@intent-hq/web 2.386.0 → 2.387.1

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 (325) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{DfgH7-YK.js → -hGB5JIm.js} +1 -1
  3. package/web/app/immutable/chunks/{D5xlMOwU.js → 0Kw0mmSW.js} +1 -1
  4. package/web/app/immutable/chunks/{Pyf1FzKM.js → 2S2jdRaL.js} +1 -1
  5. package/web/app/immutable/chunks/{BCFB88Wl.js → 4EMyw6Bc.js} +1 -1
  6. package/web/app/immutable/chunks/{DIWzdBfB.js → 4T0RCl9z.js} +1 -1
  7. package/web/app/immutable/chunks/{CJEwuNO9.js → 5j6plyZH.js} +1 -1
  8. package/web/app/immutable/chunks/{B9kUdNbG.js → 6NStP9u7.js} +1 -1
  9. package/web/app/immutable/chunks/{DbxqdYAO.js → 7lcZWflB.js} +3 -3
  10. package/web/app/immutable/chunks/{CUeOEnqq.js → 84z5wXrw.js} +1 -1
  11. package/web/app/immutable/chunks/{COBhx_l-.js → AXzVloaq.js} +1 -1
  12. package/web/app/immutable/chunks/{DDdsJrHq.js → AfZNmzF0.js} +1 -1
  13. package/web/app/immutable/chunks/{Dbr8gjWS.js → B-9zOddN.js} +1 -1
  14. package/web/app/immutable/chunks/{D2Tzo4Hp.js → B-bGycam.js} +1 -1
  15. package/web/app/immutable/chunks/{Bf_4e4N2.js → B0RPkrmZ.js} +1 -1
  16. package/web/app/immutable/chunks/{TXPMw3n4.js → B0tiGTFc.js} +1 -1
  17. package/web/app/immutable/chunks/{Bv_0mmoe.js → B1TtNV9x.js} +1 -1
  18. package/web/app/immutable/chunks/{BolJpU8l.js → B1lrKll_.js} +4 -4
  19. package/web/app/immutable/chunks/{DZjSAGjX.js → B2Bshsum.js} +1 -1
  20. package/web/app/immutable/chunks/{Di_ao8Rc.js → B7esq_NU.js} +1 -1
  21. package/web/app/immutable/chunks/{bojY7ttK.js → B9BALnhr.js} +1 -1
  22. package/web/app/immutable/chunks/{DxuwadpA.js → B9guVudk.js} +1 -1
  23. package/web/app/immutable/chunks/{BNJkKc31.js → B9iclnD1.js} +1 -1
  24. package/web/app/immutable/chunks/{ByZL9dMf.js → BAVqPace.js} +1 -1
  25. package/web/app/immutable/chunks/BC6tIXxU.js +1 -0
  26. package/web/app/immutable/chunks/{CfnXjWQL.js → BDSbC3H_.js} +1 -1
  27. package/web/app/immutable/chunks/{hRfDutUE.js → BEuhalzY.js} +1 -1
  28. package/web/app/immutable/chunks/{ico0GHoP.js → BGh7-lCM.js} +13 -13
  29. package/web/app/immutable/chunks/{fC3yz20p.js → BH3eRhvI.js} +1 -1
  30. package/web/app/immutable/chunks/{DOZ82gYM.js → BHqyzGtP.js} +1 -1
  31. package/web/app/immutable/chunks/{Dyx6ysl7.js → BIfjK4Wy.js} +1 -1
  32. package/web/app/immutable/chunks/{3Kr2ijlK.js → BJbm_MWC.js} +1 -1
  33. package/web/app/immutable/chunks/{BCiWc-GH.js → BJfXDnA-.js} +1 -1
  34. package/web/app/immutable/chunks/{3IpMTtMx.js → BKpfaDrr.js} +1 -1
  35. package/web/app/immutable/chunks/{CY0EK8Cm.js → BKqd3SpJ.js} +3 -3
  36. package/web/app/immutable/chunks/{BqCTtUhB.js → BLMhg4vm.js} +1 -1
  37. package/web/app/immutable/chunks/{DFKO8V-Y.js → BLhJfI63.js} +1 -1
  38. package/web/app/immutable/chunks/{9AJtSub0.js → BNDTLRE1.js} +1 -1
  39. package/web/app/immutable/chunks/{COsxNPUV.js → BOyRg328.js} +1 -1
  40. package/web/app/immutable/chunks/{BbWnSSTS.js → BP-cDE7g.js} +1 -1
  41. package/web/app/immutable/chunks/{CF_a5Llj.js → BP6IQXl5.js} +1 -1
  42. package/web/app/immutable/chunks/{DtQHtXEW.js → BQ8hOnRo.js} +1 -1
  43. package/web/app/immutable/chunks/{BCuI_zgX.js → BQhBnAuP.js} +1 -1
  44. package/web/app/immutable/chunks/{COSIRxZC.js → BQmS_6pd.js} +1 -1
  45. package/web/app/immutable/chunks/{Dpvv-9m3.js → BRRnx9NG.js} +1 -1
  46. package/web/app/immutable/chunks/{C8TrySMt.js → BSt1DBgt.js} +1 -1
  47. package/web/app/immutable/chunks/{DY5rw8pn.js → BUsnh1ZW.js} +1 -1
  48. package/web/app/immutable/chunks/{DNDJdxKs.js → BVYisuIY.js} +1 -1
  49. package/web/app/immutable/chunks/{DQvAX2eX.js → BWJopR_X.js} +1 -1
  50. package/web/app/immutable/chunks/{DXDbxM_W.js → BWmQYGJo.js} +1 -1
  51. package/web/app/immutable/chunks/{DhaHSPPQ.js → BWq8kRZa.js} +1 -1
  52. package/web/app/immutable/chunks/{C1La-Fme.js → B_5X6pL_.js} +1 -1
  53. package/web/app/immutable/chunks/{C6Wi6O6n.js → BaOiWDrc.js} +1 -1
  54. package/web/app/immutable/chunks/{Nrq0Uf9_.js → Bajx4HLb.js} +1 -1
  55. package/web/app/immutable/chunks/{i8jM24jD.js → Bbs1UlDC.js} +1 -1
  56. package/web/app/immutable/chunks/{TyVpf8MX.js → Bd8IVx5H.js} +1 -1
  57. package/web/app/immutable/chunks/{DAI6QH7D.js → Be5fV6fq.js} +1 -1
  58. package/web/app/immutable/chunks/{MoxNukrR.js → BevVqXi3.js} +1 -1
  59. package/web/app/immutable/chunks/{BYYtBM5R.js → Bf-yBg_f.js} +1 -1
  60. package/web/app/immutable/chunks/{0y7aytZM.js → BfQFKWzJ.js} +1 -1
  61. package/web/app/immutable/chunks/{BtMIAxno.js → BfhnpOE4.js} +1 -1
  62. package/web/app/immutable/chunks/{DU1c0itA.js → BgKaGgl0.js} +1 -1
  63. package/web/app/immutable/chunks/{D5A9atQX.js → BgV6mURq.js} +2 -2
  64. package/web/app/immutable/chunks/{DY1YVoxv.js → BhFMyG47.js} +1 -1
  65. package/web/app/immutable/chunks/{Df4a242o.js → Bj4IsLvN.js} +1 -1
  66. package/web/app/immutable/chunks/{DZSbMOPJ.js → BlaJXdkI.js} +2 -2
  67. package/web/app/immutable/chunks/{CFdI48b2.js → BmM9C7Gu.js} +1 -1
  68. package/web/app/immutable/chunks/{CGHwi-2H.js → BoGNoNFW.js} +1 -1
  69. package/web/app/immutable/chunks/{3LCOBHm6.js → BoUQWR1c.js} +1 -1
  70. package/web/app/immutable/chunks/{Cwg3XF5F.js → BoZ2kJyE.js} +1 -1
  71. package/web/app/immutable/chunks/{DBwdk2-0.js → BpNCDrL-.js} +1 -1
  72. package/web/app/immutable/chunks/{B1xM1EBM.js → BpPZlehu.js} +1 -1
  73. package/web/app/immutable/chunks/{Dde9Z_vp.js → BpXDXz8J.js} +1 -1
  74. package/web/app/immutable/chunks/{BPDyvu9A.js → BpiO5nnh.js} +1 -1
  75. package/web/app/immutable/chunks/{DX2U4Mz9.js → BpwKnO7b.js} +3 -3
  76. package/web/app/immutable/chunks/{CQ5BHnSj.js → Bq7euxCs.js} +1 -1
  77. package/web/app/immutable/chunks/{Bk14_fvY.js → BsCPiCkz.js} +1 -1
  78. package/web/app/immutable/chunks/{CGUVvS8r.js → Bsdq-idi.js} +1 -1
  79. package/web/app/immutable/chunks/{DEKjIPd8.js → Bstq-Mm1.js} +1 -1
  80. package/web/app/immutable/chunks/{DcMTwn77.js → Bt9izmhQ.js} +1 -1
  81. package/web/app/immutable/chunks/BtUFJg3H.js +1 -0
  82. package/web/app/immutable/chunks/{DxWgWHgi.js → BtchneSc.js} +1 -1
  83. package/web/app/immutable/chunks/{6SOEgr71.js → BteojGYq.js} +3 -3
  84. package/web/app/immutable/chunks/{DOir9M0E.js → Btsk8yXd.js} +1 -1
  85. package/web/app/immutable/chunks/{QA00-uqv.js → Bu67WlMm.js} +1 -1
  86. package/web/app/immutable/chunks/{aixoUWDq.js → BuXXIZt7.js} +1 -1
  87. package/web/app/immutable/chunks/{E8oicBhU.js → BudPFdIj.js} +1 -1
  88. package/web/app/immutable/chunks/{DJb2lMGn.js → BvjgIPau.js} +1 -1
  89. package/web/app/immutable/chunks/{Dh-HeAnQ.js → BxTCsbTV.js} +1 -1
  90. package/web/app/immutable/chunks/{maZzJmVw.js → C2zt__Wj.js} +1 -1
  91. package/web/app/immutable/chunks/{BdY8OnZP.js → C4JyfUH_.js} +1 -1
  92. package/web/app/immutable/chunks/{v7JbBbwR.js → C4S7j2UJ.js} +1 -1
  93. package/web/app/immutable/chunks/{DcLVN86K.js → C64UuXDx.js} +1 -1
  94. package/web/app/immutable/chunks/{h5ZeHogL.js → C7JeHEH2.js} +1 -1
  95. package/web/app/immutable/chunks/{Ksiiix3Q.js → C7ajdkO4.js} +1 -1
  96. package/web/app/immutable/chunks/{CM9GoLV5.js → C7dAe4yg.js} +1 -1
  97. package/web/app/immutable/chunks/{IG43rVtJ.js → C8guha5a.js} +1 -1
  98. package/web/app/immutable/chunks/{Bb8ARnaK.js → C9wBKZsV.js} +1 -1
  99. package/web/app/immutable/chunks/{BCVhFPNJ.js → CA_3gGLy.js} +1 -1
  100. package/web/app/immutable/chunks/{DaOKbar2.js → CB-znH8P.js} +2 -2
  101. package/web/app/immutable/chunks/{BIcof04i.js → CB2VKTMK.js} +1 -1
  102. package/web/app/immutable/chunks/{bIL0xbKX.js → CBbdbU2x.js} +1 -1
  103. package/web/app/immutable/chunks/{EQgYvydQ.js → CEap7Fwz.js} +1 -1
  104. package/web/app/immutable/chunks/{lSLkjC_I.js → CG28d89U.js} +1 -1
  105. package/web/app/immutable/chunks/{DgzMHcMD.js → CGPxDdZI.js} +1 -1
  106. package/web/app/immutable/chunks/{DeY70dof.js → CGdXewiA.js} +1 -1
  107. package/web/app/immutable/chunks/{C6afU4he.js → CHKOALDI.js} +1 -1
  108. package/web/app/immutable/chunks/{CdGl_2eX.js → CIWQMI37.js} +1 -1
  109. package/web/app/immutable/chunks/{BRPJcG-m.js → CIlqcFRn.js} +1 -1
  110. package/web/app/immutable/chunks/{DvnO7gWT.js → CKcb8dge.js} +3 -3
  111. package/web/app/immutable/chunks/{D9_wDL10.js → CLvqNeoi.js} +1 -1
  112. package/web/app/immutable/chunks/{DJJ2Xrlq.js → COVS9Crf.js} +1 -1
  113. package/web/app/immutable/chunks/{COS4Sgoi.js → CP7zJE2f.js} +2 -2
  114. package/web/app/immutable/chunks/{CaMRSd1-.js → CPdyCf2B.js} +1 -1
  115. package/web/app/immutable/chunks/{Cpgxz5sK.js → CQU55hIk.js} +1 -1
  116. package/web/app/immutable/chunks/{Dh438xC0.js → CSdAdmLZ.js} +2 -2
  117. package/web/app/immutable/chunks/{zFAkpaJn.js → CTowDLQa.js} +1 -1
  118. package/web/app/immutable/chunks/{BVyOECUU.js → CV5qbjYN.js} +1 -1
  119. package/web/app/immutable/chunks/{CFB2mNds.js → CV7mOfKN.js} +2 -2
  120. package/web/app/immutable/chunks/{-8AxW0IA.js → CXCilPkm.js} +3 -3
  121. package/web/app/immutable/chunks/{HcbkpXC1.js → CXkLsKgj.js} +2 -2
  122. package/web/app/immutable/chunks/{BXHbm15d.js → CZB2ndi9.js} +1 -1
  123. package/web/app/immutable/chunks/{CjLfgoGI.js → CZex5Cac.js} +1 -1
  124. package/web/app/immutable/chunks/{7EQMYysM.js → C_-0Y1ed.js} +1 -1
  125. package/web/app/immutable/chunks/{D5evzUZd.js → Caqb9E2M.js} +1 -1
  126. package/web/app/immutable/chunks/{CTTICX_5.js → Ccr7s0GQ.js} +1 -1
  127. package/web/app/immutable/chunks/CeeeYtIE.js +1 -0
  128. package/web/app/immutable/chunks/{De0cdeOU.js → CfIVswBm.js} +1 -1
  129. package/web/app/immutable/chunks/{DQBViT5w.js → CfK5RUHZ.js} +1 -1
  130. package/web/app/immutable/chunks/{CvSLeFQo.js → CfaCrhAh.js} +1 -1
  131. package/web/app/immutable/chunks/{Dm3wAkDL.js → CffZor2V.js} +1 -1
  132. package/web/app/immutable/chunks/{CSb1CnpN.js → CggFXl4B.js} +1 -1
  133. package/web/app/immutable/chunks/{3Qz3qAhk.js → Ci75CkmK.js} +1 -1
  134. package/web/app/immutable/chunks/{BVcaPXq9.js → CisSEUth.js} +1 -1
  135. package/web/app/immutable/chunks/{BHJpo3VA.js → Ck3g194G.js} +1 -1
  136. package/web/app/immutable/chunks/{BPpACIC2.js → CkXORNl2.js} +1 -1
  137. package/web/app/immutable/chunks/{DAVG7sIL.js → CmhKJ6Ie.js} +1 -1
  138. package/web/app/immutable/chunks/{CnQVxh95.js → Cn034oEm.js} +1 -1
  139. package/web/app/immutable/chunks/{tHETzssD.js → CndJcn8K.js} +1 -1
  140. package/web/app/immutable/chunks/{DdjeekcY.js → CnqyGFOt.js} +1 -1
  141. package/web/app/immutable/chunks/{BIkt0YE0.js → Co9CFvqw.js} +1 -1
  142. package/web/app/immutable/chunks/{BYJh9adv.js → Cq8MD_3v.js} +1 -1
  143. package/web/app/immutable/chunks/{BmLlDCoW.js → CrL2Nk6a.js} +1 -1
  144. package/web/app/immutable/chunks/{Bu3PKqut.js → CrpUtGFn.js} +1 -1
  145. package/web/app/immutable/chunks/{BNFvOw36.js → CrwLq8nY.js} +1 -1
  146. package/web/app/immutable/chunks/{Drf1gLyo.js → Cw2fqKk9.js} +1 -1
  147. package/web/app/immutable/chunks/{FQkCsxt2.js → CwCTYQp7.js} +1 -1
  148. package/web/app/immutable/chunks/{24f6N9l0.js → CwGPCWH6.js} +1 -1
  149. package/web/app/immutable/chunks/{awY5HvZY.js → CxCmx5S0.js} +1 -1
  150. package/web/app/immutable/chunks/{CaHWSiOY.js → CzFfpwQB.js} +1 -1
  151. package/web/app/immutable/chunks/{HeVxSGdr.js → CzRhnymD.js} +1 -1
  152. package/web/app/immutable/chunks/{mRUS_S7Z.js → CzTSi5lc.js} +1 -1
  153. package/web/app/immutable/chunks/{BGo6FK-0.js → CzjElr82.js} +1 -1
  154. package/web/app/immutable/chunks/{DSDM77x3.js → D-6Jv2pD.js} +1 -1
  155. package/web/app/immutable/chunks/{BKFxm3WK.js → D-DyBHf9.js} +1 -1
  156. package/web/app/immutable/chunks/{Z8DHXl17.js → D0hLqQX-.js} +1 -1
  157. package/web/app/immutable/chunks/{B18ybwa0.js → D1YPh_5n.js} +1 -1
  158. package/web/app/immutable/chunks/{PkPZtGfM.js → D25lWS8Q.js} +1 -1
  159. package/web/app/immutable/chunks/{yqEyUNVG.js → D2kIeaeO.js} +1 -1
  160. package/web/app/immutable/chunks/{C4M_mNFP.js → D2y-zN_4.js} +1 -1
  161. package/web/app/immutable/chunks/{UQ6MIVTw.js → D3waRWO1.js} +1 -1
  162. package/web/app/immutable/chunks/{2aKRVAvL.js → D48_y-cl.js} +1 -1
  163. package/web/app/immutable/chunks/{x-RVzKqZ.js → D49zWKPf.js} +1 -1
  164. package/web/app/immutable/chunks/{dFhS46gw.js → D55LTeKe.js} +1 -1
  165. package/web/app/immutable/chunks/{DbUDL_oo.js → D57Jyp6W.js} +1 -1
  166. package/web/app/immutable/chunks/{CIoJPvjg.js → D5wnbxHp.js} +1 -1
  167. package/web/app/immutable/chunks/{BhtJVlVx.js → D67AA9yd.js} +1 -1
  168. package/web/app/immutable/chunks/{B-MjuJTx.js → D6Q-N0-R.js} +2 -2
  169. package/web/app/immutable/chunks/{C21Z9LLF.js → D7AX9X0W.js} +1 -1
  170. package/web/app/immutable/chunks/{XMluVOSf.js → D83yV23-.js} +1 -1
  171. package/web/app/immutable/chunks/{BE08e7Se.js → D8BzOeFD.js} +1 -1
  172. package/web/app/immutable/chunks/{BqrahRdk.js → D8bY4ERR.js} +4 -4
  173. package/web/app/immutable/chunks/{BDbFQqI8.js → D9Hjcszu.js} +3 -3
  174. package/web/app/immutable/chunks/{DC1xYxUn.js → D9M659lc.js} +1 -1
  175. package/web/app/immutable/chunks/{Ly7eBIj5.js → D9MZU0Xg.js} +1 -1
  176. package/web/app/immutable/chunks/{CW979n9w.js → DC1CSztK.js} +1 -1
  177. package/web/app/immutable/chunks/{BeUuk8D1.js → DCkRL43S.js} +1 -1
  178. package/web/app/immutable/chunks/{0b3rkAam.js → DEQDOTA1.js} +1 -1
  179. package/web/app/immutable/chunks/{W05hyx94.js → DIEHuZ8f.js} +1 -1
  180. package/web/app/immutable/chunks/{DIad5c9_.js → DINctf8I.js} +1 -1
  181. package/web/app/immutable/chunks/{DsOS7N8Z.js → DIcuhccs.js} +1 -1
  182. package/web/app/immutable/chunks/{CJke1tnU.js → DIoT8eB4.js} +1 -1
  183. package/web/app/immutable/chunks/{Bb-hI5du.js → DJKfrY8C.js} +2 -2
  184. package/web/app/immutable/chunks/{CIKXOyvw.js → DJivXy66.js} +2 -2
  185. package/web/app/immutable/chunks/{BthojcF8.js → DL95yZo7.js} +6 -6
  186. package/web/app/immutable/chunks/DLO_0egf.js +1 -0
  187. package/web/app/immutable/chunks/{CnMzOGNL.js → DLs3P_Wt.js} +1 -1
  188. package/web/app/immutable/chunks/{UnM4qztD.js → DLttsd3i.js} +1 -1
  189. package/web/app/immutable/chunks/{DGdWzkgm.js → DMV5KQix.js} +1 -1
  190. package/web/app/immutable/chunks/{yy2JFRyT.js → DMlhLPB0.js} +1 -1
  191. package/web/app/immutable/chunks/DP0K41jk.js +1 -0
  192. package/web/app/immutable/chunks/{21kfe-mS.js → DPG1HUgG.js} +1 -1
  193. package/web/app/immutable/chunks/{r5JNAzEM.js → DPjr22dV.js} +1 -1
  194. package/web/app/immutable/chunks/{CZ5zON0R.js → DPmNtGFj.js} +1 -1
  195. package/web/app/immutable/chunks/{ChKOG1mU.js → DQZhKtkC.js} +1 -1
  196. package/web/app/immutable/chunks/{B8foSZsl.js → DRLJuUwT.js} +1 -1
  197. package/web/app/immutable/chunks/{COlfJVPs.js → DTtB67Qo.js} +4 -4
  198. package/web/app/immutable/chunks/{Bn4F-JIh.js → DU1ubslo.js} +1 -1
  199. package/web/app/immutable/chunks/{BB-hf8IY.js → DW_seDlm.js} +4 -4
  200. package/web/app/immutable/chunks/{BcYVm7io.js → DWqaYE81.js} +1 -1
  201. package/web/app/immutable/chunks/{C9ij7Z2h.js → D_5u7gP_.js} +1 -1
  202. package/web/app/immutable/chunks/{_HPNXgkR.js → D_j4wRX_.js} +3 -3
  203. package/web/app/immutable/chunks/{CB8gRmKb.js → Da6yJ5JS.js} +1 -1
  204. package/web/app/immutable/chunks/{BOnTc4ny.js → Dcnwzgw6.js} +1 -1
  205. package/web/app/immutable/chunks/{BWI85bGY.js → Dd3UnPYB.js} +1 -1
  206. package/web/app/immutable/chunks/{CYq58ltZ.js → DdLy5J3P.js} +1 -1
  207. package/web/app/immutable/chunks/{BD7jFvJp.js → Ddc7chXR.js} +1 -1
  208. package/web/app/immutable/chunks/{DdRupUfV.js → Dde5tnWd.js} +2 -2
  209. package/web/app/immutable/chunks/{CRUcTVFP.js → DezlVQ1h.js} +1 -1
  210. package/web/app/immutable/chunks/{OMssb4xF.js → Dga6E45c.js} +1 -1
  211. package/web/app/immutable/chunks/{CLqqc_hU.js → Dgmou2n8.js} +1 -1
  212. package/web/app/immutable/chunks/{BoEcbLG-.js → DgtVALrr.js} +1 -1
  213. package/web/app/immutable/chunks/{BRdQpeCl.js → DkERMj5B.js} +1 -1
  214. package/web/app/immutable/chunks/{A3z9XWMi.js → DkJYBjJg.js} +1 -1
  215. package/web/app/immutable/chunks/{Djah0WfC.js → DkOk28fz.js} +1 -1
  216. package/web/app/immutable/chunks/{kAav5o2h.js → Dk_Hc5oq.js} +1 -1
  217. package/web/app/immutable/chunks/{CyHe7TdT.js → DmpdpJAo.js} +1 -1
  218. package/web/app/immutable/chunks/{DIQ-xR1q.js → Do-SaITx.js} +1 -1
  219. package/web/app/immutable/chunks/{DyLERSuu.js → DqfdHjn7.js} +1 -1
  220. package/web/app/immutable/chunks/{YbqMJoDi.js → DrStWuxU.js} +1 -1
  221. package/web/app/immutable/chunks/{CsilY7l9.js → DtkIwON_.js} +1 -1
  222. package/web/app/immutable/chunks/{-VR23WhZ.js → DujtjgwV.js} +1 -1
  223. package/web/app/immutable/chunks/{Y_tkjygB.js → DwGyIIXK.js} +1 -1
  224. package/web/app/immutable/chunks/{LdXAlc1O.js → DwbEs_9r.js} +1 -1
  225. package/web/app/immutable/chunks/{CvusaaYc.js → DwiE5WsI.js} +1 -1
  226. package/web/app/immutable/chunks/{Cpw2gXhG.js → Dx1ZiLP_.js} +1 -1
  227. package/web/app/immutable/chunks/{BW2en5Js.js → DxSE2XEK.js} +1 -1
  228. package/web/app/immutable/chunks/{jyNUu-ZR.js → DxnZvDv0.js} +1 -1
  229. package/web/app/immutable/chunks/{Bx7gCv2M.js → Dy9FYRX8.js} +1 -1
  230. package/web/app/immutable/chunks/{C6rz0msZ.js → DzI8RUwZ.js} +1 -1
  231. package/web/app/immutable/chunks/{rsUVVEzx.js → ELYZilX0.js} +1 -1
  232. package/web/app/immutable/chunks/{BlRGZv8u.js → FLpsgWeB.js} +1 -1
  233. package/web/app/immutable/chunks/{BweHPPaS.js → FhJRiT1S.js} +2 -2
  234. package/web/app/immutable/chunks/{BpLxj3s3.js → HLNbJ-7M.js} +1 -1
  235. package/web/app/immutable/chunks/{D22j4iWy.js → Hi2H4bj8.js} +1 -1
  236. package/web/app/immutable/chunks/{UqcU95a7.js → Idk978zJ.js} +1 -1
  237. package/web/app/immutable/chunks/{C_wfHKmM.js → Ii0VTY5h.js} +1 -1
  238. package/web/app/immutable/chunks/{CTqRHXfu.js → ItBm4ElA.js} +1 -1
  239. package/web/app/immutable/chunks/{Dduwpj0a.js → Jk9a4xPx.js} +1 -1
  240. package/web/app/immutable/chunks/{yMcNgg0D.js → KlNP4OZJ.js} +1 -1
  241. package/web/app/immutable/chunks/{B0kNPCxU.js → KtEuoG00.js} +1 -1
  242. package/web/app/immutable/chunks/{Btst3lgy.js → L3K71tUU.js} +1 -1
  243. package/web/app/immutable/chunks/{DzpuLv6U.js → Lk7a_7W9.js} +1 -1
  244. package/web/app/immutable/chunks/{DpxbS0Pj.js → Mmc_61iE.js} +1 -1
  245. package/web/app/immutable/chunks/{DrkDJmY5.js → NpwlBTfT.js} +1 -1
  246. package/web/app/immutable/chunks/{7i0OJtNQ.js → R5lmOJFS.js} +1 -1
  247. package/web/app/immutable/chunks/{8jO_MBKF.js → RTRAqswA.js} +1 -1
  248. package/web/app/immutable/chunks/{DpESY8ko.js → UYAhegVx.js} +1 -1
  249. package/web/app/immutable/chunks/{CUA9hM4m.js → UsbmbYa0.js} +1 -1
  250. package/web/app/immutable/chunks/{DyXOhKE5.js → VcnbZvDh.js} +1 -1
  251. package/web/app/immutable/chunks/{TN7R9Ny0.js → WoPFTWyQ.js} +1 -1
  252. package/web/app/immutable/chunks/{77KTvr2w.js → WvHbj6rB.js} +1 -1
  253. package/web/app/immutable/chunks/{BbfEcBPg.js → Y2a1lhL9.js} +1 -1
  254. package/web/app/immutable/chunks/{D6_ybykj.js → YFBzMq6w.js} +1 -1
  255. package/web/app/immutable/chunks/YLhFQnIu.js +1 -0
  256. package/web/app/immutable/chunks/{VTJf_qPn.js → YeOAvjnW.js} +1 -1
  257. package/web/app/immutable/chunks/{BwVjpKmH.js → Yz7dkp3Z.js} +1 -1
  258. package/web/app/immutable/chunks/{BrDfJqC4.js → _3Ca9E4W.js} +1 -1
  259. package/web/app/immutable/chunks/{BdlYeRHB.js → aoPstOyp.js} +2 -2
  260. package/web/app/immutable/chunks/{B4F7GG5Q.js → bs-TVtqR.js} +1 -1
  261. package/web/app/immutable/chunks/{DjNuITHM.js → cEIzYo-d.js} +1 -1
  262. package/web/app/immutable/chunks/{QIFiwjW0.js → cHm1EnSF.js} +3 -3
  263. package/web/app/immutable/chunks/{B-4i031c.js → cKeJwK9J.js} +1 -1
  264. package/web/app/immutable/chunks/{cfiNEg68.js → cPsAlOmH.js} +1 -1
  265. package/web/app/immutable/chunks/{CPWMushE.js → d028N8d2.js} +1 -1
  266. package/web/app/immutable/chunks/{CDxV78M0.js → eJwA1uvO.js} +1 -1
  267. package/web/app/immutable/chunks/{DlMrAlfA.js → g08hegP2.js} +1 -1
  268. package/web/app/immutable/chunks/{D7yetF0v.js → gwv5JQYH.js} +1 -1
  269. package/web/app/immutable/chunks/{Cerl373K.js → iAKTK0Nq.js} +1 -1
  270. package/web/app/immutable/chunks/{BxU747mj.js → j5ppcWWU.js} +1 -1
  271. package/web/app/immutable/chunks/{E1uoF1cW.js → jAIXVFR4.js} +1 -1
  272. package/web/app/immutable/chunks/{B3OJ_2Dd.js → kvtKUeBe.js} +1 -1
  273. package/web/app/immutable/chunks/{B3JbrKDZ.js → lZ7zkdkp.js} +1 -1
  274. package/web/app/immutable/chunks/{DpvQ3NRH.js → mUNs8NSR.js} +1 -1
  275. package/web/app/immutable/chunks/{Bax102l4.js → nOvpikoA.js} +1 -1
  276. package/web/app/immutable/chunks/{CueOVPTy.js → oBIu7LTI.js} +1 -1
  277. package/web/app/immutable/chunks/{DKupjKLn.js → oVV8Q_Hb.js} +1 -1
  278. package/web/app/immutable/chunks/{BhYFIrRM.js → pHYq50Ny.js} +1 -1
  279. package/web/app/immutable/chunks/{De2a277N.js → ptqq1hqu.js} +1 -1
  280. package/web/app/immutable/chunks/{BjdIR-od.js → qoDJOBiM.js} +1 -1
  281. package/web/app/immutable/chunks/{DzBJS0Lp.js → scTXKJzg.js} +1 -1
  282. package/web/app/immutable/chunks/{Bj4j6g-o.js → tU2KtqMG.js} +1 -1
  283. package/web/app/immutable/chunks/{CDxGu9F5.js → tVmNccZ-.js} +1 -1
  284. package/web/app/immutable/chunks/{9R_52XLX.js → whliLT1v.js} +1 -1
  285. package/web/app/immutable/chunks/{ChOMtuod.js → x2AHvZeQ.js} +1 -1
  286. package/web/app/immutable/chunks/{B2OS2WTh.js → xPYDsdm4.js} +1 -1
  287. package/web/app/immutable/chunks/{DOLX5oss.js → xzksWQ-h.js} +1 -1
  288. package/web/app/immutable/chunks/{Dt3xwKL6.js → yMNZVIZN.js} +2 -2
  289. package/web/app/immutable/chunks/{DgjIVRdE.js → z91bgOZ6.js} +1 -1
  290. package/web/app/immutable/chunks/{Y4bYs1dr.js → z_SeEaJQ.js} +1 -1
  291. package/web/app/immutable/chunks/{hstOawAs.js → zxxqPN9_.js} +1 -1
  292. package/web/app/immutable/entry/{app.gkm8TnXW.js → app.TFdw1N9t.js} +3 -3
  293. package/web/app/immutable/entry/start.CSPHmABT.js +1 -0
  294. package/web/app/immutable/nodes/{0.xKtnYOA2.js → 0.D7LoWNFt.js} +1 -1
  295. package/web/app/immutable/nodes/{1.BMx4VsW1.js → 1.T820Pcdi.js} +1 -1
  296. package/web/app/immutable/nodes/10.TooAJmth.js +39 -0
  297. package/web/app/immutable/nodes/{11._cAIrch_.js → 11.YCt8uKtA.js} +1 -1
  298. package/web/app/immutable/nodes/{12.DOoAvwLA.js → 12.C5GV0W_U.js} +1 -1
  299. package/web/app/immutable/nodes/{13.Coj_sRB4.js → 13.BpCKbOND.js} +1 -1
  300. package/web/app/immutable/nodes/{14.AVrz3ZLQ.js → 14.DomreN-2.js} +3 -3
  301. package/web/app/immutable/nodes/{15.BGK-JRWm.js → 15.BaajVSfs.js} +1 -1
  302. package/web/app/immutable/nodes/{16.CMkcwVoI.js → 16.BcdRdVBS.js} +1 -1
  303. package/web/app/immutable/nodes/{17.BS5un5d0.js → 17.C5h-oNNo.js} +1 -1
  304. package/web/app/immutable/nodes/{18._hTG2-17.js → 18.vgJOUK1N.js} +1 -1
  305. package/web/app/immutable/nodes/{19.DuCFyr_N.js → 19.BBw49idM.js} +2 -2
  306. package/web/app/immutable/nodes/{2.uAqDAg4D.js → 2.CXHTT9vG.js} +4 -4
  307. package/web/app/immutable/nodes/{20.C1pW6BvW.js → 20.CuOgTm-x.js} +1 -1
  308. package/web/app/immutable/nodes/{3.M-EbuqKW.js → 3.CafUSpEU.js} +1 -1
  309. package/web/app/immutable/nodes/{4.ByPZ1Nrn.js → 4.wtpkgmx_.js} +1 -1
  310. package/web/app/immutable/nodes/{5.DKAjjuf7.js → 5.D26Atcdx.js} +1 -1
  311. package/web/app/immutable/nodes/{6.DOc_YxMK.js → 6.uEepPxKF.js} +1 -1
  312. package/web/app/immutable/nodes/{7.gFNAyoNX.js → 7.D-r8R1wS.js} +1 -1
  313. package/web/app/immutable/nodes/{8.C_Kp8pWz.js → 8.ELuFvMEz.js} +1 -1
  314. package/web/app/immutable/nodes/{9.C6HX35Sq.js → 9.tuk9n1NJ.js} +4 -4
  315. package/web/app/version.json +1 -1
  316. package/web/generated/paraglide.js +44 -44
  317. package/web/index.html +18 -18
  318. package/web/app/immutable/chunks/B2LBPAIA.js +0 -1
  319. package/web/app/immutable/chunks/BUTuN2nE.js +0 -1
  320. package/web/app/immutable/chunks/CH-Qi35K.js +0 -1
  321. package/web/app/immutable/chunks/DWvCfaBg.js +0 -1
  322. package/web/app/immutable/chunks/Da8rtzmJ.js +0 -1
  323. package/web/app/immutable/chunks/wBNgrgMC.js +0 -1
  324. package/web/app/immutable/entry/start.CMMmzvCE.js +0 -1
  325. package/web/app/immutable/nodes/10.HyXPJR8g.js +0 -39
