@futdevpro/ccap 1.1.2403 → 1.1.2413

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 (201) hide show
  1. package/client-dist/{agent-instances.module-A2ZUQC4D.js → agent-instances.module-YQRJGTR4.js} +2 -2
  2. package/client-dist/{ca.module-LCOTOYZS.js → ca.module-MUMV7A2C.js} +2 -2
  3. package/client-dist/cc.module-ILITAOXA.js +4 -0
  4. package/client-dist/cc.module-ILITAOXA.js.map +7 -0
  5. package/client-dist/{chunk-Q2LOKNTG.js → chunk-2S5IB4QA.js} +2 -2
  6. package/client-dist/{chunk-L3PDYXCS.js → chunk-2WCP5YOD.js} +2 -2
  7. package/client-dist/{chunk-UPWIIVQ6.js → chunk-3PN6I6TV.js} +2 -2
  8. package/client-dist/{chunk-QR3HYUNS.js → chunk-4EX42M46.js} +2 -2
  9. package/client-dist/{chunk-VRJJFYHZ.js → chunk-5BRWVAXE.js} +2 -2
  10. package/client-dist/{chunk-VC2WZEJW.js → chunk-5CFFPWO2.js} +2 -2
  11. package/client-dist/{chunk-2ANUGZLV.js → chunk-5L4RCJNJ.js} +2 -2
  12. package/client-dist/{chunk-4QMG7L3K.js → chunk-6AOMQLRI.js} +22 -22
  13. package/client-dist/{chunk-4QMG7L3K.js.map → chunk-6AOMQLRI.js.map} +1 -1
  14. package/client-dist/chunk-6QERLAGJ.js +3 -0
  15. package/client-dist/{chunk-2WIMZNS4.js.map → chunk-6QERLAGJ.js.map} +4 -4
  16. package/client-dist/{chunk-7SKYHNYQ.js → chunk-6SOTIADM.js} +2 -2
  17. package/client-dist/{chunk-ULHGCRZF.js → chunk-7N5CG2ZE.js} +2 -2
  18. package/client-dist/{chunk-HGKIQDDN.js → chunk-AU324OLU.js} +2 -2
  19. package/client-dist/{chunk-6EYSPF43.js → chunk-C7XPBJTG.js} +2 -2
  20. package/client-dist/{chunk-6EYSPF43.js.map → chunk-C7XPBJTG.js.map} +2 -2
  21. package/client-dist/{chunk-6TQLCMPS.js → chunk-CHUAQGNK.js} +2 -2
  22. package/client-dist/{chunk-LXLZTYDV.js → chunk-D5X44E36.js} +2 -2
  23. package/client-dist/{chunk-ZTG2B752.js → chunk-DE4K2EAW.js} +2 -2
  24. package/client-dist/{chunk-VJR3HZ3G.js → chunk-E5EJS23Q.js} +2 -2
  25. package/client-dist/{chunk-3J24BPVB.js → chunk-EPYGDZY6.js} +2 -2
  26. package/client-dist/{chunk-MJHVFZNJ.js → chunk-ETVRRKCG.js} +2 -2
  27. package/client-dist/{chunk-T6DWWQQO.js → chunk-EVEAADTX.js} +2 -2
  28. package/client-dist/{chunk-ZPPMC73W.js → chunk-F22COZKI.js} +2 -2
  29. package/client-dist/{chunk-CXJU7YRU.js → chunk-G27M7NME.js} +2 -2
  30. package/client-dist/{chunk-7GGP7THR.js → chunk-GEKIGTIO.js} +2 -2
  31. package/client-dist/{chunk-4IU43FSF.js → chunk-HW6OU554.js} +2 -2
  32. package/client-dist/{chunk-XG3ULHDY.js → chunk-JDWJPZDR.js} +2 -2
  33. package/client-dist/{chunk-4FPJBDX3.js → chunk-JJY7WMZC.js} +2 -2
  34. package/client-dist/{chunk-GCBCHT45.js → chunk-JY4JXOKV.js} +2 -2
  35. package/client-dist/{chunk-NBYYHCJY.js → chunk-K2VUINMT.js} +2 -2
  36. package/client-dist/{chunk-2XTCHCAU.js → chunk-K7KBQUZW.js} +2 -2
  37. package/client-dist/{chunk-LYNJHJHR.js → chunk-LMU4ZKEX.js} +2 -2
  38. package/client-dist/{chunk-EJK7DYOT.js → chunk-M52V4EZF.js} +2 -2
  39. package/client-dist/{chunk-WWBFRXUC.js → chunk-MA6KRNHC.js} +2 -2
  40. package/client-dist/{chunk-6BO4RGTF.js → chunk-MML2K2XK.js} +2 -2
  41. package/client-dist/{chunk-R5JJ4NXA.js → chunk-MROTHM6K.js} +2 -2
  42. package/client-dist/{chunk-T3QPQMWE.js → chunk-MYOVGFG6.js} +2 -2
  43. package/client-dist/{chunk-USSOB2ST.js → chunk-NA5QSJDM.js} +2 -2
  44. package/client-dist/{chunk-KMZABECD.js → chunk-NWK6WEAF.js} +2 -2
  45. package/client-dist/{chunk-D2JXXPA3.js → chunk-NYGULTZO.js} +2 -2
  46. package/client-dist/{chunk-BWHF5I73.js → chunk-OWQLFZIF.js} +2 -2
  47. package/client-dist/{chunk-GLADIICK.js → chunk-P7QASRBG.js} +2 -2
  48. package/client-dist/{chunk-GLADIICK.js.map → chunk-P7QASRBG.js.map} +1 -1
  49. package/client-dist/{chunk-6PT2MZ74.js → chunk-POAGKZ5J.js} +2 -2
  50. package/client-dist/{chunk-KAS4KL5H.js → chunk-Q5LOC2YB.js} +2 -2
  51. package/client-dist/{chunk-HDQB2FFA.js → chunk-QMS2JX2O.js} +2 -2
  52. package/client-dist/{chunk-VUPHBESM.js → chunk-S2WTIGEZ.js} +2 -2
  53. package/client-dist/{chunk-BE63JRDK.js → chunk-SD2IYFWL.js} +2 -2
  54. package/client-dist/{chunk-LWUPRATP.js → chunk-SLWCZIOD.js} +2 -2
  55. package/client-dist/{chunk-N6HZQAGL.js → chunk-TTOO5THB.js} +2 -2
  56. package/client-dist/{chunk-3LJYOX46.js → chunk-TUEKZYSI.js} +2 -2
  57. package/client-dist/{chunk-XPUEDVEA.js → chunk-U4CWC5HD.js} +2 -2
  58. package/client-dist/{chunk-MISCMKZP.js → chunk-UM5OHOCG.js} +2 -2
  59. package/client-dist/{chunk-ISY352NI.js → chunk-WKFFHHVN.js} +2 -2
  60. package/client-dist/{chunk-TDTESSW2.js → chunk-WTHNZJTR.js} +2 -2
  61. package/client-dist/{chunk-4OROAMCK.js → chunk-WZRWVN75.js} +2 -2
  62. package/client-dist/{chunk-BS6NS62C.js → chunk-XBPBZNCD.js} +2 -2
  63. package/client-dist/{chunk-FX7QVSB2.js → chunk-YVSKIQO6.js} +2 -2
  64. package/client-dist/{chunk-URM2RHFX.js → chunk-Z4QHQKDL.js} +2 -2
  65. package/client-dist/{chunk-ICJ34KOC.js → chunk-Z7JJKQPF.js} +2 -2
  66. package/client-dist/{consultant.module-QZ2ZSGVT.js → consultant.module-H3VU5FVZ.js} +2 -2
  67. package/client-dist/{crd.module-QXWKVYQA.js → crd.module-EP7XTSJ6.js} +2 -2
  68. package/client-dist/{dashboard.module-VMO6DNGU.js → dashboard.module-N5SBIINI.js} +2 -2
  69. package/client-dist/{do.module-MEKI67XV.js → do.module-ETTDW2US.js} +2 -2
  70. package/client-dist/{document-library.module-WTVKD4YU.js → document-library.module-BVQQRHPG.js} +2 -2
  71. package/client-dist/{embedding-eval.module-PLYAYGF2.js → embedding-eval.module-N5DXPMKB.js} +2 -2
  72. package/client-dist/{embedding-registry.module-4HXKVG27.js → embedding-registry.module-NSNGFKNG.js} +2 -2
  73. package/client-dist/{err.module-3JS2XT7W.js → err.module-QKPQFJ3C.js} +2 -2
  74. package/client-dist/{feedback.module-SFHES7MB.js → feedback.module-GOUMFPA7.js} +2 -2
  75. package/client-dist/{host-runtime-mcp.module-SDW7ZVPN.js → host-runtime-mcp.module-EVY6KMIH.js} +2 -2
  76. package/client-dist/index.html +2 -2
  77. package/client-dist/{live-dev-pipeline.module-PZKHWCO7.js → live-dev-pipeline.module-VKJDUXBT.js} +2 -2
  78. package/client-dist/{logs.module-SGSLBVCW.js → logs.module-YEC65J7A.js} +2 -2
  79. package/client-dist/{main-LU2I2R35.js → main-TNSQOLNS.js} +3 -3
  80. package/client-dist/{master-control-remote-poc.module-6VPAKQUQ.js → master-control-remote-poc.module-5JRQ5P6U.js} +2 -2
  81. package/client-dist/{mobile-app.module-EREJO2WC.js → mobile-app.module-R7SUNQ5R.js} +2 -2
  82. package/client-dist/{model-registry.module-7IGKIWLN.js → model-registry.module-EIJG3NIU.js} +2 -2
  83. package/client-dist/{oc.module-CT4XLVCX.js → oc.module-AECCCX4K.js} +2 -2
  84. package/client-dist/{orc.module-WJBCFXB3.js → orc.module-FQDMQS2P.js} +2 -2
  85. package/client-dist/{project-management.module-UDRPUGVK.js → project-management.module-6WIQQ6QA.js} +2 -2
  86. package/client-dist/project-source-routed.module-ODQJIY2I.js +2 -0
  87. package/client-dist/{scheduler.module-LIOP3COI.js → scheduler.module-4RS6V6IT.js} +2 -2
  88. package/client-dist/session.module-IHYJAR5P.js +12 -0
  89. package/client-dist/session.module-IHYJAR5P.js.map +7 -0
  90. package/client-dist/{set.module-QYL53JEQ.js → set.module-E2N5N5ST.js} +2 -2
  91. package/client-dist/{setup.module-TGTJ6IZV.js → setup.module-MGHZKKD2.js} +2 -2
  92. package/client-dist/styles-IPQY7PNR.css +2 -0
  93. package/client-dist/styles-IPQY7PNR.css.map +7 -0
  94. package/client-dist/{terminals.module-CKXLHM76.js → terminals.module-2F544UZE.js} +2 -2
  95. package/client-dist/{voice-notes-poc.module-L4XPDMU3.js → voice-notes-poc.module-ESWLZBHU.js} +2 -2
  96. package/client-dist/{wfs.module-DGP3CKHF.js → wfs.module-XLHY3PP3.js} +2 -2
  97. package/package.json +1 -1
  98. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-adapter.control-service.d.ts.map +1 -1
  99. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-adapter.control-service.js +8 -17
  100. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-adapter.control-service.js.map +1 -1
  101. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-output.control-service.d.ts +4 -0
  102. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-output.control-service.d.ts.map +1 -1
  103. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-output.control-service.js +17 -3
  104. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-output.control-service.js.map +1 -1
  105. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.d.ts +20 -0
  106. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.d.ts.map +1 -1
  107. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.js +44 -0
  108. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.js.map +1 -1
  109. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.spec.d.ts +8 -0
  110. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.spec.d.ts.map +1 -0
  111. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.spec.js +45 -0
  112. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.spec.js.map +1 -0
  113. package/client-dist/cc.module-JNBWNLXT.js +0 -4
  114. package/client-dist/cc.module-JNBWNLXT.js.map +0 -7
  115. package/client-dist/chunk-2WIMZNS4.js +0 -2
  116. package/client-dist/project-source-routed.module-MPNN6Y7L.js +0 -2
  117. package/client-dist/session.module-IOUXNQQL.js +0 -13
  118. package/client-dist/session.module-IOUXNQQL.js.map +0 -7
  119. package/client-dist/styles-GRAX54DU.css +0 -2
  120. package/client-dist/styles-GRAX54DU.css.map +0 -7
  121. /package/client-dist/{agent-instances.module-A2ZUQC4D.js.map → agent-instances.module-YQRJGTR4.js.map} +0 -0
  122. /package/client-dist/{ca.module-LCOTOYZS.js.map → ca.module-MUMV7A2C.js.map} +0 -0
  123. /package/client-dist/{chunk-Q2LOKNTG.js.map → chunk-2S5IB4QA.js.map} +0 -0
  124. /package/client-dist/{chunk-L3PDYXCS.js.map → chunk-2WCP5YOD.js.map} +0 -0
  125. /package/client-dist/{chunk-UPWIIVQ6.js.map → chunk-3PN6I6TV.js.map} +0 -0
  126. /package/client-dist/{chunk-QR3HYUNS.js.map → chunk-4EX42M46.js.map} +0 -0
  127. /package/client-dist/{chunk-VRJJFYHZ.js.map → chunk-5BRWVAXE.js.map} +0 -0
  128. /package/client-dist/{chunk-VC2WZEJW.js.map → chunk-5CFFPWO2.js.map} +0 -0
  129. /package/client-dist/{chunk-2ANUGZLV.js.map → chunk-5L4RCJNJ.js.map} +0 -0
  130. /package/client-dist/{chunk-7SKYHNYQ.js.map → chunk-6SOTIADM.js.map} +0 -0
  131. /package/client-dist/{chunk-ULHGCRZF.js.map → chunk-7N5CG2ZE.js.map} +0 -0
  132. /package/client-dist/{chunk-HGKIQDDN.js.map → chunk-AU324OLU.js.map} +0 -0
  133. /package/client-dist/{chunk-6TQLCMPS.js.map → chunk-CHUAQGNK.js.map} +0 -0
  134. /package/client-dist/{chunk-LXLZTYDV.js.map → chunk-D5X44E36.js.map} +0 -0
  135. /package/client-dist/{chunk-ZTG2B752.js.map → chunk-DE4K2EAW.js.map} +0 -0
  136. /package/client-dist/{chunk-VJR3HZ3G.js.map → chunk-E5EJS23Q.js.map} +0 -0
  137. /package/client-dist/{chunk-3J24BPVB.js.map → chunk-EPYGDZY6.js.map} +0 -0
  138. /package/client-dist/{chunk-MJHVFZNJ.js.map → chunk-ETVRRKCG.js.map} +0 -0
  139. /package/client-dist/{chunk-T6DWWQQO.js.map → chunk-EVEAADTX.js.map} +0 -0
  140. /package/client-dist/{chunk-ZPPMC73W.js.map → chunk-F22COZKI.js.map} +0 -0
  141. /package/client-dist/{chunk-CXJU7YRU.js.map → chunk-G27M7NME.js.map} +0 -0
  142. /package/client-dist/{chunk-7GGP7THR.js.map → chunk-GEKIGTIO.js.map} +0 -0
  143. /package/client-dist/{chunk-4IU43FSF.js.map → chunk-HW6OU554.js.map} +0 -0
  144. /package/client-dist/{chunk-XG3ULHDY.js.map → chunk-JDWJPZDR.js.map} +0 -0
  145. /package/client-dist/{chunk-4FPJBDX3.js.map → chunk-JJY7WMZC.js.map} +0 -0
  146. /package/client-dist/{chunk-GCBCHT45.js.map → chunk-JY4JXOKV.js.map} +0 -0
  147. /package/client-dist/{chunk-NBYYHCJY.js.map → chunk-K2VUINMT.js.map} +0 -0
  148. /package/client-dist/{chunk-2XTCHCAU.js.map → chunk-K7KBQUZW.js.map} +0 -0
  149. /package/client-dist/{chunk-LYNJHJHR.js.map → chunk-LMU4ZKEX.js.map} +0 -0
  150. /package/client-dist/{chunk-EJK7DYOT.js.map → chunk-M52V4EZF.js.map} +0 -0
  151. /package/client-dist/{chunk-WWBFRXUC.js.map → chunk-MA6KRNHC.js.map} +0 -0
  152. /package/client-dist/{chunk-6BO4RGTF.js.map → chunk-MML2K2XK.js.map} +0 -0
  153. /package/client-dist/{chunk-R5JJ4NXA.js.map → chunk-MROTHM6K.js.map} +0 -0
  154. /package/client-dist/{chunk-T3QPQMWE.js.map → chunk-MYOVGFG6.js.map} +0 -0
  155. /package/client-dist/{chunk-USSOB2ST.js.map → chunk-NA5QSJDM.js.map} +0 -0
  156. /package/client-dist/{chunk-KMZABECD.js.map → chunk-NWK6WEAF.js.map} +0 -0
  157. /package/client-dist/{chunk-D2JXXPA3.js.map → chunk-NYGULTZO.js.map} +0 -0
  158. /package/client-dist/{chunk-BWHF5I73.js.map → chunk-OWQLFZIF.js.map} +0 -0
  159. /package/client-dist/{chunk-6PT2MZ74.js.map → chunk-POAGKZ5J.js.map} +0 -0
  160. /package/client-dist/{chunk-KAS4KL5H.js.map → chunk-Q5LOC2YB.js.map} +0 -0
  161. /package/client-dist/{chunk-HDQB2FFA.js.map → chunk-QMS2JX2O.js.map} +0 -0
  162. /package/client-dist/{chunk-VUPHBESM.js.map → chunk-S2WTIGEZ.js.map} +0 -0
  163. /package/client-dist/{chunk-BE63JRDK.js.map → chunk-SD2IYFWL.js.map} +0 -0
  164. /package/client-dist/{chunk-LWUPRATP.js.map → chunk-SLWCZIOD.js.map} +0 -0
  165. /package/client-dist/{chunk-N6HZQAGL.js.map → chunk-TTOO5THB.js.map} +0 -0
  166. /package/client-dist/{chunk-3LJYOX46.js.map → chunk-TUEKZYSI.js.map} +0 -0
  167. /package/client-dist/{chunk-XPUEDVEA.js.map → chunk-U4CWC5HD.js.map} +0 -0
  168. /package/client-dist/{chunk-MISCMKZP.js.map → chunk-UM5OHOCG.js.map} +0 -0
  169. /package/client-dist/{chunk-ISY352NI.js.map → chunk-WKFFHHVN.js.map} +0 -0
  170. /package/client-dist/{chunk-TDTESSW2.js.map → chunk-WTHNZJTR.js.map} +0 -0
  171. /package/client-dist/{chunk-4OROAMCK.js.map → chunk-WZRWVN75.js.map} +0 -0
  172. /package/client-dist/{chunk-BS6NS62C.js.map → chunk-XBPBZNCD.js.map} +0 -0
  173. /package/client-dist/{chunk-FX7QVSB2.js.map → chunk-YVSKIQO6.js.map} +0 -0
  174. /package/client-dist/{chunk-URM2RHFX.js.map → chunk-Z4QHQKDL.js.map} +0 -0
  175. /package/client-dist/{chunk-ICJ34KOC.js.map → chunk-Z7JJKQPF.js.map} +0 -0
  176. /package/client-dist/{consultant.module-QZ2ZSGVT.js.map → consultant.module-H3VU5FVZ.js.map} +0 -0
  177. /package/client-dist/{crd.module-QXWKVYQA.js.map → crd.module-EP7XTSJ6.js.map} +0 -0
  178. /package/client-dist/{dashboard.module-VMO6DNGU.js.map → dashboard.module-N5SBIINI.js.map} +0 -0
  179. /package/client-dist/{do.module-MEKI67XV.js.map → do.module-ETTDW2US.js.map} +0 -0
  180. /package/client-dist/{document-library.module-WTVKD4YU.js.map → document-library.module-BVQQRHPG.js.map} +0 -0
  181. /package/client-dist/{embedding-eval.module-PLYAYGF2.js.map → embedding-eval.module-N5DXPMKB.js.map} +0 -0
  182. /package/client-dist/{embedding-registry.module-4HXKVG27.js.map → embedding-registry.module-NSNGFKNG.js.map} +0 -0
  183. /package/client-dist/{err.module-3JS2XT7W.js.map → err.module-QKPQFJ3C.js.map} +0 -0
  184. /package/client-dist/{feedback.module-SFHES7MB.js.map → feedback.module-GOUMFPA7.js.map} +0 -0
  185. /package/client-dist/{host-runtime-mcp.module-SDW7ZVPN.js.map → host-runtime-mcp.module-EVY6KMIH.js.map} +0 -0
  186. /package/client-dist/{live-dev-pipeline.module-PZKHWCO7.js.map → live-dev-pipeline.module-VKJDUXBT.js.map} +0 -0
  187. /package/client-dist/{logs.module-SGSLBVCW.js.map → logs.module-YEC65J7A.js.map} +0 -0
  188. /package/client-dist/{main-LU2I2R35.js.map → main-TNSQOLNS.js.map} +0 -0
  189. /package/client-dist/{master-control-remote-poc.module-6VPAKQUQ.js.map → master-control-remote-poc.module-5JRQ5P6U.js.map} +0 -0
  190. /package/client-dist/{mobile-app.module-EREJO2WC.js.map → mobile-app.module-R7SUNQ5R.js.map} +0 -0
  191. /package/client-dist/{model-registry.module-7IGKIWLN.js.map → model-registry.module-EIJG3NIU.js.map} +0 -0
  192. /package/client-dist/{oc.module-CT4XLVCX.js.map → oc.module-AECCCX4K.js.map} +0 -0
  193. /package/client-dist/{orc.module-WJBCFXB3.js.map → orc.module-FQDMQS2P.js.map} +0 -0
  194. /package/client-dist/{project-management.module-UDRPUGVK.js.map → project-management.module-6WIQQ6QA.js.map} +0 -0
  195. /package/client-dist/{project-source-routed.module-MPNN6Y7L.js.map → project-source-routed.module-ODQJIY2I.js.map} +0 -0
  196. /package/client-dist/{scheduler.module-LIOP3COI.js.map → scheduler.module-4RS6V6IT.js.map} +0 -0
  197. /package/client-dist/{set.module-QYL53JEQ.js.map → set.module-E2N5N5ST.js.map} +0 -0
  198. /package/client-dist/{setup.module-TGTJ6IZV.js.map → setup.module-MGHZKKD2.js.map} +0 -0
  199. /package/client-dist/{terminals.module-CKXLHM76.js.map → terminals.module-2F544UZE.js.map} +0 -0
  200. /package/client-dist/{voice-notes-poc.module-L4XPDMU3.js.map → voice-notes-poc.module-ESWLZBHU.js.map} +0 -0
  201. /package/client-dist/{wfs.module-DGP3CKHF.js.map → wfs.module-XLHY3PP3.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- import{c as Ce}from"./chunk-QR3HYUNS.js";import{b as Ye}from"./chunk-COVCHZOZ.js";import{a as v}from"./chunk-UFBTR2BG.js";import{g as Be,h as Fe}from"./chunk-4QMG7L3K.js";import{I as Ve}from"./chunk-GLADIICK.js";import{Aa as Oe,Ba as Re,C as Z,D as ae,Fa as m,Ga as L,Ha as _e,Ia as ze,J as R,K as z,L as H,M as ye,P as Pe,T as ne,Ta as le,U as F,Z as u,a as I,aa as V,b as w,da as D,fa as Y,ga as me,hb as g,ja as se,jb as Se,k as ke,la as S,oa as Le,p as be,pa as we,qa as p,ra as d,sa as W,ua as ie,ub as de,va as B,wa as C,xb as He,y as xe,za as Ge}from"./chunk-TBMJSIBB.js";var ve=class i{static getEmoji(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"?"\u{1F680}":t==="run-flow-complete"?"\u{1F3AF}":t==="tool-error-retry"?"\u26A0\uFE0F\u{1F9E0}":t.includes("tool-error")||t.includes("error-recovery")?"\u{1F527}\u274C":t.includes("agentic-loop-iteration")?"":o.eventType==="tool-call"||typeof e.toolId=="string"?"\u{1F527}":o.eventType==="llm-call"||typeof e.callType=="string"?"\u{1F9E0}":o.eventType==="error"?"\u26A0\uFE0F":""}static getBubbleClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-500/10 text-green-300 border border-green-500/50":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-500/10 text-orange-300 border border-orange-500/50":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-500/10 text-red-300 border border-red-500/50":t.includes("agentic-loop")?"bg-blue-500/10 text-blue-300 border border-blue-500/50":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-500/10 text-yellow-300 border border-yellow-500/50":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-500/10 text-purple-300 border border-purple-500/50":"bg-neutral-700 text-neutral-200 border border-neonCyan"}static getStepLabel(o){let e=o.data??{},t=e.step,n=e.toolId;if(typeof t=="string"&&t.length>0)return i.formatStepId(t);if(o.eventType==="tool-call"&&typeof n=="string"&&n.length>0)return`Eszk\xF6z: ${n}`;if(o.eventType==="llm-call"){let r=e.callType;return typeof r=="string"?`LLM: ${i.formatStepId(r)}`:"LLM h\xEDv\xE1s"}if(o.eventType==="error"){let r=e.message;return typeof r=="string"&&r.length>0?`Hiba: ${r.substring(0,40)}${r.length>40?"\u2026":""}`:"Hiba"}return o.eventType==="compacting"?typeof t=="string"&&t.length>0?i.formatStepId(t):"Compacting":i.formatEventTypeFallback(o.eventType)}static formatStepId(o){return o.split("-").map(e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e).join(" ")}static getDotClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-400":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-400":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-400":t.includes("agentic-loop")?"bg-blue-400":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-400":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-400":"bg-neutral-400"}static formatEventTypeFallback(o){return{step:"L\xE9p\xE9s","tool-call":"Eszk\xF6zh\xEDv\xE1s","context-update":"Kontextus friss\xEDt\xE9s",compacting:"Compacting","llm-call":"LLM h\xEDv\xE1s","session-event":"Session event",error:"Hiba"}[o]??o}};var x=function(i){return i.pending="pending",i.active="active",i.completed="completed",i.error="error",i}(x||{});var tt={[v.runInitialization]:"milestone-init",[v.analyze]:"phase-analyze",[v.analyzeResult]:"llm-analyze",[v.assemble]:"phase-assemble",[v.execution]:"phase-execution",[v.executionStart]:"phase-execution",[v.finalization]:"phase-finalization",[v.llmRunFinalization]:"llm-finalization",[v.postFinalization]:"phase-finalization",[v.runFlowComplete]:"milestone-complete"},nt=["milestone-init","phase-analyze","llm-analyze","phase-assemble","phase-execution","phase-finalization","llm-finalization","milestone-complete"],N=class i{static mapPhaseToNodeId(o){return tt[o]??null}static computeStateTransitions(o){let e=i.mapPhaseToNodeId(o);if(!e)return[];let t=[],n=!1;for(let r of nt)r===e?(t.push({nodeId:r,state:x.active}),n=!0):n||t.push({nodeId:r,state:x.completed});return t}static extractIterationData(o){let e=o.action;if(typeof e!="string")return null;let t=o.tool,n=typeof t=="string"?t:"",r=o.intent,s=typeof r=="string"?r:"",a=o.iterationCount;return{actionType:e,tool:n,intent:s,iterationIndex:typeof a=="number"?a:0}}static mapMonitoringEventToIterationNodeId(o,e){let t=o.data??{},n=t.step,r=typeof n=="string"?n:"",s=`iter-${e}`;if(o.eventType==="llm-call"){let a=t.callType;if(a==="agentic-loop")return`${s}-llm-decision`;if(a==="tool-description")return`${s}-tool-desc`;if(a==="tool-error-retry")return`${s}-tool-error-retry`;if(a==="tool-result-chunking")return`${s}-tool-chunking`;if(a==="goal-state-update")return`${s}-goal-update`}return o.eventType==="tool-call"?`${s}-tool-call`:o.eventType==="error"||r.includes("tool-error")?`${s}-tool-call`:null}static isTerminalPhase(o){return o===v.runFlowComplete}static SKELETON_LLM_NODE_MAP={analyze:"llm-analyze","run-finalization":"llm-finalization"};static LLM_CALL_PHASE_MAP={analyze:"phase-analyze","subanalyze-run-tasks":"phase-analyze","instant-reply":"phase-execution","run-finalization":"phase-finalization","chat-history-compacting":"phase-execution","execution-history-compacting":"phase-execution","soul-compacting":"phase-execution","context-compacting":"phase-execution","message-interceptor":"phase-execution"};static ITERATION_LLM_CALL_TYPES=new Set(["agentic-loop","tool-description","tool-error-retry","tool-result-chunking","goal-state-update"]);static LLM_CALL_LABEL_MAP={analyze:"LLM: Analyze","subanalyze-run-tasks":"LLM: Subanalyze","instant-reply":"LLM: Instant Reply","agentic-loop":"LLM Decision","tool-description":"Tool Description","tool-error-retry":"LLM: Error Retry","run-finalization":"LLM: Summary","chat-history-compacting":"LLM: Compact Chat","execution-history-compacting":"LLM: Compact Exec","soul-compacting":"LLM: Compact Soul","context-compacting":"LLM: Compact Ctx","tool-result-chunking":"LLM: Chunking","goal-state-update":"LLM: Goal Update","message-interceptor":"LLM: Msg Intercept"};static getPreCreatedSkeletonNodeId(o){return i.SKELETON_LLM_NODE_MAP[o]??null}static getLlmCallPhaseId(o){return i.LLM_CALL_PHASE_MAP[o]??null}static isIterationLlmCall(o){return i.ITERATION_LLM_CALL_TYPES.has(o)}static getLlmCallLabel(o){return i.LLM_CALL_LABEL_MAP[o]??`LLM: ${o}`}};var k=function(i){return i.sequential="sequential",i.loopEntry="loop-entry",i.errorRetry="error-retry",i}(k||{});var f=function(i){return i.phase="phase",i.milestone="milestone",i.llmCall="llm-call",i.toolCall="tool-call",i.toolError="tool-error",i.loopIteration="loop-iteration",i.action="action",i.error="error",i}(f||{});var je="milestone-init",Ee="phase-analyze",it="llm-analyze",Me="phase-assemble",ee="phase-execution",he="phase-finalization",Ae="llm-finalization",De="milestone-complete",P=class i{static buildSkeletonLayout(){let o=48+220/2,e=48,t=[],n=[],r=i.createNode({id:je,category:f.milestone,label:"Initialization",phase:v.runInitialization,x:o-200/2,y:e,width:200,height:48});t.push(r),e+=84;let s=i.createNode({id:Ee,category:f.phase,label:"Analyze",phase:v.analyze,x:o-220/2,y:e,width:220,height:60});t.push(s);let a=i.createNode({id:it,category:f.llmCall,label:"LLM: Analyze",phase:v.analyzeResult,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:Ee});t.push(a),n.push(i.createEdge(je,Ee,k.sequential)),e+=96;let h=i.createNode({id:Me,category:f.phase,label:"Assemble",phase:v.assemble,x:o-220/2,y:e,width:220,height:60});t.push(h),n.push(i.createEdge(Ee,Me,k.sequential)),e+=96;let l=i.createNode({id:ee,category:f.phase,label:"Execution",phase:v.execution,x:o-220/2,y:e,width:220,height:60});t.push(l),n.push(i.createEdge(Me,ee,k.sequential)),e+=96;let c=i.createNode({id:he,category:f.phase,label:"Finalization",phase:v.finalization,x:o-220/2,y:e,width:220,height:60});t.push(c);let _=i.createNode({id:Ae,category:f.llmCall,label:"LLM: Summary",phase:v.llmRunFinalization,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:he});t.push(_),n.push(i.createEdge(ee,he,k.sequential)),e+=96;let y=i.createNode({id:De,category:f.milestone,label:"Flow Complete",phase:v.runFlowComplete,x:o-200/2,y:e,width:200,height:48});t.push(y),n.push(i.createEdge(he,De,k.sequential));let T=i.recalculateViewBox(t,48);return{nodes:t,edges:n,viewBox:T,loopContainerBounds:null}}static addIterationColumn(o,e,t,n){let r=o.nodes.map(b=>I({},b)),s=[...o.edges],a=r.find(b=>b.id===ee);if(!a)return o;let h=a.x+20+e*208,l=a.y+60+20,c=`iter-${e}`,_=l,y=[],T=i.createNode({id:`${c}-llm-decision`,category:f.llmCall,label:"LLM Decision",phase:v.llmAgenticLoop,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(T),_+=68;let M=i.formatActionLabel(t),O=i.createNode({id:`${c}-action`,category:f.action,label:M,phase:v.agenticLoopIteration,x:h+20/2,y:_,width:140,height:32,parentId:ee,iterationIndex:e,data:n});if(y.push(O),_+=56,t==="tool-select"){let b=i.createNode({id:`${c}-tool-desc`,category:f.llmCall,label:"Tool Description",phase:v.llmToolDescription,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(b),_+=68;let q=n.tool,Q=typeof q=="string"?q:"tool",te=i.createNode({id:`${c}-tool-call`,category:f.toolCall,label:Q,phase:null,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e,data:n});y.push(te),_+=68}for(let b=0;b<y.length-1;b++)s.push(i.createEdge(y[b].id,y[b+1].id,k.sequential));r.push(...y);let E=20*2+(e+1)*180+e*28,j=60+20*2+(_-l);a.width=Math.max(a.width,E),a.height=Math.max(a.height,j);let K=a.y+a.height,A=[he,Ae,De],ue=K+36;for(let b of A){let q=r.find(Q=>Q.id===b);if(q){if(b===Ae){let Q=r.find(te=>te.id===he);Q&&(q.y=Q.y+16/2);continue}q.y=ue,ue+=q.height+36}}let ge={x:a.x,y:a.y+60,width:a.width,height:a.height-60},J=r,Je=s.map(b=>{let q=J.find(te=>te.id===b.sourceNodeId),Q=J.find(te=>te.id===b.targetNodeId);return!q||!Q?b:w(I({},b),{pathD:i.computeEdgePath(q,Q,b.category)})}),et=i.recalculateViewBox(J,48);return{nodes:J,edges:Je,viewBox:et,loopContainerBounds:ge}}static computeEdgePath(o,e,t){let n=o.x+o.width/2,r=o.y+o.height,s=e.x+e.width/2,a=e.y;if(Math.abs(n-s)<20)return`M ${n} ${r} L ${s} ${a}`;let h=o.x+o.width,l=o.y+o.height/2,c=e.x,_=e.y+e.height/2;if(e.parentId===o.id)return`M ${h} ${l} L ${c} ${_}`;let y=r+(a-r)/2;return`M ${n} ${r} L ${n} ${y} L ${s} ${y} L ${s} ${a}`}static recalculateViewBox(o,e){if(o.length===0)return{x:0,y:0,width:600,height:400};let t=1/0,n=1/0,r=-1/0,s=-1/0;for(let a of o)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),s=Math.max(s,a.y+a.height);return{x:t-e,y:n-e,width:r-t+e*2,height:s-n+e*2}}static addDynamicLlmNode(o,e,t,n,r,s){let a=o.nodes.map(A=>I({},A)),h=[...o.edges],l=a.find(A=>A.id===e);if(!l)return o;let c,_;l.category===f.phase||l.category===f.milestone?(c=l.x+l.width+28,_=l.y+(l.height-44)/2):(c=l.x,_=l.y+l.height+24);let T=i.createNode({id:t,category:f.llmCall,label:n,phase:null,x:c,y:_,width:160,height:44,parentId:r,iterationIndex:s??void 0});a.push(T),h.push(i.createEdge(e,t,k.sequential));let M=T.y+T.height;s!=null?i.expandExecutionContainer(a,M):i.shiftDownstreamIfOverlap(a,r,M);let O=o.loopContainerBounds,E=a.find(A=>A.id==="phase-execution");E&&E.height>60&&(O={x:E.x,y:E.y+60,width:E.width,height:E.height-60});let j=h.map(A=>{let ue=a.find(J=>J.id===A.sourceNodeId),ge=a.find(J=>J.id===A.targetNodeId);return!ue||!ge?A:w(I({},A),{pathD:i.computeEdgePath(ue,ge,A.category)})}),K=i.recalculateViewBox(a,48);return{nodes:a,edges:j,viewBox:K,loopContainerBounds:O}}static expandExecutionContainer(o,e){let t=o.find(l=>l.id==="phase-execution");if(!t)return;let n=t.y+60+20,r=60+20*2+(e+24-n);if(r<=t.height)return;t.height=r;let s=t.y+t.height,a=["phase-finalization","llm-finalization","milestone-complete"],h=s+36;for(let l of a){let c=o.find(_=>_.id===l);if(c){if(l==="llm-finalization"){let _=o.find(y=>y.id==="phase-finalization");_&&(c.y=_.y+16/2);continue}c.y<h&&(c.y=h),h=c.y+c.height+36}}for(let l of o)if(l.parentId==="phase-finalization"&&l.id!=="llm-finalization"&&l.category===f.llmCall){let c=o.find(_=>_.id==="phase-finalization");c&&(l.y=Math.max(l.y,c.y))}}static shiftDownstreamIfOverlap(o,e,t){let n=["milestone-init","phase-analyze","phase-assemble","phase-execution","phase-finalization","milestone-complete"],r=n.indexOf(e);if(r<0||r>=n.length-1)return;let s=n[r+1],a=o.find(_=>_.id===s);if(!a||t+36<=a.y)return;let h=t+36-a.y,l=new Set;for(let _ of o)_.parentId===e&&_.category===f.llmCall&&l.add(_.id);let c=a.y;for(let _ of o)_.y>=c&&!l.has(_.id)&&(_.y+=h)}static createNode(o){return{id:o.id,category:o.category,state:x.pending,label:o.label,phase:o.phase,x:o.x,y:o.y,width:o.width,height:o.height,data:o.data??{},iterationIndex:o.iterationIndex??null,parentId:o.parentId??null,monitoringEvent:null}}static createEdge(o,e,t){let n=t===k.errorRetry?"#f97316":t===k.loopEntry?"#3b82f6":"#525252",r=t===k.loopEntry?"8 4":t===k.errorRetry?"6 3":"none",s=t===k.errorRetry?"url(#ses-arrow-error)":t===k.loopEntry?"url(#ses-arrow-loop)":"url(#ses-arrow-seq)";return{id:`edge-${o}-${e}`,category:t,sourceNodeId:o,targetNodeId:e,pathD:"",strokeColor:n,strokeDashArray:r,markerEnd:s}}static formatActionLabel(o){return{"tool-select":"Tool Select","tool-group-open":"Tool Group","context-handling":"Context","loop-debrief":"Debrief",result:"Result"}[o]??o}};var qe=(()=>{class i{baseUrl=`${Ve.api.baseUrl}/session`;http=Z(He);getEvents(e){let t=encodeURIComponent(e.trim());return be(this.http.get(`${this.baseUrl}/${t}/events`))}getRunTrace(e){let t=e.sessionId.trim(),n=encodeURIComponent(e.runId.trim());return be(this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/runs/${n}/trace`))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ze=(()=>{class i{session_DS=Z(Ce);monitoring_AS=Z(qe);destroyRef=Z(Pe);graphLayout_$=V(null);activeNodeId_$=V("");selectedNodeId_$=V("");isLive_$=V(!1);isGraphOpen_$=V(!1);graphSessionId_$=V("");graphRunId_$=V("");isLoading_$=V(!1);currentIterationIndex=-1;monitoringSubscription=null;lastAppliedPhase="";phaseRightColumnLast={};iterationColumnLast={};dynamicNodeCounter=0;constructor(){Se(()=>{let e=this.session_DS.agentEvents_$();!this.isGraphOpen_$()||!this.isLive_$()||this.applyAgentEvent(e)},{allowSignalWrites:!0}),this.destroyRef.onDestroy(()=>{this.disposeSubscriptions()})}openGraphForRun(e,t,n){this.disposeSubscriptions(),this.resetState(),this.graphSessionId_$.set(e),this.graphRunId_$.set(t),this.isLive_$.set(n),this.isGraphOpen_$.set(!0),n?this.initLiveGraph():this.loadHistoricalGraph(e,t)}closeGraph(){this.disposeSubscriptions(),this.isGraphOpen_$.set(!1),this.selectedNodeId_$.set("")}selectNode(e){let t=this.selectedNodeId_$();this.selectedNodeId_$.set(t===e?"":e)}clearSelection(){this.selectedNodeId_$.set("")}initLiveGraph(){let e=P.buildSkeletonLayout(),t=this.recalculateEdgePaths(e);this.graphLayout_$.set(t),this.phaseRightColumnLast={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},this.iterationColumnLast={},this.monitoringSubscription=this.session_DS.monitoringEvent_S.subscribe(n=>{n.sessionId===this.graphSessionId_$()&&this.applyMonitoringEvent(n.event)})}applyAgentEvent(e){let t=e.phase;if(typeof t!="string"||t.length===0||t===this.lastAppliedPhase)return;if(this.lastAppliedPhase=t,t===v.agenticLoopIteration){let r=N.extractIterationData(e);r&&this.addIteration(r);return}let n=N.computeStateTransitions(t);n.length!==0&&(this.applyStateTransitions(n),N.isTerminalPhase(t)&&this.markAllIterationNodesCompleted())}addIteration(e){let t=this.graphLayout_$();if(!t)return;this.currentIterationIndex=e.iterationIndex,this.markPreviousIterationCompleted(e.iterationIndex);let n=P.addIterationColumn(t,e.iterationIndex,e.actionType,{tool:e.tool,intent:e.intent}),r=e.actionType==="tool-select"?`iter-${e.iterationIndex}-tool-call`:`iter-${e.iterationIndex}-action`;this.iterationColumnLast[e.iterationIndex]=r;let s=`iter-${e.iterationIndex}-llm-decision`,a=this.setNodeState(n,s,x.active);this.activeNodeId_$.set(s),this.graphLayout_$.set(this.recalculateEdgePaths(a))}markPreviousIterationCompleted(e){if(e<=0)return;let t=this.graphLayout_$();if(!t)return;let n=`iter-${e-1}`,r=t;for(let s of t.nodes)s.id.startsWith(n)&&s.state!==x.error&&(r=this.setNodeState(r,s.id,x.completed));this.graphLayout_$.set(r)}applyMonitoringEvent(e){let t=this.graphLayout_$();if(!t)return;let n=typeof e.eventType=="string"?e.eventType:"",r=typeof e.status=="string"?e.status:"",s=i.toRecord(e.data),a=typeof e.durationMs=="number"?e.durationMs:0,h=typeof e.inputSize=="number"?e.inputSize:0,l=typeof e.outputSize=="number"?e.outputSize:0,c={eventType:n,timestamp:new Date,data:s,durationMs:a,status:r,sessionId:this.graphSessionId_$(),runId:this.graphRunId_$(),inputSize:h,outputSize:l};if(n==="llm-call"){this.handleLlmCallMonitoringEvent(c,t);return}if(this.currentIterationIndex<0)return;let _=N.mapMonitoringEventToIterationNodeId(c,this.currentIterationIndex);if(!_)return;let y=this.enrichNodeWithMonitoringEvent(t,_,c);y&&this.graphLayout_$.set(y)}handleLlmCallMonitoringEvent(e,t){let n=e.data?.callType,r=typeof n=="string"?n:"";if(!r)return;let s=N.getPreCreatedSkeletonNodeId(r);if(s){let h=this.enrichNodeWithMonitoringEvent(t,s,e);h&&this.graphLayout_$.set(h);return}if(N.isIterationLlmCall(r)&&this.currentIterationIndex>=0){let h=N.mapMonitoringEventToIterationNodeId(e,this.currentIterationIndex);if(h){if(t.nodes.findIndex(c=>c.id===h)>=0){let c=this.enrichNodeWithMonitoringEvent(t,h,e);c&&this.graphLayout_$.set(c)}else this.createDynamicIterationLlmNode(t,r,h,e);return}}let a=N.getLlmCallPhaseId(r);a&&this.createDynamicSkeletonLlmNode(t,r,a,e)}enrichNodeWithMonitoringEvent(e,t,n){let r=e.nodes.findIndex(_=>_.id===t);if(r<0)return null;let s=n.data??{},a=n.status==="error",h=n.durationMs??0,l=a?x.error:h>0?x.completed:x.active,c=[...e.nodes];return c[r]=w(I({},c[r]),{state:l,monitoringEvent:n,data:w(I(I({},c[r].data),s),{durationMs:h})}),this.activeNodeId_$.set(l===x.active?t:""),w(I({},e),{nodes:c})}createDynamicSkeletonLlmNode(e,t,n,r){this.dynamicNodeCounter++;let s=`llm-dyn-${this.dynamicNodeCounter}`,a=N.getLlmCallLabel(t),h=this.phaseRightColumnLast[n]??n,l=P.addDynamicLlmNode(e,h,s,a,n,null);this.phaseRightColumnLast[n]=s;let c=this.enrichNodeWithMonitoringEvent(l,s,r);this.graphLayout_$.set(c??l)}createDynamicIterationLlmNode(e,t,n,r){let s=N.getLlmCallLabel(t),a=this.iterationColumnLast[this.currentIterationIndex]??`iter-${this.currentIterationIndex}-action`,h=P.addDynamicLlmNode(e,a,n,s,"phase-execution",this.currentIterationIndex);this.iterationColumnLast[this.currentIterationIndex]=n;let l=this.enrichNodeWithMonitoringEvent(h,n,r);this.graphLayout_$.set(l??h)}loadHistoricalGraph(e,t){return ke(this,null,function*(){this.isLoading_$.set(!0);try{let n=yield this.monitoring_AS.getRunTrace({sessionId:e,runId:t});this.buildHistoricalGraph(n.trace)}catch{let n=P.buildSkeletonLayout();this.graphLayout_$.set(this.recalculateEdgePaths(n))}finally{this.isLoading_$.set(!1)}})}buildHistoricalGraph(e){let t=P.buildSkeletonLayout();t=this.recalculateEdgePaths(t);let n="",r=-1,s={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},a={},h=0;for(let l of e){let c=l.data??{},_=c.step,y=typeof _=="string"?_:"";if(y.length>0&&N.mapPhaseToNodeId(y)&&y!==n){n=y;let M=N.computeStateTransitions(y);for(let O of M)t=this.setNodeState(t,O.nodeId,O.state)}if(y==="agentic-loop-iteration"||y.includes("agentic-loop")){let T=c.action,M=typeof T=="string"?T:"",O=c.tool,E=typeof O=="string"?O:"";if(M.length>0){r++,t=P.addIterationColumn(t,r,M,{tool:E});let j=M==="tool-select"?`iter-${r}-tool-call`:`iter-${r}-action`;a[r]=j}}if(l.eventType==="llm-call"){let T=c.callType,M=typeof T=="string"?T:"";if(M){let O=N.getPreCreatedSkeletonNodeId(M);if(O)t=this.enrichHistoricalNode(t,O,l,c);else if(N.isIterationLlmCall(M)&&r>=0){let E=N.mapMonitoringEventToIterationNodeId(l,r);if(E)if(t.nodes.findIndex(K=>K.id===E)>=0)t=this.enrichHistoricalNode(t,E,l,c);else{let K=N.getLlmCallLabel(M),A=a[r]??`iter-${r}-action`;t=P.addDynamicLlmNode(t,A,E,K,"phase-execution",r),t=this.enrichHistoricalNode(t,E,l,c),a[r]=E}}else{let E=N.getLlmCallPhaseId(M);if(E){h++;let j=`llm-dyn-${h}`,K=N.getLlmCallLabel(M),A=s[E]??E;t=P.addDynamicLlmNode(t,A,j,K,E,null),t=this.enrichHistoricalNode(t,j,l,c),s[E]=j}}}continue}if(r>=0){let T=N.mapMonitoringEventToIterationNodeId(l,r);T&&(t=this.enrichHistoricalNode(t,T,l,c))}}if(n===v.runFlowComplete)for(let l of t.nodes)l.state===x.pending&&(t=this.setNodeState(t,l.id,x.completed));this.graphLayout_$.set(this.recalculateEdgePaths(t))}enrichHistoricalNode(e,t,n,r){let s=e.nodes.findIndex(h=>h.id===t);if(s<0)return e;let a=[...e.nodes];return a[s]=w(I({},a[s]),{state:n.status==="error"?x.error:x.completed,monitoringEvent:n,data:w(I(I({},a[s].data),r),{durationMs:n.durationMs})}),w(I({},e),{nodes:a})}applyStateTransitions(e){let t=this.graphLayout_$();if(!t)return;let n="";for(let r of e)t=this.setNodeState(t,r.nodeId,r.state),r.state===x.active&&(n=r.nodeId);this.activeNodeId_$.set(n),this.graphLayout_$.set(t)}setNodeState(e,t,n){let r=e.nodes.findIndex(a=>a.id===t);if(r<0)return e;let s=[...e.nodes];return s[r]=w(I({},s[r]),{state:n}),w(I({},e),{nodes:s})}markAllIterationNodesCompleted(){let e=this.graphLayout_$();if(!e)return;let t=e;for(let n of e.nodes)n.iterationIndex!=null&&n.state!==x.error&&(t=this.setNodeState(t,n.id,x.completed));this.graphLayout_$.set(t)}recalculateEdgePaths(e){let t=e.edges.map(n=>{let r=e.nodes.find(a=>a.id===n.sourceNodeId),s=e.nodes.find(a=>a.id===n.targetNodeId);return!r||!s?n:w(I({},n),{pathD:P.computeEdgePath(r,s,n.category)})});return w(I({},e),{edges:t})}resetState(){this.graphLayout_$.set(null),this.activeNodeId_$.set(""),this.selectedNodeId_$.set(""),this.currentIterationIndex=-1,this.lastAppliedPhase="",this.isLoading_$.set(!1),this.dynamicNodeCounter=0,this.phaseRightColumnLast={},this.iterationColumnLast={}}disposeSubscriptions(){this.monitoringSubscription&&(this.monitoringSubscription.unsubscribe(),this.monitoringSubscription=null)}static toRecord(e){return typeof e!="object"||e==null?{}:JSON.parse(JSON.stringify(e))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ot=["appSesGraphNodeSvg",""];function rt(i,o){if(i&1&&(H(),p(0,"text",1),m(1),d()),i&2){let e=C();Y("x",10)("y",e.node().height/2+1),u(),L(e.icon_$())}}function at(i,o){if(i&1&&(H(),p(0,"text",3),m(1),d()),i&2){let e=C();Y("x",e.node().width-10)("y",12)("fill",e.node().state==="error"?"#ef4444":"#22c55e"),u(),L(e.stateIcon_$())}}function st(i,o){if(i&1&&(H(),p(0,"text",4),m(1),d()),i&2){let e=C();Y("x",e.node().width-8)("y",e.node().height-8),u(),_e("",e.durationMs_$(),"ms")}}var $e=class i{node=F.required();isHighlighted=F(!1);isSelected=F(!1);nodeClicked=ne();fillColor_$=g(()=>{let o=this.node();return o.state===x.pending?"#262626":i.CATEGORY_FILL_MAP[o.category]??"#262626"});strokeColor_$=g(()=>{let o=this.node();return o.state===x.error?"#ef4444":o.state===x.pending?"#525252":i.CATEGORY_STROKE_MAP[o.category]??"#737373"});strokeDashArray_$=g(()=>this.node().state===x.pending?"6 3":"none");textColor_$=g(()=>this.node().state===x.pending?"#737373":"#e5e5e5");opacity_$=g(()=>this.node().state===x.pending?.5:1);borderRadius_$=g(()=>this.node().category===f.action?16:8);icon_$=g(()=>{let o=this.node().category;return i.CATEGORY_ICON_MAP[o]??""});stateIcon_$=g(()=>{let o=this.node().state;return o===x.completed?"\u2713":o===x.error?"\u2715":""});animationClass_$=g(()=>this.node().state===x.active||this.isHighlighted()?"ses-graph-node--active":this.isSelected()?"ses-graph-node--selected":"");durationMs_$=g(()=>this.node().data.durationMs??0);handleClick(){this.nodeClicked.emit(this.node().id)}static CATEGORY_FILL_MAP={[f.phase]:"#1a1a2e",[f.milestone]:"#052e16",[f.llmCall]:"#1e1033",[f.toolCall]:"#2e2a05",[f.toolError]:"#2e1505",[f.loopIteration]:"#0a1628",[f.action]:"#1a1a2e",[f.error]:"#2e0505"};static CATEGORY_STROKE_MAP={[f.phase]:"#525252",[f.milestone]:"#22c55e",[f.llmCall]:"#a855f7",[f.toolCall]:"#eab308",[f.toolError]:"#f97316",[f.loopIteration]:"#3b82f6",[f.action]:"#3b82f6",[f.error]:"#ef4444"};static CATEGORY_ICON_MAP={[f.milestone]:"\u26A1",[f.llmCall]:"\u{1F9E0}",[f.toolCall]:"\u{1F527}",[f.toolError]:"\u26A0\uFE0F",[f.error]:"\u274C"};static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ae({type:i,selectors:[["","appSesGraphNodeSvg",""]],inputs:{node:[1,"node"],isHighlighted:[1,"isHighlighted"],isSelected:[1,"isSelected"]},outputs:{nodeClicked:"nodeClicked"},standalone:!0,features:[le],attrs:ot,decls:7,vars:21,consts:[[2,"cursor","pointer",3,"click"],["dominant-baseline","central","text-anchor","start","font-size","14"],["dominant-baseline","central"],["text-anchor","end","dominant-baseline","central","font-size","11","font-weight","700"],["text-anchor","end","dominant-baseline","auto","fill","#737373","font-size","9"]],template:function(e,t){e&1&&(H(),p(0,"g",0),B("click",function(){return t.handleClick()}),W(1,"rect"),D(2,rt,2,3,":svg:text",1),p(3,"text",2),m(4),d(),D(5,at,2,4,":svg:text",3)(6,st,2,3,":svg:text",4),d()),e&2&&(se(t.animationClass_$()),Y("transform","translate("+t.node().x+","+t.node().y+")")("opacity",t.opacity_$()),u(),Y("width",t.node().width)("height",t.node().height)("rx",t.borderRadius_$())("fill",t.fillColor_$())("stroke",t.strokeColor_$())("stroke-width",t.isSelected()?2.5:1.5)("stroke-dasharray",t.strokeDashArray_$()),u(),S(t.icon_$()?2:-1),u(),Y("x",t.icon_$()?30:t.node().width/2)("y",t.node().height/2+1)("text-anchor",t.icon_$()?"start":"middle")("fill",t.textColor_$())("font-size",t.node().category==="phase"||t.node().category==="milestone"?14:12)("font-weight",t.node().category==="phase"||t.node().category==="milestone"?600:400),u(),L(t.node().label),u(),S(t.stateIcon_$()?5:-1),u(),S(t.durationMs_$()?6:-1))},dependencies:[de],encapsulation:2})};function lt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Phase"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.node().phase)}}function dt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Step"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.stepLabel_$())}}function ct(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Duration"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.durationLabel_$())}}function pt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Tool"),d(),p(3,"span",12),m(4),d()()),i&2){let e=C();u(4),L(e.toolId_$())}}function ht(i,o){if(i&1&&(p(0,"div",10)(1,"span",13),m(2,"Intent"),d(),p(3,"span",14),m(4),d()()),i&2){let e=C();u(4),L(e.intent_$())}}function ut(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Iteration"),d(),p(3,"span",15),m(4),d()()),i&2){let e=C();u(4),_e("#",e.node().iterationIndex,"")}}function mt(i,o){if(i&1&&(p(0,"span",13),m(1," In: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.inputSize_$())}}function _t(i,o){if(i&1&&(p(0,"span",13),m(1," Out: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.outputSize_$())}}function ft(i,o){if(i&1&&(p(0,"div",11),D(1,mt,4,1,"span",13)(2,_t,4,1,"span",13),d()),i&2){let e=C();u(),S(e.inputSize_$()>0?1:-1),u(),S(e.outputSize_$()>0?2:-1)}}function gt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Provider"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedProvider_$())}}function xt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Model"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedModel_$())}}function yt(i,o){if(i&1&&(p(0,"span",13),m(1," Cost: "),p(2,"span",27),m(3),d()()),i&2){let e=C(4);u(3),L(e.costUsd_$())}}function St(i,o){if(i&1&&(p(0,"div",25)(1,"span",13),m(2," Tokens: "),p(3,"span",9),m(4),d()(),D(5,yt,4,1,"span",13),d()),i&2){let e=C(3);u(4),L(e.tokenInfo_$().total),u(),S(e.costUsd_$()?5:-1)}}function Ct(i,o){if(i&1&&(p(0,"div",16)(1,"div",23),m(2,"Used"),d(),p(3,"div",24),D(4,gt,5,1,"div",7)(5,xt,5,1,"div",7)(6,St,6,2,"div",25),d()()),i&2){let e=C(2);u(4),S(e.usedProvider_$()?4:-1),u(),S(e.usedModel_$()?5:-1),u(),S(e.tokenInfo_$()?6:-1)}}function vt(i,o){if(i&1){let e=ie();p(0,"button",28),B("click",function(){R(e);let n=C(2);return z(n.handleClearOverride())}),m(1," Clear "),d()}}function It(i,o){i&1&&(p(0,"div",21),m(1," Session override active "),d())}function Et(i,o){if(i&1&&(p(0,"div",22)(1,"div",29),m(2,"Global default"),d(),p(3,"div",30),m(4),d()()),i&2){let e=C(2);u(4),ze(" ",e.globalDefault_$().provider," / ",e.globalDefault_$().model," ")}}function Nt(i,o){if(i&1){let e=ie();D(0,Ct,7,3,"div",16),p(1,"div",16)(2,"div",17)(3,"div",18),m(4),d(),D(5,vt,2,0,"button",19),d(),p(6,"app-s-registry-provider-model-select",20),B("modelChange",function(n){R(e);let r=C();return z(r.handleModelChange(n))}),d(),D(7,It,2,0,"div",21),d(),D(8,Et,5,2,"div",22)}if(i&2){let e=C();S(e.usedProvider_$()||e.usedModel_$()?0:-1),u(4),_e(" Override: ",e.callTypeLabel_$()," "),u(),S(e.hasSessionOverride_$()?5:-1),u(),me("selectedProvider",e.selectedProvider_$())("selectedModel",e.selectedModel_$()),u(),S(e.hasSessionOverride_$()?7:-1),u(),S(e.globalDefault_$()?8:-1)}}var Ke=(()=>{class i{graph_DS=Z(Ze);session_DS=Z(Ce);registrySsot_CS=Z(Be);node=F.required();closed=ne();stateLabel_$=g(()=>({pending:"Pending",active:"Active",completed:"Completed",error:"Error"})[this.node().state]??this.node().state);durationLabel_$=g(()=>{let e=this.node().data.durationMs;return!e||e<=0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`});toolId_$=g(()=>{let e=this.node().data,t=e.toolId??e.tool;return typeof t=="string"?t:""});intent_$=g(()=>{let e=this.node().data.intent;return typeof e=="string"?e:""});stepLabel_$=g(()=>{let e=this.node().data.step;return typeof e!="string"||e.length===0?"":ve.formatStepId(e)});inputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.inputSize??0:0});outputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.outputSize??0:0});stateColorClass_$=g(()=>({pending:"text-neutral-500",active:"text-cyan-400",completed:"text-green-400",error:"text-red-400"})[this.node().state]??"text-neutral-400");isLlmCall_$=g(()=>this.node().category===f.llmCall);callType_$=g(()=>{let e=this.node().data?.callType;return typeof e=="string"?e:""});callTypeLabel_$=g(()=>{let e=this.callType_$();return Ye[e]??e});usedProvider_$=g(()=>{let e=this.node().data?.provider;return typeof e=="string"?e:""});usedModel_$=g(()=>{let e=this.node().data?.model;return typeof e=="string"?e:""});sessionOverride_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$();if(!t)return null;let r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.llmCallTypeOverrides;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});globalDefault_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$(),r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.globalCallTypeDefaults;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});selectedProvider_$=g(()=>this.sessionOverride_$()?.provider??"");selectedModel_$=g(()=>this.sessionOverride_$()?.model??"");hasSessionOverride_$=g(()=>this.sessionOverride_$()!==null);tokenInfo_$=g(()=>{let e=this.node().data,t=e.promptTokens,n=e.completionTokens,r=e.totalTokens;return typeof r!="number"||r<=0?null:{prompt:typeof t=="number"?t:0,completion:typeof n=="number"?n:0,total:r}});costUsd_$=g(()=>{let e=this.node().data?.costUsd;return typeof e!="number"||e<=0?"":`$${e.toFixed(4)}`});handleClose(){this.closed.emit()}handleProviderChange(e){}handleModelChange(e){let t=this.callType_$(),n=this.graph_DS.graphSessionId_$();if(!t||!n||!e)return;let s=this.registrySsot_CS.enabledLlmModels_$().find(a=>a.modelName===e);s&&this.applySessionOverride(n,t,s.provider,s.modelName)}handleClearOverride(){let e=this.callType_$(),t=this.graph_DS.graphSessionId_$();!e||!t||this.clearSessionOverride(t,e)}applySessionOverride(e,t,n,r){let h=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},l=w(I({},h),{[t]:{provider:n,model:r}});this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:l}}).then(()=>{this.session_DS.loadSessionInfo(e)})}clearSessionOverride(e,t){let s=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},a=I({},s);Reflect.deleteProperty(a,t);let h=Object.keys(a).length>0;this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:h?a:null}}).then(()=>{this.session_DS.loadSessionInfo(e)})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-node-detail"]],inputs:{node:[1,"node"]},outputs:{closed:"closed"},standalone:!0,features:[le],decls:26,vars:13,consts:[[1,"w-80","max-h-[28rem]","overflow-y-auto","rounded-lg","border","border-neonCyan/30","bg-neutral-900/95","shadow-lg","backdrop-blur-sm","p-3"],[1,"flex","items-start","justify-between","gap-2","mb-2"],[1,"text-sm","font-semibold","text-neutral-200","leading-tight"],["title","Bez\xE1r\xE1s","aria-label","Bez\xE1r\xE1s",1,"p-1","min-h-[28px]","min-w-[28px]","flex","items-center","justify-center","rounded","text-neutral-400","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M18 6L6 18M6 6l12 12"],[1,"space-y-1.5","text-xs"],[1,"flex","items-center","gap-2"],[1,"text-neutral-500","w-16","shrink-0"],[1,"text-neutral-300"],[1,"flex","flex-col","gap-0.5"],[1,"flex","items-center","gap-3","pt-1","border-t","border-neutral-800"],[1,"text-yellow-300","font-mono","text-[11px]"],[1,"text-neutral-500"],[1,"text-neutral-300","text-[11px]","leading-tight","break-words"],[1,"text-blue-400"],[1,"mt-3","pt-2","border-t","border-neutral-700"],[1,"flex","items-center","justify-between","mb-1.5"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors"],["registryKind","llm","providerLabel","Provider","modelLabel","Model",3,"modelChange","selectedProvider","selectedModel"],[1,"mt-1.5","text-[10px]","text-purple-400"],[1,"mt-2","pt-1.5","border-t","border-neutral-800"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1.5"],[1,"space-y-1","text-xs"],[1,"flex","items-center","gap-3"],[1,"text-purple-300","font-mono","text-[11px]"],[1,"text-green-400"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors",3,"click"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1"],[1,"text-[11px]","text-neutral-400","font-mono"]],template:function(t,n){t&1&&(p(0,"div",0)(1,"div",1)(2,"h3",2),m(3),d(),p(4,"button",3),B("click",function(){return n.handleClose()}),H(),p(5,"svg",4),W(6,"path",5),d()()(),ye(),p(7,"div",6)(8,"div",7)(9,"span",8),m(10,"State"),d(),p(11,"span"),m(12),d()(),p(13,"div",7)(14,"span",8),m(15,"Type"),d(),p(16,"span",9),m(17),d()(),D(18,lt,5,1,"div",7)(19,dt,5,1,"div",7)(20,ct,5,1,"div",7)(21,pt,5,1,"div",7)(22,ht,5,1,"div",10)(23,ut,5,1,"div",7)(24,ft,3,2,"div",11),d(),D(25,Nt,9,7),d()),t&2&&(u(3),L(n.node().label),u(8),se(n.stateColorClass_$()+" font-medium"),u(),L(n.stateLabel_$()),u(5),L(n.node().category),u(),S(n.node().phase?18:-1),u(),S(n.stepLabel_$()?19:-1),u(),S(n.durationLabel_$()?20:-1),u(),S(n.toolId_$()?21:-1),u(),S(n.intent_$()?22:-1),u(),S(n.node().iterationIndex!==null?23:-1),u(),S(n.inputSize_$()>0||n.outputSize_$()>0?24:-1),u(),S(n.isLlmCall_$()&&n.callType_$()?25:-1))},dependencies:[de,Fe],encapsulation:2})}return i})();var $t=["graphSvg"],Qe=(i,o)=>o.id;function bt(i,o){i&1&&(p(0,"span",7),m(1,"Loading trace..."),d())}function Lt(i,o){if(i&1&&(H(),W(0,"rect",16)),i&2){let e=o;Y("x",e.x)("y",e.y)("width",e.width)("height",e.height)}}function wt(i,o){if(i&1&&(H(),W(0,"path",17)),i&2){let e=o.$implicit;Y("d",e.pathD)("stroke",e.strokeColor)("stroke-dasharray",e.strokeDashArray)("marker-end",e.markerEnd)}}function Tt(i,o){if(i&1){let e=ie();H(),p(0,"g",20),B("nodeClicked",function(n){R(e);let r=C();return z(r.handleNodeClick(n))}),d()}if(i&2){let e=o.$implicit,t=C();me("node",e)("isHighlighted",t.activeNodeId()===e.id)("isSelected",t.selectedNodeId()===e.id)}}function Mt(i,o){if(i&1){let e=ie();p(0,"app-ses-graph-node-detail",21),B("closed",function(){R(e);let n=C();return z(n.handleDetailClose())}),d()}i&2&&me("node",o)}var Gn=(()=>{class i{svgRef;layout=F(null);activeNodeId=F("");selectedNodeId=F("");isLoading=F(!1);nodeClicked=ne();detailClosed=ne();viewBox_$=V({x:0,y:0,width:800,height:600});viewBoxStr_$=g(()=>{let e=this.viewBox_$();return`${e.x} ${e.y} ${e.width} ${e.height}`});isFollowActive_$=V(!0);isPanning=!1;panStartX=0;panStartY=0;panStartViewBoxX=0;panStartViewBoxY=0;nodes_$=g(()=>this.layout()?.nodes??[]);edges_$=g(()=>this.layout()?.edges??[]);loopBounds_$=g(()=>this.layout()?.loopContainerBounds??null);selectedNode_$=g(()=>{let e=this.selectedNodeId();return e?this.nodes_$().find(t=>t.id===e)??null:null});constructor(){Se(()=>{let e=this.layout();e&&this.viewBox_$.set(I({},e.viewBox))},{allowSignalWrites:!0})}handleNodeClick(e){this.nodeClicked.emit(e)}handleDetailClose(){this.detailClosed.emit()}handlePointerDown(e){if(e.button!==0)return;this.isPanning=!0,this.panStartX=e.clientX,this.panStartY=e.clientY;let t=this.viewBox_$();this.panStartViewBoxX=t.x,this.panStartViewBoxY=t.y,this.svgRef&&this.svgRef.nativeElement.setPointerCapture(e.pointerId)}handlePointerMove(e){if(!this.isPanning||!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=n.width/t.clientWidth,s=n.height/t.clientHeight,a=(e.clientX-this.panStartX)*r,h=(e.clientY-this.panStartY)*s;this.viewBox_$.set(w(I({},n),{x:this.panStartViewBoxX-a,y:this.panStartViewBoxY-h}))}handlePointerUp(){this.isPanning=!1}handleWheel(e){if(e.preventDefault(),!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=e.deltaY>0?1.1:.9,s=t.getBoundingClientRect(),a=(e.clientX-s.left)/s.width,h=(e.clientY-s.top)/s.height,l=n.width*r,c=n.height*r;if(l<200||l>5e3)return;let _=n.x+(n.width-l)*a,y=n.y+(n.height-c)*h;this.viewBox_$.set({x:_,y,width:l,height:c})}handleFitToView(){let e=this.nodes_$();if(e.length===0)return;let t=P.recalculateViewBox(e,48);this.viewBox_$.set(t)}handleToggleFollowActive(){this.isFollowActive_$.update(e=>!e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-view"]],viewQuery:function(t,n){if(t&1&&Ge($t,5),t&2){let r;Oe(r=Re())&&(n.svgRef=r.first)}},inputs:{layout:[1,"layout"],activeNodeId:[1,"activeNodeId"],selectedNodeId:[1,"selectedNodeId"],isLoading:[1,"isLoading"]},outputs:{nodeClicked:"nodeClicked",detailClosed:"detailClosed"},standalone:!0,features:[le],decls:25,vars:6,consts:[["graphSvg",""],[1,"flex","flex-col","h-full","w-full","overflow-hidden"],[1,"flex","items-center","gap-2","px-3","py-2","border-b","border-neutral-800","shrink-0","bg-neutral-900/80"],["title","Fit to view",1,"px-2","py-1","text-xs","border","rounded","transition-colors","border-neutral-700","text-neutral-400","hover:text-neutral-200","hover:border-neutral-500",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","inline-block","mr-1"],["d","M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"],["title","Follow active node",1,"px-2","py-1","text-xs","border","rounded","transition-colors",3,"click"],[1,"text-xs","text-neutral-500","ml-auto"],[1,"flex-1","min-h-0","relative"],["preserveAspectRatio","xMidYMid meet",1,"ses-graph-svg",3,"pointerdown","pointermove","pointerup","pointerleave","wheel"],["id","ses-arrow-seq","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#525252"],["id","ses-arrow-loop","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#3b82f6"],["id","ses-arrow-error","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#f97316"],["rx","6","fill","#0f172a","stroke","#1e3a5f","stroke-width","1","stroke-dasharray","4 2","opacity","0.5"],["stroke-width","1.5","fill","none"],["appSesGraphNodeSvg","",3,"node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"node"],["appSesGraphNodeSvg","",3,"nodeClicked","node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"closed","node"]],template:function(t,n){if(t&1){let r=ie();p(0,"div",1)(1,"div",2)(2,"button",3),B("click",function(){return R(r),z(n.handleFitToView())}),H(),p(3,"svg",4),W(4,"path",5),d(),m(5," Fit "),d(),ye(),p(6,"button",6),B("click",function(){return R(r),z(n.handleToggleFollowActive())}),m(7," Follow "),d(),D(8,bt,2,0,"span",7),d(),p(9,"div",8),H(),p(10,"svg",9,0),B("pointerdown",function(a){return R(r),z(n.handlePointerDown(a))})("pointermove",function(a){return R(r),z(n.handlePointerMove(a))})("pointerup",function(){return R(r),z(n.handlePointerUp())})("pointerleave",function(){return R(r),z(n.handlePointerUp())})("wheel",function(a){return R(r),z(n.handleWheel(a))}),p(12,"defs")(13,"marker",10),W(14,"path",11),d(),p(15,"marker",12),W(16,"path",13),d(),p(17,"marker",14),W(18,"path",15),d()(),D(19,Lt,1,4,":svg:rect",16),Le(20,wt,1,4,":svg:path",17,Qe),Le(22,Tt,1,3,":svg:g",18,Qe),d(),D(24,Mt,1,1,"app-ses-graph-node-detail",19),d()()}if(t&2){let r,s;u(6),se(n.isFollowActive_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-500"),u(2),S(n.isLoading()?8:-1),u(2),Y("viewBox",n.viewBoxStr_$()),u(9),S((r=n.loopBounds_$())?19:-1,r),u(),we(n.edges_$()),u(2),we(n.nodes_$()),u(2),S((s=n.selectedNode_$())?24:-1,s)}},dependencies:[de,$e,Ke],styles:[`@charset "UTF-8";@keyframes _ngcontent-%COMP%_ses-graph-node-pulse{0%,to{filter:drop-shadow(0 0 4px var(--ses-graph-pulse-color, #22d3ee))}50%{filter:drop-shadow(0 0 12px var(--ses-graph-pulse-color, #22d3ee))}}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.ses-graph-svg[_ngcontent-%COMP%]{width:100%;height:100%;background:#0a0a0a;-webkit-user-select:none;user-select:none} .ses-graph-node--active{animation:_ngcontent-%COMP%_ses-graph-node-pulse 1.5s ease-in-out infinite} .ses-graph-node--active rect{stroke-width:2.5} .ses-graph-node--selected{filter:drop-shadow(0 0 6px rgba(34,211,238,.4))}
1
+ import{c as Ce}from"./chunk-4EX42M46.js";import{b as Ye}from"./chunk-COVCHZOZ.js";import{a as v}from"./chunk-UFBTR2BG.js";import{g as Be,h as Fe}from"./chunk-6AOMQLRI.js";import{I as Ve}from"./chunk-P7QASRBG.js";import{Aa as Oe,Ba as Re,C as Z,D as ae,Fa as m,Ga as L,Ha as _e,Ia as ze,J as R,K as z,L as H,M as ye,P as Pe,T as ne,Ta as le,U as F,Z as u,a as I,aa as V,b as w,da as D,fa as Y,ga as me,hb as g,ja as se,jb as Se,k as ke,la as S,oa as Le,p as be,pa as we,qa as p,ra as d,sa as W,ua as ie,ub as de,va as B,wa as C,xb as He,y as xe,za as Ge}from"./chunk-TBMJSIBB.js";var ve=class i{static getEmoji(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"?"\u{1F680}":t==="run-flow-complete"?"\u{1F3AF}":t==="tool-error-retry"?"\u26A0\uFE0F\u{1F9E0}":t.includes("tool-error")||t.includes("error-recovery")?"\u{1F527}\u274C":t.includes("agentic-loop-iteration")?"":o.eventType==="tool-call"||typeof e.toolId=="string"?"\u{1F527}":o.eventType==="llm-call"||typeof e.callType=="string"?"\u{1F9E0}":o.eventType==="error"?"\u26A0\uFE0F":""}static getBubbleClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-500/10 text-green-300 border border-green-500/50":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-500/10 text-orange-300 border border-orange-500/50":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-500/10 text-red-300 border border-red-500/50":t.includes("agentic-loop")?"bg-blue-500/10 text-blue-300 border border-blue-500/50":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-500/10 text-yellow-300 border border-yellow-500/50":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-500/10 text-purple-300 border border-purple-500/50":"bg-neutral-700 text-neutral-200 border border-neonCyan"}static getStepLabel(o){let e=o.data??{},t=e.step,n=e.toolId;if(typeof t=="string"&&t.length>0)return i.formatStepId(t);if(o.eventType==="tool-call"&&typeof n=="string"&&n.length>0)return`Eszk\xF6z: ${n}`;if(o.eventType==="llm-call"){let r=e.callType;return typeof r=="string"?`LLM: ${i.formatStepId(r)}`:"LLM h\xEDv\xE1s"}if(o.eventType==="error"){let r=e.message;return typeof r=="string"&&r.length>0?`Hiba: ${r.substring(0,40)}${r.length>40?"\u2026":""}`:"Hiba"}return o.eventType==="compacting"?typeof t=="string"&&t.length>0?i.formatStepId(t):"Compacting":i.formatEventTypeFallback(o.eventType)}static formatStepId(o){return o.split("-").map(e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e).join(" ")}static getDotClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-400":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-400":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-400":t.includes("agentic-loop")?"bg-blue-400":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-400":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-400":"bg-neutral-400"}static formatEventTypeFallback(o){return{step:"L\xE9p\xE9s","tool-call":"Eszk\xF6zh\xEDv\xE1s","context-update":"Kontextus friss\xEDt\xE9s",compacting:"Compacting","llm-call":"LLM h\xEDv\xE1s","session-event":"Session event",error:"Hiba"}[o]??o}};var x=function(i){return i.pending="pending",i.active="active",i.completed="completed",i.error="error",i}(x||{});var tt={[v.runInitialization]:"milestone-init",[v.analyze]:"phase-analyze",[v.analyzeResult]:"llm-analyze",[v.assemble]:"phase-assemble",[v.execution]:"phase-execution",[v.executionStart]:"phase-execution",[v.finalization]:"phase-finalization",[v.llmRunFinalization]:"llm-finalization",[v.postFinalization]:"phase-finalization",[v.runFlowComplete]:"milestone-complete"},nt=["milestone-init","phase-analyze","llm-analyze","phase-assemble","phase-execution","phase-finalization","llm-finalization","milestone-complete"],N=class i{static mapPhaseToNodeId(o){return tt[o]??null}static computeStateTransitions(o){let e=i.mapPhaseToNodeId(o);if(!e)return[];let t=[],n=!1;for(let r of nt)r===e?(t.push({nodeId:r,state:x.active}),n=!0):n||t.push({nodeId:r,state:x.completed});return t}static extractIterationData(o){let e=o.action;if(typeof e!="string")return null;let t=o.tool,n=typeof t=="string"?t:"",r=o.intent,s=typeof r=="string"?r:"",a=o.iterationCount;return{actionType:e,tool:n,intent:s,iterationIndex:typeof a=="number"?a:0}}static mapMonitoringEventToIterationNodeId(o,e){let t=o.data??{},n=t.step,r=typeof n=="string"?n:"",s=`iter-${e}`;if(o.eventType==="llm-call"){let a=t.callType;if(a==="agentic-loop")return`${s}-llm-decision`;if(a==="tool-description")return`${s}-tool-desc`;if(a==="tool-error-retry")return`${s}-tool-error-retry`;if(a==="tool-result-chunking")return`${s}-tool-chunking`;if(a==="goal-state-update")return`${s}-goal-update`}return o.eventType==="tool-call"?`${s}-tool-call`:o.eventType==="error"||r.includes("tool-error")?`${s}-tool-call`:null}static isTerminalPhase(o){return o===v.runFlowComplete}static SKELETON_LLM_NODE_MAP={analyze:"llm-analyze","run-finalization":"llm-finalization"};static LLM_CALL_PHASE_MAP={analyze:"phase-analyze","subanalyze-run-tasks":"phase-analyze","instant-reply":"phase-execution","run-finalization":"phase-finalization","chat-history-compacting":"phase-execution","execution-history-compacting":"phase-execution","soul-compacting":"phase-execution","context-compacting":"phase-execution","message-interceptor":"phase-execution"};static ITERATION_LLM_CALL_TYPES=new Set(["agentic-loop","tool-description","tool-error-retry","tool-result-chunking","goal-state-update"]);static LLM_CALL_LABEL_MAP={analyze:"LLM: Analyze","subanalyze-run-tasks":"LLM: Subanalyze","instant-reply":"LLM: Instant Reply","agentic-loop":"LLM Decision","tool-description":"Tool Description","tool-error-retry":"LLM: Error Retry","run-finalization":"LLM: Summary","chat-history-compacting":"LLM: Compact Chat","execution-history-compacting":"LLM: Compact Exec","soul-compacting":"LLM: Compact Soul","context-compacting":"LLM: Compact Ctx","tool-result-chunking":"LLM: Chunking","goal-state-update":"LLM: Goal Update","message-interceptor":"LLM: Msg Intercept"};static getPreCreatedSkeletonNodeId(o){return i.SKELETON_LLM_NODE_MAP[o]??null}static getLlmCallPhaseId(o){return i.LLM_CALL_PHASE_MAP[o]??null}static isIterationLlmCall(o){return i.ITERATION_LLM_CALL_TYPES.has(o)}static getLlmCallLabel(o){return i.LLM_CALL_LABEL_MAP[o]??`LLM: ${o}`}};var k=function(i){return i.sequential="sequential",i.loopEntry="loop-entry",i.errorRetry="error-retry",i}(k||{});var f=function(i){return i.phase="phase",i.milestone="milestone",i.llmCall="llm-call",i.toolCall="tool-call",i.toolError="tool-error",i.loopIteration="loop-iteration",i.action="action",i.error="error",i}(f||{});var je="milestone-init",Ee="phase-analyze",it="llm-analyze",Me="phase-assemble",ee="phase-execution",he="phase-finalization",Ae="llm-finalization",De="milestone-complete",P=class i{static buildSkeletonLayout(){let o=48+220/2,e=48,t=[],n=[],r=i.createNode({id:je,category:f.milestone,label:"Initialization",phase:v.runInitialization,x:o-200/2,y:e,width:200,height:48});t.push(r),e+=84;let s=i.createNode({id:Ee,category:f.phase,label:"Analyze",phase:v.analyze,x:o-220/2,y:e,width:220,height:60});t.push(s);let a=i.createNode({id:it,category:f.llmCall,label:"LLM: Analyze",phase:v.analyzeResult,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:Ee});t.push(a),n.push(i.createEdge(je,Ee,k.sequential)),e+=96;let h=i.createNode({id:Me,category:f.phase,label:"Assemble",phase:v.assemble,x:o-220/2,y:e,width:220,height:60});t.push(h),n.push(i.createEdge(Ee,Me,k.sequential)),e+=96;let l=i.createNode({id:ee,category:f.phase,label:"Execution",phase:v.execution,x:o-220/2,y:e,width:220,height:60});t.push(l),n.push(i.createEdge(Me,ee,k.sequential)),e+=96;let c=i.createNode({id:he,category:f.phase,label:"Finalization",phase:v.finalization,x:o-220/2,y:e,width:220,height:60});t.push(c);let _=i.createNode({id:Ae,category:f.llmCall,label:"LLM: Summary",phase:v.llmRunFinalization,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:he});t.push(_),n.push(i.createEdge(ee,he,k.sequential)),e+=96;let y=i.createNode({id:De,category:f.milestone,label:"Flow Complete",phase:v.runFlowComplete,x:o-200/2,y:e,width:200,height:48});t.push(y),n.push(i.createEdge(he,De,k.sequential));let T=i.recalculateViewBox(t,48);return{nodes:t,edges:n,viewBox:T,loopContainerBounds:null}}static addIterationColumn(o,e,t,n){let r=o.nodes.map(b=>I({},b)),s=[...o.edges],a=r.find(b=>b.id===ee);if(!a)return o;let h=a.x+20+e*208,l=a.y+60+20,c=`iter-${e}`,_=l,y=[],T=i.createNode({id:`${c}-llm-decision`,category:f.llmCall,label:"LLM Decision",phase:v.llmAgenticLoop,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(T),_+=68;let M=i.formatActionLabel(t),O=i.createNode({id:`${c}-action`,category:f.action,label:M,phase:v.agenticLoopIteration,x:h+20/2,y:_,width:140,height:32,parentId:ee,iterationIndex:e,data:n});if(y.push(O),_+=56,t==="tool-select"){let b=i.createNode({id:`${c}-tool-desc`,category:f.llmCall,label:"Tool Description",phase:v.llmToolDescription,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(b),_+=68;let q=n.tool,Q=typeof q=="string"?q:"tool",te=i.createNode({id:`${c}-tool-call`,category:f.toolCall,label:Q,phase:null,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e,data:n});y.push(te),_+=68}for(let b=0;b<y.length-1;b++)s.push(i.createEdge(y[b].id,y[b+1].id,k.sequential));r.push(...y);let E=20*2+(e+1)*180+e*28,j=60+20*2+(_-l);a.width=Math.max(a.width,E),a.height=Math.max(a.height,j);let K=a.y+a.height,A=[he,Ae,De],ue=K+36;for(let b of A){let q=r.find(Q=>Q.id===b);if(q){if(b===Ae){let Q=r.find(te=>te.id===he);Q&&(q.y=Q.y+16/2);continue}q.y=ue,ue+=q.height+36}}let ge={x:a.x,y:a.y+60,width:a.width,height:a.height-60},J=r,Je=s.map(b=>{let q=J.find(te=>te.id===b.sourceNodeId),Q=J.find(te=>te.id===b.targetNodeId);return!q||!Q?b:w(I({},b),{pathD:i.computeEdgePath(q,Q,b.category)})}),et=i.recalculateViewBox(J,48);return{nodes:J,edges:Je,viewBox:et,loopContainerBounds:ge}}static computeEdgePath(o,e,t){let n=o.x+o.width/2,r=o.y+o.height,s=e.x+e.width/2,a=e.y;if(Math.abs(n-s)<20)return`M ${n} ${r} L ${s} ${a}`;let h=o.x+o.width,l=o.y+o.height/2,c=e.x,_=e.y+e.height/2;if(e.parentId===o.id)return`M ${h} ${l} L ${c} ${_}`;let y=r+(a-r)/2;return`M ${n} ${r} L ${n} ${y} L ${s} ${y} L ${s} ${a}`}static recalculateViewBox(o,e){if(o.length===0)return{x:0,y:0,width:600,height:400};let t=1/0,n=1/0,r=-1/0,s=-1/0;for(let a of o)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),s=Math.max(s,a.y+a.height);return{x:t-e,y:n-e,width:r-t+e*2,height:s-n+e*2}}static addDynamicLlmNode(o,e,t,n,r,s){let a=o.nodes.map(A=>I({},A)),h=[...o.edges],l=a.find(A=>A.id===e);if(!l)return o;let c,_;l.category===f.phase||l.category===f.milestone?(c=l.x+l.width+28,_=l.y+(l.height-44)/2):(c=l.x,_=l.y+l.height+24);let T=i.createNode({id:t,category:f.llmCall,label:n,phase:null,x:c,y:_,width:160,height:44,parentId:r,iterationIndex:s??void 0});a.push(T),h.push(i.createEdge(e,t,k.sequential));let M=T.y+T.height;s!=null?i.expandExecutionContainer(a,M):i.shiftDownstreamIfOverlap(a,r,M);let O=o.loopContainerBounds,E=a.find(A=>A.id==="phase-execution");E&&E.height>60&&(O={x:E.x,y:E.y+60,width:E.width,height:E.height-60});let j=h.map(A=>{let ue=a.find(J=>J.id===A.sourceNodeId),ge=a.find(J=>J.id===A.targetNodeId);return!ue||!ge?A:w(I({},A),{pathD:i.computeEdgePath(ue,ge,A.category)})}),K=i.recalculateViewBox(a,48);return{nodes:a,edges:j,viewBox:K,loopContainerBounds:O}}static expandExecutionContainer(o,e){let t=o.find(l=>l.id==="phase-execution");if(!t)return;let n=t.y+60+20,r=60+20*2+(e+24-n);if(r<=t.height)return;t.height=r;let s=t.y+t.height,a=["phase-finalization","llm-finalization","milestone-complete"],h=s+36;for(let l of a){let c=o.find(_=>_.id===l);if(c){if(l==="llm-finalization"){let _=o.find(y=>y.id==="phase-finalization");_&&(c.y=_.y+16/2);continue}c.y<h&&(c.y=h),h=c.y+c.height+36}}for(let l of o)if(l.parentId==="phase-finalization"&&l.id!=="llm-finalization"&&l.category===f.llmCall){let c=o.find(_=>_.id==="phase-finalization");c&&(l.y=Math.max(l.y,c.y))}}static shiftDownstreamIfOverlap(o,e,t){let n=["milestone-init","phase-analyze","phase-assemble","phase-execution","phase-finalization","milestone-complete"],r=n.indexOf(e);if(r<0||r>=n.length-1)return;let s=n[r+1],a=o.find(_=>_.id===s);if(!a||t+36<=a.y)return;let h=t+36-a.y,l=new Set;for(let _ of o)_.parentId===e&&_.category===f.llmCall&&l.add(_.id);let c=a.y;for(let _ of o)_.y>=c&&!l.has(_.id)&&(_.y+=h)}static createNode(o){return{id:o.id,category:o.category,state:x.pending,label:o.label,phase:o.phase,x:o.x,y:o.y,width:o.width,height:o.height,data:o.data??{},iterationIndex:o.iterationIndex??null,parentId:o.parentId??null,monitoringEvent:null}}static createEdge(o,e,t){let n=t===k.errorRetry?"#f97316":t===k.loopEntry?"#3b82f6":"#525252",r=t===k.loopEntry?"8 4":t===k.errorRetry?"6 3":"none",s=t===k.errorRetry?"url(#ses-arrow-error)":t===k.loopEntry?"url(#ses-arrow-loop)":"url(#ses-arrow-seq)";return{id:`edge-${o}-${e}`,category:t,sourceNodeId:o,targetNodeId:e,pathD:"",strokeColor:n,strokeDashArray:r,markerEnd:s}}static formatActionLabel(o){return{"tool-select":"Tool Select","tool-group-open":"Tool Group","context-handling":"Context","loop-debrief":"Debrief",result:"Result"}[o]??o}};var qe=(()=>{class i{baseUrl=`${Ve.api.baseUrl}/session`;http=Z(He);getEvents(e){let t=encodeURIComponent(e.trim());return be(this.http.get(`${this.baseUrl}/${t}/events`))}getRunTrace(e){let t=e.sessionId.trim(),n=encodeURIComponent(e.runId.trim());return be(this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/runs/${n}/trace`))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ze=(()=>{class i{session_DS=Z(Ce);monitoring_AS=Z(qe);destroyRef=Z(Pe);graphLayout_$=V(null);activeNodeId_$=V("");selectedNodeId_$=V("");isLive_$=V(!1);isGraphOpen_$=V(!1);graphSessionId_$=V("");graphRunId_$=V("");isLoading_$=V(!1);currentIterationIndex=-1;monitoringSubscription=null;lastAppliedPhase="";phaseRightColumnLast={};iterationColumnLast={};dynamicNodeCounter=0;constructor(){Se(()=>{let e=this.session_DS.agentEvents_$();!this.isGraphOpen_$()||!this.isLive_$()||this.applyAgentEvent(e)},{allowSignalWrites:!0}),this.destroyRef.onDestroy(()=>{this.disposeSubscriptions()})}openGraphForRun(e,t,n){this.disposeSubscriptions(),this.resetState(),this.graphSessionId_$.set(e),this.graphRunId_$.set(t),this.isLive_$.set(n),this.isGraphOpen_$.set(!0),n?this.initLiveGraph():this.loadHistoricalGraph(e,t)}closeGraph(){this.disposeSubscriptions(),this.isGraphOpen_$.set(!1),this.selectedNodeId_$.set("")}selectNode(e){let t=this.selectedNodeId_$();this.selectedNodeId_$.set(t===e?"":e)}clearSelection(){this.selectedNodeId_$.set("")}initLiveGraph(){let e=P.buildSkeletonLayout(),t=this.recalculateEdgePaths(e);this.graphLayout_$.set(t),this.phaseRightColumnLast={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},this.iterationColumnLast={},this.monitoringSubscription=this.session_DS.monitoringEvent_S.subscribe(n=>{n.sessionId===this.graphSessionId_$()&&this.applyMonitoringEvent(n.event)})}applyAgentEvent(e){let t=e.phase;if(typeof t!="string"||t.length===0||t===this.lastAppliedPhase)return;if(this.lastAppliedPhase=t,t===v.agenticLoopIteration){let r=N.extractIterationData(e);r&&this.addIteration(r);return}let n=N.computeStateTransitions(t);n.length!==0&&(this.applyStateTransitions(n),N.isTerminalPhase(t)&&this.markAllIterationNodesCompleted())}addIteration(e){let t=this.graphLayout_$();if(!t)return;this.currentIterationIndex=e.iterationIndex,this.markPreviousIterationCompleted(e.iterationIndex);let n=P.addIterationColumn(t,e.iterationIndex,e.actionType,{tool:e.tool,intent:e.intent}),r=e.actionType==="tool-select"?`iter-${e.iterationIndex}-tool-call`:`iter-${e.iterationIndex}-action`;this.iterationColumnLast[e.iterationIndex]=r;let s=`iter-${e.iterationIndex}-llm-decision`,a=this.setNodeState(n,s,x.active);this.activeNodeId_$.set(s),this.graphLayout_$.set(this.recalculateEdgePaths(a))}markPreviousIterationCompleted(e){if(e<=0)return;let t=this.graphLayout_$();if(!t)return;let n=`iter-${e-1}`,r=t;for(let s of t.nodes)s.id.startsWith(n)&&s.state!==x.error&&(r=this.setNodeState(r,s.id,x.completed));this.graphLayout_$.set(r)}applyMonitoringEvent(e){let t=this.graphLayout_$();if(!t)return;let n=typeof e.eventType=="string"?e.eventType:"",r=typeof e.status=="string"?e.status:"",s=i.toRecord(e.data),a=typeof e.durationMs=="number"?e.durationMs:0,h=typeof e.inputSize=="number"?e.inputSize:0,l=typeof e.outputSize=="number"?e.outputSize:0,c={eventType:n,timestamp:new Date,data:s,durationMs:a,status:r,sessionId:this.graphSessionId_$(),runId:this.graphRunId_$(),inputSize:h,outputSize:l};if(n==="llm-call"){this.handleLlmCallMonitoringEvent(c,t);return}if(this.currentIterationIndex<0)return;let _=N.mapMonitoringEventToIterationNodeId(c,this.currentIterationIndex);if(!_)return;let y=this.enrichNodeWithMonitoringEvent(t,_,c);y&&this.graphLayout_$.set(y)}handleLlmCallMonitoringEvent(e,t){let n=e.data?.callType,r=typeof n=="string"?n:"";if(!r)return;let s=N.getPreCreatedSkeletonNodeId(r);if(s){let h=this.enrichNodeWithMonitoringEvent(t,s,e);h&&this.graphLayout_$.set(h);return}if(N.isIterationLlmCall(r)&&this.currentIterationIndex>=0){let h=N.mapMonitoringEventToIterationNodeId(e,this.currentIterationIndex);if(h){if(t.nodes.findIndex(c=>c.id===h)>=0){let c=this.enrichNodeWithMonitoringEvent(t,h,e);c&&this.graphLayout_$.set(c)}else this.createDynamicIterationLlmNode(t,r,h,e);return}}let a=N.getLlmCallPhaseId(r);a&&this.createDynamicSkeletonLlmNode(t,r,a,e)}enrichNodeWithMonitoringEvent(e,t,n){let r=e.nodes.findIndex(_=>_.id===t);if(r<0)return null;let s=n.data??{},a=n.status==="error",h=n.durationMs??0,l=a?x.error:h>0?x.completed:x.active,c=[...e.nodes];return c[r]=w(I({},c[r]),{state:l,monitoringEvent:n,data:w(I(I({},c[r].data),s),{durationMs:h})}),this.activeNodeId_$.set(l===x.active?t:""),w(I({},e),{nodes:c})}createDynamicSkeletonLlmNode(e,t,n,r){this.dynamicNodeCounter++;let s=`llm-dyn-${this.dynamicNodeCounter}`,a=N.getLlmCallLabel(t),h=this.phaseRightColumnLast[n]??n,l=P.addDynamicLlmNode(e,h,s,a,n,null);this.phaseRightColumnLast[n]=s;let c=this.enrichNodeWithMonitoringEvent(l,s,r);this.graphLayout_$.set(c??l)}createDynamicIterationLlmNode(e,t,n,r){let s=N.getLlmCallLabel(t),a=this.iterationColumnLast[this.currentIterationIndex]??`iter-${this.currentIterationIndex}-action`,h=P.addDynamicLlmNode(e,a,n,s,"phase-execution",this.currentIterationIndex);this.iterationColumnLast[this.currentIterationIndex]=n;let l=this.enrichNodeWithMonitoringEvent(h,n,r);this.graphLayout_$.set(l??h)}loadHistoricalGraph(e,t){return ke(this,null,function*(){this.isLoading_$.set(!0);try{let n=yield this.monitoring_AS.getRunTrace({sessionId:e,runId:t});this.buildHistoricalGraph(n.trace)}catch{let n=P.buildSkeletonLayout();this.graphLayout_$.set(this.recalculateEdgePaths(n))}finally{this.isLoading_$.set(!1)}})}buildHistoricalGraph(e){let t=P.buildSkeletonLayout();t=this.recalculateEdgePaths(t);let n="",r=-1,s={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},a={},h=0;for(let l of e){let c=l.data??{},_=c.step,y=typeof _=="string"?_:"";if(y.length>0&&N.mapPhaseToNodeId(y)&&y!==n){n=y;let M=N.computeStateTransitions(y);for(let O of M)t=this.setNodeState(t,O.nodeId,O.state)}if(y==="agentic-loop-iteration"||y.includes("agentic-loop")){let T=c.action,M=typeof T=="string"?T:"",O=c.tool,E=typeof O=="string"?O:"";if(M.length>0){r++,t=P.addIterationColumn(t,r,M,{tool:E});let j=M==="tool-select"?`iter-${r}-tool-call`:`iter-${r}-action`;a[r]=j}}if(l.eventType==="llm-call"){let T=c.callType,M=typeof T=="string"?T:"";if(M){let O=N.getPreCreatedSkeletonNodeId(M);if(O)t=this.enrichHistoricalNode(t,O,l,c);else if(N.isIterationLlmCall(M)&&r>=0){let E=N.mapMonitoringEventToIterationNodeId(l,r);if(E)if(t.nodes.findIndex(K=>K.id===E)>=0)t=this.enrichHistoricalNode(t,E,l,c);else{let K=N.getLlmCallLabel(M),A=a[r]??`iter-${r}-action`;t=P.addDynamicLlmNode(t,A,E,K,"phase-execution",r),t=this.enrichHistoricalNode(t,E,l,c),a[r]=E}}else{let E=N.getLlmCallPhaseId(M);if(E){h++;let j=`llm-dyn-${h}`,K=N.getLlmCallLabel(M),A=s[E]??E;t=P.addDynamicLlmNode(t,A,j,K,E,null),t=this.enrichHistoricalNode(t,j,l,c),s[E]=j}}}continue}if(r>=0){let T=N.mapMonitoringEventToIterationNodeId(l,r);T&&(t=this.enrichHistoricalNode(t,T,l,c))}}if(n===v.runFlowComplete)for(let l of t.nodes)l.state===x.pending&&(t=this.setNodeState(t,l.id,x.completed));this.graphLayout_$.set(this.recalculateEdgePaths(t))}enrichHistoricalNode(e,t,n,r){let s=e.nodes.findIndex(h=>h.id===t);if(s<0)return e;let a=[...e.nodes];return a[s]=w(I({},a[s]),{state:n.status==="error"?x.error:x.completed,monitoringEvent:n,data:w(I(I({},a[s].data),r),{durationMs:n.durationMs})}),w(I({},e),{nodes:a})}applyStateTransitions(e){let t=this.graphLayout_$();if(!t)return;let n="";for(let r of e)t=this.setNodeState(t,r.nodeId,r.state),r.state===x.active&&(n=r.nodeId);this.activeNodeId_$.set(n),this.graphLayout_$.set(t)}setNodeState(e,t,n){let r=e.nodes.findIndex(a=>a.id===t);if(r<0)return e;let s=[...e.nodes];return s[r]=w(I({},s[r]),{state:n}),w(I({},e),{nodes:s})}markAllIterationNodesCompleted(){let e=this.graphLayout_$();if(!e)return;let t=e;for(let n of e.nodes)n.iterationIndex!=null&&n.state!==x.error&&(t=this.setNodeState(t,n.id,x.completed));this.graphLayout_$.set(t)}recalculateEdgePaths(e){let t=e.edges.map(n=>{let r=e.nodes.find(a=>a.id===n.sourceNodeId),s=e.nodes.find(a=>a.id===n.targetNodeId);return!r||!s?n:w(I({},n),{pathD:P.computeEdgePath(r,s,n.category)})});return w(I({},e),{edges:t})}resetState(){this.graphLayout_$.set(null),this.activeNodeId_$.set(""),this.selectedNodeId_$.set(""),this.currentIterationIndex=-1,this.lastAppliedPhase="",this.isLoading_$.set(!1),this.dynamicNodeCounter=0,this.phaseRightColumnLast={},this.iterationColumnLast={}}disposeSubscriptions(){this.monitoringSubscription&&(this.monitoringSubscription.unsubscribe(),this.monitoringSubscription=null)}static toRecord(e){return typeof e!="object"||e==null?{}:JSON.parse(JSON.stringify(e))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ot=["appSesGraphNodeSvg",""];function rt(i,o){if(i&1&&(H(),p(0,"text",1),m(1),d()),i&2){let e=C();Y("x",10)("y",e.node().height/2+1),u(),L(e.icon_$())}}function at(i,o){if(i&1&&(H(),p(0,"text",3),m(1),d()),i&2){let e=C();Y("x",e.node().width-10)("y",12)("fill",e.node().state==="error"?"#ef4444":"#22c55e"),u(),L(e.stateIcon_$())}}function st(i,o){if(i&1&&(H(),p(0,"text",4),m(1),d()),i&2){let e=C();Y("x",e.node().width-8)("y",e.node().height-8),u(),_e("",e.durationMs_$(),"ms")}}var $e=class i{node=F.required();isHighlighted=F(!1);isSelected=F(!1);nodeClicked=ne();fillColor_$=g(()=>{let o=this.node();return o.state===x.pending?"#262626":i.CATEGORY_FILL_MAP[o.category]??"#262626"});strokeColor_$=g(()=>{let o=this.node();return o.state===x.error?"#ef4444":o.state===x.pending?"#525252":i.CATEGORY_STROKE_MAP[o.category]??"#737373"});strokeDashArray_$=g(()=>this.node().state===x.pending?"6 3":"none");textColor_$=g(()=>this.node().state===x.pending?"#737373":"#e5e5e5");opacity_$=g(()=>this.node().state===x.pending?.5:1);borderRadius_$=g(()=>this.node().category===f.action?16:8);icon_$=g(()=>{let o=this.node().category;return i.CATEGORY_ICON_MAP[o]??""});stateIcon_$=g(()=>{let o=this.node().state;return o===x.completed?"\u2713":o===x.error?"\u2715":""});animationClass_$=g(()=>this.node().state===x.active||this.isHighlighted()?"ses-graph-node--active":this.isSelected()?"ses-graph-node--selected":"");durationMs_$=g(()=>this.node().data.durationMs??0);handleClick(){this.nodeClicked.emit(this.node().id)}static CATEGORY_FILL_MAP={[f.phase]:"#1a1a2e",[f.milestone]:"#052e16",[f.llmCall]:"#1e1033",[f.toolCall]:"#2e2a05",[f.toolError]:"#2e1505",[f.loopIteration]:"#0a1628",[f.action]:"#1a1a2e",[f.error]:"#2e0505"};static CATEGORY_STROKE_MAP={[f.phase]:"#525252",[f.milestone]:"#22c55e",[f.llmCall]:"#a855f7",[f.toolCall]:"#eab308",[f.toolError]:"#f97316",[f.loopIteration]:"#3b82f6",[f.action]:"#3b82f6",[f.error]:"#ef4444"};static CATEGORY_ICON_MAP={[f.milestone]:"\u26A1",[f.llmCall]:"\u{1F9E0}",[f.toolCall]:"\u{1F527}",[f.toolError]:"\u26A0\uFE0F",[f.error]:"\u274C"};static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ae({type:i,selectors:[["","appSesGraphNodeSvg",""]],inputs:{node:[1,"node"],isHighlighted:[1,"isHighlighted"],isSelected:[1,"isSelected"]},outputs:{nodeClicked:"nodeClicked"},standalone:!0,features:[le],attrs:ot,decls:7,vars:21,consts:[[2,"cursor","pointer",3,"click"],["dominant-baseline","central","text-anchor","start","font-size","14"],["dominant-baseline","central"],["text-anchor","end","dominant-baseline","central","font-size","11","font-weight","700"],["text-anchor","end","dominant-baseline","auto","fill","#737373","font-size","9"]],template:function(e,t){e&1&&(H(),p(0,"g",0),B("click",function(){return t.handleClick()}),W(1,"rect"),D(2,rt,2,3,":svg:text",1),p(3,"text",2),m(4),d(),D(5,at,2,4,":svg:text",3)(6,st,2,3,":svg:text",4),d()),e&2&&(se(t.animationClass_$()),Y("transform","translate("+t.node().x+","+t.node().y+")")("opacity",t.opacity_$()),u(),Y("width",t.node().width)("height",t.node().height)("rx",t.borderRadius_$())("fill",t.fillColor_$())("stroke",t.strokeColor_$())("stroke-width",t.isSelected()?2.5:1.5)("stroke-dasharray",t.strokeDashArray_$()),u(),S(t.icon_$()?2:-1),u(),Y("x",t.icon_$()?30:t.node().width/2)("y",t.node().height/2+1)("text-anchor",t.icon_$()?"start":"middle")("fill",t.textColor_$())("font-size",t.node().category==="phase"||t.node().category==="milestone"?14:12)("font-weight",t.node().category==="phase"||t.node().category==="milestone"?600:400),u(),L(t.node().label),u(),S(t.stateIcon_$()?5:-1),u(),S(t.durationMs_$()?6:-1))},dependencies:[de],encapsulation:2})};function lt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Phase"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.node().phase)}}function dt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Step"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.stepLabel_$())}}function ct(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Duration"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.durationLabel_$())}}function pt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Tool"),d(),p(3,"span",12),m(4),d()()),i&2){let e=C();u(4),L(e.toolId_$())}}function ht(i,o){if(i&1&&(p(0,"div",10)(1,"span",13),m(2,"Intent"),d(),p(3,"span",14),m(4),d()()),i&2){let e=C();u(4),L(e.intent_$())}}function ut(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Iteration"),d(),p(3,"span",15),m(4),d()()),i&2){let e=C();u(4),_e("#",e.node().iterationIndex,"")}}function mt(i,o){if(i&1&&(p(0,"span",13),m(1," In: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.inputSize_$())}}function _t(i,o){if(i&1&&(p(0,"span",13),m(1," Out: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.outputSize_$())}}function ft(i,o){if(i&1&&(p(0,"div",11),D(1,mt,4,1,"span",13)(2,_t,4,1,"span",13),d()),i&2){let e=C();u(),S(e.inputSize_$()>0?1:-1),u(),S(e.outputSize_$()>0?2:-1)}}function gt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Provider"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedProvider_$())}}function xt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Model"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedModel_$())}}function yt(i,o){if(i&1&&(p(0,"span",13),m(1," Cost: "),p(2,"span",27),m(3),d()()),i&2){let e=C(4);u(3),L(e.costUsd_$())}}function St(i,o){if(i&1&&(p(0,"div",25)(1,"span",13),m(2," Tokens: "),p(3,"span",9),m(4),d()(),D(5,yt,4,1,"span",13),d()),i&2){let e=C(3);u(4),L(e.tokenInfo_$().total),u(),S(e.costUsd_$()?5:-1)}}function Ct(i,o){if(i&1&&(p(0,"div",16)(1,"div",23),m(2,"Used"),d(),p(3,"div",24),D(4,gt,5,1,"div",7)(5,xt,5,1,"div",7)(6,St,6,2,"div",25),d()()),i&2){let e=C(2);u(4),S(e.usedProvider_$()?4:-1),u(),S(e.usedModel_$()?5:-1),u(),S(e.tokenInfo_$()?6:-1)}}function vt(i,o){if(i&1){let e=ie();p(0,"button",28),B("click",function(){R(e);let n=C(2);return z(n.handleClearOverride())}),m(1," Clear "),d()}}function It(i,o){i&1&&(p(0,"div",21),m(1," Session override active "),d())}function Et(i,o){if(i&1&&(p(0,"div",22)(1,"div",29),m(2,"Global default"),d(),p(3,"div",30),m(4),d()()),i&2){let e=C(2);u(4),ze(" ",e.globalDefault_$().provider," / ",e.globalDefault_$().model," ")}}function Nt(i,o){if(i&1){let e=ie();D(0,Ct,7,3,"div",16),p(1,"div",16)(2,"div",17)(3,"div",18),m(4),d(),D(5,vt,2,0,"button",19),d(),p(6,"app-s-registry-provider-model-select",20),B("modelChange",function(n){R(e);let r=C();return z(r.handleModelChange(n))}),d(),D(7,It,2,0,"div",21),d(),D(8,Et,5,2,"div",22)}if(i&2){let e=C();S(e.usedProvider_$()||e.usedModel_$()?0:-1),u(4),_e(" Override: ",e.callTypeLabel_$()," "),u(),S(e.hasSessionOverride_$()?5:-1),u(),me("selectedProvider",e.selectedProvider_$())("selectedModel",e.selectedModel_$()),u(),S(e.hasSessionOverride_$()?7:-1),u(),S(e.globalDefault_$()?8:-1)}}var Ke=(()=>{class i{graph_DS=Z(Ze);session_DS=Z(Ce);registrySsot_CS=Z(Be);node=F.required();closed=ne();stateLabel_$=g(()=>({pending:"Pending",active:"Active",completed:"Completed",error:"Error"})[this.node().state]??this.node().state);durationLabel_$=g(()=>{let e=this.node().data.durationMs;return!e||e<=0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`});toolId_$=g(()=>{let e=this.node().data,t=e.toolId??e.tool;return typeof t=="string"?t:""});intent_$=g(()=>{let e=this.node().data.intent;return typeof e=="string"?e:""});stepLabel_$=g(()=>{let e=this.node().data.step;return typeof e!="string"||e.length===0?"":ve.formatStepId(e)});inputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.inputSize??0:0});outputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.outputSize??0:0});stateColorClass_$=g(()=>({pending:"text-neutral-500",active:"text-cyan-400",completed:"text-green-400",error:"text-red-400"})[this.node().state]??"text-neutral-400");isLlmCall_$=g(()=>this.node().category===f.llmCall);callType_$=g(()=>{let e=this.node().data?.callType;return typeof e=="string"?e:""});callTypeLabel_$=g(()=>{let e=this.callType_$();return Ye[e]??e});usedProvider_$=g(()=>{let e=this.node().data?.provider;return typeof e=="string"?e:""});usedModel_$=g(()=>{let e=this.node().data?.model;return typeof e=="string"?e:""});sessionOverride_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$();if(!t)return null;let r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.llmCallTypeOverrides;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});globalDefault_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$(),r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.globalCallTypeDefaults;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});selectedProvider_$=g(()=>this.sessionOverride_$()?.provider??"");selectedModel_$=g(()=>this.sessionOverride_$()?.model??"");hasSessionOverride_$=g(()=>this.sessionOverride_$()!==null);tokenInfo_$=g(()=>{let e=this.node().data,t=e.promptTokens,n=e.completionTokens,r=e.totalTokens;return typeof r!="number"||r<=0?null:{prompt:typeof t=="number"?t:0,completion:typeof n=="number"?n:0,total:r}});costUsd_$=g(()=>{let e=this.node().data?.costUsd;return typeof e!="number"||e<=0?"":`$${e.toFixed(4)}`});handleClose(){this.closed.emit()}handleProviderChange(e){}handleModelChange(e){let t=this.callType_$(),n=this.graph_DS.graphSessionId_$();if(!t||!n||!e)return;let s=this.registrySsot_CS.enabledLlmModels_$().find(a=>a.modelName===e);s&&this.applySessionOverride(n,t,s.provider,s.modelName)}handleClearOverride(){let e=this.callType_$(),t=this.graph_DS.graphSessionId_$();!e||!t||this.clearSessionOverride(t,e)}applySessionOverride(e,t,n,r){let h=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},l=w(I({},h),{[t]:{provider:n,model:r}});this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:l}}).then(()=>{this.session_DS.loadSessionInfo(e)})}clearSessionOverride(e,t){let s=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},a=I({},s);Reflect.deleteProperty(a,t);let h=Object.keys(a).length>0;this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:h?a:null}}).then(()=>{this.session_DS.loadSessionInfo(e)})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-node-detail"]],inputs:{node:[1,"node"]},outputs:{closed:"closed"},standalone:!0,features:[le],decls:26,vars:13,consts:[[1,"w-80","max-h-[28rem]","overflow-y-auto","rounded-lg","border","border-neonCyan/30","bg-neutral-900/95","shadow-lg","backdrop-blur-sm","p-3"],[1,"flex","items-start","justify-between","gap-2","mb-2"],[1,"text-sm","font-semibold","text-neutral-200","leading-tight"],["title","Bez\xE1r\xE1s","aria-label","Bez\xE1r\xE1s",1,"p-1","min-h-[28px]","min-w-[28px]","flex","items-center","justify-center","rounded","text-neutral-400","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M18 6L6 18M6 6l12 12"],[1,"space-y-1.5","text-xs"],[1,"flex","items-center","gap-2"],[1,"text-neutral-500","w-16","shrink-0"],[1,"text-neutral-300"],[1,"flex","flex-col","gap-0.5"],[1,"flex","items-center","gap-3","pt-1","border-t","border-neutral-800"],[1,"text-yellow-300","font-mono","text-[11px]"],[1,"text-neutral-500"],[1,"text-neutral-300","text-[11px]","leading-tight","break-words"],[1,"text-blue-400"],[1,"mt-3","pt-2","border-t","border-neutral-700"],[1,"flex","items-center","justify-between","mb-1.5"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors"],["registryKind","llm","providerLabel","Provider","modelLabel","Model",3,"modelChange","selectedProvider","selectedModel"],[1,"mt-1.5","text-[10px]","text-purple-400"],[1,"mt-2","pt-1.5","border-t","border-neutral-800"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1.5"],[1,"space-y-1","text-xs"],[1,"flex","items-center","gap-3"],[1,"text-purple-300","font-mono","text-[11px]"],[1,"text-green-400"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors",3,"click"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1"],[1,"text-[11px]","text-neutral-400","font-mono"]],template:function(t,n){t&1&&(p(0,"div",0)(1,"div",1)(2,"h3",2),m(3),d(),p(4,"button",3),B("click",function(){return n.handleClose()}),H(),p(5,"svg",4),W(6,"path",5),d()()(),ye(),p(7,"div",6)(8,"div",7)(9,"span",8),m(10,"State"),d(),p(11,"span"),m(12),d()(),p(13,"div",7)(14,"span",8),m(15,"Type"),d(),p(16,"span",9),m(17),d()(),D(18,lt,5,1,"div",7)(19,dt,5,1,"div",7)(20,ct,5,1,"div",7)(21,pt,5,1,"div",7)(22,ht,5,1,"div",10)(23,ut,5,1,"div",7)(24,ft,3,2,"div",11),d(),D(25,Nt,9,7),d()),t&2&&(u(3),L(n.node().label),u(8),se(n.stateColorClass_$()+" font-medium"),u(),L(n.stateLabel_$()),u(5),L(n.node().category),u(),S(n.node().phase?18:-1),u(),S(n.stepLabel_$()?19:-1),u(),S(n.durationLabel_$()?20:-1),u(),S(n.toolId_$()?21:-1),u(),S(n.intent_$()?22:-1),u(),S(n.node().iterationIndex!==null?23:-1),u(),S(n.inputSize_$()>0||n.outputSize_$()>0?24:-1),u(),S(n.isLlmCall_$()&&n.callType_$()?25:-1))},dependencies:[de,Fe],encapsulation:2})}return i})();var $t=["graphSvg"],Qe=(i,o)=>o.id;function bt(i,o){i&1&&(p(0,"span",7),m(1,"Loading trace..."),d())}function Lt(i,o){if(i&1&&(H(),W(0,"rect",16)),i&2){let e=o;Y("x",e.x)("y",e.y)("width",e.width)("height",e.height)}}function wt(i,o){if(i&1&&(H(),W(0,"path",17)),i&2){let e=o.$implicit;Y("d",e.pathD)("stroke",e.strokeColor)("stroke-dasharray",e.strokeDashArray)("marker-end",e.markerEnd)}}function Tt(i,o){if(i&1){let e=ie();H(),p(0,"g",20),B("nodeClicked",function(n){R(e);let r=C();return z(r.handleNodeClick(n))}),d()}if(i&2){let e=o.$implicit,t=C();me("node",e)("isHighlighted",t.activeNodeId()===e.id)("isSelected",t.selectedNodeId()===e.id)}}function Mt(i,o){if(i&1){let e=ie();p(0,"app-ses-graph-node-detail",21),B("closed",function(){R(e);let n=C();return z(n.handleDetailClose())}),d()}i&2&&me("node",o)}var Gn=(()=>{class i{svgRef;layout=F(null);activeNodeId=F("");selectedNodeId=F("");isLoading=F(!1);nodeClicked=ne();detailClosed=ne();viewBox_$=V({x:0,y:0,width:800,height:600});viewBoxStr_$=g(()=>{let e=this.viewBox_$();return`${e.x} ${e.y} ${e.width} ${e.height}`});isFollowActive_$=V(!0);isPanning=!1;panStartX=0;panStartY=0;panStartViewBoxX=0;panStartViewBoxY=0;nodes_$=g(()=>this.layout()?.nodes??[]);edges_$=g(()=>this.layout()?.edges??[]);loopBounds_$=g(()=>this.layout()?.loopContainerBounds??null);selectedNode_$=g(()=>{let e=this.selectedNodeId();return e?this.nodes_$().find(t=>t.id===e)??null:null});constructor(){Se(()=>{let e=this.layout();e&&this.viewBox_$.set(I({},e.viewBox))},{allowSignalWrites:!0})}handleNodeClick(e){this.nodeClicked.emit(e)}handleDetailClose(){this.detailClosed.emit()}handlePointerDown(e){if(e.button!==0)return;this.isPanning=!0,this.panStartX=e.clientX,this.panStartY=e.clientY;let t=this.viewBox_$();this.panStartViewBoxX=t.x,this.panStartViewBoxY=t.y,this.svgRef&&this.svgRef.nativeElement.setPointerCapture(e.pointerId)}handlePointerMove(e){if(!this.isPanning||!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=n.width/t.clientWidth,s=n.height/t.clientHeight,a=(e.clientX-this.panStartX)*r,h=(e.clientY-this.panStartY)*s;this.viewBox_$.set(w(I({},n),{x:this.panStartViewBoxX-a,y:this.panStartViewBoxY-h}))}handlePointerUp(){this.isPanning=!1}handleWheel(e){if(e.preventDefault(),!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=e.deltaY>0?1.1:.9,s=t.getBoundingClientRect(),a=(e.clientX-s.left)/s.width,h=(e.clientY-s.top)/s.height,l=n.width*r,c=n.height*r;if(l<200||l>5e3)return;let _=n.x+(n.width-l)*a,y=n.y+(n.height-c)*h;this.viewBox_$.set({x:_,y,width:l,height:c})}handleFitToView(){let e=this.nodes_$();if(e.length===0)return;let t=P.recalculateViewBox(e,48);this.viewBox_$.set(t)}handleToggleFollowActive(){this.isFollowActive_$.update(e=>!e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-view"]],viewQuery:function(t,n){if(t&1&&Ge($t,5),t&2){let r;Oe(r=Re())&&(n.svgRef=r.first)}},inputs:{layout:[1,"layout"],activeNodeId:[1,"activeNodeId"],selectedNodeId:[1,"selectedNodeId"],isLoading:[1,"isLoading"]},outputs:{nodeClicked:"nodeClicked",detailClosed:"detailClosed"},standalone:!0,features:[le],decls:25,vars:6,consts:[["graphSvg",""],[1,"flex","flex-col","h-full","w-full","overflow-hidden"],[1,"flex","items-center","gap-2","px-3","py-2","border-b","border-neutral-800","shrink-0","bg-neutral-900/80"],["title","Fit to view",1,"px-2","py-1","text-xs","border","rounded","transition-colors","border-neutral-700","text-neutral-400","hover:text-neutral-200","hover:border-neutral-500",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","inline-block","mr-1"],["d","M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"],["title","Follow active node",1,"px-2","py-1","text-xs","border","rounded","transition-colors",3,"click"],[1,"text-xs","text-neutral-500","ml-auto"],[1,"flex-1","min-h-0","relative"],["preserveAspectRatio","xMidYMid meet",1,"ses-graph-svg",3,"pointerdown","pointermove","pointerup","pointerleave","wheel"],["id","ses-arrow-seq","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#525252"],["id","ses-arrow-loop","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#3b82f6"],["id","ses-arrow-error","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#f97316"],["rx","6","fill","#0f172a","stroke","#1e3a5f","stroke-width","1","stroke-dasharray","4 2","opacity","0.5"],["stroke-width","1.5","fill","none"],["appSesGraphNodeSvg","",3,"node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"node"],["appSesGraphNodeSvg","",3,"nodeClicked","node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"closed","node"]],template:function(t,n){if(t&1){let r=ie();p(0,"div",1)(1,"div",2)(2,"button",3),B("click",function(){return R(r),z(n.handleFitToView())}),H(),p(3,"svg",4),W(4,"path",5),d(),m(5," Fit "),d(),ye(),p(6,"button",6),B("click",function(){return R(r),z(n.handleToggleFollowActive())}),m(7," Follow "),d(),D(8,bt,2,0,"span",7),d(),p(9,"div",8),H(),p(10,"svg",9,0),B("pointerdown",function(a){return R(r),z(n.handlePointerDown(a))})("pointermove",function(a){return R(r),z(n.handlePointerMove(a))})("pointerup",function(){return R(r),z(n.handlePointerUp())})("pointerleave",function(){return R(r),z(n.handlePointerUp())})("wheel",function(a){return R(r),z(n.handleWheel(a))}),p(12,"defs")(13,"marker",10),W(14,"path",11),d(),p(15,"marker",12),W(16,"path",13),d(),p(17,"marker",14),W(18,"path",15),d()(),D(19,Lt,1,4,":svg:rect",16),Le(20,wt,1,4,":svg:path",17,Qe),Le(22,Tt,1,3,":svg:g",18,Qe),d(),D(24,Mt,1,1,"app-ses-graph-node-detail",19),d()()}if(t&2){let r,s;u(6),se(n.isFollowActive_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-500"),u(2),S(n.isLoading()?8:-1),u(2),Y("viewBox",n.viewBoxStr_$()),u(9),S((r=n.loopBounds_$())?19:-1,r),u(),we(n.edges_$()),u(2),we(n.nodes_$()),u(2),S((s=n.selectedNode_$())?24:-1,s)}},dependencies:[de,$e,Ke],styles:[`@charset "UTF-8";@keyframes _ngcontent-%COMP%_ses-graph-node-pulse{0%,to{filter:drop-shadow(0 0 4px var(--ses-graph-pulse-color, #22d3ee))}50%{filter:drop-shadow(0 0 12px var(--ses-graph-pulse-color, #22d3ee))}}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.ses-graph-svg[_ngcontent-%COMP%]{width:100%;height:100%;background:#0a0a0a;-webkit-user-select:none;user-select:none} .ses-graph-node--active{animation:_ngcontent-%COMP%_ses-graph-node-pulse 1.5s ease-in-out infinite} .ses-graph-node--active rect{stroke-width:2.5} .ses-graph-node--selected{filter:drop-shadow(0 0 6px rgba(34,211,238,.4))}
2
2
  /*# sourceMappingURL=ses-graph-view.component-5NATWVIS.css.map */`]})}return i})();export{qe as a,ve as b,x as c,k as d,f as e,P as f,Ze as g,Gn as h};
3
- //# sourceMappingURL=chunk-HGKIQDDN.js.map
3
+ //# sourceMappingURL=chunk-AU324OLU.js.map
@@ -1,3 +1,3 @@
1
- import{c as Y,f as K,i as X,v as J}from"./chunk-EO4DNTT4.js";import{$ as Q,Aa as G,Ba as N,D as M,Fa as u,Ga as T,Ha as O,J as c,K as p,L as w,M as E,T as h,Ta as q,U as m,V as U,X as H,Z as l,_ as P,aa as I,da as b,fa as R,ga as v,ha as L,ia as $,ja as y,jb as W,k as j,la as x,na as F,oa as A,pa as V,qa as o,ra as r,sa as g,ua as S,ub as D,va as _,wa as s,xa as z,ya as k,za as B}from"./chunk-TBMJSIBB.js";var ie=[[["","sSessionToolbarLeft",""]],[["","sSessionToolbarCenter",""]],[["","sSessionToolbarRight",""]]],oe=["[sSessionToolbarLeft]","[sSessionToolbarCenter]","[sSessionToolbarRight]"],Ne=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["app-s-session-shell-toolbar"]],hostAttrs:[1,"block","shrink-0","w-full","min-w-0"],standalone:!0,features:[q],ngContentSelectors:oe,decls:7,vars:0,consts:[[1,"grid","grid-cols-[1fr_auto_1fr]","items-center","gap-x-1","gap-y-1","p-1","border-b","border-neonDefault","bg-ccapSurface","w-full","min-w-0"],[1,"flex","items-center","gap-1","min-w-0","justify-self-start"],[1,"flex","items-center","justify-center","gap-2","min-w-0","max-w-[min(100vw-12rem,42rem)]","justify-self-center"],[1,"flex","items-center","gap-1","min-w-0","justify-self-end","flex-wrap","justify-end"]],template:function(i,n){i&1&&(z(ie),o(0,"div",0)(1,"div",1),k(2),r(),o(3,"div",2),k(4,1),r(),o(5,"div",3),k(6,2),r()())},dependencies:[D],encapsulation:2})}return t})();var re=[[["","sSessionShellMain",""]],[["","sSessionShellRightPanel",""]],[["","sSessionShellSidebar",""]]],ae=["[sSessionShellMain]","[sSessionShellRightPanel]","[sSessionShellSidebar]"];function se(t,d){if(t&1){let e=S();o(0,"div",2),_("click",function(){c(e);let n=s();return p(n.mobileBackdropClicked.emit())}),r()}}function le(t,d){if(t&1){let e=S();o(0,"div",3),k(1,2),r(),o(2,"div",4),_("pointerdown",function(n){c(e);let a=s();return p(a.sidebarResizeStart.emit(n))}),r()}if(t&2){let e=s();L("width",e.sidebarWidthPx(),"px")}}var Je=(()=>{class t{isSidebarOpen=m(!0);sidebarWidthPx=m(320);isResizing=m(!1);sidebarResizeStart=h();isMobileBackdropActive=m(!1);mobileBackdropClicked=h();static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["app-s-resizable-session-shell-layout"]],hostAttrs:[1,"block","flex","flex-1","min-h-0","w-full","overflow-hidden"],inputs:{isSidebarOpen:[1,"isSidebarOpen"],sidebarWidthPx:[1,"sidebarWidthPx"],isResizing:[1,"isResizing"],isMobileBackdropActive:[1,"isMobileBackdropActive"]},outputs:{sidebarResizeStart:"sidebarResizeStart",mobileBackdropClicked:"mobileBackdropClicked"},standalone:!0,features:[q],ngContentSelectors:ae,decls:5,vars:2,consts:[["aria-hidden","true",1,"fixed","inset-0","z-30","bg-black/50","xs:block","gt-xs:hidden"],[1,"flex","min-h-0","min-w-0","flex-1","flex-col","overflow-hidden","bg-ccapBg","self-stretch"],["aria-hidden","true",1,"fixed","inset-0","z-30","bg-black/50","xs:block","gt-xs:hidden",3,"click"],[1,"border-r","border-neonDefault","bg-ccapSurface","flex","flex-col","min-h-0","overflow-hidden","shrink-0","self-stretch"],[1,"w-1","shrink-0","cursor-col-resize","hover:bg-ccapAccent/40","active:bg-ccapAccent/60","transition-colors","touch-none",3,"pointerdown"]],template:function(i,n){i&1&&(z(re),b(0,se,1,0,"div",0)(1,le,3,2),o(2,"div",1),k(3),r(),k(4,1)),i&2&&(x(n.isMobileBackdropActive()?0:-1),l(),x(n.isSidebarOpen()?1:-1))},dependencies:[D],encapsulation:2})}return t})();var de=["textareaEl"],ce=[[["","sInputTextareaAccessory",""]]],pe=["[sInputTextareaAccessory]"],ue=(t,d)=>d.id,me=(t,d)=>d.queueItemId;function _e(t,d){t&1&&g(0,"div",3)}function fe(t,d){if(t&1){let e=S();o(0,"div",18),g(1,"img",20),o(2,"button",21),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.handleRemoveAttachment(n.id))}),u(3," \xD7 "),r()()}if(t&2){let e=s().$implicit;l(),v("src",e.previewUrl,H)}}function xe(t,d){if(t&1){let e=S();o(0,"div",19),w(),o(1,"svg",22),g(2,"path",23)(3,"polyline",24),r(),E(),o(4,"span",25),u(5),r(),o(6,"button",26),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.handleRemoveAttachment(n.id))}),u(7," \xD7 "),r()()}if(t&2){let e=s().$implicit;l(5),T(e.fileName)}}function he(t,d){if(t&1&&b(0,fe,4,1,"div",18)(1,xe,8,1,"div",19),t&2){let e=d.$implicit;x(e.isImage&&e.previewUrl?0:1)}}function ge(t,d){if(t&1&&(o(0,"div",5),A(1,he,2,1,null,null,ue),r()),t&2){let e=s();l(),V(e.pendingAttachments)}}function Ce(t,d){t&1&&(o(0,"span",32),u(1,"Editing"),r())}function Se(t,d){if(t&1){let e=S();o(0,"textarea",36),_("ngModelChange",function(n){c(e);let a=s(3);return p(a.queueEditTextChange.emit(n))}),u(1," "),r(),o(2,"div",37)(3,"button",38),_("click",function(){c(e);let n=s(3);return p(n.queueEditSave.emit())}),u(4," Save "),r(),o(5,"button",39),_("click",function(){c(e);let n=s(3);return p(n.queueEditCancel.emit())}),u(6," Cancel "),r()()}if(t&2){let e=s(3);v("ngModel",e.editingQueueText())}}function be(t,d){if(t&1){let e=S();o(0,"span",40),u(1),r(),o(2,"div",41)(3,"button",42),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueMoveUp.emit(n.queueItemId))}),w(),o(4,"svg",43),g(5,"path",44),r()(),E(),o(6,"button",45),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueMoveDown.emit(n.queueItemId))}),w(),o(7,"svg",43),g(8,"path",46),r()(),E(),o(9,"button",47),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueEditStart.emit(n.queueItemId))}),u(10," Edit "),r(),o(11,"button",48),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueRemoveItem.emit(n.queueItemId))}),u(12," \xD7 "),r(),o(13,"button",49),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueSendNow.emit(n.queueItemId))}),u(14," Send Now "),r()()}if(t&2){let e=s(),i=e.$implicit,n=e.$index,a=e.$count,f=s(2);l(),T(i.text),l(),$("opacity-100",!0),l(),v("disabled",f.isQueueLocked()||n===0),l(3),v("disabled",f.isQueueLocked()||n===a-1),l(3),v("disabled",f.isQueueLocked()),l(2),v("disabled",f.isQueueLocked()),l(2),v("disabled",f.isQueueLocked())}}function we(t,d){if(t&1&&(o(0,"div",35),b(1,Se,7,1)(2,be,15,8),r()),t&2){let e=d.$implicit,i=s(2);y(i.editingQueueItemId()===e.queueItemId?"bg-neutral-800 border border-neonAmber/30":"bg-neutral-800/40 hover:bg-neutral-800/70"),l(),x(i.editingQueueItemId()===e.queueItemId?1:2)}}function ve(t,d){if(t&1&&(o(0,"div",6)(1,"div",27),w(),o(2,"svg",28),g(3,"rect",29)(4,"rect",30)(5,"rect",31),r(),E(),o(6,"span"),u(7),r(),b(8,Ce,2,0,"span",32),r(),o(9,"div",33),A(10,we,3,3,"div",34,me),r()()),t&2){let e=s();l(7),O("Queued (",e.queueItems().length,")"),l(),x(e.isQueueLocked()?8:-1),l(2),V(e.queueItems())}}function ke(t,d){t&1&&g(0,"span",51)}function ye(t,d){t&1&&(w(),o(0,"svg",52),g(1,"polygon",56)(2,"polyline",57)(3,"line",58)(4,"line",59),r())}function Ee(t,d){t&1&&g(0,"span",54)}function Te(t,d){t&1&&(w(),o(0,"svg",55),g(1,"rect",60),r())}function Me(t,d){if(t&1){let e=S();o(0,"div",11)(1,"button",50),_("click",function(){c(e);let n=s();return p(n.handleQueueClick())}),b(2,ke,1,0,"span",51)(3,ye,5,0,":svg:svg",52),r(),o(4,"button",53),_("click",function(){c(e);let n=s();return p(n.handleStopClick())}),b(5,Ee,1,0,"span",54)(6,Te,2,0,":svg:svg",55),r()()}if(t&2){let e=s();l(),v("disabled",e.isSending()),l(),x(e.isSending()?2:3),l(2),v("disabled",e.isStopping()),R("aria-label",e.isStopping()?"Stopping\u2026":"Stop")("title",e.isStopping()?"Stopping\u2026":"Stop"),l(),x(e.isStopping()?5:6)}}function Ie(t,d){t&1&&g(0,"span",62)}function Re(t,d){t&1&&(w(),o(0,"svg",63),g(1,"line",64)(2,"polygon",65),r())}function Ae(t,d){if(t&1){let e=S();o(0,"button",61),_("click",function(){c(e);let n=s();return p(n.handleSendClick())}),b(1,Ie,1,0,"span",62)(2,Re,3,0,":svg:svg",63),r()}if(t&2){let e=s();v("disabled",e.isSending()),l(),x(e.isSending()?1:2)}}function Ve(t,d){if(t&1){let e=S();o(0,"label",14),w(),o(1,"svg",28),g(2,"path",66),r(),u(3," Attach "),E(),o(4,"input",67),_("change",function(n){c(e);let a=s();return p(a.handleFilesSelected(n))}),r()()}if(t&2){let e=s();l(4),v("accept",e.acceptedFileTypes())}}function ze(t,d){if(t&1){let e=S();o(0,"button",76),_("click",function(){let n=c(e).$implicit,a=s(3);return p(a.handleSelectMode(n))}),u(1),r()}if(t&2){let e=d.$implicit,i=s(3);y(e===i.selectedMode()?"text-neonCyan bg-neonCyan/10":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"),l(),O(" ",e," ")}}function qe(t,d){if(t&1&&(o(0,"div",74),A(1,ze,2,3,"button",75,F),r()),t&2){let e=s(2);l(),V(e.modeOptions())}}function De(t,d){if(t&1){let e=S();o(0,"div",15)(1,"button",68),_("click",function(){c(e);let n=s();return p(n.handleToggleModeDropdown())}),o(2,"span",69),u(3,"Mode"),r(),o(4,"span",70),u(5,":"),r(),o(6,"span",71),u(7),r(),w(),o(8,"svg",72),g(9,"path",73),r()(),b(10,qe,3,0,"div",74),r()}if(t&2){let e=s();l(),y(e.isModeDropdownOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-400 hover:text-neutral-300 hover:border-neutral-600"),R("aria-label","Mode: "+e.selectedMode()),l(6),T(e.selectedMode()),l(3),x(e.isModeDropdownOpen_$()?10:-1)}}function $e(t,d){if(t&1){let e=S();o(0,"button",76),_("click",function(){let n=c(e).$implicit,a=s(3);return p(a.handleSelectModel(n))}),u(1),r()}if(t&2){let e=d.$implicit,i=s(3);y(e===i.selectedModel()?"text-neonAmber bg-neonAmber/10":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"),l(),O(" ",e," ")}}function Oe(t,d){if(t&1&&(o(0,"div",74),A(1,$e,2,3,"button",75,F),r()),t&2){let e=s(2);l(),V(e.modelOptions())}}function Le(t,d){if(t&1){let e=S();o(0,"div",15)(1,"button",68),_("click",function(){c(e);let n=s();return p(n.handleToggleModelDropdown())}),o(2,"span",69),u(3,"Model"),r(),o(4,"span",70),u(5,":"),r(),o(6,"span",71),u(7),r(),w(),o(8,"svg",72),g(9,"path",73),r()(),b(10,Oe,3,0,"div",74),r()}if(t&2){let e=s();l(),y(e.isModelDropdownOpen_$()?"border-neonAmber/50 text-neonAmber bg-neonAmber/10":"border-neutral-700 text-neutral-400 hover:text-neutral-300 hover:border-neutral-600"),R("aria-label","Model: "+e.selectedModel()),l(6),T(e.selectedModel()),l(3),x(e.isModelDropdownOpen_$()?10:-1)}}function Fe(t,d){if(t&1){let e=S();o(0,"button",76),_("click",function(){let n=c(e).$implicit,a=s(3);return p(a.handleSelectEffort(n))}),u(1),r()}if(t&2){let e=d.$implicit,i=s(3);y(e===i.selectedEffort()?"text-neonPurple bg-neonPurple/10":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"),l(),O(" ",e," ")}}function je(t,d){if(t&1&&(o(0,"div",74),A(1,Fe,2,3,"button",75,F),r()),t&2){let e=s(2);l(),V(e.effortOptions())}}function Pe(t,d){if(t&1){let e=S();o(0,"div",15)(1,"button",68),_("click",function(){c(e);let n=s();return p(n.handleToggleEffortDropdown())}),o(2,"span",69),u(3,"Effort"),r(),o(4,"span",70),u(5,":"),r(),o(6,"span",71),u(7),r(),w(),o(8,"svg",72),g(9,"path",73),r()(),b(10,je,3,0,"div",74),r()}if(t&2){let e=s();l(),y(e.isEffortDropdownOpen_$()?"border-neonPurple/50 text-neonPurple bg-neonPurple/10":"border-neutral-700 text-neutral-400 hover:text-neutral-300 hover:border-neutral-600"),R("aria-label","Effort: "+e.selectedEffort()),l(6),T(e.selectedEffort()),l(3),x(e.isEffortDropdownOpen_$()?10:-1)}}function Ue(t,d){if(t&1&&(o(0,"div",17),w(),o(1,"svg",28),g(2,"circle",77)(3,"path",78),r(),E(),o(4,"span"),u(5),r()()),t&2){let e=s();l(5),T(e.usageText())}}var ee=["image/png","image/jpeg","image/webp","image/gif"],He=120,Qe=.4,st=(()=>{class t{elementRef;renderer;draftText=m("");placeholder=m("Send a prompt\u2026");textareaRows=m(3);draftTextChange=h();isExecuting=m(!1);isSending=m(!1);isStopping=m(!1);modeOptions=m([]);selectedMode=m("");modelOptions=m([]);selectedModel=m("");effortOptions=m([]);selectedEffort=m("");usageText=m("");queueItems=m([]);isQueueLocked=m(!1);editingQueueItemId=m(null);editingQueueText=m("");queueEditStart=h();queueEditTextChange=h();queueEditSave=h();queueEditCancel=h();queueRemoveItem=h();queueSendNow=h();queueMoveUp=h();queueMoveDown=h();enableAttachments=m(!1);acceptedFileTypes=m("image/png,image/jpeg,image/webp,image/gif,.txt,.pdf,.md,.json,.csv,.xml,.yaml,.yml,.log");maxAttachmentCount=m(6);sendRequested=h();queueRequested=h();stopRequested=h();modeChanged=h();modelChanged=h();effortChanged=h();attachmentsChanged=h();pendingAttachments=[];isModeDropdownOpen_$=I(!1);isModelDropdownOpen_$=I(!1);isEffortDropdownOpen_$=I(!1);isManualResize_$=I(!1);manualPanelHeight_$=I(300);textareaElRef;resizeStartY=0;resizeStartHeight=0;resizeMoveCleanup=null;resizeUpCleanup=null;resizeCancelCleanup=null;get hostHeightPx(){return this.isManualResize_$()?this.manualPanelHeight_$():void 0}constructor(e,i){this.elementRef=e,this.renderer=i,W(()=>{this.draftText(),this.isManualResize_$()||requestAnimationFrame(()=>{this.textareaElRef?.nativeElement&&this.adjustTextareaAutoGrow(this.textareaElRef.nativeElement)})})}ngOnDestroy(){this.cleanupResizeListeners();for(let e of this.pendingAttachments)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);this.pendingAttachments=[]}handleKeyDown(e){e.key!=="Enter"||e.shiftKey||(e.preventDefault(),this.emitSendOrQueue())}handleSendClick(){this.emitSendOrQueue()}handleQueueClick(){this.emitSendOrQueue()}handleStopClick(){this.isStopping()||this.stopRequested.emit()}handleTextareaInput(){this.isManualResize_$()||this.textareaElRef?.nativeElement&&this.adjustTextareaAutoGrow(this.textareaElRef.nativeElement)}handleResizeStart(e){e.preventDefault();let i=e.currentTarget;i instanceof HTMLElement&&i.setPointerCapture(e.pointerId),this.resizeStartY=e.clientY,this.resizeStartHeight=this.elementRef.nativeElement.offsetHeight,this.resizeMoveCleanup=this.renderer.listen("document","pointermove",n=>{this.handleResizeMove(n)}),this.resizeUpCleanup=this.renderer.listen("document","pointerup",()=>{i instanceof HTMLElement&&i.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.cleanupResizeListeners()}),this.resizeCancelCleanup=this.renderer.listen("document","pointercancel",()=>{i instanceof HTMLElement&&i.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.cleanupResizeListeners()})}handleResizeReset(){this.isManualResize_$.set(!1),requestAnimationFrame(()=>{this.textareaElRef?.nativeElement&&this.adjustTextareaAutoGrow(this.textareaElRef.nativeElement)})}handleToggleModeDropdown(){this.closeAllDropdownsExcept("mode"),this.isModeDropdownOpen_$.set(!this.isModeDropdownOpen_$())}handleToggleModelDropdown(){this.closeAllDropdownsExcept("model"),this.isModelDropdownOpen_$.set(!this.isModelDropdownOpen_$())}handleToggleEffortDropdown(){this.closeAllDropdownsExcept("effort"),this.isEffortDropdownOpen_$.set(!this.isEffortDropdownOpen_$())}handleSelectMode(e){this.isModeDropdownOpen_$.set(!1),this.modeChanged.emit(e)}handleSelectModel(e){this.isModelDropdownOpen_$.set(!1),this.modelChanged.emit(e)}handleSelectEffort(e){this.isEffortDropdownOpen_$.set(!1),this.effortChanged.emit(e)}handleFilesSelected(e){return j(this,null,function*(){let i=e.target,n=i?.files??null;n?.length&&(yield this.addFiles(Array.from(n)),i&&(i.value=""))})}handlePaste(e){if(!this.enableAttachments())return;let i=e.clipboardData?.items;if(!i?.length)return;let n=[];for(let a=0;a<i.length;a++){let f=i[a];if(f.kind==="file"&&ee.some(C=>f.type.toLowerCase().startsWith(C))){let C=f.getAsFile();C&&n.push(C)}}n.length&&(e.preventDefault(),this.addFiles(n))}handleRemoveAttachment(e){let i=this.pendingAttachments.find(n=>n.id===e);i?.previewUrl&&URL.revokeObjectURL(i.previewUrl),this.pendingAttachments=this.pendingAttachments.filter(n=>n.id!==e),this.attachmentsChanged.emit(this.pendingAttachments)}clearAttachments(){for(let e of this.pendingAttachments)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);this.pendingAttachments=[],this.attachmentsChanged.emit(this.pendingAttachments)}emitSendOrQueue(){if(this.isSending())return;let e=(this.draftText()??"").trim().length>0,i=this.pendingAttachments.length>0;!e&&!i||(this.isExecuting()?this.queueRequested.emit():this.sendRequested.emit())}adjustTextareaAutoGrow(e){e.style.height="auto";let i=Math.round(window.innerHeight*Qe),n=Math.min(e.scrollHeight,i);e.style.height=n+"px"}handleResizeMove(e){let i=this.isManualResize_$(),n=this.resizeStartY-e.clientY,a=Math.round(window.innerHeight*.7),f=Math.max(He,Math.min(this.resizeStartHeight+n,a));this.isManualResize_$.set(!0),this.manualPanelHeight_$.set(f),!i&&this.textareaElRef?.nativeElement&&(this.textareaElRef.nativeElement.style.height="")}cleanupResizeListeners(){this.resizeMoveCleanup&&(this.resizeMoveCleanup(),this.resizeMoveCleanup=null),this.resizeUpCleanup&&(this.resizeUpCleanup(),this.resizeUpCleanup=null),this.resizeCancelCleanup&&(this.resizeCancelCleanup(),this.resizeCancelCleanup=null)}closeAllDropdownsExcept(e){e!=="mode"&&this.isModeDropdownOpen_$.set(!1),e!=="model"&&this.isModelDropdownOpen_$.set(!1),e!=="effort"&&this.isEffortDropdownOpen_$.set(!1)}addFiles(e){return j(this,null,function*(){let i=this.maxAttachmentCount()-this.pendingAttachments.length;if(i<=0)return;let n=e.slice(0,i);for(let a of n)try{let f=yield this.readFileToBase64(a),C=ee.some(ne=>a.type.toLowerCase().startsWith(ne)),te={id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`att-${Date.now()}-${Math.random()}`,fileName:a.name,mimeType:a.type||"application/octet-stream",base64:f,previewUrl:C?URL.createObjectURL(a):void 0,sizeBytes:a.size,isImage:C};this.pendingAttachments=[...this.pendingAttachments,te]}catch{}this.attachmentsChanged.emit(this.pendingAttachments)})}readFileToBase64(e){return new Promise((i,n)=>{let a=new FileReader;a.onload=()=>{let f=String(a.result??""),C=f.indexOf(",");i(C>=0?f.slice(C+1):f)},a.onerror=()=>{n(a.error)},a.readAsDataURL(e)})}static \u0275fac=function(i){return new(i||t)(P(U),P(Q))};static \u0275cmp=M({type:t,selectors:[["app-s-session-input"]],viewQuery:function(i,n){if(i&1&&B(de,5),i&2){let a;G(a=N())&&(n.textareaElRef=a.first)}},hostAttrs:[1,"flex","flex-col","shrink-0","border-t","border-neonDefault","bg-ccapSurface","relative","overflow-hidden"],hostVars:2,hostBindings:function(i,n){i&2&&L("height",n.hostHeightPx,"px")},inputs:{draftText:[1,"draftText"],placeholder:[1,"placeholder"],textareaRows:[1,"textareaRows"],isExecuting:[1,"isExecuting"],isSending:[1,"isSending"],isStopping:[1,"isStopping"],modeOptions:[1,"modeOptions"],selectedMode:[1,"selectedMode"],modelOptions:[1,"modelOptions"],selectedModel:[1,"selectedModel"],effortOptions:[1,"effortOptions"],selectedEffort:[1,"selectedEffort"],usageText:[1,"usageText"],queueItems:[1,"queueItems"],isQueueLocked:[1,"isQueueLocked"],editingQueueItemId:[1,"editingQueueItemId"],editingQueueText:[1,"editingQueueText"],enableAttachments:[1,"enableAttachments"],acceptedFileTypes:[1,"acceptedFileTypes"],maxAttachmentCount:[1,"maxAttachmentCount"]},outputs:{draftTextChange:"draftTextChange",queueEditStart:"queueEditStart",queueEditTextChange:"queueEditTextChange",queueEditSave:"queueEditSave",queueEditCancel:"queueEditCancel",queueRemoveItem:"queueRemoveItem",queueSendNow:"queueSendNow",queueMoveUp:"queueMoveUp",queueMoveDown:"queueMoveDown",sendRequested:"sendRequested",queueRequested:"queueRequested",stopRequested:"stopRequested",modeChanged:"modeChanged",modelChanged:"modelChanged",effortChanged:"effortChanged",attachmentsChanged:"attachmentsChanged"},standalone:!0,features:[q],ngContentSelectors:pe,decls:22,vars:20,consts:[["textareaEl",""],[1,"group","flex","items-center","justify-center","h-2.5","shrink-0","cursor-ns-resize","select-none","touch-none",3,"pointerdown","dblclick"],[1,"w-8","h-0.5","rounded-full","bg-neutral-600","transition-all","group-hover:bg-neonCyan/50","group-hover:w-12"],[1,"knight-rider-bar"],[1,"flex","flex-col","gap-2","p-2","flex-1","min-h-0"],[1,"flex","flex-wrap","gap-2"],[1,"flex","flex-col","gap-1","rounded","border","border-neutral-700/50","bg-neutral-900/60","p-2","text-[11px]"],[1,"flex","gap-2"],[1,"relative","min-w-0","flex-1"],[1,"min-h-[60px]","w-full","resize-none","rounded","border","border-neutral-700","bg-neutral-800","px-3","py-2","text-sm","text-neutral-200","placeholder-neutral-600","focus:border-ccapAccent","focus:outline-none",3,"ngModelChange","input","keydown","paste","placeholder","ngModel"],[1,"shrink-0","self-stretch","flex","flex-col","items-center","justify-between","gap-2"],[1,"flex","flex-col","items-center","gap-1.5"],["type","button","aria-label","Send","title","Send",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-ccapAccent","text-black","transition-all","duration-200","disabled:opacity-50","hover:bg-ccapAccent/80","hover:shadow-neon-glow-cyan","focus:outline-none","focus:ring-2","focus:ring-ccapAccent","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"disabled"],[1,"flex","flex-wrap","items-center","gap-2","text-[11px]","shrink-0"],[1,"flex","items-center","gap-1","px-2","py-1","rounded","border","border-neutral-700","text-neutral-400","hover:text-neutral-300","hover:border-neutral-600","cursor-pointer","transition-colors","shrink-0"],[1,"relative"],[1,"flex-1"],[1,"flex","items-center","gap-1.5","text-neutral-500","shrink-0"],[1,"relative","w-14","h-14","rounded","border","border-neonDefault","overflow-hidden","shrink-0"],[1,"relative","flex","items-center","gap-1","px-2","py-1","rounded","border","border-neonDefault","text-[10px]","text-neutral-400","shrink-0","max-w-[140px]"],["alt","",1,"w-full","h-full","object-cover",3,"src"],["type","button",1,"absolute","top-0","right-0","w-4","h-4","text-[10px]","leading-4","bg-black/70","text-white","border-0","cursor-pointer",3,"click"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","shrink-0","opacity-60"],["d","M7 1H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4L7 1z","stroke","currentColor","stroke-width","1"],["points","7 1 7 4 10 4","stroke","currentColor","stroke-width","1"],[1,"truncate"],["type","button",1,"ml-auto","w-3","h-3","text-[10px]","leading-3","text-neutral-500","hover:text-white","cursor-pointer","shrink-0",3,"click"],[1,"flex","items-center","gap-1.5","text-neutral-500","font-medium","mb-0.5"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","opacity-60"],["x","1","y","1","width","10","height","3","rx","0.5","stroke","currentColor","stroke-width","0.8"],["x","1","y","5","width","10","height","3","rx","0.5","stroke","currentColor","stroke-width","0.8","opacity","0.6"],["x","1","y","9","width","10","height","3","rx","0.5","stroke","currentColor","stroke-width","0.8","opacity","0.3"],[1,"ml-1","rounded","bg-neonAmber/15","px-1","py-px","text-[9px]","font-semibold","text-neonAmber","uppercase","tracking-wider"],[1,"flex","flex-col","gap-1","max-h-[280px]","overflow-y-auto","overscroll-contain","pr-1"],[1,"flex","items-start","gap-1.5","rounded","px-2","py-1.5","transition-colors",3,"class"],[1,"flex","items-start","gap-1.5","rounded","px-2","py-1.5","transition-colors"],["rows","2",1,"flex-1","min-h-[36px]","max-h-[100px]","resize-none","rounded","border","border-neutral-600","bg-neutral-900","px-2","py-1","text-[11px]","text-neutral-200","focus:border-neonAmber","focus:outline-none",3,"ngModelChange","ngModel"],[1,"flex","flex-col","gap-1","shrink-0"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","bg-neonAmber/20","text-neonAmber","hover:bg-neonAmber/30","transition-colors","cursor-pointer",3,"click"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-300","hover:bg-neutral-700","transition-colors","cursor-pointer",3,"click"],[1,"flex-1","text-neutral-300","break-words","whitespace-pre-wrap","leading-relaxed"],[1,"flex","items-center","gap-1","shrink-0","opacity-0","group-hover:opacity-100","transition-opacity"],["type","button","title","Move up",1,"px-1","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3"],["d","M6 3L3 7h6L6 3z","fill","currentColor"],["type","button","title","Move down",1,"px-1","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["d","M6 9L3 5h6L6 9z","fill","currentColor"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-red-400","hover:bg-red-950/30","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neonCyan","hover:bg-neonCyan/10","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["type","button","aria-label","Add to queue","title","Add to queue (Enter)",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-neutral-900","border-2","border-neonAmber/60","text-neonAmber","hover:border-neonAmber","hover:shadow-neon-glow-amber","hover:bg-neonAmber/10","transition-all","duration-200","disabled:opacity-40","focus:outline-none","focus:ring-2","focus:ring-neonAmber","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-neonAmber/40","border-t-neonAmber"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-5","h-5","shrink-0"],["type","button",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-neutral-900","border-2","border-neonRed/50","text-red-300","hover:border-neonRed","hover:shadow-neon-glow-red","transition-all","duration-200","disabled:opacity-40","focus:outline-none","focus:ring-2","focus:ring-neonRed","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-neonRed/40","border-t-neonRed"],["viewBox","0 0 24 24","fill","currentColor","aria-hidden","true",1,"w-5","h-5","shrink-0"],["points","18 3 2 9 9 12 18 3"],["points","18 3 11 19 9 12"],["x1","19","y1","15","x2","19","y2","21"],["x1","16","y1","18","x2","22","y2","18"],["x","6","y","6","width","12","height","12","rx","2"],["type","button","aria-label","Send","title","Send",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-ccapAccent","text-black","transition-all","duration-200","disabled:opacity-50","hover:bg-ccapAccent/80","hover:shadow-neon-glow-cyan","focus:outline-none","focus:ring-2","focus:ring-ccapAccent","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-black/40","border-t-black"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-5","h-5","shrink-0"],["x1","22","y1","2","x2","11","y2","13"],["points","22 2 15 22 11 13 2 9 22 2"],["d","M10.5 5.5l-4.3 4.3a2.5 2.5 0 0 1-3.5-3.5L7 2a1.7 1.7 0 0 1 2.4 2.4L5.1 8.7a.8.8 0 0 1-1.2-1.2L7.5 4","stroke","currentColor","stroke-width","1","stroke-linecap","round"],["type","file","multiple","",1,"sr-only",3,"change","accept"],["type","button",1,"flex","items-center","gap-1","px-2","py-0.5","rounded","border","transition-colors","cursor-pointer",3,"click"],[1,"uppercase","font-medium","tracking-wide","hidden","gt-xs:inline"],[1,"text-neutral-500","mx-0.5","hidden","gt-xs:inline"],[1,"capitalize"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","ml-0.5","opacity-50"],["d","M3 5l3 3 3-3","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"],[1,"absolute","bottom-full","left-0","mb-1","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-lg","overflow-hidden","z-20","min-w-[100px]"],["type","button",1,"w-full","text-left","px-3","py-1.5","text-[11px]","capitalize","transition-colors","cursor-pointer",3,"class"],["type","button",1,"w-full","text-left","px-3","py-1.5","text-[11px]","capitalize","transition-colors","cursor-pointer",3,"click"],["cx","6","cy","6","r","5","stroke","currentColor","stroke-width","1"],["d","M6 3v3.5l2 1.5","stroke","currentColor","stroke-width","1","stroke-linecap","round"]],template:function(i,n){if(i&1){let a=S();z(ce),o(0,"div",1),_("pointerdown",function(C){return c(a),p(n.handleResizeStart(C))})("dblclick",function(){return c(a),p(n.handleResizeReset())}),g(1,"div",2),r(),b(2,_e,1,0,"div",3),o(3,"div",4),b(4,ge,3,0,"div",5)(5,ve,12,2,"div",6),o(6,"div",7)(7,"div",8)(8,"textarea",9,0),_("ngModelChange",function(C){return c(a),p(n.draftTextChange.emit(C))})("input",function(){return c(a),p(n.handleTextareaInput())})("keydown",function(C){return c(a),p(n.handleKeyDown(C))})("paste",function(C){return c(a),p(n.handlePaste(C))}),u(10," "),r()(),o(11,"div",10),k(12),b(13,Me,7,6,"div",11)(14,Ae,3,2,"button",12),r()(),o(15,"div",13),b(16,Ve,5,1,"label",14)(17,De,11,5,"div",15)(18,Le,11,5,"div",15)(19,Pe,11,5,"div",15),g(20,"div",16),b(21,Ue,6,1,"div",17),r()()}i&2&&(l(2),x(n.isExecuting()?2:-1),l(2),x(n.pendingAttachments.length?4:-1),l(),x(n.queueItems().length?5:-1),l(),$("flex-1",n.isManualResize_$())("min-h-0",n.isManualResize_$()),l(),$("min-h-0",n.isManualResize_$()),l(),$("h-full",n.isManualResize_$()),v("placeholder",n.placeholder())("ngModel",n.draftText()),R("rows",n.textareaRows()),l(5),x(n.isExecuting()?13:14),l(3),x(n.enableAttachments()?16:-1),l(),x(n.modeOptions().length?17:-1),l(),x(n.modelOptions().length?18:-1),l(),x(n.effortOptions().length?19:-1),l(2),x(n.usageText()?21:-1))},dependencies:[D,J,Y,K,X],styles:[`@charset "UTF-8";.knight-rider-bar[_ngcontent-%COMP%]{position:absolute;top:-1px;left:0;right:0;height:2px;overflow:hidden;pointer-events:none;z-index:10}.knight-rider-bar[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(0,245,255,.15) 25%,rgba(0,212,255,.7) 45%,#00f5ff 50%,rgba(45,212,191,.9) 53%,rgba(0,212,255,.7) 55%,rgba(0,245,255,.15) 75%,transparent 100%);background-size:55% 100%;animation:_ngcontent-%COMP%_knight-rider-sweep 1.8s ease-in-out infinite alternate;filter:drop-shadow(0 0 4px #00f5ff) drop-shadow(0 0 10px rgba(0,245,255,.6))}@keyframes _ngcontent-%COMP%_knight-rider-sweep{0%{background-position:-55% center}to{background-position:155% center}}
1
+ import{c as Y,f as K,i as X,v as J}from"./chunk-EO4DNTT4.js";import{$ as Q,Aa as G,Ba as N,D as M,Fa as u,Ga as T,Ha as O,J as c,K as p,L as w,M as E,T as h,Ta as q,U as m,V as U,X as H,Z as l,_ as P,aa as I,da as b,fa as R,ga as v,ha as L,ia as $,ja as y,jb as W,k as j,la as x,na as F,oa as A,pa as V,qa as o,ra as r,sa as g,ua as S,ub as D,va as _,wa as s,xa as z,ya as k,za as B}from"./chunk-TBMJSIBB.js";var ie=[[["","sSessionToolbarLeft",""]],[["","sSessionToolbarCenter",""]],[["","sSessionToolbarRight",""]]],oe=["[sSessionToolbarLeft]","[sSessionToolbarCenter]","[sSessionToolbarRight]"],Ne=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["app-s-session-shell-toolbar"]],hostAttrs:[1,"block","shrink-0","w-full","min-w-0"],standalone:!0,features:[q],ngContentSelectors:oe,decls:7,vars:0,consts:[[1,"grid","grid-cols-[1fr_auto_1fr]","items-center","gap-x-1","gap-y-1","p-1","border-b","border-neonDefault","bg-ccapSurface","w-full","min-w-0"],[1,"flex","items-center","gap-1","min-w-0","justify-self-start"],[1,"flex","items-center","justify-center","gap-2","min-w-0","max-w-[min(100vw-12rem,42rem)]","justify-self-center"],[1,"flex","items-center","gap-1","min-w-0","justify-self-end","flex-wrap","justify-end"]],template:function(i,n){i&1&&(z(ie),o(0,"div",0)(1,"div",1),k(2),r(),o(3,"div",2),k(4,1),r(),o(5,"div",3),k(6,2),r()())},dependencies:[D],encapsulation:2})}return t})();var re=[[["","sSessionShellMain",""]],[["","sSessionShellRightPanel",""]],[["","sSessionShellSidebar",""]]],ae=["[sSessionShellMain]","[sSessionShellRightPanel]","[sSessionShellSidebar]"];function se(t,d){if(t&1){let e=S();o(0,"div",2),_("click",function(){c(e);let n=s();return p(n.mobileBackdropClicked.emit())}),r()}}function le(t,d){if(t&1){let e=S();o(0,"div",3),k(1,2),r(),o(2,"div",4),_("pointerdown",function(n){c(e);let a=s();return p(a.sidebarResizeStart.emit(n))}),r()}if(t&2){let e=s();L("width",e.sidebarWidthPx(),"px")}}var Je=(()=>{class t{isSidebarOpen=m(!0);sidebarWidthPx=m(320);isResizing=m(!1);sidebarResizeStart=h();isMobileBackdropActive=m(!1);mobileBackdropClicked=h();static \u0275fac=function(i){return new(i||t)};static \u0275cmp=M({type:t,selectors:[["app-s-resizable-session-shell-layout"]],hostAttrs:[1,"block","flex","flex-1","min-h-0","w-full","overflow-hidden"],inputs:{isSidebarOpen:[1,"isSidebarOpen"],sidebarWidthPx:[1,"sidebarWidthPx"],isResizing:[1,"isResizing"],isMobileBackdropActive:[1,"isMobileBackdropActive"]},outputs:{sidebarResizeStart:"sidebarResizeStart",mobileBackdropClicked:"mobileBackdropClicked"},standalone:!0,features:[q],ngContentSelectors:ae,decls:5,vars:2,consts:[["aria-hidden","true",1,"fixed","inset-0","z-30","bg-black/50","xs:block","gt-xs:hidden"],[1,"flex","min-h-0","min-w-0","flex-1","flex-col","overflow-hidden","bg-ccapBg","self-stretch"],["aria-hidden","true",1,"fixed","inset-0","z-30","bg-black/50","xs:block","gt-xs:hidden",3,"click"],[1,"border-r","border-neonDefault","bg-ccapSurface","flex","flex-col","min-h-0","overflow-hidden","shrink-0","self-stretch"],[1,"w-1","shrink-0","cursor-col-resize","hover:bg-ccapAccent/40","active:bg-ccapAccent/60","transition-colors","touch-none",3,"pointerdown"]],template:function(i,n){i&1&&(z(re),b(0,se,1,0,"div",0)(1,le,3,2),o(2,"div",1),k(3),r(),k(4,1)),i&2&&(x(n.isMobileBackdropActive()?0:-1),l(),x(n.isSidebarOpen()?1:-1))},dependencies:[D],encapsulation:2})}return t})();var de=["textareaEl"],ce=[[["","sInputTextareaAccessory",""]]],pe=["[sInputTextareaAccessory]"],ue=(t,d)=>d.id,me=(t,d)=>d.queueItemId;function _e(t,d){t&1&&g(0,"div",3)}function fe(t,d){if(t&1){let e=S();o(0,"div",18),g(1,"img",20),o(2,"button",21),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.handleRemoveAttachment(n.id))}),u(3," \xD7 "),r()()}if(t&2){let e=s().$implicit;l(),v("src",e.previewUrl,H)}}function xe(t,d){if(t&1){let e=S();o(0,"div",19),w(),o(1,"svg",22),g(2,"path",23)(3,"polyline",24),r(),E(),o(4,"span",25),u(5),r(),o(6,"button",26),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.handleRemoveAttachment(n.id))}),u(7," \xD7 "),r()()}if(t&2){let e=s().$implicit;l(5),T(e.fileName)}}function he(t,d){if(t&1&&b(0,fe,4,1,"div",18)(1,xe,8,1,"div",19),t&2){let e=d.$implicit;x(e.isImage&&e.previewUrl?0:1)}}function ge(t,d){if(t&1&&(o(0,"div",5),A(1,he,2,1,null,null,ue),r()),t&2){let e=s();l(),V(e.pendingAttachments)}}function Ce(t,d){t&1&&(o(0,"span",32),u(1,"Editing"),r())}function Se(t,d){if(t&1){let e=S();o(0,"textarea",36),_("ngModelChange",function(n){c(e);let a=s(3);return p(a.queueEditTextChange.emit(n))}),u(1," "),r(),o(2,"div",37)(3,"button",38),_("click",function(){c(e);let n=s(3);return p(n.queueEditSave.emit())}),u(4," Save "),r(),o(5,"button",39),_("click",function(){c(e);let n=s(3);return p(n.queueEditCancel.emit())}),u(6," Cancel "),r()()}if(t&2){let e=s(3);v("ngModel",e.editingQueueText())}}function be(t,d){if(t&1){let e=S();o(0,"span",40),u(1),r(),o(2,"div",41)(3,"button",42),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueMoveUp.emit(n.queueItemId))}),w(),o(4,"svg",43),g(5,"path",44),r()(),E(),o(6,"button",45),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueMoveDown.emit(n.queueItemId))}),w(),o(7,"svg",43),g(8,"path",46),r()(),E(),o(9,"button",47),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueEditStart.emit(n.queueItemId))}),u(10," Edit "),r(),o(11,"button",48),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueRemoveItem.emit(n.queueItemId))}),u(12," \xD7 "),r(),o(13,"button",49),_("click",function(){c(e);let n=s().$implicit,a=s(2);return p(a.queueSendNow.emit(n.queueItemId))}),u(14," Send Now "),r()()}if(t&2){let e=s(),i=e.$implicit,n=e.$index,a=e.$count,f=s(2);l(),T(i.text),l(),$("opacity-100",!0),l(),v("disabled",f.isQueueLocked()||n===0),l(3),v("disabled",f.isQueueLocked()||n===a-1),l(3),v("disabled",f.isQueueLocked()),l(2),v("disabled",f.isQueueLocked()),l(2),v("disabled",f.isQueueLocked())}}function we(t,d){if(t&1&&(o(0,"div",35),b(1,Se,7,1)(2,be,15,8),r()),t&2){let e=d.$implicit,i=s(2);y(i.editingQueueItemId()===e.queueItemId?"bg-neutral-800 border border-neonAmber/30":"bg-neutral-800/40 hover:bg-neutral-800/70"),l(),x(i.editingQueueItemId()===e.queueItemId?1:2)}}function ve(t,d){if(t&1&&(o(0,"div",6)(1,"div",27),w(),o(2,"svg",28),g(3,"rect",29)(4,"rect",30)(5,"rect",31),r(),E(),o(6,"span"),u(7),r(),b(8,Ce,2,0,"span",32),r(),o(9,"div",33),A(10,we,3,3,"div",34,me),r()()),t&2){let e=s();l(7),O("Queued (",e.queueItems().length,")"),l(),x(e.isQueueLocked()?8:-1),l(2),V(e.queueItems())}}function ke(t,d){t&1&&g(0,"span",51)}function ye(t,d){t&1&&(w(),o(0,"svg",52),g(1,"polygon",56)(2,"polyline",57)(3,"line",58)(4,"line",59),r())}function Ee(t,d){t&1&&g(0,"span",54)}function Te(t,d){t&1&&(w(),o(0,"svg",55),g(1,"rect",60),r())}function Me(t,d){if(t&1){let e=S();o(0,"div",11)(1,"button",50),_("click",function(){c(e);let n=s();return p(n.handleQueueClick())}),b(2,ke,1,0,"span",51)(3,ye,5,0,":svg:svg",52),r(),o(4,"button",53),_("click",function(){c(e);let n=s();return p(n.handleStopClick())}),b(5,Ee,1,0,"span",54)(6,Te,2,0,":svg:svg",55),r()()}if(t&2){let e=s();l(),v("disabled",e.isSending()),l(),x(e.isSending()?2:3),l(2),v("disabled",e.isStopping()),R("aria-label",e.isStopping()?"Stopping\u2026":"Stop")("title",e.isStopping()?"Stopping\u2026":"Stop"),l(),x(e.isStopping()?5:6)}}function Ie(t,d){t&1&&g(0,"span",62)}function Re(t,d){t&1&&(w(),o(0,"svg",63),g(1,"line",64)(2,"polygon",65),r())}function Ae(t,d){if(t&1){let e=S();o(0,"button",61),_("click",function(){c(e);let n=s();return p(n.handleSendClick())}),b(1,Ie,1,0,"span",62)(2,Re,3,0,":svg:svg",63),r()}if(t&2){let e=s();v("disabled",e.isSending()),l(),x(e.isSending()?1:2)}}function Ve(t,d){if(t&1){let e=S();o(0,"label",14),w(),o(1,"svg",28),g(2,"path",66),r(),u(3," Attach "),E(),o(4,"input",67),_("change",function(n){c(e);let a=s();return p(a.handleFilesSelected(n))}),r()()}if(t&2){let e=s();l(4),v("accept",e.acceptedFileTypes())}}function ze(t,d){if(t&1){let e=S();o(0,"button",76),_("click",function(){let n=c(e).$implicit,a=s(3);return p(a.handleSelectMode(n))}),u(1),r()}if(t&2){let e=d.$implicit,i=s(3);y(e===i.selectedMode()?"text-neonCyan bg-neonCyan/10":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"),l(),O(" ",e," ")}}function qe(t,d){if(t&1&&(o(0,"div",74),A(1,ze,2,3,"button",75,F),r()),t&2){let e=s(2);l(),V(e.modeOptions())}}function De(t,d){if(t&1){let e=S();o(0,"div",15)(1,"button",68),_("click",function(){c(e);let n=s();return p(n.handleToggleModeDropdown())}),o(2,"span",69),u(3,"Mode"),r(),o(4,"span",70),u(5,":"),r(),o(6,"span",71),u(7),r(),w(),o(8,"svg",72),g(9,"path",73),r()(),b(10,qe,3,0,"div",74),r()}if(t&2){let e=s();l(),y(e.isModeDropdownOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-400 hover:text-neutral-300 hover:border-neutral-600"),R("aria-label","Mode: "+e.selectedMode()),l(6),T(e.selectedMode()),l(3),x(e.isModeDropdownOpen_$()?10:-1)}}function $e(t,d){if(t&1){let e=S();o(0,"button",76),_("click",function(){let n=c(e).$implicit,a=s(3);return p(a.handleSelectModel(n))}),u(1),r()}if(t&2){let e=d.$implicit,i=s(3);y(e===i.selectedModel()?"text-neonAmber bg-neonAmber/10":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"),l(),O(" ",e," ")}}function Oe(t,d){if(t&1&&(o(0,"div",74),A(1,$e,2,3,"button",75,F),r()),t&2){let e=s(2);l(),V(e.modelOptions())}}function Le(t,d){if(t&1){let e=S();o(0,"div",15)(1,"button",68),_("click",function(){c(e);let n=s();return p(n.handleToggleModelDropdown())}),o(2,"span",69),u(3,"Model"),r(),o(4,"span",70),u(5,":"),r(),o(6,"span",71),u(7),r(),w(),o(8,"svg",72),g(9,"path",73),r()(),b(10,Oe,3,0,"div",74),r()}if(t&2){let e=s();l(),y(e.isModelDropdownOpen_$()?"border-neonAmber/50 text-neonAmber bg-neonAmber/10":"border-neutral-700 text-neutral-400 hover:text-neutral-300 hover:border-neutral-600"),R("aria-label","Model: "+e.selectedModel()),l(6),T(e.selectedModel()),l(3),x(e.isModelDropdownOpen_$()?10:-1)}}function Fe(t,d){if(t&1){let e=S();o(0,"button",76),_("click",function(){let n=c(e).$implicit,a=s(3);return p(a.handleSelectEffort(n))}),u(1),r()}if(t&2){let e=d.$implicit,i=s(3);y(e===i.selectedEffort()?"text-neonPurple bg-neonPurple/10":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800"),l(),O(" ",e," ")}}function je(t,d){if(t&1&&(o(0,"div",74),A(1,Fe,2,3,"button",75,F),r()),t&2){let e=s(2);l(),V(e.effortOptions())}}function Pe(t,d){if(t&1){let e=S();o(0,"div",15)(1,"button",68),_("click",function(){c(e);let n=s();return p(n.handleToggleEffortDropdown())}),o(2,"span",69),u(3,"Effort"),r(),o(4,"span",70),u(5,":"),r(),o(6,"span",71),u(7),r(),w(),o(8,"svg",72),g(9,"path",73),r()(),b(10,je,3,0,"div",74),r()}if(t&2){let e=s();l(),y(e.isEffortDropdownOpen_$()?"border-neonPurple/50 text-neonPurple bg-neonPurple/10":"border-neutral-700 text-neutral-400 hover:text-neutral-300 hover:border-neutral-600"),R("aria-label","Effort: "+e.selectedEffort()),l(6),T(e.selectedEffort()),l(3),x(e.isEffortDropdownOpen_$()?10:-1)}}function Ue(t,d){if(t&1&&(o(0,"div",17),w(),o(1,"svg",28),g(2,"circle",77)(3,"path",78),r(),E(),o(4,"span"),u(5),r()()),t&2){let e=s();l(5),T(e.usageText())}}var ee=["image/png","image/jpeg","image/webp","image/gif"],He=120,Qe=.4,st=(()=>{class t{elementRef;renderer;draftText=m("");placeholder=m("Send a prompt\u2026");textareaRows=m(3);draftTextChange=h();isExecuting=m(!1);isSending=m(!1);isStopping=m(!1);modeOptions=m([]);selectedMode=m("");modelOptions=m([]);selectedModel=m("");effortOptions=m([]);selectedEffort=m("");usageText=m("");queueItems=m([]);isQueueLocked=m(!1);editingQueueItemId=m(null);editingQueueText=m("");queueEditStart=h();queueEditTextChange=h();queueEditSave=h();queueEditCancel=h();queueRemoveItem=h();queueSendNow=h();queueMoveUp=h();queueMoveDown=h();enableAttachments=m(!1);acceptedFileTypes=m("image/png,image/jpeg,image/webp,image/gif,.txt,.pdf,.md,.json,.csv,.xml,.yaml,.yml,.log");maxAttachmentCount=m(6);sendRequested=h();queueRequested=h();stopRequested=h();modeChanged=h();modelChanged=h();effortChanged=h();attachmentsChanged=h();pendingAttachments=[];isModeDropdownOpen_$=I(!1);isModelDropdownOpen_$=I(!1);isEffortDropdownOpen_$=I(!1);isManualResize_$=I(!1);manualPanelHeight_$=I(300);textareaElRef;resizeStartY=0;resizeStartHeight=0;resizeMoveCleanup=null;resizeUpCleanup=null;resizeCancelCleanup=null;get hostHeightPx(){return this.isManualResize_$()?this.manualPanelHeight_$():void 0}constructor(e,i){this.elementRef=e,this.renderer=i,W(()=>{this.draftText(),this.isManualResize_$()||requestAnimationFrame(()=>{this.textareaElRef?.nativeElement&&this.adjustTextareaAutoGrow(this.textareaElRef.nativeElement)})})}ngOnDestroy(){this.cleanupResizeListeners();for(let e of this.pendingAttachments)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);this.pendingAttachments=[]}handleKeyDown(e){e.key!=="Enter"||e.shiftKey||(e.preventDefault(),this.emitSendOrQueue())}handleSendClick(){this.emitSendOrQueue()}handleQueueClick(){this.emitSendOrQueue()}handleStopClick(){this.isStopping()||this.stopRequested.emit()}handleTextareaInput(){this.isManualResize_$()||this.textareaElRef?.nativeElement&&this.adjustTextareaAutoGrow(this.textareaElRef.nativeElement)}handleResizeStart(e){e.preventDefault();let i=e.currentTarget;i instanceof HTMLElement&&i.setPointerCapture(e.pointerId),this.resizeStartY=e.clientY,this.resizeStartHeight=this.elementRef.nativeElement.offsetHeight,this.resizeMoveCleanup=this.renderer.listen("document","pointermove",n=>{this.handleResizeMove(n)}),this.resizeUpCleanup=this.renderer.listen("document","pointerup",()=>{i instanceof HTMLElement&&i.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.cleanupResizeListeners()}),this.resizeCancelCleanup=this.renderer.listen("document","pointercancel",()=>{i instanceof HTMLElement&&i.hasPointerCapture(e.pointerId)&&i.releasePointerCapture(e.pointerId),this.cleanupResizeListeners()})}handleResizeReset(){this.isManualResize_$.set(!1),requestAnimationFrame(()=>{this.textareaElRef?.nativeElement&&this.adjustTextareaAutoGrow(this.textareaElRef.nativeElement)})}handleToggleModeDropdown(){this.closeAllDropdownsExcept("mode"),this.isModeDropdownOpen_$.set(!this.isModeDropdownOpen_$())}handleToggleModelDropdown(){this.closeAllDropdownsExcept("model"),this.isModelDropdownOpen_$.set(!this.isModelDropdownOpen_$())}handleToggleEffortDropdown(){this.closeAllDropdownsExcept("effort"),this.isEffortDropdownOpen_$.set(!this.isEffortDropdownOpen_$())}handleSelectMode(e){this.isModeDropdownOpen_$.set(!1),this.modeChanged.emit(e)}handleSelectModel(e){this.isModelDropdownOpen_$.set(!1),this.modelChanged.emit(e)}handleSelectEffort(e){this.isEffortDropdownOpen_$.set(!1),this.effortChanged.emit(e)}handleFilesSelected(e){return j(this,null,function*(){let i=e.target,n=i?.files??null;n?.length&&(yield this.addFiles(Array.from(n)),i&&(i.value=""))})}handlePaste(e){if(!this.enableAttachments())return;let i=e.clipboardData?.items;if(!i?.length)return;let n=[];for(let a=0;a<i.length;a++){let f=i[a];if(f.kind==="file"&&ee.some(C=>f.type.toLowerCase().startsWith(C))){let C=f.getAsFile();C&&n.push(C)}}n.length&&(e.preventDefault(),this.addFiles(n))}handleRemoveAttachment(e){let i=this.pendingAttachments.find(n=>n.id===e);i?.previewUrl&&URL.revokeObjectURL(i.previewUrl),this.pendingAttachments=this.pendingAttachments.filter(n=>n.id!==e),this.attachmentsChanged.emit(this.pendingAttachments)}clearAttachments(){for(let e of this.pendingAttachments)e.previewUrl&&URL.revokeObjectURL(e.previewUrl);this.pendingAttachments=[],this.attachmentsChanged.emit(this.pendingAttachments)}emitSendOrQueue(){if(this.isSending())return;let e=(this.draftText()??"").trim().length>0,i=this.pendingAttachments.length>0;!e&&!i||(this.isExecuting()?this.queueRequested.emit():this.sendRequested.emit())}adjustTextareaAutoGrow(e){e.style.height="auto";let i=Math.round(window.innerHeight*Qe),n=Math.min(e.scrollHeight,i);e.style.height=n+"px"}handleResizeMove(e){let i=this.isManualResize_$(),n=this.resizeStartY-e.clientY,a=Math.round(window.innerHeight*.7),f=Math.max(He,Math.min(this.resizeStartHeight+n,a));this.isManualResize_$.set(!0),this.manualPanelHeight_$.set(f),!i&&this.textareaElRef?.nativeElement&&(this.textareaElRef.nativeElement.style.height="")}cleanupResizeListeners(){this.resizeMoveCleanup&&(this.resizeMoveCleanup(),this.resizeMoveCleanup=null),this.resizeUpCleanup&&(this.resizeUpCleanup(),this.resizeUpCleanup=null),this.resizeCancelCleanup&&(this.resizeCancelCleanup(),this.resizeCancelCleanup=null)}closeAllDropdownsExcept(e){e!=="mode"&&this.isModeDropdownOpen_$.set(!1),e!=="model"&&this.isModelDropdownOpen_$.set(!1),e!=="effort"&&this.isEffortDropdownOpen_$.set(!1)}addFiles(e){return j(this,null,function*(){let i=this.maxAttachmentCount()-this.pendingAttachments.length;if(i<=0)return;let n=e.slice(0,i);for(let a of n)try{let f=yield this.readFileToBase64(a),C=ee.some(ne=>a.type.toLowerCase().startsWith(ne)),te={id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`att-${Date.now()}-${Math.random()}`,fileName:a.name,mimeType:a.type||"application/octet-stream",base64:f,previewUrl:C?URL.createObjectURL(a):void 0,sizeBytes:a.size,isImage:C};this.pendingAttachments=[...this.pendingAttachments,te]}catch{}this.attachmentsChanged.emit(this.pendingAttachments)})}readFileToBase64(e){return new Promise((i,n)=>{let a=new FileReader;a.onload=()=>{let f=String(a.result??""),C=f.indexOf(",");i(C>=0?f.slice(C+1):f)},a.onerror=()=>{n(a.error)},a.readAsDataURL(e)})}static \u0275fac=function(i){return new(i||t)(P(U),P(Q))};static \u0275cmp=M({type:t,selectors:[["app-s-session-input"]],viewQuery:function(i,n){if(i&1&&B(de,5),i&2){let a;G(a=N())&&(n.textareaElRef=a.first)}},hostAttrs:[1,"flex","flex-col","shrink-0","border-t","border-neonDefault","bg-ccapSurface","relative","overflow-hidden"],hostVars:2,hostBindings:function(i,n){i&2&&L("height",n.hostHeightPx,"px")},inputs:{draftText:[1,"draftText"],placeholder:[1,"placeholder"],textareaRows:[1,"textareaRows"],isExecuting:[1,"isExecuting"],isSending:[1,"isSending"],isStopping:[1,"isStopping"],modeOptions:[1,"modeOptions"],selectedMode:[1,"selectedMode"],modelOptions:[1,"modelOptions"],selectedModel:[1,"selectedModel"],effortOptions:[1,"effortOptions"],selectedEffort:[1,"selectedEffort"],usageText:[1,"usageText"],queueItems:[1,"queueItems"],isQueueLocked:[1,"isQueueLocked"],editingQueueItemId:[1,"editingQueueItemId"],editingQueueText:[1,"editingQueueText"],enableAttachments:[1,"enableAttachments"],acceptedFileTypes:[1,"acceptedFileTypes"],maxAttachmentCount:[1,"maxAttachmentCount"]},outputs:{draftTextChange:"draftTextChange",queueEditStart:"queueEditStart",queueEditTextChange:"queueEditTextChange",queueEditSave:"queueEditSave",queueEditCancel:"queueEditCancel",queueRemoveItem:"queueRemoveItem",queueSendNow:"queueSendNow",queueMoveUp:"queueMoveUp",queueMoveDown:"queueMoveDown",sendRequested:"sendRequested",queueRequested:"queueRequested",stopRequested:"stopRequested",modeChanged:"modeChanged",modelChanged:"modelChanged",effortChanged:"effortChanged",attachmentsChanged:"attachmentsChanged"},standalone:!0,features:[q],ngContentSelectors:pe,decls:22,vars:20,consts:[["textareaEl",""],[1,"group","flex","items-center","justify-center","h-2.5","shrink-0","cursor-ns-resize","select-none","touch-none",3,"pointerdown","dblclick"],[1,"w-8","h-0.5","rounded-full","bg-neutral-600","transition-all","group-hover:bg-neonCyan/50","group-hover:w-12"],[1,"knight-rider-bar"],[1,"flex","flex-col","gap-2","p-2","flex-1","min-h-0"],[1,"flex","flex-wrap","gap-2"],[1,"flex","flex-col","gap-1","rounded","border","border-neutral-700/50","bg-neutral-900/60","p-2","text-[11px]"],[1,"flex","gap-2"],[1,"relative","min-w-0","flex-1"],[1,"min-h-[60px]","w-full","resize-none","rounded","border","border-neutral-700","bg-neutral-800","px-3","py-2","text-sm","text-neutral-200","placeholder-neutral-600","focus:border-ccapAccent","focus:outline-none",3,"ngModelChange","input","keydown","paste","placeholder","ngModel"],[1,"shrink-0","self-stretch","flex","flex-col","items-center","justify-between","gap-2"],[1,"flex","flex-col","items-center","gap-1.5"],["type","button","aria-label","Send","title","Send",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-ccapAccent","text-black","transition-all","duration-200","disabled:opacity-50","hover:bg-ccapAccent/80","hover:shadow-neon-glow-cyan","focus:outline-none","focus:ring-2","focus:ring-ccapAccent","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"disabled"],[1,"flex","flex-wrap","items-center","gap-2","text-[11px]","shrink-0"],[1,"flex","items-center","gap-1","px-2","py-1","rounded","border","border-neutral-700","text-neutral-400","hover:text-neutral-300","hover:border-neutral-600","cursor-pointer","transition-colors","shrink-0"],[1,"relative"],[1,"flex-1"],[1,"flex","items-center","gap-1.5","text-neutral-500","shrink-0"],[1,"relative","w-14","h-14","rounded","border","border-neonDefault","overflow-hidden","shrink-0"],[1,"relative","flex","items-center","gap-1","px-2","py-1","rounded","border","border-neonDefault","text-[10px]","text-neutral-400","shrink-0","max-w-[140px]"],["alt","",1,"w-full","h-full","object-cover",3,"src"],["type","button",1,"absolute","top-0","right-0","w-4","h-4","text-[10px]","leading-4","bg-black/70","text-white","border-0","cursor-pointer",3,"click"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","shrink-0","opacity-60"],["d","M7 1H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4L7 1z","stroke","currentColor","stroke-width","1"],["points","7 1 7 4 10 4","stroke","currentColor","stroke-width","1"],[1,"truncate"],["type","button",1,"ml-auto","w-3","h-3","text-[10px]","leading-3","text-neutral-500","hover:text-white","cursor-pointer","shrink-0",3,"click"],[1,"flex","items-center","gap-1.5","text-neutral-500","font-medium","mb-0.5"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","opacity-60"],["x","1","y","1","width","10","height","3","rx","0.5","stroke","currentColor","stroke-width","0.8"],["x","1","y","5","width","10","height","3","rx","0.5","stroke","currentColor","stroke-width","0.8","opacity","0.6"],["x","1","y","9","width","10","height","3","rx","0.5","stroke","currentColor","stroke-width","0.8","opacity","0.3"],[1,"ml-1","rounded","bg-neonAmber/15","px-1","py-px","text-[9px]","font-semibold","text-neonAmber","uppercase","tracking-wider"],[1,"flex","flex-col","gap-1","max-h-[280px]","overflow-y-auto","overscroll-contain","pr-1"],[1,"flex","items-start","gap-1.5","rounded","px-2","py-1.5","transition-colors",3,"class"],[1,"flex","items-start","gap-1.5","rounded","px-2","py-1.5","transition-colors"],["rows","2",1,"flex-1","min-h-[36px]","max-h-[100px]","resize-none","rounded","border","border-neutral-600","bg-neutral-900","px-2","py-1","text-[11px]","text-neutral-200","focus:border-neonAmber","focus:outline-none",3,"ngModelChange","ngModel"],[1,"flex","flex-col","gap-1","shrink-0"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","bg-neonAmber/20","text-neonAmber","hover:bg-neonAmber/30","transition-colors","cursor-pointer",3,"click"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-300","hover:bg-neutral-700","transition-colors","cursor-pointer",3,"click"],[1,"flex-1","text-neutral-300","break-words","whitespace-pre-wrap","leading-relaxed"],[1,"flex","items-center","gap-1","shrink-0","opacity-0","group-hover:opacity-100","transition-opacity"],["type","button","title","Move up",1,"px-1","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3"],["d","M6 3L3 7h6L6 3z","fill","currentColor"],["type","button","title","Move down",1,"px-1","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["d","M6 9L3 5h6L6 9z","fill","currentColor"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-red-400","hover:bg-red-950/30","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"px-1.5","py-0.5","text-[10px]","rounded","text-neutral-500","hover:text-neonCyan","hover:bg-neonCyan/10","transition-colors","cursor-pointer","disabled:opacity-30","disabled:cursor-not-allowed",3,"click","disabled"],["type","button","aria-label","Add to queue","title","Add to queue (Enter)",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-neutral-900","border-2","border-neonAmber/60","text-neonAmber","hover:border-neonAmber","hover:shadow-neon-glow-amber","hover:bg-neonAmber/10","transition-all","duration-200","disabled:opacity-40","focus:outline-none","focus:ring-2","focus:ring-neonAmber","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-neonAmber/40","border-t-neonAmber"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-5","h-5","shrink-0"],["type","button",1,"flex","items-center","justify-center","w-5","h-5","rounded-full","shrink-0","bg-neutral-900","border","border-neonRed/50","text-red-300","hover:border-neonRed","hover:shadow-neon-glow-red","transition-all","duration-200","disabled:opacity-40","focus:outline-none","focus:ring-2","focus:ring-neonRed","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-2.5","h-2.5","shrink-0","animate-spin","rounded-full","border","border-neonRed/40","border-t-neonRed"],["viewBox","0 0 24 24","fill","currentColor","aria-hidden","true",1,"w-2.5","h-2.5","shrink-0"],["points","18 3 2 9 9 12 18 3"],["points","18 3 11 19 9 12"],["x1","19","y1","15","x2","19","y2","21"],["x1","16","y1","18","x2","22","y2","18"],["x","6","y","6","width","12","height","12","rx","2"],["type","button","aria-label","Send","title","Send",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-ccapAccent","text-black","transition-all","duration-200","disabled:opacity-50","hover:bg-ccapAccent/80","hover:shadow-neon-glow-cyan","focus:outline-none","focus:ring-2","focus:ring-ccapAccent","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-black/40","border-t-black"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-5","h-5","shrink-0"],["x1","22","y1","2","x2","11","y2","13"],["points","22 2 15 22 11 13 2 9 22 2"],["d","M10.5 5.5l-4.3 4.3a2.5 2.5 0 0 1-3.5-3.5L7 2a1.7 1.7 0 0 1 2.4 2.4L5.1 8.7a.8.8 0 0 1-1.2-1.2L7.5 4","stroke","currentColor","stroke-width","1","stroke-linecap","round"],["type","file","multiple","",1,"sr-only",3,"change","accept"],["type","button",1,"flex","items-center","gap-1","px-2","py-0.5","rounded","border","transition-colors","cursor-pointer",3,"click"],[1,"uppercase","font-medium","tracking-wide","hidden","gt-xs:inline"],[1,"text-neutral-500","mx-0.5","hidden","gt-xs:inline"],[1,"capitalize"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","ml-0.5","opacity-50"],["d","M3 5l3 3 3-3","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"],[1,"absolute","bottom-full","left-0","mb-1","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-lg","overflow-hidden","z-20","min-w-[100px]"],["type","button",1,"w-full","text-left","px-3","py-1.5","text-[11px]","capitalize","transition-colors","cursor-pointer",3,"class"],["type","button",1,"w-full","text-left","px-3","py-1.5","text-[11px]","capitalize","transition-colors","cursor-pointer",3,"click"],["cx","6","cy","6","r","5","stroke","currentColor","stroke-width","1"],["d","M6 3v3.5l2 1.5","stroke","currentColor","stroke-width","1","stroke-linecap","round"]],template:function(i,n){if(i&1){let a=S();z(ce),o(0,"div",1),_("pointerdown",function(C){return c(a),p(n.handleResizeStart(C))})("dblclick",function(){return c(a),p(n.handleResizeReset())}),g(1,"div",2),r(),b(2,_e,1,0,"div",3),o(3,"div",4),b(4,ge,3,0,"div",5)(5,ve,12,2,"div",6),o(6,"div",7)(7,"div",8)(8,"textarea",9,0),_("ngModelChange",function(C){return c(a),p(n.draftTextChange.emit(C))})("input",function(){return c(a),p(n.handleTextareaInput())})("keydown",function(C){return c(a),p(n.handleKeyDown(C))})("paste",function(C){return c(a),p(n.handlePaste(C))}),u(10," "),r()(),o(11,"div",10),k(12),b(13,Me,7,6,"div",11)(14,Ae,3,2,"button",12),r()(),o(15,"div",13),b(16,Ve,5,1,"label",14)(17,De,11,5,"div",15)(18,Le,11,5,"div",15)(19,Pe,11,5,"div",15),g(20,"div",16),b(21,Ue,6,1,"div",17),r()()}i&2&&(l(2),x(n.isExecuting()?2:-1),l(2),x(n.pendingAttachments.length?4:-1),l(),x(n.queueItems().length?5:-1),l(),$("flex-1",n.isManualResize_$())("min-h-0",n.isManualResize_$()),l(),$("min-h-0",n.isManualResize_$()),l(),$("h-full",n.isManualResize_$()),v("placeholder",n.placeholder())("ngModel",n.draftText()),R("rows",n.textareaRows()),l(5),x(n.isExecuting()?13:14),l(3),x(n.enableAttachments()?16:-1),l(),x(n.modeOptions().length?17:-1),l(),x(n.modelOptions().length?18:-1),l(),x(n.effortOptions().length?19:-1),l(2),x(n.usageText()?21:-1))},dependencies:[D,J,Y,K,X],styles:[`@charset "UTF-8";.knight-rider-bar[_ngcontent-%COMP%]{position:absolute;top:-1px;left:0;right:0;height:2px;overflow:hidden;pointer-events:none;z-index:10}.knight-rider-bar[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(0,245,255,.15) 25%,rgba(0,212,255,.7) 45%,#00f5ff 50%,rgba(45,212,191,.9) 53%,rgba(0,212,255,.7) 55%,rgba(0,245,255,.15) 75%,transparent 100%);background-size:55% 100%;animation:_ngcontent-%COMP%_knight-rider-sweep 1.8s ease-in-out infinite alternate;filter:drop-shadow(0 0 4px #00f5ff) drop-shadow(0 0 10px rgba(0,245,255,.6))}@keyframes _ngcontent-%COMP%_knight-rider-sweep{0%{background-position:-55% center}to{background-position:155% center}}
2
2
  /*# sourceMappingURL=s-session-input.component-MONCAJ63.css.map */`]})}return t})();export{Ne as a,Je as b,st as c};
3
- //# sourceMappingURL=chunk-6EYSPF43.js.map
3
+ //# sourceMappingURL=chunk-C7XPBJTG.js.map