@intent-hq/web 2.383.5 → 2.383.7

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 (252) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{RFsxwSsB.js → -jC6R53Y.js} +1 -1
  3. package/web/app/immutable/chunks/{Co4vj0dC.js → 11IPfP64.js} +1 -1
  4. package/web/app/immutable/chunks/{wqIK2bns.js → 1VDAs3Ud.js} +1 -1
  5. package/web/app/immutable/chunks/{DnJ4jlPB.js → 2BBUaa8p.js} +1 -1
  6. package/web/app/immutable/chunks/{Bymbu99U.js → 38BB0grB.js} +1 -1
  7. package/web/app/immutable/chunks/{Dirmxn0x.js → 3FaPVDTk.js} +1 -1
  8. package/web/app/immutable/chunks/{D6G8WbHL.js → 51Rp6_AF.js} +1 -1
  9. package/web/app/immutable/chunks/{Dj14JHUo.js → 5moVT_HQ.js} +1 -1
  10. package/web/app/immutable/chunks/{B8-Q1tED.js → 6D8I0EJP.js} +1 -1
  11. package/web/app/immutable/chunks/{DW25C9MI.js → 7da8sugr.js} +2 -2
  12. package/web/app/immutable/chunks/{CiMmbOsB.js → 7g_E9v8v.js} +1 -1
  13. package/web/app/immutable/chunks/{DibfmKHg.js → 8MucyzZK.js} +1 -1
  14. package/web/app/immutable/chunks/{f24VwgrA.js → 90dwRRI_.js} +1 -1
  15. package/web/app/immutable/chunks/{B5MrjS7j.js → 96gE90DS.js} +1 -1
  16. package/web/app/immutable/chunks/9KbPq6ne.js +1 -0
  17. package/web/app/immutable/chunks/9bpkKfDs.js +1 -0
  18. package/web/app/immutable/chunks/{UMwTu6TE.js → 9p0DyBPU.js} +1 -1
  19. package/web/app/immutable/chunks/{No1eCFy3.js → B-4NNXpn.js} +1 -1
  20. package/web/app/immutable/chunks/{D6dlPeEM.js → B0-WaGMs.js} +1 -1
  21. package/web/app/immutable/chunks/{B8V-jGiS.js → B0SuIES7.js} +1 -1
  22. package/web/app/immutable/chunks/{BAKPnd3w.js → B2w13ngc.js} +1 -1
  23. package/web/app/immutable/chunks/{p7SBTgaC.js → B3WV7a-V.js} +1 -1
  24. package/web/app/immutable/chunks/{-tAyw6ob.js → B3zWdyp-.js} +1 -1
  25. package/web/app/immutable/chunks/{C6mS8uZB.js → B50rrLDJ.js} +1 -1
  26. package/web/app/immutable/chunks/{Bg_lZIRf.js → B6ERx__s.js} +2 -2
  27. package/web/app/immutable/chunks/{BmkXo3Yq.js → B6q3uVQG.js} +1 -1
  28. package/web/app/immutable/chunks/{GuiAAF9e.js → B7ZVMWBx.js} +1 -1
  29. package/web/app/immutable/chunks/{B265Nxi3.js → B91a7NqB.js} +1 -1
  30. package/web/app/immutable/chunks/{L_tYoUCb.js → B9ZFoPLo.js} +1 -1
  31. package/web/app/immutable/chunks/{Cgxwerkr.js → B9bXgFyu.js} +2 -2
  32. package/web/app/immutable/chunks/{c5QZsH9t.js → B9qXV8kb.js} +1 -1
  33. package/web/app/immutable/chunks/{C_KuQ05a.js → BAwmUXtg.js} +1 -1
  34. package/web/app/immutable/chunks/{BxoyDHGw.js → BB2DpGJV.js} +1 -1
  35. package/web/app/immutable/chunks/{C7Zl7z5c.js → BBrT6DIB.js} +1 -1
  36. package/web/app/immutable/chunks/{CO5zWp8I.js → BFPO9C1I.js} +1 -1
  37. package/web/app/immutable/chunks/{CfiKUG8A.js → BGm3f58g.js} +1 -1
  38. package/web/app/immutable/chunks/{iN763416.js → BIsdYrnK.js} +1 -1
  39. package/web/app/immutable/chunks/{3o8kzB3n.js → BM2XSA6g.js} +1 -1
  40. package/web/app/immutable/chunks/{BxEf7uwl.js → BMF9dBr3.js} +1 -1
  41. package/web/app/immutable/chunks/{B4WuQori.js → BMWq5Cem.js} +1 -1
  42. package/web/app/immutable/chunks/{DA5opfEp.js → BPjvgJzJ.js} +1 -1
  43. package/web/app/immutable/chunks/{CsD5HG3r.js → BUDFO3oC.js} +1 -1
  44. package/web/app/immutable/chunks/{Cq88mLGj.js → BUchcLc3.js} +3 -3
  45. package/web/app/immutable/chunks/BWu0YXkV.js +1 -0
  46. package/web/app/immutable/chunks/{Dp-6l6dc.js → BXMl8g0k.js} +1 -1
  47. package/web/app/immutable/chunks/{CqcqWJoa.js → BY98dnH8.js} +1 -1
  48. package/web/app/immutable/chunks/{DqWLkzGY.js → BZ1Q38PM.js} +1 -1
  49. package/web/app/immutable/chunks/{BjfHx7zJ.js → BbHdeR3v.js} +1 -1
  50. package/web/app/immutable/chunks/BcQ6Rg0V.js +10 -0
  51. package/web/app/immutable/chunks/{WGwfzXjP.js → BcUHkjB6.js} +1 -1
  52. package/web/app/immutable/chunks/{D96pHovR.js → Bf16PEz1.js} +1 -1
  53. package/web/app/immutable/chunks/{BqRWw-wJ.js → BfSTFUKA.js} +1 -1
  54. package/web/app/immutable/chunks/{C3upI-xJ.js → BgZpMc5-.js} +1 -1
  55. package/web/app/immutable/chunks/{u2aKD69u.js → BgjaD_Yy.js} +1 -1
  56. package/web/app/immutable/chunks/{KEaRLIGy.js → BhcBqtJg.js} +1 -1
  57. package/web/app/immutable/chunks/{Bs9K_x5H.js → BkPSRIlH.js} +1 -1
  58. package/web/app/immutable/chunks/{Dlk4BhFg.js → BnG797lq.js} +1 -1
  59. package/web/app/immutable/chunks/{CDK_hSiv.js → BotfI-oJ.js} +1 -1
  60. package/web/app/immutable/chunks/{EK6zOAHM.js → BsOWc0fD.js} +1 -1
  61. package/web/app/immutable/chunks/{DzB2TE-q.js → BtI19qHa.js} +40 -40
  62. package/web/app/immutable/chunks/{DizKilK3.js → Bwa_PJLB.js} +2 -2
  63. package/web/app/immutable/chunks/{BwfxdDPw.js → Byb6yuNY.js} +1 -1
  64. package/web/app/immutable/chunks/{6Bqipt1r.js → C-LBvoL7.js} +1 -1
  65. package/web/app/immutable/chunks/{ZxEOlEA2.js → C1IZMhCT.js} +1 -1
  66. package/web/app/immutable/chunks/{ozVAo4aX.js → C1JG3JxG.js} +1 -1
  67. package/web/app/immutable/chunks/{CApA6QD2.js → C1dPOfxb.js} +4 -4
  68. package/web/app/immutable/chunks/{BYChQVmd.js → C2BnXWav.js} +1 -1
  69. package/web/app/immutable/chunks/{DCRuihKm.js → C2jYl_tm.js} +2 -2
  70. package/web/app/immutable/chunks/{CkA2ItLw.js → C3Cs4xcH.js} +1 -1
  71. package/web/app/immutable/chunks/{-Q8WHsT1.js → C3KL0Dob.js} +2 -2
  72. package/web/app/immutable/chunks/{518Fef2L.js → C3kvbgti.js} +1 -1
  73. package/web/app/immutable/chunks/{C4QKwtCH.js → C429ViPJ.js} +1 -1
  74. package/web/app/immutable/chunks/{CWdKrGNN.js → C4ItHUxb.js} +1 -1
  75. package/web/app/immutable/chunks/{Cg871q2J.js → C56HY_cI.js} +1 -1
  76. package/web/app/immutable/chunks/{DATzIj-C.js → C5H3ErAr.js} +1 -1
  77. package/web/app/immutable/chunks/{_SYFiE9N.js → C7Q9MjK0.js} +1 -1
  78. package/web/app/immutable/chunks/{IK5u1LkS.js → C8ZC1xrW.js} +1 -1
  79. package/web/app/immutable/chunks/{cfdblcWY.js → C91EC830.js} +1 -1
  80. package/web/app/immutable/chunks/{CHKnj_kH.js → C9fVl7VH.js} +1 -1
  81. package/web/app/immutable/chunks/{Bty1UglO.js → CAXPT_Gw.js} +1 -1
  82. package/web/app/immutable/chunks/{DC8keNAk.js → CCjzzCpy.js} +1 -1
  83. package/web/app/immutable/chunks/{D51XIZYq.js → CDLANF8s.js} +1 -1
  84. package/web/app/immutable/chunks/{MEqItsKn.js → CE-gn8fg.js} +1 -1
  85. package/web/app/immutable/chunks/{BYq9VtBF.js → CENp25rd.js} +1 -1
  86. package/web/app/immutable/chunks/{3vWQiXY2.js → CEOk8g-Q.js} +3 -3
  87. package/web/app/immutable/chunks/{Du0DJF2z.js → CEl8yEuC.js} +1 -1
  88. package/web/app/immutable/chunks/{B5YNqIIm.js → CIeXUP7u.js} +1 -1
  89. package/web/app/immutable/chunks/{DzbS0qCL.js → CKjysSbd.js} +1 -1
  90. package/web/app/immutable/chunks/{u8znU8zy.js → CLUxyZqF.js} +1 -1
  91. package/web/app/immutable/chunks/{BHt4i6xN.js → CPIZev3Z.js} +1 -1
  92. package/web/app/immutable/chunks/{B9YYIjUd.js → CQlHJWbs.js} +3 -3
  93. package/web/app/immutable/chunks/{BiQUDh4s.js → CQvGDYQV.js} +1 -1
  94. package/web/app/immutable/chunks/{DsGUBv3k.js → CQwOMyxz.js} +1 -1
  95. package/web/app/immutable/chunks/{yFcbscNn.js → CRdOY_2z.js} +1 -1
  96. package/web/app/immutable/chunks/{lzAd2Up3.js → CS3H-hA4.js} +1 -1
  97. package/web/app/immutable/chunks/{DKHY8q_S.js → CTP1vzdq.js} +1 -1
  98. package/web/app/immutable/chunks/{nTGBknlr.js → CTYV2WCR.js} +1 -1
  99. package/web/app/immutable/chunks/{CRZZ_hOy.js → CW0Mb2k4.js} +1 -1
  100. package/web/app/immutable/chunks/{B2Ym4lhl.js → CYkPVUDx.js} +1 -1
  101. package/web/app/immutable/chunks/{W0L8GDXP.js → C_1zy40-.js} +1 -1
  102. package/web/app/immutable/chunks/{Do2giiGP.js → CaCH7xka.js} +1 -1
  103. package/web/app/immutable/chunks/{Bygq9d8w.js → CaVcxIX_.js} +1 -1
  104. package/web/app/immutable/chunks/{RWObpdxy.js → Cb9atCGq.js} +1 -1
  105. package/web/app/immutable/chunks/{DZYWuj4L.js → CdDve0EN.js} +1 -1
  106. package/web/app/immutable/chunks/{CmrjfWYI.js → Ce1_P2yR.js} +1 -1
  107. package/web/app/immutable/chunks/{C8y9EItt.js → Chp6TQgb.js} +1 -1
  108. package/web/app/immutable/chunks/{tZyAiGvb.js → ClIBKxjv.js} +1 -1
  109. package/web/app/immutable/chunks/{OtomGvb3.js → CmAb18no.js} +1 -1
  110. package/web/app/immutable/chunks/{Yyy6gahW.js → CmbyIv2W.js} +1 -1
  111. package/web/app/immutable/chunks/{BaujsV9k.js → Cppy6ZYG.js} +1 -1
  112. package/web/app/immutable/chunks/{BhSvmxU-.js → Cpw-AI-k.js} +4 -4
  113. package/web/app/immutable/chunks/{7dpPwFPi.js → CqEyPGwj.js} +1 -1
  114. package/web/app/immutable/chunks/{BTrqJIJZ.js → Cq_r_CYV.js} +1 -1
  115. package/web/app/immutable/chunks/{CFUZ-wx4.js → CqhHB0m1.js} +3 -3
  116. package/web/app/immutable/chunks/{D8UBdXB2.js → CtCH4W1N.js} +1 -1
  117. package/web/app/immutable/chunks/{Z0_LIT6x.js → CteMcmUe.js} +2 -2
  118. package/web/app/immutable/chunks/{FzlZUztb.js → CttA-M7l.js} +1 -1
  119. package/web/app/immutable/chunks/{C9dAybnM.js → Cxb8aRlA.js} +2 -2
  120. package/web/app/immutable/chunks/{C0cGUVCr.js → Cxs-r6qH.js} +1 -1
  121. package/web/app/immutable/chunks/{DbZ5HUqx.js → CzMfcD76.js} +2 -2
  122. package/web/app/immutable/chunks/{DAJnPbZk.js → CzRvdM50.js} +4 -4
  123. package/web/app/immutable/chunks/{Dac_vP74.js → D14F6Zen.js} +1 -1
  124. package/web/app/immutable/chunks/{iHxbYHJ6.js → D1Kvaw2U.js} +1 -1
  125. package/web/app/immutable/chunks/{DTuql3Rj.js → D32iIfZB.js} +1 -1
  126. package/web/app/immutable/chunks/{D_Xpj-6r.js → D5TRf27k.js} +1 -1
  127. package/web/app/immutable/chunks/{Djp7mdlG.js → D6x1PvJt.js} +1 -1
  128. package/web/app/immutable/chunks/{DY-t7Was.js → D8bef7T8.js} +1 -1
  129. package/web/app/immutable/chunks/{Bvi-fRGz.js → DA3JhNUa.js} +1 -1
  130. package/web/app/immutable/chunks/{BRJQPxpd.js → DBOkAv2-.js} +1 -1
  131. package/web/app/immutable/chunks/{fiz8N_zQ.js → DCL0Px6m.js} +1 -1
  132. package/web/app/immutable/chunks/{5c25JTI1.js → DCzWLn9w.js} +1 -1
  133. package/web/app/immutable/chunks/{DrIA1Azf.js → DDxtqhsd.js} +1 -1
  134. package/web/app/immutable/chunks/{CY4fyoCV.js → DEe4pSnF.js} +1 -1
  135. package/web/app/immutable/chunks/{Dsr4GELp.js → DFUCAM2K.js} +1 -1
  136. package/web/app/immutable/chunks/{CBB3lnfZ.js → DGP-y2GB.js} +3 -3
  137. package/web/app/immutable/chunks/{DDfr81XI.js → DGSdOlov.js} +1 -1
  138. package/web/app/immutable/chunks/{BP5uGGO_.js → DHLXX1td.js} +1 -1
  139. package/web/app/immutable/chunks/{BypvqIQM.js → DHbAORA3.js} +1 -1
  140. package/web/app/immutable/chunks/{CqnrQ6ti.js → DITUyjV2.js} +3 -3
  141. package/web/app/immutable/chunks/{B4SiDSWP.js → DI_O2uCQ.js} +1 -1
  142. package/web/app/immutable/chunks/{Ctbo6mXV.js → DJcj8WvN.js} +1 -1
  143. package/web/app/immutable/chunks/{CG-tM1HG.js → DLS35Cs2.js} +2 -2
  144. package/web/app/immutable/chunks/{Cngzlos4.js → DMVD9ZWm.js} +1 -1
  145. package/web/app/immutable/chunks/{BpcUO3Xs.js → DOAyQZ8n.js} +1 -1
  146. package/web/app/immutable/chunks/{CnZI1GOS.js → DQZ6hbu0.js} +1 -1
  147. package/web/app/immutable/chunks/{SqlvGXMi.js → DT_iJHxn.js} +1 -1
  148. package/web/app/immutable/chunks/{CHLX1QZz.js → DXn0DuET.js} +1 -1
  149. package/web/app/immutable/chunks/{eElW3aeh.js → DZ84MPQO.js} +1 -1
  150. package/web/app/immutable/chunks/{BXCVSrGo.js → D_Fe9jJy.js} +1 -1
  151. package/web/app/immutable/chunks/{BIQB3Kx5.js → DaLNZosE.js} +1 -1
  152. package/web/app/immutable/chunks/{DPCOdXX2.js → DbD3dAy_.js} +1 -1
  153. package/web/app/immutable/chunks/{C0LshS-P.js → Dc0NoKVI.js} +1 -1
  154. package/web/app/immutable/chunks/{C0o77pad.js → Dd6jkKNK.js} +2 -2
  155. package/web/app/immutable/chunks/{Bv1ckDXI.js → DggzSry-.js} +1 -1
  156. package/web/app/immutable/chunks/{BNVrbjR5.js → DgiZ-0Sp.js} +2 -2
  157. package/web/app/immutable/chunks/{B-MmNWOm.js → DhQSNgxc.js} +1 -1
  158. package/web/app/immutable/chunks/{QeBH-DWE.js → Dhy-QJgd.js} +1 -1
  159. package/web/app/immutable/chunks/{KYuLFpkq.js → DiNBgjb1.js} +1 -1
  160. package/web/app/immutable/chunks/{Dql2ogGT.js → Dj8digI5.js} +1 -1
  161. package/web/app/immutable/chunks/{C1EvfTg-.js → DjNVz8pO.js} +1 -1
  162. package/web/app/immutable/chunks/{6-uYidyP.js → DkDSK_05.js} +3 -3
  163. package/web/app/immutable/chunks/{DCK8dPAL.js → DkME16PR.js} +1 -1
  164. package/web/app/immutable/chunks/{j65te9ZT.js → Dl2c_Q4j.js} +1 -1
  165. package/web/app/immutable/chunks/{BWbkCnfm.js → Dl4B5sLX.js} +1 -1
  166. package/web/app/immutable/chunks/{BmTMWrby.js → DlUZpQ7U.js} +1 -1
  167. package/web/app/immutable/chunks/{CLkfOjAo.js → DnNC4gf3.js} +3 -3
  168. package/web/app/immutable/chunks/{CSRYV6LQ.js → Dnp239cR.js} +1 -1
  169. package/web/app/immutable/chunks/{BfojStRz.js → DpPV7WHr.js} +1 -1
  170. package/web/app/immutable/chunks/{BP3Sccje.js → DpX9aeiZ.js} +1 -1
  171. package/web/app/immutable/chunks/{B_JCVgq0.js → DqH-hVUa.js} +1 -1
  172. package/web/app/immutable/chunks/{Dr8j8hDa.js → DqMZWY-u.js} +2 -2
  173. package/web/app/immutable/chunks/{BZC6DuKQ.js → Dqhi5681.js} +1 -1
  174. package/web/app/immutable/chunks/{Cqa6LF3b.js → DrWDRmYR.js} +1 -1
  175. package/web/app/immutable/chunks/{BYdTf9Vr.js → DsCz_Hld.js} +1 -1
  176. package/web/app/immutable/chunks/{DrxfcnSy.js → DsffLoT8.js} +1 -1
  177. package/web/app/immutable/chunks/{CP9Lq5G_.js → DtekCANZ.js} +1 -1
  178. package/web/app/immutable/chunks/{ClJhkXR5.js → DwDabzpx.js} +1 -1
  179. package/web/app/immutable/chunks/{BPL5Fo2b.js → Dx3nOa5s.js} +1 -1
  180. package/web/app/immutable/chunks/{BacafptN.js → DyIsX23v.js} +4 -4
  181. package/web/app/immutable/chunks/{BcpfdNy8.js → FITmaVUJ.js} +1 -1
  182. package/web/app/immutable/chunks/{Bj84UPYb.js → FoSxZj2s.js} +1 -1
  183. package/web/app/immutable/chunks/{CAvYeStH.js → JvS7MGpw.js} +1 -1
  184. package/web/app/immutable/chunks/{DQ_mNIfK.js → L0wFy8_j.js} +1 -1
  185. package/web/app/immutable/chunks/{D8ohaX19.js → NE3LtfEb.js} +1 -1
  186. package/web/app/immutable/chunks/{CpJb1fZG.js → NaXnyxXD.js} +1 -1
  187. package/web/app/immutable/chunks/{B_kMSQKD.js → NqwdDVdt.js} +1 -1
  188. package/web/app/immutable/chunks/{B2DRKAdQ.js → Q16zd2xh.js} +1 -1
  189. package/web/app/immutable/chunks/{C4JbSg3f.js → SB0XkB7s.js} +1 -1
  190. package/web/app/immutable/chunks/{BKPEtXUT.js → SDBQMo24.js} +1 -1
  191. package/web/app/immutable/chunks/{DaFpSJap.js → SSdhXyvx.js} +1 -1
  192. package/web/app/immutable/chunks/{CwTtJpch.js → SnC5sLK-.js} +1 -1
  193. package/web/app/immutable/chunks/{CMEtJ5i1.js → SwH0lZVC.js} +1 -1
  194. package/web/app/immutable/chunks/{CbqxWBi7.js → T-y84UQ-.js} +1 -1
  195. package/web/app/immutable/chunks/{S845NCb3.js → VxaCN40t.js} +1 -1
  196. package/web/app/immutable/chunks/{C4LrSRW3.js → Y3x17kvu.js} +1 -1
  197. package/web/app/immutable/chunks/{BxJ6X-Sl.js → ZNxS70ti.js} +1 -1
  198. package/web/app/immutable/chunks/{ClMg21pU.js → ZtnoAnS2.js} +1 -1
  199. package/web/app/immutable/chunks/{tr-2J8Mf.js → _LtUY0jS.js} +1 -1
  200. package/web/app/immutable/chunks/{DwL1A1su.js → _WGu_9si.js} +1 -1
  201. package/web/app/immutable/chunks/{PIgqsYsQ.js → _Z48PZPG.js} +1 -1
  202. package/web/app/immutable/chunks/{DtF9DVpp.js → _szCylN8.js} +1 -1
  203. package/web/app/immutable/chunks/{CwtLM6uA.js → amTgh_yM.js} +1 -1
  204. package/web/app/immutable/chunks/{WiA7_4AK.js → aoCeefP4.js} +1 -1
  205. package/web/app/immutable/chunks/{OFhgRaUm.js → bq2jN3Y4.js} +1 -1
  206. package/web/app/immutable/chunks/{CDjpuJh0.js → c6a4q1y9.js} +1 -1
  207. package/web/app/immutable/chunks/{Cx37GTsM.js → cWnGUUZk.js} +1 -1
  208. package/web/app/immutable/chunks/{D37getya.js → ceYukiuF.js} +1 -1
  209. package/web/app/immutable/chunks/{BaW_cM4B.js → i2uLOz57.js} +1 -1
  210. package/web/app/immutable/chunks/{BeOwB_6G.js → iDB1itc7.js} +1 -1
  211. package/web/app/immutable/chunks/{-afdnSwu.js → lFCyJLs0.js} +1 -1
  212. package/web/app/immutable/chunks/{CJtViYfh.js → lQcc1B6x.js} +1 -1
  213. package/web/app/immutable/chunks/{DT3Kx0Qe.js → lzc_ALaY.js} +1 -1
  214. package/web/app/immutable/chunks/{CmVBRNuA.js → m2kIPDiE.js} +1 -1
  215. package/web/app/immutable/chunks/{CjTo2K46.js → nA0tsFRt.js} +1 -1
  216. package/web/app/immutable/chunks/{B2nCyo89.js → pQ6IdBCz.js} +1 -1
  217. package/web/app/immutable/chunks/{BSKFIBj2.js → ram0Xoqf.js} +1 -1
  218. package/web/app/immutable/chunks/{CCqqosml.js → rpEVAvPW.js} +1 -1
  219. package/web/app/immutable/chunks/{CSVgdt55.js → sABlNrvu.js} +1 -1
  220. package/web/app/immutable/chunks/{DMV7vEM7.js → tV0w-z-Q.js} +1 -1
  221. package/web/app/immutable/chunks/{DFi1P2MD.js → veocPVpA.js} +1 -1
  222. package/web/app/immutable/chunks/{hHMYoFyG.js → wjh5cuBI.js} +1 -1
  223. package/web/app/immutable/chunks/{BTv8uh2C.js → xGj0i83D.js} +6 -6
  224. package/web/app/immutable/entry/{app.Cqjdbldk.js → app.oKB02DpO.js} +2 -2
  225. package/web/app/immutable/entry/start.MWx9NKvl.js +1 -0
  226. package/web/app/immutable/nodes/{0.CIMKJ2v2.js → 0.Cj75U9Pb.js} +1 -1
  227. package/web/app/immutable/nodes/{1.C-zZe4mL.js → 1.COmRB5Gs.js} +1 -1
  228. package/web/app/immutable/nodes/{10.CRicXMMy.js → 10.B-EGmrBP.js} +5 -5
  229. package/web/app/immutable/nodes/{11.CFkPUf9W.js → 11.CHJVqhXh.js} +1 -1
  230. package/web/app/immutable/nodes/{13.CCKyw-_o.js → 13.C6TyTlAm.js} +1 -1
  231. package/web/app/immutable/nodes/{14.BD92xFv4.js → 14.CHiqNDyF.js} +1 -1
  232. package/web/app/immutable/nodes/{15.BDAlg-ra.js → 15.DvvqcqqW.js} +1 -1
  233. package/web/app/immutable/nodes/{16.CVCm-nfj.js → 16.Dyi9KYXl.js} +1 -1
  234. package/web/app/immutable/nodes/{17.CjKvJw8X.js → 17.CH042Yj8.js} +1 -1
  235. package/web/app/immutable/nodes/{18.DDY8Eqsn.js → 18.DVg5DSa7.js} +1 -1
  236. package/web/app/immutable/nodes/{19.DJgRbiNE.js → 19.CFGkesVY.js} +2 -2
  237. package/web/app/immutable/nodes/{2.Dl71tIky.js → 2.BSKohF8j.js} +4 -4
  238. package/web/app/immutable/nodes/{20.CLsq1QLL.js → 20.Byg15mRq.js} +1 -1
  239. package/web/app/immutable/nodes/{3.DNld1BNY.js → 3.CgM283V9.js} +1 -1
  240. package/web/app/immutable/nodes/{4.Dqn6Xii_.js → 4.pSSQL5ZR.js} +1 -1
  241. package/web/app/immutable/nodes/{5.B0BP_LYC.js → 5.gjcZy0Yo.js} +1 -1
  242. package/web/app/immutable/nodes/{6.NwMlYZya.js → 6.mfPH3Xl6.js} +1 -1
  243. package/web/app/immutable/nodes/{7.CP-QZto7.js → 7.hkLeTg6x.js} +1 -1
  244. package/web/app/immutable/nodes/{8.BsQgGFet.js → 8.CwwxHkuu.js} +1 -1
  245. package/web/app/immutable/nodes/{9.DY6xrFrM.js → 9.VYVO4dZo.js} +4 -4
  246. package/web/app/version.json +1 -1
  247. package/web/index.html +12 -12
  248. package/web/app/immutable/chunks/BIVeXMBl.js +0 -1
  249. package/web/app/immutable/chunks/D-zjf2Af.js +0 -1
  250. package/web/app/immutable/chunks/DH5O4f99.js +0 -1
  251. package/web/app/immutable/chunks/pUxZXv-3.js +0 -10
  252. package/web/app/immutable/entry/start.D0BpS8PF.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Cgxwerkr.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/Z0_LIT6x.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/S845NCb3.js","/app/immutable/chunks/EK6zOAHM.js","/app/immutable/chunks/B2nCyo89.js"])))=>i.map(i=>d[i]);
