@intent-hq/web 2.346.2 → 2.346.4

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 (269) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BBhsbqLJ.js → -CHLoCv2.js} +1 -1
  3. package/web/app/immutable/chunks/{DKnPivVx.js → -FMYDRBF.js} +1 -1
  4. package/web/app/immutable/chunks/{DFBU68gv.js → 2rbh16KP.js} +1 -1
  5. package/web/app/immutable/chunks/{k7pV_mI9.js → 4CzdfJpH.js} +1 -1
  6. package/web/app/immutable/chunks/{DMAPjgGW.js → 4UjNJakA.js} +1 -1
  7. package/web/app/immutable/chunks/{DUyBdSjv.js → 5GYSXevc.js} +1 -1
  8. package/web/app/immutable/chunks/{3OP-tats.js → 6EBJYAxp.js} +1 -1
  9. package/web/app/immutable/chunks/{DYbBpj-3.js → 6MPt5WH3.js} +1 -1
  10. package/web/app/immutable/chunks/{Bw9Opv8X.js → 7uqL-6tT.js} +1 -1
  11. package/web/app/immutable/chunks/{DoxU2MH-.js → 8hWYh2SV.js} +1 -1
  12. package/web/app/immutable/chunks/{JbkOWTOg.js → 8ksyQzxS.js} +1 -1
  13. package/web/app/immutable/chunks/{BOvPBTkx.js → 9kj5ZfRr.js} +1 -1
  14. package/web/app/immutable/chunks/{aEMYrozm.js → B-KN8Jlj.js} +1 -1
  15. package/web/app/immutable/chunks/{sCaWuYEb.js → B-mfoYJY.js} +1 -1
  16. package/web/app/immutable/chunks/{BGqL3gJO.js → B0A8uFhj.js} +1 -1
  17. package/web/app/immutable/chunks/{BaDPh7vq.js → B1Bex3N_.js} +1 -1
  18. package/web/app/immutable/chunks/{C5GFtLhI.js → B2fjzJpx.js} +2 -2
  19. package/web/app/immutable/chunks/{W4Nuovgc.js → B2lO9JOz.js} +1 -1
  20. package/web/app/immutable/chunks/{DNQiloiF.js → B35kShEY.js} +1 -1
  21. package/web/app/immutable/chunks/{B1b_Q-DK.js → B4ra8hfV.js} +1 -1
  22. package/web/app/immutable/chunks/{B0tYoxIu.js → B50qxjRT.js} +24 -24
  23. package/web/app/immutable/chunks/{CIhlsnLM.js → B7PtZbeR.js} +1 -1
  24. package/web/app/immutable/chunks/{CxlqEDL_.js → B7myJZdQ.js} +3 -3
  25. package/web/app/immutable/chunks/{BXPYDVnQ.js → B88KZW78.js} +1 -1
  26. package/web/app/immutable/chunks/{B_qlaCea.js → B8kDwCP_.js} +1 -1
  27. package/web/app/immutable/chunks/{t_9JF5Ld.js → B9Z-QU9w.js} +2 -2
  28. package/web/app/immutable/chunks/{OJa6n6kP.js → B9b_K-RG.js} +1 -1
  29. package/web/app/immutable/chunks/{Cv_fAsRR.js → BAYfmcgi.js} +1 -1
  30. package/web/app/immutable/chunks/{BPsfqTTH.js → BBDyE7y7.js} +1 -1
  31. package/web/app/immutable/chunks/{Ewbvp_lS.js → BBXjSeZz.js} +1 -1
  32. package/web/app/immutable/chunks/{Br-2EMQh.js → BI0ZZ8UO.js} +1 -1
  33. package/web/app/immutable/chunks/{DHNaVZzM.js → BIqnmVRf.js} +4 -4
  34. package/web/app/immutable/chunks/{-ATexmb_.js → BJWhwwHx.js} +1 -1
  35. package/web/app/immutable/chunks/{DhWGSJOr.js → BJwkYtAi.js} +1 -1
  36. package/web/app/immutable/chunks/{CSelYXXo.js → BL2lJmRT.js} +1 -1
  37. package/web/app/immutable/chunks/{BW1uSKLL.js → BLgIfeYS.js} +1 -1
  38. package/web/app/immutable/chunks/{V_ABjOKq.js → BMOaW1oW.js} +1 -1
  39. package/web/app/immutable/chunks/{CPo4UsMt.js → BN2mg-Hu.js} +1 -1
  40. package/web/app/immutable/chunks/{Bqw_xSaW.js → BNJe789p.js} +1 -1
  41. package/web/app/immutable/chunks/{Fas-AZ8u.js → BNwYXBCy.js} +1 -1
  42. package/web/app/immutable/chunks/{B6_GAXLX.js → BOr-kq9m.js} +1 -1
  43. package/web/app/immutable/chunks/{NhKlePe6.js → BPY8OTRz.js} +1 -1
  44. package/web/app/immutable/chunks/{Cjyjhytt.js → BPg5N0kY.js} +1 -1
  45. package/web/app/immutable/chunks/{yw7dEI88.js → BR8cFY4D.js} +1 -1
  46. package/web/app/immutable/chunks/{CNHQ2hz2.js → BS47DjuS.js} +1 -1
  47. package/web/app/immutable/chunks/{CTMYdigD.js → BS8Oxiwq.js} +1 -1
  48. package/web/app/immutable/chunks/{CK4TIiJZ.js → BSzY-NMz.js} +1 -1
  49. package/web/app/immutable/chunks/{L1oXncPn.js → BT9wQ0Ce.js} +6 -6
  50. package/web/app/immutable/chunks/{2_W5MGlF.js → BTrGu4V2.js} +1 -1
  51. package/web/app/immutable/chunks/{CUEYQ1xR.js → BYu-G7r_.js} +1 -1
  52. package/web/app/immutable/chunks/{DctMspbi.js → BZQDFgmp.js} +1 -1
  53. package/web/app/immutable/chunks/{CJbkgYat.js → Ba-QPC0I.js} +1 -1
  54. package/web/app/immutable/chunks/{_8ZvVPLV.js → BepEnAFk.js} +1 -1
  55. package/web/app/immutable/chunks/{FFimwbkT.js → BfUFKHC3.js} +1 -1
  56. package/web/app/immutable/chunks/BgsoTwBt.js +1 -0
  57. package/web/app/immutable/chunks/{D2D1pbBM.js → BhXOnc6x.js} +1 -1
  58. package/web/app/immutable/chunks/{B_ALvSh2.js → BhpN5y2w.js} +1 -1
  59. package/web/app/immutable/chunks/{3hAJcdO4.js → Bii5NwwM.js} +1 -1
  60. package/web/app/immutable/chunks/{D-3gv8KK.js → Bj5SxeMr.js} +1 -1
  61. package/web/app/immutable/chunks/{CT-2GqFI.js → BksE-BZ5.js} +1 -1
  62. package/web/app/immutable/chunks/{IrTkIWCG.js → BkwxWGIh.js} +1 -1
  63. package/web/app/immutable/chunks/{CP2XzLLk.js → Br0L4BrM.js} +1 -1
  64. package/web/app/immutable/chunks/{CjxgW2LG.js → BtFbwSdu.js} +1 -1
  65. package/web/app/immutable/chunks/{qvZYvB9N.js → Bv2KudWv.js} +1 -1
  66. package/web/app/immutable/chunks/{7HnS2P2A.js → By29T7f9.js} +1 -1
  67. package/web/app/immutable/chunks/{D1JIts8z.js → ByDHRaj1.js} +1 -1
  68. package/web/app/immutable/chunks/{dT5WNNGq.js → BzUmccFe.js} +1 -1
  69. package/web/app/immutable/chunks/{DRXZoO9N.js → C-G83LXE.js} +1 -1
  70. package/web/app/immutable/chunks/{BO3bzcut.js → C-P--5-o.js} +1 -1
  71. package/web/app/immutable/chunks/{BRBkuZqk.js → C0BifgcV.js} +3 -3
  72. package/web/app/immutable/chunks/{CAQf2iW_.js → C0CqY7Yc.js} +1 -1
  73. package/web/app/immutable/chunks/{D03v07xA.js → C0WVBwZy.js} +1 -1
  74. package/web/app/immutable/chunks/{C8d3Ntbq.js → C18Lu2A8.js} +1 -1
  75. package/web/app/immutable/chunks/{CKWRbVNZ.js → C1waf3iu.js} +1 -1
  76. package/web/app/immutable/chunks/{C3RXsOpj.js → C2EstpWq.js} +1 -1
  77. package/web/app/immutable/chunks/{B_uWHofm.js → C2XebNhA.js} +1 -1
  78. package/web/app/immutable/chunks/{UKn44y3B.js → C55nGHPT.js} +1 -1
  79. package/web/app/immutable/chunks/{BIWW5pDn.js → C6vwP-ay.js} +1 -1
  80. package/web/app/immutable/chunks/{EF8Lgcvo.js → C8MPntD9.js} +1 -1
  81. package/web/app/immutable/chunks/{C3Pl_e9x.js → C9pKpUIK.js} +1 -1
  82. package/web/app/immutable/chunks/{CQ5RMFdD.js → C9yvm97z.js} +3 -3
  83. package/web/app/immutable/chunks/{C1s02RDB.js → CApIfgsx.js} +1 -1
  84. package/web/app/immutable/chunks/{DfZvKQFw.js → CBc9tLFK.js} +4 -4
  85. package/web/app/immutable/chunks/{5qgyaXHk.js → CBq6DlIt.js} +4 -4
  86. package/web/app/immutable/chunks/{BMCRnGzk.js → CCk7G8nC.js} +1 -1
  87. package/web/app/immutable/chunks/{B-hjApiN.js → CEbGQG52.js} +1 -1
  88. package/web/app/immutable/chunks/{BUwilubW.js → CEr-aDm8.js} +1 -1
  89. package/web/app/immutable/chunks/{CpsuxuwM.js → CFj0DasV.js} +1 -1
  90. package/web/app/immutable/chunks/{BIDATtgj.js → CG_uU7t2.js} +1 -1
  91. package/web/app/immutable/chunks/{BvZcpO0X.js → CHr6G3cY.js} +1 -1
  92. package/web/app/immutable/chunks/{0h3tB2X7.js → CIpI7Qrh.js} +1 -1
  93. package/web/app/immutable/chunks/{BulYm0mb.js → CK_Ox9jk.js} +1 -1
  94. package/web/app/immutable/chunks/{CeydpcQL.js → CM4TK2R4.js} +1 -1
  95. package/web/app/immutable/chunks/{RKjwEkJS.js → CO4a0yRH.js} +1 -1
  96. package/web/app/immutable/chunks/{MoI4LiSA.js → CO5MrM9v.js} +1 -1
  97. package/web/app/immutable/chunks/{B8HwWHod.js → CPCmJFz3.js} +1 -1
  98. package/web/app/immutable/chunks/{C1N6iAP2.js → CPKMQWOs.js} +1 -1
  99. package/web/app/immutable/chunks/{DghbEZ16.js → CQQbNjsN.js} +1 -1
  100. package/web/app/immutable/chunks/{QcdWHB0v.js → CUxXMHrG.js} +1 -1
  101. package/web/app/immutable/chunks/{BbMjUd1J.js → CVM42XXi.js} +3 -3
  102. package/web/app/immutable/chunks/{DRpIoF9f.js → CVXxjkW7.js} +1 -1
  103. package/web/app/immutable/chunks/{BZklR_B6.js → CW-YFngS.js} +1 -1
  104. package/web/app/immutable/chunks/{BMlW8PWp.js → CXOFOhS1.js} +1 -1
  105. package/web/app/immutable/chunks/{DIKxUBjo.js → CY04lbSN.js} +1 -1
  106. package/web/app/immutable/chunks/{ByJd4XYj.js → CZytbhGb.js} +1 -1
  107. package/web/app/immutable/chunks/{CXZBvyNr.js → C_Lje1cd.js} +1 -1
  108. package/web/app/immutable/chunks/{CNwVL4wn.js → CaUG7pKp.js} +1 -1
  109. package/web/app/immutable/chunks/{B6hd6-h0.js → CapiHpD_.js} +1 -1
  110. package/web/app/immutable/chunks/{Dy_FWGdw.js → Cc25YYnU.js} +1 -1
  111. package/web/app/immutable/chunks/{CjpBT44D.js → CfvmLdft.js} +2 -2
  112. package/web/app/immutable/chunks/{VVSQHNmC.js → Ch-DGnj6.js} +1 -1
  113. package/web/app/immutable/chunks/{Cu4yzzG1.js → Ch69Gx78.js} +1 -1
  114. package/web/app/immutable/chunks/{BdnmB6mE.js → CjUvLS5U.js} +1 -1
  115. package/web/app/immutable/chunks/{KpAtxVXt.js → CkOW2_R1.js} +1 -1
  116. package/web/app/immutable/chunks/{DbjrS_71.js → CkbCPRkQ.js} +1 -1
  117. package/web/app/immutable/chunks/{DaOs4JNK.js → CkkCr6dG.js} +1 -1
  118. package/web/app/immutable/chunks/{B6jO8Woe.js → CkuIoWee.js} +1 -1
  119. package/web/app/immutable/chunks/{FXM57FKt.js → ClG9H6Ln.js} +1 -1
  120. package/web/app/immutable/chunks/{BB4FgpiZ.js → ClH0Gega.js} +1 -1
  121. package/web/app/immutable/chunks/{wZNQMR8J.js → CoMnnGKT.js} +1 -1
  122. package/web/app/immutable/chunks/{DlQwd6Dz.js → CpCtdYM3.js} +1 -1
  123. package/web/app/immutable/chunks/{CqvGUHnF.js → CqzfYhYr.js} +1 -1
  124. package/web/app/immutable/chunks/{D9WJ9yaW.js → CrWhihJ_.js} +1 -1
  125. package/web/app/immutable/chunks/{D7oCAGaV.js → Cs3L-D2A.js} +1 -1
  126. package/web/app/immutable/chunks/{BGsa1Rn-.js → CsKccV54.js} +1 -1
  127. package/web/app/immutable/chunks/{GAq2mIWu.js → CtZBPGmK.js} +1 -1
  128. package/web/app/immutable/chunks/{m4m_OnCq.js → Cu1u-4wq.js} +1 -1
  129. package/web/app/immutable/chunks/{DMNf2kIx.js → CugnkL_9.js} +4 -4
  130. package/web/app/immutable/chunks/{BtiDRzyn.js → CwDNa5HL.js} +1 -1
  131. package/web/app/immutable/chunks/{R_Ru9hwD.js → CwUHwo2Y.js} +1 -1
  132. package/web/app/immutable/chunks/{BzrasdW9.js → Cwvr2VA7.js} +1 -1
  133. package/web/app/immutable/chunks/{BHmRsJkZ.js → CxMGjr-k.js} +1 -1
  134. package/web/app/immutable/chunks/{CIRZKLVu.js → Cy8JcjH6.js} +1 -1
  135. package/web/app/immutable/chunks/{E9kqzP8d.js → CzPYlOCC.js} +1 -1
  136. package/web/app/immutable/chunks/{Bhz5wZ4Q.js → D-ZcbI-Y.js} +1 -1
  137. package/web/app/immutable/chunks/{DRG7DUhO.js → D-l6NLYy.js} +1 -1
  138. package/web/app/immutable/chunks/{BywHYLA0.js → D-uBGxZi.js} +1 -1
  139. package/web/app/immutable/chunks/{DAP42sSp.js → D0s1SVt5.js} +1 -1
  140. package/web/app/immutable/chunks/{LZaIAE1Y.js → D0wPN4-P.js} +1 -1
  141. package/web/app/immutable/chunks/{CiLrRXKC.js → D1TT2-Xo.js} +1 -1
  142. package/web/app/immutable/chunks/D32HMlYT.js +1 -0
  143. package/web/app/immutable/chunks/{hCF4Zu9x.js → D6rAyjoF.js} +1 -1
  144. package/web/app/immutable/chunks/{5mNJ4C7j.js → D8tPfa9K.js} +2 -2
  145. package/web/app/immutable/chunks/{BALLinLf.js → DDjhSDXW.js} +1 -1
  146. package/web/app/immutable/chunks/{BMxLlxet.js → DDuFS2zo.js} +1 -1
  147. package/web/app/immutable/chunks/{CFFiNWgw.js → DEApyfNP.js} +1 -1
  148. package/web/app/immutable/chunks/{DCmSz4nS.js → DJhhNZ7M.js} +1 -1
  149. package/web/app/immutable/chunks/{Cdb_pBT1.js → DLIkH-mx.js} +1 -1
  150. package/web/app/immutable/chunks/{BYpXsiCq.js → DNbEh_Pn.js} +1 -1
  151. package/web/app/immutable/chunks/{CsvSUZwX.js → DOH10_LL.js} +2 -2
  152. package/web/app/immutable/chunks/{CvGWJUqA.js → DOzvQ0Rd.js} +1 -1
  153. package/web/app/immutable/chunks/{DNMpoEvN.js → DPcH5rXQ.js} +1 -1
  154. package/web/app/immutable/chunks/{BticJnNL.js → DPpH6C1S.js} +1 -1
  155. package/web/app/immutable/chunks/{Cueu30DH.js → DQ01F80Q.js} +1 -1
  156. package/web/app/immutable/chunks/{C1Fdolkg.js → DU-RLEFB.js} +1 -1
  157. package/web/app/immutable/chunks/{CS4C4Dqz.js → DU9Ky5os.js} +1 -1
  158. package/web/app/immutable/chunks/{CeboDH9D.js → DVDOk-ql.js} +1 -1
  159. package/web/app/immutable/chunks/{CzGw49VI.js → DVJxiIYn.js} +1 -1
  160. package/web/app/immutable/chunks/{eqxSNkBq.js → DW0lWqDY.js} +1 -1
  161. package/web/app/immutable/chunks/{DxkncNQp.js → DYxNs3ex.js} +1 -1
  162. package/web/app/immutable/chunks/{k6cZvV27.js → DZHzDies.js} +1 -1
  163. package/web/app/immutable/chunks/{CMG5CVfP.js → DZtzqJzi.js} +1 -1
  164. package/web/app/immutable/chunks/{Cbpbq74u.js → DaWQpSHZ.js} +1 -1
  165. package/web/app/immutable/chunks/{BmooL5Pj.js → Db6-PdUB.js} +1 -1
  166. package/web/app/immutable/chunks/{DuA0wXTo.js → DbdK0wtE.js} +1 -1
  167. package/web/app/immutable/chunks/{CPE7SIVP.js → Dbp_q6hu.js} +1 -1
  168. package/web/app/immutable/chunks/{CI36mkCP.js → Dc5gEXVa.js} +1 -1
  169. package/web/app/immutable/chunks/{rBb3s3xl.js → DfqK8haP.js} +1 -1
  170. package/web/app/immutable/chunks/{9PMcLe0B.js → DhO5FJJI.js} +1 -1
  171. package/web/app/immutable/chunks/{DiLuZbm3.js → DhoGdCQi.js} +2 -2
  172. package/web/app/immutable/chunks/{Db5vVNPd.js → Dih9qRTv.js} +1 -1
  173. package/web/app/immutable/chunks/{CMcMoJJq.js → Dj3ZrCzO.js} +1 -1
  174. package/web/app/immutable/chunks/{Cp8bbNVk.js → DjLQeEnc.js} +2 -2
  175. package/web/app/immutable/chunks/{BGel6u2i.js → DjakyUlc.js} +1 -1
  176. package/web/app/immutable/chunks/{DkMx9Khd.js → Dk7aFMZs.js} +1 -1
  177. package/web/app/immutable/chunks/{DzrrFPjR.js → DnahZard.js} +3 -3
  178. package/web/app/immutable/chunks/{SrhdBdnO.js → DoYFP432.js} +1 -1
  179. package/web/app/immutable/chunks/{BjDqyb_W.js → DpFPjrHa.js} +2 -2
  180. package/web/app/immutable/chunks/{BEA1dP-Y.js → DqcBqbDI.js} +1 -1
  181. package/web/app/immutable/chunks/{DIYt9yAc.js → DqgXv99N.js} +1 -1
  182. package/web/app/immutable/chunks/{BG2eX09y.js → Dr9VLQ7a.js} +1 -1
  183. package/web/app/immutable/chunks/{BQk_mrPH.js → DrHq7-l3.js} +1 -1
  184. package/web/app/immutable/chunks/{DoIXHwho.js → DuP0kN9u.js} +1 -1
  185. package/web/app/immutable/chunks/{Bkff-hvs.js → DvyKNoGC.js} +1 -1
  186. package/web/app/immutable/chunks/{BqRBAXUd.js → DwrUEXuQ.js} +3 -3
  187. package/web/app/immutable/chunks/{DU8GQiwc.js → DzHxtEmT.js} +3 -3
  188. package/web/app/immutable/chunks/DzyUo7pt.js +1 -0
  189. package/web/app/immutable/chunks/{C4EqZepj.js → EOsEsFiT.js} +1 -1
  190. package/web/app/immutable/chunks/{BKJdB-rj.js → EbS0dv8R.js} +1 -1
  191. package/web/app/immutable/chunks/{DxdbljsN.js → GRe-AQYA.js} +1 -1
  192. package/web/app/immutable/chunks/{CJl18r_J.js → GXoNce_4.js} +1 -1
  193. package/web/app/immutable/chunks/{B47FKnfA.js → GgJbmGSc.js} +1 -1
  194. package/web/app/immutable/chunks/{CTgw4phK.js → Ik_OLFJv.js} +1 -1
  195. package/web/app/immutable/chunks/{CIDQz_xi.js → JM_PKnGS.js} +1 -1
  196. package/web/app/immutable/chunks/{P2s61dnl.js → MA6Nl0OX.js} +1 -1
  197. package/web/app/immutable/chunks/{tcnXcM0S.js → MQ537-MV.js} +1 -1
  198. package/web/app/immutable/chunks/{DmY0GWNY.js → Mc93eSxl.js} +1 -1
  199. package/web/app/immutable/chunks/{BN7h9eAI.js → McA_XHBx.js} +1 -1
  200. package/web/app/immutable/chunks/{DmDreYHi.js → Mg8H3Ad_.js} +2 -2
  201. package/web/app/immutable/chunks/{DhUnCLhA.js → NDjLJa7E.js} +1 -1
  202. package/web/app/immutable/chunks/{WXiWQWrz.js → PRcE3ypK.js} +1 -1
  203. package/web/app/immutable/chunks/{DlOpwiIn.js → PTikn3lb.js} +1 -1
  204. package/web/app/immutable/chunks/{BQjy1SUJ.js → R-YEJgRO.js} +1 -1
  205. package/web/app/immutable/chunks/S3oleArH.js +4 -0
  206. package/web/app/immutable/chunks/{fYStpNp1.js → SVOpkWQp.js} +2 -2
  207. package/web/app/immutable/chunks/{CpB9-pxF.js → TPdIgwsT.js} +2 -2
  208. package/web/app/immutable/chunks/{FIoCaQ2r.js → WVba34Wr.js} +1 -1
  209. package/web/app/immutable/chunks/Y9-4hTF9.js +1 -0
  210. package/web/app/immutable/chunks/{Dsq9SKtm.js → ZKiqJWPE.js} +1 -1
  211. package/web/app/immutable/chunks/{Bzvkqwap.js → _q-KbJHf.js} +1 -1
  212. package/web/app/immutable/chunks/{LPERbs3m.js → aK5j3GUe.js} +1 -1
  213. package/web/app/immutable/chunks/aos1n-nT.js +4 -0
  214. package/web/app/immutable/chunks/{BGKCZT2I.js → b30yTgwC.js} +1 -1
  215. package/web/app/immutable/chunks/{D1J3O3UF.js → b_tEJldq.js} +1 -1
  216. package/web/app/immutable/chunks/{Bs7Hg6Iw.js → cFbB-5Cu.js} +1 -1
  217. package/web/app/immutable/chunks/{CZF99d-A.js → cQMohqSY.js} +1 -1
  218. package/web/app/immutable/chunks/d7GMXNij.js +1 -0
  219. package/web/app/immutable/chunks/{GTp1YEph.js → dWKHnuAl.js} +1 -1
  220. package/web/app/immutable/chunks/{BcLSwxTf.js → ddhULx4L.js} +1 -1
  221. package/web/app/immutable/chunks/{CzZewxhP.js → e3tI_GeB.js} +1 -1
  222. package/web/app/immutable/chunks/{C1c28WNI.js → fqYOWiI-.js} +1 -1
  223. package/web/app/immutable/chunks/{B4lGG925.js → g9XYCabR.js} +1 -1
  224. package/web/app/immutable/chunks/{C-6Vv_Md.js → hUKBOWr5.js} +1 -1
  225. package/web/app/immutable/chunks/{Bb6S2E-a.js → jX7_8poo.js} +1 -1
  226. package/web/app/immutable/chunks/{C8_z1bbT.js → khtpv5vo.js} +1 -1
  227. package/web/app/immutable/chunks/{CcOcBD3s.js → mP3jvNc-.js} +1 -1
  228. package/web/app/immutable/chunks/{CNOSe0wO.js → pBUZ5yOz.js} +1 -1
  229. package/web/app/immutable/chunks/{C9u4tXUT.js → poVs4JlU.js} +1 -1
  230. package/web/app/immutable/chunks/{zqCR6Knb.js → q6hitSEG.js} +1 -1
  231. package/web/app/immutable/chunks/{_5Vv4dkf.js → rt8UAcU5.js} +1 -1
  232. package/web/app/immutable/chunks/{CnkXoP0c.js → ryfL7_qm.js} +1 -1
  233. package/web/app/immutable/chunks/{Cbr_yt83.js → s464WHxX.js} +1 -1
  234. package/web/app/immutable/chunks/{C4xNNtUj.js → tU_ZJtMw.js} +1 -1
  235. package/web/app/immutable/chunks/{DiKPZGG7.js → tgq3aX1k.js} +1 -1
  236. package/web/app/immutable/chunks/{BxyjmPKU.js → yhs5mgcb.js} +1 -1
  237. package/web/app/immutable/chunks/{DfumCvo1.js → z8H4OcR3.js} +1 -1
  238. package/web/app/immutable/entry/{app.BQtRy4N0.js → app.DnRD5eKq.js} +3 -3
  239. package/web/app/immutable/entry/start.CbqkOfEp.js +1 -0
  240. package/web/app/immutable/nodes/{0.YxkIXYW_.js → 0.CmJ43u1e.js} +1 -1
  241. package/web/app/immutable/nodes/{1.DPIiTcn7.js → 1.CqfYJXsK.js} +1 -1
  242. package/web/app/immutable/nodes/{10.CYSFXPaq.js → 10.Bl5RgWV9.js} +1 -1
  243. package/web/app/immutable/nodes/{11.Bl5UwrS9.js → 11.CtUvalit.js} +1 -1
  244. package/web/app/immutable/nodes/{12.CUp8k2-A.js → 12.BEzNSZ5P.js} +1 -1
  245. package/web/app/immutable/nodes/{13.Ch9aZ9Uv.js → 13.sp2ZZVeV.js} +3 -3
  246. package/web/app/immutable/nodes/{14.BW4XzZI8.js → 14.lB98JO4-.js} +3 -3
  247. package/web/app/immutable/nodes/{15.Cto8qDz0.js → 15.DxqMZDdK.js} +1 -1
  248. package/web/app/immutable/nodes/{16.SivUu1Ma.js → 16.C_vshDQR.js} +1 -1
  249. package/web/app/immutable/nodes/{17.Chj8J0QC.js → 17.BtrKoac8.js} +1 -1
  250. package/web/app/immutable/nodes/{18.BmSdt93l.js → 18.C1RSVrDA.js} +2 -2
  251. package/web/app/immutable/nodes/{2.CL9-Oazw.js → 2.CALBXNAI.js} +6 -6
  252. package/web/app/immutable/nodes/{3.6SFTvSLk.js → 3.Cbim6IQ0.js} +1 -1
  253. package/web/app/immutable/nodes/{4.s2OPBDUw.js → 4.CLMy68qv.js} +1 -1
  254. package/web/app/immutable/nodes/{5.BhdLMGJF.js → 5.DTKqXK_K.js} +1 -1
  255. package/web/app/immutable/nodes/{6.DorNgn-a.js → 6.COrZ368S.js} +1 -1
  256. package/web/app/immutable/nodes/{7.9iHTOKVc.js → 7.BOwmWuI7.js} +1 -1
  257. package/web/app/immutable/nodes/{8.DGrpVVpf.js → 8.DVUc29Ay.js} +4 -4
  258. package/web/app/immutable/nodes/{9.rNDQpOBQ.js → 9.Bf5-_PNq.js} +5 -5
  259. package/web/app/version.json +1 -1
  260. package/web/generated/paraglide.js +49 -49
  261. package/web/index.html +18 -18
  262. package/web/app/immutable/chunks/BKW86yq_.js +0 -1
  263. package/web/app/immutable/chunks/BtwtItRa.js +0 -4
  264. package/web/app/immutable/chunks/C8ummx7x.js +0 -1
  265. package/web/app/immutable/chunks/D1jZIoRI.js +0 -1
  266. package/web/app/immutable/chunks/DLzSUn52.js +0 -4
  267. package/web/app/immutable/chunks/Dk2XuKyL.js +0 -1
  268. package/web/app/immutable/chunks/O7PQPM4V.js +0 -1
  269. package/web/app/immutable/entry/start.DP05n5bC.js +0 -1