@@ -1 +1 @@
1
- import{t as lt,bo as f,bw as dt,b as ct,bm as e,br as ft,bs as we,bq as Et}from"./DWvCfaBg.js";import{bs as pt,ay as We,be as A,b$ as T,b_ as n,bO as i,W as a,bS as o,bl as D,bn as _t,aA as g,a7 as Lt,aD as t,c9 as $,aB as k,a5 as x,bA as y,bf as gt,bo as It,bV as tt,br as Gt,ca as bt,bH as $e,bk as zt}from"./3SdAC2_C.js";import{g as Ut,i as Ot,I as mt}from"./CueOVPTy.js";import{c as Ft}from"./Y_tkjygB.js";import{s as ot,f as Bt,c as Nt}from"./BCuI_zgX.js";import{f as z}from"./Drf1gLyo.js";import"./CIKXOyvw.js";import"./77KTvr2w.js";import{b as Rt}from"./B8foSZsl.js";import"./B3OJ_2Dd.js";import"./B0kNPCxU.js";import{b as Ht}from"./21kfe-mS.js";import{i as S}from"./VTJf_qPn.js";import{b as Mt}from"./D3yXvqwY.js";import{F as Wt,ay as Jt,c_ as qt,cn as Yt,aN as Vt,bn as jt,d0 as Qt,cK as Xt}from"./D7yetF0v.js";import"./Bu3PKqut.js";import{F as ht,G as Zt}from"./ChKOG1mU.js";import"./CdGl_2eX.js";/* empty css */import{C as er}from"./BXHbm15d.js";import{L as kt}from"./CvusaaYc.js";import{I as rt}from"./BRdQpeCl.js";import"./CsilY7l9.js";import"./9AJtSub0.js";import{h as tr}from"./BweHPPaS.js";import{Jx as Ke,fC as xt,J as rr,ep as yt,r6 as sr,uB as ar,Jo as ir,oE as nr,hS as or}from"./CIoJPvjg.js";import{aB as St,aC as $t,aD as lr,aw as dr,ax as Kt,ay as cr,az as pr,aH as _r}from"./CFB2mNds.js";import{R as ur}from"./BbWnSSTS.js";var vr=k('<!> <p class="type-body"> </p>',1);function fr(l,r){if(new.target)return lt({component:fr,...l});pt(r,!0);let _=f(r,"open",15,!1),E=f(r,"static",7,!1),B=f(r,"title",7),u=f(r,"message",7),b=f(r,"buttons",7),m=f(r,"cancelIndex",7,0),ae=f(r,"onSelect",7);function Y(d){_(!1),ae()?.(d)}var he={get open(){return _()},set open(d=!1){_(d),g()},get static(){return E()},set static(d=!1){E(d),g()},get title(){return B()},set title(d){B(d),g()},get message(){return u()},set message(d){u(d),g()},get buttons(){return b()},set buttons(d){b(d),g()},get cancelIndex(){return m()},set cancelIndex(d=0){m(d),g()},get onSelect(){return ae()},set onSelect(d){ae(d),g()},$set:dt,$on:(d,V)=>ct(r,d,V)};return Ht(l,{get static(){return E()},role:"alertdialog",get title(){return B()},dismissOnInteractOutside:!1,focusContent:!0,onSubmit:()=>Y(b().length-1),onCancel:()=>Y(m()),get open(){return _()},set open(V){_(V)},footer:V=>{var K=Lt(),N=We(K);Ut(N,17,b,Ot,(ie,ne,te)=>{{let ke=$(()=>te===m()?"ghost":te===b().length-1?"primary":"outline");z(ie,{get variant(){return t(ke)},onclick:()=>Y(te),children:(Ae,R)=>{A();var Te=T();n(()=>i(Te,t(ne))),a(Ae,Te)},$$slots:{default:!0}})}}),a(V,K)},children:(V,K)=>{var N=vr(),ie=We(N);Ft(ie,()=>Rt,(ke,Ae)=>{Ae(ke,{class:"sr-only",children:(R,Te)=>{A();var Fe=T();n(()=>i(Fe,u())),a(R,Fe)},$$slots:{default:!0}})});var ne=o(ie,2),te=D(ne,!0);n(()=>i(te,u())),a(V,N)},$$slots:{footer:!0,default:!0}}),_t(he)}const Oe={anthropicKeys:"https://console.anthropic.com/settings/keys",openAiKeys:"https://platform.openai.com/api-keys",openAiTokens:"https://developers.openai.com/codex/enterprise/access-tokens",xaiConsole:"https://console.x.ai",factoryKeys:"https://app.factory.ai/settings/api-keys",cursorDashboard:"https://cursor.com/dashboard?tab=integrations",auggieAuth:"https://docs.augmentcode.com/cli/setup-auggie/authentication"},gr="claude setup-token",br="auggie token print";function mr(l,r){if(r==="differentLogin")return e.settings_providerProfileKinds_differentLogin_description();if(r==="token")return l==="codex"?e.settings_providerProfileKinds_tokenCodex_description():l==="auggie"?e.settings_providerProfileKinds_tokenAuggie_description():e.settings_providerProfileKinds_tokenClaude_description();switch(l){case"codex":return e.settings_providerProfileKinds_apiKeyCodex_description();case"grok":return e.settings_providerProfileKinds_apiKeyGrok_description();case"droid":return e.settings_providerProfileKinds_apiKeyDroid_description();case"cursor":return e.settings_providerProfileKinds_apiKeyCursor_description();default:return e.settings_providerProfileKinds_apiKeyClaude_description()}}function hr(l,r){return r==="apiKey"?e.settings_providerProfileKinds_apiKey_label():l==="auggie"?e.settings_providerProfileKinds_tokenAuggie_label():e.settings_providerProfileKinds_token_label()}function Ss(l,r){return l!=="claude"&&l!=="codex"?mr(l,r):r==="token"?l==="codex"?e.settings_providerProfileKinds_tokenCodexDialog_description():e.settings_providerProfileKinds_tokenClaudeDialog_description():l==="codex"?e.settings_providerProfileKinds_apiKeyCodexDialog_description():e.settings_providerProfileKinds_apiKeyClaudeDialog_description()}function kr(l,r){if(r==="token")return l==="codex"?{steps:[e.settings_providerProfileKinds_tokenCodexStep1_label()],link:{href:Oe.openAiTokens,label:e.settings_providerProfileKinds_openAiAccessTokens_link()},eligibility:e.settings_providerProfileKinds_tokenCodexEligibility_description()}:l==="auggie"?{steps:[e.settings_providerProfileKinds_tokenAuggieStep1_label(),e.settings_providerProfileKinds_tokenAuggieStep2_label()],command:br,link:{href:Oe.auggieAuth,label:e.settings_providerProfileKinds_auggieAuthDocs_link()}}:{steps:[e.settings_providerProfileKinds_tokenClaudeStep1_label(),e.settings_providerProfileKinds_tokenClaudeStep2_label()],command:gr};switch(l){case"codex":return{steps:[e.settings_providerProfileKinds_apiKeyCodexStep1_label(),e.settings_providerProfileKinds_apiKeyCodexStep2_label()],link:{href:Oe.openAiKeys,label:e.settings_providerProfileKinds_openAiApiKeys_link()}};case"grok":return{steps:[e.settings_providerProfileKinds_apiKeyGrokStep1_label(),e.settings_providerProfileKinds_apiKeyGrokStep2_label()],link:{href:Oe.xaiConsole,label:e.settings_providerProfileKinds_xaiConsole_link()}};case"droid":return{steps:[e.settings_providerProfileKinds_apiKeyDroidStep1_label(),e.settings_providerProfileKinds_apiKeyDroidStep2_label()],link:{href:Oe.factoryKeys,label:e.settings_providerProfileKinds_factoryApiKeys_link()}};case"cursor":return{steps:[e.settings_providerProfileKinds_apiKeyCursorStep1_label(),e.settings_providerProfileKinds_apiKeyCursorStep2_label()],link:{href:Oe.cursorDashboard,label:e.settings_providerProfileKinds_cursorDashboard_link()}};default:return{steps:[e.settings_providerProfileKinds_apiKeyClaudeStep1_label(),e.settings_providerProfileKinds_apiKeyClaudeStep2_label()],link:{href:Oe.anthropicKeys,label:e.settings_providerProfileKinds_anthropicConsole_link()}}}}function xr(l,r){return r?l==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeStep3_label():e.settings_providerProfileKinds_tokenClaudeStep3_label():e.settings_providerProfileKinds_pasteNoCheck_label()}function $s(l,r){if(r==="token")return l==="codex"?e.settings_providerProfileKinds_tokenNotJwt_error():l==="auggie"?e.settings_providerProfileKinds_tokenShapeAuggie_error():e.settings_providerProfileKinds_tokenShapeClaude_error();switch(l){case"codex":return e.settings_providerProfileKinds_keyShapeCodex_error();case"grok":return e.settings_providerProfileKinds_keyShapeGrok_error();case"droid":return e.settings_providerProfileKinds_keyShapeDroid_error();case"cursor":return e.settings_providerProfileKinds_keyShapeCursor_error();default:return e.settings_providerProfileKinds_keyShapeClaude_error()}}var yr=k('<p class="type-body text-muted-foreground" data-testid="provider-profile-token-eligibility"> </p>'),Sr=k('<span class="mt-1 flex items-center gap-2" data-testid="provider-profile-setup-token"><code class="rounded border border-border bg-muted px-1.5 py-0.5 font-mono type-caption text-foreground"> </code> <!></span>'),Pt=k("<li> </li>"),$r=k('<section class="space-y-2" data-testid="provider-profile-secret-steps"><h3 class="type-body font-medium! text-foreground"> </h3> <ol class="type-body list-decimal space-y-1 pl-5 text-muted-foreground"><li> <!></li> <!> <!></ol> <!></section>'),Ct=k('<div class="flex items-center gap-2"><!> <!></div>'),Kr=k('<div class="space-y-2" data-testid="provider-profile-secret-saved"><p class="type-body text-foreground"> </p> <div class="flex items-center gap-3"><span class="type-body font-mono text-muted-foreground"> </span> <!></div></div>'),Pr=k('<span class="type-body text-muted-foreground"> </span> <!>',1),Cr=k('<span class="type-body font-mono text-muted-foreground"> </span> <!> <!>',1),wr=k('<div class="flex flex-wrap items-center gap-3" data-testid="provider-profile-base-url-saved"><span class="type-body text-foreground"> </span> <!></div>'),Ar=k('<details class="group rounded-md border border-border" data-testid="provider-profile-custom-endpoint"><summary class="flex cursor-pointer list-none items-center gap-2 px-3 py-2 type-body text-foreground [&amp;::-webkit-details-marker]:hidden"><!> </summary> <div class="space-y-2 border-t border-border px-3 py-3"><p class="type-caption text-muted-foreground"> </p> <!></div></details>'),Tr=k('<div class="space-y-5" data-testid="provider-profile-secret"><!> <!> <!> <!></div>');function Dr(l,r){if(new.target)return lt({component:Dr,...l});pt(r,!0);let _=f(r,"provider",7),E=f(r,"kind",7),B=f(r,"mode",7),u=f(r,"secret",15,""),b=f(r,"secretSaved",7,!1),m=f(r,"replacing",15,!1),ae=f(r,"secretError",7),Y=f(r,"baseUrl",15,""),he=f(r,"baseUrlSaved",7,!1),d=f(r,"baseUrlAction",15,"keep"),V=f(r,"customEndpointOpen",15,!1),K=f(r,"disabled",7,!1),N=f(r,"secretDisabled",23,K),ie=f(r,"keyCheck",7,!0),ne=f(r,"pasteStep",7,!0),te=f(r,"customEndpoint",7,!0);const ke="https://",Ae=$(()=>_()==="claude"&&E()==="apiKey"),R=$(()=>kr(_(),E())),Te=$(()=>xr(E(),ie())),Fe=$(()=>B()==="add"||!b()||m()),Ye=$(()=>hr(_(),E()));function st(){m(!1),u("")}var at={get provider(){return _()},set provider(s){_(s),g()},get kind(){return E()},set kind(s){E(s),g()},get mode(){return B()},set mode(s){B(s),g()},get secret(){return u()},set secret(s=""){u(s),g()},get secretSaved(){return b()},set secretSaved(s=!1){b(s),g()},get replacing(){return m()},set replacing(s=!1){m(s),g()},get secretError(){return ae()},set secretError(s){ae(s),g()},get baseUrl(){return Y()},set baseUrl(s=""){Y(s),g()},get baseUrlSaved(){return he()},set baseUrlSaved(s=!1){he(s),g()},get baseUrlAction(){return d()},set baseUrlAction(s="keep"){d(s),g()},get customEndpointOpen(){return V()},set customEndpointOpen(s=!1){V(s),g()},get disabled(){return K()},set disabled(s=!1){K(s),g()},get secretDisabled(){return N()},set secretDisabled(s=K){N(s),g()},get keyCheck(){return ie()},set keyCheck(s=!0){ie(s),g()},get pasteStep(){return ne()},set pasteStep(s=!0){ne(s),g()},get customEndpoint(){return te()},set customEndpoint(s=!0){te(s),g()},$set:dt,$on:(s,C)=>ct(r,s,C)},Be=Tr(),De=x(Be);{var Ve=s=>{var C=yr(),H=D(C,!0);n(()=>i(H,t(R).eligibility)),a(s,C)};S(De,s=>{t(R).eligibility&&s(Ve)})}var ue=o(De,2);{var Ne=s=>{var C=$r(),H=x(C),oe=D(H,!0),j=o(H,2),Q=x(j),le=x(Q),xe=o(le);{var W=h=>{var L=Sr(),J=x(L),O=D(J,!0),de=o(J,2);er(de,{get text(){return t(R).command},size:"sm"}),y(L),n(()=>i(O,t(R).command)),a(h,L)};S(xe,h=>{t(R).command&&h(W)})}y(Q);var ve=o(Q,2);{var re=h=>{var L=Pt(),J=D(L,!0);n(()=>i(J,t(R).steps[1])),a(h,L)};S(ve,h=>{t(R).steps[1]&&h(re)})}var U=o(ve,2);{var M=h=>{var L=Pt(),J=D(L,!0);n(()=>i(J,t(Te))),a(h,L)};S(U,h=>{ne()&&h(M)})}y(j);var ye=o(j,2);{var Ee=h=>{z(h,{variant:"link",size:"sm",get href(){return t(R).link.href},target:"_blank",rel:"noopener noreferrer",class:"h-auto px-0",children:(L,J)=>{A();var O=T();n(()=>i(O,t(R).link.label)),a(L,O)},$$slots:{default:!0}})};S(ye,h=>{t(R).link&&h(Ee)})}y(C),n(h=>{i(oe,h),i(le,`${t(R).steps[0]??""} `)},[()=>E()==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeSteps_label():e.settings_providerProfileKinds_tokenSteps_label()]),a(s,C)};S(ue,s=>{(B()==="add"||m())&&s(Ne)})}var P=o(ue,2);{var je=s=>{ht(s,{get label(){return t(Ye)},get error(){return ae()},control:(H,oe=gt)=>{var j=Ct(),Q=x(j);rt(Q,ft(oe,{type:"password",autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return N()},"data-testid":"provider-profile-secret-input",get value(){return u()},set value(W){u(W)}}));var le=o(Q,2);{var xe=W=>{z(W,{variant:"ghost-light",size:"sm",get disabled(){return N()},onclick:st,children:(ve,re)=>{A();var U=T();n(M=>i(U,M),[()=>e.settings_providerProfileKinds_keepSaved_label()]),a(ve,U)},$$slots:{default:!0}})};S(le,W=>{B()==="edit"&&b()&&W(xe)})}y(j),a(H,j)},$$slots:{control:!0}})},Je=s=>{var C=Kr(),H=x(C),oe=D(H,!0),j=o(H,2),Q=x(j),le=D(Q,!0),xe=o(Q,2);z(xe,{variant:"outline",size:"sm",get disabled(){return K()},onclick:()=>m(!0),children:(W,ve)=>{A();var re=T();n(U=>i(re,U),[()=>e.settings_providerProfileKinds_replace_label()]),a(W,re)},$$slots:{default:!0}}),y(j),y(C),n(W=>{i(oe,t(Ye)),i(le,W)},[()=>e.settings_providerProfileKinds_saved_label()]),a(s,C)};S(P,s=>{t(Fe)?s(je):s(Je,-1)})}var it=o(P,2);{var Qe=s=>{var C=Ar(),H=x(C),oe=x(H);Wt(oe,{get icon(){return Jt},class:"size-3 transition-transform group-open:rotate-90"});var j=o(oe);y(H);var Q=o(H,2),le=x(Q),xe=D(le,!0),W=o(le,2);{var ve=U=>{var M=wr(),ye=x(M),Ee=D(ye,!0),h=o(ye,2);{var L=O=>{var de=Pr(),X=We(de),Pe=D(X,!0),Le=o(X,2);z(Le,{variant:"ghost-light",size:"sm",get disabled(){return K()},onclick:()=>d("keep"),children:(fe,ge)=>{A();var Re=T();n(Se=>i(Re,Se),[()=>e.settings_providerProfileKinds_keepSaved_label()]),a(fe,Re)},$$slots:{default:!0}}),n(fe=>i(Pe,fe),[()=>e.settings_providerProfileKinds_baseUrlRemoved_label()]),a(O,de)},J=O=>{var de=Cr(),X=We(de),Pe=D(X,!0),Le=o(X,2);z(Le,{variant:"outline",size:"sm",get disabled(){return K()},onclick:()=>d("replace"),children:(ge,Re)=>{A();var Se=T();n(v=>i(Se,v),[()=>e.settings_providerProfileKinds_replace_label()]),a(ge,Se)},$$slots:{default:!0}});var fe=o(Le,2);z(fe,{variant:"ghost-light",size:"sm",get disabled(){return K()},onclick:()=>d("remove"),children:(ge,Re)=>{A();var Se=T();n(v=>i(Se,v),[()=>e.settings_providerProfiles_remove_label()]),a(ge,Se)},$$slots:{default:!0}}),n(ge=>i(Pe,ge),[()=>e.settings_providerProfileKinds_saved_label()]),a(O,de)};S(h,O=>{d()==="remove"?O(L):O(J,-1)})}y(M),n(O=>i(Ee,O),[()=>e.settings_providerProfileKinds_baseUrl_label()]),a(U,M)},re=U=>{{const M=(Ee,h=gt)=>{var L=Ct(),J=x(L);rt(J,ft(h,{type:"url",placeholder:ke,autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return K()},"data-testid":"provider-profile-base-url-input",get value(){return Y()},set value(X){Y(X)}}));var O=o(J,2);{var de=X=>{z(X,{variant:"ghost-light",size:"sm",get disabled(){return K()},onclick:()=>{d("keep"),Y("")},children:(Pe,Le)=>{A();var fe=T();n(ge=>i(fe,ge),[()=>e.settings_providerProfileKinds_keepSaved_label()]),a(Pe,fe)},$$slots:{default:!0}})};S(O,X=>{B()==="edit"&&he()&&X(de)})}y(L),a(Ee,L)};let ye=$(()=>e.settings_providerProfileKinds_baseUrl_label());ht(U,{get label(){return t(ye)},control:M,$$slots:{control:!0}})}};S(W,U=>{B()==="edit"&&he()&&d()!=="replace"?U(ve):U(re,-1)})}y(Q),y(C),n((U,M)=>{i(j,` ${U??""}`),i(xe,M)},[()=>e.settings_providerProfileKinds_customEndpoint_label(),()=>e.settings_providerProfileKinds_customEndpoint_description()]),Mt("open","toggle",C,V,V),a(s,C)};S(it,s=>{t(Ae)&&te()&&s(Qe)})}return y(Be),n(()=>ot(Be,"data-kind",E())),a(l,Be),_t(at)}var Er=k('<p class="text-sm text-subtle" role="status" data-testid="gitlab-instance-update-required"> </p>'),Lr=k('<p class="break-all type-caption text-subtle" data-testid="gitlab-connect-instance"> </p>'),Ir=k('<div class="max-w-sm space-y-3" data-testid="gitlab-connect-device-flow"><!> <div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!> <!></div></div>'),Gr=k('<div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!></div>'),zr=k('<p class="text-xs text-danger" role="alert"> </p>'),Ur=k('<div class="max-w-sm space-y-1" data-testid="gitlab-connect-token"><!> <!> <p class="text-xs text-subtle"> <!></p></div> <div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>',1),Or=k('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),Fr=k('<div class="max-w-sm space-y-1"><!> <!> <p class="text-xs text-subtle"> </p> <!></div> <!>',1),Br=k('<p class="text-sm text-subtle" role="status"> </p>'),Nr=k('<div class="space-y-1"><p class="text-sm text-subtle" role="status"> </p> <!></div>'),Rr=k('<p class="text-sm text-danger" role="alert"> </p>'),Hr=k('<div data-testid="gitlab-connect-form"><!> <!> <!> <!> <!></div>');function Mr(l,r){const _=It();if(new.target)return lt({component:Mr,...l});pt(r,!0);const E=()=>we(Ae,"$storedInstance$",d),B=()=>we(st,"$deviceGrantSupported$",d),u=()=>we(Be,"$instanceSetupSupported$",d),b=()=>we(R,"$isAuthenticating$",d),m=()=>we(Te,"$isCancelling$",d),ae=()=>we(Ye,"$deviceFlow$",d),Y=()=>we(Fe,"$cancelOutcome$",d),he=()=>we(at,"$error$",d),[d,V]=Et();let K=f(r,"compact",7,!1),N=f(r,"onCancel",7);const ie=`${_}-host`,ne=`${_}-host-help`,te=`${_}-host-error`,ke=`${_}-token`,Ae=St(),R=$t(),Te=lr(),Fe=dr(),Ye=Kt(),st=cr(),at=pr(),Be=_r();let De=tt(Gt(St.select(Ke.state))),Ve=tt(!1),ue=tt(""),Ne=tt(!1);const P=$(()=>ar(t(De))),je=$(()=>t(Ne)||t(P)===E()&&B()===!1),Je=$(()=>t(P)?nr(t(P)):null),it=$(()=>u()&&t(P)!==null&&t(ue).trim().length>0);bt(()=>{const v=E();t(Ve)||$e(De,v,!0)}),bt(()=>{u()||$e(ue,"")}),zt(()=>{const v=()=>{const c=Ke.state;$t.select(c)&&Kt.select(c)&&Ke.dispatch(xt())};return window.addEventListener("focus",v),()=>window.removeEventListener("focus",v)});function Qe(){!u()||!t(P)||t(P)===E()||b()||m()||Ke.dispatch(sr(t(P)))}function s(){$e(Ve,!0),$e(ue,"")}function C(){!u()||!t(P)||b()||m()||Ke.dispatch(ir(t(P)))}function H(){const v=t(ue).trim();!u()||!v||!t(P)||b()||m()||(Ke.dispatch(or(t(P),v)),$e(ue,""))}function oe(){!u()||m()||(b()&&Ke.dispatch(yt()),$e(Ne,!0))}function j(){$e(Ne,!1)}function Q(){m()||Ke.dispatch(yt())}function le(){t(Je)&&tr(t(Je),{})}function xe(v){v.key==="Enter"&&(v.preventDefault(),Qe(),t(je)?document.getElementById(ke)?.focus():C())}function W(v){v.key==="Enter"&&(v.preventDefault(),H())}const ve=$(()=>K()?"sm":"xl"),re=$(()=>K()?"sm":"default");var U={get compact(){return K()},set compact(v=!1){K(v),g()},get onCancel(){return N()},set onCancel(v){N(v),g()},$set:dt,$on:(v,c)=>ct(r,v,c)},M=Hr();{const v=c=>{z(c,{variant:"ghost",size:"sm",type:"button",class:"text-muted-foreground hover:text-foreground",get disabled(){return m()},onclick:Q,children:(p,w)=>{A();var F=T();n(ce=>i(F,ce),[()=>m()?e.lib_gitlabConnect_cancelling_label():e.lib_gitlabConnect_cancel_label()]),a(p,F)},$$slots:{default:!0}})};var ye=x(M);{var Ee=c=>{var p=Er(),w=D(p,!0);n(F=>i(w,F),[()=>e.lib_gitlabConnect_updateRequired_description()]),a(c,p)};S(ye,c=>{u()||c(Ee)})}var h=o(ye,2);{var L=c=>{var p=Lr(),w=D(p,!0);n(()=>i(w,E())),a(c,p)};S(h,c=>{(b()||m())&&c(L)})}var J=o(h,2);{var O=c=>{var p=Ir(),w=x(p);{let Ge=$(()=>e.lib_gitlabConnect_openGitlab_label());Zt(w,{get userCode(){return ae().userCode},get verificationUri(){return ae().verificationUri},get openLabel(){return t(Ge)},get compact(){return K()}})}var F=o(w,2),ce=x(F);mt(ce,{size:16,class:"shrink-0"});var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{let Ge=$(()=>m()||!u());z(Ie,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return t(Ge)},onclick:oe,children:(nt,ut)=>{A();var I=T();n(q=>i(I,q),[()=>e.lib_gitlabConnect_useToken_label()]),a(nt,I)},$$slots:{default:!0}})}var qe=o(Ie,2);v(qe),y(F),y(p),n(Ge=>i(He,Ge),[()=>e.lib_gitlabConnect_waitingForAuthorization_label()]),a(c,p)},de=c=>{var p=Gr(),w=x(p);mt(w,{size:16,class:"shrink-0"});var F=o(w,2),ce=D(F,!0),se=o(F,2);v(se),y(p),n(He=>i(ce,He),[()=>e.lib_gitlabConnect_connecting_label()]),a(c,p)},X=c=>{var p=Fr(),w=We(p),F=x(w);kt(F,{get for(){return ie},children:(I,q)=>{A();var Z=T();n(pe=>i(Z,pe),[()=>e.lib_gitlabConnect_host_label()]),a(I,Z)},$$slots:{default:!0}});var ce=o(F,2);{let I=$(()=>!u()),q=$(()=>!t(P)||void 0),Z=$(()=>t(P)?ne:`${ne} ${te}`);rt(ce,{get id(){return ie},type:"text",autocomplete:"url",spellcheck:!1,get disabled(){return t(I)},get"aria-invalid"(){return t(q)},get"aria-describedby"(){return t(Z)},get placeholder(){return rr},oninput:s,onchange:Qe,onkeydown:xe,get value(){return t(De)},set value(pe){$e(De,pe,!0)}})}var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{var qe=I=>{var q=zr(),Z=D(q,!0);n(pe=>{ot(q,"id",te),i(Z,pe)},[()=>e.lib_gitlabConnect_invalidInstance_error()]),a(I,q)};S(Ie,I=>{t(P)||I(qe)})}y(w);var Ge=o(w,2);{var nt=I=>{var q=Ur(),Z=We(q),pe=x(Z);kt(pe,{get for(){return ke},children:(G,me)=>{A();var Me=T();n(ee=>i(Me,ee),[()=>e.lib_gitlabConnect_token_label()]),a(G,Me)},$$slots:{default:!0}});var Xe=o(pe,2);{let G=$(()=>!u());rt(Xe,{get id(){return ke},type:"password",autocomplete:"off",get disabled(){return t(G)},placeholder:"glpat-...",onkeydown:W,get value(){return t(ue)},set value(me){$e(ue,me,!0)}})}var Ze=o(Xe,2),be=x(Ze),ze=o(be);{var et=G=>{z(G,{variant:"link",size:"sm",type:"button",class:"h-auto px-0 text-xs",onclick:le,children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_createToken_label({host:t(P)})]),a(me,ee)},$$slots:{default:!0}})};S(ze,G=>{t(Je)&&t(P)&&G(et)})}y(Ze),y(Z);var _e=o(Z,2),Ce=x(_e);{let G=$(()=>!t(it));z(Ce,{variant:"primary",get size(){return t(ve)},type:"button",onclick:H,get disabled(){return t(G)},children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_connect_label()]),a(me,ee)},$$slots:{default:!0}})}var vt=o(Ce,2);{var At=G=>{z(G,{variant:"ghost",get size(){return t(re)},type:"button",onclick:j,children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_useDevice_label()]),a(me,ee)},$$slots:{default:!0}})};S(vt,G=>{t(Ne)&&!(t(P)===E()&&B()===!1)&&G(At)})}var Tt=o(vt,2);{var Dt=G=>{z(G,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return N()},children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_cancel_label()]),a(me,ee)},$$slots:{default:!0}})};S(Tt,G=>{N()&&G(Dt)})}y(_e),n(G=>i(be,`${G??""} `),[()=>e.lib_gitlabConnect_token_description()]),a(I,q)},ut=I=>{var q=Or(),Z=x(q);{let be=$(()=>!t(P)||!u());z(Z,{variant:"primary",get size(){return t(ve)},type:"button",onclick:C,get disabled(){return t(be)},children:(ze,et)=>{A();var _e=T();n(Ce=>i(_e,Ce),[()=>e.lib_gitlabConnect_connect_label()]),a(ze,_e)},$$slots:{default:!0}})}var pe=o(Z,2);{let be=$(()=>!u());z(pe,{variant:"ghost",get size(){return t(re)},type:"button",get disabled(){return t(be)},onclick:oe,children:(ze,et)=>{A();var _e=T();n(Ce=>i(_e,Ce),[()=>e.lib_gitlabConnect_useToken_label()]),a(ze,_e)},$$slots:{default:!0}})}var Xe=o(pe,2);{var Ze=be=>{z(be,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return N()},children:(ze,et)=>{A();var _e=T();n(Ce=>i(_e,Ce),[()=>e.lib_gitlabConnect_cancel_label()]),a(ze,_e)},$$slots:{default:!0}})};S(Xe,be=>{N()&&be(Ze)})}y(q),a(I,q)};S(Ge,I=>{t(je)?I(nt):I(ut,-1)})}n(I=>{ot(se,"id",ne),i(He,I)},[()=>e.lib_gitlabConnect_host_description()]),a(c,p)};S(J,c=>{(b()||m())&&ae()?c(O):b()||m()?c(de,1):c(X,-1)})}var Pe=o(J,2);{var Le=c=>{var p=Br(),w=D(p,!0);n(F=>i(w,F),[()=>e.lib_gitlabConnect_cancelled_label()]),a(c,p)},fe=c=>{var p=Nr(),w=x(p),F=D(w,!0),ce=o(w,2);z(ce,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return m()},onclick:()=>Ke.dispatch(xt()),children:(se,He)=>{A();var Ie=T();n(qe=>i(Ie,qe),[()=>e.lib_gitlabConnect_checkStatus_label()]),a(se,Ie)},$$slots:{default:!0}}),y(p),n(se=>i(F,se),[()=>Y()==="already-started"?e.lib_gitlabConnect_alreadyStarted_description():e.lib_gitlabConnect_cancelFailed_description()]),a(c,p)};S(Pe,c=>{Y()==="cancelled"?c(Le):(Y()==="already-started"||Y()==="failed")&&c(fe,1)})}var ge=o(Pe,2);{var Re=c=>{var p=Rr(),w=D(p,!0);n(()=>i(w,he())),a(c,p)};S(ge,c=>{he()&&c(Re)})}y(M)}n(()=>Bt(M,1,Nt(K()?"space-y-2":"space-y-4"))),a(l,M);var Se=_t(U);return V(),Se}const wt=[{id:"people",get label(){return e.workspace_peopleTile_title()},icon:qt,description:""},{id:"agents",get label(){return e.workspace_multiSelectSidebar_agentsTab_label()},icon:Yt,get description(){return e.workspace_multiSelectSidebar_agentsTab_description()}},{id:"context",get label(){return e.workspace_multiSelectSidebar_contextTab_label()},icon:ur.note,get description(){return e.workspace_multiSelectSidebar_contextTab_description()}},{id:"changes",get label(){return e.workspace_multiSelectSidebar_changesTab_label()},icon:Vt,get description(){return e.workspace_multiSelectSidebar_changesTab_description()}},{id:"files",get label(){return e.workspace_multiSelectSidebar_filesTab_label()},icon:jt,get description(){return e.workspace_multiSelectSidebar_filesTab_description()}},{id:"browser",get label(){return e.workspace_multiSelectSidebar_browserTab_label()},icon:Qt,get description(){return e.workspace_multiSelectSidebar_browserTab_description()}},{id:"shell",get label(){return e.workspace_multiSelectSidebar_shellTab_label()},icon:Xt,get description(){return e.workspace_multiSelectSidebar_shellTab_description()}}];function Wr(l){return wt.some(r=>r.id===l)}const Jr=new Set(["browser","shell"]),Ks=new Set(["context","changes","files","browser","shell"]),qr=new Set(["changes"]);function Ps(l,r=!1,_=!0,E=!1,B=!1){const u=l.filter(b=>Wr(b)&&(b!=="people"||_)&&!(B&&qr.has(b))&&!(r&&Jr.has(b)&&!(b==="shell"&&E)));return new Set(u.length>0?u:["agents"])}function Yr(l){const r=new Set(l);return wt.flatMap(({id:_})=>r.has(_)?[_]:[])}function Cs(l,r){const _=new Set(l);return _.has(r)?_.size>1&&_.delete(r):_.add(r),Yr(_)}export{qr as G,Ks as H,fr as M,Jr as O,Dr as P,wt as T,Mr as a,hr as b,$s as c,mr as k,Ps as n,Yr as o,Ss as s,Cs as t};
1
+ import{t as lt,bo as f,bw as dt,b as ct,bm as e,br as ft,bs as we,bq as Et}from"./YLhFQnIu.js";import{bs as pt,ay as We,be as A,b$ as T,b_ as n,bO as i,W as a,bS as o,bl as D,bn as _t,aA as g,a7 as Lt,aD as t,c9 as $,aB as k,a5 as x,bA as y,bf as gt,bo as It,bV as tt,br as Gt,ca as bt,bH as $e,bk as zt}from"./3SdAC2_C.js";import{g as Ut,i as Ot,I as mt}from"./oBIu7LTI.js";import{c as Ft}from"./DwGyIIXK.js";import{s as ot,f as Bt,c as Nt}from"./BQhBnAuP.js";import{f as z}from"./Cw2fqKk9.js";import"./DJivXy66.js";import"./WvHbj6rB.js";import{b as Rt}from"./DRLJuUwT.js";import"./kvtKUeBe.js";import"./KtEuoG00.js";import{b as Ht}from"./DPG1HUgG.js";import{i as S}from"./YeOAvjnW.js";import{b as Mt}from"./D3yXvqwY.js";import{F as Wt,ay as Jt,c_ as qt,cn as Yt,aN as Vt,bn as jt,d0 as Qt,cK as Xt}from"./gwv5JQYH.js";import"./CrpUtGFn.js";import{F as ht,G as Zt}from"./DQZhKtkC.js";import"./CIWQMI37.js";/* empty css */import{C as er}from"./CZB2ndi9.js";import{L as kt}from"./DwiE5WsI.js";import{I as rt}from"./DkERMj5B.js";import"./DtkIwON_.js";import"./BNDTLRE1.js";import{h as tr}from"./FhJRiT1S.js";import{Jx as Ke,fC as xt,J as rr,ep as yt,r6 as sr,uB as ar,Jo as ir,oE as nr,hS as or}from"./D5wnbxHp.js";import{aB as St,aC as $t,aD as lr,aw as dr,ax as Kt,ay as cr,az as pr,aH as _r}from"./CV7mOfKN.js";import{R as ur}from"./BP-cDE7g.js";var vr=k('<!> <p class="type-body"> </p>',1);function fr(l,r){if(new.target)return lt({component:fr,...l});pt(r,!0);let _=f(r,"open",15,!1),E=f(r,"static",7,!1),B=f(r,"title",7),u=f(r,"message",7),b=f(r,"buttons",7),m=f(r,"cancelIndex",7,0),ae=f(r,"onSelect",7);function Y(d){_(!1),ae()?.(d)}var he={get open(){return _()},set open(d=!1){_(d),g()},get static(){return E()},set static(d=!1){E(d),g()},get title(){return B()},set title(d){B(d),g()},get message(){return u()},set message(d){u(d),g()},get buttons(){return b()},set buttons(d){b(d),g()},get cancelIndex(){return m()},set cancelIndex(d=0){m(d),g()},get onSelect(){return ae()},set onSelect(d){ae(d),g()},$set:dt,$on:(d,V)=>ct(r,d,V)};return Ht(l,{get static(){return E()},role:"alertdialog",get title(){return B()},dismissOnInteractOutside:!1,focusContent:!0,onSubmit:()=>Y(b().length-1),onCancel:()=>Y(m()),get open(){return _()},set open(V){_(V)},footer:V=>{var K=Lt(),N=We(K);Ut(N,17,b,Ot,(ie,ne,te)=>{{let ke=$(()=>te===m()?"ghost":te===b().length-1?"primary":"outline");z(ie,{get variant(){return t(ke)},onclick:()=>Y(te),children:(Ae,R)=>{A();var Te=T();n(()=>i(Te,t(ne))),a(Ae,Te)},$$slots:{default:!0}})}}),a(V,K)},children:(V,K)=>{var N=vr(),ie=We(N);Ft(ie,()=>Rt,(ke,Ae)=>{Ae(ke,{class:"sr-only",children:(R,Te)=>{A();var Fe=T();n(()=>i(Fe,u())),a(R,Fe)},$$slots:{default:!0}})});var ne=o(ie,2),te=D(ne,!0);n(()=>i(te,u())),a(V,N)},$$slots:{footer:!0,default:!0}}),_t(he)}const Oe={anthropicKeys:"https://console.anthropic.com/settings/keys",openAiKeys:"https://platform.openai.com/api-keys",openAiTokens:"https://developers.openai.com/codex/enterprise/access-tokens",xaiConsole:"https://console.x.ai",factoryKeys:"https://app.factory.ai/settings/api-keys",cursorDashboard:"https://cursor.com/dashboard?tab=integrations",auggieAuth:"https://docs.augmentcode.com/cli/setup-auggie/authentication"},gr="claude setup-token",br="auggie token print";function mr(l,r){if(r==="differentLogin")return e.settings_providerProfileKinds_differentLogin_description();if(r==="token")return l==="codex"?e.settings_providerProfileKinds_tokenCodex_description():l==="auggie"?e.settings_providerProfileKinds_tokenAuggie_description():e.settings_providerProfileKinds_tokenClaude_description();switch(l){case"codex":return e.settings_providerProfileKinds_apiKeyCodex_description();case"grok":return e.settings_providerProfileKinds_apiKeyGrok_description();case"droid":return e.settings_providerProfileKinds_apiKeyDroid_description();case"cursor":return e.settings_providerProfileKinds_apiKeyCursor_description();default:return e.settings_providerProfileKinds_apiKeyClaude_description()}}function hr(l,r){return r==="apiKey"?e.settings_providerProfileKinds_apiKey_label():l==="auggie"?e.settings_providerProfileKinds_tokenAuggie_label():e.settings_providerProfileKinds_token_label()}function Ss(l,r){return l!=="claude"&&l!=="codex"?mr(l,r):r==="token"?l==="codex"?e.settings_providerProfileKinds_tokenCodexDialog_description():e.settings_providerProfileKinds_tokenClaudeDialog_description():l==="codex"?e.settings_providerProfileKinds_apiKeyCodexDialog_description():e.settings_providerProfileKinds_apiKeyClaudeDialog_description()}function kr(l,r){if(r==="token")return l==="codex"?{steps:[e.settings_providerProfileKinds_tokenCodexStep1_label()],link:{href:Oe.openAiTokens,label:e.settings_providerProfileKinds_openAiAccessTokens_link()},eligibility:e.settings_providerProfileKinds_tokenCodexEligibility_description()}:l==="auggie"?{steps:[e.settings_providerProfileKinds_tokenAuggieStep1_label(),e.settings_providerProfileKinds_tokenAuggieStep2_label()],command:br,link:{href:Oe.auggieAuth,label:e.settings_providerProfileKinds_auggieAuthDocs_link()}}:{steps:[e.settings_providerProfileKinds_tokenClaudeStep1_label(),e.settings_providerProfileKinds_tokenClaudeStep2_label()],command:gr};switch(l){case"codex":return{steps:[e.settings_providerProfileKinds_apiKeyCodexStep1_label(),e.settings_providerProfileKinds_apiKeyCodexStep2_label()],link:{href:Oe.openAiKeys,label:e.settings_providerProfileKinds_openAiApiKeys_link()}};case"grok":return{steps:[e.settings_providerProfileKinds_apiKeyGrokStep1_label(),e.settings_providerProfileKinds_apiKeyGrokStep2_label()],link:{href:Oe.xaiConsole,label:e.settings_providerProfileKinds_xaiConsole_link()}};case"droid":return{steps:[e.settings_providerProfileKinds_apiKeyDroidStep1_label(),e.settings_providerProfileKinds_apiKeyDroidStep2_label()],link:{href:Oe.factoryKeys,label:e.settings_providerProfileKinds_factoryApiKeys_link()}};case"cursor":return{steps:[e.settings_providerProfileKinds_apiKeyCursorStep1_label(),e.settings_providerProfileKinds_apiKeyCursorStep2_label()],link:{href:Oe.cursorDashboard,label:e.settings_providerProfileKinds_cursorDashboard_link()}};default:return{steps:[e.settings_providerProfileKinds_apiKeyClaudeStep1_label(),e.settings_providerProfileKinds_apiKeyClaudeStep2_label()],link:{href:Oe.anthropicKeys,label:e.settings_providerProfileKinds_anthropicConsole_link()}}}}function xr(l,r){return r?l==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeStep3_label():e.settings_providerProfileKinds_tokenClaudeStep3_label():e.settings_providerProfileKinds_pasteNoCheck_label()}function $s(l,r){if(r==="token")return l==="codex"?e.settings_providerProfileKinds_tokenNotJwt_error():l==="auggie"?e.settings_providerProfileKinds_tokenShapeAuggie_error():e.settings_providerProfileKinds_tokenShapeClaude_error();switch(l){case"codex":return e.settings_providerProfileKinds_keyShapeCodex_error();case"grok":return e.settings_providerProfileKinds_keyShapeGrok_error();case"droid":return e.settings_providerProfileKinds_keyShapeDroid_error();case"cursor":return e.settings_providerProfileKinds_keyShapeCursor_error();default:return e.settings_providerProfileKinds_keyShapeClaude_error()}}var yr=k('<p class="type-body text-muted-foreground" data-testid="provider-profile-token-eligibility"> </p>'),Sr=k('<span class="mt-1 flex items-center gap-2" data-testid="provider-profile-setup-token"><code class="rounded border border-border bg-muted px-1.5 py-0.5 font-mono type-caption text-foreground"> </code> <!></span>'),Pt=k("<li> </li>"),$r=k('<section class="space-y-2" data-testid="provider-profile-secret-steps"><h3 class="type-body font-medium! text-foreground"> </h3> <ol class="type-body list-decimal space-y-1 pl-5 text-muted-foreground"><li> <!></li> <!> <!></ol> <!></section>'),Ct=k('<div class="flex items-center gap-2"><!> <!></div>'),Kr=k('<div class="space-y-2" data-testid="provider-profile-secret-saved"><p class="type-body text-foreground"> </p> <div class="flex items-center gap-3"><span class="type-body font-mono text-muted-foreground"> </span> <!></div></div>'),Pr=k('<span class="type-body text-muted-foreground"> </span> <!>',1),Cr=k('<span class="type-body font-mono text-muted-foreground"> </span> <!> <!>',1),wr=k('<div class="flex flex-wrap items-center gap-3" data-testid="provider-profile-base-url-saved"><span class="type-body text-foreground"> </span> <!></div>'),Ar=k('<details class="group rounded-md border border-border" data-testid="provider-profile-custom-endpoint"><summary class="flex cursor-pointer list-none items-center gap-2 px-3 py-2 type-body text-foreground [&amp;::-webkit-details-marker]:hidden"><!> </summary> <div class="space-y-2 border-t border-border px-3 py-3"><p class="type-caption text-muted-foreground"> </p> <!></div></details>'),Tr=k('<div class="space-y-5" data-testid="provider-profile-secret"><!> <!> <!> <!></div>');function Dr(l,r){if(new.target)return lt({component:Dr,...l});pt(r,!0);let _=f(r,"provider",7),E=f(r,"kind",7),B=f(r,"mode",7),u=f(r,"secret",15,""),b=f(r,"secretSaved",7,!1),m=f(r,"replacing",15,!1),ae=f(r,"secretError",7),Y=f(r,"baseUrl",15,""),he=f(r,"baseUrlSaved",7,!1),d=f(r,"baseUrlAction",15,"keep"),V=f(r,"customEndpointOpen",15,!1),K=f(r,"disabled",7,!1),N=f(r,"secretDisabled",23,K),ie=f(r,"keyCheck",7,!0),ne=f(r,"pasteStep",7,!0),te=f(r,"customEndpoint",7,!0);const ke="https://",Ae=$(()=>_()==="claude"&&E()==="apiKey"),R=$(()=>kr(_(),E())),Te=$(()=>xr(E(),ie())),Fe=$(()=>B()==="add"||!b()||m()),Ye=$(()=>hr(_(),E()));function st(){m(!1),u("")}var at={get provider(){return _()},set provider(s){_(s),g()},get kind(){return E()},set kind(s){E(s),g()},get mode(){return B()},set mode(s){B(s),g()},get secret(){return u()},set secret(s=""){u(s),g()},get secretSaved(){return b()},set secretSaved(s=!1){b(s),g()},get replacing(){return m()},set replacing(s=!1){m(s),g()},get secretError(){return ae()},set secretError(s){ae(s),g()},get baseUrl(){return Y()},set baseUrl(s=""){Y(s),g()},get baseUrlSaved(){return he()},set baseUrlSaved(s=!1){he(s),g()},get baseUrlAction(){return d()},set baseUrlAction(s="keep"){d(s),g()},get customEndpointOpen(){return V()},set customEndpointOpen(s=!1){V(s),g()},get disabled(){return K()},set disabled(s=!1){K(s),g()},get secretDisabled(){return N()},set secretDisabled(s=K){N(s),g()},get keyCheck(){return ie()},set keyCheck(s=!0){ie(s),g()},get pasteStep(){return ne()},set pasteStep(s=!0){ne(s),g()},get customEndpoint(){return te()},set customEndpoint(s=!0){te(s),g()},$set:dt,$on:(s,C)=>ct(r,s,C)},Be=Tr(),De=x(Be);{var Ve=s=>{var C=yr(),H=D(C,!0);n(()=>i(H,t(R).eligibility)),a(s,C)};S(De,s=>{t(R).eligibility&&s(Ve)})}var ue=o(De,2);{var Ne=s=>{var C=$r(),H=x(C),oe=D(H,!0),j=o(H,2),Q=x(j),le=x(Q),xe=o(le);{var W=h=>{var L=Sr(),J=x(L),O=D(J,!0),de=o(J,2);er(de,{get text(){return t(R).command},size:"sm"}),y(L),n(()=>i(O,t(R).command)),a(h,L)};S(xe,h=>{t(R).command&&h(W)})}y(Q);var ve=o(Q,2);{var re=h=>{var L=Pt(),J=D(L,!0);n(()=>i(J,t(R).steps[1])),a(h,L)};S(ve,h=>{t(R).steps[1]&&h(re)})}var U=o(ve,2);{var M=h=>{var L=Pt(),J=D(L,!0);n(()=>i(J,t(Te))),a(h,L)};S(U,h=>{ne()&&h(M)})}y(j);var ye=o(j,2);{var Ee=h=>{z(h,{variant:"link",size:"sm",get href(){return t(R).link.href},target:"_blank",rel:"noopener noreferrer",class:"h-auto px-0",children:(L,J)=>{A();var O=T();n(()=>i(O,t(R).link.label)),a(L,O)},$$slots:{default:!0}})};S(ye,h=>{t(R).link&&h(Ee)})}y(C),n(h=>{i(oe,h),i(le,`${t(R).steps[0]??""} `)},[()=>E()==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeSteps_label():e.settings_providerProfileKinds_tokenSteps_label()]),a(s,C)};S(ue,s=>{(B()==="add"||m())&&s(Ne)})}var P=o(ue,2);{var je=s=>{ht(s,{get label(){return t(Ye)},get error(){return ae()},control:(H,oe=gt)=>{var j=Ct(),Q=x(j);rt(Q,ft(oe,{type:"password",autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return N()},"data-testid":"provider-profile-secret-input",get value(){return u()},set value(W){u(W)}}));var le=o(Q,2);{var xe=W=>{z(W,{variant:"ghost-light",size:"sm",get disabled(){return N()},onclick:st,children:(ve,re)=>{A();var U=T();n(M=>i(U,M),[()=>e.settings_providerProfileKinds_keepSaved_label()]),a(ve,U)},$$slots:{default:!0}})};S(le,W=>{B()==="edit"&&b()&&W(xe)})}y(j),a(H,j)},$$slots:{control:!0}})},Je=s=>{var C=Kr(),H=x(C),oe=D(H,!0),j=o(H,2),Q=x(j),le=D(Q,!0),xe=o(Q,2);z(xe,{variant:"outline",size:"sm",get disabled(){return K()},onclick:()=>m(!0),children:(W,ve)=>{A();var re=T();n(U=>i(re,U),[()=>e.settings_providerProfileKinds_replace_label()]),a(W,re)},$$slots:{default:!0}}),y(j),y(C),n(W=>{i(oe,t(Ye)),i(le,W)},[()=>e.settings_providerProfileKinds_saved_label()]),a(s,C)};S(P,s=>{t(Fe)?s(je):s(Je,-1)})}var it=o(P,2);{var Qe=s=>{var C=Ar(),H=x(C),oe=x(H);Wt(oe,{get icon(){return Jt},class:"size-3 transition-transform group-open:rotate-90"});var j=o(oe);y(H);var Q=o(H,2),le=x(Q),xe=D(le,!0),W=o(le,2);{var ve=U=>{var M=wr(),ye=x(M),Ee=D(ye,!0),h=o(ye,2);{var L=O=>{var de=Pr(),X=We(de),Pe=D(X,!0),Le=o(X,2);z(Le,{variant:"ghost-light",size:"sm",get disabled(){return K()},onclick:()=>d("keep"),children:(fe,ge)=>{A();var Re=T();n(Se=>i(Re,Se),[()=>e.settings_providerProfileKinds_keepSaved_label()]),a(fe,Re)},$$slots:{default:!0}}),n(fe=>i(Pe,fe),[()=>e.settings_providerProfileKinds_baseUrlRemoved_label()]),a(O,de)},J=O=>{var de=Cr(),X=We(de),Pe=D(X,!0),Le=o(X,2);z(Le,{variant:"outline",size:"sm",get disabled(){return K()},onclick:()=>d("replace"),children:(ge,Re)=>{A();var Se=T();n(v=>i(Se,v),[()=>e.settings_providerProfileKinds_replace_label()]),a(ge,Se)},$$slots:{default:!0}});var fe=o(Le,2);z(fe,{variant:"ghost-light",size:"sm",get disabled(){return K()},onclick:()=>d("remove"),children:(ge,Re)=>{A();var Se=T();n(v=>i(Se,v),[()=>e.settings_providerProfiles_remove_label()]),a(ge,Se)},$$slots:{default:!0}}),n(ge=>i(Pe,ge),[()=>e.settings_providerProfileKinds_saved_label()]),a(O,de)};S(h,O=>{d()==="remove"?O(L):O(J,-1)})}y(M),n(O=>i(Ee,O),[()=>e.settings_providerProfileKinds_baseUrl_label()]),a(U,M)},re=U=>{{const M=(Ee,h=gt)=>{var L=Ct(),J=x(L);rt(J,ft(h,{type:"url",placeholder:ke,autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return K()},"data-testid":"provider-profile-base-url-input",get value(){return Y()},set value(X){Y(X)}}));var O=o(J,2);{var de=X=>{z(X,{variant:"ghost-light",size:"sm",get disabled(){return K()},onclick:()=>{d("keep"),Y("")},children:(Pe,Le)=>{A();var fe=T();n(ge=>i(fe,ge),[()=>e.settings_providerProfileKinds_keepSaved_label()]),a(Pe,fe)},$$slots:{default:!0}})};S(O,X=>{B()==="edit"&&he()&&X(de)})}y(L),a(Ee,L)};let ye=$(()=>e.settings_providerProfileKinds_baseUrl_label());ht(U,{get label(){return t(ye)},control:M,$$slots:{control:!0}})}};S(W,U=>{B()==="edit"&&he()&&d()!=="replace"?U(ve):U(re,-1)})}y(Q),y(C),n((U,M)=>{i(j,` ${U??""}`),i(xe,M)},[()=>e.settings_providerProfileKinds_customEndpoint_label(),()=>e.settings_providerProfileKinds_customEndpoint_description()]),Mt("open","toggle",C,V,V),a(s,C)};S(it,s=>{t(Ae)&&te()&&s(Qe)})}return y(Be),n(()=>ot(Be,"data-kind",E())),a(l,Be),_t(at)}var Er=k('<p class="text-sm text-subtle" role="status" data-testid="gitlab-instance-update-required"> </p>'),Lr=k('<p class="break-all type-caption text-subtle" data-testid="gitlab-connect-instance"> </p>'),Ir=k('<div class="max-w-sm space-y-3" data-testid="gitlab-connect-device-flow"><!> <div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!> <!></div></div>'),Gr=k('<div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!></div>'),zr=k('<p class="text-xs text-danger" role="alert"> </p>'),Ur=k('<div class="max-w-sm space-y-1" data-testid="gitlab-connect-token"><!> <!> <p class="text-xs text-subtle"> <!></p></div> <div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>',1),Or=k('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),Fr=k('<div class="max-w-sm space-y-1"><!> <!> <p class="text-xs text-subtle"> </p> <!></div> <!>',1),Br=k('<p class="text-sm text-subtle" role="status"> </p>'),Nr=k('<div class="space-y-1"><p class="text-sm text-subtle" role="status"> </p> <!></div>'),Rr=k('<p class="text-sm text-danger" role="alert"> </p>'),Hr=k('<div data-testid="gitlab-connect-form"><!> <!> <!> <!> <!></div>');function Mr(l,r){const _=It();if(new.target)return lt({component:Mr,...l});pt(r,!0);const E=()=>we(Ae,"$storedInstance$",d),B=()=>we(st,"$deviceGrantSupported$",d),u=()=>we(Be,"$instanceSetupSupported$",d),b=()=>we(R,"$isAuthenticating$",d),m=()=>we(Te,"$isCancelling$",d),ae=()=>we(Ye,"$deviceFlow$",d),Y=()=>we(Fe,"$cancelOutcome$",d),he=()=>we(at,"$error$",d),[d,V]=Et();let K=f(r,"compact",7,!1),N=f(r,"onCancel",7);const ie=`${_}-host`,ne=`${_}-host-help`,te=`${_}-host-error`,ke=`${_}-token`,Ae=St(),R=$t(),Te=lr(),Fe=dr(),Ye=Kt(),st=cr(),at=pr(),Be=_r();let De=tt(Gt(St.select(Ke.state))),Ve=tt(!1),ue=tt(""),Ne=tt(!1);const P=$(()=>ar(t(De))),je=$(()=>t(Ne)||t(P)===E()&&B()===!1),Je=$(()=>t(P)?nr(t(P)):null),it=$(()=>u()&&t(P)!==null&&t(ue).trim().length>0);bt(()=>{const v=E();t(Ve)||$e(De,v,!0)}),bt(()=>{u()||$e(ue,"")}),zt(()=>{const v=()=>{const c=Ke.state;$t.select(c)&&Kt.select(c)&&Ke.dispatch(xt())};return window.addEventListener("focus",v),()=>window.removeEventListener("focus",v)});function Qe(){!u()||!t(P)||t(P)===E()||b()||m()||Ke.dispatch(sr(t(P)))}function s(){$e(Ve,!0),$e(ue,"")}function C(){!u()||!t(P)||b()||m()||Ke.dispatch(ir(t(P)))}function H(){const v=t(ue).trim();!u()||!v||!t(P)||b()||m()||(Ke.dispatch(or(t(P),v)),$e(ue,""))}function oe(){!u()||m()||(b()&&Ke.dispatch(yt()),$e(Ne,!0))}function j(){$e(Ne,!1)}function Q(){m()||Ke.dispatch(yt())}function le(){t(Je)&&tr(t(Je),{})}function xe(v){v.key==="Enter"&&(v.preventDefault(),Qe(),t(je)?document.getElementById(ke)?.focus():C())}function W(v){v.key==="Enter"&&(v.preventDefault(),H())}const ve=$(()=>K()?"sm":"xl"),re=$(()=>K()?"sm":"default");var U={get compact(){return K()},set compact(v=!1){K(v),g()},get onCancel(){return N()},set onCancel(v){N(v),g()},$set:dt,$on:(v,c)=>ct(r,v,c)},M=Hr();{const v=c=>{z(c,{variant:"ghost",size:"sm",type:"button",class:"text-muted-foreground hover:text-foreground",get disabled(){return m()},onclick:Q,children:(p,w)=>{A();var F=T();n(ce=>i(F,ce),[()=>m()?e.lib_gitlabConnect_cancelling_label():e.lib_gitlabConnect_cancel_label()]),a(p,F)},$$slots:{default:!0}})};var ye=x(M);{var Ee=c=>{var p=Er(),w=D(p,!0);n(F=>i(w,F),[()=>e.lib_gitlabConnect_updateRequired_description()]),a(c,p)};S(ye,c=>{u()||c(Ee)})}var h=o(ye,2);{var L=c=>{var p=Lr(),w=D(p,!0);n(()=>i(w,E())),a(c,p)};S(h,c=>{(b()||m())&&c(L)})}var J=o(h,2);{var O=c=>{var p=Ir(),w=x(p);{let Ge=$(()=>e.lib_gitlabConnect_openGitlab_label());Zt(w,{get userCode(){return ae().userCode},get verificationUri(){return ae().verificationUri},get openLabel(){return t(Ge)},get compact(){return K()}})}var F=o(w,2),ce=x(F);mt(ce,{size:16,class:"shrink-0"});var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{let Ge=$(()=>m()||!u());z(Ie,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return t(Ge)},onclick:oe,children:(nt,ut)=>{A();var I=T();n(q=>i(I,q),[()=>e.lib_gitlabConnect_useToken_label()]),a(nt,I)},$$slots:{default:!0}})}var qe=o(Ie,2);v(qe),y(F),y(p),n(Ge=>i(He,Ge),[()=>e.lib_gitlabConnect_waitingForAuthorization_label()]),a(c,p)},de=c=>{var p=Gr(),w=x(p);mt(w,{size:16,class:"shrink-0"});var F=o(w,2),ce=D(F,!0),se=o(F,2);v(se),y(p),n(He=>i(ce,He),[()=>e.lib_gitlabConnect_connecting_label()]),a(c,p)},X=c=>{var p=Fr(),w=We(p),F=x(w);kt(F,{get for(){return ie},children:(I,q)=>{A();var Z=T();n(pe=>i(Z,pe),[()=>e.lib_gitlabConnect_host_label()]),a(I,Z)},$$slots:{default:!0}});var ce=o(F,2);{let I=$(()=>!u()),q=$(()=>!t(P)||void 0),Z=$(()=>t(P)?ne:`${ne} ${te}`);rt(ce,{get id(){return ie},type:"text",autocomplete:"url",spellcheck:!1,get disabled(){return t(I)},get"aria-invalid"(){return t(q)},get"aria-describedby"(){return t(Z)},get placeholder(){return rr},oninput:s,onchange:Qe,onkeydown:xe,get value(){return t(De)},set value(pe){$e(De,pe,!0)}})}var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{var qe=I=>{var q=zr(),Z=D(q,!0);n(pe=>{ot(q,"id",te),i(Z,pe)},[()=>e.lib_gitlabConnect_invalidInstance_error()]),a(I,q)};S(Ie,I=>{t(P)||I(qe)})}y(w);var Ge=o(w,2);{var nt=I=>{var q=Ur(),Z=We(q),pe=x(Z);kt(pe,{get for(){return ke},children:(G,me)=>{A();var Me=T();n(ee=>i(Me,ee),[()=>e.lib_gitlabConnect_token_label()]),a(G,Me)},$$slots:{default:!0}});var Xe=o(pe,2);{let G=$(()=>!u());rt(Xe,{get id(){return ke},type:"password",autocomplete:"off",get disabled(){return t(G)},placeholder:"glpat-...",onkeydown:W,get value(){return t(ue)},set value(me){$e(ue,me,!0)}})}var Ze=o(Xe,2),be=x(Ze),ze=o(be);{var et=G=>{z(G,{variant:"link",size:"sm",type:"button",class:"h-auto px-0 text-xs",onclick:le,children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_createToken_label({host:t(P)})]),a(me,ee)},$$slots:{default:!0}})};S(ze,G=>{t(Je)&&t(P)&&G(et)})}y(Ze),y(Z);var _e=o(Z,2),Ce=x(_e);{let G=$(()=>!t(it));z(Ce,{variant:"primary",get size(){return t(ve)},type:"button",onclick:H,get disabled(){return t(G)},children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_connect_label()]),a(me,ee)},$$slots:{default:!0}})}var vt=o(Ce,2);{var At=G=>{z(G,{variant:"ghost",get size(){return t(re)},type:"button",onclick:j,children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_useDevice_label()]),a(me,ee)},$$slots:{default:!0}})};S(vt,G=>{t(Ne)&&!(t(P)===E()&&B()===!1)&&G(At)})}var Tt=o(vt,2);{var Dt=G=>{z(G,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return N()},children:(me,Me)=>{A();var ee=T();n(Ue=>i(ee,Ue),[()=>e.lib_gitlabConnect_cancel_label()]),a(me,ee)},$$slots:{default:!0}})};S(Tt,G=>{N()&&G(Dt)})}y(_e),n(G=>i(be,`${G??""} `),[()=>e.lib_gitlabConnect_token_description()]),a(I,q)},ut=I=>{var q=Or(),Z=x(q);{let be=$(()=>!t(P)||!u());z(Z,{variant:"primary",get size(){return t(ve)},type:"button",onclick:C,get disabled(){return t(be)},children:(ze,et)=>{A();var _e=T();n(Ce=>i(_e,Ce),[()=>e.lib_gitlabConnect_connect_label()]),a(ze,_e)},$$slots:{default:!0}})}var pe=o(Z,2);{let be=$(()=>!u());z(pe,{variant:"ghost",get size(){return t(re)},type:"button",get disabled(){return t(be)},onclick:oe,children:(ze,et)=>{A();var _e=T();n(Ce=>i(_e,Ce),[()=>e.lib_gitlabConnect_useToken_label()]),a(ze,_e)},$$slots:{default:!0}})}var Xe=o(pe,2);{var Ze=be=>{z(be,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return N()},children:(ze,et)=>{A();var _e=T();n(Ce=>i(_e,Ce),[()=>e.lib_gitlabConnect_cancel_label()]),a(ze,_e)},$$slots:{default:!0}})};S(Xe,be=>{N()&&be(Ze)})}y(q),a(I,q)};S(Ge,I=>{t(je)?I(nt):I(ut,-1)})}n(I=>{ot(se,"id",ne),i(He,I)},[()=>e.lib_gitlabConnect_host_description()]),a(c,p)};S(J,c=>{(b()||m())&&ae()?c(O):b()||m()?c(de,1):c(X,-1)})}var Pe=o(J,2);{var Le=c=>{var p=Br(),w=D(p,!0);n(F=>i(w,F),[()=>e.lib_gitlabConnect_cancelled_label()]),a(c,p)},fe=c=>{var p=Nr(),w=x(p),F=D(w,!0),ce=o(w,2);z(ce,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return m()},onclick:()=>Ke.dispatch(xt()),children:(se,He)=>{A();var Ie=T();n(qe=>i(Ie,qe),[()=>e.lib_gitlabConnect_checkStatus_label()]),a(se,Ie)},$$slots:{default:!0}}),y(p),n(se=>i(F,se),[()=>Y()==="already-started"?e.lib_gitlabConnect_alreadyStarted_description():e.lib_gitlabConnect_cancelFailed_description()]),a(c,p)};S(Pe,c=>{Y()==="cancelled"?c(Le):(Y()==="already-started"||Y()==="failed")&&c(fe,1)})}var ge=o(Pe,2);{var Re=c=>{var p=Rr(),w=D(p,!0);n(()=>i(w,he())),a(c,p)};S(ge,c=>{he()&&c(Re)})}y(M)}n(()=>Bt(M,1,Nt(K()?"space-y-2":"space-y-4"))),a(l,M);var Se=_t(U);return V(),Se}const wt=[{id:"people",get label(){return e.workspace_peopleTile_title()},icon:qt,description:""},{id:"agents",get label(){return e.workspace_multiSelectSidebar_agentsTab_label()},icon:Yt,get description(){return e.workspace_multiSelectSidebar_agentsTab_description()}},{id:"context",get label(){return e.workspace_multiSelectSidebar_contextTab_label()},icon:ur.note,get description(){return e.workspace_multiSelectSidebar_contextTab_description()}},{id:"changes",get label(){return e.workspace_multiSelectSidebar_changesTab_label()},icon:Vt,get description(){return e.workspace_multiSelectSidebar_changesTab_description()}},{id:"files",get label(){return e.workspace_multiSelectSidebar_filesTab_label()},icon:jt,get description(){return e.workspace_multiSelectSidebar_filesTab_description()}},{id:"browser",get label(){return e.workspace_multiSelectSidebar_browserTab_label()},icon:Qt,get description(){return e.workspace_multiSelectSidebar_browserTab_description()}},{id:"shell",get label(){return e.workspace_multiSelectSidebar_shellTab_label()},icon:Xt,get description(){return e.workspace_multiSelectSidebar_shellTab_description()}}];function Wr(l){return wt.some(r=>r.id===l)}const Jr=new Set(["browser","shell"]),Ks=new Set(["context","changes","files","browser","shell"]),qr=new Set(["changes"]);function Ps(l,r=!1,_=!0,E=!1,B=!1){const u=l.filter(b=>Wr(b)&&(b!=="people"||_)&&!(B&&qr.has(b))&&!(r&&Jr.has(b)&&!(b==="shell"&&E)));return new Set(u.length>0?u:["agents"])}function Yr(l){const r=new Set(l);return wt.flatMap(({id:_})=>r.has(_)?[_]:[])}function Cs(l,r){const _=new Set(l);return _.has(r)?_.size>1&&_.delete(r):_.add(r),Yr(_)}export{qr as G,Ks as H,fr as M,Jr as O,Dr as P,wt as T,Mr as a,hr as b,$s as c,mr as k,Ps as n,Yr as o,Ss as s,Cs as t};
@@ -1,4 +1,4 @@
1
- import{s as ce,a as Wn,b as qn,d as Hn,f as Te,c as T,i as zn}from"./HcbkpXC1.js";import{b as x,X as Jn,ay as m,bg as Kn,b1 as Zn,a4 as Qn,af as Se,aL as Ce,ad as er,ae as nr,aK as rr}from"./BolJpU8l.js";import{L as U,I as O,r as Ie,s as H,C as z,H as tn,m as le,K as an,c as tr,g as on,W as ar,R as ir,Q as or,J as he,k as sr,V as dr,U as Re,a as ke,w as pe,n as ge,P as V,E as sn,S as dn,b as ur,B as I,v as fr,M as cr,D as lr,A as Me,F as hr,h as un,l as M,O as pr,f as gr,e as vr,d as X,o as fn,i as cn,y as br,z as ve,p as ln,X as wr,j as hn,x as mr,Y as yr,G as N,u as l,q as xr,N as L,t as $,Z as R,T as J}from"./-xK_vQQs.js";var Er=/\s/;function Lr(e){for(var n=e.length;n--&&Er.test(e.charAt(n)););return n}var Or=/^\s+/;function Nr(e){return e&&e.slice(0,Lr(e)+1).replace(Or,"")}var _e=NaN,Pr=/^[-+]0x[0-9a-f]+$/i,Tr=/^0b[01]+$/i,Sr=/^0o[0-7]+$/i,Cr=parseInt;function Ir(e){if(typeof e=="number")return e;if(U(e))return _e;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Nr(e);var r=Tr.test(e);return r||Sr.test(e)?Cr(e.slice(2),r?2:8):Pr.test(e)?_e:+e}var Ae=1/0,Rr=17976931348623157e292;function G(e){if(!e)return e===0?e:0;if(e=Ir(e),e===Ae||e===-Ae){var n=e<0?-1:1;return n*Rr}return e===e?e:0}function kr(e){var n=G(e),r=n%1;return n===n?r?n-r:n:0}var je=Object.create,Mr=(function(){function e(){}return function(n){if(!O(n))return{};if(je)return je(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function _r(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function K(e,n,r){n=="__proto__"&&Ie?Ie(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var Ar=Object.prototype,jr=Ar.hasOwnProperty;function Z(e,n,r){var t=e[n];(!(jr.call(e,n)&&H(t,r))||r===void 0&&!(n in e))&&K(e,n,r)}function Dr(e,n,r,t){var a=!r;r||(r={});for(var o=-1,i=n.length;++o<i;){var s=n[o],d=void 0;d===void 0&&(d=e[s]),a?K(r,s,d):Z(r,s,d)}return r}function j(e,n,r){if(!O(r))return!1;var t=typeof n;return(t=="number"?z(r)&&tn(n,r.length):t=="string"&&n in r)?H(r[n],e):!1}function Br(e){return le(function(n,r){var t=-1,a=r.length,o=a>1?r[a-1]:void 0,i=a>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(a--,o):void 0,i&&j(r[0],r[1],i)&&(o=a<3?void 0:o,a=1),n=Object(n);++t<a;){var s=r[t];s&&e(n,s,t,o)}return n})}function $r(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var Fr=Object.prototype,Xr=Fr.hasOwnProperty;function Gr(e){if(!O(e))return $r(e);var n=an(e),r=[];for(var t in e)t=="constructor"&&(n||!Xr.call(e,t))||r.push(t);return r}function Q(e){return z(e)?tr(e,!0):Gr(e)}function _(e){var n=e==null?0:e.length;return n?on(e):[]}function Yr(e){return ar(ir(e,void 0,_),e+"")}var pn=or(Object.getPrototypeOf,Object),Ur="[object Object]",Vr=Function.prototype,Wr=Object.prototype,gn=Vr.toString,qr=Wr.hasOwnProperty,Hr=gn.call(Object);function zr(e){if(!he(e)||sr(e)!=Ur)return!1;var n=pn(e);if(n===null)return!0;var r=qr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&gn.call(r)==Hr}var vn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,De=vn&&typeof module=="object"&&module&&!module.nodeType&&module,Jr=De&&De.exports===vn,Be=Jr?dr.Buffer:void 0,$e=Be?Be.allocUnsafe:void 0;function bn(e,n){if(n)return e.slice();var r=e.length,t=$e?$e(r):new e.constructor(r);return e.copy(t),t}var Kr=Object.prototype,Zr=Kr.hasOwnProperty;function Qr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Zr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function be(e){var n=new e.constructor(e.byteLength);return new Re(n).set(new Re(e)),n}function et(e,n){var r=be(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var nt=/\w*$/;function rt(e){var n=new e.constructor(e.source,nt.exec(e));return n.lastIndex=e.lastIndex,n}var Fe=ke?ke.prototype:void 0,Xe=Fe?Fe.valueOf:void 0;function tt(e){return Xe?Object(Xe.call(e)):{}}function wn(e,n){var r=n?be(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var at="[object Boolean]",it="[object Date]",ot="[object Map]",st="[object Number]",dt="[object RegExp]",ut="[object Set]",ft="[object String]",ct="[object Symbol]",lt="[object ArrayBuffer]",ht="[object DataView]",pt="[object Float32Array]",gt="[object Float64Array]",vt="[object Int8Array]",bt="[object Int16Array]",wt="[object Int32Array]",mt="[object Uint8Array]",yt="[object Uint8ClampedArray]",xt="[object Uint16Array]",Et="[object Uint32Array]";function Lt(e,n,r){var t=e.constructor;switch(n){case lt:return be(e);case at:case it:return new t(+e);case ht:return et(e);case pt:case gt:case vt:case bt:case wt:case mt:case yt:case xt:case Et:return wn(e,r);case ot:return new t;case st:case ft:return new t(e);case dt:return rt(e);case ut:return new t;case ct:return tt(e)}}function mn(e){return typeof e.constructor=="function"&&!an(e)?Mr(pn(e)):{}}var Ot="[object Map]";function Nt(e){return he(e)&&pe(e)==Ot}var Ge=V&&V.isMap,Pt=Ge?ge(Ge):Nt,Tt="[object Set]";function St(e){return he(e)&&pe(e)==Tt}var Ye=V&&V.isSet,Ct=Ye?ge(Ye):St,It=1,yn="[object Arguments]",Rt="[object Array]",kt="[object Boolean]",Mt="[object Date]",_t="[object Error]",xn="[object Function]",At="[object GeneratorFunction]",jt="[object Map]",Dt="[object Number]",En="[object Object]",Bt="[object RegExp]",$t="[object Set]",Ft="[object String]",Xt="[object Symbol]",Gt="[object WeakMap]",Yt="[object ArrayBuffer]",Ut="[object DataView]",Vt="[object Float32Array]",Wt="[object Float64Array]",qt="[object Int8Array]",Ht="[object Int16Array]",zt="[object Int32Array]",Jt="[object Uint8Array]",Kt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",Qt="[object Uint32Array]",y={};y[yn]=y[Rt]=y[Yt]=y[Ut]=y[kt]=y[Mt]=y[Vt]=y[Wt]=y[qt]=y[Ht]=y[zt]=y[jt]=y[Dt]=y[En]=y[Bt]=y[$t]=y[Ft]=y[Xt]=y[Jt]=y[Kt]=y[Zt]=y[Qt]=!0;y[_t]=y[xn]=y[Gt]=!1;function Y(e,n,r,t,a,o){var i,s=n&It;if(i!==void 0)return i;if(!O(e))return e;var d=I(e);if(d)i=Qr(e);else{var u=pe(e),f=u==xn||u==At;if(sn(e))return bn(e,s);if(u==En||u==yn||f&&!a)i=f?{}:mn(e);else{if(!y[u])return a?e:{};i=Lt(e,u,s)}}o||(o=new dn);var c=o.get(e);if(c)return c;o.set(e,i),Ct(e)?e.forEach(function(p){i.add(Y(p,n,r,p,e,o))}):Pt(e)&&e.forEach(function(p,g){i.set(g,Y(p,n,r,g,e,o))});var h=fr,v=d?void 0:h(e);return ur(v||e,function(p,g){v&&(g=p,p=e[g]),Z(i,g,Y(p,n,r,g,e,o))}),i}var ea=1,na=4;function ra(e){return Y(e,ea|na)}var Ln=Object.prototype,ta=Ln.hasOwnProperty,aa=le(function(e,n){e=Object(e);var r=-1,t=n.length,a=t>2?n[2]:void 0;for(a&&j(n[0],n[1],a)&&(t=1);++r<t;)for(var o=n[r],i=Q(o),s=-1,d=i.length;++s<d;){var u=i[s],f=e[u];(f===void 0||H(f,Ln[u])&&!ta.call(e,u))&&(e[u]=o[u])}return e});function se(e,n,r){(r!==void 0&&!H(e[n],r)||r===void 0&&!(n in e))&&K(e,n,r)}function de(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function ia(e){return Dr(e,Q(e))}function oa(e,n,r,t,a,o,i){var s=de(e,r),d=de(n,r),u=i.get(d);if(u){se(e,r,u);return}var f=o?o(s,d,r+"",e,n,i):void 0,c=f===void 0;if(c){var h=I(d),v=!h&&sn(d),p=!h&&!v&&cr(d);f=d,h||v||p?I(s)?f=s:lr(s)?f=_r(s):v?(c=!1,f=bn(d,!0)):p?(c=!1,f=wn(d,!0)):f=[]:zr(d)||Me(d)?(f=s,Me(s)?f=ia(s):(!O(s)||hr(s))&&(f=mn(d))):c=!1}c&&(i.set(d,f),a(f,d,t,o,i),i.delete(d)),se(e,r,f)}function On(e,n,r,t,a){e!==n&&un(n,function(o,i){if(a||(a=new dn),O(o))oa(e,n,i,r,On,t,a);else{var s=t?t(de(e,i),o,i+"",e,n,a):void 0;s===void 0&&(s=o),se(e,i,s)}},Q)}function W(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function sa(e){return function(n,r,t){var a=Object(n);if(!z(n)){var o=M(r);n=pr(n),r=function(s){return o(a[s],s,a)}}var i=e(n,r,t);return i>-1?a[o?n[i]:i]:void 0}}var da=Math.max;function ua(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var a=r==null?0:kr(r);return a<0&&(a=da(t+a,0)),gr(e,M(n),a)}var we=sa(ua);function Nn(e,n){var r=-1,t=z(e)?Array(e.length):[];return vr(e,function(a,o,i){t[++r]=n(a,o,i)}),t}function E(e,n){var r=I(e)?X:Nn;return r(e,M(n))}function fa(e,n){return e==null?e:un(e,fn(n),Q)}function ca(e,n){return e&&cn(e,fn(n))}function la(e,n){return e>n}var ha=Object.prototype,pa=ha.hasOwnProperty;function ga(e,n){return e!=null&&pa.call(e,n)}function Pn(e,n){return e!=null&&br(e,n,ga)}function Tn(e,n){return e<n}function ee(e,n){var r={};return n=M(n),cn(e,function(t,a,o){K(r,a,n(t,a,o))}),r}function me(e,n,r){for(var t=-1,a=e.length;++t<a;){var o=e[t],i=n(o);if(i!=null&&(s===void 0?i===i&&!U(i):r(i,s)))var s=i,d=o}return d}function S(e){return e&&e.length?me(e,ve,la):void 0}var ue=Br(function(e,n,r){On(e,n,r)});function D(e){return e&&e.length?me(e,ve,Tn):void 0}function ye(e,n){return e&&e.length?me(e,M(n),Tn):void 0}function va(e,n,r,t){if(!O(e))return e;n=ln(n,e);for(var a=-1,o=n.length,i=o-1,s=e;s!=null&&++a<o;){var d=wr(n[a]),u=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(a!=i){var f=s[d];u=void 0,u===void 0&&(u=O(f)?f:tn(n[a+1])?[]:{})}Z(s,d,u),s=s[d]}return e}function ba(e,n,r){for(var t=-1,a=n.length,o={};++t<a;){var i=n[t],s=hn(e,i);r(s,i)&&va(o,ln(i,e),s)}return o}function wa(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function ma(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,o=U(e),i=n!==void 0,s=n===null,d=n===n,u=U(n);if(!s&&!u&&!o&&e>n||o&&i&&d&&!s&&!u||t&&i&&d||!r&&d||!a)return 1;if(!t&&!o&&!u&&e<n||u&&r&&a&&!t&&!o||s&&r&&a||!i&&a||!d)return-1}return 0}function ya(e,n,r){for(var t=-1,a=e.criteria,o=n.criteria,i=a.length,s=r.length;++t<i;){var d=ma(a[t],o[t]);if(d){if(t>=s)return d;var u=r[t];return d*(u=="desc"?-1:1)}}return e.index-n.index}function xa(e,n,r){n.length?n=X(n,function(o){return I(o)?function(i){return hn(i,o.length===1?o[0]:o)}:o}):n=[ve];var t=-1;n=X(n,ge(M));var a=Nn(e,function(o,i,s){var d=X(n,function(u){return u(o)});return{criteria:d,index:++t,value:o}});return wa(a,function(o,i){return ya(o,i,r)})}function Ea(e,n){return ba(e,n,function(r,t){return mr(e,t)})}var q=Yr(function(e,n){return e==null?{}:Ea(e,n)}),La=Math.ceil,Oa=Math.max;function Na(e,n,r,t){for(var a=-1,o=Oa(La((n-e)/(r||1)),0),i=Array(o);o--;)i[++a]=e,e+=r;return i}function Pa(e){return function(n,r,t){return t&&typeof t!="number"&&j(n,r,t)&&(r=t=void 0),n=G(n),r===void 0?(r=n,n=0):r=G(r),t=t===void 0?n<r?1:-1:G(t),Na(n,r,t)}}var k=Pa(),F=le(function(e,n){if(e==null)return[];var r=n.length;return r>1&&j(e,n[0],n[1])?n=[]:r>2&&j(n[0],n[1],n[2])&&(n=[n[0]]),xa(e,on(n),[])}),Ta=0;function xe(e){var n=++Ta;return yr(e)+n}function Sa(e,n,r){for(var t=-1,a=e.length,o=n.length,i={};++t<a;){var s=t<o?n[t]:void 0;r(i,e[t],s)}return i}function Ca(e,n){return Sa(e||[],n||[],Z)}class Ia{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Ue(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Ue(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Ra)),t=t._prev;return"["+n.join(", ")+"]"}}function Ue(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ra(e,n){if(e!=="_next"&&e!=="_prev")return n}var ka=xr(1);function Ma(e,n){if(e.nodeCount()<=1)return[];var r=Aa(e,n||ka),t=_a(r.graph,r.buckets,r.zeroIdx);return _(E(t,function(a){return e.outEdges(a.v,a.w)}))}function _a(e,n,r){for(var t=[],a=n[n.length-1],o=n[0],i;e.nodeCount();){for(;i=o.dequeue();)re(e,n,r,i);for(;i=a.dequeue();)re(e,n,r,i);if(e.nodeCount()){for(var s=n.length-2;s>0;--s)if(i=n[s].dequeue(),i){t=t.concat(re(e,n,r,i,!0));break}}}return t}function re(e,n,r,t,a){var o=a?[]:void 0;return l(e.inEdges(t.v),function(i){var s=e.edge(i),d=e.node(i.v);a&&o.push({v:i.v,w:i.w}),d.out-=s,fe(n,r,d)}),l(e.outEdges(t.v),function(i){var s=e.edge(i),d=i.w,u=e.node(d);u.in-=s,fe(n,r,u)}),e.removeNode(t.v),o}function Aa(e,n){var r=new N,t=0,a=0;l(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),l(e.edges(),function(s){var d=r.edge(s.v,s.w)||0,u=n(s),f=d+u;r.setEdge(s.v,s.w,f),a=Math.max(a,r.node(s.v).out+=u),t=Math.max(t,r.node(s.w).in+=u)});var o=k(a+t+3).map(function(){return new Ia}),i=t+1;return l(r.nodes(),function(s){fe(o,i,r.node(s))}),{graph:r,buckets:o,zeroIdx:i}}function fe(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function ja(e){var n=e.graph().acyclicer==="greedy"?Ma(e,r(e)):Da(e);l(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,xe("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function Da(e){var n=[],r={},t={};function a(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,l(e.outEdges(o),function(i){Object.prototype.hasOwnProperty.call(r,i.w)?n.push(i):a(i.w)}),delete r[o])}return l(e.nodes(),a),n}function Ba(e){l(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function A(e,n,r,t){var a;do a=xe(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function $a(e){var n=new N().setGraph(e.graph());return l(e.nodes(),function(r){n.setNode(r,e.node(r))}),l(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function Sn(e){var n=new N({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),l(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function Ve(e,n){var r=e.x,t=e.y,a=n.x-r,o=n.y-t,i=e.width/2,s=e.height/2;if(!a&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,u;return Math.abs(o)*i>Math.abs(a)*s?(o<0&&(s=-s),d=s*a/o,u=s):(a<0&&(i=-i),d=i,u=i*o/a),{x:r+d,y:t+u}}function ne(e){var n=E(k(Cn(e)+1),function(){return[]});return l(e.nodes(),function(r){var t=e.node(r),a=t.rank;L(a)||(n[a][t.order]=r)}),n}function Fa(e){var n=D(E(e.nodes(),function(r){return e.node(r).rank}));l(e.nodes(),function(r){var t=e.node(r);Pn(t,"rank")&&(t.rank-=n)})}function Xa(e){var n=D(E(e.nodes(),function(o){return e.node(o).rank})),r=[];l(e.nodes(),function(o){var i=e.node(o).rank-n;r[i]||(r[i]=[]),r[i].push(o)});var t=0,a=e.graph().nodeRankFactor;l(r,function(o,i){L(o)&&i%a!==0?--t:t&&l(o,function(s){e.node(s).rank+=t})})}function We(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),A(e,"border",a,n)}function Cn(e){return S(E(e.nodes(),function(n){var r=e.node(n).rank;if(!L(r))return r}))}function Ga(e,n){var r={lhs:[],rhs:[]};return l(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Ya(e,n){return n()}function Ua(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&l(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var o=a.minRank,i=a.maxRank+1;o<i;++o)qe(e,"borderLeft","_bl",r,a,o),qe(e,"borderRight","_br",r,a,o)}}l(e.children(),n)}function qe(e,n,r,t,a,o){var i={width:0,height:0,rank:o,borderType:n},s=a[n][o-1],d=A(e,"border",i,r);a[n][o]=d,e.setParent(d,t),s&&e.setEdge(s,d,{weight:1})}function Va(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&In(e)}function Wa(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&qa(e),(n==="lr"||n==="rl")&&(Ha(e),In(e))}function In(e){l(e.nodes(),function(n){He(e.node(n))}),l(e.edges(),function(n){He(e.edge(n))})}function He(e){var n=e.width;e.width=e.height,e.height=n}function qa(e){l(e.nodes(),function(n){te(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,te),Object.prototype.hasOwnProperty.call(r,"y")&&te(r)})}function te(e){e.y=-e.y}function Ha(e){l(e.nodes(),function(n){ae(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,ae),Object.prototype.hasOwnProperty.call(r,"x")&&ae(r)})}function ae(e){var n=e.x;e.x=e.y,e.y=n}function za(e){e.graph().dummyChains=[],l(e.edges(),function(n){Ja(e,n)})}function Ja(e,n){var r=n.v,t=e.node(r).rank,a=n.w,o=e.node(a).rank,i=n.name,s=e.edge(n),d=s.labelRank;if(o!==t+1){e.removeEdge(n);var u=void 0,f,c;for(c=0,++t;t<o;++c,++t)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:n,rank:t},f=A(e,"edge",u,"_d"),t===d&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),e.setEdge(r,f,{weight:s.weight},i),c===0&&e.graph().dummyChains.push(f),r=f;e.setEdge(r,a,{weight:s.weight},i)}}function Ka(e){l(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function Ee(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var o=D(E(e.outEdges(t),function(i){return r(i.w)-e.edge(i).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),a.rank=o}l(e.sources(),r)}function B(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Rn(e){var n=new N({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,o;Za(n,e)<t;)a=Qa(n,e),o=n.hasNode(a.v)?B(e,a):-B(e,a),ei(n,e,o);return n}function Za(e,n){function r(t){l(n.nodeEdges(t),function(a){var o=a.v,i=t===o?a.w:o;!e.hasNode(i)&&!B(n,a)&&(e.setNode(i,{}),e.setEdge(t,i,{}),r(i))})}return l(e.nodes(),r),e.nodeCount()}function Qa(e,n){return ye(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return B(n,r)})}function ei(e,n,r){l(e.nodes(),function(t){n.node(t).rank+=r})}function ni(){}ni.prototype=new Error;function kn(e,n,r){I(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],o={};return l(n,function(i){if(!e.hasNode(i))throw new Error("Graph does not have node: "+i);Mn(e,i,r==="post",o,t,a)}),a}function Mn(e,n,r,t,a,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),l(a(n),function(i){Mn(e,i,r,t,a,o)}),r&&o.push(n))}function ri(e,n){return kn(e,n,"post")}function ti(e,n){return kn(e,n,"pre")}C.initLowLimValues=Oe;C.initCutValues=Le;C.calcCutValue=_n;C.leaveEdge=jn;C.enterEdge=Dn;C.exchangeEdges=Bn;function C(e){e=$a(e),Ee(e);var n=Rn(e);Oe(n),Le(n,e);for(var r,t;r=jn(n);)t=Dn(n,e,r),Bn(n,e,r,t)}function Le(e,n){var r=ri(e,e.nodes());r=r.slice(0,r.length-1),l(r,function(t){ai(e,n,t)})}function ai(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=_n(e,n,r)}function _n(e,n,r){var t=e.node(r),a=t.parent,o=!0,i=n.edge(r,a),s=0;return i||(o=!1,i=n.edge(a,r)),s=i.weight,l(n.nodeEdges(r),function(d){var u=d.v===r,f=u?d.w:d.v;if(f!==a){var c=u===o,h=n.edge(d).weight;if(s+=c?h:-h,oi(e,r,f)){var v=e.edge(r,f).cutvalue;s+=c?-v:v}}}),s}function Oe(e,n){arguments.length<2&&(n=e.nodes()[0]),An(e,{},1,n)}function An(e,n,r,t,a){var o=r,i=e.node(t);return n[t]=!0,l(e.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(n,s)||(r=An(e,n,r,s,t))}),i.low=o,i.lim=r++,a?i.parent=a:delete i.parent,r}function jn(e){return we(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Dn(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var o=e.node(t),i=e.node(a),s=o,d=!1;o.lim>i.lim&&(s=i,d=!0);var u=$(n.edges(),function(f){return d===ze(e,e.node(f.v),s)&&d!==ze(e,e.node(f.w),s)});return ye(u,function(f){return B(n,f)})}function Bn(e,n,r,t){var a=r.v,o=r.w;e.removeEdge(a,o),e.setEdge(t.v,t.w,{}),Oe(e),Le(e,n),ii(e,n)}function ii(e,n){var r=we(e.nodes(),function(a){return!n.node(a).parent}),t=ti(e,r);t=t.slice(1),l(t,function(a){var o=e.node(a).parent,i=n.edge(a,o),s=!1;i||(i=n.edge(o,a),s=!0),n.node(a).rank=n.node(o).rank+(s?i.minlen:-i.minlen)})}function oi(e,n,r){return e.hasEdge(n,r)}function ze(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function si(e){switch(e.graph().ranker){case"network-simplex":Je(e);break;case"tight-tree":ui(e);break;case"longest-path":di(e);break;default:Je(e)}}var di=Ee;function ui(e){Ee(e),Rn(e)}function Je(e){C(e)}function fi(e){var n=A(e,"root",{},"_root"),r=ci(e),t=S(R(r))-1,a=2*t+1;e.graph().nestingRoot=n,l(e.edges(),function(i){e.edge(i).minlen*=a});var o=li(e)+1;l(e.children(),function(i){$n(e,n,a,o,t,r,i)}),e.graph().nodeRankFactor=a}function $n(e,n,r,t,a,o,i){var s=e.children(i);if(!s.length){i!==n&&e.setEdge(n,i,{weight:0,minlen:r});return}var d=We(e,"_bt"),u=We(e,"_bb"),f=e.node(i);e.setParent(d,i),f.borderTop=d,e.setParent(u,i),f.borderBottom=u,l(s,function(c){$n(e,n,r,t,a,o,c);var h=e.node(c),v=h.borderTop?h.borderTop:c,p=h.borderBottom?h.borderBottom:c,g=h.borderTop?t:2*t,b=v!==p?1:a-o[i]+1;e.setEdge(d,v,{weight:g,minlen:b,nestingEdge:!0}),e.setEdge(p,u,{weight:g,minlen:b,nestingEdge:!0})}),e.parent(i)||e.setEdge(n,d,{weight:0,minlen:a+o[i]})}function ci(e){var n={};function r(t,a){var o=e.children(t);o&&o.length&&l(o,function(i){r(i,a+1)}),n[t]=a}return l(e.children(),function(t){r(t,1)}),n}function li(e){return J(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function hi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,l(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function pi(e,n,r){var t={},a;l(r,function(o){for(var i=e.parent(o),s,d;i;){if(s=e.parent(i),s?(d=t[s],t[s]=i):(d=a,a=i),d&&d!==i){n.setEdge(d,i);return}i=s}})}function gi(e,n,r){var t=vi(e),a=new N({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return l(e.nodes(),function(o){var i=e.node(o),s=e.parent(o);(i.rank===n||i.minRank<=n&&n<=i.maxRank)&&(a.setNode(o),a.setParent(o,s||t),l(e[r](o),function(d){var u=d.v===o?d.w:d.v,f=a.edge(u,o),c=L(f)?0:f.weight;a.setEdge(u,o,{weight:e.edge(d).weight+c})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&a.setNode(o,{borderLeft:i.borderLeft[n],borderRight:i.borderRight[n]}))}),a}function vi(e){for(var n;e.hasNode(n=xe("_root")););return n}function bi(e,n){for(var r=0,t=1;t<n.length;++t)r+=wi(e,n[t-1],n[t]);return r}function wi(e,n,r){for(var t=Ca(r,E(r,function(u,f){return f})),a=_(E(n,function(u){return F(E(e.outEdges(u),function(f){return{pos:t[f.w],weight:e.edge(f).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var i=2*o-1;o-=1;var s=E(new Array(i),function(){return 0}),d=0;return l(a.forEach(function(u){var f=u.pos+o;s[f]+=u.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),f=f-1>>1,s[f]+=u.weight;d+=u.weight*c})),d}function mi(e){var n={},r=$(e.nodes(),function(s){return!e.children(s).length}),t=S(E(r,function(s){return e.node(s).rank})),a=E(k(t+1),function(){return[]});function o(s){if(!Pn(n,s)){n[s]=!0;var d=e.node(s);a[d.rank].push(s),l(e.successors(s),o)}}var i=F(r,function(s){return e.node(s).rank});return l(i,o),a}function yi(e,n){return E(n,function(r){var t=e.inEdges(r);if(t.length){var a=J(t,function(o,i){var s=e.edge(i),d=e.node(i.v);return{sum:o.sum+s.weight*d.order,weight:o.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function xi(e,n){var r={};l(e,function(a,o){var i=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:o};L(a.barycenter)||(i.barycenter=a.barycenter,i.weight=a.weight)}),l(n.edges(),function(a){var o=r[a.v],i=r[a.w];!L(o)&&!L(i)&&(i.indegree++,o.out.push(r[a.w]))});var t=$(r,function(a){return!a.indegree});return Ei(t)}function Ei(e){var n=[];function r(o){return function(i){i.merged||(L(i.barycenter)||L(o.barycenter)||i.barycenter>=o.barycenter)&&Li(o,i)}}function t(o){return function(i){i.in.push(o),--i.indegree===0&&e.push(i)}}for(;e.length;){var a=e.pop();n.push(a),l(a.in.reverse(),r(a)),l(a.out,t(a))}return E($(n,function(o){return!o.merged}),function(o){return q(o,["vs","i","barycenter","weight"])})}function Li(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Oi(e,n){var r=Ga(e,function(f){return Object.prototype.hasOwnProperty.call(f,"barycenter")}),t=r.lhs,a=F(r.rhs,function(f){return-f.i}),o=[],i=0,s=0,d=0;t.sort(Ni(!!n)),d=Ke(o,a,d),l(t,function(f){d+=f.vs.length,o.push(f.vs),i+=f.barycenter*f.weight,s+=f.weight,d=Ke(o,a,d)});var u={vs:_(o)};return s&&(u.barycenter=i/s,u.weight=s),u}function Ke(e,n,r){for(var t;n.length&&(t=W(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ni(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Fn(e,n,r,t){var a=e.children(n),o=e.node(n),i=o?o.borderLeft:void 0,s=o?o.borderRight:void 0,d={};i&&(a=$(a,function(p){return p!==i&&p!==s}));var u=yi(e,a);l(u,function(p){if(e.children(p.v).length){var g=Fn(e,p.v,r,t);d[p.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Ti(p,g)}});var f=xi(u,r);Pi(f,d);var c=Oi(f,t);if(i&&(c.vs=_([i,c.vs,s]),e.predecessors(i).length)){var h=e.node(e.predecessors(i)[0]),v=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(c,"barycenter")||(c.barycenter=0,c.weight=0),c.barycenter=(c.barycenter*c.weight+h.order+v.order)/(c.weight+2),c.weight+=2}return c}function Pi(e,n){l(e,function(r){r.vs=_(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Ti(e,n){L(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function Si(e){var n=Cn(e),r=Ze(e,k(1,n+1),"inEdges"),t=Ze(e,k(n-1,-1,-1),"outEdges"),a=mi(e);Qe(e,a);for(var o=Number.POSITIVE_INFINITY,i,s=0,d=0;d<4;++s,++d){Ci(s%2?r:t,s%4>=2),a=ne(e);var u=bi(e,a);u<o&&(d=0,i=ra(a),o=u)}Qe(e,i)}function Ze(e,n,r){return E(n,function(t){return gi(e,t,r)})}function Ci(e,n){var r=new N;l(e,function(t){var a=t.graph().root,o=Fn(t,a,r,n);l(o.vs,function(i,s){t.node(i).order=s}),pi(t,r,o.vs)})}function Qe(e,n){l(n,function(r){l(r,function(t,a){e.node(t).order=a})})}function Ii(e){var n=ki(e);l(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,o=Ri(e,n,a.v,a.w),i=o.path,s=o.lca,d=0,u=i[d],f=!0;r!==a.w;){if(t=e.node(r),f){for(;(u=i[d])!==s&&e.node(u).maxRank<t.rank;)d++;u===s&&(f=!1)}if(!f){for(;d<i.length-1&&e.node(u=i[d+1]).minRank<=t.rank;)d++;u=i[d]}e.setParent(r,u),r=e.successors(r)[0]}})}function Ri(e,n,r,t){var a=[],o=[],i=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim),d,u;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>i||s>n[d].lim));for(u=d,d=t;(d=e.parent(d))!==u;)o.push(d);return{path:a.concat(o.reverse()),lca:u}}function ki(e){var n={},r=0;function t(a){var o=r;l(e.children(a),t),n[a]={low:o,lim:r++}}return l(e.children(),t),n}function Mi(e,n){var r={};function t(a,o){var i=0,s=0,d=a.length,u=W(o);return l(o,function(f,c){var h=Ai(e,f),v=h?e.node(h).order:d;(h||f===u)&&(l(o.slice(s,c+1),function(p){l(e.predecessors(p),function(g){var b=e.node(g),w=b.order;(w<i||v<w)&&!(b.dummy&&e.node(p).dummy)&&Xn(r,g,p)})}),s=c+1,i=v)}),o}return J(n,t),r}function _i(e,n){var r={};function t(o,i,s,d,u){var f;l(k(i,s),function(c){f=o[c],e.node(f).dummy&&l(e.predecessors(f),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>u)&&Xn(r,h,f)})})}function a(o,i){var s=-1,d,u=0;return l(i,function(f,c){if(e.node(f).dummy==="border"){var h=e.predecessors(f);h.length&&(d=e.node(h[0]).order,t(i,u,c,s,d),u=c,s=d)}t(i,u,i.length,d,o.length)}),i}return J(n,a),r}function Ai(e,n){if(e.node(n).dummy)return we(e.predecessors(n),function(r){return e.node(r).dummy})}function Xn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ji(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Di(e,n,r,t){var a={},o={},i={};return l(n,function(s){l(s,function(d,u){a[d]=d,o[d]=d,i[d]=u})}),l(n,function(s){var d=-1;l(s,function(u){var f=t(u);if(f.length){f=F(f,function(g){return i[g]});for(var c=(f.length-1)/2,h=Math.floor(c),v=Math.ceil(c);h<=v;++h){var p=f[h];o[u]===u&&d<i[p]&&!ji(r,u,p)&&(o[p]=u,o[u]=a[u]=a[p],d=i[p])}}})}),{root:a,align:o}}function Bi(e,n,r,t,a){var o={},i=$i(e,n,r,a),s=a?"borderLeft":"borderRight";function d(c,h){for(var v=i.nodes(),p=v.pop(),g={};p;)g[p]?c(p):(g[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function u(c){o[c]=i.inEdges(c).reduce(function(h,v){return Math.max(h,o[v.v]+i.edge(v))},0)}function f(c){var h=i.outEdges(c).reduce(function(p,g){return Math.min(p,o[g.w]-i.edge(g))},Number.POSITIVE_INFINITY),v=e.node(c);h!==Number.POSITIVE_INFINITY&&v.borderType!==s&&(o[c]=Math.max(o[c],h))}return d(u,i.predecessors.bind(i)),d(f,i.successors.bind(i)),l(t,function(c){o[c]=o[r[c]]}),o}function $i(e,n,r,t){var a=new N,o=e.graph(),i=Ui(o.nodesep,o.edgesep,t);return l(n,function(s){var d;l(s,function(u){var f=r[u];if(a.setNode(f),d){var c=r[d],h=a.edge(c,f);a.setEdge(c,f,Math.max(i(e,u,d),h||0))}d=u})}),a}function Fi(e,n){return ye(R(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return fa(r,function(o,i){var s=Vi(e,i)/2;t=Math.max(o+s,t),a=Math.min(o-s,a)}),t-a})}function Xi(e,n){var r=R(n),t=D(r),a=S(r);l(["u","d"],function(o){l(["l","r"],function(i){var s=o+i,d=e[s],u;if(d!==n){var f=R(d);u=i==="l"?t-D(f):a-S(f),u&&(e[s]=ee(d,function(c){return c+u}))}})})}function Gi(e,n){return ee(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=F(E(e,t));return(a[1]+a[2])/2})}function Yi(e){var n=ne(e),r=ue(Mi(e,n),_i(e,n)),t={},a;l(["u","d"],function(i){a=i==="u"?n:R(n).reverse(),l(["l","r"],function(s){s==="r"&&(a=E(a,function(c){return R(c).reverse()}));var d=(i==="u"?e.predecessors:e.successors).bind(e),u=Di(e,a,r,d),f=Bi(e,a,u.root,u.align,s==="r");s==="r"&&(f=ee(f,function(c){return-c})),t[i+s]=f})});var o=Fi(e,t);return Xi(t,o),Gi(t,e.graph().align)}function Ui(e,n,r){return function(t,a,o){var i=t.node(a),s=t.node(o),d=0,u;if(d+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":u=-i.width/2;break;case"r":u=i.width/2;break}if(u&&(d+=r?u:-u),u=0,d+=(i.dummy?n:e)/2,d+=(s.dummy?n:e)/2,d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(d+=r?u:-u),u=0,d}}function Vi(e,n){return e.node(n).width}function Wi(e){e=Sn(e),qi(e),ca(Yi(e),function(n,r){e.node(r).x=n})}function qi(e){var n=ne(e),r=e.graph().ranksep,t=0;l(n,function(a){var o=S(E(a,function(i){return e.node(i).height}));l(a,function(i){e.node(i).y=t+o/2}),t+=o+r})}function Hi(e,n){var r=Ya;r("layout",()=>{var t=r(" buildLayoutGraph",()=>io(e));r(" runLayout",()=>zi(t,r)),r(" updateInputGraph",()=>Ji(e,t))})}function zi(e,n){n(" makeSpaceForEdgeLabels",()=>oo(e)),n(" removeSelfEdges",()=>vo(e)),n(" acyclic",()=>ja(e)),n(" nestingGraph.run",()=>fi(e)),n(" rank",()=>si(Sn(e))),n(" injectEdgeLabelProxies",()=>so(e)),n(" removeEmptyRanks",()=>Xa(e)),n(" nestingGraph.cleanup",()=>hi(e)),n(" normalizeRanks",()=>Fa(e)),n(" assignRankMinMax",()=>uo(e)),n(" removeEdgeLabelProxies",()=>fo(e)),n(" normalize.run",()=>za(e)),n(" parentDummyChains",()=>Ii(e)),n(" addBorderSegments",()=>Ua(e)),n(" order",()=>Si(e)),n(" insertSelfEdges",()=>bo(e)),n(" adjustCoordinateSystem",()=>Va(e)),n(" position",()=>Wi(e)),n(" positionSelfEdges",()=>wo(e)),n(" removeBorderNodes",()=>go(e)),n(" normalize.undo",()=>Ka(e)),n(" fixupEdgeLabelCoords",()=>ho(e)),n(" undoCoordinateSystem",()=>Wa(e)),n(" translateGraph",()=>co(e)),n(" assignNodeIntersects",()=>lo(e)),n(" reversePoints",()=>po(e)),n(" acyclic.undo",()=>Ba(e))}function Ji(e,n){l(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),l(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Ki=["nodesep","edgesep","ranksep","marginx","marginy"],Zi={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Qi=["acyclicer","ranker","rankdir","align"],eo=["width","height"],no={width:0,height:0},ro=["minlen","weight","width","height","labeloffset"],to={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ao=["labelpos"];function io(e){var n=new N({multigraph:!0,compound:!0}),r=oe(e.graph());return n.setGraph(ue({},Zi,ie(r,Ki),q(r,Qi))),l(e.nodes(),function(t){var a=oe(e.node(t));n.setNode(t,aa(ie(a,eo),no)),n.setParent(t,e.parent(t))}),l(e.edges(),function(t){var a=oe(e.edge(t));n.setEdge(t,ue({},to,ie(a,ro),q(a,ao)))}),n}function oo(e){var n=e.graph();n.ranksep/=2,l(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function so(e){l(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),o={rank:(a.rank-t.rank)/2+t.rank,e:n};A(e,"edge-proxy",o,"_ep")}})}function uo(e){var n=0;l(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=S(n,t.maxRank))}),e.graph().maxRank=n}function fo(e){l(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function co(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,o=e.graph(),i=o.marginx||0,s=o.marginy||0;function d(u){var f=u.x,c=u.y,h=u.width,v=u.height;n=Math.min(n,f-h/2),r=Math.max(r,f+h/2),t=Math.min(t,c-v/2),a=Math.max(a,c+v/2)}l(e.nodes(),function(u){d(e.node(u))}),l(e.edges(),function(u){var f=e.edge(u);Object.prototype.hasOwnProperty.call(f,"x")&&d(f)}),n-=i,t-=s,l(e.nodes(),function(u){var f=e.node(u);f.x-=n,f.y-=t}),l(e.edges(),function(u){var f=e.edge(u);l(f.points,function(c){c.x-=n,c.y-=t}),Object.prototype.hasOwnProperty.call(f,"x")&&(f.x-=n),Object.prototype.hasOwnProperty.call(f,"y")&&(f.y-=t)}),o.width=r-n+i,o.height=a-t+s}function lo(e){l(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),o,i;r.points?(o=r.points[0],i=r.points[r.points.length-1]):(r.points=[],o=a,i=t),r.points.unshift(Ve(t,o)),r.points.push(Ve(a,i))})}function ho(e){l(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function po(e){l(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function go(e){l(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),o=e.node(W(r.borderLeft)),i=e.node(W(r.borderRight));r.width=Math.abs(i.x-o.x),r.height=Math.abs(a.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),l(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function vo(e){l(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function bo(e){var n=ne(e);l(n,function(r){var t=0;l(r,function(a,o){var i=e.node(a);i.order=o+t,l(i.selfEdges,function(s){A(e,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:o+ ++t,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function wo(e){l(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,o=t.y,i=r.x-a,s=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*i/3,y:o-s},{x:a+5*i/6,y:o-s},{x:a+i,y:o},{x:a+5*i/6,y:o+s},{x:a+2*i/3,y:o+s}],r.label.x=r.x,r.label.y=r.y}})}function ie(e,n){return ee(q(e,n),Number)}function oe(e){var n={};return l(e,function(r,t){n[t.toLowerCase()]=r}),n}var en=x((e,n,r)=>Math.max(n,Math.min(r,e)),"clamp"),nn=x((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),mo=x(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),yo=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],xo=x((e,n,r,t,a)=>{const o=[],i=new Set;if(r.forEach(({start:f,end:c})=>{f!==t&&i.add(f),c!==t&&i.add(c)}),i.forEach(f=>{const c=e.node(f);typeof c?.x=="number"&&typeof c?.y=="number"&&o.push(c)}),o.length===0&&r.forEach(({edge:f})=>{(f.points??[]).forEach(c=>{typeof c?.x=="number"&&typeof c?.y=="number"&&o.push(c)})}),o.length===0)return nn(a);const s=o.reduce((f,c)=>({x:f.x+c.x/o.length,y:f.y+c.y/o.length}),{x:0,y:0}),d=s.x-n.x,u=s.y-n.y;return Math.abs(d)>Math.abs(u)?d>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":nn(a)},"getSelfLoopSide"),Eo=x((e,n="top",r=0,t=0)=>{const a=e.x,o=e.y-r,i=e.width/2,s=e.height/2,d=Math.max(36,Math.min(100,e.width*.8)),u=en(Math.max(t,e.width*.35),36,d),f=en(Math.min(e.width,e.height)*.45,24,48);switch(n){case"bottom":{const c=o+s;return[{x:a-u/2,y:c},{x:a-u/2,y:c+f},{x:a+u/2,y:c+f},{x:a+u/2,y:c}]}case"right":{const c=a+i;return[{x:c,y:o-u/2},{x:c+f,y:o-u/2},{x:c+f,y:o+u/2},{x:c,y:o+u/2}]}case"left":{const c=a-i;return[{x:c,y:o-u/2},{x:c-f,y:o-u/2},{x:c-f,y:o+u/2},{x:c,y:o+u/2}]}case"top":default:{const c=o-s;return[{x:a-u/2,y:c},{x:a-u/2,y:c-f},{x:a+u/2,y:c-f},{x:a+u/2,y:c}]}}},"getSelfLoopPoints"),Lo=x((e,n,r="top",t=0,a={})=>{const i=e.x,s=e.y-t,d=a.width??0,u=a.height??0;switch(r){case"bottom":return{x:i,y:Math.max(...n.map(f=>f.y))+u/2+4};case"right":return{x:Math.max(...n.map(f=>f.x))+d/2+4,y:s};case"left":return{x:Math.min(...n.map(f=>f.x))-d/2-4,y:s};case"top":default:return{x:i,y:Math.min(...n.map(f=>f.y))-u/2-4}}},"getSelfLoopLabelPosition"),Gn=x((e,n=0,{mergeSelfLoops:r=!0}={})=>{const t=new Map,a=[],o=e.graph()?.rankdir;return e.edges().forEach(i=>{const s=e.edge(i);if(r&&s.selfLoop){const d=s.selfLoop.id;t.has(d)||t.set(d,[]),t.get(d).push({edge:s,start:i.v,end:i.w})}else a.push({edge:s,start:i.v,end:i.w})}),t.forEach(i=>{if(i.length!==3){i.forEach(w=>a.push(w));return}i.sort((w,P)=>w.edge.selfLoop.order-P.edge.selfLoop.order);const[s,d,u]=i,f=s.edge.originalEdge??d.edge.originalEdge??u.edge.originalEdge??d.edge,c=e.node(f.start);if(!c){i.forEach(w=>a.push(w));return}const h={width:d.edge.width,height:d.edge.height},v=xo(e,c,i,f.start,o),p=Eo(c,v,n,h.width??0),g=Lo(c,p,v,n,h),b={...d.edge,...f,id:f.id,points:p,start:f.start,end:f.end,x:g.x,y:g.y,width:h.width,height:h.height,labelStyle:d.edge.labelStyle,fromCluster:s.edge.fromCluster??d.edge.fromCluster??u.edge.fromCluster,toCluster:s.edge.toCluster??d.edge.toCluster??u.edge.toCluster};delete b.selfLoop,delete b.originalEdge,a.push({edge:b,start:b.start,end:b.end})}),a},"getEdgesToRender"),Yn=x(async({element:e,graph:n,diagramType:r,id:t,parentCluster:a,siteConfig:o})=>{const i=n.graph().rankdir;m.trace("Dir in recursive render - dir:",i);const{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c}=Hn(e,{edgePathsClass:"edgePaths"});n.nodes()?m.info("Recursive render XXX",n.nodes()):m.info("No nodes found for",n),n.edges().length>0&&m.info("Recursive edges",n.edge(n.edges()[0]));const h=mo(r);await Promise.all(n.nodes().map(async function(g){const b=n.node(g);if(a!==void 0){const w=JSON.parse(JSON.stringify(a.clusterData));m.trace(`Setting data for parent cluster XXX
1
+ import{s as ce,a as Wn,b as qn,d as Hn,f as Te,c as T,i as zn}from"./CXkLsKgj.js";import{b as x,X as Jn,ay as m,bg as Kn,b1 as Zn,a4 as Qn,af as Se,aL as Ce,ad as er,ae as nr,aK as rr}from"./B1lrKll_.js";import{L as U,I as O,r as Ie,s as H,C as z,H as tn,m as le,K as an,c as tr,g as on,W as ar,R as ir,Q as or,J as he,k as sr,V as dr,U as Re,a as ke,w as pe,n as ge,P as V,E as sn,S as dn,b as ur,B as I,v as fr,M as cr,D as lr,A as Me,F as hr,h as un,l as M,O as pr,f as gr,e as vr,d as X,o as fn,i as cn,y as br,z as ve,p as ln,X as wr,j as hn,x as mr,Y as yr,G as N,u as l,q as xr,N as L,t as $,Z as R,T as J}from"./-xK_vQQs.js";var Er=/\s/;function Lr(e){for(var n=e.length;n--&&Er.test(e.charAt(n)););return n}var Or=/^\s+/;function Nr(e){return e&&e.slice(0,Lr(e)+1).replace(Or,"")}var _e=NaN,Pr=/^[-+]0x[0-9a-f]+$/i,Tr=/^0b[01]+$/i,Sr=/^0o[0-7]+$/i,Cr=parseInt;function Ir(e){if(typeof e=="number")return e;if(U(e))return _e;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Nr(e);var r=Tr.test(e);return r||Sr.test(e)?Cr(e.slice(2),r?2:8):Pr.test(e)?_e:+e}var Ae=1/0,Rr=17976931348623157e292;function G(e){if(!e)return e===0?e:0;if(e=Ir(e),e===Ae||e===-Ae){var n=e<0?-1:1;return n*Rr}return e===e?e:0}function kr(e){var n=G(e),r=n%1;return n===n?r?n-r:n:0}var je=Object.create,Mr=(function(){function e(){}return function(n){if(!O(n))return{};if(je)return je(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}})();function _r(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function K(e,n,r){n=="__proto__"&&Ie?Ie(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var Ar=Object.prototype,jr=Ar.hasOwnProperty;function Z(e,n,r){var t=e[n];(!(jr.call(e,n)&&H(t,r))||r===void 0&&!(n in e))&&K(e,n,r)}function Dr(e,n,r,t){var a=!r;r||(r={});for(var o=-1,i=n.length;++o<i;){var s=n[o],d=void 0;d===void 0&&(d=e[s]),a?K(r,s,d):Z(r,s,d)}return r}function j(e,n,r){if(!O(r))return!1;var t=typeof n;return(t=="number"?z(r)&&tn(n,r.length):t=="string"&&n in r)?H(r[n],e):!1}function Br(e){return le(function(n,r){var t=-1,a=r.length,o=a>1?r[a-1]:void 0,i=a>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(a--,o):void 0,i&&j(r[0],r[1],i)&&(o=a<3?void 0:o,a=1),n=Object(n);++t<a;){var s=r[t];s&&e(n,s,t,o)}return n})}function $r(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var Fr=Object.prototype,Xr=Fr.hasOwnProperty;function Gr(e){if(!O(e))return $r(e);var n=an(e),r=[];for(var t in e)t=="constructor"&&(n||!Xr.call(e,t))||r.push(t);return r}function Q(e){return z(e)?tr(e,!0):Gr(e)}function _(e){var n=e==null?0:e.length;return n?on(e):[]}function Yr(e){return ar(ir(e,void 0,_),e+"")}var pn=or(Object.getPrototypeOf,Object),Ur="[object Object]",Vr=Function.prototype,Wr=Object.prototype,gn=Vr.toString,qr=Wr.hasOwnProperty,Hr=gn.call(Object);function zr(e){if(!he(e)||sr(e)!=Ur)return!1;var n=pn(e);if(n===null)return!0;var r=qr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&gn.call(r)==Hr}var vn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,De=vn&&typeof module=="object"&&module&&!module.nodeType&&module,Jr=De&&De.exports===vn,Be=Jr?dr.Buffer:void 0,$e=Be?Be.allocUnsafe:void 0;function bn(e,n){if(n)return e.slice();var r=e.length,t=$e?$e(r):new e.constructor(r);return e.copy(t),t}var Kr=Object.prototype,Zr=Kr.hasOwnProperty;function Qr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Zr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function be(e){var n=new e.constructor(e.byteLength);return new Re(n).set(new Re(e)),n}function et(e,n){var r=be(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var nt=/\w*$/;function rt(e){var n=new e.constructor(e.source,nt.exec(e));return n.lastIndex=e.lastIndex,n}var Fe=ke?ke.prototype:void 0,Xe=Fe?Fe.valueOf:void 0;function tt(e){return Xe?Object(Xe.call(e)):{}}function wn(e,n){var r=n?be(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var at="[object Boolean]",it="[object Date]",ot="[object Map]",st="[object Number]",dt="[object RegExp]",ut="[object Set]",ft="[object String]",ct="[object Symbol]",lt="[object ArrayBuffer]",ht="[object DataView]",pt="[object Float32Array]",gt="[object Float64Array]",vt="[object Int8Array]",bt="[object Int16Array]",wt="[object Int32Array]",mt="[object Uint8Array]",yt="[object Uint8ClampedArray]",xt="[object Uint16Array]",Et="[object Uint32Array]";function Lt(e,n,r){var t=e.constructor;switch(n){case lt:return be(e);case at:case it:return new t(+e);case ht:return et(e);case pt:case gt:case vt:case bt:case wt:case mt:case yt:case xt:case Et:return wn(e,r);case ot:return new t;case st:case ft:return new t(e);case dt:return rt(e);case ut:return new t;case ct:return tt(e)}}function mn(e){return typeof e.constructor=="function"&&!an(e)?Mr(pn(e)):{}}var Ot="[object Map]";function Nt(e){return he(e)&&pe(e)==Ot}var Ge=V&&V.isMap,Pt=Ge?ge(Ge):Nt,Tt="[object Set]";function St(e){return he(e)&&pe(e)==Tt}var Ye=V&&V.isSet,Ct=Ye?ge(Ye):St,It=1,yn="[object Arguments]",Rt="[object Array]",kt="[object Boolean]",Mt="[object Date]",_t="[object Error]",xn="[object Function]",At="[object GeneratorFunction]",jt="[object Map]",Dt="[object Number]",En="[object Object]",Bt="[object RegExp]",$t="[object Set]",Ft="[object String]",Xt="[object Symbol]",Gt="[object WeakMap]",Yt="[object ArrayBuffer]",Ut="[object DataView]",Vt="[object Float32Array]",Wt="[object Float64Array]",qt="[object Int8Array]",Ht="[object Int16Array]",zt="[object Int32Array]",Jt="[object Uint8Array]",Kt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",Qt="[object Uint32Array]",y={};y[yn]=y[Rt]=y[Yt]=y[Ut]=y[kt]=y[Mt]=y[Vt]=y[Wt]=y[qt]=y[Ht]=y[zt]=y[jt]=y[Dt]=y[En]=y[Bt]=y[$t]=y[Ft]=y[Xt]=y[Jt]=y[Kt]=y[Zt]=y[Qt]=!0;y[_t]=y[xn]=y[Gt]=!1;function Y(e,n,r,t,a,o){var i,s=n&It;if(i!==void 0)return i;if(!O(e))return e;var d=I(e);if(d)i=Qr(e);else{var u=pe(e),f=u==xn||u==At;if(sn(e))return bn(e,s);if(u==En||u==yn||f&&!a)i=f?{}:mn(e);else{if(!y[u])return a?e:{};i=Lt(e,u,s)}}o||(o=new dn);var c=o.get(e);if(c)return c;o.set(e,i),Ct(e)?e.forEach(function(p){i.add(Y(p,n,r,p,e,o))}):Pt(e)&&e.forEach(function(p,g){i.set(g,Y(p,n,r,g,e,o))});var h=fr,v=d?void 0:h(e);return ur(v||e,function(p,g){v&&(g=p,p=e[g]),Z(i,g,Y(p,n,r,g,e,o))}),i}var ea=1,na=4;function ra(e){return Y(e,ea|na)}var Ln=Object.prototype,ta=Ln.hasOwnProperty,aa=le(function(e,n){e=Object(e);var r=-1,t=n.length,a=t>2?n[2]:void 0;for(a&&j(n[0],n[1],a)&&(t=1);++r<t;)for(var o=n[r],i=Q(o),s=-1,d=i.length;++s<d;){var u=i[s],f=e[u];(f===void 0||H(f,Ln[u])&&!ta.call(e,u))&&(e[u]=o[u])}return e});function se(e,n,r){(r!==void 0&&!H(e[n],r)||r===void 0&&!(n in e))&&K(e,n,r)}function de(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function ia(e){return Dr(e,Q(e))}function oa(e,n,r,t,a,o,i){var s=de(e,r),d=de(n,r),u=i.get(d);if(u){se(e,r,u);return}var f=o?o(s,d,r+"",e,n,i):void 0,c=f===void 0;if(c){var h=I(d),v=!h&&sn(d),p=!h&&!v&&cr(d);f=d,h||v||p?I(s)?f=s:lr(s)?f=_r(s):v?(c=!1,f=bn(d,!0)):p?(c=!1,f=wn(d,!0)):f=[]:zr(d)||Me(d)?(f=s,Me(s)?f=ia(s):(!O(s)||hr(s))&&(f=mn(d))):c=!1}c&&(i.set(d,f),a(f,d,t,o,i),i.delete(d)),se(e,r,f)}function On(e,n,r,t,a){e!==n&&un(n,function(o,i){if(a||(a=new dn),O(o))oa(e,n,i,r,On,t,a);else{var s=t?t(de(e,i),o,i+"",e,n,a):void 0;s===void 0&&(s=o),se(e,i,s)}},Q)}function W(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function sa(e){return function(n,r,t){var a=Object(n);if(!z(n)){var o=M(r);n=pr(n),r=function(s){return o(a[s],s,a)}}var i=e(n,r,t);return i>-1?a[o?n[i]:i]:void 0}}var da=Math.max;function ua(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var a=r==null?0:kr(r);return a<0&&(a=da(t+a,0)),gr(e,M(n),a)}var we=sa(ua);function Nn(e,n){var r=-1,t=z(e)?Array(e.length):[];return vr(e,function(a,o,i){t[++r]=n(a,o,i)}),t}function E(e,n){var r=I(e)?X:Nn;return r(e,M(n))}function fa(e,n){return e==null?e:un(e,fn(n),Q)}function ca(e,n){return e&&cn(e,fn(n))}function la(e,n){return e>n}var ha=Object.prototype,pa=ha.hasOwnProperty;function ga(e,n){return e!=null&&pa.call(e,n)}function Pn(e,n){return e!=null&&br(e,n,ga)}function Tn(e,n){return e<n}function ee(e,n){var r={};return n=M(n),cn(e,function(t,a,o){K(r,a,n(t,a,o))}),r}function me(e,n,r){for(var t=-1,a=e.length;++t<a;){var o=e[t],i=n(o);if(i!=null&&(s===void 0?i===i&&!U(i):r(i,s)))var s=i,d=o}return d}function S(e){return e&&e.length?me(e,ve,la):void 0}var ue=Br(function(e,n,r){On(e,n,r)});function D(e){return e&&e.length?me(e,ve,Tn):void 0}function ye(e,n){return e&&e.length?me(e,M(n),Tn):void 0}function va(e,n,r,t){if(!O(e))return e;n=ln(n,e);for(var a=-1,o=n.length,i=o-1,s=e;s!=null&&++a<o;){var d=wr(n[a]),u=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(a!=i){var f=s[d];u=void 0,u===void 0&&(u=O(f)?f:tn(n[a+1])?[]:{})}Z(s,d,u),s=s[d]}return e}function ba(e,n,r){for(var t=-1,a=n.length,o={};++t<a;){var i=n[t],s=hn(e,i);r(s,i)&&va(o,ln(i,e),s)}return o}function wa(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function ma(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,o=U(e),i=n!==void 0,s=n===null,d=n===n,u=U(n);if(!s&&!u&&!o&&e>n||o&&i&&d&&!s&&!u||t&&i&&d||!r&&d||!a)return 1;if(!t&&!o&&!u&&e<n||u&&r&&a&&!t&&!o||s&&r&&a||!i&&a||!d)return-1}return 0}function ya(e,n,r){for(var t=-1,a=e.criteria,o=n.criteria,i=a.length,s=r.length;++t<i;){var d=ma(a[t],o[t]);if(d){if(t>=s)return d;var u=r[t];return d*(u=="desc"?-1:1)}}return e.index-n.index}function xa(e,n,r){n.length?n=X(n,function(o){return I(o)?function(i){return hn(i,o.length===1?o[0]:o)}:o}):n=[ve];var t=-1;n=X(n,ge(M));var a=Nn(e,function(o,i,s){var d=X(n,function(u){return u(o)});return{criteria:d,index:++t,value:o}});return wa(a,function(o,i){return ya(o,i,r)})}function Ea(e,n){return ba(e,n,function(r,t){return mr(e,t)})}var q=Yr(function(e,n){return e==null?{}:Ea(e,n)}),La=Math.ceil,Oa=Math.max;function Na(e,n,r,t){for(var a=-1,o=Oa(La((n-e)/(r||1)),0),i=Array(o);o--;)i[++a]=e,e+=r;return i}function Pa(e){return function(n,r,t){return t&&typeof t!="number"&&j(n,r,t)&&(r=t=void 0),n=G(n),r===void 0?(r=n,n=0):r=G(r),t=t===void 0?n<r?1:-1:G(t),Na(n,r,t)}}var k=Pa(),F=le(function(e,n){if(e==null)return[];var r=n.length;return r>1&&j(e,n[0],n[1])?n=[]:r>2&&j(n[0],n[1],n[2])&&(n=[n[0]]),xa(e,on(n),[])}),Ta=0;function xe(e){var n=++Ta;return yr(e)+n}function Sa(e,n,r){for(var t=-1,a=e.length,o=n.length,i={};++t<a;){var s=t<o?n[t]:void 0;r(i,e[t],s)}return i}function Ca(e,n){return Sa(e||[],n||[],Z)}class Ia{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Ue(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Ue(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Ra)),t=t._prev;return"["+n.join(", ")+"]"}}function Ue(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ra(e,n){if(e!=="_next"&&e!=="_prev")return n}var ka=xr(1);function Ma(e,n){if(e.nodeCount()<=1)return[];var r=Aa(e,n||ka),t=_a(r.graph,r.buckets,r.zeroIdx);return _(E(t,function(a){return e.outEdges(a.v,a.w)}))}function _a(e,n,r){for(var t=[],a=n[n.length-1],o=n[0],i;e.nodeCount();){for(;i=o.dequeue();)re(e,n,r,i);for(;i=a.dequeue();)re(e,n,r,i);if(e.nodeCount()){for(var s=n.length-2;s>0;--s)if(i=n[s].dequeue(),i){t=t.concat(re(e,n,r,i,!0));break}}}return t}function re(e,n,r,t,a){var o=a?[]:void 0;return l(e.inEdges(t.v),function(i){var s=e.edge(i),d=e.node(i.v);a&&o.push({v:i.v,w:i.w}),d.out-=s,fe(n,r,d)}),l(e.outEdges(t.v),function(i){var s=e.edge(i),d=i.w,u=e.node(d);u.in-=s,fe(n,r,u)}),e.removeNode(t.v),o}function Aa(e,n){var r=new N,t=0,a=0;l(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),l(e.edges(),function(s){var d=r.edge(s.v,s.w)||0,u=n(s),f=d+u;r.setEdge(s.v,s.w,f),a=Math.max(a,r.node(s.v).out+=u),t=Math.max(t,r.node(s.w).in+=u)});var o=k(a+t+3).map(function(){return new Ia}),i=t+1;return l(r.nodes(),function(s){fe(o,i,r.node(s))}),{graph:r,buckets:o,zeroIdx:i}}function fe(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function ja(e){var n=e.graph().acyclicer==="greedy"?Ma(e,r(e)):Da(e);l(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,xe("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function Da(e){var n=[],r={},t={};function a(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,l(e.outEdges(o),function(i){Object.prototype.hasOwnProperty.call(r,i.w)?n.push(i):a(i.w)}),delete r[o])}return l(e.nodes(),a),n}function Ba(e){l(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function A(e,n,r,t){var a;do a=xe(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function $a(e){var n=new N().setGraph(e.graph());return l(e.nodes(),function(r){n.setNode(r,e.node(r))}),l(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function Sn(e){var n=new N({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),l(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function Ve(e,n){var r=e.x,t=e.y,a=n.x-r,o=n.y-t,i=e.width/2,s=e.height/2;if(!a&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,u;return Math.abs(o)*i>Math.abs(a)*s?(o<0&&(s=-s),d=s*a/o,u=s):(a<0&&(i=-i),d=i,u=i*o/a),{x:r+d,y:t+u}}function ne(e){var n=E(k(Cn(e)+1),function(){return[]});return l(e.nodes(),function(r){var t=e.node(r),a=t.rank;L(a)||(n[a][t.order]=r)}),n}function Fa(e){var n=D(E(e.nodes(),function(r){return e.node(r).rank}));l(e.nodes(),function(r){var t=e.node(r);Pn(t,"rank")&&(t.rank-=n)})}function Xa(e){var n=D(E(e.nodes(),function(o){return e.node(o).rank})),r=[];l(e.nodes(),function(o){var i=e.node(o).rank-n;r[i]||(r[i]=[]),r[i].push(o)});var t=0,a=e.graph().nodeRankFactor;l(r,function(o,i){L(o)&&i%a!==0?--t:t&&l(o,function(s){e.node(s).rank+=t})})}function We(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),A(e,"border",a,n)}function Cn(e){return S(E(e.nodes(),function(n){var r=e.node(n).rank;if(!L(r))return r}))}function Ga(e,n){var r={lhs:[],rhs:[]};return l(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Ya(e,n){return n()}function Ua(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&l(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var o=a.minRank,i=a.maxRank+1;o<i;++o)qe(e,"borderLeft","_bl",r,a,o),qe(e,"borderRight","_br",r,a,o)}}l(e.children(),n)}function qe(e,n,r,t,a,o){var i={width:0,height:0,rank:o,borderType:n},s=a[n][o-1],d=A(e,"border",i,r);a[n][o]=d,e.setParent(d,t),s&&e.setEdge(s,d,{weight:1})}function Va(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&In(e)}function Wa(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&qa(e),(n==="lr"||n==="rl")&&(Ha(e),In(e))}function In(e){l(e.nodes(),function(n){He(e.node(n))}),l(e.edges(),function(n){He(e.edge(n))})}function He(e){var n=e.width;e.width=e.height,e.height=n}function qa(e){l(e.nodes(),function(n){te(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,te),Object.prototype.hasOwnProperty.call(r,"y")&&te(r)})}function te(e){e.y=-e.y}function Ha(e){l(e.nodes(),function(n){ae(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,ae),Object.prototype.hasOwnProperty.call(r,"x")&&ae(r)})}function ae(e){var n=e.x;e.x=e.y,e.y=n}function za(e){e.graph().dummyChains=[],l(e.edges(),function(n){Ja(e,n)})}function Ja(e,n){var r=n.v,t=e.node(r).rank,a=n.w,o=e.node(a).rank,i=n.name,s=e.edge(n),d=s.labelRank;if(o!==t+1){e.removeEdge(n);var u=void 0,f,c;for(c=0,++t;t<o;++c,++t)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:n,rank:t},f=A(e,"edge",u,"_d"),t===d&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),e.setEdge(r,f,{weight:s.weight},i),c===0&&e.graph().dummyChains.push(f),r=f;e.setEdge(r,a,{weight:s.weight},i)}}function Ka(e){l(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function Ee(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var o=D(E(e.outEdges(t),function(i){return r(i.w)-e.edge(i).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),a.rank=o}l(e.sources(),r)}function B(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Rn(e){var n=new N({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,o;Za(n,e)<t;)a=Qa(n,e),o=n.hasNode(a.v)?B(e,a):-B(e,a),ei(n,e,o);return n}function Za(e,n){function r(t){l(n.nodeEdges(t),function(a){var o=a.v,i=t===o?a.w:o;!e.hasNode(i)&&!B(n,a)&&(e.setNode(i,{}),e.setEdge(t,i,{}),r(i))})}return l(e.nodes(),r),e.nodeCount()}function Qa(e,n){return ye(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return B(n,r)})}function ei(e,n,r){l(e.nodes(),function(t){n.node(t).rank+=r})}function ni(){}ni.prototype=new Error;function kn(e,n,r){I(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],o={};return l(n,function(i){if(!e.hasNode(i))throw new Error("Graph does not have node: "+i);Mn(e,i,r==="post",o,t,a)}),a}function Mn(e,n,r,t,a,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),l(a(n),function(i){Mn(e,i,r,t,a,o)}),r&&o.push(n))}function ri(e,n){return kn(e,n,"post")}function ti(e,n){return kn(e,n,"pre")}C.initLowLimValues=Oe;C.initCutValues=Le;C.calcCutValue=_n;C.leaveEdge=jn;C.enterEdge=Dn;C.exchangeEdges=Bn;function C(e){e=$a(e),Ee(e);var n=Rn(e);Oe(n),Le(n,e);for(var r,t;r=jn(n);)t=Dn(n,e,r),Bn(n,e,r,t)}function Le(e,n){var r=ri(e,e.nodes());r=r.slice(0,r.length-1),l(r,function(t){ai(e,n,t)})}function ai(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=_n(e,n,r)}function _n(e,n,r){var t=e.node(r),a=t.parent,o=!0,i=n.edge(r,a),s=0;return i||(o=!1,i=n.edge(a,r)),s=i.weight,l(n.nodeEdges(r),function(d){var u=d.v===r,f=u?d.w:d.v;if(f!==a){var c=u===o,h=n.edge(d).weight;if(s+=c?h:-h,oi(e,r,f)){var v=e.edge(r,f).cutvalue;s+=c?-v:v}}}),s}function Oe(e,n){arguments.length<2&&(n=e.nodes()[0]),An(e,{},1,n)}function An(e,n,r,t,a){var o=r,i=e.node(t);return n[t]=!0,l(e.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(n,s)||(r=An(e,n,r,s,t))}),i.low=o,i.lim=r++,a?i.parent=a:delete i.parent,r}function jn(e){return we(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Dn(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var o=e.node(t),i=e.node(a),s=o,d=!1;o.lim>i.lim&&(s=i,d=!0);var u=$(n.edges(),function(f){return d===ze(e,e.node(f.v),s)&&d!==ze(e,e.node(f.w),s)});return ye(u,function(f){return B(n,f)})}function Bn(e,n,r,t){var a=r.v,o=r.w;e.removeEdge(a,o),e.setEdge(t.v,t.w,{}),Oe(e),Le(e,n),ii(e,n)}function ii(e,n){var r=we(e.nodes(),function(a){return!n.node(a).parent}),t=ti(e,r);t=t.slice(1),l(t,function(a){var o=e.node(a).parent,i=n.edge(a,o),s=!1;i||(i=n.edge(o,a),s=!0),n.node(a).rank=n.node(o).rank+(s?i.minlen:-i.minlen)})}function oi(e,n,r){return e.hasEdge(n,r)}function ze(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function si(e){switch(e.graph().ranker){case"network-simplex":Je(e);break;case"tight-tree":ui(e);break;case"longest-path":di(e);break;default:Je(e)}}var di=Ee;function ui(e){Ee(e),Rn(e)}function Je(e){C(e)}function fi(e){var n=A(e,"root",{},"_root"),r=ci(e),t=S(R(r))-1,a=2*t+1;e.graph().nestingRoot=n,l(e.edges(),function(i){e.edge(i).minlen*=a});var o=li(e)+1;l(e.children(),function(i){$n(e,n,a,o,t,r,i)}),e.graph().nodeRankFactor=a}function $n(e,n,r,t,a,o,i){var s=e.children(i);if(!s.length){i!==n&&e.setEdge(n,i,{weight:0,minlen:r});return}var d=We(e,"_bt"),u=We(e,"_bb"),f=e.node(i);e.setParent(d,i),f.borderTop=d,e.setParent(u,i),f.borderBottom=u,l(s,function(c){$n(e,n,r,t,a,o,c);var h=e.node(c),v=h.borderTop?h.borderTop:c,p=h.borderBottom?h.borderBottom:c,g=h.borderTop?t:2*t,b=v!==p?1:a-o[i]+1;e.setEdge(d,v,{weight:g,minlen:b,nestingEdge:!0}),e.setEdge(p,u,{weight:g,minlen:b,nestingEdge:!0})}),e.parent(i)||e.setEdge(n,d,{weight:0,minlen:a+o[i]})}function ci(e){var n={};function r(t,a){var o=e.children(t);o&&o.length&&l(o,function(i){r(i,a+1)}),n[t]=a}return l(e.children(),function(t){r(t,1)}),n}function li(e){return J(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function hi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,l(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function pi(e,n,r){var t={},a;l(r,function(o){for(var i=e.parent(o),s,d;i;){if(s=e.parent(i),s?(d=t[s],t[s]=i):(d=a,a=i),d&&d!==i){n.setEdge(d,i);return}i=s}})}function gi(e,n,r){var t=vi(e),a=new N({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return l(e.nodes(),function(o){var i=e.node(o),s=e.parent(o);(i.rank===n||i.minRank<=n&&n<=i.maxRank)&&(a.setNode(o),a.setParent(o,s||t),l(e[r](o),function(d){var u=d.v===o?d.w:d.v,f=a.edge(u,o),c=L(f)?0:f.weight;a.setEdge(u,o,{weight:e.edge(d).weight+c})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&a.setNode(o,{borderLeft:i.borderLeft[n],borderRight:i.borderRight[n]}))}),a}function vi(e){for(var n;e.hasNode(n=xe("_root")););return n}function bi(e,n){for(var r=0,t=1;t<n.length;++t)r+=wi(e,n[t-1],n[t]);return r}function wi(e,n,r){for(var t=Ca(r,E(r,function(u,f){return f})),a=_(E(n,function(u){return F(E(e.outEdges(u),function(f){return{pos:t[f.w],weight:e.edge(f).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var i=2*o-1;o-=1;var s=E(new Array(i),function(){return 0}),d=0;return l(a.forEach(function(u){var f=u.pos+o;s[f]+=u.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),f=f-1>>1,s[f]+=u.weight;d+=u.weight*c})),d}function mi(e){var n={},r=$(e.nodes(),function(s){return!e.children(s).length}),t=S(E(r,function(s){return e.node(s).rank})),a=E(k(t+1),function(){return[]});function o(s){if(!Pn(n,s)){n[s]=!0;var d=e.node(s);a[d.rank].push(s),l(e.successors(s),o)}}var i=F(r,function(s){return e.node(s).rank});return l(i,o),a}function yi(e,n){return E(n,function(r){var t=e.inEdges(r);if(t.length){var a=J(t,function(o,i){var s=e.edge(i),d=e.node(i.v);return{sum:o.sum+s.weight*d.order,weight:o.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function xi(e,n){var r={};l(e,function(a,o){var i=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i:o};L(a.barycenter)||(i.barycenter=a.barycenter,i.weight=a.weight)}),l(n.edges(),function(a){var o=r[a.v],i=r[a.w];!L(o)&&!L(i)&&(i.indegree++,o.out.push(r[a.w]))});var t=$(r,function(a){return!a.indegree});return Ei(t)}function Ei(e){var n=[];function r(o){return function(i){i.merged||(L(i.barycenter)||L(o.barycenter)||i.barycenter>=o.barycenter)&&Li(o,i)}}function t(o){return function(i){i.in.push(o),--i.indegree===0&&e.push(i)}}for(;e.length;){var a=e.pop();n.push(a),l(a.in.reverse(),r(a)),l(a.out,t(a))}return E($(n,function(o){return!o.merged}),function(o){return q(o,["vs","i","barycenter","weight"])})}function Li(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Oi(e,n){var r=Ga(e,function(f){return Object.prototype.hasOwnProperty.call(f,"barycenter")}),t=r.lhs,a=F(r.rhs,function(f){return-f.i}),o=[],i=0,s=0,d=0;t.sort(Ni(!!n)),d=Ke(o,a,d),l(t,function(f){d+=f.vs.length,o.push(f.vs),i+=f.barycenter*f.weight,s+=f.weight,d=Ke(o,a,d)});var u={vs:_(o)};return s&&(u.barycenter=i/s,u.weight=s),u}function Ke(e,n,r){for(var t;n.length&&(t=W(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ni(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Fn(e,n,r,t){var a=e.children(n),o=e.node(n),i=o?o.borderLeft:void 0,s=o?o.borderRight:void 0,d={};i&&(a=$(a,function(p){return p!==i&&p!==s}));var u=yi(e,a);l(u,function(p){if(e.children(p.v).length){var g=Fn(e,p.v,r,t);d[p.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Ti(p,g)}});var f=xi(u,r);Pi(f,d);var c=Oi(f,t);if(i&&(c.vs=_([i,c.vs,s]),e.predecessors(i).length)){var h=e.node(e.predecessors(i)[0]),v=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(c,"barycenter")||(c.barycenter=0,c.weight=0),c.barycenter=(c.barycenter*c.weight+h.order+v.order)/(c.weight+2),c.weight+=2}return c}function Pi(e,n){l(e,function(r){r.vs=_(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Ti(e,n){L(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function Si(e){var n=Cn(e),r=Ze(e,k(1,n+1),"inEdges"),t=Ze(e,k(n-1,-1,-1),"outEdges"),a=mi(e);Qe(e,a);for(var o=Number.POSITIVE_INFINITY,i,s=0,d=0;d<4;++s,++d){Ci(s%2?r:t,s%4>=2),a=ne(e);var u=bi(e,a);u<o&&(d=0,i=ra(a),o=u)}Qe(e,i)}function Ze(e,n,r){return E(n,function(t){return gi(e,t,r)})}function Ci(e,n){var r=new N;l(e,function(t){var a=t.graph().root,o=Fn(t,a,r,n);l(o.vs,function(i,s){t.node(i).order=s}),pi(t,r,o.vs)})}function Qe(e,n){l(n,function(r){l(r,function(t,a){e.node(t).order=a})})}function Ii(e){var n=ki(e);l(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,o=Ri(e,n,a.v,a.w),i=o.path,s=o.lca,d=0,u=i[d],f=!0;r!==a.w;){if(t=e.node(r),f){for(;(u=i[d])!==s&&e.node(u).maxRank<t.rank;)d++;u===s&&(f=!1)}if(!f){for(;d<i.length-1&&e.node(u=i[d+1]).minRank<=t.rank;)d++;u=i[d]}e.setParent(r,u),r=e.successors(r)[0]}})}function Ri(e,n,r,t){var a=[],o=[],i=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim),d,u;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>i||s>n[d].lim));for(u=d,d=t;(d=e.parent(d))!==u;)o.push(d);return{path:a.concat(o.reverse()),lca:u}}function ki(e){var n={},r=0;function t(a){var o=r;l(e.children(a),t),n[a]={low:o,lim:r++}}return l(e.children(),t),n}function Mi(e,n){var r={};function t(a,o){var i=0,s=0,d=a.length,u=W(o);return l(o,function(f,c){var h=Ai(e,f),v=h?e.node(h).order:d;(h||f===u)&&(l(o.slice(s,c+1),function(p){l(e.predecessors(p),function(g){var b=e.node(g),w=b.order;(w<i||v<w)&&!(b.dummy&&e.node(p).dummy)&&Xn(r,g,p)})}),s=c+1,i=v)}),o}return J(n,t),r}function _i(e,n){var r={};function t(o,i,s,d,u){var f;l(k(i,s),function(c){f=o[c],e.node(f).dummy&&l(e.predecessors(f),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>u)&&Xn(r,h,f)})})}function a(o,i){var s=-1,d,u=0;return l(i,function(f,c){if(e.node(f).dummy==="border"){var h=e.predecessors(f);h.length&&(d=e.node(h[0]).order,t(i,u,c,s,d),u=c,s=d)}t(i,u,i.length,d,o.length)}),i}return J(n,a),r}function Ai(e,n){if(e.node(n).dummy)return we(e.predecessors(n),function(r){return e.node(r).dummy})}function Xn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function ji(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Di(e,n,r,t){var a={},o={},i={};return l(n,function(s){l(s,function(d,u){a[d]=d,o[d]=d,i[d]=u})}),l(n,function(s){var d=-1;l(s,function(u){var f=t(u);if(f.length){f=F(f,function(g){return i[g]});for(var c=(f.length-1)/2,h=Math.floor(c),v=Math.ceil(c);h<=v;++h){var p=f[h];o[u]===u&&d<i[p]&&!ji(r,u,p)&&(o[p]=u,o[u]=a[u]=a[p],d=i[p])}}})}),{root:a,align:o}}function Bi(e,n,r,t,a){var o={},i=$i(e,n,r,a),s=a?"borderLeft":"borderRight";function d(c,h){for(var v=i.nodes(),p=v.pop(),g={};p;)g[p]?c(p):(g[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function u(c){o[c]=i.inEdges(c).reduce(function(h,v){return Math.max(h,o[v.v]+i.edge(v))},0)}function f(c){var h=i.outEdges(c).reduce(function(p,g){return Math.min(p,o[g.w]-i.edge(g))},Number.POSITIVE_INFINITY),v=e.node(c);h!==Number.POSITIVE_INFINITY&&v.borderType!==s&&(o[c]=Math.max(o[c],h))}return d(u,i.predecessors.bind(i)),d(f,i.successors.bind(i)),l(t,function(c){o[c]=o[r[c]]}),o}function $i(e,n,r,t){var a=new N,o=e.graph(),i=Ui(o.nodesep,o.edgesep,t);return l(n,function(s){var d;l(s,function(u){var f=r[u];if(a.setNode(f),d){var c=r[d],h=a.edge(c,f);a.setEdge(c,f,Math.max(i(e,u,d),h||0))}d=u})}),a}function Fi(e,n){return ye(R(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return fa(r,function(o,i){var s=Vi(e,i)/2;t=Math.max(o+s,t),a=Math.min(o-s,a)}),t-a})}function Xi(e,n){var r=R(n),t=D(r),a=S(r);l(["u","d"],function(o){l(["l","r"],function(i){var s=o+i,d=e[s],u;if(d!==n){var f=R(d);u=i==="l"?t-D(f):a-S(f),u&&(e[s]=ee(d,function(c){return c+u}))}})})}function Gi(e,n){return ee(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=F(E(e,t));return(a[1]+a[2])/2})}function Yi(e){var n=ne(e),r=ue(Mi(e,n),_i(e,n)),t={},a;l(["u","d"],function(i){a=i==="u"?n:R(n).reverse(),l(["l","r"],function(s){s==="r"&&(a=E(a,function(c){return R(c).reverse()}));var d=(i==="u"?e.predecessors:e.successors).bind(e),u=Di(e,a,r,d),f=Bi(e,a,u.root,u.align,s==="r");s==="r"&&(f=ee(f,function(c){return-c})),t[i+s]=f})});var o=Fi(e,t);return Xi(t,o),Gi(t,e.graph().align)}function Ui(e,n,r){return function(t,a,o){var i=t.node(a),s=t.node(o),d=0,u;if(d+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":u=-i.width/2;break;case"r":u=i.width/2;break}if(u&&(d+=r?u:-u),u=0,d+=(i.dummy?n:e)/2,d+=(s.dummy?n:e)/2,d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(d+=r?u:-u),u=0,d}}function Vi(e,n){return e.node(n).width}function Wi(e){e=Sn(e),qi(e),ca(Yi(e),function(n,r){e.node(r).x=n})}function qi(e){var n=ne(e),r=e.graph().ranksep,t=0;l(n,function(a){var o=S(E(a,function(i){return e.node(i).height}));l(a,function(i){e.node(i).y=t+o/2}),t+=o+r})}function Hi(e,n){var r=Ya;r("layout",()=>{var t=r(" buildLayoutGraph",()=>io(e));r(" runLayout",()=>zi(t,r)),r(" updateInputGraph",()=>Ji(e,t))})}function zi(e,n){n(" makeSpaceForEdgeLabels",()=>oo(e)),n(" removeSelfEdges",()=>vo(e)),n(" acyclic",()=>ja(e)),n(" nestingGraph.run",()=>fi(e)),n(" rank",()=>si(Sn(e))),n(" injectEdgeLabelProxies",()=>so(e)),n(" removeEmptyRanks",()=>Xa(e)),n(" nestingGraph.cleanup",()=>hi(e)),n(" normalizeRanks",()=>Fa(e)),n(" assignRankMinMax",()=>uo(e)),n(" removeEdgeLabelProxies",()=>fo(e)),n(" normalize.run",()=>za(e)),n(" parentDummyChains",()=>Ii(e)),n(" addBorderSegments",()=>Ua(e)),n(" order",()=>Si(e)),n(" insertSelfEdges",()=>bo(e)),n(" adjustCoordinateSystem",()=>Va(e)),n(" position",()=>Wi(e)),n(" positionSelfEdges",()=>wo(e)),n(" removeBorderNodes",()=>go(e)),n(" normalize.undo",()=>Ka(e)),n(" fixupEdgeLabelCoords",()=>ho(e)),n(" undoCoordinateSystem",()=>Wa(e)),n(" translateGraph",()=>co(e)),n(" assignNodeIntersects",()=>lo(e)),n(" reversePoints",()=>po(e)),n(" acyclic.undo",()=>Ba(e))}function Ji(e,n){l(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),l(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Ki=["nodesep","edgesep","ranksep","marginx","marginy"],Zi={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Qi=["acyclicer","ranker","rankdir","align"],eo=["width","height"],no={width:0,height:0},ro=["minlen","weight","width","height","labeloffset"],to={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ao=["labelpos"];function io(e){var n=new N({multigraph:!0,compound:!0}),r=oe(e.graph());return n.setGraph(ue({},Zi,ie(r,Ki),q(r,Qi))),l(e.nodes(),function(t){var a=oe(e.node(t));n.setNode(t,aa(ie(a,eo),no)),n.setParent(t,e.parent(t))}),l(e.edges(),function(t){var a=oe(e.edge(t));n.setEdge(t,ue({},to,ie(a,ro),q(a,ao)))}),n}function oo(e){var n=e.graph();n.ranksep/=2,l(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function so(e){l(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),o={rank:(a.rank-t.rank)/2+t.rank,e:n};A(e,"edge-proxy",o,"_ep")}})}function uo(e){var n=0;l(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=S(n,t.maxRank))}),e.graph().maxRank=n}function fo(e){l(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function co(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,o=e.graph(),i=o.marginx||0,s=o.marginy||0;function d(u){var f=u.x,c=u.y,h=u.width,v=u.height;n=Math.min(n,f-h/2),r=Math.max(r,f+h/2),t=Math.min(t,c-v/2),a=Math.max(a,c+v/2)}l(e.nodes(),function(u){d(e.node(u))}),l(e.edges(),function(u){var f=e.edge(u);Object.prototype.hasOwnProperty.call(f,"x")&&d(f)}),n-=i,t-=s,l(e.nodes(),function(u){var f=e.node(u);f.x-=n,f.y-=t}),l(e.edges(),function(u){var f=e.edge(u);l(f.points,function(c){c.x-=n,c.y-=t}),Object.prototype.hasOwnProperty.call(f,"x")&&(f.x-=n),Object.prototype.hasOwnProperty.call(f,"y")&&(f.y-=t)}),o.width=r-n+i,o.height=a-t+s}function lo(e){l(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),o,i;r.points?(o=r.points[0],i=r.points[r.points.length-1]):(r.points=[],o=a,i=t),r.points.unshift(Ve(t,o)),r.points.push(Ve(a,i))})}function ho(e){l(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function po(e){l(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function go(e){l(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),o=e.node(W(r.borderLeft)),i=e.node(W(r.borderRight));r.width=Math.abs(i.x-o.x),r.height=Math.abs(a.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),l(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function vo(e){l(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function bo(e){var n=ne(e);l(n,function(r){var t=0;l(r,function(a,o){var i=e.node(a);i.order=o+t,l(i.selfEdges,function(s){A(e,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:o+ ++t,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function wo(e){l(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,o=t.y,i=r.x-a,s=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*i/3,y:o-s},{x:a+5*i/6,y:o-s},{x:a+i,y:o},{x:a+5*i/6,y:o+s},{x:a+2*i/3,y:o+s}],r.label.x=r.x,r.label.y=r.y}})}function ie(e,n){return ee(q(e,n),Number)}function oe(e){var n={};return l(e,function(r,t){n[t.toLowerCase()]=r}),n}var en=x((e,n,r)=>Math.max(n,Math.min(r,e)),"clamp"),nn=x((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),mo=x(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),yo=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],xo=x((e,n,r,t,a)=>{const o=[],i=new Set;if(r.forEach(({start:f,end:c})=>{f!==t&&i.add(f),c!==t&&i.add(c)}),i.forEach(f=>{const c=e.node(f);typeof c?.x=="number"&&typeof c?.y=="number"&&o.push(c)}),o.length===0&&r.forEach(({edge:f})=>{(f.points??[]).forEach(c=>{typeof c?.x=="number"&&typeof c?.y=="number"&&o.push(c)})}),o.length===0)return nn(a);const s=o.reduce((f,c)=>({x:f.x+c.x/o.length,y:f.y+c.y/o.length}),{x:0,y:0}),d=s.x-n.x,u=s.y-n.y;return Math.abs(d)>Math.abs(u)?d>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":nn(a)},"getSelfLoopSide"),Eo=x((e,n="top",r=0,t=0)=>{const a=e.x,o=e.y-r,i=e.width/2,s=e.height/2,d=Math.max(36,Math.min(100,e.width*.8)),u=en(Math.max(t,e.width*.35),36,d),f=en(Math.min(e.width,e.height)*.45,24,48);switch(n){case"bottom":{const c=o+s;return[{x:a-u/2,y:c},{x:a-u/2,y:c+f},{x:a+u/2,y:c+f},{x:a+u/2,y:c}]}case"right":{const c=a+i;return[{x:c,y:o-u/2},{x:c+f,y:o-u/2},{x:c+f,y:o+u/2},{x:c,y:o+u/2}]}case"left":{const c=a-i;return[{x:c,y:o-u/2},{x:c-f,y:o-u/2},{x:c-f,y:o+u/2},{x:c,y:o+u/2}]}case"top":default:{const c=o-s;return[{x:a-u/2,y:c},{x:a-u/2,y:c-f},{x:a+u/2,y:c-f},{x:a+u/2,y:c}]}}},"getSelfLoopPoints"),Lo=x((e,n,r="top",t=0,a={})=>{const i=e.x,s=e.y-t,d=a.width??0,u=a.height??0;switch(r){case"bottom":return{x:i,y:Math.max(...n.map(f=>f.y))+u/2+4};case"right":return{x:Math.max(...n.map(f=>f.x))+d/2+4,y:s};case"left":return{x:Math.min(...n.map(f=>f.x))-d/2-4,y:s};case"top":default:return{x:i,y:Math.min(...n.map(f=>f.y))-u/2-4}}},"getSelfLoopLabelPosition"),Gn=x((e,n=0,{mergeSelfLoops:r=!0}={})=>{const t=new Map,a=[],o=e.graph()?.rankdir;return e.edges().forEach(i=>{const s=e.edge(i);if(r&&s.selfLoop){const d=s.selfLoop.id;t.has(d)||t.set(d,[]),t.get(d).push({edge:s,start:i.v,end:i.w})}else a.push({edge:s,start:i.v,end:i.w})}),t.forEach(i=>{if(i.length!==3){i.forEach(w=>a.push(w));return}i.sort((w,P)=>w.edge.selfLoop.order-P.edge.selfLoop.order);const[s,d,u]=i,f=s.edge.originalEdge??d.edge.originalEdge??u.edge.originalEdge??d.edge,c=e.node(f.start);if(!c){i.forEach(w=>a.push(w));return}const h={width:d.edge.width,height:d.edge.height},v=xo(e,c,i,f.start,o),p=Eo(c,v,n,h.width??0),g=Lo(c,p,v,n,h),b={...d.edge,...f,id:f.id,points:p,start:f.start,end:f.end,x:g.x,y:g.y,width:h.width,height:h.height,labelStyle:d.edge.labelStyle,fromCluster:s.edge.fromCluster??d.edge.fromCluster??u.edge.fromCluster,toCluster:s.edge.toCluster??d.edge.toCluster??u.edge.toCluster};delete b.selfLoop,delete b.originalEdge,a.push({edge:b,start:b.start,end:b.end})}),a},"getEdgesToRender"),Yn=x(async({element:e,graph:n,diagramType:r,id:t,parentCluster:a,siteConfig:o})=>{const i=n.graph().rankdir;m.trace("Dir in recursive render - dir:",i);const{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c}=Hn(e,{edgePathsClass:"edgePaths"});n.nodes()?m.info("Recursive render XXX",n.nodes()):m.info("No nodes found for",n),n.edges().length>0&&m.info("Recursive edges",n.edge(n.edges()[0]));const h=mo(r);await Promise.all(n.nodes().map(async function(g){const b=n.node(g);if(a!==void 0){const w=JSON.parse(JSON.stringify(a.clusterData));m.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,g,`
3
3
  data=`,w.height,`
4
4
  Parent cluster`,a.height),n.setNode(a.id,w),n.parent(g)||(m.trace("Setting parent",g,a.id),n.setParent(g,a.id,w))}if(m.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),b?.clusterNode){m.info("Cluster identified XBX",g,b.width,n.node(g));const{ranksep:w,nodesep:P}=n.graph();b.graph.setGraph({...b.graph.graph(),ranksep:w+25,nodesep:P});const Ne=await So({element:f,graph:b.graph,diagramType:r,id:t,parentCluster:n.node(g),siteConfig:o}),Pe=Ne.elem;Kn(b,Pe),b.diff=Ne.diff||0,m.info("New compound node after recursive render XAX",g,"width",b.width,"height",b.height),Zn(Pe,b)}else n.children(g).length>0?(m.trace("Cluster - the non recursive path XBX",g,b.id,b,b.width,"Graph:",n),m.trace(Te(b.id,n)),T.set(b.id,{id:Te(b.id,n),node:b})):(m.trace("Node - the non recursive path XAX",g,f,n.node(g),i),await zn(f,n.node(g),{config:o,dir:i}))})),await x(async()=>{const g=n.edges().map(async function(b){const w=n.edge(b.v,b.w,b.name);if(m.info("Edge "+b.v+" -> "+b.w+": "+JSON.stringify(b)),m.info("Edge "+b.v+" -> "+b.w+": ",b," ",JSON.stringify(n.edge(b))),m.info("Fix",T,"ids:",b.v,b.w,"Translating: ",T.get(b.v),T.get(b.w)),h&&w.selfLoop){if(w.selfLoop.order!==1)return;const P={...w.originalEdge,...w,id:w.selfLoop.id,startLabelLeft:w.originalEdge?.startLabelLeft??w.startLabelLeft,startLabelRight:w.originalEdge?.startLabelRight??w.startLabelRight,endLabelLeft:w.originalEdge?.endLabelLeft??w.endLabelLeft,endLabelRight:w.originalEdge?.endLabelRight??w.endLabelRight};await Se(u,P),w.width=P.width,w.height=P.height,w.labelStyle=P.labelStyle;return}await Se(u,w)});await Promise.all(g)},"processEdges")();const{subGraphTitleTotalMargin:p}=Qn(o);return{elem:c,graph:n,groups:{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c},diagramType:r,id:t,mergeSelfLoops:h,subGraphTitleTotalMargin:p}},"measureDagreGraph"),Un=x(e=>{m.info("############################################# XXX"),m.info("### Layout ### XXX"),m.info("############################################# XXX"),Hi(e)},"runDagreGraphLayout"),Oo=x((e,n,r)=>{const t=e.node(n);if(!t)return;const a={...t};return t?.clusterNode?a.y=(t.y??0)+r:e.children(n).length>0?a.height=(t.height??0)+r:a.y=(t.y??0)+r/2,a},"normalizeDagreNode"),rn=x((e,n)=>{yo.forEach(r=>{n[r]!==void 0&&(e[r]=n[r])})},"applyDagreNodeLayout"),No=x((e,n,r,t)=>({...e,start:e.start??n,end:e.end??r,points:(e.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+t:a.y}))}),"normalizeDagreEdge"),Po=x((e,n)=>{const{graph:r,mergeSelfLoops:t,subGraphTitleTotalMargin:a=0}=n,o=new Map(e.nodes.map(s=>[s.id,s]));ce(r).forEach(s=>{const d=Oo(r,s,a);if(!d)return;rn(r.node(s),d);const u=o.get(s);u&&rn(u,d)});const i=a/2;return e.edges=Gn(r,i,{mergeSelfLoops:t}).map(({edge:s,start:d,end:u})=>No(s,d,u,i)),e},"applyDagreLayoutResult"),To=x(async({elem:e,graph:n,groups:{clusters:r,edgePaths:t},diagramType:a,id:o,mergeSelfLoops:i,subGraphTitleTotalMargin:s})=>{let d=0;await Promise.all(ce(n).map(async function(c){const h=n.node(c);if(m.info("Position XBX => "+c+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,m.info("A tainted cluster node XBX1",c,h.id,h.width,h.height,h.x,h.y,n.parent(c)),T.get(h.id).node=h,Ce(h);else if(n.children(c).length>0){m.info("A pure cluster node XBX1",c,h.id,h.x,h.y,h.width,h.height,n.parent(c)),h.height+=s,n.node(h.parentId);const v=h?.padding/2||0,p=h?.labelBBox?.height||0,g=p-v||0;m.debug("OffsetY",g,"labelHeight",p,"halfPadding",v),await er(r,h),T.get(h.id).node=h}else{const v=n.node(h.parentId);h.y+=s/2,m.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",v,v?.offsetY,h),Ce(h)}}));const u=s/2;return Gn(n,u,{mergeSelfLoops:i}).forEach(function({edge:c,start:h,end:v}){m.info("Edge "+h+" -> "+v+": "+JSON.stringify(c),c),c.points.forEach(w=>w.y+=u);const p=n.node(h),g=n.node(v),b=nr(t,c,T,a,p,g,o);rr(c,b)}),n.nodes().forEach(function(c){const h=n.node(c);m.info(c,h.type,h.diff),h.isGroup&&(d=h.diff)}),m.warn("Returning from recursive render XAX",e,d),{elem:e,diff:d}},"paintDagreLayoutCore"),So=x(async e=>{const n=await Yn(e);return Un(n.graph),await To(n)},"renderDagreSubgraph"),Vn=x(e=>{const n=new N({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(r=>{n.setNode(r.id,{...r}),r.parentId&&n.setParent(r.id,r.parentId)}),m.debug("Edges:",e.edges),e.edges.forEach(r=>{if(r.start===r.end){const t=r.start,a=t+"---"+t+"---1",o=t+"---"+t+"---2",i=n.node(t);n.setNode(a,{domId:a,id:a,parentId:i.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(a,i.parentId),n.setNode(o,{domId:o,id:o,parentId:i.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(o,i.parentId);const s=structuredClone(r),d=structuredClone(r),u=structuredClone(r),f=structuredClone(r);d.originalEdge=s,d.selfLoop={id:s.id,order:0},u.originalEdge=s,u.selfLoop={id:s.id,order:1},f.originalEdge=s,f.selfLoop={id:s.id,order:2},d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=t+"-cyclic-special-1",u.startLabelRight="",u.startLabelLeft="",u.endLabelLeft="",u.endLabelRight="",u.arrowTypeStart="none",u.arrowTypeEnd="none",u.id=t+"-cyclic-special-mid",f.label="",f.startLabelRight="",f.startLabelLeft="",f.arrowTypeStart="none",i.isGroup&&(d.fromCluster=t,f.toCluster=t),f.id=t+"-cyclic-special-2",f.arrowTypeStart="none",n.setEdge(t,a,d,t+"-cyclic-special-0"),n.setEdge(a,o,u,t+"-cyclic-special-1"),n.setEdge(o,t,f,t+"-cyclic-special-2")}else n.setEdge(r.start,r.end,{...r},r.id)}),Wn(n),{graph:n}},"prepareLayoutForDagre"),Co=x(async(e,{element:n,preparedLayout:r})=>{const t=r??Vn(e),a=Jn(),o=await Yn({element:n,graph:t.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return t.measuredLayout=o,o},"measureDagreLayout"),Io=x((e,n)=>{const r=n.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return Un(r.graph),Po(e,r),r},"runDagreLayoutCore"),Ro=x((e,{measure:n})=>ce(n.graph).map(r=>n.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),ko=x((e,n,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),jo=qn({prepareLayout:Vn,measureLayout:Co,runLayoutCore:Io,paintOptions:{clusterDb:T,getNodes:Ro,getEdgeNode:ko,skipNode:x((e,{measure:n})=>!n.graph.hasNode(e.id),"skipNode"),isCluster:x((e,{measure:n})=>n.graph.hasNode(e.id)&&(n.graph.children(e.id)??[]).length>0,"isCluster")}});export{Po as applyDagreLayoutResult,Gn as getEdgesToRender,Co as measureDagreLayout,Vn as prepareLayoutForDagre,jo as render,Io as runDagreLayoutCore};
@@ -1 +1 @@
1
- import{t as y,bo as i,bw as _,b as x}from"./DWvCfaBg.js";import{bs as C,bk as z,bH as I,a7 as N,ay as E,aD as S,W as c,bn as k,bV as w,aA as d,a5 as A,bA as P,aB as q}from"./3SdAC2_C.js";import{i as B}from"./VTJf_qPn.js";import{t as D}from"./Bu3PKqut.js";import{e as H}from"./CueOVPTy.js";var M=q("<div><!></div>");function V(l,a){if(new.target)return y({component:V,...l});C(a,!0);let n=i(a,"target",7,"body"),o=i(a,"zIndex",7,10),s=i(a,"children",7),t,m=w(!1);z(()=>{let e;return typeof n()=="string"?e=document.querySelector(n()):e=n(),e||(e=document.body),t=document.createElement("div"),t.className="portal-container",t.style.zIndex=String(o()),t.style.position="relative",e.appendChild(t),I(m,!0),()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}});function f(e){return t&&t.appendChild(e),{destroy(){e&&e.parentNode&&e.parentNode.removeChild(e)}}}var u={get target(){return n()},set target(e="body"){n(e),d()},get zIndex(){return o()},set zIndex(e=10){o(e),d()},get children(){return s()},set children(e){s(e),d()},$set:_,$on:(e,r)=>x(a,e,r)},p=N(),g=E(p);{var v=e=>{var r=M(),b=A(r);D(b,s),P(r),H(r,h=>f?.(h)),c(e,r)};B(g,e=>{S(m)&&e(v)})}return c(l,p),k(u)}export{V as P};
1
+ import{t as y,bo as i,bw as _,b as x}from"./YLhFQnIu.js";import{bs as C,bk as z,bH as I,a7 as N,ay as E,aD as S,W as c,bn as k,bV as w,aA as d,a5 as A,bA as P,aB as q}from"./3SdAC2_C.js";import{i as B}from"./YeOAvjnW.js";import{t as D}from"./CrpUtGFn.js";import{e as H}from"./oBIu7LTI.js";var M=q("<div><!></div>");function V(l,a){if(new.target)return y({component:V,...l});C(a,!0);let n=i(a,"target",7,"body"),o=i(a,"zIndex",7,10),s=i(a,"children",7),t,m=w(!1);z(()=>{let e;return typeof n()=="string"?e=document.querySelector(n()):e=n(),e||(e=document.body),t=document.createElement("div"),t.className="portal-container",t.style.zIndex=String(o()),t.style.position="relative",e.appendChild(t),I(m,!0),()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}});function f(e){return t&&t.appendChild(e),{destroy(){e&&e.parentNode&&e.parentNode.removeChild(e)}}}var u={get target(){return n()},set target(e="body"){n(e),d()},get zIndex(){return o()},set zIndex(e=10){o(e),d()},get children(){return s()},set children(e){s(e),d()},$set:_,$on:(e,r)=>x(a,e,r)},p=N(),g=E(p);{var v=e=>{var r=M(),b=A(r);D(b,s),P(r),H(r,h=>f?.(h)),c(e,r)};B(g,e=>{S(m)&&e(v)})}return c(l,p),k(u)}export{V as P};
@@ -1,4 +1,4 @@
1
- import{c as t,s as r}from"./IG43rVtJ.js";import{b as a}from"./BolJpU8l.js";var s=a(e=>`${r(e)}
1
+ import{c as t,s as r}from"./C8guha5a.js";import{b as a}from"./B1lrKll_.js";var s=a(e=>`${r(e)}
2
2
  .swimlane.cluster:not([data-color-id]) rect {
3
3
  stroke: ${e.clusterBorder} !important;
4
4
  }
@@ -1 +1 @@
1
- import{bW as b,ds as _,dA as P,bQ as k,b2 as C}from"./3Kr2ijlK.js";import{c as v}from"./ChTqQfQN.js";import{bm as m}from"./DWvCfaBg.js";import{Jx as y}from"./CIoJPvjg.js";const A={narrowWidth:600,shortHeight:500,wideWidth:900};function I(e,c,t){let i;e<A.narrowWidth?i=2:(e<A.wideWidth,i=Math.min(3,t));let o;c<A.shortHeight?o=2:o=Math.min(3,Math.ceil(t/i));const n=i*o;return{columns:i,rows:o,maxItems:n}}const h=v("PresetExecutor");async function H(e,c,t){switch(h.info("Applying content preset",{presetId:e,context:t}),e){case"planning":return W(c,t);case"agents-row":return D(c,t);case"changes":return G(c,t);case"review":return L(c,t);default:return c.applyPreset(e),!0}}async function W(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_tabTypes_agent_title(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"note",title:m.layout_shared_spec_title(),noteId:"spec",closable:!0,workspaceId:t},n[1]),!0})}async function D(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=6,r=y.state,l=b.select(r,t),p=C.select(r,t).sort((s,a)=>{const d=s.status==="active"||s.isProcessing,u=a.status==="active"||a.isProcessing;if(d&&!u)return-1;if(!d&&u)return 1;const f=s.lastActivity?new Date(s.lastActivity).getTime():s.updatedAt?new Date(s.updatedAt).getTime():0;return(a.lastActivity?new Date(a.lastActivity).getTime():a.updatedAt?new Date(a.updatedAt).getTime():0)-f});h.info("Agents row preset - agent counts",{total:l.length+p.length,foreground:l.length,background:p.length});const g=[...l,...p.slice(0,n-l.length)].slice(0,n);if(g.length===0)return h.info("No agents to display for agents-row preset"),!1;const T=I(i,o,g.length);return h.info("Agent tiling calculated",{tiling:T,agentCount:g.length}),e.batchMutations(()=>{const s=e.createGridLayout(g.length);h.info("Created grid layout for agents",{panelIds:s,panelCount:s.length,agentCount:g.length});for(let a=0;a<g.length;a++){const d=s[a];d&&e.openTab({type:"agent",title:g[a].name||m.layout_tabTypes_agent_title(),agentId:g[a].id,closable:!0,workspaceId:t},d)}return!0})}async function G(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=y.state,r=_.select(n,t),l=P.select(n,t),p=k.select(n,t),g=l.map(a=>({path:a.relativePath,type:"unstaged"})),T=r.map(a=>({path:a.relativePath,type:"staged"}));let s=[...g,...T].slice(0,6);return s.length===0&&p.length>0&&p[0].files&&(s=p[0].files.slice(0,6).map(a=>({path:a.path,type:"committed"}))),e.batchMutations(()=>{if(s.length===0){h.info("No changes to display for changes preset");const u=e.createGridLayout(1);return e.openTab({type:"changes",title:m.layout_tabTypes_changes_title(),closable:!0,workspaceId:t},u[0]),!0}const a=I(i,o,s.length);h.info("Changes tiling calculated",{tiling:a,fileCount:s.length});const d=e.createGridLayout(s.length);h.info("Created grid layout for changes",{panelIds:d,panelCount:d.length,fileCount:s.length});for(let u=0;u<s.length;u++){const f=s[u],w=f.path.split("/").pop()||f.path;e.openTab({type:"diff",title:w,diffPath:f.path,closable:!0,workspaceId:t,data:{staged:f.type==="staged"}},d[u])}return!0})}async function L(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_presetExecutor_coordinator_fallback(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"local-changes",title:m.layout_presetExecutor_allChanges_title(),closable:!0,workspaceId:t},n[1]),!0})}export{H as applyContentPreset};
1
+ import{bW as b,ds as _,dA as P,bQ as k,b2 as C}from"./BJbm_MWC.js";import{c as v}from"./ChTqQfQN.js";import{bm as m}from"./YLhFQnIu.js";import{Jx as y}from"./D5wnbxHp.js";const A={narrowWidth:600,shortHeight:500,wideWidth:900};function I(e,c,t){let i;e<A.narrowWidth?i=2:(e<A.wideWidth,i=Math.min(3,t));let o;c<A.shortHeight?o=2:o=Math.min(3,Math.ceil(t/i));const n=i*o;return{columns:i,rows:o,maxItems:n}}const h=v("PresetExecutor");async function H(e,c,t){switch(h.info("Applying content preset",{presetId:e,context:t}),e){case"planning":return W(c,t);case"agents-row":return D(c,t);case"changes":return G(c,t);case"review":return L(c,t);default:return c.applyPreset(e),!0}}async function W(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_tabTypes_agent_title(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"note",title:m.layout_shared_spec_title(),noteId:"spec",closable:!0,workspaceId:t},n[1]),!0})}async function D(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=6,r=y.state,l=b.select(r,t),p=C.select(r,t).sort((s,a)=>{const d=s.status==="active"||s.isProcessing,u=a.status==="active"||a.isProcessing;if(d&&!u)return-1;if(!d&&u)return 1;const f=s.lastActivity?new Date(s.lastActivity).getTime():s.updatedAt?new Date(s.updatedAt).getTime():0;return(a.lastActivity?new Date(a.lastActivity).getTime():a.updatedAt?new Date(a.updatedAt).getTime():0)-f});h.info("Agents row preset - agent counts",{total:l.length+p.length,foreground:l.length,background:p.length});const g=[...l,...p.slice(0,n-l.length)].slice(0,n);if(g.length===0)return h.info("No agents to display for agents-row preset"),!1;const T=I(i,o,g.length);return h.info("Agent tiling calculated",{tiling:T,agentCount:g.length}),e.batchMutations(()=>{const s=e.createGridLayout(g.length);h.info("Created grid layout for agents",{panelIds:s,panelCount:s.length,agentCount:g.length});for(let a=0;a<g.length;a++){const d=s[a];d&&e.openTab({type:"agent",title:g[a].name||m.layout_tabTypes_agent_title(),agentId:g[a].id,closable:!0,workspaceId:t},d)}return!0})}async function G(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=y.state,r=_.select(n,t),l=P.select(n,t),p=k.select(n,t),g=l.map(a=>({path:a.relativePath,type:"unstaged"})),T=r.map(a=>({path:a.relativePath,type:"staged"}));let s=[...g,...T].slice(0,6);return s.length===0&&p.length>0&&p[0].files&&(s=p[0].files.slice(0,6).map(a=>({path:a.path,type:"committed"}))),e.batchMutations(()=>{if(s.length===0){h.info("No changes to display for changes preset");const u=e.createGridLayout(1);return e.openTab({type:"changes",title:m.layout_tabTypes_changes_title(),closable:!0,workspaceId:t},u[0]),!0}const a=I(i,o,s.length);h.info("Changes tiling calculated",{tiling:a,fileCount:s.length});const d=e.createGridLayout(s.length);h.info("Created grid layout for changes",{panelIds:d,panelCount:d.length,fileCount:s.length});for(let u=0;u<s.length;u++){const f=s[u],w=f.path.split("/").pop()||f.path;e.openTab({type:"diff",title:w,diffPath:f.path,closable:!0,workspaceId:t,data:{staged:f.type==="staged"}},d[u])}return!0})}async function L(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_presetExecutor_coordinator_fallback(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"local-changes",title:m.layout_presetExecutor_allChanges_title(),closable:!0,workspaceId:t},n[1]),!0})}export{H as applyContentPreset};
@@ -1,3 +1,3 @@
1
- import{p as re}from"./CaHWSiOY.js";import{Y as oe,b0 as se,aZ as de,U as le,V as ce,a_ as me,b as o,ay as g,X as R,aW as ue,b4 as xe,r as fe,q as ge,W as B,O as he,aV as P,bi as S,m as pe}from"./BolJpU8l.js";import{p as be,i as ve}from"./C4M_mNFP.js";var D="position frame",N="frame positioned",k="position relation",T="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){w={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function O(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function W(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
1
+ import{p as re}from"./CzFfpwQB.js";import{Y as oe,b0 as se,aZ as de,U as le,V as ce,a_ as me,b as o,ay as g,X as R,aW as ue,b4 as xe,r as fe,q as ge,W as B,O as he,aV as P,bi as S,m as pe}from"./B1lrKll_.js";import{p as be,i as ve}from"./D2y-zN_4.js";var D="position frame",N="frame positioned",k="position relation",T="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){w={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function O(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function W(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
2
2
  `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function G(e,n){const t=n,i=V(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:N,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(G,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function j(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],$=f[p-1];y.y=$.y+$.height+s.swimlaneGap}return h}o(j,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function Z(e,n){const t=n;if(z(t.index,t.frame))return[];const i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;if(t.sourceFrame)a=F(e.boxes,t.sourceFrame);else{if(ve(t.frame))return[];a=q(e.boxes,i.swimlane.index,t.index-1)}return a===void 0?[]:[{$kind:T,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Z,"decidePositionRelation");function J(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(J,"evolveRelationPositioned");var Me={[D]:G,[k]:Z},Be={[N]:j,[T]:J};function Q(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Q,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Q(e,n);return ee(e,t)}o(v,"dispatch");var M={getConfig:ke,preserveCommentsWhenParsing:!0,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:W,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),M.setAst(n),re(n,M)},"parse")},Ae=R(),$e=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Re=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
3
3
  `,"id:",n,t),!$e)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=R(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),De={draw:Re},Ne=o(e=>"","getStyles"),Te=Ne,Ie={parser:Ee,db:M,renderer:De,styles:Te};export{Ie as diagram};
@@ -1 +1 @@
1
- import{nW as P,o5 as g,Jx as h,vs as d,vx as p,vu as v,h0 as y,gD as f,h2 as m,h1 as L,B0 as u,A$ as A,DS as S,Ds as F,Dv as B,B3 as z,u2 as C,C1 as O,tX as x,u3 as D,u4 as M,gU as R,h3 as _,gG as j,gF as H,Lw as E,Lu as U,Lv as V,Ld as G,nF as W,Jb as J,gW as N,u0 as q,Lr as K,Lt as X,BT as $,K8 as Q,BL as Y,dc as Z,oF as ss,oH as es,oG as ts,oI as as,EH as is,i8 as os,zw as rs,gg as T,ip as cs,ii as hs,r8 as ls}from"./CIoJPvjg.js";import{bm as ns}from"./DWvCfaBg.js";import{u as ds,b as ps,n as us,j as b,l as bs,v as I,y as Is}from"./DJJ2Xrlq.js";function ws(i,s,e,t){const a=s?.activeTabId;if(!s||!a||!s.tabs.some(r=>r.id===a))return null;const o=t?P(t).map(g):i.map(r=>[r]),c=o.findIndex(r=>r.includes(s.id));if(c<0)return null;const n=o[c+(e==="next"?1:-1)]?.[0];return n?{kind:"neighbor",tabId:a,targetPanelId:n}:o.length>=4||s.tabs.length<2&&o[c].length<2?null:{kind:"edge",tabId:a,position:e==="next"?"after":"before"}}class k{constructor(s){this.workspaceId=s}get state(){return h.state}dispatch(s){h.dispatch(s)}getPanelIds(){return ds.select(this.state,this.workspaceId)}getAllTabs(){return ps.select(this.state,this.workspaceId)}getPanel(s){return us.select(this.state,this.workspaceId,s)??null}getOtherPanelId(){const s=this.getPanelIds();if(s.length<2)return null;const e=b.select(this.state,this.workspaceId);return s.find(t=>t!==e)??null}openTab(s,e){if(e){this.dispatch(d(this.workspaceId,s,e));return}this.dispatch(p(this.workspaceId,s))}openUserTab(s,e){const t=e??b.select(this.state,this.workspaceId)??void 0;if(t){this.dispatch(d(this.workspaceId,s,t,void 0,!0));return}this.dispatch(p(this.workspaceId,s,{force:!0}))}openTabInAdjacentOrSplit(s,e,t){this.dispatch(v(this.workspaceId,s,e,t))}openBrowserPanel(s,e,t,a){const o={type:"browser",title:ns.layout_tabTypes_browser_title(),browserUrl:s??"about:blank",...a===void 0?{}:{browserRequestedUrl:a},contextItemId:e,closable:!0};this.openTabInAdjacentOrSplit(o,t)}closeTab(s,e){this.dispatch(y(this.workspaceId,s,e))}closeActiveTab(s){this.dispatch(f(this.workspaceId,s))}closeTabsByType(s,e,t){this.dispatch(m(this.workspaceId,s,e,t))}closeTabsByAgentId(s){this.dispatch(L(this.workspaceId,s))}reopenClosedTab(s,e){this.dispatch(u(this.workspaceId,void 0,s,e))}reopenLastClosed(){const s=bs.select(this.state,this.workspaceId);s?.kind==="column"?this.dispatch(A(this.workspaceId)):s?.kind==="tab"&&this.dispatch(u(this.workspaceId))}setActiveTab(s,e){this.dispatch(S(this.workspaceId,s,e))}selectNextTab(s){this.dispatch(F(this.workspaceId,s))}selectPreviousTab(s){this.dispatch(B(this.workspaceId,s))}reorderTabs(s,e,t){this.dispatch(z(this.workspaceId,s,e,t))}moveTabToPanel(s,e,t,a){this.dispatch(C(this.workspaceId,s,e,t,a))}moveActivePaneToColumn(s,e){const t=ws(this.getPanelIds(),this.getPanel(s),e,I.select(this.state,this.workspaceId));return t?(t.kind==="neighbor"?this.moveTabToPanel(t.tabId,s,t.targetPanelId):this.moveTabToSplitLevel(t.tabId,s,[],t.position,"horizontal"),!0):!1}canMoveActivePaneVertically(s,e){return O(I.select(this.state,this.workspaceId),this.getPanel(s),e)!==null}moveActivePaneVertically(s,e){return this.canMoveActivePaneVertically(s,e)?(this.dispatch(x(this.workspaceId,s,e)),!0):!1}moveTabToSplit(s,e,t,a){this.dispatch(D(this.workspaceId,s,e,t,a))}moveTabToSplitLevel(s,e,t,a,o){this.dispatch(M(this.workspaceId,s,e,t,a,o))}closeOtherTabs(s,e){this.dispatch(R(this.workspaceId,s,e))}closeTabsToRight(s,e){this.dispatch(_(this.workspaceId,s,e))}closeAllTabs(s){this.dispatch(j(this.workspaceId,s))}closeAllOthersEverywhere(s,e){this.dispatch(H(this.workspaceId,s,e))}updateTabTitle(s,e){this.dispatch(E(this.workspaceId,s,e))}updateTabBrowserUrl(s,e){this.dispatch(U(this.workspaceId,s,e))}updateTabFavicon(s,e){this.dispatch(V(this.workspaceId,s,e))}updateFileTabPath(s,e){this.dispatch(G(this.workspaceId,s,e))}focusPanel(s){this.dispatch(W(this.workspaceId,s))}splitPanel(s,e,t){this.dispatch(J(this.workspaceId,s,e,t))}closePanel(s){this.dispatch(N(this.workspaceId,s))}movePanel(s,e,t){this.dispatch(q(this.workspaceId,s,e,t))}updateSizes(s,e){this.dispatch(K(this.workspaceId,s,e))}updateSplitSizes(s,e){this.dispatch(X(this.workspaceId,s,e))}resizeRootDivider(s,e){this.dispatch($(this.workspaceId,s,e))}toggleExpandPanel(s){this.dispatch(Q(this.workspaceId,s))}resetLayout(){this.dispatch(Y(this.workspaceId))}applyPreset(s){this.dispatch(Z(this.workspaceId,s))}goBack(){this.dispatch(ss(this.workspaceId))}goForward(){this.dispatch(es(this.workspaceId))}goBackInFocusHistory(){this.dispatch(ts(this.workspaceId))}goForwardInFocusHistory(){this.dispatch(as(this.workspaceId))}setDeferSpecTab(s){this.dispatch(is(this.workspaceId,s))}consumePendingFocus(s){this.dispatch(os(this.workspaceId,s))}reconcileStaleAgentTabs(s,e,t){const a=Array.isArray(s)?s:Array.from(s);this.dispatch(rs(this.workspaceId,a,e,t))}clearLayout(){this.dispatch(T(this.workspaceId))}createGridLayout(s){return this.dispatch(cs(this.workspaceId,s)),this.getPanelIds()}batchMutations(s){return s()}initializeLayout(s){const e=s??hs();this.dispatch(ls(this.workspaceId,e))}cyclePresets(){const s=Is.select(this.state,this.workspaceId),e=Object.keys(s).length;e<=1?this.applyPreset("split-horizontal"):e===2?this.applyPreset("three-column"):this.applyPreset("single")}}const l=new Map;function Ts(i){let s=l.get(i);return s||(s=new k(i),l.set(i,s)),s}function ks(i){return!0}function Ps(i){l.delete(i)}function w(i){h.dispatch(T(i))}const fs=Object.freeze(Object.defineProperty({__proto__:null,PanelLayoutAdapter:k,clearPanelLayoutAdapter:Ps,clearPanelLayoutFn:w,clearPanelLayoutForWorkspace:w,getPanelLayoutManager:Ts,hasPanelLayoutManager:ks},Symbol.toStringTag,{value:"Module"}));export{Ps as c,Ts as g,ks as h,fs as p,ws as r};
1
+ import{nW as P,o5 as g,Jx as h,vs as d,vx as p,vu as v,h0 as y,gD as f,h2 as m,h1 as L,B0 as u,A$ as A,DS as S,Ds as F,Dv as B,B3 as z,u2 as C,C1 as O,tX as x,u3 as D,u4 as M,gU as R,h3 as _,gG as j,gF as H,Lw as E,Lu as U,Lv as V,Ld as G,nF as W,Jb as J,gW as N,u0 as q,Lr as K,Lt as X,BT as $,K8 as Q,BL as Y,dc as Z,oF as ss,oH as es,oG as ts,oI as as,EH as is,i8 as os,zw as rs,gg as T,ip as cs,ii as hs,r8 as ls}from"./D5wnbxHp.js";import{bm as ns}from"./YLhFQnIu.js";import{u as ds,b as ps,n as us,j as b,l as bs,v as I,y as Is}from"./COVS9Crf.js";function ws(i,s,e,t){const a=s?.activeTabId;if(!s||!a||!s.tabs.some(r=>r.id===a))return null;const o=t?P(t).map(g):i.map(r=>[r]),c=o.findIndex(r=>r.includes(s.id));if(c<0)return null;const n=o[c+(e==="next"?1:-1)]?.[0];return n?{kind:"neighbor",tabId:a,targetPanelId:n}:o.length>=4||s.tabs.length<2&&o[c].length<2?null:{kind:"edge",tabId:a,position:e==="next"?"after":"before"}}class k{constructor(s){this.workspaceId=s}get state(){return h.state}dispatch(s){h.dispatch(s)}getPanelIds(){return ds.select(this.state,this.workspaceId)}getAllTabs(){return ps.select(this.state,this.workspaceId)}getPanel(s){return us.select(this.state,this.workspaceId,s)??null}getOtherPanelId(){const s=this.getPanelIds();if(s.length<2)return null;const e=b.select(this.state,this.workspaceId);return s.find(t=>t!==e)??null}openTab(s,e){if(e){this.dispatch(d(this.workspaceId,s,e));return}this.dispatch(p(this.workspaceId,s))}openUserTab(s,e){const t=e??b.select(this.state,this.workspaceId)??void 0;if(t){this.dispatch(d(this.workspaceId,s,t,void 0,!0));return}this.dispatch(p(this.workspaceId,s,{force:!0}))}openTabInAdjacentOrSplit(s,e,t){this.dispatch(v(this.workspaceId,s,e,t))}openBrowserPanel(s,e,t,a){const o={type:"browser",title:ns.layout_tabTypes_browser_title(),browserUrl:s??"about:blank",...a===void 0?{}:{browserRequestedUrl:a},contextItemId:e,closable:!0};this.openTabInAdjacentOrSplit(o,t)}closeTab(s,e){this.dispatch(y(this.workspaceId,s,e))}closeActiveTab(s){this.dispatch(f(this.workspaceId,s))}closeTabsByType(s,e,t){this.dispatch(m(this.workspaceId,s,e,t))}closeTabsByAgentId(s){this.dispatch(L(this.workspaceId,s))}reopenClosedTab(s,e){this.dispatch(u(this.workspaceId,void 0,s,e))}reopenLastClosed(){const s=bs.select(this.state,this.workspaceId);s?.kind==="column"?this.dispatch(A(this.workspaceId)):s?.kind==="tab"&&this.dispatch(u(this.workspaceId))}setActiveTab(s,e){this.dispatch(S(this.workspaceId,s,e))}selectNextTab(s){this.dispatch(F(this.workspaceId,s))}selectPreviousTab(s){this.dispatch(B(this.workspaceId,s))}reorderTabs(s,e,t){this.dispatch(z(this.workspaceId,s,e,t))}moveTabToPanel(s,e,t,a){this.dispatch(C(this.workspaceId,s,e,t,a))}moveActivePaneToColumn(s,e){const t=ws(this.getPanelIds(),this.getPanel(s),e,I.select(this.state,this.workspaceId));return t?(t.kind==="neighbor"?this.moveTabToPanel(t.tabId,s,t.targetPanelId):this.moveTabToSplitLevel(t.tabId,s,[],t.position,"horizontal"),!0):!1}canMoveActivePaneVertically(s,e){return O(I.select(this.state,this.workspaceId),this.getPanel(s),e)!==null}moveActivePaneVertically(s,e){return this.canMoveActivePaneVertically(s,e)?(this.dispatch(x(this.workspaceId,s,e)),!0):!1}moveTabToSplit(s,e,t,a){this.dispatch(D(this.workspaceId,s,e,t,a))}moveTabToSplitLevel(s,e,t,a,o){this.dispatch(M(this.workspaceId,s,e,t,a,o))}closeOtherTabs(s,e){this.dispatch(R(this.workspaceId,s,e))}closeTabsToRight(s,e){this.dispatch(_(this.workspaceId,s,e))}closeAllTabs(s){this.dispatch(j(this.workspaceId,s))}closeAllOthersEverywhere(s,e){this.dispatch(H(this.workspaceId,s,e))}updateTabTitle(s,e){this.dispatch(E(this.workspaceId,s,e))}updateTabBrowserUrl(s,e){this.dispatch(U(this.workspaceId,s,e))}updateTabFavicon(s,e){this.dispatch(V(this.workspaceId,s,e))}updateFileTabPath(s,e){this.dispatch(G(this.workspaceId,s,e))}focusPanel(s){this.dispatch(W(this.workspaceId,s))}splitPanel(s,e,t){this.dispatch(J(this.workspaceId,s,e,t))}closePanel(s){this.dispatch(N(this.workspaceId,s))}movePanel(s,e,t){this.dispatch(q(this.workspaceId,s,e,t))}updateSizes(s,e){this.dispatch(K(this.workspaceId,s,e))}updateSplitSizes(s,e){this.dispatch(X(this.workspaceId,s,e))}resizeRootDivider(s,e){this.dispatch($(this.workspaceId,s,e))}toggleExpandPanel(s){this.dispatch(Q(this.workspaceId,s))}resetLayout(){this.dispatch(Y(this.workspaceId))}applyPreset(s){this.dispatch(Z(this.workspaceId,s))}goBack(){this.dispatch(ss(this.workspaceId))}goForward(){this.dispatch(es(this.workspaceId))}goBackInFocusHistory(){this.dispatch(ts(this.workspaceId))}goForwardInFocusHistory(){this.dispatch(as(this.workspaceId))}setDeferSpecTab(s){this.dispatch(is(this.workspaceId,s))}consumePendingFocus(s){this.dispatch(os(this.workspaceId,s))}reconcileStaleAgentTabs(s,e,t){const a=Array.isArray(s)?s:Array.from(s);this.dispatch(rs(this.workspaceId,a,e,t))}clearLayout(){this.dispatch(T(this.workspaceId))}createGridLayout(s){return this.dispatch(cs(this.workspaceId,s)),this.getPanelIds()}batchMutations(s){return s()}initializeLayout(s){const e=s??hs();this.dispatch(ls(this.workspaceId,e))}cyclePresets(){const s=Is.select(this.state,this.workspaceId),e=Object.keys(s).length;e<=1?this.applyPreset("split-horizontal"):e===2?this.applyPreset("three-column"):this.applyPreset("single")}}const l=new Map;function Ts(i){let s=l.get(i);return s||(s=new k(i),l.set(i,s)),s}function ks(i){return!0}function Ps(i){l.delete(i)}function w(i){h.dispatch(T(i))}const fs=Object.freeze(Object.defineProperty({__proto__:null,PanelLayoutAdapter:k,clearPanelLayoutAdapter:Ps,clearPanelLayoutFn:w,clearPanelLayoutForWorkspace:w,getPanelLayoutManager:Ts,hasPanelLayoutManager:ks},Symbol.toStringTag,{value:"Module"}));export{Ps as c,Ts as g,ks as h,fs as p,ws as r};