2
- import{_ as ue,t as re,bo as v,bw as ne,b as se,bm as k}from"./C0QTy0Sy.js";import{Jv as pe}from"./tr-2J8Mf.js";import{bs as ie,a7 as le,ay as X,aD as n,W as f,bn as oe,c9 as A,aA as h,a5 as q,bA as G,b_ as S,aB as P,bl as U,bO as K,bS as T,ca as de,bH as fe,bV as _e,aC as H}from"./3SdAC2_C.js";import{i as L}from"./bhKPSdq4.js";import{c as ge,e as me,f as te,g as ce,s as M}from"./7UPrdiE9.js";import{m as ve}from"./CE7dsja4.js";import{e as he}from"./B6S6VNu7.js";import{t as Ce}from"./DAsc1V4f.js";import{F as we}from"./U9jJmfYa.js";import{M as ke}from"./KHteWVFN.js";import{b as be}from"./BaujsV9k.js";import{aO as xe}from"./BqRWw-wJ.js";import{n as z,e as $,s as J}from"./DLwWVKiF.js";import{f as Se}from"./FzlZUztb.js";import"./DCRuihKm.js";function ut(r,t,c){if(r.metaKey||r.ctrlKey||!(r.currentTarget instanceof Element)||!r.currentTarget.closest("[data-assistant-panels]"))return!1;const e=pe.state.agentSessions.byAgentId[c]?.workspaceId??t,i=r.currentTarget.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId;return ue(async()=>{const{showAssistantContent:o}=await import("./Cgxwerkr.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url).then(({showAssistantContent:o})=>o(`intent://local/${e}/agent/${c}`,{layoutId:i})),!0}var Te=P('<span class="text-subtle animate-pulse"> </span>'),ye=P('<span class="text-green-600 dark:text-green-400 flex items-center gap-0.5"><span class="opacity-70">+</span> <span> </span></span>'),Ee=P('<span class="text-red-600 dark:text-red-400 flex items-center gap-0.5"><span class="opacity-70">-</span> <span> </span></span>'),Ie=P('<span class="text-subtle"> </span>'),Me=P("<!> <!> <!>",1),Le=P("<div><!></div>");function Ae(r,t){if(new.target)return re({component:Ae,...r});ie(t,!0);let c=v(t,"additions",7,0),e=v(t,"deletions",7,0),i=v(t,"showZero",7,!1),o=v(t,"size",7,"sm"),g=v(t,"inline",7,!0),u=v(t,"loading",7,!1),d=v(t,"class",7,""),y=A(()=>i()||c()>0||e()>0||u()),R=A(()=>{switch(o()){case"xs":return"text-ui gap-1";case"sm":return"text-xs gap-1.5";case"md":return"text-sm gap-2";case"lg":return"text-base gap-2.5";default:return"text-xs gap-1.5"}});function B(a){return ve(a,{notation:"compact"})}var F={get additions(){return c()},set additions(a=0){c(a),h()},get deletions(){return e()},set deletions(a=0){e(a),h()},get showZero(){return i()},set showZero(a=!1){i(a),h()},get size(){return o()},set size(a="sm"){o(a),h()},get inline(){return g()},set inline(a=!0){g(a),h()},get loading(){return u()},set loading(a=!1){u(a),h()},get class(){return d()},set class(a=""){d(a),h()},$set:ne,$on:(a,w)=>se(t,a,w)},C=le(),D=X(C);{var p=a=>{var w=Le(),W=q(w);{var E=_=>{var m=Te(),N=U(m,!0);S(O=>K(N,O),[()=>k.shared_lineChangeStats_calculating_label()]),f(_,m)},V=_=>{var m=Me(),N=X(m);{var O=s=>{var l=ye(),b=T(q(l),2),I=U(b,!0);G(l),S(Y=>K(I,Y),[()=>B(c())]),f(s,l)};L(N,s=>{(c()>0||i())&&s(O)})}var Z=T(N,2);{var j=s=>{var l=Ee(),b=T(q(l),2),I=U(b,!0);G(l),S(Y=>K(I,Y),[()=>B(e())]),f(s,l)};L(Z,s=>{(e()>0||i())&&s(j)})}var x=T(Z,2);{var Q=s=>{var l=Ie(),b=U(l,!0);S(I=>K(b,I),[()=>k.shared_lineChangeStats_noChanges_label()]),f(s,l)};L(x,s=>{!c()&&!e()&&!i()&&s(Q)})}f(_,m)};L(W,_=>{u()?_(E):_(V,-1)})}G(w),S(_=>te(w,1,_),[()=>ge(me("whitespace-nowrap",g()?"inline-flex":"flex","items-center font-mono",n(R),d()))]),f(a,w)};L(D,a=>{n(y)&&a(p)})}return f(r,C),oe(F)}const Ne=new Map([["STRONG","strong"],["B","strong"],["EM","em"],["I","em"],["CODE","code"]]),Pe=new Set(["AUDIO","BUTTON","CANVAS","DETAILS","EMBED","HR","IFRAME","IMG","INPUT","OBJECT","PICTURE","PRE","SELECT","SVG","TABLE","TEXTAREA","VIDEO"]),Re=new Set(["ARTICLE","BLOCKQUOTE","DD","DIV","DT","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","LI","P","SECTION"]);function De(r){return typeof Intl.Segmenter=="function"?Array.from(new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(r),({segment:t})=>t):Array.from(r)}function ee(r,t,c,e){for(const i of De(t.replace(/\s+/gu," "))){const o=i===" ";if(!(o&&(!e.hasText||e.lastWasSpace))){if(e.visibleLength>=c){if(o)return;e.truncated||r.append(document.createTextNode("…")),e.truncated=!0;return}r.append(document.createTextNode(i)),e.visibleLength+=1,e.hasText=!0,e.lastWasSpace=o}}}function ae(r,t,c,e){if(e.truncated)return;if(r.nodeType===Node.TEXT_NODE){ee(t,r.textContent??"",c,e);return}if(!(r instanceof HTMLElement)||Pe.has(r.tagName))return;if(r.tagName==="BR"){ee(t," ",c,e);return}const i=Ne.get(r.tagName);if(i){const o=document.createElement(i);t.append(o);for(const g of r.childNodes)ae(g,o,c,e);o.textContent||o.remove();return}Re.has(r.tagName)&&e.hasText&&ee(t," ",c,e);for(const o of r.childNodes)ae(o,t,c,e)}async function Oe(r,t=80){const c=await xe(r,{allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!1,processPrimitives:!1,taskBlockRenderMode:"content"}),e=document.createElement("template");e.innerHTML=c;const i=document.createElement("span"),o={visibleLength:0,hasText:!1,lastWasSpace:!1,truncated:!1},g=Math.max(0,Math.floor(t));for(const u of e.content.childNodes)ae(u,i,g,o);return i.innerHTML.trim()}async function ze(r){const t=await Oe(r,Number.MAX_SAFE_INTEGER),c=document.createElement("span");return c.innerHTML=t,(c.textContent??"").replace(/<\/?[A-Za-z][^>]*>/gu,"").replace(/\s+/gu," ").trim()}var He=P('<span data-testid="agent-preview-tool-icon"><!></span>'),Be=P('<span><!> <span class="min-w-0 flex-1 truncate text-inherit opacity-[inherit]" data-testid="agent-preview-tool-text"> </span></span>');function Fe(r,t){if(new.target)return re({component:Fe,...r});ie(t,!0);const c=new Set(["figma","sentry","playwright","github","linear","slack","context7"]);let e=v(t,"toolUse",7),i=v(t,"animate",7,!1),o=v(t,"iconSize",7,12),g=v(t,"showIcon",7,!0),u=v(t,"class",7,"");const d=A(()=>be(e().name,e().input||{})),y=A(()=>[n(d).verb,n(d).subject,n(d).path].filter(Boolean).join(" ").trim()||n(d).verb||k.chat_previewToolLabel_tool_fallback());let R=_e("");de(()=>{const p=n(y);let a=!1;return ze(p).then(w=>{a||fe(R,w,!0)}),()=>{a=!0}});var B={get toolUse(){return e()},set toolUse(p){e(p),h()},get animate(){return i()},set animate(p=!1){i(p),h()},get iconSize(){return o()},set iconSize(p=12){o(p),h()},get showIcon(){return g()},set showIcon(p=!0){g(p),h()},get class(){return u()},set class(p=""){u(p),h()},$set:ne,$on:(p,a)=>se(t,p,a)},F=le(),C=X(F);{var D=p=>{var a=Be(),w=q(a);{var W=_=>{var m=He(),N=q(m);{var O=x=>{ke(x,{get iconName(){return n(d).mcpSource},get label(){return n(d).mcpSource},get size(){return o()}})},Z=A(()=>n(d).mcpSource&&c.has(n(d).mcpSource)),j=x=>{we(x,{get icon(){return n(d).icon},class:"h-full! w-full! text-inherit opacity-[inherit]"})};L(N,x=>{n(Z)?x(O):x(j,-1)})}G(m),S(()=>{te(m,1,`agent-preview-tool-icon inline-flex shrink-0 items-center justify-center text-inherit opacity-[inherit] ${i()?"animate-pulse":""}`,"svelte-115ywqs"),ce(m,`width: ${o()??""}px; height: ${o()??""}px;`)}),f(_,m)};L(w,_=>{g()&&_(W)})}var E=T(w,2),V=U(E,!0);he(E,(_,m)=>Ce?.(_,m),()=>n(R)),G(a),S(()=>{te(a,1,`type-body inline-flex w-full min-w-0 items-center font-normal ${g()?"gap-1.5":""} ${u()??""}`,"svelte-115ywqs"),K(V,n(R))}),f(p,a)};L(C,p=>{n(d).hidden||p(D)})}return f(r,F),oe(B)}var Ve=H('<circle cx="12" cy="12" r="10" stroke-width="2" fill="none"></circle>'),Ze=H('<path d="M7 12.5L10.5 16L17 9" stroke="white" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" fill="none"></path>'),Ue=H('<path d="M5 19L19 5" stroke-width="2.5" stroke-linecap="round"></path>'),qe=H('<path d="M13.1372 17.7135C13.1372 18.1682 12.9566 18.6042 12.6351 18.9257C12.3136 19.2472 11.8776 19.4278 11.4229 19.4278C10.9683 19.4278 10.5322 19.2472 10.2107 18.9257C9.88925 18.6042 9.70864 18.1682 9.70864 17.7135C9.70864 17.2589 9.88925 16.8228 10.2107 16.5014C10.5322 16.1799 10.9683 15.9993 11.4229 15.9993C11.8776 15.9993 12.3136 16.1799 12.6351 16.5014C12.9566 16.8228 13.1372 17.2589 13.1372 17.7135ZM10.2109 7.07297C10.3957 6.88872 10.6201 6.7491 10.8671 6.66473C11.114 6.58037 11.377 6.55349 11.6359 6.58615C11.8948 6.61881 12.1428 6.71015 12.361 6.8532C12.5793 6.99625 12.762 7.18724 12.8953 7.4116C13.0285 7.63597 13.1088 7.8878 13.1299 8.14789C13.1511 8.40799 13.1126 8.66948 13.0174 8.91244C12.9222 9.1554 12.7728 9.37342 12.5805 9.54988C12.3883 9.72634 12.1583 9.85659 11.9081 9.93068C11.1212 10.1604 10.1372 10.901 10.1372 12.1421V12.5707C10.1372 12.9117 10.2727 13.2387 10.5138 13.4798C10.7549 13.7209 11.0819 13.8564 11.4229 13.8564C11.7639 13.8564 12.0909 13.7209 12.3321 13.4798C12.5732 13.2387 12.7086 12.9117 12.7086 12.5707V12.3735C13.3281 12.1785 13.8952 11.8451 14.3669 11.3988C14.8387 10.9524 15.2029 10.4046 15.4319 9.79683C15.6609 9.18906 15.7487 8.53719 15.6888 7.89048C15.6289 7.24377 15.4228 6.61913 15.0861 6.06376C14.7494 5.50838 14.2908 5.03681 13.7451 4.68466C13.1994 4.33251 12.5808 4.10899 11.936 4.03101C11.2912 3.95302 10.6371 4.0226 10.0232 4.23449C9.40925 4.44638 8.8515 4.79503 8.39207 5.25411C8.26933 5.37277 8.17145 5.51469 8.10414 5.67158C8.03683 5.82848 8.00145 5.9972 8.00004 6.16792C7.99864 6.33864 8.03125 6.50792 8.09597 6.6659C8.16069 6.82388 8.25623 6.96739 8.37701 7.08805C8.49778 7.20871 8.64138 7.30411 8.79942 7.36868C8.95746 7.43326 9.12677 7.46571 9.29749 7.46414C9.4682 7.46258 9.6369 7.42703 9.79373 7.35958C9.95056 7.29212 10.0924 7.19411 10.2109 7.07125V7.07297Z" fill="white" class="origin-center"></path>'),Ge=H('<path d="M12 5.5V13.5" stroke="white" stroke-width="3" stroke-linecap="round"></path><circle cx="12" cy="17.5" r="1.6" fill="white" class="origin-center"></circle>',1),We=H('<path d="M11.6668 13.649C12.1044 13.649 12.5241 13.4751 12.8336 13.1656C13.1431 12.8562 13.3169 12.4365 13.3169 11.9988C13.3169 11.5611 13.1431 11.1414 12.8336 10.832C12.5241 10.5225 12.1044 10.3486 11.6668 10.3486C11.2291 10.3486 10.8094 10.5225 10.4999 10.832C10.1905 11.1414 10.0166 11.5611 10.0166 11.9988C10.0166 12.4365 10.1905 12.8562 10.4999 13.1656C10.8094 13.4751 11.2291 13.649 11.6668 13.649Z" fill="white" class="origin-center"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4.38506 12.3064C4.31566 12.1046 4.31566 11.8855 4.38506 11.6837C4.90912 10.1693 5.89241 8.85596 7.198 7.92665C8.50359 6.99734 10.0665 6.4983 11.669 6.49902C13.2716 6.49975 14.834 7.00021 16.1388 7.9307C17.4435 8.8612 18.4256 10.1754 18.9483 11.6903C19.0177 11.8921 19.0177 12.1112 18.9483 12.313C18.4245 13.8278 17.4412 15.1416 16.1355 16.0712C14.8298 17.0008 13.2666 17.5 11.6638 17.4993C10.0609 17.4986 8.49824 16.9979 7.19336 16.0671C5.88848 15.1363 4.90641 13.8217 4.38396 12.3064H4.38506ZM14.9681 11.9984C14.9681 12.8737 14.6204 13.7131 14.0015 14.3321C13.3825 14.951 12.5431 15.2987 11.6678 15.2987C10.7925 15.2987 9.95304 14.951 9.33411 14.3321C8.71517 13.7131 8.36746 12.8737 8.36746 11.9984C8.36746 11.1231 8.71517 10.2836 9.33411 9.66468C9.95304 9.04575 10.7925 8.69803 11.6678 8.69803C12.5431 8.69803 13.3825 9.04575 14.0015 9.66468C14.6204 10.2836 14.9681 11.1231 14.9681 11.9984Z" fill="white" class="origin-center"></path>',1),je=H('<svg viewBox="0 0 24 24" fill="none"><defs><clipPath><rect x="48%" y="0" width="100%" height="100%"></rect></clipPath></defs><circle cx="50%" cy="50%" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none origin-center"></circle><circle cx="50%" cy="50%" r="45%" stroke-width="2.5" fill="none" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none"></circle><!></svg>');function Ke(r,t){if(new.target)return re({component:Ke,...r});ie(t,!0);const c=new Set(["not_started","waiting","discussion_needed","blocked","in_progress","review_required","complete","cancelled"]);let e=v(t,"status",7),i=v(t,"size",7,16),o=v(t,"onclick",7);const g=Math.random().toString(36).substring(2,9);let u=A(()=>e()==="todo"?"not_started":e()==="in-progress"?"in_progress":e()==="done"?"complete":typeof e()=="string"&&c.has(e())?e():"unknown");const d={not_started:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},waiting:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},discussion_needed:{stroke:"#f59e0b",fill:"#f59e0b",innerCircleRPercentage:100},blocked:{stroke:"#ef4444",fill:"#ef4444",innerCircleRPercentage:100},in_progress:{stroke:"#00BCFF",fill:"#00BCFF",innerCircleRPercentage:55},review_required:{stroke:"#3b82f6",fill:"#3b82f6",innerCircleRPercentage:100},complete:{stroke:"#22c55e",fill:"#00BD7D",innerCircleRPercentage:100},cancelled:{stroke:"#99999966",fill:"#99999966",innerCircleRPercentage:0},unknown:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0}};let y=A(()=>d[n(u)]||d.not_started);const R={not_started:k.tiptap_taskStatus_notStarted_label,waiting:k.tiptap_taskStatus_waiting_label,discussion_needed:k.tiptap_taskStatus_discussionNeeded_label,blocked:k.tiptap_taskStatus_blocked_label,in_progress:k.tiptap_taskStatus_inProgress_label,review_required:k.tiptap_taskStatus_reviewRequired_label,complete:k.tiptap_taskStatus_complete_label,cancelled:k.tiptap_taskStatus_cancelled_label,unknown:k.tiptap_taskStatus_unknown_label};let B=A(()=>(R[n(u)]??k.tiptap_taskStatus_unknown_label)());var F={get status(){return e()},set status(C){e(C),h()},get size(){return i()},set size(C=16){i(C),h()},get onclick(){return o()},set onclick(C){o(C),h()},$set:ne,$on:(C,D)=>se(t,C,D)};{let C=A(()=>k.tiptap_taskStatus_status_tooltip({status:n(B)}));Se(r,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"task-status-icon shrink-0 cursor-pointer bg-transparent border-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-primary-ink rounded-full",get style(){return`width: ${i()??""}px; height: ${i()??""}px;`},get onclick(){return o()},get title(){return n(C)},children:(D,p)=>{var a=je(),w=q(a),W=U(w),E=T(w),V=T(E),_=T(V);{var m=s=>{},N=s=>{var l=Ve();S(()=>M(l,"stroke",n(y).stroke)),f(s,l)},O=s=>{var l=Ze();z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},Z=s=>{var l=Ue();S(()=>M(l,"stroke",n(y).stroke)),z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},j=s=>{var l=qe();z(3,l,()=>J,()=>({tier:"slow"})),f(s,l)},x=s=>{var l=Ge(),b=X(l),I=T(b);z(3,b,()=>$,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)},Q=s=>{var l=We(),b=X(l),I=T(b);z(3,b,()=>J,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)};L(_,s=>{n(u)==="not_started"||n(u)==="waiting"?s(m):n(u)==="in_progress"?s(N,1):n(u)==="complete"?s(O,2):n(u)==="cancelled"?s(Z,3):n(u)==="discussion_needed"?s(j,4):n(u)==="blocked"?s(x,5):n(u)==="review_required"&&s(Q,6)})}G(a),S(()=>{M(a,"width",i()),M(a,"height",i()),ce(a,`width: ${i()??""}px; height: ${i()??""}px;`),M(W,"id",`half-clip-${g??""}`),M(E,"r",`${n(y).innerCircleRPercentage*.5}%`),M(E,"fill",n(y).fill),M(E,"clip-path",n(u)==="in_progress"?`url(#half-clip-${g})`:"none"),M(V,"stroke",n(y).stroke)}),f(D,a)},$$slots:{default:!0}})}return oe(F)}export{Fe as A,Ae as L,Ke as T,Oe as a,ut as o,ze as r};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B9bXgFyu.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/_LtUY0jS.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/B50rrLDJ.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/C2jYl_tm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/_WGu_9si.js","/app/immutable/chunks/CteMcmUe.js","/app/immutable/chunks/DlUZpQ7U.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/CttA-M7l.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/DI_O2uCQ.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/Cppy6ZYG.js","/app/immutable/chunks/B9ZFoPLo.js","/app/immutable/chunks/VxaCN40t.js","/app/immutable/chunks/BsOWc0fD.js","/app/immutable/chunks/pQ6IdBCz.js"])))=>i.map(i=>d[i]);
2
+ import{_ as ue,t as re,bo as v,bw as ne,b as se,bm as k}from"./C0QTy0Sy.js";import{Jv as pe}from"./_LtUY0jS.js";import{bs as ie,a7 as le,ay as X,aD as n,W as f,bn as oe,c9 as A,aA as h,a5 as q,bA as G,b_ as S,aB as P,bl as U,bO as K,bS as T,ca as de,bH as fe,bV as _e,aC as H}from"./3SdAC2_C.js";import{i as L}from"./bhKPSdq4.js";import{c as ge,e as me,f as te,g as ce,s as M}from"./7UPrdiE9.js";import{m as ve}from"./CE7dsja4.js";import{e as he}from"./B6S6VNu7.js";import{t as Ce}from"./DAsc1V4f.js";import{F as we}from"./U9jJmfYa.js";import{M as ke}from"./KHteWVFN.js";import{b as be}from"./Cppy6ZYG.js";import{aO as xe}from"./BfSTFUKA.js";import{n as z,e as $,s as J}from"./DLwWVKiF.js";import{f as Se}from"./CttA-M7l.js";import"./C2jYl_tm.js";function ut(r,t,c){if(r.metaKey||r.ctrlKey||!(r.currentTarget instanceof Element)||!r.currentTarget.closest("[data-assistant-panels]"))return!1;const e=pe.state.agentSessions.byAgentId[c]?.workspaceId??t,i=r.currentTarget.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId;return ue(async()=>{const{showAssistantContent:o}=await import("./B9bXgFyu.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url).then(({showAssistantContent:o})=>o(`intent://local/${e}/agent/${c}`,{layoutId:i})),!0}var Te=P('<span class="text-subtle animate-pulse"> </span>'),ye=P('<span class="text-green-600 dark:text-green-400 flex items-center gap-0.5"><span class="opacity-70">+</span> <span> </span></span>'),Ee=P('<span class="text-red-600 dark:text-red-400 flex items-center gap-0.5"><span class="opacity-70">-</span> <span> </span></span>'),Ie=P('<span class="text-subtle"> </span>'),Me=P("<!> <!> <!>",1),Le=P("<div><!></div>");function Ae(r,t){if(new.target)return re({component:Ae,...r});ie(t,!0);let c=v(t,"additions",7,0),e=v(t,"deletions",7,0),i=v(t,"showZero",7,!1),o=v(t,"size",7,"sm"),g=v(t,"inline",7,!0),u=v(t,"loading",7,!1),d=v(t,"class",7,""),y=A(()=>i()||c()>0||e()>0||u()),R=A(()=>{switch(o()){case"xs":return"text-ui gap-1";case"sm":return"text-xs gap-1.5";case"md":return"text-sm gap-2";case"lg":return"text-base gap-2.5";default:return"text-xs gap-1.5"}});function B(a){return ve(a,{notation:"compact"})}var F={get additions(){return c()},set additions(a=0){c(a),h()},get deletions(){return e()},set deletions(a=0){e(a),h()},get showZero(){return i()},set showZero(a=!1){i(a),h()},get size(){return o()},set size(a="sm"){o(a),h()},get inline(){return g()},set inline(a=!0){g(a),h()},get loading(){return u()},set loading(a=!1){u(a),h()},get class(){return d()},set class(a=""){d(a),h()},$set:ne,$on:(a,w)=>se(t,a,w)},C=le(),D=X(C);{var p=a=>{var w=Le(),W=q(w);{var E=_=>{var m=Te(),N=U(m,!0);S(O=>K(N,O),[()=>k.shared_lineChangeStats_calculating_label()]),f(_,m)},V=_=>{var m=Me(),N=X(m);{var O=s=>{var l=ye(),b=T(q(l),2),I=U(b,!0);G(l),S(Y=>K(I,Y),[()=>B(c())]),f(s,l)};L(N,s=>{(c()>0||i())&&s(O)})}var Z=T(N,2);{var j=s=>{var l=Ee(),b=T(q(l),2),I=U(b,!0);G(l),S(Y=>K(I,Y),[()=>B(e())]),f(s,l)};L(Z,s=>{(e()>0||i())&&s(j)})}var x=T(Z,2);{var Q=s=>{var l=Ie(),b=U(l,!0);S(I=>K(b,I),[()=>k.shared_lineChangeStats_noChanges_label()]),f(s,l)};L(x,s=>{!c()&&!e()&&!i()&&s(Q)})}f(_,m)};L(W,_=>{u()?_(E):_(V,-1)})}G(w),S(_=>te(w,1,_),[()=>ge(me("whitespace-nowrap",g()?"inline-flex":"flex","items-center font-mono",n(R),d()))]),f(a,w)};L(D,a=>{n(y)&&a(p)})}return f(r,C),oe(F)}const Ne=new Map([["STRONG","strong"],["B","strong"],["EM","em"],["I","em"],["CODE","code"]]),Pe=new Set(["AUDIO","BUTTON","CANVAS","DETAILS","EMBED","HR","IFRAME","IMG","INPUT","OBJECT","PICTURE","PRE","SELECT","SVG","TABLE","TEXTAREA","VIDEO"]),Re=new Set(["ARTICLE","BLOCKQUOTE","DD","DIV","DT","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","LI","P","SECTION"]);function De(r){return typeof Intl.Segmenter=="function"?Array.from(new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(r),({segment:t})=>t):Array.from(r)}function ee(r,t,c,e){for(const i of De(t.replace(/\s+/gu," "))){const o=i===" ";if(!(o&&(!e.hasText||e.lastWasSpace))){if(e.visibleLength>=c){if(o)return;e.truncated||r.append(document.createTextNode("…")),e.truncated=!0;return}r.append(document.createTextNode(i)),e.visibleLength+=1,e.hasText=!0,e.lastWasSpace=o}}}function ae(r,t,c,e){if(e.truncated)return;if(r.nodeType===Node.TEXT_NODE){ee(t,r.textContent??"",c,e);return}if(!(r instanceof HTMLElement)||Pe.has(r.tagName))return;if(r.tagName==="BR"){ee(t," ",c,e);return}const i=Ne.get(r.tagName);if(i){const o=document.createElement(i);t.append(o);for(const g of r.childNodes)ae(g,o,c,e);o.textContent||o.remove();return}Re.has(r.tagName)&&e.hasText&&ee(t," ",c,e);for(const o of r.childNodes)ae(o,t,c,e)}async function Oe(r,t=80){const c=await xe(r,{allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!1,processPrimitives:!1,taskBlockRenderMode:"content"}),e=document.createElement("template");e.innerHTML=c;const i=document.createElement("span"),o={visibleLength:0,hasText:!1,lastWasSpace:!1,truncated:!1},g=Math.max(0,Math.floor(t));for(const u of e.content.childNodes)ae(u,i,g,o);return i.innerHTML.trim()}async function ze(r){const t=await Oe(r,Number.MAX_SAFE_INTEGER),c=document.createElement("span");return c.innerHTML=t,(c.textContent??"").replace(/<\/?[A-Za-z][^>]*>/gu,"").replace(/\s+/gu," ").trim()}var He=P('<span data-testid="agent-preview-tool-icon"><!></span>'),Be=P('<span><!> <span class="min-w-0 flex-1 truncate text-inherit opacity-[inherit]" data-testid="agent-preview-tool-text"> </span></span>');function Fe(r,t){if(new.target)return re({component:Fe,...r});ie(t,!0);const c=new Set(["figma","sentry","playwright","github","linear","slack","context7"]);let e=v(t,"toolUse",7),i=v(t,"animate",7,!1),o=v(t,"iconSize",7,12),g=v(t,"showIcon",7,!0),u=v(t,"class",7,"");const d=A(()=>be(e().name,e().input||{})),y=A(()=>[n(d).verb,n(d).subject,n(d).path].filter(Boolean).join(" ").trim()||n(d).verb||k.chat_previewToolLabel_tool_fallback());let R=_e("");de(()=>{const p=n(y);let a=!1;return ze(p).then(w=>{a||fe(R,w,!0)}),()=>{a=!0}});var B={get toolUse(){return e()},set toolUse(p){e(p),h()},get animate(){return i()},set animate(p=!1){i(p),h()},get iconSize(){return o()},set iconSize(p=12){o(p),h()},get showIcon(){return g()},set showIcon(p=!0){g(p),h()},get class(){return u()},set class(p=""){u(p),h()},$set:ne,$on:(p,a)=>se(t,p,a)},F=le(),C=X(F);{var D=p=>{var a=Be(),w=q(a);{var W=_=>{var m=He(),N=q(m);{var O=x=>{ke(x,{get iconName(){return n(d).mcpSource},get label(){return n(d).mcpSource},get size(){return o()}})},Z=A(()=>n(d).mcpSource&&c.has(n(d).mcpSource)),j=x=>{we(x,{get icon(){return n(d).icon},class:"h-full! w-full! text-inherit opacity-[inherit]"})};L(N,x=>{n(Z)?x(O):x(j,-1)})}G(m),S(()=>{te(m,1,`agent-preview-tool-icon inline-flex shrink-0 items-center justify-center text-inherit opacity-[inherit] ${i()?"animate-pulse":""}`,"svelte-115ywqs"),ce(m,`width: ${o()??""}px; height: ${o()??""}px;`)}),f(_,m)};L(w,_=>{g()&&_(W)})}var E=T(w,2),V=U(E,!0);he(E,(_,m)=>Ce?.(_,m),()=>n(R)),G(a),S(()=>{te(a,1,`type-body inline-flex w-full min-w-0 items-center font-normal ${g()?"gap-1.5":""} ${u()??""}`,"svelte-115ywqs"),K(V,n(R))}),f(p,a)};L(C,p=>{n(d).hidden||p(D)})}return f(r,F),oe(B)}var Ve=H('<circle cx="12" cy="12" r="10" stroke-width="2" fill="none"></circle>'),Ze=H('<path d="M7 12.5L10.5 16L17 9" stroke="white" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" fill="none"></path>'),Ue=H('<path d="M5 19L19 5" stroke-width="2.5" stroke-linecap="round"></path>'),qe=H('<path d="M13.1372 17.7135C13.1372 18.1682 12.9566 18.6042 12.6351 18.9257C12.3136 19.2472 11.8776 19.4278 11.4229 19.4278C10.9683 19.4278 10.5322 19.2472 10.2107 18.9257C9.88925 18.6042 9.70864 18.1682 9.70864 17.7135C9.70864 17.2589 9.88925 16.8228 10.2107 16.5014C10.5322 16.1799 10.9683 15.9993 11.4229 15.9993C11.8776 15.9993 12.3136 16.1799 12.6351 16.5014C12.9566 16.8228 13.1372 17.2589 13.1372 17.7135ZM10.2109 7.07297C10.3957 6.88872 10.6201 6.7491 10.8671 6.66473C11.114 6.58037 11.377 6.55349 11.6359 6.58615C11.8948 6.61881 12.1428 6.71015 12.361 6.8532C12.5793 6.99625 12.762 7.18724 12.8953 7.4116C13.0285 7.63597 13.1088 7.8878 13.1299 8.14789C13.1511 8.40799 13.1126 8.66948 13.0174 8.91244C12.9222 9.1554 12.7728 9.37342 12.5805 9.54988C12.3883 9.72634 12.1583 9.85659 11.9081 9.93068C11.1212 10.1604 10.1372 10.901 10.1372 12.1421V12.5707C10.1372 12.9117 10.2727 13.2387 10.5138 13.4798C10.7549 13.7209 11.0819 13.8564 11.4229 13.8564C11.7639 13.8564 12.0909 13.7209 12.3321 13.4798C12.5732 13.2387 12.7086 12.9117 12.7086 12.5707V12.3735C13.3281 12.1785 13.8952 11.8451 14.3669 11.3988C14.8387 10.9524 15.2029 10.4046 15.4319 9.79683C15.6609 9.18906 15.7487 8.53719 15.6888 7.89048C15.6289 7.24377 15.4228 6.61913 15.0861 6.06376C14.7494 5.50838 14.2908 5.03681 13.7451 4.68466C13.1994 4.33251 12.5808 4.10899 11.936 4.03101C11.2912 3.95302 10.6371 4.0226 10.0232 4.23449C9.40925 4.44638 8.8515 4.79503 8.39207 5.25411C8.26933 5.37277 8.17145 5.51469 8.10414 5.67158C8.03683 5.82848 8.00145 5.9972 8.00004 6.16792C7.99864 6.33864 8.03125 6.50792 8.09597 6.6659C8.16069 6.82388 8.25623 6.96739 8.37701 7.08805C8.49778 7.20871 8.64138 7.30411 8.79942 7.36868C8.95746 7.43326 9.12677 7.46571 9.29749 7.46414C9.4682 7.46258 9.6369 7.42703 9.79373 7.35958C9.95056 7.29212 10.0924 7.19411 10.2109 7.07125V7.07297Z" fill="white" class="origin-center"></path>'),Ge=H('<path d="M12 5.5V13.5" stroke="white" stroke-width="3" stroke-linecap="round"></path><circle cx="12" cy="17.5" r="1.6" fill="white" class="origin-center"></circle>',1),We=H('<path d="M11.6668 13.649C12.1044 13.649 12.5241 13.4751 12.8336 13.1656C13.1431 12.8562 13.3169 12.4365 13.3169 11.9988C13.3169 11.5611 13.1431 11.1414 12.8336 10.832C12.5241 10.5225 12.1044 10.3486 11.6668 10.3486C11.2291 10.3486 10.8094 10.5225 10.4999 10.832C10.1905 11.1414 10.0166 11.5611 10.0166 11.9988C10.0166 12.4365 10.1905 12.8562 10.4999 13.1656C10.8094 13.4751 11.2291 13.649 11.6668 13.649Z" fill="white" class="origin-center"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4.38506 12.3064C4.31566 12.1046 4.31566 11.8855 4.38506 11.6837C4.90912 10.1693 5.89241 8.85596 7.198 7.92665C8.50359 6.99734 10.0665 6.4983 11.669 6.49902C13.2716 6.49975 14.834 7.00021 16.1388 7.9307C17.4435 8.8612 18.4256 10.1754 18.9483 11.6903C19.0177 11.8921 19.0177 12.1112 18.9483 12.313C18.4245 13.8278 17.4412 15.1416 16.1355 16.0712C14.8298 17.0008 13.2666 17.5 11.6638 17.4993C10.0609 17.4986 8.49824 16.9979 7.19336 16.0671C5.88848 15.1363 4.90641 13.8217 4.38396 12.3064H4.38506ZM14.9681 11.9984C14.9681 12.8737 14.6204 13.7131 14.0015 14.3321C13.3825 14.951 12.5431 15.2987 11.6678 15.2987C10.7925 15.2987 9.95304 14.951 9.33411 14.3321C8.71517 13.7131 8.36746 12.8737 8.36746 11.9984C8.36746 11.1231 8.71517 10.2836 9.33411 9.66468C9.95304 9.04575 10.7925 8.69803 11.6678 8.69803C12.5431 8.69803 13.3825 9.04575 14.0015 9.66468C14.6204 10.2836 14.9681 11.1231 14.9681 11.9984Z" fill="white" class="origin-center"></path>',1),je=H('<svg viewBox="0 0 24 24" fill="none"><defs><clipPath><rect x="48%" y="0" width="100%" height="100%"></rect></clipPath></defs><circle cx="50%" cy="50%" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none origin-center"></circle><circle cx="50%" cy="50%" r="45%" stroke-width="2.5" fill="none" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none"></circle><!></svg>');function Ke(r,t){if(new.target)return re({component:Ke,...r});ie(t,!0);const c=new Set(["not_started","waiting","discussion_needed","blocked","in_progress","review_required","complete","cancelled"]);let e=v(t,"status",7),i=v(t,"size",7,16),o=v(t,"onclick",7);const g=Math.random().toString(36).substring(2,9);let u=A(()=>e()==="todo"?"not_started":e()==="in-progress"?"in_progress":e()==="done"?"complete":typeof e()=="string"&&c.has(e())?e():"unknown");const d={not_started:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},waiting:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},discussion_needed:{stroke:"#f59e0b",fill:"#f59e0b",innerCircleRPercentage:100},blocked:{stroke:"#ef4444",fill:"#ef4444",innerCircleRPercentage:100},in_progress:{stroke:"#00BCFF",fill:"#00BCFF",innerCircleRPercentage:55},review_required:{stroke:"#3b82f6",fill:"#3b82f6",innerCircleRPercentage:100},complete:{stroke:"#22c55e",fill:"#00BD7D",innerCircleRPercentage:100},cancelled:{stroke:"#99999966",fill:"#99999966",innerCircleRPercentage:0},unknown:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0}};let y=A(()=>d[n(u)]||d.not_started);const R={not_started:k.tiptap_taskStatus_notStarted_label,waiting:k.tiptap_taskStatus_waiting_label,discussion_needed:k.tiptap_taskStatus_discussionNeeded_label,blocked:k.tiptap_taskStatus_blocked_label,in_progress:k.tiptap_taskStatus_inProgress_label,review_required:k.tiptap_taskStatus_reviewRequired_label,complete:k.tiptap_taskStatus_complete_label,cancelled:k.tiptap_taskStatus_cancelled_label,unknown:k.tiptap_taskStatus_unknown_label};let B=A(()=>(R[n(u)]??k.tiptap_taskStatus_unknown_label)());var F={get status(){return e()},set status(C){e(C),h()},get size(){return i()},set size(C=16){i(C),h()},get onclick(){return o()},set onclick(C){o(C),h()},$set:ne,$on:(C,D)=>se(t,C,D)};{let C=A(()=>k.tiptap_taskStatus_status_tooltip({status:n(B)}));Se(r,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"task-status-icon shrink-0 cursor-pointer bg-transparent border-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-primary-ink rounded-full",get style(){return`width: ${i()??""}px; height: ${i()??""}px;`},get onclick(){return o()},get title(){return n(C)},children:(D,p)=>{var a=je(),w=q(a),W=U(w),E=T(w),V=T(E),_=T(V);{var m=s=>{},N=s=>{var l=Ve();S(()=>M(l,"stroke",n(y).stroke)),f(s,l)},O=s=>{var l=Ze();z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},Z=s=>{var l=Ue();S(()=>M(l,"stroke",n(y).stroke)),z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},j=s=>{var l=qe();z(3,l,()=>J,()=>({tier:"slow"})),f(s,l)},x=s=>{var l=Ge(),b=X(l),I=T(b);z(3,b,()=>$,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)},Q=s=>{var l=We(),b=X(l),I=T(b);z(3,b,()=>J,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)};L(_,s=>{n(u)==="not_started"||n(u)==="waiting"?s(m):n(u)==="in_progress"?s(N,1):n(u)==="complete"?s(O,2):n(u)==="cancelled"?s(Z,3):n(u)==="discussion_needed"?s(j,4):n(u)==="blocked"?s(x,5):n(u)==="review_required"&&s(Q,6)})}G(a),S(()=>{M(a,"width",i()),M(a,"height",i()),ce(a,`width: ${i()??""}px; height: ${i()??""}px;`),M(W,"id",`half-clip-${g??""}`),M(E,"r",`${n(y).innerCircleRPercentage*.5}%`),M(E,"fill",n(y).fill),M(E,"clip-path",n(u)==="in_progress"?`url(#half-clip-${g})`:"none"),M(V,"stroke",n(y).stroke)}),f(D,a)},$$slots:{default:!0}})}return oe(F)}export{Fe as A,Ae as L,Ke as T,Oe as a,ut as o,ze as r};
@@ -1,4 +1,4 @@
1
- import{t as oe,bo as st,bm as Q,bw as ie,bs as $t,bq as Me,b as ce}from"./C0QTy0Sy.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as K,b_ as k,bO as B,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as Be,aj as Ne,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as De}from"./3SdAC2_C.js";import{i as at}from"./bhKPSdq4.js";import{I as ea,g as jt,i as Se}from"./B6S6VNu7.js";import{f as Xt,g as ne,s as gt,c as se}from"./7UPrdiE9.js";import{b as ba}from"./Dn334wJv.js";import{f as Ut}from"./FzlZUztb.js";import"./DCRuihKm.js";import{A as aa,b as na,a as sa}from"./BYq9VtBF.js";import"./CrD0jtXE.js";import{ax as ra,aO as oa,az as Aa,aA as ka,aB as We,ar as ia,b as $a,w as Ta,dM as Ca,a_ as Na,aC as Sa}from"./BaujsV9k.js";import{R as Oa}from"./BmTMWrby.js";import{F as pe,bB as Fa,bg as Ra,aC as Ma,aW as Wa,cE as Ba}from"./U9jJmfYa.js";import{H as Da}from"./Cf4fmkfL.js";import{A as La}from"./wl2qP2wF.js";import{N as Ea}from"./DAJnPbZk.js";import{f as Pa}from"./KEaRLIGy.js";import{i as St,Jv as Fe,nY as Ga,fU as za,c6 as ja,sE as Ka,u$ as Ha}from"./tr-2J8Mf.js";import"./DX-Wrapd.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),N=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Bt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return N()},set onmouseleave(A){N(A),rt()},$set:ie,$on:(A,D)=>ce(a,A,D)},ht=nn(),bt=L(ht);{var Kt=A=>{var D=Le(),Tt=L(D);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(D),k(()=>B(Rt,` ${p()??""}`)),_(A,D)};at(bt,A=>{p()&&u()&&A(Kt)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
1
+ import{t as oe,bo as st,bm as Q,bw as ie,bs as $t,bq as Me,b as ce}from"./C0QTy0Sy.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as K,b_ as k,bO as B,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as Be,aj as Ne,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as De}from"./3SdAC2_C.js";import{i as at}from"./bhKPSdq4.js";import{I as ea,g as jt,i as Se}from"./B6S6VNu7.js";import{f as Xt,g as ne,s as gt,c as se}from"./7UPrdiE9.js";import{b as ba}from"./Dn334wJv.js";import{f as Ut}from"./CttA-M7l.js";import"./C2jYl_tm.js";import{A as aa,b as na,a as sa}from"./CENp25rd.js";import"./CrD0jtXE.js";import{ax as ra,aO as oa,az as Aa,aA as ka,aB as We,ar as ia,b as $a,w as Ta,dM as Ca,a_ as Na,aC as Sa}from"./Cppy6ZYG.js";import{R as Oa}from"./DlUZpQ7U.js";import{F as pe,bB as Fa,bg as Ra,aC as Ma,aW as Wa,cE as Ba}from"./U9jJmfYa.js";import{H as Da}from"./Cf4fmkfL.js";import{A as La}from"./wl2qP2wF.js";import{N as Ea}from"./CzRvdM50.js";import{f as Pa}from"./BhcBqtJg.js";import{i as St,Jv as Fe,nY as Ga,fU as za,c6 as ja,sE as Ka,u$ as Ha}from"./_LtUY0jS.js";import"./DX-Wrapd.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),N=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Bt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return N()},set onmouseleave(A){N(A),rt()},$set:ie,$on:(A,D)=>ce(a,A,D)},ht=nn(),bt=L(ht);{var Kt=A=>{var D=Le(),Tt=L(D);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(D),k(()=>B(Rt,` ${p()??""}`)),_(A,D)};at(bt,A=>{p()&&u()&&A(Kt)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
2
2
  hover:shadow transition-all cursor-pointer ${t(A)??""}`},get style(){return`width: 180px; height: 180px; anchor-name: --agent-hierarchy-${n().agentId??""};`},get onclick(){return v()},get onmouseenter(){return b()},get onmouseleave(){return N()},children:(D,Tt)=>{var Rt=an(),Lt=Yt(Rt),me=L(Lt);aa(me,{get agentId(){return n().agentId},variant:"emphasized",get state(){return t(Ot)},get specialist(){return n().specialist}}),$(Lt);var Zt=C(Lt,2),_e=K(Zt,!0),Jt=C(Zt,2),te=L(Jt);{var ye=ft=>{var r=Va(),f=L(r),M=L(f);{let z=y(()=>s().kind==="blocker"?Ma:Wa);pe(M,{get icon(){return t(z)},size:"xs"})}var W=C(M,2),m=K(W,!0);$(f);var H=C(f,2);{var nt=z=>{var It=Ua(),ot=K(It,!0);k(()=>B(ot,s().reason)),_(z,It)};at(H,z=>{s().reason&&z(nt)})}var S=C(H,2);{var G=z=>{Oa(z,{get date(){return s().timestamp},class:"text-ui text-ghost"})};at(S,z=>{s().timestamp&&z(G)})}$(r),k(z=>{Xt(r,1,`text-sm flex flex-col items-center gap-0.5 ${s().kind==="blocker"?"text-red-500":"text-warning-ink"}`),B(m,z)},[()=>s().kind==="blocker"?Q.chat_agentCard_attentionBlocker_label():Q.chat_agentCard_attentionDiscussion_label()]),_(ft,r)},yt=ft=>{var r=Qa(),f=L(r);pe(f,{get icon(){return Fa},size:"xs",class:"animate-pulse"});var M=C(f,2),W=K(M,!0);$(r),k(m=>B(W,m),[()=>Q.agentOverview_hierarchyCard_waitingFor_label({names:t(E).join(", ")})]),_(ft,r)},Ie=ft=>{const r=y(()=>n().activeToolName?$a(n().activeToolName,n().activeToolInput||{}):null),f=y(()=>t(r)&&!t(r).hidden?t(r):null);var M=tn(),W=L(M),m=L(W);ea(m,{size:14});var H=C(m,2);{var nt=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>B(pt,Et),[()=>Q.agentOverview_hierarchyCard_thinking_label()]),_(Y,Z)},S=Y=>{var Z=Za(),pt=K(Z);k(()=>B(pt,`${t(f).verb??""}
3
3
  ${t(f).subject??""}`)),_(Y,Z)},G=Y=>{var Z=Oe(),pt=K(Z);k(()=>B(pt,`${t(f).verb??""}...`)),_(Y,Z)},z=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>B(pt,Et),[()=>Q.agentOverview_hierarchyCard_responding_label()]),_(Y,Z)};at(H,Y=>{i()?Y(nt):t(f)&&t(f).subject?Y(S,1):t(f)?Y(G,2):Y(z,-1)})}$(W);var It=C(W,2);{var ot=Y=>{var Z=Ja(),pt=K(Z,!0);k(()=>B(pt,n().lastResponse)),_(Y,Z)};at(It,Y=>{!t(f)&&n().lastResponse&&Y(ot)})}$(M),_(ft,M)},xe=ft=>{var r=en(),f=K(r,!0);k(()=>B(f,n().lastResponse)),_(ft,r)};at(te,ft=>{s()?ft(ye):c()?ft(yt,1):u()||i()?ft(Ie,2):n().lastResponse&&ft(xe,3)})}$(Jt),k(()=>B(_e,n().name)),_(D,Rt)},$$slots:{default:!0}})}var ge=C(Ft,2);{var Dt=A=>{var D=Le(),Tt=L(D);pe(Tt,{get icon(){return Ba},size:"xs",class:"inline"});var Rt=C(Tt);$(D),k(Lt=>B(Rt,` ${Lt??""}`),[()=>Q.agentOverview_hierarchyCard_note_label()]),_(A,D)};at(ge,A=>{R()&&u()&&A(Dt)})}$(ht),_(e,ht);var Qt=de(Bt);return l(),Qt}const sn=50;var rn=F('<span class="sr-only"> </span> <!>',1);function Re(e,a){if(new.target)return oe({component:Re,...e});le(a,!0);const s=()=>$t(R,"$attentionRequest$",c),g=()=>$t(h,"$agentSession$",c),u=()=>$t(p,"$agentIsWaitingForOtherAgents$",c),[c,d]=Me();let i=st(a,"agent",7),o=st(a,"onclick",7),l=st(a,"onmouseenter",7),n=st(a,"onmouseleave",7);const p=We(i().agentId),R=ia(i().agentId),h=oa(i().agentId),v=y(()=>{const x={attentionKind:s()?.kind??null};return g()?na(g(),x):sa({status:i().status,isResponding:i().status==="responding",isWaitingForOtherAgents:u()},{...x,isCompleted:i().status==="completed",isFailed:i().status==="failed"})});var b={get agent(){return i()},set agent(x){i(x),rt()},get onclick(){return o()},set onclick(x){o(x),rt()},get onmouseenter(){return l()},set onmouseenter(x){l(x),rt()},get onmouseleave(){return n()},set onmouseleave(x){n(x),rt()},$set:ie,$on:(x,it)=>ce(a,x,it)};Ut(e,{variant:"ghost",type:"button",class:"background-agent-card relative flex flex-col items-center justify-center gap-1 rounded-full bg-sidebar hover:bg-muted/70 transition-colors cursor-pointer p-2",get style(){return`width: 50px; min-height: 50px; anchor-name: --agent-hierarchy-${i().agentId??""};`},get onclick(){return o()},get onmouseenter(){return l()},get onmouseleave(){return n()},children:(x,it)=>{var E=rn(),I=Yt(E),P=K(I,!0),ct=C(I,2);aa(ct,{get agentId(){return i().agentId},size:32,get state(){return t(v)},get specialist(){return i().specialist}}),k(()=>B(P,i().name)),_(x,E)},$$slots:{default:!0}});var N=de(b);return d(),N}var re=he('<path fill="none"></path>'),on=F('<div class="batch-group-box relative z-10 bg-background border border-border rounded-xl"></div>'),cn=F('<svg class="connector-svg" style="overflow: visible; display: block;"><!><!></svg> <div class="children-items-row flex items-start justify-center"></div>',1),ln=F('<div class="children-wrapper flex flex-col items-center"></div>'),dn=F('<div class="agent-tree-node flex flex-col items-center"><div class="agent-card-wrapper relative z-10"><!></div> <!></div>'),gn=F('<div class="absolute inset-0 flex items-center justify-center"><div class="text-center text-subtle"><p class="text-lg font-medium"> </p> <p class="text-sm mt-1"> </p></div></div>'),un=F('<div class="utility-corral border border-dashed border-border rounded-lg p-3 min-w-20"><div class="corral-label text-xs text-subtle font-medium mb-2 text-center"> </div> <div class="corral-agents flex flex-col items-center gap-2"></div></div>'),fn=F('<div class="utility-corrals flex flex-col gap-4"></div>'),pn=F('<div class="text-xs text-subtle capitalize"> </div>'),vn=F('<span class="px-1.5 py-0.5 text-ui font-medium bg-muted text-subtle rounded"> </span>'),hn=F('<span class="text-warning-ink"> </span>'),mn=F('<span class="text-primary-ink"> </span>'),_n=F('<span class="text-green-500"> </span>'),yn=F('<span class="text-red-500"> </span>'),In=F("<span> </span>"),xn=F('<div class="text-xs text-subtle line-clamp-3 border-t border-border pt-2 mt-2"> </div>'),wn=F('<div class="text-xs text-subtle flex items-center gap-1"><!> <span> </span></div>'),bn=F('<div class="p-3 space-y-2"><div class="flex items-center gap-2"><!> <div class="flex-1 min-w-0"><div class="font-medium text-sm truncate"> </div> <!></div> <!></div> <div class="text-xs text-subtle"><!></div> <div class="text-xs text-subtle"> </div> <!> <!></div>'),An=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),kn=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),$n=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path></svg>'),Tn=F('<div class="canvas-content absolute inset-0 flex items-center justify-center p-8 svelte-13q5gm4"><div class="hierarchy-wrapper flex items-start gap-8"><!> <div class="main-hierarchy flex flex-col items-center gap-4"><div class="hierarchy-container flex flex-col items-center gap-4"><div class="roots-row flex justify-center"></div></div></div></div> <!></div> <div class="zoom-controls absolute bottom-4 right-4 flex items-center gap-1 bg-card border border-border rounded-lg shadow-sm p-1"><!> <!> <!> <div class="w-px h-6 bg-border mx-1"></div> <!></div> <div class="absolute bottom-4 left-4 text-xs text-subtle"> </div>',1),Cn=F('<div class="agent-hierarchy-graph relative w-full h-full overflow-hidden bg-background svelte-13q5gm4"><!></div>');function la(e,a){if(new.target)return oe({component:la,...e});le(a,!0);const s=(r,f=wa,M)=>{const W=y(()=>f().agent.isBackground),m=y(()=>f().children.length>0),H=y(()=>t(m)&&f().children[0]?.agent.isBackground?sn:Xa),nt=y(()=>16),S=y(()=>60),G=y(()=>t(m)?Rt(f().children,t(H),i):[]),z=y(()=>(()=>{const O=[];for(let q=0;q<t(G).length;q+=Tt)O.push(t(G).slice(q,q+Tt));return O})()),It=y(()=>t(z).map(O=>O.reduce((q,J)=>q+J.width,0)+Math.max(0,O.length-1)*i)),ot=y(()=>Math.max(...t(It),0));var Y=dn(),Z=L(Y),pt=L(Z);{var Et=O=>{Re(O,{get agent(){return f().agent},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})},we=O=>{ca(O,{get agent(){return f().agent},get activeFile(){return f().activeFile},get activeNote(){return f().activeNote},get agentNames(){return t(Lt)},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})};at(pt,O=>{t(W)?O(Et):O(we,-1)})}$(Z);var be=C(Z,2);{var U=O=>{const q=y(()=>f().agent.status==="waiting"?f().agent.waitingForAgentIds||[]:[]),J=y(()=>t(q).length>0),et=y(()=>t(S)/2);var xt=ln();jt(xt,21,()=>t(z),Se,(Ht,At,Ct)=>{const Pt=y(()=>t(It)[Ct]),ee=y(()=>(t(ot)-t(Pt))/2),Ae=y(()=>(()=>{let ut=0;return t(At).map(j=>{const Nt=ut+j.width/2;return ut+=j.width+i,Nt})})());var ue=cn(),Gt=Yt(ue);gt(Gt,"height",t(S));var qt=L(Gt);{var ke=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} -${Ya} L ${t(ot)/2} ${t(S)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)},$e=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} 0 L ${t(ot)/2} ${t(S)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)};at(qt,ut=>{Ct>0?ut(ke):ut($e,-1)})}var Te=C(qt);jt(Te,17,()=>t(At),Se,(ut,j,Nt)=>{const vt=y(()=>t(ee)+t(Ae)[Nt]),lt=y(()=>t(ot)/2),zt=y(()=>t(j).type==="batch"?t(j).children.some(wt=>t(q).includes(wt.agent.agentId)):t(q).includes(t(j).child.agent.agentId)),mt=y(()=>t(zt)?"var(--color-primary)":"currentColor"),kt=y(()=>t(zt)?"":"text-border"),w=y(()=>t(zt)?2:1),T=y(()=>t(j).type==="batch"?t(S)-A:t(S)),tt=y(()=>Math.abs(t(vt)-t(lt))),X=y(()=>Math.min(t(nt),t(tt)/2));var fe=De(),Ce=Yt(fe);{var va=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(S)/3} L ${t(lt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)},ha=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(S)/3}
4
4
  L ${t(lt)??""} ${t(et)-t(X)}
@@ -1 +1 @@
1
- import{t as H,bo as x,bw as U,b as W}from"./C0QTy0Sy.js";import{bV as j,br as q,bH as A,aD as y,bs as X,ca as z,a5 as J,b_ as C,W as N,bS as K,a7 as Q,ay as Z,bA as $,bn as ee,c9 as te,at as ae,aA as _,aB as M,bI as re,aG as se}from"./3SdAC2_C.js";import{k as oe}from"./-K3ARgq0.js";import{g as D,e as L,o as ne,p as ie}from"./B6S6VNu7.js";import{n as V,g as F,S}from"./DLwWVKiF.js";import{c as T,e as O,f as P}from"./7UPrdiE9.js";import{_ as G}from"./DCRuihKm.js";import{c as de}from"./BAKPnd3w.js";function ce(r,a){const i=[...a].filter(t=>Number.isInteger(t)&&t>=0&&r[t]!==void 0).sort((t,o)=>t-o),u=[];for(const t of i){const o=u.at(-1);!o||t>o.endIndex+1?u.push({startIndex:t,endIndex:t}):t>o.endIndex&&(o.endIndex=t)}return u.map(({startIndex:t,endIndex:o})=>{let c=Number.POSITIVE_INFINITY,d=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=Number.NEGATIVE_INFINITY;for(let l=t;l<=o;l+=1){const n=r[l];n&&(c=Math.min(c,n.top),d=Math.min(d,n.left),g=Math.max(g,n.left+n.width),m=Math.max(m,n.top+n.height))}return{startIndex:t,endIndex:o,rect:{top:c,left:d,width:g-d,height:m-c}}})}function E(r,a){return Math.max(0,Math.min(r.endIndex,a.endIndex)-Math.max(r.startIndex,a.startIndex)+1)}function le(){let r=j(q([])),a=[],i=1;return{get groups(){return y(r)},update(u,t){const o=new Set,c=ce(u,t).map(d=>{const m=a.filter(l=>!o.has(l.id)&&E(l,d)>0).sort((l,n)=>E(n,d)-E(l,d)||l.id-n.id)[0]?.id??i++;return o.add(m),{id:m,...d}});a=c,A(r,c,!0)},reset(){a=[],A(r,[],!0),i=1}}}var ue=M('<div data-proximity-highlight="selected" style="border-radius: var(--radius-row)"></div>'),me=M('<div data-proximity-highlight="hover" style="border-radius: var(--radius-row)"></div>'),pe=M('<div aria-hidden="true"><!> <!></div>');function fe(r,a){if(new.target)return H({component:fe,...r});X(a,!0);let i=x(a,"store",7),u=x(a,"selectedIndexes",23,()=>[]),t=x(a,"selectedClass",7,"bg-selected"),o=x(a,"hoverClass",7,"bg-hover"),c=x(a,"class",7);const d=le(),g=te(()=>i().activeIndex===null?void 0:i().itemRects[i().activeIndex]);z(()=>{d.update(i().itemRects,u())});const m=(e,s)=>{const p=new S(s.rect.top,s.tier),f=new S(s.rect.left,s.tier),b=new S(s.rect.width,s.tier),v=new S(s.rect.height,s.tier),I=ae(()=>{z(()=>{e.style.transform=`translate3d(${f.current}px, ${p.current}px, 0)`,e.style.width=`${b.current}px`,e.style.height=`${v.current}px`})}),w=h=>{p.set(h.rect.top),f.set(h.rect.left),b.set(h.rect.width),v.set(h.rect.height)},B=ne(()=>ie()&&w(s));return{update(h){s=h,w(h)},destroy(){B(),I()}}};var l={get store(){return i()},set store(e){i(e),_()},get selectedIndexes(){return u()},set selectedIndexes(e=[]){u(e),_()},get selectedClass(){return t()},set selectedClass(e="bg-selected"){t(e),_()},get hoverClass(){return o()},set hoverClass(e="bg-hover"){o(e),_()},get class(){return c()},set class(e){c(e),_()},$set:U,$on:(e,s)=>W(a,e,s)},n=pe(),R=J(n);D(R,17,()=>d.groups,e=>e.id,(e,s)=>{var p=ue();L(p,(f,b)=>m?.(f,b),()=>({rect:y(s).rect,tier:"moderate"})),C(f=>P(p,1,f),[()=>T(O("absolute",t()))]),V(2,p,()=>F,()=>({tier:"moderate"})),N(e,p)});var k=K(R,2);return oe(k,()=>i().sessionId,e=>{var s=Q(),p=Z(s);D(p,17,()=>y(g)?[y(g)]:[],f=>0,(f,b)=>{var v=me();L(v,(I,w)=>m?.(I,w),()=>({rect:y(b),tier:"moderate"})),C(I=>P(v,1,I),[()=>T(O("absolute",o()))]),V(2,v,()=>F,()=>({tier:"fast"})),N(f,v)}),N(e,s)}),$(n),C(e=>P(n,1,e),[()=>T(O("pointer-events-none absolute inset-0",c()))]),N(r,n),ee(l)}const Se=G({base:`${de} menu-row group/menu-item relative z-10 flex w-full min-w-0 cursor-default select-none items-start gap-2.5 border-none bg-transparent px-2.5 py-1.5 transition-colors duration-spring-fast ease-spring-fast focus:text-foreground focus-visible:outline-none data-[menu-item]:font-medium data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none`,variants:{inset:{true:"pl-8"}}}),Ce=G({base:"menu-overlay type-caption relative isolate z-(--layer-popover) overflow-hidden rounded-(--radius-medium) border border-border bg-popover shadow-(--elevation-overlay) [--menu-icon-size:calc(var(--space-3)+var(--space-1)/2)] [--radius-row:calc(var(--radius-small)-var(--space-1)/2)] focus-visible:border-input focus-visible:outline focus-visible:-outline-offset-1 data-[side=bottom]:origin-top data-[side=top]:origin-bottom data-[side=left]:origin-right data-[side=right]:origin-left data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-spring-moderate data-[state=open]:ease-spring-moderate data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-spring-moderate-exit data-[state=closed]:ease-spring-exit motion-reduce:animate-none motion-reduce:transition-none"}),Te="text-shortcut-foreground",Oe=-5,Pe={enter:{tier:"moderate",y:4,scale:.95},exit:{tier:"moderate"}},Y=Symbol("dialog-portal-target");function Ee(r){re(Y,r)}function Me(){const r=se(Y);return()=>r?.()??void 0}const ge=["[data-bits-floating-content-wrapper]",'[role="combobox"][aria-expanded="true"]','[aria-haspopup]:not([aria-haspopup="false"])[aria-expanded="true"]'].join(", ");function Re(r,a){return r?.querySelector(":scope > [data-bits-floating-content-wrapper]")?!0:a.target instanceof Element&&a.target.closest(ge)!==null}export{fe as P,Se as a,Ce as b,Pe as c,Oe as d,Re as e,Te as m,Ee as p,Me as u};
1
+ import{t as H,bo as x,bw as U,b as W}from"./C0QTy0Sy.js";import{bV as j,br as q,bH as A,aD as y,bs as X,ca as z,a5 as J,b_ as C,W as N,bS as K,a7 as Q,ay as Z,bA as $,bn as ee,c9 as te,at as ae,aA as _,aB as M,bI as re,aG as se}from"./3SdAC2_C.js";import{k as oe}from"./-K3ARgq0.js";import{g as D,e as L,o as ne,p as ie}from"./B6S6VNu7.js";import{n as V,g as F,S}from"./DLwWVKiF.js";import{c as T,e as O,f as P}from"./7UPrdiE9.js";import{_ as G}from"./C2jYl_tm.js";import{c as de}from"./B2w13ngc.js";function ce(r,a){const i=[...a].filter(t=>Number.isInteger(t)&&t>=0&&r[t]!==void 0).sort((t,o)=>t-o),u=[];for(const t of i){const o=u.at(-1);!o||t>o.endIndex+1?u.push({startIndex:t,endIndex:t}):t>o.endIndex&&(o.endIndex=t)}return u.map(({startIndex:t,endIndex:o})=>{let c=Number.POSITIVE_INFINITY,d=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=Number.NEGATIVE_INFINITY;for(let l=t;l<=o;l+=1){const n=r[l];n&&(c=Math.min(c,n.top),d=Math.min(d,n.left),g=Math.max(g,n.left+n.width),m=Math.max(m,n.top+n.height))}return{startIndex:t,endIndex:o,rect:{top:c,left:d,width:g-d,height:m-c}}})}function E(r,a){return Math.max(0,Math.min(r.endIndex,a.endIndex)-Math.max(r.startIndex,a.startIndex)+1)}function le(){let r=j(q([])),a=[],i=1;return{get groups(){return y(r)},update(u,t){const o=new Set,c=ce(u,t).map(d=>{const m=a.filter(l=>!o.has(l.id)&&E(l,d)>0).sort((l,n)=>E(n,d)-E(l,d)||l.id-n.id)[0]?.id??i++;return o.add(m),{id:m,...d}});a=c,A(r,c,!0)},reset(){a=[],A(r,[],!0),i=1}}}var ue=M('<div data-proximity-highlight="selected" style="border-radius: var(--radius-row)"></div>'),me=M('<div data-proximity-highlight="hover" style="border-radius: var(--radius-row)"></div>'),pe=M('<div aria-hidden="true"><!> <!></div>');function fe(r,a){if(new.target)return H({component:fe,...r});X(a,!0);let i=x(a,"store",7),u=x(a,"selectedIndexes",23,()=>[]),t=x(a,"selectedClass",7,"bg-selected"),o=x(a,"hoverClass",7,"bg-hover"),c=x(a,"class",7);const d=le(),g=te(()=>i().activeIndex===null?void 0:i().itemRects[i().activeIndex]);z(()=>{d.update(i().itemRects,u())});const m=(e,s)=>{const p=new S(s.rect.top,s.tier),f=new S(s.rect.left,s.tier),b=new S(s.rect.width,s.tier),v=new S(s.rect.height,s.tier),I=ae(()=>{z(()=>{e.style.transform=`translate3d(${f.current}px, ${p.current}px, 0)`,e.style.width=`${b.current}px`,e.style.height=`${v.current}px`})}),w=h=>{p.set(h.rect.top),f.set(h.rect.left),b.set(h.rect.width),v.set(h.rect.height)},B=ne(()=>ie()&&w(s));return{update(h){s=h,w(h)},destroy(){B(),I()}}};var l={get store(){return i()},set store(e){i(e),_()},get selectedIndexes(){return u()},set selectedIndexes(e=[]){u(e),_()},get selectedClass(){return t()},set selectedClass(e="bg-selected"){t(e),_()},get hoverClass(){return o()},set hoverClass(e="bg-hover"){o(e),_()},get class(){return c()},set class(e){c(e),_()},$set:U,$on:(e,s)=>W(a,e,s)},n=pe(),R=J(n);D(R,17,()=>d.groups,e=>e.id,(e,s)=>{var p=ue();L(p,(f,b)=>m?.(f,b),()=>({rect:y(s).rect,tier:"moderate"})),C(f=>P(p,1,f),[()=>T(O("absolute",t()))]),V(2,p,()=>F,()=>({tier:"moderate"})),N(e,p)});var k=K(R,2);return oe(k,()=>i().sessionId,e=>{var s=Q(),p=Z(s);D(p,17,()=>y(g)?[y(g)]:[],f=>0,(f,b)=>{var v=me();L(v,(I,w)=>m?.(I,w),()=>({rect:y(b),tier:"moderate"})),C(I=>P(v,1,I),[()=>T(O("absolute",o()))]),V(2,v,()=>F,()=>({tier:"fast"})),N(f,v)}),N(e,s)}),$(n),C(e=>P(n,1,e),[()=>T(O("pointer-events-none absolute inset-0",c()))]),N(r,n),ee(l)}const Se=G({base:`${de} menu-row group/menu-item relative z-10 flex w-full min-w-0 cursor-default select-none items-start gap-2.5 border-none bg-transparent px-2.5 py-1.5 transition-colors duration-spring-fast ease-spring-fast focus:text-foreground focus-visible:outline-none data-[menu-item]:font-medium data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none`,variants:{inset:{true:"pl-8"}}}),Ce=G({base:"menu-overlay type-caption relative isolate z-(--layer-popover) overflow-hidden rounded-(--radius-medium) border border-border bg-popover shadow-(--elevation-overlay) [--menu-icon-size:calc(var(--space-3)+var(--space-1)/2)] [--radius-row:calc(var(--radius-small)-var(--space-1)/2)] focus-visible:border-input focus-visible:outline focus-visible:-outline-offset-1 data-[side=bottom]:origin-top data-[side=top]:origin-bottom data-[side=left]:origin-right data-[side=right]:origin-left data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-spring-moderate data-[state=open]:ease-spring-moderate data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-spring-moderate-exit data-[state=closed]:ease-spring-exit motion-reduce:animate-none motion-reduce:transition-none"}),Te="text-shortcut-foreground",Oe=-5,Pe={enter:{tier:"moderate",y:4,scale:.95},exit:{tier:"moderate"}},Y=Symbol("dialog-portal-target");function Ee(r){re(Y,r)}function Me(){const r=se(Y);return()=>r?.()??void 0}const ge=["[data-bits-floating-content-wrapper]",'[role="combobox"][aria-expanded="true"]','[aria-haspopup]:not([aria-haspopup="false"])[aria-expanded="true"]'].join(", ");function Re(r,a){return r?.querySelector(":scope > [data-bits-floating-content-wrapper]")?!0:a.target instanceof Element&&a.target.closest(ge)!==null}export{fe as P,Se as a,Ce as b,Pe as c,Oe as d,Re as e,Te as m,Ee as p,Me as u};
@@ -1 +1 @@
1
- import{t as lt,bo as u,bw as ct,b as dt}from"./C0QTy0Sy.js";import{bs as vt,ca as ft,aD as t,a5 as H,bS as ut,bA as D,bH as K,b_ as S,W as T,bn as gt,bV as P,c9 as x,aA as g,a7 as mt,ay as ht,bl as pt,bO as bt,aB as F}from"./3SdAC2_C.js";import{i as L}from"./bhKPSdq4.js";import{g as _t}from"./B6S6VNu7.js";import{t as kt}from"./CrD0jtXE.js";import{f as X,s as c,g as R}from"./7UPrdiE9.js";import{b as wt}from"./Dn334wJv.js";import{l as j}from"./CE7dsja4.js";import{A as xt}from"./BYq9VtBF.js";import{a as Wt}from"./wl2qP2wF.js";function It(W){const{itemCount:a,maxVisible:d,availableWidth:n,surface:s,overlap:b,overflowOverlap:v}=W;if(n<=0)return 0;const _=s-b,m=Math.min(a,Math.max(0,d)),y=i=>i===0?0:s+(i-1)*_;if(a<=m&&y(a)<=n)return a;for(let i=m;i>=0;i-=1){const A=a-i;if(y(i)+(A>0?W.measureOverflowText(A)-(i>0?v:0):0)<=n)return i}return 0}function yt(W,a=n=>requestAnimationFrame(n),d=n=>cancelAnimationFrame(n)){let n,s;return{set(b){if(n=b,s!==void 0)return;let v=!1;const _=a(()=>{v=!0,s=void 0;const m=n;n=void 0,W(m)});v||(s=_)},cancel(){s!==void 0&&(d(s),s=void 0),n=void 0}}}const At=20,Ct=12;let O,J;const Q=new Map;var Tt=F('<span data-agent-avatar-stack-item=""><!></span>'),Ot=F('<span class="agent-avatar-stack-track svelte-1nk9fhe"></span>'),Vt=F('<span class="agent-avatar-stack-overflow svelte-1nk9fhe" data-agent-avatar-overflow=""> </span>'),Mt=F('<span data-agent-avatar-stack="" data-agent-avatar-stack-overlap="later-on-top"><!> <!></span>');function St(W,a){if(new.target)return lt({component:St,...W});vt(a,!0);let d=u(a,"items",7),n=u(a,"maxVisible",7,3),s=u(a,"adaptive",7,!1),b=u(a,"align",7,"end"),v=u(a,"variant",7,"card-stack"),_=u(a,"interactive",7,!1),m=u(a,"overflowId",7),y=u(a,"overflowTestId",7),i=u(a,"itemContent",7),A=u(a,"class",7,""),I=P(void 0),z=P(void 0);const h=x(()=>Wt[v()]),U=x(()=>s()&&t(z)!==void 0?It({itemCount:d().length,maxVisible:n(),availableWidth:t(z),surface:t(h).surface,overlap:t(h).overlap,overflowOverlap:t(h).overlap,measureOverflowText:e=>Math.max(t(h).surface,$(e)+Ct)}):void 0),Y=x(()=>Math.min(d().length,Math.max(0,s()?t(U)??n():n()))),k=x(()=>d().slice(0,t(Y))),E=x(()=>Math.max(0,d().length-t(k).length)),N=x(()=>t(h).surface-t(h).overlap),Z=x(()=>t(k).length===0?0:t(h).surface+(t(k).length-1)*t(N));function $(e){const r=`+${j(e)}`,o=Q.get(r);if(o!==void 0)return o;if(O===void 0&&(O=document.createElement("canvas").getContext("2d")),!O||!t(I))return At;J??=`500 12px ${getComputedStyle(t(I)).fontFamily}`,O.font=J;const l=O.measureText(r).width;return Q.set(r,l),l}ft(()=>{if(!s()||!t(I)||typeof ResizeObserver>"u")return;const e=yt(o=>{K(z,o,!0)}),r=new ResizeObserver(o=>{const l=o[o.length-1];e.set(l.borderBoxSize?.[0]?.inlineSize??l.contentRect.width)});return r.observe(t(I)),()=>{r.disconnect(),e.cancel()}});var tt={get items(){return d()},set items(e){d(e),g()},get maxVisible(){return n()},set maxVisible(e=3){n(e),g()},get adaptive(){return s()},set adaptive(e=!1){s(e),g()},get align(){return b()},set align(e="end"){b(e),g()},get variant(){return v()},set variant(e="card-stack"){v(e),g()},get interactive(){return _()},set interactive(e=!1){_(e),g()},get overflowId(){return m()},set overflowId(e){m(e),g()},get overflowTestId(){return y()},set overflowTestId(e){y(e),g()},get itemContent(){return i()},set itemContent(e){i(e),g()},get class(){return A()},set class(e=""){A(e),g()},$set:ct,$on:(e,r)=>dt(a,e,r)},p=Mt();let q;var B=H(p);{var et=e=>{var r=Ot();let o;_t(r,23,()=>t(k),l=>l.key,(l,w,V)=>{var f=Tt();let G;var nt=H(f);{var st=C=>{var M=mt(),ot=ht(M);kt(ot,i,()=>t(w)),T(C,M)},it=C=>{{let M=x(()=>t(w).state??"idle");xt(C,{get agentId(){return t(w).agentId},get specialist(){return t(w).specialist},get icon(){return t(w).icon},get state(){return t(M)},get variant(){return v()},class:"agent-avatar-stack-surface"})}};L(nt,C=>{i()?C(st):C(it,-1)})}D(f),S(()=>{G=X(f,1,"agent-avatar-stack-item svelte-1nk9fhe",null,G,{"agent-avatar-stack-item--before-overflow":t(E)>0&&t(V)===t(k).length-1}),R(f,`inset-inline-start: ${t(V)*t(N)}px; z-index: ${t(V)+1};`),c(f,"data-agent-avatar-stack-index",t(V)),c(f,"data-agent-avatar-stack-key",t(w).key),c(f,"data-agent-avatar-stack-agent-id",t(w).agentId),c(f,"data-agent-avatar-stack-specialist",t(w).specialist??void 0),c(f,"aria-hidden",_()?void 0:"true")}),T(l,f)}),D(r),S(()=>o=R(r,"",o,{width:`${t(Z)}px`})),T(e,r)};L(B,e=>{t(k).length>0&&e(et)})}var at=ut(B,2);{var rt=e=>{var r=Vt(),o=pt(r);S(l=>{c(r,"id",m()),R(r,`margin-inline-start: ${t(k).length>0?-t(h).overlap:0}px; z-index: ${t(k).length+1};`),c(r,"data-testid",y()),bt(o,`+${l??""}`)},[()=>j(t(E))]),T(e,r)};L(at,e=>{t(E)>0&&e(rt)})}return D(p),wt(p,e=>K(I,e),()=>t(I)),S(()=>{q=X(p,1,`agent-avatar-stack ${A()??""}`,"svelte-1nk9fhe",q,{"agent-avatar-stack--adaptive":s(),"agent-avatar-stack--start":b()==="start"}),c(p,"data-agent-avatar-stack-align",b()),c(p,"data-avatar-variant",v()),c(p,"data-agent-avatar-stack-clear-space",t(h).ring),c(p,"aria-hidden",!_()&&!m()?"true":void 0)}),T(W,p),gt(tt)}export{St as A};
1
+ import{t as lt,bo as u,bw as ct,b as dt}from"./C0QTy0Sy.js";import{bs as vt,ca as ft,aD as t,a5 as H,bS as ut,bA as D,bH as K,b_ as S,W as T,bn as gt,bV as P,c9 as x,aA as g,a7 as mt,ay as ht,bl as pt,bO as bt,aB as F}from"./3SdAC2_C.js";import{i as L}from"./bhKPSdq4.js";import{g as _t}from"./B6S6VNu7.js";import{t as kt}from"./CrD0jtXE.js";import{f as X,s as c,g as R}from"./7UPrdiE9.js";import{b as wt}from"./Dn334wJv.js";import{l as j}from"./CE7dsja4.js";import{A as xt}from"./CENp25rd.js";import{a as Wt}from"./wl2qP2wF.js";function It(W){const{itemCount:a,maxVisible:d,availableWidth:n,surface:s,overlap:b,overflowOverlap:v}=W;if(n<=0)return 0;const _=s-b,m=Math.min(a,Math.max(0,d)),y=i=>i===0?0:s+(i-1)*_;if(a<=m&&y(a)<=n)return a;for(let i=m;i>=0;i-=1){const A=a-i;if(y(i)+(A>0?W.measureOverflowText(A)-(i>0?v:0):0)<=n)return i}return 0}function yt(W,a=n=>requestAnimationFrame(n),d=n=>cancelAnimationFrame(n)){let n,s;return{set(b){if(n=b,s!==void 0)return;let v=!1;const _=a(()=>{v=!0,s=void 0;const m=n;n=void 0,W(m)});v||(s=_)},cancel(){s!==void 0&&(d(s),s=void 0),n=void 0}}}const At=20,Ct=12;let O,J;const Q=new Map;var Tt=F('<span data-agent-avatar-stack-item=""><!></span>'),Ot=F('<span class="agent-avatar-stack-track svelte-1nk9fhe"></span>'),Vt=F('<span class="agent-avatar-stack-overflow svelte-1nk9fhe" data-agent-avatar-overflow=""> </span>'),Mt=F('<span data-agent-avatar-stack="" data-agent-avatar-stack-overlap="later-on-top"><!> <!></span>');function St(W,a){if(new.target)return lt({component:St,...W});vt(a,!0);let d=u(a,"items",7),n=u(a,"maxVisible",7,3),s=u(a,"adaptive",7,!1),b=u(a,"align",7,"end"),v=u(a,"variant",7,"card-stack"),_=u(a,"interactive",7,!1),m=u(a,"overflowId",7),y=u(a,"overflowTestId",7),i=u(a,"itemContent",7),A=u(a,"class",7,""),I=P(void 0),z=P(void 0);const h=x(()=>Wt[v()]),U=x(()=>s()&&t(z)!==void 0?It({itemCount:d().length,maxVisible:n(),availableWidth:t(z),surface:t(h).surface,overlap:t(h).overlap,overflowOverlap:t(h).overlap,measureOverflowText:e=>Math.max(t(h).surface,$(e)+Ct)}):void 0),Y=x(()=>Math.min(d().length,Math.max(0,s()?t(U)??n():n()))),k=x(()=>d().slice(0,t(Y))),E=x(()=>Math.max(0,d().length-t(k).length)),N=x(()=>t(h).surface-t(h).overlap),Z=x(()=>t(k).length===0?0:t(h).surface+(t(k).length-1)*t(N));function $(e){const r=`+${j(e)}`,o=Q.get(r);if(o!==void 0)return o;if(O===void 0&&(O=document.createElement("canvas").getContext("2d")),!O||!t(I))return At;J??=`500 12px ${getComputedStyle(t(I)).fontFamily}`,O.font=J;const l=O.measureText(r).width;return Q.set(r,l),l}ft(()=>{if(!s()||!t(I)||typeof ResizeObserver>"u")return;const e=yt(o=>{K(z,o,!0)}),r=new ResizeObserver(o=>{const l=o[o.length-1];e.set(l.borderBoxSize?.[0]?.inlineSize??l.contentRect.width)});return r.observe(t(I)),()=>{r.disconnect(),e.cancel()}});var tt={get items(){return d()},set items(e){d(e),g()},get maxVisible(){return n()},set maxVisible(e=3){n(e),g()},get adaptive(){return s()},set adaptive(e=!1){s(e),g()},get align(){return b()},set align(e="end"){b(e),g()},get variant(){return v()},set variant(e="card-stack"){v(e),g()},get interactive(){return _()},set interactive(e=!1){_(e),g()},get overflowId(){return m()},set overflowId(e){m(e),g()},get overflowTestId(){return y()},set overflowTestId(e){y(e),g()},get itemContent(){return i()},set itemContent(e){i(e),g()},get class(){return A()},set class(e=""){A(e),g()},$set:ct,$on:(e,r)=>dt(a,e,r)},p=Mt();let q;var B=H(p);{var et=e=>{var r=Ot();let o;_t(r,23,()=>t(k),l=>l.key,(l,w,V)=>{var f=Tt();let G;var nt=H(f);{var st=C=>{var M=mt(),ot=ht(M);kt(ot,i,()=>t(w)),T(C,M)},it=C=>{{let M=x(()=>t(w).state??"idle");xt(C,{get agentId(){return t(w).agentId},get specialist(){return t(w).specialist},get icon(){return t(w).icon},get state(){return t(M)},get variant(){return v()},class:"agent-avatar-stack-surface"})}};L(nt,C=>{i()?C(st):C(it,-1)})}D(f),S(()=>{G=X(f,1,"agent-avatar-stack-item svelte-1nk9fhe",null,G,{"agent-avatar-stack-item--before-overflow":t(E)>0&&t(V)===t(k).length-1}),R(f,`inset-inline-start: ${t(V)*t(N)}px; z-index: ${t(V)+1};`),c(f,"data-agent-avatar-stack-index",t(V)),c(f,"data-agent-avatar-stack-key",t(w).key),c(f,"data-agent-avatar-stack-agent-id",t(w).agentId),c(f,"data-agent-avatar-stack-specialist",t(w).specialist??void 0),c(f,"aria-hidden",_()?void 0:"true")}),T(l,f)}),D(r),S(()=>o=R(r,"",o,{width:`${t(Z)}px`})),T(e,r)};L(B,e=>{t(k).length>0&&e(et)})}var at=ut(B,2);{var rt=e=>{var r=Vt(),o=pt(r);S(l=>{c(r,"id",m()),R(r,`margin-inline-start: ${t(k).length>0?-t(h).overlap:0}px; z-index: ${t(k).length+1};`),c(r,"data-testid",y()),bt(o,`+${l??""}`)},[()=>j(t(E))]),T(e,r)};L(at,e=>{t(E)>0&&e(rt)})}return D(p),wt(p,e=>K(I,e),()=>t(I)),S(()=>{q=X(p,1,`agent-avatar-stack ${A()??""}`,"svelte-1nk9fhe",q,{"agent-avatar-stack--adaptive":s(),"agent-avatar-stack--start":b()==="start"}),c(p,"data-agent-avatar-stack-align",b()),c(p,"data-avatar-variant",v()),c(p,"data-agent-avatar-stack-clear-space",t(h).ring),c(p,"aria-hidden",!_()&&!m()?"true":void 0)}),T(W,p),gt(tt)}export{St as A};
@@ -1 +1 @@
1
- import{t as T,bo as r,bw as W,bq as $,b as x,bs as B}from"./C0QTy0Sy.js";import{bs as C,cd as H,ca as S,a7 as u,ay as f,W as k,bn as q,aA as o}from"./3SdAC2_C.js";import{i as D}from"./bhKPSdq4.js";import{k as J}from"./-K3ARgq0.js";import{a as L}from"./Dac_vP74.js";import{dH as j}from"./BaujsV9k.js";import{Jv as z,g$ as E}from"./tr-2J8Mf.js";function F(i,t){if(new.target)return T({component:F,...i});C(t,!0);const d=()=>B(w,"$workspace$",b),[b,v]=$();let c=r(t,"tab",7),a=r(t,"workspaceId",7),n=r(t,"layoutId",7),p=r(t,"isActive",7);const m=H(a());S(()=>m.set(a()));const w=j(m);var g={get tab(){return c()},set tab(e){c(e),o()},get workspaceId(){return a()},set workspaceId(e){a(e),o()},get layoutId(){return n()},set layoutId(e){n(e),o()},get isActive(){return p()},set isActive(e){p(e),o()},$set:W,$on:(e,s)=>x(t,e,s)},l=u(),_=f(l);{var y=e=>{var s=u(),A=f(s);J(A,a,h=>{L(h,{get workspace(){return d()},showBackToList:!1,onclose:()=>z.dispatch(E(n()??a(),c().id))})}),k(e,s)};D(_,e=>{p()&&d()&&e(y)})}k(i,l);var I=q(g);return v(),I}export{F as default};
1
+ import{t as T,bo as r,bw as W,bq as $,b as x,bs as B}from"./C0QTy0Sy.js";import{bs as C,cd as H,ca as S,a7 as u,ay as f,W as k,bn as q,aA as o}from"./3SdAC2_C.js";import{i as D}from"./bhKPSdq4.js";import{k as J}from"./-K3ARgq0.js";import{a as L}from"./D14F6Zen.js";import{dH as j}from"./Cppy6ZYG.js";import{Jv as z,g$ as E}from"./_LtUY0jS.js";function F(i,t){if(new.target)return T({component:F,...i});C(t,!0);const d=()=>B(w,"$workspace$",b),[b,v]=$();let c=r(t,"tab",7),a=r(t,"workspaceId",7),n=r(t,"layoutId",7),p=r(t,"isActive",7);const m=H(a());S(()=>m.set(a()));const w=j(m);var g={get tab(){return c()},set tab(e){c(e),o()},get workspaceId(){return a()},set workspaceId(e){a(e),o()},get layoutId(){return n()},set layoutId(e){n(e),o()},get isActive(){return p()},set isActive(e){p(e),o()},$set:W,$on:(e,s)=>x(t,e,s)},l=u(),_=f(l);{var y=e=>{var s=u(),A=f(s);J(A,a,h=>{L(h,{get workspace(){return d()},showBackToList:!1,onclose:()=>z.dispatch(E(n()??a(),c().id))})}),k(e,s)};D(_,e=>{p()&&d()&&e(y)})}k(i,l);var I=q(g);return v(),I}export{F as default};
@@ -1 +1 @@
1
- import{t as G,bo as n,bw as H,b as W,bp as k}from"./C0QTy0Sy.js";import{bo as z,bs as B,a7 as m,ay as p,W as c,bn as D,aA as d,aD as h,a5 as I,bf as Q,bA as j,c9 as q,aB as E}from"./3SdAC2_C.js";import{i as F}from"./bhKPSdq4.js";import{t as _}from"./CrD0jtXE.js";import{b as J}from"./7UPrdiE9.js";import{a as L,S as M}from"./BSKFIBj2.js";import{az as b,av as S,aQ as K}from"./FzlZUztb.js";var N=new Set(["$$slots","$$events","$$legacy","id","ref","children","child"]),O=E("<div><!></div>");function R(f,t){const u=z();if(new.target)return G({component:R,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"children",7),i=n(t,"child",7),x=k(t,N);const y=L.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get children(){return s()},set children(e){s(e),d()},get child(){return i()},set child(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,i,()=>({props:h(v)})),c(e,r)},C=e=>{var r=O();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>s()??Q),j(r),c(e,r)};F(P,e=>{i()?e(A):e(C,-1)})}return c(f,g),D(w)}var T=new Set(["$$slots","$$events","$$legacy","id","ref","child","children"]),U=E("<div><!></div>");function V(f,t){const u=z();if(new.target)return G({component:V,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"child",7),i=n(t,"children",7),x=k(t,T);const y=M.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get child(){return s()},set child(e){s(e),d()},get children(){return i()},set children(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,s,()=>({props:h(v)})),c(e,r)},C=e=>{var r=U();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>i()??Q),j(r),c(e,r)};F(P,e=>{s()?e(A):e(C,-1)})}return c(f,g),D(w)}export{R as S,V as a};
1
+ import{t as G,bo as n,bw as H,b as W,bp as k}from"./C0QTy0Sy.js";import{bo as z,bs as B,a7 as m,ay as p,W as c,bn as D,aA as d,aD as h,a5 as I,bf as Q,bA as j,c9 as q,aB as E}from"./3SdAC2_C.js";import{i as F}from"./bhKPSdq4.js";import{t as _}from"./CrD0jtXE.js";import{b as J}from"./7UPrdiE9.js";import{a as L,S as M}from"./ram0Xoqf.js";import{az as b,av as S,aQ as K}from"./CttA-M7l.js";var N=new Set(["$$slots","$$events","$$legacy","id","ref","children","child"]),O=E("<div><!></div>");function R(f,t){const u=z();if(new.target)return G({component:R,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"children",7),i=n(t,"child",7),x=k(t,N);const y=L.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get children(){return s()},set children(e){s(e),d()},get child(){return i()},set child(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,i,()=>({props:h(v)})),c(e,r)},C=e=>{var r=O();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>s()??Q),j(r),c(e,r)};F(P,e=>{i()?e(A):e(C,-1)})}return c(f,g),D(w)}var T=new Set(["$$slots","$$events","$$legacy","id","ref","child","children"]),U=E("<div><!></div>");function V(f,t){const u=z();if(new.target)return G({component:V,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"child",7),i=n(t,"children",7),x=k(t,T);const y=M.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get child(){return s()},set child(e){s(e),d()},get children(){return i()},set children(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,s,()=>({props:h(v)})),c(e,r)},C=e=>{var r=U();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>i()??Q),j(r),c(e,r)};F(P,e=>{s()?e(A):e(C,-1)})}return c(f,g),D(w)}export{R as S,V as a};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/ozVAo4aX.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/DA5opfEp.js","/app/immutable/chunks/EK6zOAHM.js"])))=>i.map(i=>d[i]);
2
- var Fh=Object.defineProperty;var Nh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var P=(t,e,i)=>Nh(t,typeof e!="symbol"?e+"":e,i);import{cd as zh}from"./3SdAC2_C.js";import{bm as $s,_ as Dn}from"./C0QTy0Sy.js";import{a as Xi}from"./BdWqymET.js";import{i as Fs}from"./BBWuirRW.js";import{f as Wh}from"./C6mS8uZB.js";import{t as Hh}from"./C8y9EItt.js";import{d as Hi}from"./B0Z-1lwJ.js";import{c as Uh}from"./ChTqQfQN.js";import{s as Wt}from"./CQ409-Pj.js";import{H as Kh}from"./DCRuihKm.js";import{Jv as _t,KA as Bn,gD as qh,a_ as Vh,CC as Gh,AP as Yh,sj as Xh}from"./tr-2J8Mf.js";import{O as An,S as Pn,J as On,B as In}from"./Bqd7fdCF.js";import{g as jh}from"./L_tYoUCb.js";import{f as Zh,l as Jh}from"./PIgqsYsQ.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/C1JG3JxG.js","/app/immutable/chunks/DlUZpQ7U.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CttA-M7l.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/C2jYl_tm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/DI_O2uCQ.js","/app/immutable/chunks/_LtUY0jS.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BPjvgJzJ.js","/app/immutable/chunks/BsOWc0fD.js"])))=>i.map(i=>d[i]);
2
+ var Fh=Object.defineProperty;var Nh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var P=(t,e,i)=>Nh(t,typeof e!="symbol"?e+"":e,i);import{cd as zh}from"./3SdAC2_C.js";import{bm as $s,_ as Dn}from"./C0QTy0Sy.js";import{a as Xi}from"./BdWqymET.js";import{i as Fs}from"./BBWuirRW.js";import{f as Wh}from"./B50rrLDJ.js";import{t as Hh}from"./Chp6TQgb.js";import{d as Hi}from"./B0Z-1lwJ.js";import{c as Uh}from"./ChTqQfQN.js";import{s as Wt}from"./CQ409-Pj.js";import{H as Kh}from"./C2jYl_tm.js";import{Jv as _t,KA as Bn,gD as qh,a_ as Vh,CC as Gh,AP as Yh,sj as Xh}from"./_LtUY0jS.js";import{O as An,S as Pn,J as On,B as In}from"./Bqd7fdCF.js";import{g as jh}from"./B9ZFoPLo.js";import{f as Zh,l as Jh}from"./_Z48PZPG.js";/**
3
3
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
4
4
  * @license MIT
5
5
  *
@@ -141,6 +141,6 @@ void main() {
141
141
  `))}},df=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},uf=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},_f=0,dr=class{constructor(t){this.value=t,this.id=_f++}},ff=2,gf,ut=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new lf(t?.onListenerError??cr,this._options?.leakWarningThreshold??hf):void 0,this._perfMon=this._options?._profName?new af(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,e,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let a=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],l=new uf(`${o}. HINT: Stack shows most frequent listener (${a[1]}-times)`,a[0]);return(this._options?.onListenerError||cr)(l),Kt.None}if(this._disposed)return Kt.None;e&&(t=t.bind(e));let s=new dr(t),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=cf.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof dr?(this._deliveryQueue??=new pf,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=Ci(()=>{r?.(),this._removeListener(s)});return i instanceof xn?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*ff<=e.length){let r=0;for(let n=0;n<e.length;n++)e[n]?e[r++]=e[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=r}}_deliver(t,e){if(!t)return;let i=this._options?.onListenerError||cr;if(!i){t.value(e);return}try{t.value(e)}catch(s){i(s)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof dr)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},pf=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ph=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),mf;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof vf?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ph})})(mf||={});var vf=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ph:(this._emitter||(this._emitter=new ut),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},pi="en",ur=!1,cs,bs=pi,oa=pi,Sf,Et,ri=globalThis,Ge;typeof ri.vscode<"u"&&typeof ri.vscode.process<"u"?Ge=ri.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ge=process);var wf=typeof Ge?.versions?.electron=="string",bf=wf&&Ge?.type==="renderer";if(typeof Ge=="object"){Ge.platform,Ge.platform,ur=Ge.platform==="linux",ur&&Ge.env.SNAP&&Ge.env.SNAP_REVISION,Ge.env.CI||Ge.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cs=pi,bs=pi;let t=Ge.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);cs=e.userLocale,oa=e.osLocale,bs=e.resolvedLanguage||pi,Sf=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!bf?(Et=navigator.userAgent,Et.indexOf("Windows")>=0,Et.indexOf("Macintosh")>=0,(Et.indexOf("Macintosh")>=0||Et.indexOf("iPad")>=0||Et.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ur=Et.indexOf("Linux")>=0,Et?.indexOf("Mobi")>=0,bs=globalThis._VSCODE_NLS_LANGUAGE||pi,cs=navigator.language.toLowerCase(),oa=cs):console.error("Unable to resolve platform.");var vt=Et,$t=bs,Cf;(t=>{function e(){return $t}t.value=e;function i(){return $t.length===2?$t==="en":$t.length>=3?$t[0]==="e"&&$t[1]==="n"&&$t[2]==="-":!1}t.isDefaultVariant=i;function s(){return $t==="en"}t.isDefault=s})(Cf||={});var yf=typeof ri.postMessage=="function"&&!ri.importScripts;(()=>{if(yf){let t=[];ri.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(s,1),n.callback();return}}});let e=0;return i=>{let s=++e;t.push({id:s,callback:i}),ri.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var xf=!!(vt&&vt.indexOf("Chrome")>=0);vt&&vt.indexOf("Firefox")>=0;!xf&&vt&&vt.indexOf("Safari")>=0;vt&&vt.indexOf("Edg/")>=0;vt&&vt.indexOf("Android")>=0;function Oh(t,e=0,i){let s=setTimeout(()=>{t()},e);return Ci(()=>{clearTimeout(s)})}var kf;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(kf||={});var aa=class Qe{static fromArray(e){return new Qe(i=>{i.emitMany(e)})}static fromPromise(e){return new Qe(async i=>{i.emitMany(await e)})}static fromPromises(e){return new Qe(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new Qe(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ut,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await kn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new Qe(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return Qe.map(this,e)}static filter(e,i){return new Qe(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return Qe.filter(this,e)}static coalesce(e){return Qe.filter(e,i=>!!i)}coalesce(){return Qe.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return Qe.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};aa.EMPTY=aa.fromArray([]);var Lf=class extends Kt{constructor(t){super(),this._terminal=t,this._linesCacheTimeout=this._register(new Ts),this._linesCacheDisposables=this._register(new Ts),this._register(Ci(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=Eh(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=Oh(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(t){return this._linesCache?.[t]}setLineInCache(t,e){this._linesCache&&(this._linesCache[t]=e)}translateBufferLineToStringWithWrap(t,e){let i=[],s=[0],r=this._terminal.buffer.active.getLine(t);for(;r;){let n=this._terminal.buffer.active.getLine(t+1),o=n?n.isWrapped:!1,a=r.translateToString(!o&&e);if(o&&n){let l=r.getCell(r.length-1);l&&l.getCode()===0&&l.getWidth()===1&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)s.push(s[s.length-1]+a.length);else break;t++,r=n}return[i.join(""),s]}},Ef=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(t){this._cachedSearchTerm=t}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(t){this._lastSearchOptions=t}isValidSearchTerm(t){return!!(t&&t.length>0)}didOptionsChange(t){return this._lastSearchOptions?t?this._lastSearchOptions.caseSensitive!==t.caseSensitive||this._lastSearchOptions.regex!==t.regex||this._lastSearchOptions.wholeWord!==t.wholeWord:!1:!0}shouldUpdateHighlighting(t,e){return e?.decorations?this._cachedSearchTerm===void 0||t!==this._cachedSearchTerm||this.didOptionsChange(e):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},Mf=class{constructor(t,e){this._terminal=t,this._lineCache=e}find(t,e,i,s){if(!t||t.length===0){this._terminal.clearSelection();return}if(i>this._terminal.cols)throw new Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let r={startRow:e,startCol:i},n=this._findInLine(t,r,s);if(!n)for(let o=e+1;o<this._terminal.buffer.active.baseY+this._terminal.rows&&(r.startRow=o,r.startCol=0,n=this._findInLine(t,r,s),!n);o++);return n}findNextWithSelection(t,e,i){if(!t||t.length===0){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,n=0;s&&(i===t?(r=s.end.x,n=s.end.y):(r=s.start.x,n=s.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:r},a=this._findInLine(t,o,e);if(!a)for(let l=n+1;l<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=l,o.startCol=0,a=this._findInLine(t,o,e),!a);l++);if(!a&&n!==0)for(let l=0;l<n&&(o.startRow=l,o.startCol=0,a=this._findInLine(t,o,e),!a);l++);return!a&&s&&(o.startRow=s.start.y,o.startCol=0,a=this._findInLine(t,o,e)),a}findPreviousWithSelection(t,e,i){if(!t||t.length===0){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols,o=!0;this._lineCache.initLinesCache();let a={startRow:r,startCol:n},l;if(s&&(a.startRow=r=s.start.y,a.startCol=n=s.start.x,i!==t&&(l=this._findInLine(t,a,e,!1),l||(a.startRow=r=s.end.y,a.startCol=n=s.end.x))),l||(l=this._findInLine(t,a,e,o)),!l){a.startCol=Math.max(a.startCol,this._terminal.cols);for(let h=r-1;h>=0&&(a.startRow=h,l=this._findInLine(t,a,e,o),!l);h--);}if(!l&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let h=this._terminal.buffer.active.baseY+this._terminal.rows-1;h>=r&&(a.startRow=h,l=this._findInLine(t,a,e,o),!l);h--);return l}_isWholeWord(t,e,i){return(t===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(e[t-1]))&&(t+i.length===e.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(e[t+i.length]))}_findInLine(t,e,i={},s=!1){let r=e.startRow,n=e.startCol;if(this._terminal.buffer.active.getLine(r)?.isWrapped){if(s){e.startCol+=this._terminal.cols;return}return e.startRow--,e.startCol+=this._terminal.cols,this._findInLine(t,e,i)}let o=this._lineCache.getLineFromCache(r);o||(o=this._lineCache.translateBufferLineToStringWithWrap(r,!0),this._lineCache.setLineInCache(r,o));let[a,l]=o,h=this._bufferColsToStringOffset(r,n),c=t,d=a;i.regex||(c=i.caseSensitive?t:t.toLowerCase(),d=i.caseSensitive?a:a.toLowerCase());let u=-1;if(i.regex){let f=RegExp(c,i.caseSensitive?"g":"gi"),g;if(s)for(;g=f.exec(d.slice(0,h));)u=f.lastIndex-g[0].length,t=g[0],f.lastIndex-=t.length-1;else g=f.exec(d.slice(h)),g&&g[0].length>0&&(u=h+(f.lastIndex-g[0].length),t=g[0])}else s?h-c.length>=0&&(u=d.lastIndexOf(c,h-c.length)):u=d.indexOf(c,h);if(u>=0){if(i.wholeWord&&!this._isWholeWord(u,d,t))return;let f=0;for(;f<l.length-1&&u>=l[f+1];)f++;let g=f;for(;g<l.length-1&&u+t.length>=l[g+1];)g++;let C=u-l[f],L=u+t.length-l[g],D=this._stringLengthToBufferSize(r+f,C),B=this._stringLengthToBufferSize(r+g,L)-D+this._terminal.cols*(g-f);return{term:t,col:D,row:r+f,size:B}}}_stringLengthToBufferSize(t,e){let i=this._terminal.buffer.active.getLine(t);if(!i)return 0;for(let s=0;s<e;s++){let r=i.getCell(s);if(!r)break;let n=r.getChars();n.length>1&&(e-=n.length-1);let o=i.getCell(s+1);o&&o.getWidth()===0&&e++}return e}_bufferColsToStringOffset(t,e){let i=t,s=0,r=this._terminal.buffer.active.getLine(i);for(;e>0&&r;){for(let n=0;n<e&&n<this._terminal.cols;n++){let o=r.getCell(n);if(!o)break;o.getWidth()&&(s+=o.getCode()===0?1:o.getChars().length)}if(i++,r=this._terminal.buffer.active.getLine(i),r&&!r.isWrapped)break;e-=this._terminal.cols}return s}},Tf=class extends Kt{constructor(t){super(),this._terminal=t,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(Ci(()=>this.clearHighlightDecorations()))}createHighlightDecorations(t,e){this.clearHighlightDecorations();for(let i of t){let s=this._createResultDecorations(i,e,!1);if(s)for(let r of s)this._storeDecoration(r,i)}}createActiveDecoration(t,e){let i=this._createResultDecorations(t,e,!0);if(i)return{decorations:i,match:t,dispose(){Ki(i)}}}clearHighlightDecorations(){Ki(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,e){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:e,dispose(){t.dispose()}})}_applyStyles(t,e,i){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),e&&(t.style.outline=`1px solid ${e}`)),i&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,e,i){let s=[],r=t.col,n=t.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;n>0;){let l=Math.min(this._terminal.cols-r,n);s.push([o,r,l]),r=0,n-=l,o++}let a=[];for(let l of s){let h=this._terminal.registerMarker(l[0]),c=this._terminal.registerDecoration({marker:h,x:l[1],width:l[2],backgroundColor:i?e.activeMatchBackground:e.matchBackground,overviewRulerOptions:this._highlightedLines.has(h.line)?void 0:{color:i?e.activeMatchColorOverviewRuler:e.matchOverviewRuler,position:"center"}});if(c){let d=[];d.push(h),d.push(c.onRender(u=>this._applyStyles(u,i?e.activeMatchBorder:e.matchBorder,!1))),d.push(c.onDispose(()=>Ki(d))),a.push(c)}}return a.length===0?void 0:a}},Rf=class extends Kt{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new ut)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,e){this._searchResults=t.slice(0,e)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let e=0;e<this._searchResults.length;e++){let i=this._searchResults[e];if(i.row===t.row&&i.col===t.col&&i.size===t.size)return e}return-1}fireResultsChanged(t){if(!t)return;let e=-1;this._selectedDecoration&&(e=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:e,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},Df=class extends Kt{constructor(t){super(),this._highlightTimeout=this._register(new Ts),this._lineCache=this._register(new Ts),this._state=new Ef,this._resultTracker=this._register(new Rf),this._highlightLimit=t?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(t){this._terminal=t,this._lineCache.value=new Lf(t),this._engine=new Mf(t,this._lineCache.value),this._decorationManager=new Tf(t),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(Ci(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=Oh(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(t){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),t||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findNextAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_highlightAllMatches(t,e){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(t)){this.clearDecorations();return}this.clearDecorations(!0);let i=[],s,r=this._engine.find(t,0,0,e);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(t,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,e);this._resultTracker.updateResults(i,this._highlightLimit),e.decorations&&this._decorationManager.createHighlightDecorations(i,e.decorations)}_findNextAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}findPrevious(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findPreviousAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_fireResults(t){this._resultTracker.fireResultsChanged(!!t?.decorations)}_findPreviousAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}_selectResult(t,e,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!t)return this._terminal.clearSelection(),!1;if(this._terminal.select(t.col,t.row,t.size),e){let s=this._decorationManager.createActiveDecoration(t,e);s&&(this._resultTracker.selectedDecoration=s)}if(!i&&(t.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||t.row<this._terminal.buffer.active.viewportY)){let s=t.row-this._terminal.buffer.active.viewportY;s-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(s)}return!0}};const Gt=new Xi("TerminalStateMachine");var et=(t=>(t.UNINITIALIZED="uninitialized",t.INITIALIZING="initializing",t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.DISCONNECTED="disconnected",t.ERROR="error",t.DISPOSED="disposed",t))(et||{});class Bf{constructor(e){P(this,"currentState","uninitialized");P(this,"stateListeners",new Map);P(this,"transitionListeners",new Set);P(this,"errorHandlers",new Set);P(this,"transitions",[{from:["uninitialized"],to:"initializing",action:"initialize"},{from:["initializing"],to:"connecting",action:"connect"},{from:["connecting"],to:"connected",action:"connected"},{from:["disconnected","error"],to:"reconnecting",action:"reconnect"},{from:["reconnecting"],to:"connected",action:"reconnected"},{from:["connected","connecting"],to:"disconnected",action:"disconnect"},{from:["initializing","connecting","connected","reconnecting"],to:"error",action:"error"},{from:["uninitialized","initializing","connecting","connected","reconnecting","disconnected","error"],to:"disposed",action:"dispose"}]);this.terminalId=e}getState(){return this.currentState}canTransition(e){const i=this.transitions.find(s=>s.action===e&&s.from.includes(this.currentState));return!(!i||i.guard&&!i.guard())}transition(e){const i=this.transitions.find(r=>r.action===e&&r.from.includes(this.currentState));if(!i)return Gt.warn(`Invalid transition: ${e} from ${this.currentState}`),!1;if(i.guard&&!i.guard())return Gt.warn(`Guard failed for transition: ${e}`),!1;const s=this.currentState;return this.currentState=i.to,Gt.info(`Terminal ${this.terminalId}: ${s} -> ${this.currentState} (${e})`),this.notifyStateListeners(this.currentState),this.notifyTransitionListeners(s,this.currentState),!0}onStateChange(e,i){let s=this.stateListeners.get(e);return s||(s=new Set,this.stateListeners.set(e,s)),s.add(i),()=>{this.stateListeners.get(e)?.delete(i)}}onTransition(e){return this.transitionListeners.add(e),()=>{this.transitionListeners.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}reportError(e){Gt.error(`Terminal ${this.terminalId} error:`,e),this.errorHandlers.forEach(i=>{try{i(e)}catch(s){Gt.error("Error handler threw exception:",s)}}),this.currentState!=="disposed"&&this.transition("error")}isHealthy(){return["connected","connecting","reconnecting"].includes(this.currentState)}canAcceptInput(){return this.currentState==="connected"}isDisposed(){return this.currentState==="disposed"}notifyStateListeners(e){this.stateListeners.get(e)?.forEach(i=>{try{i()}catch(s){Gt.error("Error in state listener:",s)}})}notifyTransitionListeners(e,i){this.transitionListeners.forEach(s=>{try{s(e,i)}catch(r){Gt.error("Error in transition listener:",r)}})}dispose(){this.isDisposed()||this.transition("dispose"),this.stateListeners.clear(),this.transitionListeners.clear(),this.errorHandlers.clear()}}const ct=new Xi("TerminalBufferManager"),Ln="terminal-buffer-index";let Zt=null,an=0;const Af=5e3;function En(){const t=Date.now();if(Zt&&t-an<Af)return Zt;try{const e=localStorage.getItem(Ln);if(e){const i=JSON.parse(e);Zt=new Map(i.map(s=>[s.key,s.timestamp]))}else Zt=new Map}catch{Zt=new Map}return an=t,Zt}function Mn(t){try{const e=Array.from(t.entries()).map(([i,s])=>({key:i,timestamp:s}));localStorage.setItem(Ln,JSON.stringify(e)),Zt=t,an=Date.now()}catch{}}function ha(t,e){const i=En();i.set(t,e),Mn(i)}function la(t){const e=En();e.delete(t),Mn(e)}const $e=class $e{constructor(e,i){P(this,"storageKey");P(this,"fallbackStorage",new Map);this.workspaceId=e,this.terminalId=i,this.storageKey=`terminal-buffer-${e}-${i}`}async saveBuffer(e,i,s){try{const n={lines:this.trimBuffer(e),cursorX:i,cursorY:s,timestamp:Date.now(),version:$e.BUFFER_VERSION};if(await this.hasStorageSpace(n))try{return localStorage.setItem(this.storageKey,JSON.stringify(n)),ha(this.storageKey,n.timestamp),ct.debug(`Saved buffer for terminal ${this.terminalId}`),!0}catch(o){return ct.warn("localStorage failed, using fallback storage:",o),this.fallbackStorage.set(this.storageKey,n),!0}else{await this.cleanupOldBuffers();try{return localStorage.setItem(this.storageKey,JSON.stringify(n)),ha(this.storageKey,n.timestamp),!0}catch{return this.fallbackStorage.set(this.storageKey,n),!0}}}catch(r){return ct.error("Failed to save buffer:",r),!1}}async restoreBuffer(){try{const e=localStorage.getItem(this.storageKey);if(e){const s=JSON.parse(e);if(this.isValidSnapshot(s))return ct.debug(`Restored buffer for terminal ${this.terminalId}`),s;localStorage.removeItem(this.storageKey)}const i=this.fallbackStorage.get(this.storageKey);return i&&this.isValidSnapshot(i)?i:null}catch(e){return ct.error("Failed to restore buffer:",e),null}}async clearBuffer(){try{localStorage.removeItem(this.storageKey),this.fallbackStorage.delete(this.storageKey),la(this.storageKey)}catch(e){ct.error("Failed to clear buffer:",e)}}trimBuffer(e){for(;e.length>0&&!e[e.length-1].trim();)e.pop();return e.length>$e.MAX_BUFFER_SIZE&&(e=e.slice(-1e4)),e.map(i=>i.length>$e.MAX_LINE_LENGTH?`${i.substring(0,$e.MAX_LINE_LENGTH)}…`:i)}isValidSnapshot(e){return!(e.version!==$e.BUFFER_VERSION||Date.now()-e.timestamp>$e.RETENTION_PERIOD||!Array.isArray(e.lines))}async hasStorageSpace(e){try{const i=JSON.stringify(e).length;if("storage"in navigator&&"estimate"in navigator.storage){const s=await navigator.storage.estimate();return(s.quota||0)-(s.usage||0)>i+$e.STORAGE_QUOTA_BUFFER}return!0}catch{return!0}}async cleanupOldBuffers(){try{const e=[],i=Date.now(),s=En();for(const[r,n]of s)i-n>$e.RETENTION_PERIOD&&e.push(r);for(const r of e)localStorage.removeItem(r),la(r),ct.debug(`Cleaned up old buffer: ${r}`);s.size===0&&await this.rebuildBufferIndex()}catch(e){ct.error("Failed to cleanup old buffers:",e)}}async rebuildBufferIndex(){try{const e=new Map;for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);if(s?.startsWith("terminal-buffer-")&&s!==Ln)try{const r=localStorage.getItem(s);if(r){const n=JSON.parse(r);e.set(s,n.timestamp)}}catch{}}e.size>0&&(Mn(e),ct.debug(`Rebuilt buffer index with ${e.size} entries`))}catch(e){ct.error("Failed to rebuild buffer index:",e)}}getStats(){try{const e=localStorage.getItem(this.storageKey);if(e){const i=JSON.parse(e);return{size:e.length,lineCount:i.lines.length,age:Date.now()-i.timestamp}}return null}catch{return null}}};P($e,"BUFFER_VERSION",1),P($e,"MAX_BUFFER_SIZE",1e4),P($e,"MAX_LINE_LENGTH",1e3),P($e,"RETENTION_PERIOD",1440*60*1e3),P($e,"STORAGE_QUOTA_BUFFER",100*1024);let Rs=$e;const Pi=new Xi("TerminalThemeManager"),Se=class Se{constructor(e){P(this,"currentTheme");P(this,"customTerminalTheme",null);P(this,"themeObserver",null);P(this,"transitionTimeout",null);P(this,"darkModeQuery",null);P(this,"darkModeChangeHandler",null);P(this,"themeChangeHandler",null);this.container=e,this.currentTheme=this.detectSystemTheme(),this.setContainer(this.container??null),this.setupThemeObserver()}setContainer(e){this.transitionTimeout&&(clearTimeout(this.transitionTimeout),this.transitionTimeout=null),this.container&&this.container!==e&&(this.container.style.transition=""),this.container=e,this.container&&(this.container.style.backgroundColor=this.currentTheme.background||"transparent")}getCurrentTheme(){return this.currentTheme}applyTheme(e,i){const s=i||this.detectSystemTheme();if(s.name!==this.currentTheme.name)try{this.container&&(this.container.style.transition=`background-color ${Se.TRANSITION_DURATION}ms ease`),e.options.theme=s,this.container&&(this.container.style.backgroundColor=s.background||"transparent"),e.refresh(0,e.rows-1),this.currentTheme=s,Pi.debug(`Applied theme: ${s.name}`),this.transitionTimeout&&clearTimeout(this.transitionTimeout),this.transitionTimeout=setTimeout(()=>{this.container&&(this.container.style.transition="")},Se.TRANSITION_DURATION)}catch(r){Pi.error("Failed to apply theme:",r)}}detectSystemTheme(){if(this.customTerminalTheme)return this.customTerminalTheme;const e=document.documentElement.classList.contains("dark"),i=document.documentElement.classList.contains("light");if(e)return Se.DARK_THEME;if(i)return Se.LIGHT_THEME;const s=document.documentElement.getAttribute("data-theme");if(s==="dark")return Se.DARK_THEME;if(s==="light")return Se.LIGHT_THEME;const n=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return n&&this.isColorDark(n)||Hh.isDark()?Se.DARK_THEME:Se.LIGHT_THEME}isColorDark(e){const i=this.colorToRgb(e);return i?(.299*i.r+.587*i.g+.114*i.b)/255<.5:!1}colorToRgb(e){if(e.startsWith("#")){const s=e.slice(1);if(s.length===3)return{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16)};if(s.length===6)return{r:parseInt(s.slice(0,2),16),g:parseInt(s.slice(2,4),16),b:parseInt(s.slice(4,6),16)}}const i=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);return i?{r:parseInt(i[1]),g:parseInt(i[2]),b:parseInt(i[3])}:null}setupThemeObserver(){typeof window>"u"||(this.themeObserver=new MutationObserver(e=>{for(const i of e)if(i.type==="attributes"){const s=i.attributeName;if(s==="class"||s==="data-theme"){const r=this.detectSystemTheme();r.name!==this.currentTheme.name&&(Pi.debug(`Theme change detected: ${this.currentTheme.name} -> ${r.name}`),Hi("terminal-theme-changed",{theme:r}))}}}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.darkModeChangeHandler=()=>{Pi.debug("System theme preference changed");const e=this.detectSystemTheme();e.name!==this.currentTheme.name&&Hi("terminal-theme-changed",{theme:e})},this.darkModeQuery.addEventListener("change",this.darkModeChangeHandler),this.themeChangeHandler=e=>{const i=e.detail?.isDark,s=e.detail?.terminalColors;let r;s&&Object.keys(s).length>0?(r={...i?Se.DARK_THEME:Se.LIGHT_THEME,...s,name:"custom",isDark:i},this.customTerminalTheme=r):(this.customTerminalTheme=null,r=i?Se.DARK_THEME:Se.LIGHT_THEME),(r.name!==this.currentTheme.name||s)&&(Pi.debug(`App theme changed to ${r.name}`),Hi("terminal-theme-changed",{theme:r}))},window.addEventListener("theme-changed",this.themeChangeHandler))}dispose(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.darkModeQuery&&this.darkModeChangeHandler&&(this.darkModeQuery.removeEventListener("change",this.darkModeChangeHandler),this.darkModeQuery=null,this.darkModeChangeHandler=null),this.themeChangeHandler&&(window.removeEventListener("theme-changed",this.themeChangeHandler),this.themeChangeHandler=null),this.transitionTimeout&&(clearTimeout(this.transitionTimeout),this.transitionTimeout=null),this.setContainer(null)}};P(Se,"TRANSITION_DURATION",200),P(Se,"DARK_THEME",{name:"sleek-dark",isDark:!0,background:"#0B0B0E",foreground:"#e4e4e7",cursor:"#fbbf24",cursorAccent:"#1a1a1a",selectionBackground:"#3f3f46",selectionForeground:"#F7F7F7",selectionInactiveBackground:"#27272a",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#d4d4d8",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#f4f4f5"}),P(Se,"LIGHT_THEME",{name:"sleek-light",isDark:!1,background:"#F7F7F8",foreground:"#18181b",cursor:"#f59e0b",cursorAccent:"#F7F7F7",selectionBackground:"#e4e4e7",selectionForeground:"#09090b",selectionInactiveBackground:"#f4f4f5",black:"#18181b",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#e4e4e7",brightBlack:"#71717a",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#F7F7F7"});let hn=Se;const Yt=Uh("TerminalHistoryTracker"),Jt=class Jt{constructor(){P(this,"histories",new Map);P(this,"MAX_HISTORY_SIZE",10);P(this,"MAX_OUTPUT_LENGTH",500);P(this,"STORAGE_PREFIX","terminal-history-");P(this,"_updateCounter",zh(0));P(this,"updateCounter",{subscribe:this._updateCounter.subscribe});this.loadHistories()}notifyUpdate(){this._updateCounter.update(e=>e+1)}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}getOrCreateHistory(e,i){let s=this.histories.get(e);return s||(s={terminalId:e,workspaceId:i,commands:[],currentOutput:"",isExecuting:!1},this.histories.set(e,s)),s}onCommandStart(e,i,s){const r=this.getOrCreateHistory(e,i),n=Wt(s);r.currentCommand=n,r.currentOutput="",r.isExecuting=!0,r.lastCommand=n,this.notifyUpdate(),Yt.debug(`Command started for terminal ${e}: ${n}`)}onOutput(e,i,s){const r=this.getOrCreateHistory(e,i);r.currentOutput.length<this.MAX_OUTPUT_LENGTH&&(r.currentOutput+=s,r.currentOutput.length>this.MAX_OUTPUT_LENGTH&&(r.currentOutput=`${r.currentOutput.substring(0,this.MAX_OUTPUT_LENGTH)}...`))}onCommandFinish(e,i){const s=this.getOrCreateHistory(e,i);if(s.currentCommand){const r=Wt(s.currentCommand),n={command:r,timestamp:Date.now(),output:s.currentOutput};s.commands.push(n),s.commands.length>this.MAX_HISTORY_SIZE&&(s.commands=s.commands.slice(-this.MAX_HISTORY_SIZE)),s.lastCommand=r,s.lastOutput=s.currentOutput,this.saveHistory(e,s),Yt.debug(`Command finished for terminal ${e}: ${r}`)}s.currentCommand=void 0,s.currentOutput="",s.isExecuting=!1,this.notifyUpdate()}getHistory(e){return this.histories.get(e)}getHistoriesForWorkspace(e){return Array.from(this.histories.values()).filter(i=>i.workspaceId===e)}getLastCommand(e){return this.histories.get(e)?.lastCommand}getLastOutput(e){return this.histories.get(e)?.lastOutput}saveHistory(e,i){try{const s=`${this.STORAGE_PREFIX}${e}`,r={terminalId:i.terminalId,workspaceId:i.workspaceId,commands:i.commands.slice(-5).map(n=>({...n,command:Wt(n.command)})),lastCommand:i.lastCommand?Wt(i.lastCommand):void 0,lastOutput:i.lastOutput?.substring(0,200)};localStorage.setItem(s,JSON.stringify(r))}catch(s){Yt.warn("Failed to save terminal history:",s)}}loadHistories(){try{const e=Object.keys(localStorage).filter(i=>i.startsWith(this.STORAGE_PREFIX));for(const i of e)try{const s=localStorage.getItem(i);if(s){const r=JSON.parse(s);r.terminalId&&this.histories.set(r.terminalId,{...r,currentOutput:"",isExecuting:!1,commands:r.commands||[]})}}catch(s){Yt.warn(`Failed to load terminal history for ${i}:`,s)}Yt.info(`Loaded ${this.histories.size} terminal histories from localStorage`)}catch(e){Yt.error("Failed to load terminal histories:",e)}}clearHistory(e){this.histories.delete(e);try{localStorage.removeItem(`${this.STORAGE_PREFIX}${e}`)}catch(i){Yt.warn("Failed to clear terminal history:",i)}}clearWorkspaceHistories(e){const i=[];for(const[s,r]of this.histories.entries())r.workspaceId===e&&i.push(s);for(const s of i)this.clearHistory(s)}};P(Jt,"instance");let ln=Jt;const Oi=ln.getInstance();function Pf(t,e){return setTimeout(()=>{try{t.dispose()}catch(i){if(e)e(i);else throw i}},0)}const Of=["panel.focus-next-column","panel.focus-previous-column","global.next-space-alt","global.previous-space-alt","navigation.go-to-tab","navigation.recent-agents"];function If(t,e,i,s=!1){const r=o=>An(o,e),n=s?r("navigation.go-to-device"):An("navigation.go-to-tab",e)===Pn["navigation.go-to-tab"]?Pn["navigation.go-to-device"]:null;return n&&On(t,n,i)>=0&&!In("navigation.go-to-device",t,r,i)?!0:Of.some(o=>On(t,r(o),i)>=0&&(o!=="navigation.go-to-tab"||!In(o,t,r,i)))}const $f=Df,I=new Xi("TerminalAdapter"),Ff=typeof process<"u"&&process.platform==="win32",Nf=100,Ae=class Ae{constructor(e){P(this,"xterm");P(this,"fitAddon");P(this,"searchAddon");P(this,"webLinksAddon");P(this,"webglAddon",null);P(this,"stateMachine");P(this,"bufferManager");P(this,"themeManager");P(this,"terminalId");P(this,"workspaceId");P(this,"container");P(this,"eventListeners",[]);P(this,"resizeObserver",null);P(this,"reattachFitObserver",null);P(this,"reattachFitTimer",null);P(this,"visibilityObserver",null);P(this,"wasVisible",!0);P(this,"isVisible",!0);P(this,"lastFittedSize",null);P(this,"resizeDebounceTimer",null);P(this,"bufferSaveTimer",null);P(this,"dataDisposable",null);P(this,"resizeDisposable",null);P(this,"selectionDisposable",null);P(this,"ipcCleanup",null);P(this,"themeCleanup",null);P(this,"webglContextLostCleanup",null);P(this,"isDisposed",!1);P(this,"isXtermOpened",!1);P(this,"autoReconnectTimer",null);P(this,"autoReconnectAttempts",0);P(this,"heartbeatTimer",null);P(this,"webglRecoveryAttempts",0);P(this,"exitedNormally",!1);P(this,"lastCwd");P(this,"isExecuting",!1);P(this,"startTime",Date.now());P(this,"commandBuffer","");P(this,"currentLineBuffer","");P(this,"isAtPrompt",!1);P(this,"callbacks");P(this,"terminals");this.workspaceId=e.workspaceId,this.terminalId=e.terminalId||`terminal-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,this.container=e.container,this.terminals=(e.appClient??Wh).terminals,this.callbacks={onReady:e.onReady,onExit:e.onExit,onCommandStart:e.onCommandStart,onCommandFinished:e.onCommandFinished,onCwdChanged:e.onCwdChanged,onError:e.onError,onToggleSearch:e.onToggleSearch},this.stateMachine=new Bf(this.terminalId),this.setupStateMachineListeners(),this.bufferManager=new Rs(this.workspaceId,this.terminalId),this.themeManager=new hn(this.container);const i=e.fontFamily??jh.select(_t.state);this.xterm=new au({allowProposedApi:!0,fontFamily:i,fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!0,cursorStyle:"block",cursorWidth:1,scrollback:1e4,allowTransparency:!0,windowsPty:Ff?{backend:"conpty"}:void 0,macOptionIsMeta:!0,rightClickSelectsWord:!0,convertEol:!0,drawBoldTextInBrightColors:!0,scrollSensitivity:1,theme:this.themeManager.getCurrentTheme()}),this.fitAddon=new cu,this.xterm.loadAddon(this.fitAddon),this.webLinksAddon=new pu((s,r)=>{this.handleLinkClick(r)}),this.xterm.loadAddon(this.webLinksAddon),this.searchAddon=new $f,this.xterm.loadAddon(this.searchAddon),this.searchAddon.onDidChangeResults(s=>{this.callbacks.onSearchResultsChange?.(s.resultIndex,s.resultCount)})}getSearchDecorations(){return{matchBackground:"#515c6a",matchBorder:"#515c6a",matchOverviewRuler:"#515c6a",activeMatchBackground:"#eab308",activeMatchBorder:"#ca8a04",activeMatchColorOverviewRuler:"#eab308"}}setupStateMachineListeners(){this.stateMachine.onTransition((e,i)=>{i===et.ERROR&&this.handleError(new Error(`Terminal entered error state from ${e}`)),(i===et.DISCONNECTED||i===et.ERROR)&&(this.stopHeartbeat(),this.exitedNormally||this.scheduleAutoReconnect()),i===et.CONNECTED&&(this.autoReconnectAttempts=0,this.cancelAutoReconnect(),this.startHeartbeat())}),this.stateMachine.onError(e=>{this.handleError(e)})}async initialize(e=!1){if(this.isDisposed)throw new Error("Cannot initialize disposed terminal");if(!this.container)throw new Error("Cannot initialize terminal without a container");const i=this.container;if(!this.stateMachine.canTransition("initialize"))throw new Error(`Cannot initialize terminal in state ${this.stateMachine.getState()}`);this.stateMachine.transition("initialize");try{this.isXtermOpened?I.warn(`[initialize] XTerm already opened for terminal ${this.terminalId}, skipping open()`):(this.xterm.open(i),this.isXtermOpened=!0,I.info(`[initialize] XTerm opened for terminal ${this.terminalId}`)),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer for light theme (better anti-aliasing)"),this.themeManager.applyTheme(this.xterm),this.fitTerminalToContainer()||(I.warn("Container has no dimensions, delaying fit"),setTimeout(()=>{this.fitTerminalToContainer()},100)),this.setupResizeObserver(),this.setupXTermEventHandlers(),this.setupThemeChangeListener();const r=this.xterm.cols,n=this.xterm.rows,o=await this.findBackendTerminal(),a=o!==null;if(!e)if(a)try{const l=await this.terminals.getBuffer(this.terminalId,void 0,this.workspaceId);l&&(I.info(`Restoring ${l.length} bytes of buffered output from backend`),this.xterm.write(l),this.parseTerminalOutput(l))}catch(l){I.warn("Could not restore terminal buffer from backend:",l)}else{const l=await this.bufferManager.restoreBuffer();l&&(I.info("Restoring terminal buffer from local storage"),this.restoreFromSnapshot(l))}this.startBufferAutoSave(),this.stateMachine.transition("connect"),a?(this.setupIpcEventHandlers(),this.stateMachine.transition("connected"),this.resize(r,n),o?.isExecuting===!1&&this.hideCursorOnExit(),this.callbacks.onReady?.()):(I.debug(`[initialize] Terminal ${this.terminalId} creating new PTY`),await this.openPtyConnection(r,n)),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()})}catch(s){throw this.stateMachine.reportError(s),s}}async openPtyConnection(e,i){try{const s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_openFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("connected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(s){throw this.stateMachine.reportError(s),s}}async findBackendTerminal(){try{const{terminals:e}=await this.terminals.list(this.workspaceId);return e.find(i=>i.id===this.terminalId)??null}catch(e){return I.warn("Could not check terminal existence:",e),null}}async terminalExistsOnBackend(){return await this.findBackendTerminal()!==null}hideCursorOnExit(){this.isDisposed||(this.xterm.options.cursorBlink=!1,this.xterm.write("\x1B[?25l"))}restoreCursor(){this.isDisposed||(this.xterm.options.cursorBlink=!0,this.xterm.write("\x1B[?25h"))}setupXTermEventHandlers(){this.container&&(this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.resizeDisposable&&(this.resizeDisposable.dispose(),this.resizeDisposable=null),this.selectionDisposable&&(this.selectionDisposable.dispose(),this.selectionDisposable=null),this.xterm.attachCustomKeyEventHandler(e=>{const i=navigator.platform.toUpperCase().includes("MAC"),s=i?e.metaKey:e.ctrlKey;return e.metaKey&&e.key==="k"&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&this.clear(),!1):s&&e.key==="j"&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&_t.dispatch(Bn(this.workspaceId)),!1):s&&e.key==="f"&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&this.callbacks.onToggleSearch?.(),!1):s&&(e.key==="t"||e.key==="T")&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&Hi("workspace:new-terminal",{workspaceId:this.workspaceId}),!1):s&&(e.key==="w"||e.key==="W")&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&_t.dispatch(qh(this.workspaceId)),!1):If(e,_t.state.userPreferences?.shortcutOverrides??{},i,_t.state.machineRail?.enabled??!1)||s&&e.shiftKey&&!e.altKey&&(e.key==="]"||e.key==="}"||e.key==="["||e.key==="{")?!1:e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.key==="`"||e.key==="~")?(e.type==="keydown"&&(e.shiftKey||e.key==="~"?Hi("workspace:new-terminal",{workspaceId:this.workspaceId}):_t.dispatch(Bn(this.workspaceId))),!1):!0}),this.dataDisposable=this.xterm.onData(e=>{this.isDisposed||this.write(e)}),this.resizeDisposable=this.xterm.onResize(({cols:e,rows:i})=>{!this.isDisposed&&this.stateMachine.canAcceptInput()&&this.resize(e,i)}),this.selectionDisposable=this.xterm.onSelectionChange(()=>{}))}setupIpcEventHandlers(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null);let e=!1;const i=this.terminals.subscribeEvents(this.terminalId,{onData:({chunk:s})=>{e||this.isDisposed||this.stateMachine.canAcceptInput()&&(this.xterm.write(s),this.parseTerminalOutput(s))},onExit:({exitCode:s})=>{e||this.isDisposed||(this.exitedNormally=!0,this.hideCursorOnExit(),this.callbacks.onExit?.(s),this.stateMachine.transition("disconnect"))},onCwd:({cwd:s})=>{e||this.isDisposed||(this.lastCwd=s,this.callbacks.onCwdChanged?.(s))}},this.workspaceId);this.ipcCleanup=()=>{e=!0;try{i()}catch(s){I.warn("Failed to unsubscribe terminal events:",s)}}}setupResizeObserver(){if(!this.container||!this.isVisible)return;const e=this.container;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.resizeObserver=new ResizeObserver(()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>{this.fitTerminalToContainer()},100)}),this.resizeObserver.observe(e),this.setupVisibilityObserver()}setupVisibilityObserver(){if(!this.container)return;const e=this.container;this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.visibilityObserver=new IntersectionObserver(i=>{for(const s of i){const r=s.isIntersecting;r&&!this.wasVisible&&(I.debug(`[visibility] Terminal ${this.terminalId} became visible, reconnecting ResizeObserver`),this.resizeObserver||(this.resizeObserver=new ResizeObserver(()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>{this.fitTerminalToContainer()},100)}),this.resizeObserver.observe(e)),this.fitTerminalToContainer()),this.wasVisible=r}}),this.visibilityObserver.observe(e)}loadWebglAddon(){this.disposeWebglAddon();try{this.webglAddon=new Z_,this.xterm.loadAddon(this.webglAddon);const e=this.xterm.element?.querySelector("canvas");if(e){const i=s=>{s.preventDefault(),I.warn(`[WebGL] Context lost for terminal ${this.terminalId}, recovering...`),!this.isDisposed&&(this.disposeWebglAddon(),setTimeout(()=>{if(this.isDisposed)return;if(!this.themeManager.getCurrentTheme().isDark){I.info("[WebGL] Skipping WebGL recovery on light theme, using Canvas renderer");return}if(this.webglRecoveryAttempts>=Ae.MAX_WEBGL_RECOVERY_ATTEMPTS){I.warn(`[WebGL] Max recovery attempts (${Ae.MAX_WEBGL_RECOVERY_ATTEMPTS}) reached for terminal ${this.terminalId}, staying on Canvas renderer`);return}this.webglRecoveryAttempts++;try{this.loadWebglAddon(),I.info(`[WebGL] Successfully recovered from context loss (attempt ${this.webglRecoveryAttempts})`)}catch(n){I.warn("[WebGL] Failed to recover from context loss, falling back to Canvas renderer:",n),this.webglAddon=null}},100))};e.addEventListener("webglcontextlost",i),this.webglContextLostCleanup=()=>{e.removeEventListener("webglcontextlost",i)}}}catch(e){I.warn("Failed to load WebGL renderer, falling back to Canvas renderer:",e),this.webglAddon=null}}disposeWebglAddon(){if(this.webglContextLostCleanup&&(this.webglContextLostCleanup(),this.webglContextLostCleanup=null),this.webglAddon){try{this.webglAddon.dispose()}catch(e){I.warn("Error disposing WebGL addon:",e)}this.webglAddon=null}}setupThemeChangeListener(){this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null);const e=i=>{const s=i.detail?.theme;s&&this.xterm&&(I.info(`[Theme] Theme changed to: ${s.name} (isDark: ${s.isDark})`),this.themeManager.applyTheme(this.xterm,s),s.isDark?this.webglAddon||this.loadWebglAddon():this.webglAddon&&(this.disposeWebglAddon(),I.info("[WebGL] Disposed WebGL addon for light theme (using Canvas renderer)")))};window.addEventListener("terminal-theme-changed",e),this.themeCleanup=()=>{window.removeEventListener("terminal-theme-changed",e)}}parseTerminalOutput(e){Oi.onOutput(this.terminalId,this.workspaceId,e),e.includes("\x1B]133;C\x07")?(this.isExecuting&&(this.isExecuting=!1,this.callbacks.onCommandFinished?.(),Oi.onCommandFinish(this.terminalId,this.workspaceId)),this.commandBuffer="",this.isAtPrompt=!0):e.includes("\x1B]133;A\x07")&&(this.isExecuting||(this.isExecuting=!0,this.callbacks.onCommandStart?.()),this.isAtPrompt=!0,this.commandBuffer="");const i=/[\$%]\s*$/,s=/^.*[\$%]\s+(.+)$/,r=e.split(/\r?\n/);for(const o of r){const a=o.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07]*\x07/g,"").replace(/\x1b\][^\x1b]*\x1b\\/g,"").replace(/\x1b[()][AB0-2]/g,"").replace(/\x1b[=>]/g,"").replace(/\x1b[78]/g,"").replace(/\x1b[DME]/g,"").replace(/\x1b[HZ]/g,"").replace(/\x1b[c]/g,"").replace(/\[\?[0-9;]*[a-zA-Z]/g,"").replace(/\x07/g,"").replace(/\x00-\x08\x0b\x0c\x0e-\x1f/g,"").trim();if(!a||/^\[[\?0-9;]*[a-zA-Z]$/.test(a))continue;const l=a.match(s);if(l&&l[1]){const h=l[1].trim(),c=/^[a-zA-Z0-9.\/~]/.test(h);h.length>0&&!this.isExecuting&&c?(I.info(`[TerminalAdapter] Detected command from output: ${Wt(h)}`),Oi.onCommandStart(this.terminalId,this.workspaceId,h),this.isExecuting=!0,this.callbacks.onCommandStart?.()):h.length>0&&!c&&I.debug(`[TerminalAdapter] Skipping suspicious command detection: ${Wt(h)}`)}i.test(a)&&!l&&(this.isExecuting&&(this.isExecuting=!1,this.callbacks.onCommandFinished?.(),Oi.onCommandFinish(this.terminalId,this.workspaceId),I.debug(`[TerminalAdapter] Command finished, prompt detected: ${Wt(a)}`)),this.isAtPrompt=!0,this.commandBuffer="")}const n=e.match(/\x1b\]7;file:\/\/[^/]*([^\x07]*)\x07/);if(n){const o=decodeURIComponent(n[1]);o!==this.lastCwd&&(this.lastCwd=o,this.callbacks.onCwdChanged?.(o))}}startBufferAutoSave(){this.bufferSaveTimer=setInterval(()=>{this.stateMachine?.canAcceptInput()&&this.saveBuffer()},5e3)}async saveBuffer(){try{const e=this.xterm.buffer.active,i=[];for(let s=0;s<e.length;s++){const r=e.getLine(s);r&&i.push(r.translateToString(!0))}await this.bufferManager.saveBuffer(i,e.cursorX,e.cursorY)}catch(e){I.error("Failed to save buffer:",e)}}restoreFromSnapshot(e){if(e.lines&&e.lines.length>0){this.xterm.clear();const i=[...e.lines];for(;i.length>0&&i[i.length-1].trim()==="";)i.pop();const s=/[\$>#%]\s*$/,r=/@[\w-]+/;if(i.length>0){const n=i[i.length-1],o=i.length>1?i[i.length-2]:"";if(s.test(n)&&r.test(n))i.pop();else if(s.test(n)&&n.trim().length<80)i.pop(),i.length>0&&r.test(i[i.length-1])&&i.pop();else if(i.length>=2){const a=o+n;s.test(a)&&r.test(a)&&(i.pop(),i.pop())}}for(let n=0;n<i.length;n++)n<i.length-1?this.xterm.writeln(i[n]):i[n].trim()&&this.xterm.writeln(i[n]);I.debug(`Restored terminal buffer for ${this.terminalId} with ${i.length} lines (prompt removed)`)}}getCommandFromXtermBuffer(){try{const e=this.xterm.buffer.active,i=e.cursorY+e.baseY,s=e.getLine(i);if(!s)return null;const r=s.translateToString(!0);if(!r||!r.trim())return null;const n=r.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07]*\x07/g,"").replace(/\x1b[()][AB0-2]/g,"").replace(/\x07/g,"").trim();if(!n)return null;const o=n.match(/^.*[\$%#❯➜]\s+(.+)$/);return o&&o[1]?o[1].trim():null}catch{return null}}write(e){if(!(this.isDisposed||!this.stateMachine.canAcceptInput())){if(e==="\r"||e===`
142
142
  `){const i=this.getCommandFromXtermBuffer(),s=i||this.commandBuffer.trim();s&&(Oi.onCommandStart(this.terminalId,this.workspaceId,s),this.isExecuting=!0,I.debug(`Command executed: ${Wt(s)}${i?" (from xterm buffer)":" (from keystroke buffer)"}`)),this.commandBuffer="",this.currentLineBuffer=""}else e===""||e==="\b"?this.commandBuffer.length>0&&(this.commandBuffer=this.commandBuffer.slice(0,-1)):e===""?(this.commandBuffer="",this.currentLineBuffer=""):e===""?(this.commandBuffer="",this.currentLineBuffer=""):e.match(/[\x00-\x1F\x7F]/)||(this.commandBuffer+=e,this.currentLineBuffer+=e);this.terminals.write(this.terminalId,e,this.workspaceId).then(i=>{i.success||I.error(`[write] Terminal ${this.terminalId}: write failed - ${i.error}`)}).catch(i=>{I.error(`[write] Terminal ${this.terminalId}: transport error - ${i}`),this.isDisposed||this.stateMachine.reportError(i)})}}resize(e,i){this.isDisposed||!this.stateMachine.canAcceptInput()||this.terminals.resize(this.terminalId,e,i,this.workspaceId).catch(s=>{I.error("Failed to resize terminal:",s)})}focus(){!this.isDisposed&&this.isVisible&&this.xterm.focus()}blur(){this.isDisposed||this.xterm.blur()}setVisible(e){if(!(this.isDisposed||this.isVisible===e)){if(this.isVisible=e,this.wasVisible=e,!e){this.xterm.blur(),this.disconnectLayoutObservers();return}this.setupResizeObserver(),requestAnimationFrame(()=>this.fitTerminalToContainer())}}fitTerminalToContainer(){if(this.isDisposed||!this.isVisible||!this.container)return!1;const{width:e,height:i}=this.container.getBoundingClientRect();return e<=0||i<=0?!1:(this.lastFittedSize?.width===e&&this.lastFittedSize.height===i||(this.fitAddon.fit(),this.lastFittedSize={width:e,height:i}),!0)}disconnectLayoutObservers(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.visibilityObserver?.disconnect(),this.visibilityObserver=null,this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null)}fitAfterReattach(e){if(this.cancelReattachFit(),this.fitReattachedContainer(e))return;const i=new ResizeObserver(()=>{if(this.reattachFitObserver!==i){i.disconnect();return}this.hasReattachedContainerBox(e)&&(this.reattachFitTimer&&clearTimeout(this.reattachFitTimer),this.reattachFitTimer=setTimeout(()=>{this.reattachFitTimer=null,this.fitReattachedContainer(e)&&this.cancelReattachFit()},Nf))});this.reattachFitObserver=i,i.observe(e)}fitReattachedContainer(e){if(this.isDisposed||this.container!==e)return!0;if(!this.hasReattachedContainerBox(e))return!1;const{width:i,height:s}=e.getBoundingClientRect();return this.fitAddon.fit(),this.lastFittedSize={width:i,height:s},this.xterm.refresh(0,this.xterm.rows-1),!0}hasReattachedContainerBox(e){if(!this.isVisible)return!1;const{width:i,height:s}=e.getBoundingClientRect();return i>0&&s>0}cancelReattachFit(){this.reattachFitObserver?.disconnect(),this.reattachFitObserver=null,this.reattachFitTimer&&(clearTimeout(this.reattachFitTimer),this.reattachFitTimer=null)}clear(){this.isDisposed||this.xterm.clear()}async reattach(e){if(this.isDisposed||this.stateMachine.isDisposed())throw new Error("Cannot reattach disposed terminal");this.cancelAutoReconnect(),this.autoReconnectAttempts=0,this.webglRecoveryAttempts=0,this.exitedNormally=!1,this.setupIpcEventHandlers();const i=this.stateMachine.getState();if(i!==et.CONNECTED){I.info(`[reattach] Terminal ${this.terminalId} not in CONNECTED state (${i}), attempting to restore`);const n=await this.findBackendTerminal();n&&(i===et.DISCONNECTED||i===et.ERROR?(this.stateMachine.transition("reconnect"),this.stateMachine.transition("reconnected")):i===et.CONNECTING&&this.stateMachine.transition("connected"),n.isExecuting===!1&&this.hideCursorOnExit(),I.info(`[reattach] Terminal ${this.terminalId} state restored to ${this.stateMachine.getState()}`))}const s=this.xterm.element;if(s){e.appendChild(s),this.container=e,this.themeManager.setContainer(e),this.disposeWebglAddon(),this.themeManager.applyTheme(this.xterm),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer after move (light theme)"),this.fitAfterReattach(e),this.setupResizeObserver(),this.setupXTermEventHandlers(),this.commandBuffer="",this.currentLineBuffer="",this.isAtPrompt=!1,this.startHeartbeat(),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()});return}I.warn(`Could not move terminal element, recreating for terminal ${this.terminalId}`),this.container&&(this.container.innerHTML=""),this.disposeWebglAddon(),this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.container=e,this.themeManager.setContainer(e),this.isXtermOpened&&I.warn(`[reattach] XTerm was already opened for terminal ${this.terminalId}, calling open() again may cause duplicate handlers`),this.xterm.open(e),this.isXtermOpened=!0,this.themeManager.applyTheme(this.xterm),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer on reattach (light theme)"),this.fitAfterReattach(e),this.setupXTermEventHandlers(),this.setupResizeObserver(),this.commandBuffer="",this.currentLineBuffer="",this.isAtPrompt=!1,this.startHeartbeat(),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()})}updateCallbacks(e){Object.assign(this.callbacks,e)}updateFontFamily(e){this.isDisposed||this.xterm.options.fontFamily!==e&&(this.xterm.options.fontFamily=e)}findNext(e,i){return this.searchAddon.findNext(e,{caseSensitive:i?.caseSensitive??!1,wholeWord:i?.wholeWord??!1,regex:i?.regex??!1,incremental:!1,decorations:this.getSearchDecorations()})}findPrevious(e,i){return this.searchAddon.findPrevious(e,{caseSensitive:i?.caseSensitive??!1,wholeWord:i?.wholeWord??!1,regex:i?.regex??!1,incremental:!1,decorations:this.getSearchDecorations()})}clearSearch(){this.searchAddon.clearDecorations()}getSelection(){return this.xterm.getSelection()}getInfo(){const e=this.bufferManager.getStats();return{id:this.terminalId,workspaceId:this.workspaceId,state:this.stateMachine.getState(),cwd:this.lastCwd,isExecuting:this.isExecuting,stats:e?{bufferSize:e.size,lineCount:e.lineCount,uptime:Date.now()-this.startTime}:void 0}}startHeartbeat(){this.heartbeatTimer||this.isDisposed||(I.debug(`[heartbeat] Starting for terminal ${this.terminalId} (every ${Ae.HEARTBEAT_INTERVAL_MS}ms)`),this.heartbeatTimer=setInterval(()=>{this.performHealthCheck()},Ae.HEARTBEAT_INTERVAL_MS))}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null,I.debug(`[heartbeat] Stopped for terminal ${this.terminalId}`))}async performHealthCheck(){if(this.isDisposed||!this.ipcCleanup||this.stateMachine.getState()!==et.CONNECTED)return;let e=null;try{const i=await Promise.race([this.terminalExistsOnBackend(),new Promise((s,r)=>{e=setTimeout(()=>r(new Error("Heartbeat timeout")),Ae.HEARTBEAT_TIMEOUT_MS)})]);if(e&&clearTimeout(e),this.isDisposed)return;i||(I.warn(`[heartbeat] Terminal ${this.terminalId}: PTY not found on backend, transitioning to DISCONNECTED`),this.stopHeartbeat(),this.stateMachine.transition("disconnect"))}catch(i){if(e&&clearTimeout(e),this.isDisposed)return;I.warn(`[heartbeat] Terminal ${this.terminalId}: health check failed:`,i),this.stopHeartbeat(),this.stateMachine.transition("disconnect")}}scheduleAutoReconnect(){if(this.isDisposed)return;if(this.autoReconnectAttempts>=Ae.MAX_RECONNECT_ATTEMPTS){I.warn(`[auto-reconnect] Terminal ${this.terminalId}: max reconnect attempts (${Ae.MAX_RECONNECT_ATTEMPTS}) reached, giving up`);return}this.cancelAutoReconnect();const e=Ae.BASE_RECONNECT_DELAY_MS*Math.pow(2,this.autoReconnectAttempts);this.autoReconnectAttempts++,I.info(`[auto-reconnect] Terminal ${this.terminalId}: scheduling attempt ${this.autoReconnectAttempts}/${Ae.MAX_RECONNECT_ATTEMPTS} in ${e}ms`),this.autoReconnectTimer=setTimeout(()=>{this.autoReconnectTimer=null,this.attemptAutoReconnect()},e)}cancelAutoReconnect(){this.autoReconnectTimer&&(clearTimeout(this.autoReconnectTimer),this.autoReconnectTimer=null)}async attemptAutoReconnect(){if(this.isDisposed)return;const e=this.stateMachine.getState();if(e!==et.DISCONNECTED&&e!==et.ERROR){I.debug(`[auto-reconnect] Terminal ${this.terminalId}: skipping, state is ${e}`);return}this.exitedNormally=!1,I.info(`[auto-reconnect] Terminal ${this.terminalId}: attempting reconnect (attempt ${this.autoReconnectAttempts})`);try{const i=await this.findBackendTerminal();if(this.isDisposed)return;i?(I.info(`[auto-reconnect] Terminal ${this.terminalId}: PTY exists on backend, re-establishing connection`),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnect"),this.stateMachine.transition("reconnected"),this.xterm.cols&&this.xterm.rows&&this.resize(this.xterm.cols,this.xterm.rows),i.isExecuting===!1&&this.hideCursorOnExit(),this.callbacks.onReady?.(),I.info(`[auto-reconnect] Terminal ${this.terminalId}: reconnected successfully`)):(I.info(`[auto-reconnect] Terminal ${this.terminalId}: PTY not found, creating new PTY`),await this.reconnect(),I.info(`[auto-reconnect] Terminal ${this.terminalId}: new PTY created successfully`))}catch(i){I.error(`[auto-reconnect] Terminal ${this.terminalId}: attempt ${this.autoReconnectAttempts} failed:`,i),this.scheduleAutoReconnect()}}handleError(e){I.error(`Terminal ${this.terminalId} error:`,e),this.callbacks.onError?.(e),this.isDisposed||this.xterm.writeln(`\r
143
143
  \x1B[31m${$s.terminal_adapter_errorLine_label({message:e.message})}\x1B[0m\r
144
- `)}handleLinkClick(e){try{if(Kh(e)||this.workspaceId===Vh){I.debug("Opening terminal link in external browser",{uri:e,workspaceId:this.workspaceId}),Fs("shell:openExternal",{url:e});return}Dn(async()=>{const{resolveBrowserLinkForOpen:i}=await import("./ozVAo4aX.js").then(s=>s.b);return{resolveBrowserLinkForOpen:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url).then(({resolveBrowserLinkForOpen:i})=>i(e)).catch(()=>({url:e})).then(i=>{Dn(async()=>{const{getPanelLayoutManager:s}=await import("./DA5opfEp.js").then(r=>r.p);return{getPanelLayoutManager:s}},__vite__mapDeps([32,21,22,5,23,24,3,8,4,25,15,2,33]),import.meta.url).then(({getPanelLayoutManager:s})=>{s(this.workspaceId).openBrowserPanel(i.url,void 0,void 0,i.requestedUrl),I.debug("Opened URL in browser panel",{uri:e,resolvedUrl:i.url,workspaceId:this.workspaceId})}).catch(s=>{I.warn("Failed to open URL in browser panel, falling back to external browser",{uri:e,error:s}),Fs("shell:openExternal",{url:i.url})})})}catch(i){I.warn("Failed to handle link click",{uri:e,error:i}),Fs("shell:openExternal",{url:e})}}async reconnect(){if(this.isDisposed)throw new Error("Cannot reconnect disposed terminal");if(!this.stateMachine.canTransition("reconnect"))throw new Error(`Cannot reconnect in state ${this.stateMachine.getState()}`);this.exitedNormally=!1,this.stateMachine.transition("reconnect");try{const e=this.xterm.cols,i=this.xterm.rows,s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_reconnectFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(e){throw this.stateMachine.reportError(e),e}}detach(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null),this.stopHeartbeat(),this.cancelAutoReconnect(),this.cancelReattachFit(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null);const e=this.xterm.element;e&&e.parentNode&&e.parentNode.removeChild(e),this.themeManager.setContainer(null),this.container=null}dispose(e={}){if(!(this.isDisposed||this.stateMachine.isDisposed())){if(this.isDisposed=!0,this.cancelAutoReconnect(),this.stopHeartbeat(),this.cancelReattachFit(),this.stateMachine.transition("dispose"),this.saveBuffer().catch(()=>{}),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.bufferSaveTimer&&(clearInterval(this.bufferSaveTimer),this.bufferSaveTimer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.dataDisposable){try{this.dataDisposable.dispose()}catch(i){I.error("Error disposing data handler:",i)}this.dataDisposable=null}if(this.resizeDisposable){try{this.resizeDisposable.dispose()}catch(i){I.error("Error disposing resize handler:",i)}this.resizeDisposable=null}if(this.selectionDisposable){try{this.selectionDisposable.dispose()}catch(i){I.error("Error disposing selection handler:",i)}this.selectionDisposable=null}if(this.ipcCleanup){try{this.ipcCleanup()}catch(i){I.error("Error cleaning up IPC handlers:",i)}this.ipcCleanup=null}if(this.themeCleanup){try{this.themeCleanup()}catch(i){I.error("Error cleaning up theme listener:",i)}this.themeCleanup=null}this.eventListeners.forEach(i=>{try{i()}catch(s){I.error("Error cleaning up event listener:",s)}}),this.eventListeners=[],e.killPty!==!1&&this.terminals.kill(this.terminalId,this.workspaceId).catch(i=>{I.error("Error killing PTY connection:",i)});try{this.searchAddon?.dispose&&this.searchAddon.dispose(),this.webLinksAddon?.dispose&&this.webLinksAddon.dispose(),this.disposeWebglAddon(),this.fitAddon?.dispose&&this.fitAddon.dispose()}catch(i){I.error("Error disposing addons:",i)}try{this.themeManager.dispose()}catch(i){I.error("Error disposing theme manager:",i)}try{this.stateMachine.dispose()}catch(i){I.error("Error disposing state machine:",i)}Pf(this.xterm,i=>{I.error("Error disposing xterm:",i)})}}};P(Ae,"MAX_RECONNECT_ATTEMPTS",5),P(Ae,"BASE_RECONNECT_DELAY_MS",1e3),P(Ae,"HEARTBEAT_INTERVAL_MS",3e4),P(Ae,"HEARTBEAT_TIMEOUT_MS",1e4),P(Ae,"MAX_WEBGL_RECOVERY_ATTEMPTS",3);let cn=Ae;const le=new Xi("TerminalManager");class zf{constructor(){P(this,"terminals",new Map)}saveTerminalMetadata(e,i,s){try{_t.dispatch(Gh(i,e,s,new Date().toISOString())),le.debug(`[RendererTerminalManager] Saved terminal metadata for ${e}`)}catch(r){le.error("[RendererTerminalManager] Failed to save terminal metadata:",r)}}loadTerminalMetadata(e){try{return Zh.select(_t.state,e).map(i=>({terminalId:i.id,workspaceId:i.workspaceId??e,createdAt:i.createdAt??"",title:i.customName||Jh(i.name)}))}catch(i){le.error("[RendererTerminalManager] Failed to load terminal metadata:",i)}return[]}removeTerminalMetadata(e,i){try{_t.dispatch(Yh(i,e)),le.debug(`[RendererTerminalManager] Removed terminal metadata for ${e}`)}catch(s){le.error("[RendererTerminalManager] Failed to remove terminal metadata:",s)}}hasTerminal(e){return this.terminals.has(e)}async getOrCreateTerminal(e,i,s,r,n=!1){let o=this.terminals.get(e);if(n&&o&&(le.info(`[RendererTerminalManager] Force creating new terminal, disposing existing: ${e}`),this.disposeTerminal(e),o=void 0),o)if(o.workspaceId!==i)le.warn(`[RendererTerminalManager] Terminal ${e} has mismatched workspaceId (has: ${o.workspaceId}, requested: ${i}). Disposing and recreating.`),this.disposeTerminal(e),o=void 0;else return le.info(`[RendererTerminalManager] Reattaching to existing terminal: ${e} (was attached: ${o.isAttached})`),o.container=s,o.isAttached=!0,await o.adapter.reattach(s),r&&(o.adapter.updateCallbacks(r),r.onReady?.()),le.info(`[RendererTerminalManager] Successfully reattached terminal: ${e}`),o.adapter;le.info(`[RendererTerminalManager] Creating new terminal: ${e}`);const a=new cn({workspaceId:i,terminalId:e,container:s,...r});return o={adapter:a,terminalId:e,workspaceId:i,isAttached:!0,container:s},this.terminals.set(e,o),this.saveTerminalMetadata(e,i),await a.initialize(n),a}isAttachedTo(e,i){const s=this.terminals.get(e);return!!s&&s.isAttached&&s.container===i}detachTerminal(e,i){const s=this.terminals.get(e);if(s){if(i&&s.container!==i){le.info(`[RendererTerminalManager] Ignoring detach from a stale surface: ${e}`);return}le.info(`[RendererTerminalManager] Detaching terminal: ${e}`),s.isAttached=!1,s.adapter.detach(),s.container=null}}disposeTerminal(e,i){const s=this.terminals.get(e);s?(le.info(`[RendererTerminalManager] Disposing terminal: ${e}`),s.adapter.dispose(),this.terminals.delete(e),this.removeTerminalMetadata(e,s.workspaceId)):_t.dispatch(Xh(e,i))}disposeExitedTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Disposing exited terminal: ${e}`),i.adapter.dispose({killPty:!1}),this.terminals.delete(e))}clearTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Clearing terminal: ${e}`),i.adapter.clear())}getTerminalInfo(e){const i=this.terminals.get(e);return i?i.adapter.getInfo():null}async getBufferContent(e,i){const s=this.terminals.get(e);if(s?.adapter)try{const r=s.adapter.xterm;if(r?.buffer?.active){const n=r.buffer.active,o=[];for(let a=0;a<n.length;a++){const l=n.getLine(a);l&&o.push(l.translateToString(!0))}for(;o.length>0&&!o[o.length-1].trim();)o.pop();if(o.length>0)return o.join(`
144
+ `)}handleLinkClick(e){try{if(Kh(e)||this.workspaceId===Vh){I.debug("Opening terminal link in external browser",{uri:e,workspaceId:this.workspaceId}),Fs("shell:openExternal",{url:e});return}Dn(async()=>{const{resolveBrowserLinkForOpen:i}=await import("./C1JG3JxG.js").then(s=>s.b);return{resolveBrowserLinkForOpen:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url).then(({resolveBrowserLinkForOpen:i})=>i(e)).catch(()=>({url:e})).then(i=>{Dn(async()=>{const{getPanelLayoutManager:s}=await import("./BPjvgJzJ.js").then(r=>r.p);return{getPanelLayoutManager:s}},__vite__mapDeps([32,21,22,5,23,24,3,8,4,25,15,2,33]),import.meta.url).then(({getPanelLayoutManager:s})=>{s(this.workspaceId).openBrowserPanel(i.url,void 0,void 0,i.requestedUrl),I.debug("Opened URL in browser panel",{uri:e,resolvedUrl:i.url,workspaceId:this.workspaceId})}).catch(s=>{I.warn("Failed to open URL in browser panel, falling back to external browser",{uri:e,error:s}),Fs("shell:openExternal",{url:i.url})})})}catch(i){I.warn("Failed to handle link click",{uri:e,error:i}),Fs("shell:openExternal",{url:e})}}async reconnect(){if(this.isDisposed)throw new Error("Cannot reconnect disposed terminal");if(!this.stateMachine.canTransition("reconnect"))throw new Error(`Cannot reconnect in state ${this.stateMachine.getState()}`);this.exitedNormally=!1,this.stateMachine.transition("reconnect");try{const e=this.xterm.cols,i=this.xterm.rows,s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_reconnectFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(e){throw this.stateMachine.reportError(e),e}}detach(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null),this.stopHeartbeat(),this.cancelAutoReconnect(),this.cancelReattachFit(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null);const e=this.xterm.element;e&&e.parentNode&&e.parentNode.removeChild(e),this.themeManager.setContainer(null),this.container=null}dispose(e={}){if(!(this.isDisposed||this.stateMachine.isDisposed())){if(this.isDisposed=!0,this.cancelAutoReconnect(),this.stopHeartbeat(),this.cancelReattachFit(),this.stateMachine.transition("dispose"),this.saveBuffer().catch(()=>{}),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.bufferSaveTimer&&(clearInterval(this.bufferSaveTimer),this.bufferSaveTimer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.dataDisposable){try{this.dataDisposable.dispose()}catch(i){I.error("Error disposing data handler:",i)}this.dataDisposable=null}if(this.resizeDisposable){try{this.resizeDisposable.dispose()}catch(i){I.error("Error disposing resize handler:",i)}this.resizeDisposable=null}if(this.selectionDisposable){try{this.selectionDisposable.dispose()}catch(i){I.error("Error disposing selection handler:",i)}this.selectionDisposable=null}if(this.ipcCleanup){try{this.ipcCleanup()}catch(i){I.error("Error cleaning up IPC handlers:",i)}this.ipcCleanup=null}if(this.themeCleanup){try{this.themeCleanup()}catch(i){I.error("Error cleaning up theme listener:",i)}this.themeCleanup=null}this.eventListeners.forEach(i=>{try{i()}catch(s){I.error("Error cleaning up event listener:",s)}}),this.eventListeners=[],e.killPty!==!1&&this.terminals.kill(this.terminalId,this.workspaceId).catch(i=>{I.error("Error killing PTY connection:",i)});try{this.searchAddon?.dispose&&this.searchAddon.dispose(),this.webLinksAddon?.dispose&&this.webLinksAddon.dispose(),this.disposeWebglAddon(),this.fitAddon?.dispose&&this.fitAddon.dispose()}catch(i){I.error("Error disposing addons:",i)}try{this.themeManager.dispose()}catch(i){I.error("Error disposing theme manager:",i)}try{this.stateMachine.dispose()}catch(i){I.error("Error disposing state machine:",i)}Pf(this.xterm,i=>{I.error("Error disposing xterm:",i)})}}};P(Ae,"MAX_RECONNECT_ATTEMPTS",5),P(Ae,"BASE_RECONNECT_DELAY_MS",1e3),P(Ae,"HEARTBEAT_INTERVAL_MS",3e4),P(Ae,"HEARTBEAT_TIMEOUT_MS",1e4),P(Ae,"MAX_WEBGL_RECOVERY_ATTEMPTS",3);let cn=Ae;const le=new Xi("TerminalManager");class zf{constructor(){P(this,"terminals",new Map)}saveTerminalMetadata(e,i,s){try{_t.dispatch(Gh(i,e,s,new Date().toISOString())),le.debug(`[RendererTerminalManager] Saved terminal metadata for ${e}`)}catch(r){le.error("[RendererTerminalManager] Failed to save terminal metadata:",r)}}loadTerminalMetadata(e){try{return Zh.select(_t.state,e).map(i=>({terminalId:i.id,workspaceId:i.workspaceId??e,createdAt:i.createdAt??"",title:i.customName||Jh(i.name)}))}catch(i){le.error("[RendererTerminalManager] Failed to load terminal metadata:",i)}return[]}removeTerminalMetadata(e,i){try{_t.dispatch(Yh(i,e)),le.debug(`[RendererTerminalManager] Removed terminal metadata for ${e}`)}catch(s){le.error("[RendererTerminalManager] Failed to remove terminal metadata:",s)}}hasTerminal(e){return this.terminals.has(e)}async getOrCreateTerminal(e,i,s,r,n=!1){let o=this.terminals.get(e);if(n&&o&&(le.info(`[RendererTerminalManager] Force creating new terminal, disposing existing: ${e}`),this.disposeTerminal(e),o=void 0),o)if(o.workspaceId!==i)le.warn(`[RendererTerminalManager] Terminal ${e} has mismatched workspaceId (has: ${o.workspaceId}, requested: ${i}). Disposing and recreating.`),this.disposeTerminal(e),o=void 0;else return le.info(`[RendererTerminalManager] Reattaching to existing terminal: ${e} (was attached: ${o.isAttached})`),o.container=s,o.isAttached=!0,await o.adapter.reattach(s),r&&(o.adapter.updateCallbacks(r),r.onReady?.()),le.info(`[RendererTerminalManager] Successfully reattached terminal: ${e}`),o.adapter;le.info(`[RendererTerminalManager] Creating new terminal: ${e}`);const a=new cn({workspaceId:i,terminalId:e,container:s,...r});return o={adapter:a,terminalId:e,workspaceId:i,isAttached:!0,container:s},this.terminals.set(e,o),this.saveTerminalMetadata(e,i),await a.initialize(n),a}isAttachedTo(e,i){const s=this.terminals.get(e);return!!s&&s.isAttached&&s.container===i}detachTerminal(e,i){const s=this.terminals.get(e);if(s){if(i&&s.container!==i){le.info(`[RendererTerminalManager] Ignoring detach from a stale surface: ${e}`);return}le.info(`[RendererTerminalManager] Detaching terminal: ${e}`),s.isAttached=!1,s.adapter.detach(),s.container=null}}disposeTerminal(e,i){const s=this.terminals.get(e);s?(le.info(`[RendererTerminalManager] Disposing terminal: ${e}`),s.adapter.dispose(),this.terminals.delete(e),this.removeTerminalMetadata(e,s.workspaceId)):_t.dispatch(Xh(e,i))}disposeExitedTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Disposing exited terminal: ${e}`),i.adapter.dispose({killPty:!1}),this.terminals.delete(e))}clearTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Clearing terminal: ${e}`),i.adapter.clear())}getTerminalInfo(e){const i=this.terminals.get(e);return i?i.adapter.getInfo():null}async getBufferContent(e,i){const s=this.terminals.get(e);if(s?.adapter)try{const r=s.adapter.xterm;if(r?.buffer?.active){const n=r.buffer.active,o=[];for(let a=0;a<n.length;a++){const l=n.getLine(a);l&&o.push(l.translateToString(!0))}for(;o.length>0&&!o[o.length-1].trim();)o.pop();if(o.length>0)return o.join(`
145
145
  `)}}catch(r){le.warn("[RendererTerminalManager] Failed to read live buffer, falling back:",r)}try{const n=await new Rs(i,e).restoreBuffer();if(n&&n.lines.length>0){const o=[...n.lines];for(;o.length>0&&!o[o.length-1].trim();)o.pop();return o.join(`
146
146
  `)}}catch(r){le.error("[RendererTerminalManager] Failed to read persisted buffer:",r)}return null}disposeWorkspaceTerminals(e){const i=[];for(const[s,r]of this.terminals)r.workspaceId===e&&i.push(s);if(i.length>0){le.info(`[RendererTerminalManager] Disposing ${i.length} terminals for workspace ${e}`);for(const s of i)try{const r=this.terminals.get(s);r&&(r.adapter.dispose(),this.terminals.delete(s))}catch(r){le.error(`[RendererTerminalManager] Failed to dispose terminal ${s}:`,r)}}}disposeAll(){le.info(`[RendererTerminalManager] Disposing all ${this.terminals.size} terminals`);for(const[e,i]of this.terminals)try{i.adapter.dispose()}catch(s){le.error(`[RendererTerminalManager] Failed to dispose terminal ${e}:`,s)}this.terminals.clear()}}typeof window<"u"&&!window.__terminalManager&&(window.__terminalManager=new zf);const Wf=window.__terminalManager,Tp=Object.freeze(Object.defineProperty({__proto__:null,terminalManager:Wf},Symbol.toStringTag,{value:"Module"}));export{au as D,pu as L,hn as T,Wf as a,Tp as b,Pf as d,cu as o,Oi as t};