@@ -1 +1 @@
1
- var j=Object.defineProperty;var V=(s,e,t)=>e in s?j(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>V(s,typeof e!="symbol"?e+"":e,t);import{f as x,j as G,p as z}from"./uXuxG9cN.js";import{u as J,o as T,_ as C,s as b,l as _,n as U}from"./CIyUrgF0.js";import{bo as $}from"./BKW86yq_.js";class u extends Error{constructor(t){super(t.message);n(this,"code");n(this,"data");n(this,"rpcCode");this.name="BackendError",this.code=t.code,this.data=t.data,this.rpcCode=t.rpcCode}}function Ee(s){return!s||typeof s!="object"?!1:typeof s.rpcCode=="number"}const K=-32003;function Ce(s){return!s||typeof s!="object"?!1:s.rpcCode===K}const Ae=x.refine(s=>s.repository.provider==="github"&&s.kind==="pull-request"||s.repository.provider==="gitlab"&&s.kind==="merge-request"),Oe=J([T({state:C(["available","pending","reconnect-required","restricted","disabled","unsupported","unavailable","unknown"])}),T({state:_("backoff"),retryAt:b()}),T({state:_("unresolved"),reason:C(["missing-provenance","unverified-import","invalid-target","missing-authority","unknown"]).catch("unknown")})]).catch({state:"unknown"}),_e=T({backendId:b().min(1),sessionId:b().min(1),workspaceId:b().min(1)}).strict();function v(s){return typeof s=="number"&&Number.isSafeInteger(s)&&s>=1}function Ne(s){if(s.resource||s.monitorAvailability||s.title===null||s.url===null||s.lastSnapshot===null)return!1;const e=s.lastSnapshot;return!e||!e.availability&&e.isDraft!==null&&e.hasConflicts!==null&&e.isBehind!==null&&Object.values(e.checks).every(t=>t!==null)&&e.approvals.decision!==null&&e.approvals.have!==null&&e.approvals.changesRequested!==null}const Ie=new Set(["agent.getConversation","agent.listUserMessages","agent.getMessageBlock","chat.subscribe","chat.unsubscribe"]);class Y{constructor(e,t,i,o,a,d,R){n(this,"ready");n(this,"acknowledged",!1);n(this,"closed",!1);n(this,"id",0);n(this,"pending",new Map);n(this,"listeners",new Set);n(this,"rejectReady");n(this,"timer");this.socket=e,this.currentSource=o,this.timeoutMs=a,this.onFailure=R,this.ready=new Promise((m,r)=>{this.rejectReady=r,e.onopen=()=>{if(!this.current())return this.fail();this.send("client.hello",{clientId:t,connectionRole:"review-monitor",capabilities:{reviewMonitoring:i}}).then(f=>{const c=f;if(!this.current()||c?.clientId!==t||c?.connectionRole!=="review-monitor"||!v(c?.server?.capabilities?.reviewMonitoring))return this.fail();this.acknowledged=!0,clearTimeout(this.timer),m()},()=>this.fail())}}),this.timer=setTimeout(()=>this.fail(),d),e.onerror=()=>this.fail(),e.onclose=()=>this.fail(),e.onmessage=({data:m})=>{if(!this.current()||typeof m!="string")return;let r;try{r=JSON.parse(m)}catch{return}if(!r||typeof r!="object")return;if(typeof r.method=="string"){if(r.id!=null){try{e.send(JSON.stringify({jsonrpc:"2.0",id:r.id,error:{code:-32601,message:"Method not found"}}))}catch{this.fail()}return}if(this.acknowledged)for(const c of[...this.listeners])c({method:r.method,params:r.params});return}if(typeof r.id!="number")return;const f=this.pending.get(r.id);if(f)if(this.pending.delete(r.id),clearTimeout(f.timer),r.error){const c=r.error.data,g=c&&typeof c=="object"&&"code"in c&&typeof c.code=="string"?c.code:"SERVER_ERROR";f.reject(new u({code:g,message:typeof r.error.message=="string"?r.error.message:"Monitor request failed",data:c,rpcCode:typeof r.error.code=="number"?r.error.code:void 0}))}else f.resolve(r.result)}}current(){return!this.closed&&this.currentSource()}onNotification(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,t){return!this.acknowledged||e==="client.hello"?Promise.reject(this.unavailable()):this.send(e,t)}close(){if(this.closed)return;this.closed=!0,this.acknowledged=!1,clearTimeout(this.timer);const e=this.unavailable();this.rejectReady(e);for(const t of this.pending.values())clearTimeout(t.timer),t.reject(e);this.pending.clear(),this.listeners.clear(),this.socket.onopen=this.socket.onmessage=this.socket.onerror=this.socket.onclose=null;try{this.socket.close()}catch{}}fail(){this.closed||(this.close(),this.onFailure())}unavailable(){return new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor attachment unavailable"})}send(e,t){if(!this.current())return Promise.reject(this.unavailable());const i=++this.id;return new Promise((o,a)=>{const d=setTimeout(()=>{this.pending.delete(i),a(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`}))},this.timeoutMs);this.pending.set(i,{resolve:o,reject:a,timer:d});try{this.socket.send(JSON.stringify({jsonrpc:"2.0",id:i,method:e,params:t}))}catch{this.fail()}})}}const X=["agentNodes","localNodeIsolation","agentPlatformRouting","workspaceMembershipEvents","rawScreenshotRetention","chiefAttachments","noteTruncatedRead","remoteMachines","remoteInitialAgent","remoteMachineClaim","machineOrder","remoteLinkTraffic","cloudMachines","cloudMachineEntries","cloudMachineProviders"];function Q(s){return Object.freeze(Object.fromEntries(X.map(e=>[e,s?.[e]===1?1:0])))}function Z(s){if(!G(s,11,1))throw new Error($.files_secondaryRoot_unsupported_error())}function ee(s,e,t){te(s,e)&&Z(t)}function te(s,e){if(s!=="file.read"&&s!=="file.readChunk")return!1;const t=e?.gitRootId;return typeof t=="string"&&!!t.trim()}const N=-32012,se="system.startupStatus",ne=1e3,L=1e3,F=3e4,w=U().int().nonnegative().max(Number.MAX_SAFE_INTEGER),ie=T({completedNotes:w,totalNotes:w,processedSourceBytes:w,totalSourceBytes:w}).refine(s=>s.completedNotes<=s.totalNotes&&s.processedSourceBytes<=s.totalSourceBytes),oe=T({startupStatus:_(1),daemonVersion:b().min(1).optional(),attemptId:b().min(1),phase:C(["preparing","indexing","finalizing","ready","failed"]),elapsedMs:w,phaseElapsedMs:w,progressAgeMs:w,retryAfterMs:U().int().min(L).max(F).optional(),progress:ie.optional(),estimatedRemainingMs:w.optional(),finalizingStep:C(["anchors","committing","services"]).optional(),failure:T({code:b().min(1),message:b().min(1)}).optional()}).refine(s=>(s.phase==="ready"||s.phase==="failed"?s.retryAfterMs===void 0:s.retryAfterMs!==void 0)&&(s.phase==="finalizing"?s.finalizingStep!==void 0:s.finalizingStep===void 0)&&(s.phase==="failed"?s.failure!==void 0:s.failure===void 0)&&(s.estimatedRemainingMs===void 0||s.phase==="indexing"));function B(s){const e=oe.safeParse(s);return e.success?e.data:null}function P(s){const e=typeof s=="number"&&Number.isFinite(s)?s:ne;return Math.min(F,Math.max(L,e))}function re(s){const e=s;return typeof e.rpcCode=="number"?e.rpcCode:typeof e.code=="number"?e.code:void 0}function q(s){if(!s||typeof s!="object"||re(s)!==N)return;const e=s.data??{},t=B(e.startup);if(e.code==="daemon-startup-failed"){const i=e.startup?.failure?.message,o=s.message;return{kind:"failed",message:typeof i=="string"&&i.trim()?i:typeof o=="string"?o:"",snapshot:t}}if(!(e.code!=="daemon-not-ready"||e.retryable!==!0))return{kind:"not-ready",retryAfterMs:P(e.retryAfterMs),snapshot:t}}function D(s){const e=s.snapshot??void 0;return s.state==="failed"?{code:N,message:"Daemon startup failed",data:{code:"daemon-startup-failed",retryable:!1,startup:e}}:{code:N,message:"Daemon not ready",data:{code:"daemon-not-ready",retryable:!0,retryAfterMs:P(e?.retryAfterMs),startup:e}}}const ae=5e3,ce=5e3,le=3e4;function he(s){const e=s.snapshot;return JSON.stringify([s.state,s.available,e?.attemptId,e?.phase,e?.finalizingStep,e?.progress?.completedNotes,e?.progress?.totalNotes,e?.estimatedRemainingMs===void 0,(e?.progressAgeMs??0)>=le])}class ue{constructor(e){n(this,"generation",0);n(this,"timer",null);n(this,"snapshot",null);n(this,"lastKey",null);n(this,"lastPublishedAt",0);this.host=e}start(e){this.stop(),this.snapshot=e.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:e.snapshot!==null},!0),this.schedule(e.retryAfterMs)}stop(){this.generation++,this.timer&&(clearTimeout(this.timer),this.timer=null)}reset(){this.stop(),this.snapshot=null,this.lastKey=null,this.lastPublishedAt=0}publish(e,t=!1){const i=he(e),o=Date.now();!t&&i===this.lastKey&&o-this.lastPublishedAt<ce||(this.lastKey=i,this.lastPublishedAt=o,this.host.publish(e))}schedule(e){const t=this.generation;this.timer=setTimeout(()=>{if(this.timer=null,t!==this.generation)return;const i=()=>this.poll(t);this.host.track?this.host.track(i):i()},e)}async poll(e){let t;try{t=B(await this.host.request())}catch(i){if(e!==this.generation)return;const o=q(i);if(o?.kind==="failed"){this.stop(),this.host.fail(o.message,o.snapshot);return}if(o?.kind==="not-ready"){this.snapshot=o.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:o.snapshot!==null}),this.schedule(o.retryAfterMs);return}this.unavailable();return}if(e===this.generation){if(t===null){this.unavailable();return}if(this.snapshot=t,t.phase==="failed"){this.stop(),this.host.fail(t.failure?.message??"",t);return}if(t.phase==="ready"){this.stop(),this.publish({state:"starting",snapshot:t,available:!0},!0),this.host.handoff(!0);return}this.publish({state:"starting",snapshot:t,available:!0}),this.schedule(P(t.retryAfterMs))}}unavailable(){this.stop(),this.publish({state:"starting",snapshot:this.snapshot,available:!1},!0),this.host.handoff(!1)}}function Pe(s=(()=>{const e=globalThis.__INTENT_RUNTIME_CONFIG__;return e?.intentdWsUrl!==void 0?e.intentdWsUrl:typeof process>"u"?void 0:""})()){if(typeof s!="string")return;const e=s.trim();if(!e)return;if(e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\")){const o=globalThis.location;if(o?.host&&(o.protocol==="http:"||o.protocol==="https:"))return`${o.protocol==="https:"?"wss:":"ws:"}//${o.host}${e}`;console.warn("[browser-websocket-transport] Ignoring same-origin WebSocket path without an HTTP page origin");return}let t;try{t=new URL(e)}catch{console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}if(t.protocol!=="ws:"&&t.protocol!=="wss:"){console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}const i=t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol==="ws:"&&!i){console.warn("[browser-websocket-transport] Ignoring insecure remote WebSocket URL: use wss://");return}return e}function de(s){try{const e=new URL(s);return e.username="",e.password="",e.search="",e.hash="",e.toString()}catch{return s.replace(/[?#].*$/,"").replace(/^([a-z][a-z0-9+.-]*:\/\/)[^/]*@/i,"$1")}}const fe={[-32700]:"PARSE_ERROR",[-32600]:"INVALID_REQUEST",[-32601]:"METHOD_NOT_FOUND",[-32602]:"INVALID_PARAMS",[-32603]:"INTERNAL_ERROR"};function pe(s){const e=fe[s];return e||(s<=-32e3&&s>=-32099?"SERVER_ERROR":"UNKNOWN_ERROR")}function me(s){if(s&&typeof s=="object"&&"code"in s){const e=s.code;if(typeof e=="string"&&e.length>0)return e}}function O(s){const e=me(s.data)??pe(s.code),t=s.data&&typeof s.data=="object"?{...s.data,code:e}:typeof s.data=="string"&&s.data.length>0?{code:e,detail:s.data}:{code:e};return{code:e,message:s.message,data:t,rpcCode:s.code}}function E(s){if(s instanceof u)return s;const e=s instanceof Error?s.message:String(s);return new u({code:"TRANSPORT_ERROR",message:e,data:{code:"TRANSPORT_ERROR"}})}const ge=3e4,Re=1e3,ye=3e4,Se=1e4,be=5e3;class we{constructor(e){n(this,"url");n(this,"webSocketFactory");n(this,"requestTimeoutMs");n(this,"reconnectDelayMs");n(this,"maxReconnectDelayMs");n(this,"connectTimeoutMs");n(this,"socket",null);n(this,"connected",!1);n(this,"connecting",!1);n(this,"disposed",!1);n(this,"requestId",0);n(this,"currentReconnectDelay");n(this,"reconnectTimer",null);n(this,"connectTimer",null);n(this,"connectWaiters",[]);n(this,"clientId");n(this,"helloConfirmed",!1);n(this,"acknowledgedHello",null);n(this,"nodeCapabilities",null);n(this,"capabilityHelloGeneration",0);n(this,"reviewMonitoring");n(this,"reviewMonitoringRecipient");n(this,"reviewMonitoringEnabled",!1);n(this,"ordinaryHello",!1);n(this,"monitorRetry",null);n(this,"monitorRetirements",new Set);n(this,"monitorReady",new Set);n(this,"protocolVersion",null);n(this,"helloError",new u({code:"UNAVAILABLE",message:"client.hello has not completed on this connection"}));n(this,"pending",new Map);n(this,"hasBeenConnected",!1);n(this,"hasConnectionFailed",!1);n(this,"notificationHandlers",new Set);n(this,"reconnectedHandlers",new Set);n(this,"statusHandlers",new Set);n(this,"lastNotifiedStatus","disconnected");n(this,"startupState",null);n(this,"startupSocket",null);n(this,"startupPoller",new ue({request:()=>{const e=this.startupSocket;return e?this.requestOnSocket(se,void 0,{timeoutMs:ae},e):Promise.reject(this.startupRefusal())},publish:e=>this.updateStartup(e),handoff:e=>this.startupHandoff(e),fail:(e,t)=>this.failStartup(e,t)}));n(this,"startupHandlers",new Set);this.reviewMonitoringEnabled=v(e.reviewMonitoring),this.reviewMonitoringRecipient=v(e.reviewMonitoring)?e.reviewMonitoring:void 0,this.url=e.url,this.webSocketFactory=e.webSocketFactory??(t=>new WebSocket(t)),this.requestTimeoutMs=e.requestTimeoutMs??ge,this.reconnectDelayMs=e.reconnectDelayMs??Re,this.maxReconnectDelayMs=e.maxReconnectDelayMs??ye,this.connectTimeoutMs=e.connectTimeoutMs??Se,this.currentReconnectDelay=this.reconnectDelayMs}isAvailable(){return!this.disposed}async readPrincipal(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected(),t=this.capabilityHelloGeneration,i=structuredClone(this.acknowledgedHello),o=()=>!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t&&this.acknowledgedHello!==null;if(!o())throw this.helloError;const a=await this.requestOnSocket("principal.me",{},void 0,e);if(!o())throw new u({code:"UNAVAILABLE",message:"Principal discovery connection changed"});return{hello:i,principal:a}}async observeNodeCapabilities(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected();if(this.disposed||!this.connected||this.socket!==e)throw new u({code:"UNAVAILABLE",message:"Backend connection changed"});return{server:{capabilities:this.nodeCapabilities}}}onMonitorReconnected(e){this.monitorReady.add(e);const t=this.onReconnected(e);return()=>{this.monitorReady.delete(e),t()}}prMonitorBackendId(){return de(this.url)}async capturePrMonitorSession(e){const t=await this.ensureConnected(),i=this.capabilityHelloGeneration,o=()=>new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor connection unavailable"});let a,d=!1;const R=new Set,m=new Set,r=()=>{if(!d){d=!0,this.monitorRetirements.delete(r),a?.close();for(const l of R)l();R.clear()}},f=()=>!d&&!this.disposed&&this.connected&&this.helloConfirmed&&this.socket===t&&i===this.capabilityHelloGeneration,c=()=>f()&&(!a||a.current());if(!c())throw o();this.monitorRetirements.add(r);const g=v(this.reviewMonitoring);let M=g?"consumer-pending":"unsupported";if(g&&this.reviewMonitoringEnabled&&this.ordinaryHello&&this.clientId)try{if(a=new Y(this.webSocketFactory(this.url),this.clientId,Math.min(this.reviewMonitoringRecipient,this.reviewMonitoring),f,this.requestTimeoutMs,this.connectTimeoutMs,()=>{const l=f();r(),l&&this.scheduleMonitorRecovery(t,i)}),await a.ready,!c())throw o();M="supported"}catch(l){const p=f();throw r(),p&&this.scheduleMonitorRecovery(t,i),l}const y=(l,p)=>a?a.request(l,p):this.requestOnSocket(l,p,void 0,t);return{origin:{backendId:this.prMonitorBackendId(),sessionId:crypto.randomUUID(),workspaceId:e},support:M,onRetired(l){return c()?(R.add(l),()=>{R.delete(l)}):(l(),()=>{})},onNotification:l=>(a??this).onNotification(p=>{c()&&l(p)}),request:async(l,p)=>{if(!c()||M==="consumer-pending"||p.workspaceId!==e)throw o();const k=await y(l,p),h=l==="events.subscribe"?k?.subscriptionId:void 0;if(!c())throw h&&this.socket===t&&this.connected&&i===this.capabilityHelloGeneration&&y("events.unsubscribe",{workspaceId:e,subscriptionId:h}).catch(()=>{}),o();return h&&m.add(h),l==="events.unsubscribe"&&m.delete(String(p.subscriptionId)),k},release:async()=>{const l=c();r(),l&&!a&&await Promise.all([...m].map(p=>this.requestOnSocket("events.unsubscribe",{workspaceId:e,subscriptionId:p},void 0,t).catch(()=>{})))}}}request(e,t,i){return this.requestOnSocket(e,t,i)}requestOnSocket(e,t,i,o){if(i?.localMachine)return Promise.reject(new u({code:"UNAVAILABLE",message:"Local machine requests require the desktop bridge"}));if(this.disposed)return Promise.reject(new u({code:"UNAVAILABLE",message:"Backend transport disposed"}));if(!o&&this.startupState?.state==="starting")return Promise.reject(new u(O(D(this.startupState))));const a=++this.requestId,d=i?.timeoutMs,R=typeof d=="number"&&Number.isFinite(d)&&d>0?d:this.requestTimeoutMs;return new Promise((m,r)=>{let f=!1;const c=setTimeout(()=>{f=!0,this.pending.delete(a),r(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`,data:{code:"TIMEOUT"}}))},R),g=y=>{clearTimeout(c),r(E(y))},M=y=>{if(f)return;if(this.disposed||this.socket!==y){g(new u({code:"TRANSPORT_ERROR",message:"Connection replaced"}));return}if(e==="presence.update"&&!this.helloConfirmed){g(this.helloError);return}try{ee(e,t,this.protocolVersion)}catch(h){g(h);return}let l=e==="client.hello"&&this.clientId?{clientId:this.clientId,...t}:t;if(e==="client.hello"){const h={...l},S={...h.capabilities};Object.prototype.hasOwnProperty.call(S,"reviewMonitoring")&&(this.reviewMonitoringEnabled=this.reviewMonitoringRecipient!==void 0&&v(S.reviewMonitoring)),delete S.reviewMonitoring,delete h.connectionRole,h.capabilities!==void 0&&(h.capabilities=S),l=h}const p=JSON.stringify({jsonrpc:"2.0",id:a,method:e,params:l}),k=e==="client.hello"?++this.capabilityHelloGeneration:0;if(e==="client.hello"){this.helloConfirmed=!1,this.ordinaryHello=!1,this.clearMonitorRecovery(),this.nodeCapabilities=null,this.reviewMonitoring=void 0;for(const h of[...this.monitorRetirements])h();this.acknowledgedHello=null}this.pending.set(a,{method:e,timeout:c,resolve:h=>{if(e==="client.hello"&&this.socket===y&&k===this.capabilityHelloGeneration){const S=h?.clientId;if(typeof S=="string"&&S.length>0){const H=h.server?.capabilities;if(this.clientId=S,this.reviewMonitoring=H?.reviewMonitoring,this.ordinaryHello=h.connectionRole===void 0,this.acknowledgedHello=structuredClone(h),this.nodeCapabilities=Q(H),this.protocolVersion=z(h.protocolVersion),this.helloConfirmed=!0,this.connected)for(const W of this.monitorReady)W()}}m(h)},reject:r});try{y.send(p)}catch(h){clearTimeout(c),this.pending.delete(a),r(E(h))}};o?M(o):this.connected&&this.socket?M(this.socket):this.ensureConnected().then(M,g)})}async subscribe(e){return this.request("events.subscribe",e)}async unsubscribe(e,t){try{await this.request("events.unsubscribe",{subscriptionId:e,...t!==void 0?{workspaceId:t}:{}})}catch{}}onNotification(e){return this.notificationHandlers.add(e),()=>this.notificationHandlers.delete(e)}onReconnected(e){return this.reconnectedHandlers.add(e),()=>this.reconnectedHandlers.delete(e)}getConnectionStatus(){return this.connected?"connected":this.connecting?"connecting":"disconnected"}getStartupState(){return this.startupState}onStartupChange(e){return this.startupHandlers.add(e),()=>this.startupHandlers.delete(e)}onConnectionStatusChange(e){return this.statusHandlers.add(e),()=>this.statusHandlers.delete(e)}dispose(){if(this.disposed)return;this.disposed=!0,this.clearReconnect(),this.clearConnectTimer();const e=new u({code:"UNAVAILABLE",message:"Backend transport disposed"});this.failPending(e),this.failWaiters(e),this.teardownSocket(),this.connected=!1,this.connecting=!1,this.notifyStatusChange(),this.notificationHandlers.clear(),this.reconnectedHandlers.clear(),this.statusHandlers.clear(),this.startupHandlers.clear()}ensureConnected(){return this.connected&&this.socket?Promise.resolve(this.socket):new Promise((e,t)=>{this.connectWaiters.push({resolve:e,reject:t}),this.start()})}start(){this.disposed||this.socket||this.connecting||this.reconnectTimer||this.connect()}connect(){this.clearReconnect(),this.connecting=!0,this.notifyStatusChange();let e;try{e=this.webSocketFactory(this.url)}catch(t){this.connecting=!1,this.onConnectionFailure(E(t));return}this.socket=e,this.helloConfirmed=!1,this.connectTimer=setTimeout(()=>{this.connectTimer=null,!(this.socket!==e||this.connected)&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:`WebSocket connect attempt timed out after ${this.connectTimeoutMs}ms`})))},this.connectTimeoutMs),e.onopen=()=>{this.socket===e&&this.onConnected(e)},e.onmessage=t=>{this.socket===e&&this.onMessage(t.data)},e.onerror=null,e.onclose=()=>{this.socket===e&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})))}}onConnected(e){this.clearConnectTimer(),this.performHelloHandshake(e)}async performHelloHandshake(e){try{await this.requestOnSocket("client.hello",{},{timeoutMs:Math.min(this.requestTimeoutMs,be)},e)}catch(o){if(this.disposed||this.socket!==e)return;const a=q(o);if(a){this.enterStartup(e,a);return}this.helloError=E(o)}if(this.disposed||this.socket!==e)return;this.startupPoller.reset(),this.startupSocket=null;const t=this.startupState!==null;this.startupState=null,this.connecting=!1,this.connected=!0,this.currentReconnectDelay=this.reconnectDelayMs;const i=this.hasBeenConnected||this.hasConnectionFailed;if(this.hasBeenConnected=!0,this.hasConnectionFailed=!1,this.notifyStatusChange(),t)for(const o of[...this.startupHandlers])o(null);if(this.flushWaiters(e),i)for(const o of[...this.reconnectedHandlers])o()}onConnectionFailure(e){if(this.clearConnectTimer(),!this.disposed){if(this.startupSocket!==null&&this.startupSocket===this.socket){this.startupHandoff(!0);return}this.startupState?.state==="starting"&&(this.startupPoller.reset(),this.updateStartup(null)),this.hasConnectionFailed=!0,this.connected=!1,this.notifyStatusChange(),this.teardownSocket(),this.failPending(e),this.failWaiters(e),this.scheduleReconnect()}}notifyStatusChange(){const e=this.getConnectionStatus();if(e!==this.lastNotifiedStatus){this.lastNotifiedStatus=e;for(const t of[...this.statusHandlers])t(e)}}onMessage(e){if(typeof e!="string")return;let t;try{t=JSON.parse(e)}catch{console.warn("[browser-websocket-transport] Dropping unparseable frame");return}if(!t||typeof t!="object")return;const i=typeof t.method=="string",o=t.id!=null;if(i&&o){this.sendFrame({jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${String(t.method)}`}});return}if(o){const a=Number(t.id),d=this.pending.get(a);if(!d)return;this.pending.delete(a),clearTimeout(d.timeout),t.error?d.reject(new u(O(t.error))):d.resolve(t.result);return}if(i){const a={method:t.method,params:t.params};for(const d of[...this.notificationHandlers])d(a)}}sendFrame(e){try{this.socket?.send(JSON.stringify(e))}catch{}}scheduleReconnect(){if(this.disposed||this.reconnectTimer)return;const e=this.currentReconnectDelay;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.currentReconnectDelay=Math.min(e*2,this.maxReconnectDelayMs),this.disposed||this.connect()},e)}clearReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}clearConnectTimer(){this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null)}scheduleMonitorRecovery(e,t){this.monitorRetry||this.disposed||(this.monitorRetry=setTimeout(()=>{if(this.monitorRetry=null,!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t)for(const i of[...this.monitorReady])i()},this.reconnectDelayMs))}clearMonitorRecovery(){this.monitorRetry&&clearTimeout(this.monitorRetry),this.monitorRetry=null}teardownSocket(){this.startupPoller.stop(),this.startupSocket=null,this.reviewMonitoring=void 0,this.clearMonitorRecovery();for(const t of[...this.monitorRetirements])t();if(this.acknowledgedHello=null,this.nodeCapabilities=null,this.capabilityHelloGeneration+=1,this.protocolVersion=null,!this.socket)return;const e=this.socket;this.socket=null,e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}updateStartup(e){this.startupState=e?Object.freeze({...e}):null;for(const t of[...this.startupHandlers])t(this.startupState)}startupRefusal(){return this.startupState?new u(O(D(this.startupState))):new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})}enterStartup(e,t){if(this.hasConnectionFailed=!0,t.kind==="failed"){this.failStartup(t.message,t.snapshot);return}this.startupSocket=e,this.startupPoller.start(t),this.failWaiters(this.startupRefusal())}startupHandoff(e){const t=this.startupRefusal();if(this.teardownSocket(),this.failPending(t),this.disposed)return;this.connecting=!0,this.notifyStatusChange(),this.clearReconnect();let i=this.reconnectDelayMs;e?this.currentReconnectDelay=this.reconnectDelayMs:(i=this.currentReconnectDelay,this.currentReconnectDelay=Math.min(i*2,this.maxReconnectDelayMs)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.disposed||this.connect()},i)}failStartup(e,t){this.startupPoller.stop(),this.startupSocket=null,this.hasConnectionFailed=!0,this.updateStartup({state:"failed",snapshot:t,available:t!==null,message:e}),this.connecting=!1,this.onConnectionFailure(this.startupRefusal())}failPending(e){for(const t of this.pending.values())clearTimeout(t.timeout),t.reject(e);this.pending.clear()}flushWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.resolve(e)}failWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.reject(e)}}function He(s){return new we(s)}let A=null;const I=new Set;function De(s){A=s;for(const e of[...I])e(s)}function Ue(){return A}function Le(s){return I.add(s),A&&s(A),()=>I.delete(s)}export{u as B,Oe as M,_e as P,Ie as R,Ae as a,Ce as b,He as c,Ne as d,Pe as e,v as f,Ue as g,Ee as i,Le as o,De as r,de as s};
1
+ var j=Object.defineProperty;var V=(s,e,t)=>e in s?j(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>V(s,typeof e!="symbol"?e+"":e,t);import{f as x,j as G,p as z}from"./uXuxG9cN.js";import{u as J,o as T,_ as C,s as b,l as _,n as U}from"./CIyUrgF0.js";import{bo as $}from"./Y9-4hTF9.js";class u extends Error{constructor(t){super(t.message);n(this,"code");n(this,"data");n(this,"rpcCode");this.name="BackendError",this.code=t.code,this.data=t.data,this.rpcCode=t.rpcCode}}function Ee(s){return!s||typeof s!="object"?!1:typeof s.rpcCode=="number"}const K=-32003;function Ce(s){return!s||typeof s!="object"?!1:s.rpcCode===K}const Ae=x.refine(s=>s.repository.provider==="github"&&s.kind==="pull-request"||s.repository.provider==="gitlab"&&s.kind==="merge-request"),Oe=J([T({state:C(["available","pending","reconnect-required","restricted","disabled","unsupported","unavailable","unknown"])}),T({state:_("backoff"),retryAt:b()}),T({state:_("unresolved"),reason:C(["missing-provenance","unverified-import","invalid-target","missing-authority","unknown"]).catch("unknown")})]).catch({state:"unknown"}),_e=T({backendId:b().min(1),sessionId:b().min(1),workspaceId:b().min(1)}).strict();function v(s){return typeof s=="number"&&Number.isSafeInteger(s)&&s>=1}function Ne(s){if(s.resource||s.monitorAvailability||s.title===null||s.url===null||s.lastSnapshot===null)return!1;const e=s.lastSnapshot;return!e||!e.availability&&e.isDraft!==null&&e.hasConflicts!==null&&e.isBehind!==null&&Object.values(e.checks).every(t=>t!==null)&&e.approvals.decision!==null&&e.approvals.have!==null&&e.approvals.changesRequested!==null}const Ie=new Set(["agent.getConversation","agent.listUserMessages","agent.getMessageBlock","chat.subscribe","chat.unsubscribe"]);class Y{constructor(e,t,i,o,a,d,R){n(this,"ready");n(this,"acknowledged",!1);n(this,"closed",!1);n(this,"id",0);n(this,"pending",new Map);n(this,"listeners",new Set);n(this,"rejectReady");n(this,"timer");this.socket=e,this.currentSource=o,this.timeoutMs=a,this.onFailure=R,this.ready=new Promise((m,r)=>{this.rejectReady=r,e.onopen=()=>{if(!this.current())return this.fail();this.send("client.hello",{clientId:t,connectionRole:"review-monitor",capabilities:{reviewMonitoring:i}}).then(f=>{const c=f;if(!this.current()||c?.clientId!==t||c?.connectionRole!=="review-monitor"||!v(c?.server?.capabilities?.reviewMonitoring))return this.fail();this.acknowledged=!0,clearTimeout(this.timer),m()},()=>this.fail())}}),this.timer=setTimeout(()=>this.fail(),d),e.onerror=()=>this.fail(),e.onclose=()=>this.fail(),e.onmessage=({data:m})=>{if(!this.current()||typeof m!="string")return;let r;try{r=JSON.parse(m)}catch{return}if(!r||typeof r!="object")return;if(typeof r.method=="string"){if(r.id!=null){try{e.send(JSON.stringify({jsonrpc:"2.0",id:r.id,error:{code:-32601,message:"Method not found"}}))}catch{this.fail()}return}if(this.acknowledged)for(const c of[...this.listeners])c({method:r.method,params:r.params});return}if(typeof r.id!="number")return;const f=this.pending.get(r.id);if(f)if(this.pending.delete(r.id),clearTimeout(f.timer),r.error){const c=r.error.data,g=c&&typeof c=="object"&&"code"in c&&typeof c.code=="string"?c.code:"SERVER_ERROR";f.reject(new u({code:g,message:typeof r.error.message=="string"?r.error.message:"Monitor request failed",data:c,rpcCode:typeof r.error.code=="number"?r.error.code:void 0}))}else f.resolve(r.result)}}current(){return!this.closed&&this.currentSource()}onNotification(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,t){return!this.acknowledged||e==="client.hello"?Promise.reject(this.unavailable()):this.send(e,t)}close(){if(this.closed)return;this.closed=!0,this.acknowledged=!1,clearTimeout(this.timer);const e=this.unavailable();this.rejectReady(e);for(const t of this.pending.values())clearTimeout(t.timer),t.reject(e);this.pending.clear(),this.listeners.clear(),this.socket.onopen=this.socket.onmessage=this.socket.onerror=this.socket.onclose=null;try{this.socket.close()}catch{}}fail(){this.closed||(this.close(),this.onFailure())}unavailable(){return new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor attachment unavailable"})}send(e,t){if(!this.current())return Promise.reject(this.unavailable());const i=++this.id;return new Promise((o,a)=>{const d=setTimeout(()=>{this.pending.delete(i),a(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`}))},this.timeoutMs);this.pending.set(i,{resolve:o,reject:a,timer:d});try{this.socket.send(JSON.stringify({jsonrpc:"2.0",id:i,method:e,params:t}))}catch{this.fail()}})}}const X=["agentNodes","localNodeIsolation","agentPlatformRouting","workspaceMembershipEvents","rawScreenshotRetention","chiefAttachments","noteTruncatedRead","remoteMachines","remoteInitialAgent","remoteMachineClaim","machineOrder","remoteLinkTraffic","cloudMachines","cloudMachineEntries","cloudMachineProviders"];function Q(s){return Object.freeze(Object.fromEntries(X.map(e=>[e,s?.[e]===1?1:0])))}function Z(s){if(!G(s,11,1))throw new Error($.files_secondaryRoot_unsupported_error())}function ee(s,e,t){te(s,e)&&Z(t)}function te(s,e){if(s!=="file.read"&&s!=="file.readChunk")return!1;const t=e?.gitRootId;return typeof t=="string"&&!!t.trim()}const N=-32012,se="system.startupStatus",ne=1e3,L=1e3,F=3e4,w=U().int().nonnegative().max(Number.MAX_SAFE_INTEGER),ie=T({completedNotes:w,totalNotes:w,processedSourceBytes:w,totalSourceBytes:w}).refine(s=>s.completedNotes<=s.totalNotes&&s.processedSourceBytes<=s.totalSourceBytes),oe=T({startupStatus:_(1),daemonVersion:b().min(1).optional(),attemptId:b().min(1),phase:C(["preparing","indexing","finalizing","ready","failed"]),elapsedMs:w,phaseElapsedMs:w,progressAgeMs:w,retryAfterMs:U().int().min(L).max(F).optional(),progress:ie.optional(),estimatedRemainingMs:w.optional(),finalizingStep:C(["anchors","committing","services"]).optional(),failure:T({code:b().min(1),message:b().min(1)}).optional()}).refine(s=>(s.phase==="ready"||s.phase==="failed"?s.retryAfterMs===void 0:s.retryAfterMs!==void 0)&&(s.phase==="finalizing"?s.finalizingStep!==void 0:s.finalizingStep===void 0)&&(s.phase==="failed"?s.failure!==void 0:s.failure===void 0)&&(s.estimatedRemainingMs===void 0||s.phase==="indexing"));function B(s){const e=oe.safeParse(s);return e.success?e.data:null}function P(s){const e=typeof s=="number"&&Number.isFinite(s)?s:ne;return Math.min(F,Math.max(L,e))}function re(s){const e=s;return typeof e.rpcCode=="number"?e.rpcCode:typeof e.code=="number"?e.code:void 0}function q(s){if(!s||typeof s!="object"||re(s)!==N)return;const e=s.data??{},t=B(e.startup);if(e.code==="daemon-startup-failed"){const i=e.startup?.failure?.message,o=s.message;return{kind:"failed",message:typeof i=="string"&&i.trim()?i:typeof o=="string"?o:"",snapshot:t}}if(!(e.code!=="daemon-not-ready"||e.retryable!==!0))return{kind:"not-ready",retryAfterMs:P(e.retryAfterMs),snapshot:t}}function D(s){const e=s.snapshot??void 0;return s.state==="failed"?{code:N,message:"Daemon startup failed",data:{code:"daemon-startup-failed",retryable:!1,startup:e}}:{code:N,message:"Daemon not ready",data:{code:"daemon-not-ready",retryable:!0,retryAfterMs:P(e?.retryAfterMs),startup:e}}}const ae=5e3,ce=5e3,le=3e4;function he(s){const e=s.snapshot;return JSON.stringify([s.state,s.available,e?.attemptId,e?.phase,e?.finalizingStep,e?.progress?.completedNotes,e?.progress?.totalNotes,e?.estimatedRemainingMs===void 0,(e?.progressAgeMs??0)>=le])}class ue{constructor(e){n(this,"generation",0);n(this,"timer",null);n(this,"snapshot",null);n(this,"lastKey",null);n(this,"lastPublishedAt",0);this.host=e}start(e){this.stop(),this.snapshot=e.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:e.snapshot!==null},!0),this.schedule(e.retryAfterMs)}stop(){this.generation++,this.timer&&(clearTimeout(this.timer),this.timer=null)}reset(){this.stop(),this.snapshot=null,this.lastKey=null,this.lastPublishedAt=0}publish(e,t=!1){const i=he(e),o=Date.now();!t&&i===this.lastKey&&o-this.lastPublishedAt<ce||(this.lastKey=i,this.lastPublishedAt=o,this.host.publish(e))}schedule(e){const t=this.generation;this.timer=setTimeout(()=>{if(this.timer=null,t!==this.generation)return;const i=()=>this.poll(t);this.host.track?this.host.track(i):i()},e)}async poll(e){let t;try{t=B(await this.host.request())}catch(i){if(e!==this.generation)return;const o=q(i);if(o?.kind==="failed"){this.stop(),this.host.fail(o.message,o.snapshot);return}if(o?.kind==="not-ready"){this.snapshot=o.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:o.snapshot!==null}),this.schedule(o.retryAfterMs);return}this.unavailable();return}if(e===this.generation){if(t===null){this.unavailable();return}if(this.snapshot=t,t.phase==="failed"){this.stop(),this.host.fail(t.failure?.message??"",t);return}if(t.phase==="ready"){this.stop(),this.publish({state:"starting",snapshot:t,available:!0},!0),this.host.handoff(!0);return}this.publish({state:"starting",snapshot:t,available:!0}),this.schedule(P(t.retryAfterMs))}}unavailable(){this.stop(),this.publish({state:"starting",snapshot:this.snapshot,available:!1},!0),this.host.handoff(!1)}}function Pe(s=(()=>{const e=globalThis.__INTENT_RUNTIME_CONFIG__;return e?.intentdWsUrl!==void 0?e.intentdWsUrl:typeof process>"u"?void 0:""})()){if(typeof s!="string")return;const e=s.trim();if(!e)return;if(e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\")){const o=globalThis.location;if(o?.host&&(o.protocol==="http:"||o.protocol==="https:"))return`${o.protocol==="https:"?"wss:":"ws:"}//${o.host}${e}`;console.warn("[browser-websocket-transport] Ignoring same-origin WebSocket path without an HTTP page origin");return}let t;try{t=new URL(e)}catch{console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}if(t.protocol!=="ws:"&&t.protocol!=="wss:"){console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}const i=t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol==="ws:"&&!i){console.warn("[browser-websocket-transport] Ignoring insecure remote WebSocket URL: use wss://");return}return e}function de(s){try{const e=new URL(s);return e.username="",e.password="",e.search="",e.hash="",e.toString()}catch{return s.replace(/[?#].*$/,"").replace(/^([a-z][a-z0-9+.-]*:\/\/)[^/]*@/i,"$1")}}const fe={[-32700]:"PARSE_ERROR",[-32600]:"INVALID_REQUEST",[-32601]:"METHOD_NOT_FOUND",[-32602]:"INVALID_PARAMS",[-32603]:"INTERNAL_ERROR"};function pe(s){const e=fe[s];return e||(s<=-32e3&&s>=-32099?"SERVER_ERROR":"UNKNOWN_ERROR")}function me(s){if(s&&typeof s=="object"&&"code"in s){const e=s.code;if(typeof e=="string"&&e.length>0)return e}}function O(s){const e=me(s.data)??pe(s.code),t=s.data&&typeof s.data=="object"?{...s.data,code:e}:typeof s.data=="string"&&s.data.length>0?{code:e,detail:s.data}:{code:e};return{code:e,message:s.message,data:t,rpcCode:s.code}}function E(s){if(s instanceof u)return s;const e=s instanceof Error?s.message:String(s);return new u({code:"TRANSPORT_ERROR",message:e,data:{code:"TRANSPORT_ERROR"}})}const ge=3e4,Re=1e3,ye=3e4,Se=1e4,be=5e3;class we{constructor(e){n(this,"url");n(this,"webSocketFactory");n(this,"requestTimeoutMs");n(this,"reconnectDelayMs");n(this,"maxReconnectDelayMs");n(this,"connectTimeoutMs");n(this,"socket",null);n(this,"connected",!1);n(this,"connecting",!1);n(this,"disposed",!1);n(this,"requestId",0);n(this,"currentReconnectDelay");n(this,"reconnectTimer",null);n(this,"connectTimer",null);n(this,"connectWaiters",[]);n(this,"clientId");n(this,"helloConfirmed",!1);n(this,"acknowledgedHello",null);n(this,"nodeCapabilities",null);n(this,"capabilityHelloGeneration",0);n(this,"reviewMonitoring");n(this,"reviewMonitoringRecipient");n(this,"reviewMonitoringEnabled",!1);n(this,"ordinaryHello",!1);n(this,"monitorRetry",null);n(this,"monitorRetirements",new Set);n(this,"monitorReady",new Set);n(this,"protocolVersion",null);n(this,"helloError",new u({code:"UNAVAILABLE",message:"client.hello has not completed on this connection"}));n(this,"pending",new Map);n(this,"hasBeenConnected",!1);n(this,"hasConnectionFailed",!1);n(this,"notificationHandlers",new Set);n(this,"reconnectedHandlers",new Set);n(this,"statusHandlers",new Set);n(this,"lastNotifiedStatus","disconnected");n(this,"startupState",null);n(this,"startupSocket",null);n(this,"startupPoller",new ue({request:()=>{const e=this.startupSocket;return e?this.requestOnSocket(se,void 0,{timeoutMs:ae},e):Promise.reject(this.startupRefusal())},publish:e=>this.updateStartup(e),handoff:e=>this.startupHandoff(e),fail:(e,t)=>this.failStartup(e,t)}));n(this,"startupHandlers",new Set);this.reviewMonitoringEnabled=v(e.reviewMonitoring),this.reviewMonitoringRecipient=v(e.reviewMonitoring)?e.reviewMonitoring:void 0,this.url=e.url,this.webSocketFactory=e.webSocketFactory??(t=>new WebSocket(t)),this.requestTimeoutMs=e.requestTimeoutMs??ge,this.reconnectDelayMs=e.reconnectDelayMs??Re,this.maxReconnectDelayMs=e.maxReconnectDelayMs??ye,this.connectTimeoutMs=e.connectTimeoutMs??Se,this.currentReconnectDelay=this.reconnectDelayMs}isAvailable(){return!this.disposed}async readPrincipal(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected(),t=this.capabilityHelloGeneration,i=structuredClone(this.acknowledgedHello),o=()=>!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t&&this.acknowledgedHello!==null;if(!o())throw this.helloError;const a=await this.requestOnSocket("principal.me",{},void 0,e);if(!o())throw new u({code:"UNAVAILABLE",message:"Principal discovery connection changed"});return{hello:i,principal:a}}async observeNodeCapabilities(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected();if(this.disposed||!this.connected||this.socket!==e)throw new u({code:"UNAVAILABLE",message:"Backend connection changed"});return{server:{capabilities:this.nodeCapabilities}}}onMonitorReconnected(e){this.monitorReady.add(e);const t=this.onReconnected(e);return()=>{this.monitorReady.delete(e),t()}}prMonitorBackendId(){return de(this.url)}async capturePrMonitorSession(e){const t=await this.ensureConnected(),i=this.capabilityHelloGeneration,o=()=>new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor connection unavailable"});let a,d=!1;const R=new Set,m=new Set,r=()=>{if(!d){d=!0,this.monitorRetirements.delete(r),a?.close();for(const l of R)l();R.clear()}},f=()=>!d&&!this.disposed&&this.connected&&this.helloConfirmed&&this.socket===t&&i===this.capabilityHelloGeneration,c=()=>f()&&(!a||a.current());if(!c())throw o();this.monitorRetirements.add(r);const g=v(this.reviewMonitoring);let M=g?"consumer-pending":"unsupported";if(g&&this.reviewMonitoringEnabled&&this.ordinaryHello&&this.clientId)try{if(a=new Y(this.webSocketFactory(this.url),this.clientId,Math.min(this.reviewMonitoringRecipient,this.reviewMonitoring),f,this.requestTimeoutMs,this.connectTimeoutMs,()=>{const l=f();r(),l&&this.scheduleMonitorRecovery(t,i)}),await a.ready,!c())throw o();M="supported"}catch(l){const p=f();throw r(),p&&this.scheduleMonitorRecovery(t,i),l}const y=(l,p)=>a?a.request(l,p):this.requestOnSocket(l,p,void 0,t);return{origin:{backendId:this.prMonitorBackendId(),sessionId:crypto.randomUUID(),workspaceId:e},support:M,onRetired(l){return c()?(R.add(l),()=>{R.delete(l)}):(l(),()=>{})},onNotification:l=>(a??this).onNotification(p=>{c()&&l(p)}),request:async(l,p)=>{if(!c()||M==="consumer-pending"||p.workspaceId!==e)throw o();const k=await y(l,p),h=l==="events.subscribe"?k?.subscriptionId:void 0;if(!c())throw h&&this.socket===t&&this.connected&&i===this.capabilityHelloGeneration&&y("events.unsubscribe",{workspaceId:e,subscriptionId:h}).catch(()=>{}),o();return h&&m.add(h),l==="events.unsubscribe"&&m.delete(String(p.subscriptionId)),k},release:async()=>{const l=c();r(),l&&!a&&await Promise.all([...m].map(p=>this.requestOnSocket("events.unsubscribe",{workspaceId:e,subscriptionId:p},void 0,t).catch(()=>{})))}}}request(e,t,i){return this.requestOnSocket(e,t,i)}requestOnSocket(e,t,i,o){if(i?.localMachine)return Promise.reject(new u({code:"UNAVAILABLE",message:"Local machine requests require the desktop bridge"}));if(this.disposed)return Promise.reject(new u({code:"UNAVAILABLE",message:"Backend transport disposed"}));if(!o&&this.startupState?.state==="starting")return Promise.reject(new u(O(D(this.startupState))));const a=++this.requestId,d=i?.timeoutMs,R=typeof d=="number"&&Number.isFinite(d)&&d>0?d:this.requestTimeoutMs;return new Promise((m,r)=>{let f=!1;const c=setTimeout(()=>{f=!0,this.pending.delete(a),r(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`,data:{code:"TIMEOUT"}}))},R),g=y=>{clearTimeout(c),r(E(y))},M=y=>{if(f)return;if(this.disposed||this.socket!==y){g(new u({code:"TRANSPORT_ERROR",message:"Connection replaced"}));return}if(e==="presence.update"&&!this.helloConfirmed){g(this.helloError);return}try{ee(e,t,this.protocolVersion)}catch(h){g(h);return}let l=e==="client.hello"&&this.clientId?{clientId:this.clientId,...t}:t;if(e==="client.hello"){const h={...l},S={...h.capabilities};Object.prototype.hasOwnProperty.call(S,"reviewMonitoring")&&(this.reviewMonitoringEnabled=this.reviewMonitoringRecipient!==void 0&&v(S.reviewMonitoring)),delete S.reviewMonitoring,delete h.connectionRole,h.capabilities!==void 0&&(h.capabilities=S),l=h}const p=JSON.stringify({jsonrpc:"2.0",id:a,method:e,params:l}),k=e==="client.hello"?++this.capabilityHelloGeneration:0;if(e==="client.hello"){this.helloConfirmed=!1,this.ordinaryHello=!1,this.clearMonitorRecovery(),this.nodeCapabilities=null,this.reviewMonitoring=void 0;for(const h of[...this.monitorRetirements])h();this.acknowledgedHello=null}this.pending.set(a,{method:e,timeout:c,resolve:h=>{if(e==="client.hello"&&this.socket===y&&k===this.capabilityHelloGeneration){const S=h?.clientId;if(typeof S=="string"&&S.length>0){const H=h.server?.capabilities;if(this.clientId=S,this.reviewMonitoring=H?.reviewMonitoring,this.ordinaryHello=h.connectionRole===void 0,this.acknowledgedHello=structuredClone(h),this.nodeCapabilities=Q(H),this.protocolVersion=z(h.protocolVersion),this.helloConfirmed=!0,this.connected)for(const W of this.monitorReady)W()}}m(h)},reject:r});try{y.send(p)}catch(h){clearTimeout(c),this.pending.delete(a),r(E(h))}};o?M(o):this.connected&&this.socket?M(this.socket):this.ensureConnected().then(M,g)})}async subscribe(e){return this.request("events.subscribe",e)}async unsubscribe(e,t){try{await this.request("events.unsubscribe",{subscriptionId:e,...t!==void 0?{workspaceId:t}:{}})}catch{}}onNotification(e){return this.notificationHandlers.add(e),()=>this.notificationHandlers.delete(e)}onReconnected(e){return this.reconnectedHandlers.add(e),()=>this.reconnectedHandlers.delete(e)}getConnectionStatus(){return this.connected?"connected":this.connecting?"connecting":"disconnected"}getStartupState(){return this.startupState}onStartupChange(e){return this.startupHandlers.add(e),()=>this.startupHandlers.delete(e)}onConnectionStatusChange(e){return this.statusHandlers.add(e),()=>this.statusHandlers.delete(e)}dispose(){if(this.disposed)return;this.disposed=!0,this.clearReconnect(),this.clearConnectTimer();const e=new u({code:"UNAVAILABLE",message:"Backend transport disposed"});this.failPending(e),this.failWaiters(e),this.teardownSocket(),this.connected=!1,this.connecting=!1,this.notifyStatusChange(),this.notificationHandlers.clear(),this.reconnectedHandlers.clear(),this.statusHandlers.clear(),this.startupHandlers.clear()}ensureConnected(){return this.connected&&this.socket?Promise.resolve(this.socket):new Promise((e,t)=>{this.connectWaiters.push({resolve:e,reject:t}),this.start()})}start(){this.disposed||this.socket||this.connecting||this.reconnectTimer||this.connect()}connect(){this.clearReconnect(),this.connecting=!0,this.notifyStatusChange();let e;try{e=this.webSocketFactory(this.url)}catch(t){this.connecting=!1,this.onConnectionFailure(E(t));return}this.socket=e,this.helloConfirmed=!1,this.connectTimer=setTimeout(()=>{this.connectTimer=null,!(this.socket!==e||this.connected)&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:`WebSocket connect attempt timed out after ${this.connectTimeoutMs}ms`})))},this.connectTimeoutMs),e.onopen=()=>{this.socket===e&&this.onConnected(e)},e.onmessage=t=>{this.socket===e&&this.onMessage(t.data)},e.onerror=null,e.onclose=()=>{this.socket===e&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})))}}onConnected(e){this.clearConnectTimer(),this.performHelloHandshake(e)}async performHelloHandshake(e){try{await this.requestOnSocket("client.hello",{},{timeoutMs:Math.min(this.requestTimeoutMs,be)},e)}catch(o){if(this.disposed||this.socket!==e)return;const a=q(o);if(a){this.enterStartup(e,a);return}this.helloError=E(o)}if(this.disposed||this.socket!==e)return;this.startupPoller.reset(),this.startupSocket=null;const t=this.startupState!==null;this.startupState=null,this.connecting=!1,this.connected=!0,this.currentReconnectDelay=this.reconnectDelayMs;const i=this.hasBeenConnected||this.hasConnectionFailed;if(this.hasBeenConnected=!0,this.hasConnectionFailed=!1,this.notifyStatusChange(),t)for(const o of[...this.startupHandlers])o(null);if(this.flushWaiters(e),i)for(const o of[...this.reconnectedHandlers])o()}onConnectionFailure(e){if(this.clearConnectTimer(),!this.disposed){if(this.startupSocket!==null&&this.startupSocket===this.socket){this.startupHandoff(!0);return}this.startupState?.state==="starting"&&(this.startupPoller.reset(),this.updateStartup(null)),this.hasConnectionFailed=!0,this.connected=!1,this.notifyStatusChange(),this.teardownSocket(),this.failPending(e),this.failWaiters(e),this.scheduleReconnect()}}notifyStatusChange(){const e=this.getConnectionStatus();if(e!==this.lastNotifiedStatus){this.lastNotifiedStatus=e;for(const t of[...this.statusHandlers])t(e)}}onMessage(e){if(typeof e!="string")return;let t;try{t=JSON.parse(e)}catch{console.warn("[browser-websocket-transport] Dropping unparseable frame");return}if(!t||typeof t!="object")return;const i=typeof t.method=="string",o=t.id!=null;if(i&&o){this.sendFrame({jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${String(t.method)}`}});return}if(o){const a=Number(t.id),d=this.pending.get(a);if(!d)return;this.pending.delete(a),clearTimeout(d.timeout),t.error?d.reject(new u(O(t.error))):d.resolve(t.result);return}if(i){const a={method:t.method,params:t.params};for(const d of[...this.notificationHandlers])d(a)}}sendFrame(e){try{this.socket?.send(JSON.stringify(e))}catch{}}scheduleReconnect(){if(this.disposed||this.reconnectTimer)return;const e=this.currentReconnectDelay;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.currentReconnectDelay=Math.min(e*2,this.maxReconnectDelayMs),this.disposed||this.connect()},e)}clearReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}clearConnectTimer(){this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null)}scheduleMonitorRecovery(e,t){this.monitorRetry||this.disposed||(this.monitorRetry=setTimeout(()=>{if(this.monitorRetry=null,!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t)for(const i of[...this.monitorReady])i()},this.reconnectDelayMs))}clearMonitorRecovery(){this.monitorRetry&&clearTimeout(this.monitorRetry),this.monitorRetry=null}teardownSocket(){this.startupPoller.stop(),this.startupSocket=null,this.reviewMonitoring=void 0,this.clearMonitorRecovery();for(const t of[...this.monitorRetirements])t();if(this.acknowledgedHello=null,this.nodeCapabilities=null,this.capabilityHelloGeneration+=1,this.protocolVersion=null,!this.socket)return;const e=this.socket;this.socket=null,e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}updateStartup(e){this.startupState=e?Object.freeze({...e}):null;for(const t of[...this.startupHandlers])t(this.startupState)}startupRefusal(){return this.startupState?new u(O(D(this.startupState))):new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})}enterStartup(e,t){if(this.hasConnectionFailed=!0,t.kind==="failed"){this.failStartup(t.message,t.snapshot);return}this.startupSocket=e,this.startupPoller.start(t),this.failWaiters(this.startupRefusal())}startupHandoff(e){const t=this.startupRefusal();if(this.teardownSocket(),this.failPending(t),this.disposed)return;this.connecting=!0,this.notifyStatusChange(),this.clearReconnect();let i=this.reconnectDelayMs;e?this.currentReconnectDelay=this.reconnectDelayMs:(i=this.currentReconnectDelay,this.currentReconnectDelay=Math.min(i*2,this.maxReconnectDelayMs)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.disposed||this.connect()},i)}failStartup(e,t){this.startupPoller.stop(),this.startupSocket=null,this.hasConnectionFailed=!0,this.updateStartup({state:"failed",snapshot:t,available:t!==null,message:e}),this.connecting=!1,this.onConnectionFailure(this.startupRefusal())}failPending(e){for(const t of this.pending.values())clearTimeout(t.timeout),t.reject(e);this.pending.clear()}flushWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.resolve(e)}failWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.reject(e)}}function He(s){return new we(s)}let A=null;const I=new Set;function De(s){A=s;for(const e of[...I])e(s)}function Ue(){return A}function Le(s){return I.add(s),A&&s(A),()=>I.delete(s)}export{u as B,Oe as M,_e as P,Ie as R,Ae as a,Ce as b,He as c,Ne as d,Pe as e,v as f,Ue as g,Ee as i,Le as o,De as r,de as s};
@@ -1 +1 @@
1
- import{a as S}from"./BdWqymET.js";import{aE as g}from"./DYhIMPy1.js";import{g as c}from"./L1oXncPn.js";import{p as l}from"./DFBU68gv.js";import{d as I}from"./B0Z-1lwJ.js";import{dC as f}from"./BB4FgpiZ.js";import{By as u,g as y,Iz as o,gR as A,v0 as m,v1 as N,v3 as b}from"./C4xNNtUj.js";import{g as W,n as h}from"./DRG7DUhO.js";import{S as D,a as R,n as E}from"./Cp8bbNVk.js";import{n as O,o as v}from"./DRpIoF9f.js";const k="intent:onboarding-skip:v1";function P(e){return u.getItem(h(k,e))==="1"}function re(e){P(e)||u.setItem(h(k,e),"1")}function _(e){return e.connections?.hasReceivedList===!0&&P(W(e))}function F(e,a){return e.some(t=>t.id!==y&&t.id!==a&&t.status!=="Archived"&&t.status!=="Deleted")}function j(e,a,t=!1){return t||F(e,a)?"/":"/workspace/new"}function d(e,a){return j(f.select(e),a,_(e))}const se=Object.freeze(Object.defineProperty({__proto__:null,resolveWindowEmptyDestination:d},Symbol.toStringTag,{value:"Module"})),r=new S("WorkspaceNavigation");async function L(e){r.info(`[navigateToAgent] Navigating to agent: ${e}`);const t=g(l).params.id;if(!t){r.error("[navigateToAgent] No workspace ID found in current page params");return}const n=new URL(window.location.href);n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","agent"),n.searchParams.set("selectedAgent",e),n.searchParams.delete("selectedTerminal"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"agent",e))}async function C(e){r.info(`[navigateToTerminal] Navigating to terminal: ${e}`);const t=g(l).params.id;if(!t){r.error("[navigateToTerminal] No workspace ID found in current page params");return}const n=new URL(window.location.href),i=n.searchParams.get("drawerOpen")==="1",s=n.searchParams.get("drawerType")==="terminal";(!i||!s)&&n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","terminal"),n.searchParams.set("selectedTerminal",e),n.searchParams.delete("selectedAgent"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"terminal",e))}function $(e){return!e||!(e instanceof Element)?void 0:e.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0}async function p(e,a){r.info(`[navigateToNote] Navigating to note: ${e}`,a);const t=g(l),n=a?.workspaceId??t.params.id;if(!n){r.error("[navigateToNote] No workspace ID found in current page params");return}o.dispatch(b(n,e,{openInAdjacentPanel:a?.openInAdjacentPanel??!1,openInNewAdjacentPanel:a?.openInNewAdjacentPanel??!1,sourcePanelId:a?.sourcePanelId}))}async function U(e,a,t){r.info(`[navigateToFile] Navigating to file: ${e}${a?` (line ${a})`:""}`,t);const i=g(l).params.id;if(!i){r.error("[navigateToFile] No workspace ID found in current page params");return}o.dispatch(N(i,e,{line:a,openInAdjacentPanel:t?.openInAdjacentPanel??!1,sourcePanelId:t?.sourcePanelId}))}async function B(){r.info("[navigateToSpec] Navigating to workspace spec"),await p("spec")}async function M(){r.info("[closeDrawer] Closing drawer");const a=g(l).params.id;if(!a){r.error("[closeDrawer] No workspace ID found in current page params");return}const t=new URL(window.location.href);t.searchParams.set("drawerOpen","0"),t.searchParams.delete("selectedAgent"),t.searchParams.delete("selectedTerminal"),await c(t.toString(),{replaceState:!0}),o.dispatch(A(a))}async function K(){r.info("[clearMainContent] Clearing main content");const e=new URL(window.location.href);e.searchParams.set("mainContentType","empty"),e.searchParams.delete("selectedNoteId"),e.searchParams.delete("selectedFile"),e.searchParams.delete("line"),await c(e.toString(),{replaceState:!1})}async function z(e,a,t){r.info("[navigateToTask] Navigating to task",{noteId:e,taskPosition:a,taskText:t}),await p(e);const n=()=>{I("scroll-to-task",{noteId:e,taskPosition:a,taskText:t},{bubbles:!0}),r.debug("[navigateToTask] Dispatched scroll-to-task event",{noteId:e,taskPosition:a})},i=[100,300,600];for(const s of i)setTimeout(n,s)}async function G(e){r.info("[navigateToSettings] Navigating to settings",e);const a=new URL("/settings",window.location.origin),t=window.location.pathname.match(/^\/workspace\/([^/]+)/)?.[1],n=t==="new"?void 0:t,i=e?.workspaceId??n;if(e?.tab&&a.searchParams.set("tab",e.tab),e?.specialist&&a.searchParams.set("specialist",e.specialist),e?.view&&a.searchParams.set("view",e.view),i&&a.searchParams.set("workspaceId",i),e?.hash&&(a.hash=e.hash),typeof window<"u"&&window.location.pathname==="/settings"){if(e?.tab||e?.specialist||e?.view||e?.workspaceId){const s=new URL(window.location.href);e?.tab&&s.searchParams.set("tab",e.tab),e?.specialist&&s.searchParams.set("specialist",e.specialist),e?.view&&s.searchParams.set("view",e.view),e?.workspaceId&&s.searchParams.set("workspaceId",e.workspaceId),e?.hash&&(s.hash=e.hash),await c(s.toString(),{replaceState:!0});return}if(e?.hash){const s=`#${e.hash}`;window.location.hash===s&&(window.location.hash=""),window.location.hash=s;return}return}await E(a.pathname+a.search+a.hash)}function T(){const e=typeof sessionStorage>"u"?null:sessionStorage.getItem(D);if(e&&e!=="/"&&!R(e))return e;const a=w();return a?`/workspace/${a.id}`:d(o.state)}async function H(){const e=T();r.info("[navigateBackFromSettings] Navigating back to:",e),await O(e)}function w(e){return f.select(o.state).find(a=>a.id!==e&&a.status!=="Archived"&&a.status!=="Deleted")}async function Y(){const e=w();if(e){r.info("[navigateToFirstWorkspace] Showing workspace:",e.id),await v(e.id);return}const a=d(o.state);r.info("[navigateToFirstWorkspace] Navigating to:",a),await c(a)}async function V(e){const a=w(e);if(a){r.info("[navigateAfterWorkspaceRemoval] Showing workspace:",a.id),await v(a.id);return}const t=d(o.state,e);r.info("[navigateAfterWorkspaceRemoval] Navigating to:",t),await c(t)}const ie=Object.freeze(Object.defineProperty({__proto__:null,clearMainContent:K,closeDrawer:M,findSourcePanelId:$,getSettingsPreviousPath:T,navigateAfterWorkspaceRemoval:V,navigateBackFromSettings:H,navigateToAgent:L,navigateToFile:U,navigateToFirstWorkspace:Y,navigateToNote:p,navigateToSettings:G,navigateToSpec:B,navigateToTask:z,navigateToTerminal:C},Symbol.toStringTag,{value:"Module"}));export{U as a,Y as b,p as c,G as d,z as e,$ as f,d as g,ie as h,_ as i,H as n,re as r,se as w};
1
+ import{a as S}from"./BdWqymET.js";import{aE as g}from"./DYhIMPy1.js";import{g as c}from"./BT9wQ0Ce.js";import{p as l}from"./2rbh16KP.js";import{d as I}from"./B0Z-1lwJ.js";import{dC as f}from"./ClH0Gega.js";import{By as u,g as y,Iz as o,gR as A,v0 as m,v1 as N,v3 as b}from"./tU_ZJtMw.js";import{g as W,n as h}from"./D-l6NLYy.js";import{S as D,a as R,n as E}from"./DjLQeEnc.js";import{n as O,o as v}from"./CVXxjkW7.js";const k="intent:onboarding-skip:v1";function P(e){return u.getItem(h(k,e))==="1"}function re(e){P(e)||u.setItem(h(k,e),"1")}function _(e){return e.connections?.hasReceivedList===!0&&P(W(e))}function F(e,a){return e.some(t=>t.id!==y&&t.id!==a&&t.status!=="Archived"&&t.status!=="Deleted")}function j(e,a,t=!1){return t||F(e,a)?"/":"/workspace/new"}function d(e,a){return j(f.select(e),a,_(e))}const se=Object.freeze(Object.defineProperty({__proto__:null,resolveWindowEmptyDestination:d},Symbol.toStringTag,{value:"Module"})),r=new S("WorkspaceNavigation");async function L(e){r.info(`[navigateToAgent] Navigating to agent: ${e}`);const t=g(l).params.id;if(!t){r.error("[navigateToAgent] No workspace ID found in current page params");return}const n=new URL(window.location.href);n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","agent"),n.searchParams.set("selectedAgent",e),n.searchParams.delete("selectedTerminal"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"agent",e))}async function C(e){r.info(`[navigateToTerminal] Navigating to terminal: ${e}`);const t=g(l).params.id;if(!t){r.error("[navigateToTerminal] No workspace ID found in current page params");return}const n=new URL(window.location.href),i=n.searchParams.get("drawerOpen")==="1",s=n.searchParams.get("drawerType")==="terminal";(!i||!s)&&n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","terminal"),n.searchParams.set("selectedTerminal",e),n.searchParams.delete("selectedAgent"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"terminal",e))}function $(e){return!e||!(e instanceof Element)?void 0:e.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0}async function p(e,a){r.info(`[navigateToNote] Navigating to note: ${e}`,a);const t=g(l),n=a?.workspaceId??t.params.id;if(!n){r.error("[navigateToNote] No workspace ID found in current page params");return}o.dispatch(b(n,e,{openInAdjacentPanel:a?.openInAdjacentPanel??!1,openInNewAdjacentPanel:a?.openInNewAdjacentPanel??!1,sourcePanelId:a?.sourcePanelId}))}async function U(e,a,t){r.info(`[navigateToFile] Navigating to file: ${e}${a?` (line ${a})`:""}`,t);const i=g(l).params.id;if(!i){r.error("[navigateToFile] No workspace ID found in current page params");return}o.dispatch(N(i,e,{line:a,openInAdjacentPanel:t?.openInAdjacentPanel??!1,sourcePanelId:t?.sourcePanelId}))}async function B(){r.info("[navigateToSpec] Navigating to workspace spec"),await p("spec")}async function M(){r.info("[closeDrawer] Closing drawer");const a=g(l).params.id;if(!a){r.error("[closeDrawer] No workspace ID found in current page params");return}const t=new URL(window.location.href);t.searchParams.set("drawerOpen","0"),t.searchParams.delete("selectedAgent"),t.searchParams.delete("selectedTerminal"),await c(t.toString(),{replaceState:!0}),o.dispatch(A(a))}async function K(){r.info("[clearMainContent] Clearing main content");const e=new URL(window.location.href);e.searchParams.set("mainContentType","empty"),e.searchParams.delete("selectedNoteId"),e.searchParams.delete("selectedFile"),e.searchParams.delete("line"),await c(e.toString(),{replaceState:!1})}async function z(e,a,t){r.info("[navigateToTask] Navigating to task",{noteId:e,taskPosition:a,taskText:t}),await p(e);const n=()=>{I("scroll-to-task",{noteId:e,taskPosition:a,taskText:t},{bubbles:!0}),r.debug("[navigateToTask] Dispatched scroll-to-task event",{noteId:e,taskPosition:a})},i=[100,300,600];for(const s of i)setTimeout(n,s)}async function G(e){r.info("[navigateToSettings] Navigating to settings",e);const a=new URL("/settings",window.location.origin),t=window.location.pathname.match(/^\/workspace\/([^/]+)/)?.[1],n=t==="new"?void 0:t,i=e?.workspaceId??n;if(e?.tab&&a.searchParams.set("tab",e.tab),e?.specialist&&a.searchParams.set("specialist",e.specialist),e?.view&&a.searchParams.set("view",e.view),i&&a.searchParams.set("workspaceId",i),e?.hash&&(a.hash=e.hash),typeof window<"u"&&window.location.pathname==="/settings"){if(e?.tab||e?.specialist||e?.view||e?.workspaceId){const s=new URL(window.location.href);e?.tab&&s.searchParams.set("tab",e.tab),e?.specialist&&s.searchParams.set("specialist",e.specialist),e?.view&&s.searchParams.set("view",e.view),e?.workspaceId&&s.searchParams.set("workspaceId",e.workspaceId),e?.hash&&(s.hash=e.hash),await c(s.toString(),{replaceState:!0});return}if(e?.hash){const s=`#${e.hash}`;window.location.hash===s&&(window.location.hash=""),window.location.hash=s;return}return}await E(a.pathname+a.search+a.hash)}function T(){const e=typeof sessionStorage>"u"?null:sessionStorage.getItem(D);if(e&&e!=="/"&&!R(e))return e;const a=w();return a?`/workspace/${a.id}`:d(o.state)}async function H(){const e=T();r.info("[navigateBackFromSettings] Navigating back to:",e),await O(e)}function w(e){return f.select(o.state).find(a=>a.id!==e&&a.status!=="Archived"&&a.status!=="Deleted")}async function Y(){const e=w();if(e){r.info("[navigateToFirstWorkspace] Showing workspace:",e.id),await v(e.id);return}const a=d(o.state);r.info("[navigateToFirstWorkspace] Navigating to:",a),await c(a)}async function V(e){const a=w(e);if(a){r.info("[navigateAfterWorkspaceRemoval] Showing workspace:",a.id),await v(a.id);return}const t=d(o.state,e);r.info("[navigateAfterWorkspaceRemoval] Navigating to:",t),await c(t)}const ie=Object.freeze(Object.defineProperty({__proto__:null,clearMainContent:K,closeDrawer:M,findSourcePanelId:$,getSettingsPreviousPath:T,navigateAfterWorkspaceRemoval:V,navigateBackFromSettings:H,navigateToAgent:L,navigateToFile:U,navigateToFirstWorkspace:Y,navigateToNote:p,navigateToSettings:G,navigateToSpec:B,navigateToTask:z,navigateToTerminal:C},Symbol.toStringTag,{value:"Module"}));export{U as a,Y as b,p as c,G as d,z as e,$ as f,d as g,ie as h,_ as i,H as n,re as r,se as w};