orcaq 1.0.30 → 1.0.32

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 (289) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{DzJD_fir.js → -p9JbKy8.js} +3 -3
  3. package/.output/public/_nuxt/019vQzZn.js +1 -0
  4. package/.output/public/_nuxt/0lRW_xjL.js +1 -0
  5. package/.output/public/_nuxt/{BV6TSzbC.js → 3UJtAGbG.js} +3 -2
  6. package/.output/public/_nuxt/ACOLmAuq.js +15 -0
  7. package/.output/public/_nuxt/B1X10hvy.js +261 -0
  8. package/.output/public/_nuxt/B27ECqWz.js +220 -0
  9. package/.output/public/_nuxt/B6EI6PpE.js +1 -0
  10. package/.output/public/_nuxt/B8JnYxjr.js +2 -0
  11. package/.output/public/_nuxt/B9Mt45db.js +1 -0
  12. package/.output/public/_nuxt/B9zSkyFO.js +1 -0
  13. package/.output/public/_nuxt/BCcTASq_.js +139 -0
  14. package/.output/public/_nuxt/BJxYuvXF.js +7 -0
  15. package/.output/public/_nuxt/{FyrDS92w.js → BM4vnZvX.js} +101 -101
  16. package/.output/public/_nuxt/BNYR501z.js +1 -0
  17. package/.output/public/_nuxt/BQOaPJzs.js +145 -0
  18. package/.output/public/_nuxt/BUDtG__q.js +1 -0
  19. package/.output/public/_nuxt/BVLVn__t.js +9 -0
  20. package/.output/public/_nuxt/{KlH93fIm.js → BY1l0S_M.js} +1 -1
  21. package/.output/public/_nuxt/{ClnidwGv.js → B_PBOfFN.js} +2 -2
  22. package/.output/public/_nuxt/{y68LmDX2.js → BcvJQkv0.js} +1 -1
  23. package/.output/public/_nuxt/{llxtZpFD.js → BdN9B2_l.js} +2 -2
  24. package/.output/public/_nuxt/BflvengI.js +1 -0
  25. package/.output/public/_nuxt/BgolbRTO.js +1 -0
  26. package/.output/public/_nuxt/BhUkpIlA.js +1 -0
  27. package/.output/public/_nuxt/BsoQBloB.js +24 -0
  28. package/.output/public/_nuxt/BwISH3M4.js +1 -0
  29. package/.output/public/_nuxt/C-M4q4KX.js +1 -0
  30. package/.output/public/_nuxt/C07rlnlv.js +1 -0
  31. package/.output/public/_nuxt/C27bL9Es.js +1 -0
  32. package/.output/public/_nuxt/C2Ziircr.js +1 -0
  33. package/.output/public/_nuxt/C3NWXcpd.js +39 -0
  34. package/.output/public/_nuxt/C5p44jKD.js +1 -0
  35. package/.output/public/_nuxt/C617vhDd.js +1 -0
  36. package/.output/public/_nuxt/C6Vqzp-9.js +7 -0
  37. package/.output/public/_nuxt/C7C8tPlA.js +65 -0
  38. package/.output/public/_nuxt/C8S0o4Gy.js +1 -0
  39. package/.output/public/_nuxt/CHOD7i6O.js +4 -0
  40. package/.output/public/_nuxt/CNlsVoWh.js +1 -0
  41. package/.output/public/_nuxt/CQb_mUBo.js +1 -0
  42. package/.output/public/_nuxt/{MLO1tLKS.js → CSTzT9hP.js} +1 -1
  43. package/.output/public/_nuxt/CVliJ52o.js +162 -0
  44. package/.output/public/_nuxt/CWGdTiOD.js +1 -0
  45. package/.output/public/_nuxt/{CzF1NEwP.js → CWkPMmwS.js} +2 -2
  46. package/.output/public/_nuxt/CffFK_qY.js +189 -0
  47. package/.output/public/_nuxt/Cgy4ijjN.js +67 -0
  48. package/.output/public/_nuxt/ChkFTcxr.js +43 -0
  49. package/.output/public/_nuxt/Cjgqfl1g.js +10 -0
  50. package/.output/public/_nuxt/ClBBUcFW.js +1 -0
  51. package/.output/public/_nuxt/{DFd73eNR.js → ClYziJpO.js} +1 -1
  52. package/.output/public/_nuxt/CmKTTxBW.js +1 -0
  53. package/.output/public/_nuxt/CuRyxljq.js +1 -0
  54. package/.output/public/_nuxt/CvTHaPAO.js +1 -0
  55. package/.output/public/_nuxt/{HQyqkOpZ.js → CwdIiq6J.js} +1 -1
  56. package/.output/public/_nuxt/Cx4Bnfq1.js +2 -0
  57. package/.output/public/_nuxt/CyJtwmzi.js +331 -0
  58. package/.output/public/_nuxt/{ubO-cWd-.js → D-H6_V16.js} +1 -1
  59. package/.output/public/_nuxt/D-SDqguC.js +1 -0
  60. package/.output/public/_nuxt/{6I72R6kW.js → D-XwprNU.js} +1 -1
  61. package/.output/public/_nuxt/D3G5Xy_-.js +1 -0
  62. package/.output/public/_nuxt/D4jn2f-6.js +255 -0
  63. package/.output/public/_nuxt/D9o5Pdvp.js +1 -0
  64. package/.output/public/_nuxt/DDYV6jDr.js +1 -0
  65. package/.output/public/_nuxt/DFArp87o.js +1 -0
  66. package/.output/public/_nuxt/{C_CjS9Yt.js → DFZIXzfU.js} +1 -1
  67. package/.output/public/_nuxt/DHRNt0p9.js +1 -0
  68. package/.output/public/_nuxt/DLHYqHwF.js +24 -0
  69. package/.output/public/_nuxt/{D8pqASdN.js → DLKku6fV.js} +1 -1
  70. package/.output/public/_nuxt/DNZpxuwM.js +1 -0
  71. package/.output/public/_nuxt/DRKnK1N_.js +132 -0
  72. package/.output/public/_nuxt/DVxTxYP4.js +34 -0
  73. package/.output/public/_nuxt/{DQiMjOqm.js → DWgjNKGq.js} +1 -1
  74. package/.output/public/_nuxt/DX6XiGOO.js +1 -0
  75. package/.output/public/_nuxt/DYm57BZk.js +2 -0
  76. package/.output/public/_nuxt/DaQw8gVp.js +1 -0
  77. package/.output/public/_nuxt/DcfsxCxL.js +36 -0
  78. package/.output/public/_nuxt/DgnsV5Qb.js +1 -0
  79. package/.output/public/_nuxt/DkY69STm.js +292 -0
  80. package/.output/public/_nuxt/DkggUtNN.js +30 -0
  81. package/.output/public/_nuxt/Dnx67EG9.js +68 -0
  82. package/.output/public/_nuxt/{DVe5MHjS.js → DnxDSFih.js} +1 -1
  83. package/.output/public/_nuxt/Do5Fyo7J.js +1 -0
  84. package/.output/public/_nuxt/{h2fvG4Xe.js → Dqirx7MF.js} +1 -1
  85. package/.output/public/_nuxt/{WrapperErdDiagram.DsE2QNGr.css → ErdDiagram.Cnqgwj9d.css} +1 -1
  86. package/.output/public/_nuxt/FIJP2AmN.js +73 -0
  87. package/.output/public/_nuxt/Gi6I4Gst.js +1 -0
  88. package/.output/public/_nuxt/{C26aAkUg.js → GoTwJjoS.js} +1 -1
  89. package/.output/public/_nuxt/Hs25HoUO.js +22 -0
  90. package/.output/public/_nuxt/IitECNfD.js +89 -0
  91. package/.output/public/_nuxt/J2CvNR3L.js +1 -0
  92. package/.output/public/_nuxt/LFK46Fls.js +61 -0
  93. package/.output/public/_nuxt/LK6Q8l0D.js +1 -0
  94. package/.output/public/_nuxt/Oh9SO2qg.js +1 -0
  95. package/.output/public/_nuxt/{CtRc_P0d.js → P_8UoGnr.js} +2 -2
  96. package/.output/public/_nuxt/UqWhjgOc.js +10 -0
  97. package/.output/public/_nuxt/V5yaR3hv.js +2 -0
  98. package/.output/public/_nuxt/XWTuAj6n.js +1 -0
  99. package/.output/public/_nuxt/XqwbcqcW.js +1 -0
  100. package/.output/public/_nuxt/ZdjmUBoX.js +70 -0
  101. package/.output/public/_nuxt/_8UrUcVF.js +1 -0
  102. package/.output/public/_nuxt/builds/latest.json +1 -1
  103. package/.output/public/_nuxt/builds/meta/27a307c3-bfc5-4ccd-94b8-387eb94981bb.json +1 -0
  104. package/.output/public/_nuxt/cKBf5-av.js +1 -0
  105. package/.output/public/_nuxt/c_huf6xz.js +162 -0
  106. package/.output/public/_nuxt/entry.DeK5kcSi.css +1 -0
  107. package/.output/public/_nuxt/gO22NLpn.js +1 -0
  108. package/.output/public/_nuxt/index.xxedlMJo.css +1 -0
  109. package/.output/public/_nuxt/kc-op4gz.js +12 -0
  110. package/.output/public/_nuxt/lSaGvORn.js +10 -0
  111. package/.output/public/_nuxt/lY3EyFEK.js +1 -0
  112. package/.output/public/_nuxt/qsFoMdT2.js +1 -0
  113. package/.output/public/_nuxt/sE-55p4e.js +1 -0
  114. package/.output/public/_nuxt/tMhdAKU2.js +3 -0
  115. package/.output/public/_nuxt/trZyeId5.js +70 -0
  116. package/.output/public/_nuxt/uyCIL8xw.js +1 -0
  117. package/.output/server/chunks/_/db-connection.mjs +17 -3
  118. package/.output/server/chunks/_/db-connection.mjs.map +1 -1
  119. package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -1
  120. package/.output/server/chunks/_/metadata.factory.mjs +4 -5
  121. package/.output/server/chunks/_/metadata.factory.mjs.map +1 -1
  122. package/.output/server/chunks/_/query.factory.mjs +31 -2
  123. package/.output/server/chunks/_/query.factory.mjs.map +1 -1
  124. package/.output/server/chunks/build/client.manifest.mjs +1302 -546
  125. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  126. package/.output/server/chunks/nitro/nitro.mjs +712 -364
  127. package/.output/server/chunks/routes/api/ai/agent.mjs +258 -89
  128. package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
  129. package/.output/server/chunks/routes/api/ai/chat.mjs +1 -2
  130. package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -1
  131. package/.output/server/chunks/routes/api/database-export/export-database.mjs +1 -2
  132. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
  133. package/.output/server/chunks/routes/api/database-import/import-database.mjs +1 -2
  134. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
  135. package/.output/server/chunks/routes/api/database-roles/create-role.mjs +1 -2
  136. package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
  137. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +1 -2
  138. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
  139. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +1 -2
  140. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
  141. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +1 -2
  142. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
  143. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +1 -2
  144. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
  145. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +1 -2
  146. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
  147. package/.output/server/chunks/routes/api/database-roles/get-role.mjs +1 -2
  148. package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
  149. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +1 -2
  150. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
  151. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +1 -2
  152. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
  153. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +1 -2
  154. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
  155. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +1 -2
  156. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
  157. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +1 -2
  158. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
  159. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +1 -2
  160. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
  161. package/.output/server/chunks/routes/api/functions/definition.post.mjs +5 -3
  162. package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
  163. package/.output/server/chunks/routes/api/functions/delete.post.mjs +1 -2
  164. package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
  165. package/.output/server/chunks/routes/api/functions/overview.post.mjs +12 -10
  166. package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
  167. package/.output/server/chunks/routes/api/functions/rename.post.mjs +1 -2
  168. package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
  169. package/.output/server/chunks/routes/api/functions/signature.post.mjs +5 -3
  170. package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
  171. package/.output/server/chunks/routes/api/functions/update.post.mjs +1 -2
  172. package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
  173. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +1 -2
  174. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
  175. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +1 -2
  176. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
  177. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +1 -2
  178. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
  179. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +1 -2
  180. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
  181. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +1 -2
  182. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
  183. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +1 -2
  184. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
  185. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +1 -2
  186. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
  187. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +1 -2
  188. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
  189. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +1 -2
  190. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
  191. package/.output/server/chunks/routes/api/metadata/erd.post.mjs +12 -10
  192. package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
  193. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +14 -12
  194. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
  195. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +12 -10
  196. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
  197. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +12 -10
  198. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
  199. package/.output/server/chunks/routes/api/query/execute.post.mjs +14 -12
  200. package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
  201. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +14 -12
  202. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
  203. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +14 -12
  204. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
  205. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +1 -2
  206. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
  207. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +1 -2
  208. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
  209. package/.output/server/chunks/routes/api/tables/ddl.post.mjs +5 -3
  210. package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
  211. package/.output/server/chunks/routes/api/tables/export.post.mjs +1 -2
  212. package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
  213. package/.output/server/chunks/routes/api/tables/indexes.post.mjs +5 -3
  214. package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
  215. package/.output/server/chunks/routes/api/tables/meta.post.mjs +12 -10
  216. package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
  217. package/.output/server/chunks/routes/api/tables/overview.post.mjs +5 -3
  218. package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
  219. package/.output/server/chunks/routes/api/tables/rls.post.mjs +5 -3
  220. package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
  221. package/.output/server/chunks/routes/api/tables/rules.post.mjs +5 -3
  222. package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
  223. package/.output/server/chunks/routes/api/tables/size.post.mjs +5 -3
  224. package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
  225. package/.output/server/chunks/routes/api/tables/structure.post.mjs +5 -3
  226. package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
  227. package/.output/server/chunks/routes/api/tables/triggers.post.mjs +5 -3
  228. package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
  229. package/.output/server/chunks/routes/api/views/definition.post.mjs +5 -3
  230. package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
  231. package/.output/server/chunks/routes/api/views/dependencies.post.mjs +5 -3
  232. package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
  233. package/.output/server/chunks/routes/api/views/explain.post.mjs +1 -2
  234. package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
  235. package/.output/server/chunks/routes/api/views/indexes.post.mjs +5 -3
  236. package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
  237. package/.output/server/chunks/routes/api/views/meta.post.mjs +5 -3
  238. package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
  239. package/.output/server/chunks/routes/api/views/overview.post.mjs +5 -3
  240. package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
  241. package/.output/server/chunks/routes/renderer.mjs +1 -2
  242. package/.output/server/index.mjs +1 -2
  243. package/.output/server/index.mjs.map +1 -1
  244. package/.output/server/package.json +1 -1
  245. package/README.md +8 -2
  246. package/package.json +1 -1
  247. package/.output/public/_nuxt/8_EuFD3X.js +0 -1
  248. package/.output/public/_nuxt/B6H7odCi.js +0 -1
  249. package/.output/public/_nuxt/B7nSJBpY.js +0 -1
  250. package/.output/public/_nuxt/BBNxNerU.js +0 -1
  251. package/.output/public/_nuxt/BDKd-SA5.js +0 -1
  252. package/.output/public/_nuxt/BDRdbLz0.js +0 -1
  253. package/.output/public/_nuxt/BKWWO5HE.js +0 -1
  254. package/.output/public/_nuxt/BVKG-F8j.js +0 -1
  255. package/.output/public/_nuxt/BoGW82nK.js +0 -1
  256. package/.output/public/_nuxt/Bs_ItSbk.js +0 -1
  257. package/.output/public/_nuxt/Btu7FO8S.js +0 -1
  258. package/.output/public/_nuxt/C04Tz2vC.js +0 -67
  259. package/.output/public/_nuxt/C4JPKbJK.js +0 -1
  260. package/.output/public/_nuxt/C5KSeJUi.js +0 -8
  261. package/.output/public/_nuxt/CDnZBTSk.js +0 -1
  262. package/.output/public/_nuxt/CKq06U7u.js +0 -19
  263. package/.output/public/_nuxt/CQpD-JHn.js +0 -1
  264. package/.output/public/_nuxt/Chcc8yNZ.js +0 -1
  265. package/.output/public/_nuxt/CpzDNDcD.js +0 -1
  266. package/.output/public/_nuxt/Cs1HkKH7.js +0 -1
  267. package/.output/public/_nuxt/CsYOf3m-.js +0 -39
  268. package/.output/public/_nuxt/Ctr2mpV9.js +0 -2
  269. package/.output/public/_nuxt/D2j2esR5.js +0 -3
  270. package/.output/public/_nuxt/D4ZGn1tW.js +0 -1
  271. package/.output/public/_nuxt/D6YseYA6.js +0 -1
  272. package/.output/public/_nuxt/D7EPcL9i.js +0 -1
  273. package/.output/public/_nuxt/DCMJS6Fh.js +0 -1
  274. package/.output/public/_nuxt/D_G1mAJ8.js +0 -3
  275. package/.output/public/_nuxt/De1hkrJC.js +0 -1
  276. package/.output/public/_nuxt/DnCs9xpG.js +0 -1
  277. package/.output/public/_nuxt/DvJ2MjiW.js +0 -2
  278. package/.output/public/_nuxt/Dzr_z_mY.js +0 -9
  279. package/.output/public/_nuxt/OEVyCyyD.js +0 -1
  280. package/.output/public/_nuxt/builds/meta/0ab6db39-d52b-46b9-a687-0df3b4c65db5.json +0 -1
  281. package/.output/public/_nuxt/builds/meta/dev.json +0 -1
  282. package/.output/public/_nuxt/e_Ir8LP9.js +0 -1
  283. package/.output/public/_nuxt/entry.XV7TCKso.css +0 -1
  284. package/.output/public/_nuxt/fRxmPZZB.js +0 -8
  285. package/.output/public/_nuxt/logo.BsJ2Dfin.png +0 -0
  286. package/.output/public/_nuxt/q4KcRwD-.js +0 -1
  287. package/.output/public/_nuxt/qIKg23Pc.js +0 -1
  288. package/.output/public/_nuxt/txD20ixW.js +0 -1
  289. package/.output/public/_nuxt/x2HBvptj.js +0 -1
@@ -0,0 +1 @@
1
+ import{d as r,H as d,I as i,r as p,b as o,o as l,w as n,f as u,u as e,P as _,n as c,e as f}from"./BM4vnZvX.js";const[R,v]=i("AvatarRoot");var h=r({__name:"AvatarRoot",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){return d(),v({imageLoadingStatus:p("idle")}),(a,t)=>(l(),o(e(_),{"as-child":a.asChild,as:a.as},{default:n(()=>[u(a.$slots,"default")]),_:3},8,["as-child","as"]))}}),m=h;const x=r({__name:"Avatar",props:{class:{}},setup(s){const a=s;return(t,C)=>(l(),o(e(m),{"data-slot":"avatar",class:c(e(f)("relative flex size-8 shrink-0 overflow-hidden rounded-full",a.class))},{default:n(()=>[u(t.$slots,"default")]),_:3},8,["class"]))}});export{x as _,R as i};
@@ -0,0 +1 @@
1
+ import{d as S,m as y,o as g,C as h,F as b,t as i,G as A,a9 as B,n as I,i as D,h as v,u as $,j as N,aa as r,ab as w,ac as K}from"./BM4vnZvX.js";const V={class:"gap-1 flex flex-col text-sm min-w-[20rem]"},L={class:"font-medium text-sm mb-1"},P={class:"text-xs text-muted-foreground"},z={key:0,class:"text-xs text-muted-foreground"},E={key:1,class:"text-xs text-muted-foreground"},Z={class:"mt-1 text-xs max-h-[12rem] overflow-auto"},J={class:"text-muted-foreground"},M=S({__name:"SuggestionTableInfo",props:{schemaName:{},tableName:{},columns:{},pkColumns:{},fkColumns:{}},setup(t){return(e,s)=>(g(),y("div",V,[h("div",L,i(e.tableName)+" ("+i(e.schemaName||"public")+") ",1),h("div",P," Columns: "+i(e.columns.length),1),e.pkColumns.length>0?(g(),y("div",z," Primary Keys: "+i(e.pkColumns.join(", ")),1)):b("",!0),e.fkColumns.length>0?(g(),y("div",E," Foreign Keys: "+i(e.fkColumns.join(", ")),1)):b("",!0),h("div",Z,[(g(!0),y(A,null,B(e.columns,n=>(g(),y("div",{key:n.name,class:I(["py-0.5",{"font-semibold":e.pkColumns.includes(n.name)}])},[D(i(n.name)+": ",1),h("span",J,i(n.short_type_name),1)],2))),128))])]))}}),O={class:"gap-1 flex flex-col text-sm min-w-[10rem]"},G={class:"font-medium text-sm mb-1"},W={class:"text-xs text-muted-foreground"},q={class:"text-xs text-muted-foreground"},H={key:0,class:"text-xs text-yellow-500 mt-1 flex items-center gap-1"},Q={key:1,class:"text-xs text-blue-500 mt-1 flex items-center gap-1"},R=S({__name:"SuggetionColumnInfo",props:{columnName:{},dataType:{},tableName:{},isPrimaryKey:{type:Boolean},foreignKey:{}},setup(t){return(e,s)=>(g(),y("div",O,[h("div",G,i(e.columnName),1),h("div",W,"Type: "+i(e.dataType),1),h("div",q,"Table: "+i(e.tableName),1),e.isPrimaryKey?(g(),y("div",H,[v($(N),{name:"hugeicons:key-01",class:"w-4 text-yellow-400 text-xl"}),s[0]||(s[0]=h("span",null,"Primary Key",-1))])):b("",!0),e.foreignKey?(g(),y("div",Q,[v($(N),{name:"hugeicons:key-01",class:"w-4 text-muted-foreground text-xl"}),h("span",null,"FK → "+i(e.foreignKey.referenced_table)+"."+i(e.foreignKey.referenced_column),1)])):b("",!0)]))}});function U(t){let e=t.toLowerCase();const s=["tbl_","table_"];for(const o of s)e!=null&&e.startsWith(o)&&(e=e.slice(o.length));e=e.replace(/(_v\d+|_\d+)$/,"");let n=e.split(/[_-]/);n.length===1&&(n=e.match(/[A-Z]?[a-z]+|[A-Z]+(?=[A-Z][a-z]|\b)/g)||[e]);let a=n.filter(o=>o.length>0).map(o=>o[0]).join("");return!a&&e&&(a=e[0]),a}function X(t,e,s){var l,u;const n=document.createElement("div"),a=((l=e.primary_keys)==null?void 0:l.map(d=>d.column))||[],o=((u=e.foreign_keys)==null?void 0:u.map(d=>d.column))||[],c=w(M,{tableName:t,columns:e.columns,pkColumns:a,fkColumns:o,schemaName:s});return K(c,n),n}function T(t,e,s,n,a,o){const c=document.createElement("div"),l=w(R,{columnName:t,dataType:e,tableName:o?`${o}.${s}`:s,isPrimaryKey:n,foreignKey:a});return K(l,c),c}function Y(t){const e=t.toLowerCase();return e.includes("int")||e.includes("numeric")||e.includes("decimal")||e.includes("float")||e.includes("double")||e.includes("real")||e.includes("serial")||e.includes("money")?r.Numeric:e.includes("char")||e.includes("text")||e.includes("varchar")||e.includes("string")||e.includes("uuid")||e.includes("citext")?r.String:e.includes("date")||e.includes("time")||e.includes("timestamp")||e.includes("interval")?r.Calendar:e.includes("array")||e.includes("json")||e.includes("jsonb")||e.includes("[]")?r.Brackets:e.includes("vector")?r.Vector:r.Field}function ee({typeName:t,isPrimaryKey:e,hasForeignKey:s}){return e?r.Keyword:s?r.ForeignKey:Y(t)}function te({column:t,tableName:e,schemaName:s,isPrimaryKey:n,foreignKey:a,info:o}){const c={label:t.name,type:ee({typeName:t.short_type_name,isPrimaryKey:n,hasForeignKey:!!a}),detail:t.short_type_name,boost:-t.ordinal_position};return o?c.info=o:c.info=()=>T(t.name,t.short_type_name,e,n,a,s),c}function se({schemas:t,defaultSchemaName:e="public",fileVariables:s}){var o,c;const n={};if(t&&t.length>0)for(const l of t){if(!l.tableDetails)continue;const u=l.name,d={};for(const m in l.tableDetails){const p=l.tableDetails[m],_={},C=new Set(((o=p.primary_keys)==null?void 0:o.map(f=>f.column))||[]),x=new Map(((c=p.foreign_keys)==null?void 0:c.map(f=>[f.column,f]))||[]);for(const f of p.columns){const F=C.has(f.name),j=x.get(f.name);_[f.name]={self:te({column:f,tableName:m,schemaName:u,isPrimaryKey:F,foreignKey:j}),children:{}}}_["*"]={self:{label:"*",type:r.Function,detail:"All columns",boost:50,info:()=>T("* All columns","Selects all columns",m,!1,void 0,u)},children:{}};const k=U(m);d[m]={self:{label:m,displayLabel:`${m} AS ${k}`,type:r.Table,detail:`${p.columns.length} columns`,apply:`${m} AS ${k}`,boost:100,info:()=>X(m,p,u)},children:_}}n[u]={self:{label:u,type:r.Database,detail:`${Object.keys(d).length} tables`},children:d}}const a=[];if(s)try{const l=JSON.parse(s);for(const u in l)a.push({label:`:${u}`,type:r.Variable,boost:120,detail:"variable",apply(d,m,p,_){const x=d.state.doc.sliceString(p-1,p)===":"?p-1:p;d.dispatch({changes:{from:x,to:_,insert:m.label}})}})}catch(l){console.error("🚀 ~ mappedSchemaSuggestion ~ error:",l)}return{schema:n,variableCompletions:a,defaultSchema:e}}export{te as c,U as g,se as m};
@@ -0,0 +1,7 @@
1
+ import{_ as a,s as gi,g as xi,t as Xt,q as di,a as fi,b as pi,l as Nt,L as mi,e as yi,A as bi,H as St,G as Yt,I as Ai,a1 as wi,i as Ci,al as Si,a9 as Wt}from"./D4jn2f-6.js";import{i as _i}from"./Gi6I4Gst.js";import{o as ki}from"./CmKTTxBW.js";import{l as zt}from"./DDYV6jDr.js";import"./BM4vnZvX.js";import"./DX6XiGOO.js";function Ri(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function yt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,g,m=!1,p=0,k=0,v=.5;delete e.unknown;function C(){var b=t().length,E=n<s,D=E?n:s,P=E?s:n;o=(P-D)/Math.max(1,b-p+k*2),m&&(o=Math.floor(o)),D+=(P-D-o*(b-p))*v,g=o*(1-p),m&&(D=Math.round(D),g=Math.round(g));var I=Ri(b).map(function(y){return D+o*y});return i(E?I.reverse():I)}return e.domain=function(b){return arguments.length?(t(b),C()):t()},e.range=function(b){return arguments.length?([s,n]=b,s=+s,n=+n,C()):[s,n]},e.rangeRound=function(b){return[s,n]=b,s=+s,n=+n,m=!0,C()},e.bandwidth=function(){return g},e.step=function(){return o},e.round=function(b){return arguments.length?(m=!!b,C()):m},e.padding=function(b){return arguments.length?(p=Math.min(1,k=+b),C()):p},e.paddingInner=function(b){return arguments.length?(p=Math.min(1,b),C()):p},e.paddingOuter=function(b){return arguments.length?(k=+b,C()):k},e.align=function(b){return arguments.length?(v=Math.max(0,Math.min(1,b)),C()):v},e.copy=function(){return yt(t(),[s,n]).round(m).paddingInner(p).paddingOuter(k).align(v)},_i.apply(C(),arguments)}var bt=function(){var e=a(function(O,h,u,x){for(u=u||{},x=O.length;x--;u[O[x]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],p=[1,25],k=[1,26],v=[1,28],C=[1,29],b=[1,30],E=[1,31],D=[1,32],P=[1,33],I=[1,34],y=[1,35],_=[1,36],c=[1,37],W=[1,43],z=[1,42],U=[1,47],X=[1,50],l=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],R=[1,64],$={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,u,x,d,w,r,at){var f=r.length-1;switch(w){case 5:d.setOrientation(r[f]);break;case 9:d.setDiagramTitle(r[f].text.trim());break;case 12:d.setLineData({text:"",type:"text"},r[f]);break;case 13:d.setLineData(r[f-1],r[f]);break;case 14:d.setBarData({text:"",type:"text"},r[f]);break;case 15:d.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),d.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:this.$=[Number(r[f-2]),...r[f]];break;case 21:this.$=[Number(r[f])];break;case 22:d.setXAxisTitle(r[f]);break;case 23:d.setXAxisTitle(r[f-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(r[f]);break;case 26:d.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 27:this.$=r[f-1];break;case 28:this.$=[r[f-2],...r[f]];break;case 29:this.$=[r[f]];break;case 30:d.setYAxisTitle(r[f]);break;case 31:d.setYAxisTitle(r[f-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 37:this.$={text:r[f],type:"text"};break;case 38:this.$={text:r[f],type:"text"};break;case 39:this.$={text:r[f],type:"markdown"};break;case 40:this.$=r[f];break;case 41:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(m,[2,34]),e(m,[2,35]),e(m,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:g}),{1:[2,3]},e(m,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:g}),{11:23,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:45,15:44,27:U,33:46,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:49,17:48,24:X,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{11:52,17:51,24:X,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},{20:[1,53]},{22:[1,54]},e(l,[2,18]),{1:[2,2]},e(l,[2,8]),e(l,[2,9]),e(L,[2,37],{40:55,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c}),e(L,[2,38]),e(L,[2,39]),e(S,[2,40]),e(S,[2,42]),e(S,[2,43]),e(S,[2,44]),e(S,[2,45]),e(S,[2,46]),e(S,[2,47]),e(S,[2,48]),e(S,[2,49]),e(S,[2,50]),e(S,[2,51]),e(l,[2,10]),e(l,[2,22],{30:41,29:56,24:W,27:z}),e(l,[2,24]),e(l,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},e(l,[2,11]),e(l,[2,30],{33:60,27:U}),e(l,[2,32]),{31:[1,61]},e(l,[2,12]),{17:62,24:X},{25:63,27:R},e(l,[2,14]),{17:65,24:X},e(l,[2,16]),e(l,[2,17]),e(S,[2,41]),e(l,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(l,[2,31]),{27:[1,69]},e(l,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(l,[2,15]),e(l,[2,26]),e(l,[2,27]),{11:59,32:72,37:24,38:p,39:k,40:27,41:v,42:C,43:b,44:E,45:D,46:P,47:I,48:y,49:_,50:c},e(l,[2,33]),e(l,[2,19]),{25:73,27:R},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,u){if(u.recoverable)this.trace(h);else{var x=new Error(h);throw x.hash=u,x}},"parseError"),parse:a(function(h){var u=this,x=[0],d=[],w=[null],r=[],at=this.table,f="",lt=0,It=0,hi=2,Mt=1,li=r.slice.call(arguments,1),T=Object.create(this.lexer),Y={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(Y.yy[dt]=this.yy[dt]);T.setInput(h,Y.yy),Y.yy.lexer=T,Y.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var ft=T.yylloc;r.push(ft);var ci=T.options&&T.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(V){x.length=x.length-2*V,w.length=w.length-V,r.length=r.length-V}a(ui,"popStack");function Vt(){var V;return V=d.pop()||T.lex()||Mt,typeof V!="number"&&(V instanceof Array&&(d=V,V=d.pop()),V=u.symbols_[V]||V),V}a(Vt,"lex");for(var M,H,B,pt,q={},ct,F,Bt,ut;;){if(H=x[x.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((M===null||typeof M>"u")&&(M=Vt()),B=at[H]&&at[H][M]),typeof B>"u"||!B.length||!B[0]){var mt="";ut=[];for(ct in at[H])this.terminals_[ct]&&ct>hi&&ut.push("'"+this.terminals_[ct]+"'");T.showPosition?mt="Parse error on line "+(lt+1)+`:
2
+ `+T.showPosition()+`
3
+ Expecting `+ut.join(", ")+", got '"+(this.terminals_[M]||M)+"'":mt="Parse error on line "+(lt+1)+": Unexpected "+(M==Mt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(mt,{text:T.match,token:this.terminals_[M]||M,line:T.yylineno,loc:ft,expected:ut})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+M);switch(B[0]){case 1:x.push(M),w.push(T.yytext),r.push(T.yylloc),x.push(B[1]),M=null,It=T.yyleng,f=T.yytext,lt=T.yylineno,ft=T.yylloc;break;case 2:if(F=this.productions_[B[1]][1],q.$=w[w.length-F],q._$={first_line:r[r.length-(F||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(F||1)].first_column,last_column:r[r.length-1].last_column},ci&&(q._$.range=[r[r.length-(F||1)].range[0],r[r.length-1].range[1]]),pt=this.performAction.apply(q,[f,It,lt,Y.yy,B[1],w,r].concat(li)),typeof pt<"u")return pt;F&&(x=x.slice(0,-1*F*2),w=w.slice(0,-1*F),r=r.slice(0,-1*F)),x.push(this.productions_[B[1]][0]),w.push(q.$),r.push(q._$),Bt=at[x[x.length-2]][x[x.length-1]],x.push(Bt);break;case 3:return!0}}return!0},"parse")},Et=function(){var O={EOF:1,parseError:a(function(u,x){if(this.yy.parser)this.yy.parser.parseError(u,x);else throw new Error(u)},"parseError"),setInput:a(function(h,u){return this.yy=u||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:a(function(h){var u=h.length,x=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===d.length?this.yylloc.first_column:0)+d[d.length-x.length].length-x[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(h){this.unput(this.match.slice(h))},"less"),pastInput:a(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
+ `+u+"^"},"showPosition"),test_match:a(function(h,u){var x,d,w;if(this.options.backtrack_lexer&&(w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(w.yylloc.range=this.yylloc.range.slice(0))),d=h[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],x=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var r in w)this[r]=w[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,u,x,d;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),r=0;r<w.length;r++)if(x=this._input.match(this.rules[w[r]]),x&&(!u||x[0].length>u[0].length)){if(u=x,d=r,this.options.backtrack_lexer){if(h=this.test_match(x,w[r]),h!==!1)return h;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(h=this.test_match(u,w[d]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var u=this.next();return u||this.lex()},"lex"),begin:a(function(u){this.conditionStack.push(u)},"begin"),popState:a(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:a(function(u){this.begin(u)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(u,x,d,w){switch(d){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O}();$.lexer=Et;function N(){this.yy={}}return a(N,"Parser"),N.prototype=$,$.Parser=N,new N}();bt.parser=bt;var Ti=bt;function At(e){return e.type==="bar"}a(At,"isBarPlot");function _t(e){return e.type==="band"}a(_t,"isBandAxisData");function G(e){return e.type==="linear"}a(G,"isLinearAxisData");var j,Ht=(j=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((o,g)=>Math.max(g.length,o),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const o of t){const g=Si(n,1,o),m=g?g.width:o.length*i,p=g?g.height:i;s.width=Math.max(s.width,m),s.height=Math.max(s.height,p)}return n.remove(),s}},a(j,"TextDimensionCalculatorWithFont"),j),Ot=.7,Ft=.2,Q,Ut=(Q=class{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Ot*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ot*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=Ft*t.width;this.outerPadding=Math.min(s.width/2,n);const o=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=Ft*t.height;this.outerPadding=Math.min(s.height/2,n);const o=s.width+this.axisConfig.labelPadding*2;o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},a(Q,"BaseAxis"),Q),K,Di=(K=class extends Ut{constructor(t,i,s,n,o){super(t,n,o,i),this.categories=s,this.scale=yt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=yt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Nt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},a(K,"BandAxis"),K),Z,vi=(Z=class extends Ut{constructor(t,i,s,n,o){super(t,n,o,i),this.domain=s,this.scale=zt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=zt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},a(Z,"LinearAxis"),Z);function wt(e,t,i,s){const n=new Ht(s);return _t(e)?new Di(t,i,e.categories,e.title,n):new vi(t,i,[e.min,e.max],e.title,n)}a(wt,"getAxis");var J,Pi=(J=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},a(J,"ChartTitle"),J);function $t(e,t,i,s){const n=new Ht(s);return new Pi(n,e,t,i)}a($t,"getChartTitleComponent");var tt,Li=(tt=class{constructor(t,i,s,n,o){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let i;return this.orientation==="horizontal"?i=Wt().y(s=>s[0]).x(s=>s[1])(t):i=Wt().x(s=>s[0]).y(s=>s[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},a(tt,"LinePlot"),tt),it,Ei=(it=class{constructor(t,i,s,n,o,g){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(o=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},a(it,"BarPlot"),it),et,Ii=(et=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const n=new Li(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{const n=new Ei(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}},a(et,"BasePlot"),et);function qt(e,t,i){return new Ii(e,t,i)}a(qt,"getPlotComponent");var st,Mi=(st=class{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:$t(t,i,s,n),plot:qt(t,i,s),xAxis:wt(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:wt(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:o,height:g});t-=m.width,i-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=m.height,i-=m.height,this.componentStore.xAxis.setAxisPosition("bottom"),m=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=m.height,this.componentStore.yAxis.setAxisPosition("left"),m=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=m.width,t-=m.width,t>0&&(o+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:o,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+g}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(p=>At(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),m=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:g,height:m});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=p.width,n=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=p.height,o=s+p.height,t>0&&(g+=t,t=0),i>0&&(m+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:m}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+m]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some(k=>At(k))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},a(st,"Orchestrator"),st),nt,Vi=(nt=class{static build(t,i,s,n){return new Mi(t,i,s,n).getDrawableElement()}},a(nt,"XYChartBuilder"),nt),rt=0,Gt,ot=Tt(),ht=Rt(),A=Dt(),Ct=ht.plotColorPalette.split(",").map(e=>e.trim()),gt=!1,kt=!1;function Rt(){const e=wi(),t=St();return Yt(e.xyChart,t.themeVariables.xyChart)}a(Rt,"getChartDefaultThemeConfig");function Tt(){const e=St();return Yt(Ai.xyChart,e.xyChart)}a(Tt,"getChartDefaultConfig");function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(Dt,"getChartDefaultData");function xt(e){const t=St();return Ci(e.trim(),t)}a(xt,"textSanitizer");function jt(e){Gt=e}a(jt,"setTmpSVGG");function Qt(e){e==="horizontal"?ot.chartOrientation="horizontal":ot.chartOrientation="vertical"}a(Qt,"setOrientation");function Kt(e){A.xAxis.title=xt(e.text)}a(Kt,"setXAxisTitle");function vt(e,t){A.xAxis={type:"linear",title:A.xAxis.title,min:e,max:t},gt=!0}a(vt,"setXAxisRangeData");function Zt(e){A.xAxis={type:"band",title:A.xAxis.title,categories:e.map(t=>xt(t.text))},gt=!0}a(Zt,"setXAxisBand");function Jt(e){A.yAxis.title=xt(e.text)}a(Jt,"setYAxisTitle");function ti(e,t){A.yAxis={type:"linear",title:A.yAxis.title,min:e,max:t},kt=!0}a(ti,"setYAxisRangeData");function ii(e){const t=Math.min(...e),i=Math.max(...e),s=G(A.yAxis)?A.yAxis.min:1/0,n=G(A.yAxis)?A.yAxis.max:-1/0;A.yAxis={type:"linear",title:A.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}a(ii,"setYAxisRangeFromPlotData");function Pt(e){let t=[];if(e.length===0)return t;if(!gt){const i=G(A.xAxis)?A.xAxis.min:1/0,s=G(A.xAxis)?A.xAxis.max:-1/0;vt(Math.min(i,1),Math.max(s,e.length))}if(kt||ii(e),_t(A.xAxis)&&(t=A.xAxis.categories.map((i,s)=>[i,e[s]])),G(A.xAxis)){const i=A.xAxis.min,s=A.xAxis.max,n=(s-i)/(e.length-1),o=[];for(let g=i;g<=s;g+=n)o.push(`${g}`);t=o.map((g,m)=>[g,e[m]])}return t}a(Pt,"transformDataWithoutCategory");function Lt(e){return Ct[e===0?0:e%Ct.length]}a(Lt,"getPlotColorFromPalette");function ei(e,t){const i=Pt(t);A.plots.push({type:"line",strokeFill:Lt(rt),strokeWidth:2,data:i}),rt++}a(ei,"setLineData");function si(e,t){const i=Pt(t);A.plots.push({type:"bar",fill:Lt(rt),data:i}),rt++}a(si,"setBarData");function ni(){if(A.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return A.title=Xt(),Vi.build(ot,A,ht,Gt)}a(ni,"getDrawableElem");function ai(){return ht}a(ai,"getChartThemeConfig");function ri(){return ot}a(ri,"getChartConfig");function oi(){return A}a(oi,"getXYChartData");var Bi=a(function(){bi(),rt=0,ot=Tt(),A=Dt(),ht=Rt(),Ct=ht.plotColorPalette.split(",").map(e=>e.trim()),gt=!1,kt=!1},"clear"),Wi={getDrawableElem:ni,clear:Bi,setAccTitle:pi,getAccTitle:fi,setDiagramTitle:di,getDiagramTitle:Xt,getAccDescription:xi,setAccDescription:gi,setOrientation:Qt,setXAxisTitle:Kt,setXAxisRangeData:vt,setXAxisBand:Zt,setYAxisTitle:Jt,setYAxisRangeData:ti,setLineData:ei,setBarData:si,setTmpSVGG:jt,getChartThemeConfig:ai,getChartConfig:ri,getXYChartData:oi},zi=a((e,t,i,s)=>{const n=s.db,o=n.getChartThemeConfig(),g=n.getChartConfig(),m=n.getXYChartData().plots[0].data.map(y=>y[1]);function p(y){return y==="top"?"text-before-edge":"middle"}a(p,"getDominantBaseLine");function k(y){return y==="left"?"start":y==="right"?"end":"middle"}a(k,"getTextAnchor");function v(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}a(v,"getTextTransformation"),Nt.debug(`Rendering xychart chart
7
+ `+e);const C=mi(t),b=C.append("g").attr("class","main"),E=b.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");yi(C,g.height,g.width,!0),C.attr("viewBox",`0 0 ${g.width} ${g.height}`),E.attr("fill",o.backgroundColor),n.setTmpSVGG(C.append("g").attr("class","mermaid-tmp-group"));const D=n.getDrawableElem(),P={};function I(y){let _=b,c="";for(const[W]of y.entries()){let z=b;W>0&&P[c]&&(z=P[c]),c+=y[W],_=P[c],_||(_=P[c]=z.append("g").attr("class",y[W]))}return _}a(I,"getGroup");for(const y of D){if(y.data.length===0)continue;const _=I(y.groupTexts);switch(y.type){case"rect":if(_.selectAll("rect").data(y.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),g.showDataLabel)if(g.chartOrientation==="horizontal"){let c=function(l,L){const{data:S,label:R}=l;return L*R.length*W<=S.width-10};a(c,"fitsHorizontally");const W=.7,z=y.data.map((l,L)=>({data:l,label:m[L].toString()})).filter(l=>l.data.width>0&&l.data.height>0),U=z.map(l=>{const{data:L}=l;let S=L.height*.7;for(;!c(l,S)&&S>0;)S-=1;return S}),X=Math.floor(Math.min(...U));_.selectAll("text").data(z).enter().append("text").attr("x",l=>l.data.x+l.data.width-10).attr("y",l=>l.data.y+l.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${X}px`).text(l=>l.label)}else{let c=function(l,L,S){const{data:R,label:$}=l,N=L*$.length*.7,O=R.x+R.width/2,h=O-N/2,u=O+N/2,x=h>=R.x&&u<=R.x+R.width,d=R.y+S+L<=R.y+R.height;return x&&d};a(c,"fitsInBar");const W=10,z=y.data.map((l,L)=>({data:l,label:m[L].toString()})).filter(l=>l.data.width>0&&l.data.height>0),U=z.map(l=>{const{data:L,label:S}=l;let R=L.width/(S.length*.7);for(;!c(l,R,W)&&R>0;)R-=1;return R}),X=Math.floor(Math.min(...U));_.selectAll("text").data(z).enter().append("text").attr("x",l=>l.data.x+l.data.width/2).attr("y",l=>l.data.y+W).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${X}px`).text(l=>l.label)}break;case"text":_.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>p(c.verticalPos)).attr("text-anchor",c=>k(c.horizontalPos)).attr("transform",c=>v(c)).text(c=>c.text);break;case"path":_.selectAll("path").data(y.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Oi={draw:zi},$i={parser:Ti,db:Wi,renderer:Oi};export{$i as diagram};
@@ -0,0 +1,65 @@
1
+ import{p as V}from"./sE-55p4e.js";import{I as X}from"./CvTHaPAO.js";import{_ as $,t as J,q as Q,s as Z,g as rr,a as er,b as tr,l as m,d as ar,u as sr,F as nr,A as or,k as E,G as cr,H as ir,I as dr,K as hr}from"./D4jn2f-6.js";import{p as lr}from"./c_huf6xz.js";import"./BM4vnZvX.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},$r=dr.gitGraph,q=$(()=>cr({...$r,...ir().gitGraph}),"getConfig"),i=new X(()=>{const t=q(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function z(){return hr({length:7})}$(z,"getID");function W(t,r){const a=Object.create(null);return t.reduce((n,e)=>{const s=r(e);return a[s]||(a[s]=!0,n.push(e)),n},[])}$(W,"uniqBy");var fr=$(function(t){i.records.direction=t},"setDirection"),yr=$(function(t){m.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),gr=$(function(){return i.records.options},"getOptions"),xr=$(function(t){let r=t.msg,a=t.id;const n=t.type;let e=t.tags;m.info("commit",r,a,n,e),m.debug("Entering commit:",r,a,n,e);const s=q();a=E.sanitizeText(a,s),r=E.sanitizeText(r,s),e=e==null?void 0:e.map(c=>E.sanitizeText(c,s));const o={id:a||i.records.seq+"-"+z(),message:r,seq:i.records.seq++,type:n??p.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=o,m.info("main branch",s.mainBranchName),i.records.commits.has(o.id)&&m.warn(`Commit ID ${o.id} already exists`),i.records.commits.set(o.id,o),i.records.branches.set(i.records.currBranch,o.id),m.debug("in pushCommit "+o.id)},"commit"),ur=$(function(t){let r=t.name;const a=t.order;if(r=E.sanitizeText(r,q()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:a}),S(r),m.debug("in createBranch")},"branch"),pr=$(t=>{let r=t.branch,a=t.id;const n=t.type,e=t.tags,s=q();r=E.sanitizeText(r,s),a&&(a=E.sanitizeText(a,s));const o=i.records.branches.get(i.records.currBranch),c=i.records.branches.get(r),d=o?i.records.commits.get(o):void 0,h=c?i.records.commits.get(c):void 0;if(d&&h&&d.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const l=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},l}if(d===void 0||!d){const l=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},l}if(!i.records.branches.has(r)){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},l}if(h===void 0||!h){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},l}if(d===h){const l=new Error('Incorrect usage of "merge". Both branches have same head');throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},l}if(a&&i.records.commits.has(a)){const l=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw l.hash={text:`merge ${r} ${a} ${n} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${n} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${n} ${e==null?void 0:e.join(" ")}`]},l}const f=c||"",y={id:a||`${i.records.seq}-${z()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,f],branch:i.records.currBranch,type:p.MERGE,customType:n,customId:!!a,tags:e??[]};i.records.head=y,i.records.commits.set(y.id,y),i.records.branches.set(i.records.currBranch,y.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),br=$(function(t){let r=t.id,a=t.targetId,n=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,n);const s=q();if(r=E.sanitizeText(r,s),a=E.sanitizeText(a,s),n=n==null?void 0:n.map(d=>E.sanitizeText(d,s)),e=E.sanitizeText(e,s),!r||!i.records.commits.has(r)){const d=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw d.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},d}const o=i.records.commits.get(r);if(o===void 0||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(o.parents)&&o.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const c=o.branch;if(o.type===p.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!i.records.commits.has(a)){if(c===i.records.currBranch){const y=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const d=i.records.branches.get(i.records.currBranch);if(d===void 0||!d){const y=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const h=i.records.commits.get(d);if(h===void 0||!h){const y=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const f={id:i.records.seq+"-"+z(),message:`cherry-picked ${o==null?void 0:o.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,o.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${o.id}${o.type===p.MERGE?`|parent:${e}`:""}`]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),m.debug(i.records.branches),m.debug("in cherryPick")}},"cherryPick"),S=$(function(t){if(t=E.sanitizeText(t,q()),i.records.branches.has(t)){i.records.currBranch=t;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function D(t,r,a){const n=t.indexOf(r);n===-1?t.push(a):t.splice(n,1,a)}$(D,"upsert");function F(t){const r=t.reduce((e,s)=>e.seq>s.seq?e:s,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const n=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&n.push(e);if(m.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=i.records.commits.get(r.parents[0]);D(t,r,e),r.parents[1]&&t.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=i.records.commits.get(r.parents[0]);D(t,r,e)}}t=W(t,e=>e.id),F(t)}$(F,"prettyPrintCommitHistory");var mr=$(function(){m.debug(i.records.commits);const t=j()[0];F([t])},"prettyPrint"),wr=$(function(){i.reset(),or()},"clear"),vr=$(function(){return[...i.records.branchConfig.values()].map((r,a)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${a}`)}).sort((r,a)=>(r.order??0)-(a.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Cr=$(function(){return i.records.branches},"getBranches"),Er=$(function(){return i.records.commits},"getCommits"),j=$(function(){const t=[...i.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Br=$(function(){return i.records.currBranch},"getCurrentBranch"),Tr=$(function(){return i.records.direction},"getDirection"),Lr=$(function(){return i.records.head},"getHead"),K={commitType:p,getConfig:q,setDirection:fr,setOptions:yr,getOptions:gr,commit:xr,branch:ur,merge:pr,cherryPick:br,checkout:S,prettyPrint:mr,clear:wr,getBranchesAsObjArray:vr,getBranches:Cr,getCommits:Er,getCommitsArray:j,getCurrentBranch:Br,getDirection:Tr,getHead:Lr,setAccTitle:tr,getAccTitle:er,getAccDescription:rr,setAccDescription:Z,setDiagramTitle:Q,getDiagramTitle:J},kr=$((t,r)=>{V(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)Mr(a,r)},"populate"),Mr=$((t,r)=>{const n={Commit:$(e=>r.commit(Ir(e)),"Commit"),Branch:$(e=>r.branch(Rr(e)),"Branch"),Merge:$(e=>r.merge(Gr(e)),"Merge"),Checkout:$(e=>r.checkout(Or(e)),"Checkout"),CherryPicking:$(e=>r.cherryPick(qr(e)),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ir=$(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?p[t.type]:p.NORMAL,tags:t.tags??void 0}),"parseCommit"),Rr=$(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=$(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?p[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Or=$(t=>t.branch,"parseCheckout"),qr=$(t=>{var a;return{id:t.id,targetId:"",tags:((a=t.tags)==null?void 0:a.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Ar={parse:$(async t=>{const r=await lr("gitGraph",t);m.debug(r),kr(r,K)},"parse")},I=10,R=40,B=4,L=2,O=8,v=new Map,C=new Map,P=30,A=new Map,_=[],M=0,x="LR",Hr=$(()=>{v.clear(),C.clear(),A.clear(),M=0,_=[],x="LR"},"clear"),Y=$(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=n.trim(),r.appendChild(e)}),r},"drawText"),U=$(t=>{let r,a,n;return x==="BT"?(a=$((e,s)=>e<=s,"comparisonFunc"),n=1/0):(a=$((e,s)=>e>=s,"comparisonFunc"),n=0),t.forEach(e=>{var o,c;const s=x==="TB"||x=="BT"?(o=C.get(e))==null?void 0:o.y:(c=C.get(e))==null?void 0:c.x;s!==void 0&&a(s,n)&&(r=e,n=s)}),r},"findClosestParent"),Pr=$(t=>{let r="",a=1/0;return t.forEach(n=>{const e=C.get(n).y;e<=a&&(r=n,a=e)}),r||void 0},"findClosestParentBT"),_r=$((t,r,a)=>{let n=a,e=a;const s=[];t.forEach(o=>{const c=r.get(o);if(!c)throw new Error(`Commit not found for key ${o}`);c.parents.length?(n=Dr(c),e=Math.max(n,e)):s.push(c),Fr(c,n)}),n=e,s.forEach(o=>{Nr(o,n,a)}),t.forEach(o=>{const c=r.get(o);if(c!=null&&c.parents.length){const d=Pr(c.parents);n=C.get(d).y-R,n<=e&&(e=n);const h=v.get(c.branch).pos,f=n-I;C.set(c.id,{x:h,y:f})}})},"setParallelBTPos"),zr=$(t=>{var n;const r=U(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(n=C.get(r))==null?void 0:n.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Dr=$(t=>zr(t)+R,"calculateCommitPosition"),Fr=$((t,r)=>{const a=v.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const n=a.pos,e=r+I;return C.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),Nr=$((t,r,a)=>{const n=v.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,s=n.pos;C.set(t.id,{x:s,y:e})},"setRootPosition"),Wr=$((t,r,a,n,e,s)=>{if(s===p.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%O} ${n}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%O} ${n}-inner`);else if(s===p.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const o=t.append("circle");if(o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",r.type===p.MERGE?9:10),o.attr("class",`commit ${r.id} commit${e%O}`),s===p.MERGE){const c=t.append("circle");c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",6),c.attr("class",`commit ${n} ${r.id} commit${e%O}`)}s===p.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Sr=$((t,r,a,n,e)=>{var s;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&e.showCommitLabel){const o=t.append("g"),c=o.insert("rect").attr("class","commit-label-bkg"),d=o.append("text").attr("x",n).attr("y",a.y+25).attr("class","commit-label").text(r.id),h=(s=d.node())==null?void 0:s.getBBox();if(h&&(c.attr("x",a.posWithOffset-h.width/2-L).attr("y",a.y+13.5).attr("width",h.width+2*L).attr("height",h.height+2*L),x==="TB"||x==="BT"?(c.attr("x",a.x-(h.width+4*B+5)).attr("y",a.y-12),d.attr("x",a.x-(h.width+4*B)).attr("y",a.y+h.height-12)):d.attr("x",a.posWithOffset-h.width/2),e.rotateCommitLabel))if(x==="TB"||x==="BT")d.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const f=-7.5-(h.width+10)/25*9.5,y=10+h.width/25*8.5;o.attr("transform","translate("+f+", "+y+") rotate(-45, "+n+", "+a.y+")")}}},"drawCommitLabel"),jr=$((t,r,a,n)=>{var e;if(r.tags.length>0){let s=0,o=0,c=0;const d=[];for(const h of r.tags.reverse()){const f=t.insert("polygon"),y=t.append("circle"),l=t.append("text").attr("y",a.y-16-s).attr("class","tag-label").text(h),g=(e=l.node())==null?void 0:e.getBBox();if(!g)throw new Error("Tag bbox not found");o=Math.max(o,g.width),c=Math.max(c,g.height),l.attr("x",a.posWithOffset-g.width/2),d.push({tag:l,hole:y,rect:f,yOffset:s}),s+=20}for(const{tag:h,hole:f,rect:y,yOffset:l}of d){const g=c/2,u=a.y-19.2-l;if(y.attr("class","tag-label-bkg").attr("points",`
2
+ ${n-o/2-B/2},${u+L}
3
+ ${n-o/2-B/2},${u-L}
4
+ ${a.posWithOffset-o/2-B},${u-g-L}
5
+ ${a.posWithOffset+o/2+B},${u-g-L}
6
+ ${a.posWithOffset+o/2+B},${u+g+L}
7
+ ${a.posWithOffset-o/2-B},${u+g+L}`),f.attr("cy",u).attr("cx",n-o/2+B/2).attr("r",1.5).attr("class","tag-hole"),x==="TB"||x==="BT"){const b=n+l;y.attr("class","tag-label-bkg").attr("points",`
8
+ ${a.x},${b+2}
9
+ ${a.x},${b-2}
10
+ ${a.x+I},${b-g-2}
11
+ ${a.x+I+o+4},${b-g-2}
12
+ ${a.x+I+o+4},${b+g+2}
13
+ ${a.x+I},${b+g+2}`).attr("transform","translate(12,12) rotate(45, "+a.x+","+n+")"),f.attr("cx",a.x+B/2).attr("cy",b).attr("transform","translate(12,12) rotate(45, "+a.x+","+n+")"),h.attr("x",a.x+5).attr("y",b+3).attr("transform","translate(14,14) rotate(45, "+a.x+","+n+")")}}}},"drawCommitTags"),Kr=$(t=>{switch(t.customType??t.type){case p.NORMAL:return"commit-normal";case p.REVERSE:return"commit-reverse";case p.HIGHLIGHT:return"commit-highlight";case p.MERGE:return"commit-merge";case p.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),Yr=$((t,r,a,n)=>{const e={x:0,y:0};if(t.parents.length>0){const s=U(t.parents);if(s){const o=n.get(s)??e;return r==="TB"?o.y+R:r==="BT"?(n.get(t.id)??e).y-R:o.x+R}}else return r==="TB"?P:r==="BT"?(n.get(t.id)??e).y-R:0;return 0},"calculatePosition"),Ur=$((t,r,a)=>{var o,c;const n=x==="BT"&&a?r:r+I,e=x==="TB"||x==="BT"?n:(o=v.get(t.branch))==null?void 0:o.pos,s=x==="TB"||x==="BT"?(c=v.get(t.branch))==null?void 0:c.pos:n;if(s===void 0||e===void 0)throw new Error(`Position were undefined for commit ${t.id}`);return{x:s,y:e,posWithOffset:n}},"getCommitPosition"),N=$((t,r,a,n)=>{const e=t.append("g").attr("class","commit-bullets"),s=t.append("g").attr("class","commit-labels");let o=x==="TB"||x==="BT"?P:0;const c=[...r.keys()],d=n.parallelCommits??!1,h=$((y,l)=>{var b,T;const g=(b=r.get(y))==null?void 0:b.seq,u=(T=r.get(l))==null?void 0:T.seq;return g!==void 0&&u!==void 0?g-u:0},"sortKeys");let f=c.sort(h);x==="BT"&&(d&&_r(f,r,o),f=f.reverse()),f.forEach(y=>{var u;const l=r.get(y);if(!l)throw new Error(`Commit not found for key ${y}`);d&&(o=Yr(l,x,o,C));const g=Ur(l,o,d);if(a){const b=Kr(l),T=l.customType??l.type,G=((u=v.get(l.branch))==null?void 0:u.index)??0;Wr(e,l,g,b,G,T),Sr(s,l,g,o,n),jr(s,l,g,o)}x==="TB"||x==="BT"?C.set(l.id,{x:g.x,y:g.posWithOffset}):C.set(l.id,{x:g.posWithOffset,y:g.y}),o=x==="BT"&&d?o+R:o+R+I,o>M&&(M=o)})},"drawCommits"),Vr=$((t,r,a,n,e)=>{const o=(x==="TB"||x==="BT"?a.x<n.x:a.y<n.y)?r.branch:t.branch,c=$(h=>h.branch===o,"isOnBranchToGetCurve"),d=$(h=>h.seq>t.seq&&h.seq<r.seq,"isBetweenCommits");return[...e.values()].some(h=>d(h)&&c(h))},"shouldRerouteArrow"),H=$((t,r,a=0)=>{const n=t+Math.abs(t-r)/2;if(a>5)return n;if(_.every(o=>Math.abs(o-n)>=10))return _.push(n),n;const s=Math.abs(t-r);return H(t,r-s/5,a+1)},"findLane"),Xr=$((t,r,a,n)=>{var g,u,b,T,G;const e=C.get(r.id),s=C.get(a.id);if(e===void 0||s===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);const o=Vr(r,a,e,s,n);let c="",d="",h=0,f=0,y=(g=v.get(a.branch))==null?void 0:g.index;a.type===p.MERGE&&r.id!==a.parents[0]&&(y=(u=v.get(r.branch))==null?void 0:u.index);let l;if(o){c="A 10 10, 0, 0, 0,",d="A 10 10, 0, 0, 1,",h=10,f=10;const k=e.y<s.y?H(e.y,s.y):H(s.y,e.y),w=e.x<s.x?H(e.x,s.x):H(s.x,e.x);x==="TB"?e.x<s.x?l=`M ${e.x} ${e.y} L ${w-h} ${e.y} ${d} ${w} ${e.y+f} L ${w} ${s.y-h} ${c} ${w+f} ${s.y} L ${s.x} ${s.y}`:(y=(b=v.get(r.branch))==null?void 0:b.index,l=`M ${e.x} ${e.y} L ${w+h} ${e.y} ${c} ${w} ${e.y+f} L ${w} ${s.y-h} ${d} ${w-f} ${s.y} L ${s.x} ${s.y}`):x==="BT"?e.x<s.x?l=`M ${e.x} ${e.y} L ${w-h} ${e.y} ${c} ${w} ${e.y-f} L ${w} ${s.y+h} ${d} ${w+f} ${s.y} L ${s.x} ${s.y}`:(y=(T=v.get(r.branch))==null?void 0:T.index,l=`M ${e.x} ${e.y} L ${w+h} ${e.y} ${d} ${w} ${e.y-f} L ${w} ${s.y+h} ${c} ${w-f} ${s.y} L ${s.x} ${s.y}`):e.y<s.y?l=`M ${e.x} ${e.y} L ${e.x} ${k-h} ${c} ${e.x+f} ${k} L ${s.x-h} ${k} ${d} ${s.x} ${k+f} L ${s.x} ${s.y}`:(y=(G=v.get(r.branch))==null?void 0:G.index,l=`M ${e.x} ${e.y} L ${e.x} ${k+h} ${d} ${e.x+f} ${k} L ${s.x-h} ${k} ${c} ${s.x} ${k-f} L ${s.x} ${s.y}`)}else c="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,f=20,x==="TB"?(e.x<s.x&&(a.type===p.MERGE&&r.id!==a.parents[0]?l=`M ${e.x} ${e.y} L ${e.x} ${s.y-h} ${c} ${e.x+f} ${s.y} L ${s.x} ${s.y}`:l=`M ${e.x} ${e.y} L ${s.x-h} ${e.y} ${d} ${s.x} ${e.y+f} L ${s.x} ${s.y}`),e.x>s.x&&(c="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,f=20,a.type===p.MERGE&&r.id!==a.parents[0]?l=`M ${e.x} ${e.y} L ${e.x} ${s.y-h} ${d} ${e.x-f} ${s.y} L ${s.x} ${s.y}`:l=`M ${e.x} ${e.y} L ${s.x+h} ${e.y} ${c} ${s.x} ${e.y+f} L ${s.x} ${s.y}`),e.x===s.x&&(l=`M ${e.x} ${e.y} L ${s.x} ${s.y}`)):x==="BT"?(e.x<s.x&&(a.type===p.MERGE&&r.id!==a.parents[0]?l=`M ${e.x} ${e.y} L ${e.x} ${s.y+h} ${d} ${e.x+f} ${s.y} L ${s.x} ${s.y}`:l=`M ${e.x} ${e.y} L ${s.x-h} ${e.y} ${c} ${s.x} ${e.y-f} L ${s.x} ${s.y}`),e.x>s.x&&(c="A 20 20, 0, 0, 0,",d="A 20 20, 0, 0, 1,",h=20,f=20,a.type===p.MERGE&&r.id!==a.parents[0]?l=`M ${e.x} ${e.y} L ${e.x} ${s.y+h} ${c} ${e.x-f} ${s.y} L ${s.x} ${s.y}`:l=`M ${e.x} ${e.y} L ${s.x+h} ${e.y} ${d} ${s.x} ${e.y-f} L ${s.x} ${s.y}`),e.x===s.x&&(l=`M ${e.x} ${e.y} L ${s.x} ${s.y}`)):(e.y<s.y&&(a.type===p.MERGE&&r.id!==a.parents[0]?l=`M ${e.x} ${e.y} L ${s.x-h} ${e.y} ${d} ${s.x} ${e.y+f} L ${s.x} ${s.y}`:l=`M ${e.x} ${e.y} L ${e.x} ${s.y-h} ${c} ${e.x+f} ${s.y} L ${s.x} ${s.y}`),e.y>s.y&&(a.type===p.MERGE&&r.id!==a.parents[0]?l=`M ${e.x} ${e.y} L ${s.x-h} ${e.y} ${c} ${s.x} ${e.y-f} L ${s.x} ${s.y}`:l=`M ${e.x} ${e.y} L ${e.x} ${s.y+h} ${d} ${e.x+f} ${s.y} L ${s.x} ${s.y}`),e.y===s.y&&(l=`M ${e.x} ${e.y} L ${s.x} ${s.y}`));if(l===void 0)throw new Error("Line definition not found");t.append("path").attr("d",l).attr("class","arrow arrow"+y%O)},"drawArrow"),Jr=$((t,r)=>{const a=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(n=>{const e=r.get(n);e.parents&&e.parents.length>0&&e.parents.forEach(s=>{Xr(a,r.get(s),e,r)})})},"drawArrows"),Qr=$((t,r,a)=>{const n=t.append("g");r.forEach((e,s)=>{var b;const o=s%O,c=(b=v.get(e.name))==null?void 0:b.pos;if(c===void 0)throw new Error(`Position not found for branch ${e.name}`);const d=n.append("line");d.attr("x1",0),d.attr("y1",c),d.attr("x2",M),d.attr("y2",c),d.attr("class","branch branch"+o),x==="TB"?(d.attr("y1",P),d.attr("x1",c),d.attr("y2",M),d.attr("x2",c)):x==="BT"&&(d.attr("y1",M),d.attr("x1",c),d.attr("y2",P),d.attr("x2",c)),_.push(c);const h=e.name,f=Y(h),y=n.insert("rect"),g=n.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+o);g.node().appendChild(f);const u=f.getBBox();y.attr("class","branchLabelBkg label"+o).attr("rx",4).attr("ry",4).attr("x",-u.width-4-(a.rotateCommitLabel===!0?30:0)).attr("y",-u.height/2+8).attr("width",u.width+18).attr("height",u.height+4),g.attr("transform","translate("+(-u.width-14-(a.rotateCommitLabel===!0?30:0))+", "+(c-u.height/2-1)+")"),x==="TB"?(y.attr("x",c-u.width/2-10).attr("y",0),g.attr("transform","translate("+(c-u.width/2-5)+", 0)")):x==="BT"?(y.attr("x",c-u.width/2-10).attr("y",M),g.attr("transform","translate("+(c-u.width/2-5)+", "+M+")")):y.attr("transform","translate(-19, "+(c-u.height/2)+")")})},"drawBranches"),Zr=$(function(t,r,a,n,e){return v.set(t,{pos:r,index:a}),r+=50+(e?40:0)+(x==="TB"||x==="BT"?n.width/2:0),r},"setBranchPosition"),re=$(function(t,r,a,n){Hr(),m.debug("in gitgraph renderer",t+`
14
+ `,"id:",r,a);const e=n.db;if(!e.getConfig){m.error("getConfig method is not available on db");return}const s=e.getConfig(),o=s.rotateCommitLabel??!1;A=e.getCommits();const c=e.getBranchesAsObjArray();x=e.getDirection();const d=ar(`[id="${r}"]`);let h=0;c.forEach((f,y)=>{var G;const l=Y(f.name),g=d.append("g"),u=g.insert("g").attr("class","branchLabel"),b=u.insert("g").attr("class","label branch-label");(G=b.node())==null||G.appendChild(l);const T=l.getBBox();h=Zr(f.name,h,y,T,o),b.remove(),u.remove(),g.remove()}),N(d,A,!1,s),s.showBranches&&Qr(d,c,s),Jr(d,A),N(d,A,!0,s),sr.insertTitle(d,"gitTitleText",s.titleTopMargin??0,e.getDiagramTitle()),nr(void 0,d,s.diagramPadding,s.useMaxWidth)},"draw"),ee={draw:re},te=$(t=>`
15
+ .commit-id,
16
+ .commit-msg,
17
+ .branch-label {
18
+ fill: lightgrey;
19
+ color: lightgrey;
20
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
21
+ font-family: var(--mermaid-font-family);
22
+ }
23
+ ${[0,1,2,3,4,5,6,7].map(r=>`
24
+ .branch-label${r} { fill: ${t["gitBranchLabel"+r]}; }
25
+ .commit${r} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; }
26
+ .commit-highlight${r} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; }
27
+ .label${r} { fill: ${t["git"+r]}; }
28
+ .arrow${r} { stroke: ${t["git"+r]}; }
29
+ `).join(`
30
+ `)}
31
+
32
+ .branch {
33
+ stroke-width: 1;
34
+ stroke: ${t.lineColor};
35
+ stroke-dasharray: 2;
36
+ }
37
+ .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
38
+ .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
39
+ .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
40
+ .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
41
+ .tag-hole { fill: ${t.textColor}; }
42
+
43
+ .commit-merge {
44
+ stroke: ${t.primaryColor};
45
+ fill: ${t.primaryColor};
46
+ }
47
+ .commit-reverse {
48
+ stroke: ${t.primaryColor};
49
+ fill: ${t.primaryColor};
50
+ stroke-width: 3;
51
+ }
52
+ .commit-highlight-outer {
53
+ }
54
+ .commit-highlight-inner {
55
+ stroke: ${t.primaryColor};
56
+ fill: ${t.primaryColor};
57
+ }
58
+
59
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
60
+ .gitTitleText {
61
+ text-anchor: middle;
62
+ font-size: 18px;
63
+ fill: ${t.textColor};
64
+ }
65
+ `,"getStyles"),ae=te,de={parser:Ar,db:K,renderer:ee,styles:ae};export{de as diagram};
@@ -0,0 +1 @@
1
+ import{c as I,U as Se,bO as re,d as $,S as we,T as xe,H as Q,I as fe,b as V,o as b,w as n,f as T,u as e,P as me,bR as Ve,Z as ke,bS as $e,N as Z,C as i,n as q,e as ne,bV as Ae,h as a,cC as Ee,al as se,r as B,cD as H,ai as Ie,ad as de,cE as Pe,cF as Ke,j as P,m as U,F as N,aQ as S,i as g,aY as ve,G as J,aP as K,aO as Re,aR as Ue,aS as Te,aT as Oe,aV as F,a6 as Be,t as G,aW as qe,s as ge,x as ye,y as he,a9 as Ne,z as be,A as M,B as He,q as ze,p as ae,cG as Fe}from"./BM4vnZvX.js";import{i as Me,_ as ie}from"./0lRW_xjL.js";import{_ as je,b as Le,c as ue}from"./BNYR501z.js";import{_ as pe}from"./D3G5Xy_-.js";import{u as Ge}from"./kehy-5uo.js";import{C as Ye,a as We,b as Qe}from"./D9o5Pdvp.js";import{u as Ze,_ as Je,e as L,f as Xe}from"./DgnsV5Qb.js";import{_ as Y}from"./BhUkpIlA.js";function es({type:o,defaultValue:l,modelValue:r}){const t=r||l;return r!==void 0||l!==void 0?Array.isArray(t)?"multiple":"single":o??"single"}function ss({type:o,defaultValue:l,modelValue:r}){return o||es({type:o,defaultValue:l,modelValue:r})}function as({type:o,defaultValue:l}){return l!==void 0?l:o==="single"?void 0:[]}function ts(o,l){const r=I(()=>ss(o)),t=Se(o,"modelValue",l,{defaultValue:as(o),passive:o.modelValue===void 0,deep:!0});function u(v){if(r.value==="single")t.value=re(v,t.value)?void 0:v;else{const f=Array.isArray(t.value)?[...t.value||[]]:[t.value].filter(Boolean);if(Me(f,v)){const d=f.findIndex(s=>re(s,v));f.splice(d,1)}else f.push(v);t.value=f}}const p=I(()=>r.value==="single");return{modelValue:t,changeModelValue:u,isSingle:p}}const[X,os]=fe("AccordionRoot");var ns=$({__name:"AccordionRoot",props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:"vertical"},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:["update:modelValue"],setup(o,{emit:l}){const r=o,t=l,{dir:u,disabled:p,unmountOnHide:v}=we(r),f=xe(u),{modelValue:d,changeModelValue:s,isSingle:w}=ts(r,t),{forwardRef:h,currentElement:x}=Q();return os({disabled:p,direction:f,orientation:r.orientation,parentElement:x,isSingle:w,collapsible:r.collapsible,modelValue:d,changeModelValue:s,unmountOnHide:v}),(R,_)=>(b(),V(e(me),{ref:e(h),"as-child":R.asChild,as:R.as},{default:n(()=>[T(R.$slots,"default",{modelValue:e(d)})]),_:3},8,["as-child","as"]))}}),ls=ns,te=function(o){return o.Open="open",o.Closed="closed",o}(te||{});const[le,rs]=fe("AccordionItem");var ds=$({__name:"AccordionItem",props:{disabled:{type:Boolean,required:!1},value:{type:String,required:!0},unmountOnHide:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o,{expose:l}){const r=o,t=X(),u=I(()=>t.isSingle.value?r.value===t.modelValue.value:Array.isArray(t.modelValue.value)&&t.modelValue.value.includes(r.value)),p=I(()=>t.disabled.value||r.disabled),v=I(()=>p.value?"":void 0),f=I(()=>u.value?te.Open:te.Closed);l({open:u,dataDisabled:v});const{currentRef:d,currentElement:s}=Q();rs({open:u,dataState:f,disabled:p,dataDisabled:v,triggerId:"",currentRef:d,currentElement:s,value:I(()=>r.value)});function w(h){var m;const x=h.target;if(Array.from(((m=t.parentElement.value)==null?void 0:m.querySelectorAll("[data-reka-collection-item]"))??[]).findIndex(k=>k===x)===-1)return null;Ze(h,x,t.parentElement.value,{arrowKeyOptions:t.orientation,dir:t.direction.value,focus:!0})}return(h,x)=>(b(),V(e(Ye),{"data-orientation":e(t).orientation,"data-disabled":v.value,"data-state":f.value,disabled:p.value,open:u.value,as:r.as,"as-child":r.asChild,"unmount-on-hide":r.unmountOnHide??e(t).unmountOnHide.value,onKeydown:Ve(w,["up","down","left","right","home","end"])},{default:n(()=>[T(h.$slots,"default",{open:u.value})]),_:3},8,["data-orientation","data-disabled","data-state","disabled","open","as","as-child","unmount-on-hide"]))}}),is=ds,us=$({__name:"AccordionContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const l=o,r=X(),t=le();return Q(),(u,p)=>(b(),V(e(We),{role:"region","as-child":l.asChild,as:u.as,"force-mount":l.forceMount,"aria-labelledby":e(t).triggerId,"data-state":e(t).dataState.value,"data-disabled":e(t).dataDisabled.value,"data-orientation":e(r).orientation,style:{"--reka-accordion-content-width":"var(--reka-collapsible-content-width)","--reka-accordion-content-height":"var(--reka-collapsible-content-height)"},onContentFound:p[0]||(p[0]=v=>e(r).changeModelValue(e(t).value.value))},{default:n(()=>[T(u.$slots,"default")]),_:3},8,["as-child","as","force-mount","aria-labelledby","data-state","data-disabled","data-orientation"]))}}),ps=us,cs=$({__name:"AccordionHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h3"}},setup(o){const l=o,r=X(),t=le();return Q(),(u,p)=>(b(),V(e(me),{as:l.as,"as-child":l.asChild,"data-orientation":e(r).orientation,"data-state":e(t).dataState.value,"data-disabled":e(t).dataDisabled.value},{default:n(()=>[T(u.$slots,"default")]),_:3},8,["as","as-child","data-orientation","data-state","data-disabled"]))}}),fs=cs,ms=$({__name:"AccordionTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(o){const l=o,r=X(),t=le();t.triggerId||(t.triggerId=ke(void 0,"reka-accordion-trigger"));function u(){const p=r.isSingle.value&&t.open.value&&!r.collapsible;t.disabled.value||p||r.changeModelValue(t.value.value)}return(p,v)=>(b(),V(e(Qe),{id:e(t).triggerId,ref:e(t).currentRef,"data-reka-collection-item":"",as:l.as,"as-child":l.asChild,"aria-disabled":e(t).disabled.value||void 0,"aria-expanded":e(t).open.value||!1,"data-disabled":e(t).dataDisabled.value,"data-orientation":e(r).orientation,"data-state":e(t).dataState.value,disabled:e(t).disabled.value,onClick:u},{default:n(()=>[T(p.$slots,"default")]),_:3},8,["id","as","as-child","aria-disabled","aria-expanded","data-disabled","data-orientation","data-state","disabled"]))}}),vs=ms;const ce=$({__name:"Accordion",props:{collapsible:{type:Boolean},disabled:{type:Boolean},dir:{},orientation:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},type:{},modelValue:{},defaultValue:{}},emits:["update:modelValue"],setup(o,{emit:l}){const u=$e(o,l);return(p,v)=>(b(),V(e(ls),Z({"data-slot":"accordion"},e(u)),{default:n(()=>[T(p.$slots,"default")]),_:3},16))}}),_e=$({__name:"AccordionContent",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(o){const l=o,r=I(()=>{const{class:t,...u}=l;return u});return(t,u)=>(b(),V(e(ps),Z({"data-slot":"accordion-content"},r.value,{class:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"}),{default:n(()=>[i("div",{class:q(e(ne)("pt-0 pb-4",l.class))},[T(t.$slots,"default")],2)]),_:3},16))}}),De=$({__name:"AccordionItem",props:{disabled:{type:Boolean},value:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(o){const l=o,r=I(()=>{const{class:u,...p}=l;return p}),t=Ae(r);return(u,p)=>(b(),V(e(is),Z({"data-slot":"accordion-item"},e(t),{class:e(ne)("border-b last:border-b-0",l.class)}),{default:n(()=>[T(u.$slots,"default")]),_:3},16,["class"]))}}),Ce=$({__name:"AccordionTrigger",props:{asChild:{type:Boolean},as:{},class:{}},setup(o){const l=o,r=I(()=>{const{class:t,...u}=l;return u});return(t,u)=>(b(),V(e(fs),{class:"flex"},{default:n(()=>[a(e(vs),Z({"data-slot":"accordion-trigger"},r.value,{class:e(ne)("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",l.class)}),{default:n(()=>[T(t.$slots,"default"),T(t.$slots,"icon",{},()=>[a(e(Ee),{class:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})])]),_:3},16,["class"])]),_:3}))}}),gs={healthCheck:o=>$fetch("/api/managment-connection/health-check",{method:"POST",body:o})};var z=(o=>(o.STRING="string",o.FORM="form",o))(z||{}),oe=(o=>(o.DISABLE="disable",o.PREFERRED="preferred",o.REQUIRE="require",o.VERIFY_CA="verify-ca",o.VERIFY_FULL="verify-full",o))(oe||{}),O=(o=>(o.PASSWORD="password",o.KEY="key",o))(O||{});function ys(o){const l=se(o.open),r=se(o.editingConnection),t=se(o.workspaceId),u=B(1),p=B(H.POSTGRES),v=B("my-abc-db:dev"),f=B(z.STRING),d=B(""),s=Ie({host:"",port:"",username:"",password:"",database:"",sslEnabled:!1,sslMode:oe.DISABLE,sslCA:"",sslCert:"",sslKey:"",sslRejectUnauthorized:!0,sshEnabled:!1,sshHost:"",sshPort:22,sshUsername:"",sshAuthMethod:O.PASSWORD,sshPassword:"",sshPrivateKey:"",sshStoreInKeychain:!0,sshUseKey:!1}),w=B("idle"),h=D=>D&&Pe[D]||"",x=()=>{u.value=1,p.value=H.POSTGRES,v.value="my-abc-db:dev",f.value=z.STRING,d.value="",s.host="",s.port=h(H.POSTGRES),s.username="",s.password="",s.database="",s.sslEnabled=!1,s.sslMode=oe.DISABLE,s.sslCA="",s.sslCert="",s.sslKey="",s.sslRejectUnauthorized=!0,s.sshEnabled=!1,s.sshHost="",s.sshPort=22,s.sshUsername="",s.sshAuthMethod=O.PASSWORD,s.sshPassword="",s.sshPrivateKey="",s.sshStoreInKeychain=!0,s.sshUseKey=!1,w.value="idle"},R=()=>{u.value===1&&p.value&&(u.value=2)},_=()=>{u.value=1,w.value="idle"},m=async()=>{w.value="testing";const D={type:p.value};f.value===z.STRING?D.stringConnection=d.value:(D.host=s.host,D.port=s.port||h(p.value),D.username=s.username,D.password=s.password,D.database=s.database,s.sslEnabled&&(D.ssl={mode:s.sslMode,ca:s.sslCA,cert:s.sslCert,key:s.sslKey,rejectUnauthorized:s.sslRejectUnauthorized}),s.sshEnabled&&(D.ssh={enabled:!0,host:s.sshHost,port:s.sshPort,username:s.sshUsername,authMethod:s.sshUseKey?O.KEY:O.PASSWORD,password:s.sshPassword,privateKey:s.sshPrivateKey,storeInKeychain:s.sshStoreInKeychain,useSshKey:s.sshUseKey}));try{return(await gs.healthCheck(D)).isConnectedSuccess?(w.value="success",!0):(w.value="error",!1)}catch{return w.value="error",!1}},k=async()=>{var E,c;const y=!!!r.value;if(y&&!await m())return;const A={workspaceId:t.value,id:((E=r.value)==null?void 0:E.id)||Ge(),name:v.value,type:p.value,method:f.value,createdAt:((c=r.value)==null?void 0:c.createdAt)||Ke().toISOString()};if(f.value===z.STRING)A.connectionString=d.value;else{A.host=s.host,A.port=s.port||h(p.value),A.username=s.username,A.password=s.password,A.database=s.database,s.sslEnabled&&(A.ssl={mode:s.sslMode,ca:s.sslCA,cert:s.sslCert,key:s.sslKey,rejectUnauthorized:s.sslRejectUnauthorized}),s.sshEnabled&&(A.ssh={enabled:!0,host:s.sshHost,port:s.sshPort,username:s.sshUsername,authMethod:s.sshUseKey?O.KEY:O.PASSWORD,password:s.sshPassword,privateKey:s.sshPrivateKey,storeInKeychain:s.sshStoreInKeychain,useSshKey:s.sshUseKey});const C=p.value===H.POSTGRES?"postgresql":"mysql";A.connectionString=`${C}://${s.username}:${s.password}@${s.host}:${A.port}/${s.database}`}y?o.onAddNew(A):o.onUpdate(A),o.onClose()},ee=()=>{switch(p.value){case H.POSTGRES:return"postgresql://username:password@localhost:5432/database";case H.MYSQL:case H.MYSQL2:return"mysql://username:password@localhost:3306/database";default:return""}},j=I(()=>v.value?f.value===z.STRING?!!d.value:!!(s.host&&(s.port||h(p.value))&&s.username&&s.database):!1);return de(p,D=>{D&&!r.value&&(s.port=h(D))}),de(()=>[l.value,r.value],()=>{var D;if(l.value)if(r.value){const y=r.value;v.value=y.name,p.value=y.type,f.value=y.method,d.value=y.connectionString||"",s.host=y.host||"",s.port=y.port||"",s.username=y.username||"",s.password=y.password||"",s.database=y.database||"",s.sslEnabled=!!y.ssl,y.ssl&&(s.sslMode=y.ssl.mode,s.sslCA=y.ssl.ca||"",s.sslCert=y.ssl.cert||"",s.sslKey=y.ssl.key||"",s.sslRejectUnauthorized=y.ssl.rejectUnauthorized??!0),s.sshEnabled=!!((D=y.ssh)!=null&&D.enabled),y.ssh&&(s.sshHost=y.ssh.host||"",s.sshPort=y.ssh.port||22,s.sshUsername=y.ssh.username||"",s.sshAuthMethod=y.ssh.authMethod||O.PASSWORD,s.sshPassword=y.ssh.password||"",s.sshPrivateKey=y.ssh.privateKey||"",s.sshStoreInKeychain=y.ssh.storeInKeychain??!0,s.sshUseKey=y.ssh.useSshKey??y.ssh.authMethod===O.KEY),u.value=2}else x()},{immediate:!0}),{step:u,dbType:p,connectionName:v,connectionMethod:f,connectionString:d,formData:s,testStatus:w,handleNext:R,handleBack:_,handleTestConnection:m,handleCreateConnection:k,getDefaultPort:()=>h(p.value),getConnectionPlaceholder:ee,isFormValid:j,resetForm:x}}function W(o){const l=B(!1);return{isDragging:l,onDragOver:p=>{p.preventDefault(),l.value=!0},onDragLeave:()=>{l.value=!1},onDrop:async p=>{var s;p.preventDefault(),l.value=!1;const v=(s=p.dataTransfer)==null?void 0:s.files;if(!v||v.length===0)return;const f=v[0],d=new FileReader;d.onload=w=>{var x;const h=(x=w.target)==null?void 0:x.result;o&&o(h)},d.readAsText(f)}}}const hs={class:"flex items-center gap-2"},bs={class:"flex items-center justify-between"},_s={class:"grid grid-cols-4 gap-4"},Ds={class:"col-span-3 space-y-2"},Cs={class:"space-y-2"},Ss={class:"grid grid-cols-2 gap-4"},ws={class:"space-y-2"},xs={class:"space-y-2"},Vs={class:"relative"},ks=["aria-label"],$s={class:"flex items-center gap-2"},As={class:"space-y-4 pt-2 border-t"},Es={class:"flex items-center gap-2"},Is={key:0,class:"space-y-2"},Ps=$({__name:"ConnectionSSHTunnel",props:{formData:{}},setup(o){const l=o,{onDragOver:r,onDragLeave:t,onDrop:u,isDragging:p}=W(f=>{l.formData.sshPrivateKey=f}),v=B(!1);return(f,d)=>(b(),V(e(De),{value:"ssh"},{default:n(()=>[a(e(Ce),{class:"hover:no-underline"},{default:n(()=>[i("div",hs,[a(e(P),{name:"lucide:terminal",class:"size-4 text-primary"}),d[9]||(d[9]=i("span",null,"SSH Tunnel",-1))])]),_:1}),a(e(_e),{class:"space-y-4 pt-4 px-1"},{default:n(()=>[i("div",bs,[a(e(S),{for:"ssh-enabled"},{default:n(()=>d[10]||(d[10]=[g("Over SSH")])),_:1}),a(e(ve),{id:"ssh-enabled","model-value":f.formData.sshEnabled,"onUpdate:modelValue":d[0]||(d[0]=s=>f.formData.sshEnabled=s)},null,8,["model-value"])]),f.formData.sshEnabled?(b(),U(J,{key:0},[i("div",_s,[i("div",Ds,[a(e(S),{for:"ssh-host"},{default:n(()=>d[11]||(d[11]=[g("Server")])),_:1}),a(e(K),{id:"ssh-host",placeholder:"e.g. ssh.example.com or 1.2.3.4",modelValue:f.formData.sshHost,"onUpdate:modelValue":d[1]||(d[1]=s=>f.formData.sshHost=s)},null,8,["modelValue"])]),i("div",Cs,[a(e(S),{for:"ssh-port"},{default:n(()=>d[12]||(d[12]=[g("Port")])),_:1}),a(e(K),{id:"ssh-port",type:"number",placeholder:"22",modelValue:f.formData.sshPort,"onUpdate:modelValue":d[2]||(d[2]=s=>f.formData.sshPort=s)},null,8,["modelValue"])])]),i("div",Ss,[i("div",ws,[a(e(S),{for:"ssh-user"},{default:n(()=>d[13]||(d[13]=[g("User")])),_:1}),a(e(K),{id:"ssh-user",placeholder:"e.g. root or ubuntu",modelValue:f.formData.sshUsername,"onUpdate:modelValue":d[3]||(d[3]=s=>f.formData.sshUsername=s)},null,8,["modelValue"])]),i("div",xs,[a(e(S),{for:"ssh-password"},{default:n(()=>d[14]||(d[14]=[g("Password")])),_:1}),i("div",Vs,[a(e(K),{id:"ssh-password",type:e(v)?"text":"password",placeholder:"SSH password (optional if using key)",modelValue:f.formData.sshPassword,"onUpdate:modelValue":d[4]||(d[4]=s=>f.formData.sshPassword=s),class:"pr-8"},null,8,["type","modelValue"]),i("button",{type:"button",class:"absolute right-2 top-1/2 h-4 cursor-pointer -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:d[5]||(d[5]=s=>v.value=!e(v)),"aria-label":e(v)?"Hide password":"Show password"},[a(e(P),{name:e(v)?"hugeicons:view":"hugeicons:view-off",class:"size-4!"},null,8,["name"])],8,ks)])])]),i("div",$s,[a(e(ie),{id:"ssh-keychain","model-value":f.formData.sshStoreInKeychain,"onUpdate:modelValue":d[6]||(d[6]=s=>f.formData.sshStoreInKeychain=s)},null,8,["model-value"]),a(e(S),{for:"ssh-keychain",class:"text-sm font-normal"},{default:n(()=>d[15]||(d[15]=[g("Store in keychain")])),_:1})]),i("div",As,[i("div",Es,[a(e(ie),{id:"ssh-use-key","model-value":f.formData.sshUseKey,"onUpdate:modelValue":d[7]||(d[7]=s=>f.formData.sshUseKey=s)},null,8,["model-value"]),a(e(S),{for:"ssh-use-key",class:"text-sm font-semibold"},{default:n(()=>d[16]||(d[16]=[g("SSH Key Authentication")])),_:1})]),f.formData.sshUseKey?(b(),U("div",Is,[a(e(S),{for:"ssh-key-file"},{default:n(()=>d[17]||(d[17]=[g("Private Key")])),_:1}),a(e(Y),{id:"ssh-key-file",modelValue:f.formData.sshPrivateKey,"onUpdate:modelValue":d[8]||(d[8]=s=>f.formData.sshPrivateKey=s),placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----\\n...\\n-----END OPENSSH PRIVATE KEY-----",class:q(["min-h-[100px] max-h-[200px] text-xs font-mono",e(p)?"ring-2 ring-primary":""]),onDragover:e(r),onDragleave:e(t),onDrop:e(u)},null,8,["modelValue","class","onDragover","onDragleave","onDrop"]),d[18]||(d[18]=i("p",{class:"text-xs text-muted-foreground"}," Drop a .pem / .key file here, or paste the SSH private key content ",-1))])):N("",!0)])],64)):N("",!0)]),_:1})]),_:1}))}}),Ks={class:"flex items-center gap-2"},Rs={class:"flex items-center justify-between"},Us={class:"space-y-2"},Ts={class:"space-y-4"},Os={class:"space-y-2"},Bs={class:"space-y-2"},qs={class:"space-y-2"},Ns=$({__name:"ConnectionSSLConfig",props:{formData:{}},setup(o){const l=o,{onDragOver:r,onDragLeave:t,onDrop:u,isDragging:p}=W(_=>{l.formData.sslCA=_}),{onDragOver:v,onDragLeave:f,onDrop:d,isDragging:s}=W(_=>{l.formData.sslCert=_}),{onDragOver:w,onDragLeave:h,onDrop:x,isDragging:R}=W(_=>{l.formData.sslKey=_});return(_,m)=>(b(),V(e(De),{value:"ssl"},{default:n(()=>[a(e(Ce),{class:"hover:no-underline"},{default:n(()=>[i("div",Ks,[a(e(P),{name:"hugeicons:security-check",class:"size-4 text-primary"}),m[5]||(m[5]=i("span",null,"SSL Configuration",-1))])]),_:1}),a(e(_e),{class:"space-y-4 pt-4 px-1"},{default:n(()=>[i("div",Rs,[a(e(S),{for:"ssl-enabled"},{default:n(()=>m[6]||(m[6]=[g("Enable SSL")])),_:1}),a(e(ve),{id:"ssl-enabled","model-value":_.formData.sslEnabled,"onUpdate:modelValue":m[0]||(m[0]=k=>_.formData.sslEnabled=k)},null,8,["model-value"])]),_.formData.sslEnabled?(b(),U(J,{key:0},[i("div",Us,[a(e(S),{for:"ssl-mode"},{default:n(()=>m[7]||(m[7]=[g("SSL Mode")])),_:1}),a(e(Re),{modelValue:_.formData.sslMode,"onUpdate:modelValue":m[1]||(m[1]=k=>_.formData.sslMode=k)},{default:n(()=>[a(e(Ue),{id:"ssl-mode"},{default:n(()=>[a(e(Te),{placeholder:"Select mode"})]),_:1}),a(e(Oe),null,{default:n(()=>[a(e(F),{value:"disable"},{default:n(()=>m[8]||(m[8]=[g("Disable")])),_:1}),a(e(F),{value:"preferred"},{default:n(()=>m[9]||(m[9]=[g("Preferred")])),_:1}),a(e(F),{value:"require"},{default:n(()=>m[10]||(m[10]=[g("Require")])),_:1}),a(e(F),{value:"verify-ca"},{default:n(()=>m[11]||(m[11]=[g("Verify CA")])),_:1}),a(e(F),{value:"verify-full"},{default:n(()=>m[12]||(m[12]=[g("Verify Full")])),_:1})]),_:1})]),_:1},8,["modelValue"])]),i("div",Ts,[i("div",Os,[a(e(S),{for:"ssl-ca"},{default:n(()=>m[13]||(m[13]=[g("CA Certificate")])),_:1}),a(e(Y),{id:"ssl-ca",modelValue:_.formData.sslCA,"onUpdate:modelValue":m[2]||(m[2]=k=>_.formData.sslCA=k),placeholder:"-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----",class:q(["min-h-[80px] max-h-[160px] text-xs font-mono",e(p)?"ring-2 ring-primary":""]),onDragover:e(r),onDragleave:e(t),onDrop:e(u)},null,8,["modelValue","class","onDragover","onDragleave","onDrop"]),m[14]||(m[14]=i("p",{class:"text-xs text-muted-foreground"}," Drop a .pem / .crt file here, or paste the CA certificate content ",-1))]),i("div",Bs,[a(e(S),{for:"ssl-cert"},{default:n(()=>m[15]||(m[15]=[g("Client Certificate")])),_:1}),a(e(Y),{id:"ssl-cert",modelValue:_.formData.sslCert,"onUpdate:modelValue":m[3]||(m[3]=k=>_.formData.sslCert=k),placeholder:"-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----",class:q(["min-h-[80px] max-h-[160px] text-xs font-mono",e(s)?"ring-2 ring-primary":""]),onDragover:e(v),onDragleave:e(f),onDrop:e(d)},null,8,["modelValue","class","onDragover","onDragleave","onDrop"]),m[16]||(m[16]=i("p",{class:"text-xs text-muted-foreground"}," Drop a .pem / .crt file here, or paste the client certificate content ",-1))]),i("div",qs,[a(e(S),{for:"ssl-key"},{default:n(()=>m[17]||(m[17]=[g("SSL Key")])),_:1}),a(e(Y),{id:"ssl-key",modelValue:_.formData.sslKey,"onUpdate:modelValue":m[4]||(m[4]=k=>_.formData.sslKey=k),placeholder:"-----BEGIN RSA PRIVATE KEY-----\\n...\\n-----END RSA PRIVATE KEY-----",class:q(["min-h-[80px] max-h-[160px] text-xs font-mono",e(R)?"ring-2 ring-primary":""]),onDragover:e(w),onDragleave:e(h),onDrop:e(x)},null,8,["modelValue","class","onDragover","onDragleave","onDrop"]),m[18]||(m[18]=i("p",{class:"text-xs text-muted-foreground"}," Drop a .pem / .key file here, or paste the private key content ",-1))])])],64)):N("",!0)]),_:1})]),_:1}))}}),Hs={key:0,class:"flex items-center gap-2 rounded-md border p-3 text-sm"},zs={key:1,class:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 p-3 text-sm text-green-600 dark:border-green-900 dark:bg-green-950/50 dark:text-green-400"},Fs={key:2,class:"flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-600 dark:border-red-900 dark:bg-red-950/50 dark:text-red-400"},Ms=$({__name:"ConnectionStatusSection",props:{testStatus:{}},setup(o){return(l,r)=>(b(),U(J,null,[l.testStatus==="testing"?(b(),U("div",Hs,[a(e(P),{name:"hugeicons:loading-03",class:"animate-spin size-5!"}),r[0]||(r[0]=i("span",null,"Testing connection...",-1))])):N("",!0),l.testStatus==="success"?(b(),U("div",zs,[a(e(P),{name:"hugeicons:checkmark-circle-02",class:"shrink-0 size-4"}),r[1]||(r[1]=i("span",null,"Connection successful! Your database is ready to use.",-1))])):N("",!0),l.testStatus==="error"?(b(),U("div",Fs,[a(e(P),{name:"hugeicons:cancel-01",class:"shrink-0 size-4"}),r[2]||(r[2]=i("span",null,"Connection failed. Please check your details and try again.",-1))])):N("",!0)],64))}}),js={class:"flex flex-col items-center gap-1.5 text-center"},Ls=$({__name:"DatabaseTypeCard",props:{name:{},icon:{},selected:{type:Boolean},isSupport:{type:Boolean},iconClass:{}},setup(o){return(l,r)=>(b(),V(e(Je),{class:q(e(L)("relative",l.isSupport?"cursor-pointer":"opacity-90 cursor-not-allowed ",l.selected&&l.isSupport?"border-muted-foreground shadow-lg":"border-transparent bg-background"))},{default:n(()=>[a(e(Xe),{class:"flex flex-col items-center justify-center p-0 w-full"},{default:n(()=>[i("div",{class:q(e(L)("flex items-center justify-center rounded-xl p-2 transition-transform duration-300",l.selected&&l.isSupport?"scale-105":"group-hover:scale-105",!l.isSupport&&"opacity-40"))},[(b(),V(Be(l.icon),{class:q(e(L)("size-12",l.iconClass))},null,8,["class"]))],2),i("div",js,[i("span",{class:q(e(L)("text-sm font-medium tracking-tight transition-colors",l.selected&&l.isSupport?"text-primary":"text-foreground/70",!l.isSupport&&"text-muted-foreground"))},G(l.name),3),l.isSupport?N("",!0):(b(),V(e(qe),{key:0,variant:"secondary",class:"text-[9px] px-1.5 py-0 h-3.5 uppercase tracking-widest font-bold opacity-60"},{default:n(()=>r[0]||(r[0]=[g(" Soon ")])),_:1}))])]),_:1})]),_:1},8,["class"]))}}),Gs={class:"flex flex-col h-full overflow-hidden"},Ys={class:"flex-1 overflow-y-auto p-6"},Ws={id:"tour-database-type-cards",class:"grid grid-cols-3 gap-4 py-4"},Qs=$({__name:"ConnectionStepType",props:{databaseOptions:{},dbType:{}},emits:["next","close"],setup(o,{emit:l}){const r=t=>{t.isSupport&&t.onClick()};return(t,u)=>{const p=P;return b(),U("div",Gs,[a(e(ge),{class:"p-6"},{default:n(()=>[a(e(ye),null,{default:n(()=>u[2]||(u[2]=[g("Select Database Type")])),_:1}),a(e(he),null,{default:n(()=>u[3]||(u[3]=[g("Choose the type of database you want to connect to")])),_:1})]),_:1}),i("div",Ys,[i("div",Ws,[(b(!0),U(J,null,Ne(t.databaseOptions,v=>(b(),V(Ls,{key:v.type,name:v.name,icon:v.icon,selected:v.isActive,onClick:()=>r(v),isSupport:v.isSupport,iconClass:"size-14!"},null,8,["name","icon","selected","onClick","isSupport"]))),128))])]),a(e(be),{class:"p-6 flex items-center justify-end gap-2"},{default:n(()=>[a(e(M),{variant:"outline",onClick:u[0]||(u[0]=v=>t.$emit("close")),size:"sm"},{default:n(()=>u[4]||(u[4]=[g(" Cancel ")])),_:1}),a(e(M),{id:"tour-database-type-next",onClick:u[1]||(u[1]=v=>t.$emit("next")),disabled:!t.dbType,size:"sm"},{default:n(()=>[u[5]||(u[5]=g(" Next ")),a(p,{name:"hugeicons:arrow-right-02"})]),_:1},8,["disabled"])]),_:1})])}}}),Zs={key:1,class:"flex flex-col h-full overflow-hidden"},Js={class:"flex-1 overflow-y-auto p-4 space-y-4"},Xs={class:"space-y-2 mt-2"},ea={class:"space-y-2"},sa={class:"text-xs text-muted-foreground"},aa={class:"space-y-4"},ta={class:"grid grid-cols-4 gap-2"},oa={class:"col-span-3 space-y-2"},na={class:"space-y-2"},la={class:"grid grid-cols-2 gap-2"},ra={class:"space-y-2"},da={class:"space-y-2"},ia={class:"relative"},ua=["aria-label"],pa={class:"space-y-2"},ca={class:"space-y-4"},fa={class:"flex flex-1 space-x-2"},ma={class:"flex space-x-2"},Sa=$({__name:"CreateConnectionModal",props:{open:{type:Boolean},editingConnection:{},workspaceId:{}},emits:["update:open","addNew","update"],setup(o,{emit:l}){const r=o,t=l,u=()=>{t("update:open",!1),setTimeout(y,300)},p=B(!1),{step:v,dbType:f,connectionName:d,connectionMethod:s,connectionString:w,formData:h,testStatus:x,handleNext:R,handleBack:_,handleTestConnection:m,handleCreateConnection:k,getDefaultPort:ee,getConnectionPlaceholder:j,isFormValid:D,resetForm:y}=ys({open:()=>r.open,editingConnection:()=>r.editingConnection,workspaceId:()=>r.workspaceId,onAddNew:E=>t("addNew",E),onUpdate:E=>t("update",E),onClose:u}),A=I(()=>Fe.map(E=>({...E,isActive:f.value===E.type,onClick:()=>f.value=E.type})));return(E,c)=>(b(),V(e(He),{open:E.open,"onUpdate:open":c[9]||(c[9]=C=>E.$emit("update:open",C))},{default:n(()=>[a(e(ze),{class:"max-w-[50vw]! w-full h-[60vh]! max-h-[90vh] p-0 flex flex-col overflow-hidden"},{default:n(()=>[e(v)===1?(b(),V(Qs,{key:0,"database-options":A.value,"db-type":e(f),onNext:e(R),onClose:u},null,8,["database-options","db-type","onNext"])):(b(),U("div",Zs,[a(e(ge),{class:"p-6 pb-2"},{default:n(()=>[a(e(ye),null,{default:n(()=>c[10]||(c[10]=[g("Connection Details")])),_:1}),a(e(he),null,{default:n(()=>[g(" Enter the details for your "+G(e(f))+" database ",1)]),_:1})]),_:1}),i("div",Js,[a(e(je),{modelValue:e(s),"onUpdate:modelValue":c[8]||(c[8]=C=>ae(s)?s.value=C:null),class:"w-full"},{default:n(()=>[a(e(Le),{class:"grid w-fit grid-cols-2",id:"tour-connection-method-tabs"},{default:n(()=>[a(e(ue),{value:"string",class:"cursor-pointer"},{default:n(()=>c[11]||(c[11]=[i("span",{id:"tour-connection-string-tab"}," Connection String ",-1)])),_:1}),a(e(ue),{value:"form",class:"cursor-pointer"},{default:n(()=>c[12]||(c[12]=[i("span",{id:"tour-connection-form-tab"}," Connection Form ",-1)])),_:1})]),_:1}),i("div",Xs,[a(e(S),{for:"connection-name",class:"flex items-center gap-2"},{default:n(()=>[a(e(P),{name:"hugeicons:database",class:"h-3.5 w-3.5 text-muted-foreground"}),c[13]||(c[13]=g(" Connection Name ")),c[14]||(c[14]=i("span",{class:"text-destructive"},"*",-1))]),_:1}),a(e(K),{id:"connection-name",placeholder:"My Database Connection",modelValue:e(d),"onUpdate:modelValue":c[0]||(c[0]=C=>ae(d)?d.value=C:null)},null,8,["modelValue"])]),a(e(pe),{value:"string",class:"space-y-4 pt-4"},{default:n(()=>[i("div",ea,[a(e(S),{for:"connection-string",class:"flex items-center gap-2"},{default:n(()=>[a(e(P),{name:"hugeicons:connect",class:"h-3.5 w-3.5 text-muted-foreground"}),c[15]||(c[15]=g(" Connection String ")),c[16]||(c[16]=i("span",{class:"text-destructive"},"*",-1))]),_:1}),a(e(K),{id:"connection-string",placeholder:e(j)(),modelValue:e(w),"onUpdate:modelValue":c[1]||(c[1]=C=>ae(w)?w.value=C:null),class:"font-mono text-sm"},null,8,["placeholder","modelValue"]),i("p",sa," Example: "+G(e(j)()),1)])]),_:1}),a(e(pe),{value:"form",class:"space-y-6 pt-2"},{default:n(()=>[i("div",aa,[i("div",ta,[i("div",oa,[a(e(S),{for:"host"},{default:n(()=>c[17]||(c[17]=[g("Host "),i("span",{class:"text-destructive"},"*",-1)])),_:1}),a(e(K),{id:"host",placeholder:"localhost",modelValue:e(h).host,"onUpdate:modelValue":c[2]||(c[2]=C=>e(h).host=C)},null,8,["modelValue"])]),i("div",na,[a(e(S),{for:"port"},{default:n(()=>c[18]||(c[18]=[g("Port "),i("span",{class:"text-destructive"},"*",-1)])),_:1}),a(e(K),{id:"port",placeholder:e(ee)(),modelValue:e(h).port,"onUpdate:modelValue":c[3]||(c[3]=C=>e(h).port=C)},null,8,["placeholder","modelValue"])])]),i("div",la,[i("div",ra,[a(e(S),{for:"username"},{default:n(()=>c[19]||(c[19]=[g("User "),i("span",{class:"text-destructive"},"*",-1)])),_:1}),a(e(K),{id:"username",placeholder:"username",modelValue:e(h).username,"onUpdate:modelValue":c[4]||(c[4]=C=>e(h).username=C)},null,8,["modelValue"])]),i("div",da,[a(e(S),{for:"password"},{default:n(()=>c[20]||(c[20]=[g("Password")])),_:1}),i("div",ia,[a(e(K),{id:"password",type:e(p)?"text":"password",placeholder:"••••••••",modelValue:e(h).password,"onUpdate:modelValue":c[5]||(c[5]=C=>e(h).password=C),class:"pr-8"},null,8,["type","modelValue"]),i("button",{type:"button",class:"absolute right-2 top-1/2 h-5 cursor-pointer -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:c[6]||(c[6]=C=>p.value=!e(p)),"aria-label":e(p)?"Hide password":"Show password"},[a(e(P),{name:e(p)?"hugeicons:view":"hugeicons:view-off",class:"size-4!"},null,8,["name"])],8,ua)])])]),i("div",pa,[a(e(S),{for:"database"},{default:n(()=>c[21]||(c[21]=[g("Database "),i("span",{class:"text-destructive"},"*",-1)])),_:1}),a(e(K),{id:"database",placeholder:"my_database",modelValue:e(h).database,"onUpdate:modelValue":c[7]||(c[7]=C=>e(h).database=C)},null,8,["modelValue"])])]),i("div",ca,[a(e(ce),{type:"single",collapsible:"",class:"w-full border px-4 rounded-lg shadow"},{default:n(()=>[a(Ns,{"form-data":e(h)},null,8,["form-data"])]),_:1}),a(e(ce),{type:"single",collapsible:"",class:"w-full border px-4 rounded-lg shadow"},{default:n(()=>[a(Ps,{"form-data":e(h)},null,8,["form-data"])]),_:1})])]),_:1})]),_:1},8,["modelValue"]),a(Ms,{"test-status":e(x)},null,8,["test-status"])]),a(e(be),{class:"p-6 pt-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-between sm:space-x-2"},{default:n(()=>[i("div",fa,[a(e(M),{variant:"outline",onClick:e(_),size:"sm"},{default:n(()=>[a(e(P),{name:"hugeicons:arrow-left-02"}),c[22]||(c[22]=g(" Back "))]),_:1},8,["onClick"])]),i("div",ma,[a(e(M),{variant:"outline",onClick:e(m),size:"sm",disabled:e(x)==="testing"||!e(D)},{default:n(()=>[e(x)==="testing"?(b(),V(e(P),{key:0,name:"hugeicons:loading-03",class:"mr-2 size-4 animate-spin"})):N("",!0),c[23]||(c[23]=g(" Test "))]),_:1},8,["onClick","disabled"]),a(e(M),{id:"tour-create-update-connection-btn",onClick:e(k),size:"sm",disabled:e(x)==="testing"||!e(D)},{default:n(()=>[g(G(E.editingConnection?"Update":"Create"),1)]),_:1},8,["onClick","disabled"])])]),_:1})]))]),_:1})]),_:1},8,["open"]))}});export{Sa as _};
@@ -0,0 +1,4 @@
1
+ import{_ as X,an as j,ao as F,ap as Y,aq as H,l as i,c as V,ar as q,as as U,ai as $,at as z,aj as P,ah as K,au as Q,av as W,aw as Z}from"./D4jn2f-6.js";import{i as x,G as B}from"./qsFoMdT2.js";import{b as L,m as A,l as I}from"./CQb_mUBo.js";import"./BM4vnZvX.js";var ee=4;function ne(e){return L(e,ee)}function p(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:te(e),edges:se(e)};return x(e.graph())||(t.value=ne(e.graph())),t}function te(e){return A(e.nodes(),function(t){var n=e.node(t),o=e.parent(t),c={v:t};return x(n)||(c.value=n),x(o)||(c.parent=o),c})}function se(e){return A(e.edges(),function(t){var n=e.edge(t),o={v:t.v,w:t.w};return x(t.name)||(o.name=t.name),x(n)||(o.value=n),o})}var f=new Map,b=new Map,G=new Map,ie=X(()=>{b.clear(),G.clear(),f.clear()},"clear"),O=X((e,t)=>{const n=b.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),re=X((e,t)=>{const n=b.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),J=X((e,t,n,o)=>{i.warn("Copying children of ",e,"root",o,"data",t.node(e),o);const c=t.children(e)||[];e!==o&&c.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",c),c.forEach(a=>{if(t.children(a).length>0)J(a,t,n,o);else{const r=t.node(a);i.info("cp ",a," to ",o," with parent ",e),n.setNode(a,r),o!==t.parent(a)&&(i.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==o&&a!==e?(i.debug("Setting parent",a,e),n.setParent(a,e)):(i.info("In copy ",e,"root",o,"data",t.node(e),o),i.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==o,"node!==clusterId",a!==e));const u=t.edges(a);i.debug("Copying Edges",u),u.forEach(l=>{i.info("Edge",l);const h=t.edge(l.v,l.w,l.name);i.info("Edge data",h,o);try{re(l,o)?(i.info("Copying as ",l.v,l.w,h,l.name),n.setEdge(l.v,l.w,h,l.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",o," clusterId:",e)}catch(C){i.error(C)}})}i.debug("Removing node",a),t.removeNode(a)})},"copy"),R=X((e,t)=>{const n=t.children(e);let o=[...n];for(const c of n)G.set(c,e),o=[...o,...R(c,t)];return o},"extractDescendants"),oe=X((e,t,n)=>{const o=e.edges().filter(l=>l.v===t||l.w===t),c=e.edges().filter(l=>l.v===n||l.w===n),a=o.map(l=>({v:l.v===t?n:l.v,w:l.w===t?t:l.w})),r=c.map(l=>({v:l.v,w:l.w}));return a.filter(l=>r.some(h=>l.v===h.v&&l.w===h.w))},"findCommonEdges"),D=X((e,t,n)=>{const o=t.children(e);if(i.trace("Searching children of id ",e,o),o.length<1)return e;let c;for(const a of o){const r=D(a,t,n),u=oe(t,n,r);if(r)if(u.length>0)c=r;else return r}return c},"findNonClusterChild"),k=X(e=>!f.has(e)||!f.get(e).externalConnections?e:f.has(e)?f.get(e).id:e,"getAnchorId"),ae=X((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),b.set(n,R(n,e)),f.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const o=e.children(n),c=e.edges();o.length>0?(i.debug("Cluster identified",n,b),c.forEach(a=>{const r=O(a.v,n),u=O(a.w,n);r^u&&(i.warn("Edge: ",a," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",b.get(n)),f.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,b)});for(let n of f.keys()){const o=f.get(n).id,c=e.parent(o);c!==n&&f.has(c)&&!f.get(c).externalConnections&&(f.get(n).id=c)}e.edges().forEach(function(n){const o=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let c=n.v,a=n.w;if(i.warn("Fix XXX",f,"ids:",n.v,n.w,"Translating: ",f.get(n.v)," --- ",f.get(n.w)),f.get(n.v)||f.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),c=k(n.v),a=k(n.w),e.removeEdge(n.v,n.w,n.name),c!==n.v){const r=e.parent(c);f.get(r).externalConnections=!0,o.fromCluster=n.v}if(a!==n.w){const r=e.parent(a);f.get(r).externalConnections=!0,o.toCluster=n.w}i.warn("Fix Replacing with XXX",c,a,n.name),e.setEdge(c,a,o,n.name)}}),i.warn("Adjusted Graph",p(e)),T(e,0),i.trace(f)},"adjustClustersAndEdges"),T=X((e,t)=>{var c,a;if(i.warn("extractor - ",t,p(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),o=!1;for(const r of n){const u=e.children(r);o=o||u.length>0}if(!o){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,f,f.has(r)&&!f.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!f.has(r))i.debug("Not a cluster",r,t);else if(!f.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";(a=(c=f.get(r))==null?void 0:c.clusterData)!=null&&a.dir&&(l=f.get(r).clusterData.dir,i.warn("Fixing dir",f.get(r).clusterData.dir,l));const h=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",p(e)),J(r,e,h,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:f.get(r).clusterData,label:f.get(r).label,graph:h}),i.warn("New graph after copy node: (",r,")",p(h)),i.debug("Old graph after copy",p(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!f.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(f);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const u=e.node(r);i.warn(" Now next level",r,u),u!=null&&u.clusterNode&&T(u.graph,t+1)}},"extractor"),M=X((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(o=>{const c=e.children(o),a=M(e,c);n=[...n,...a]}),n},"sorter"),ce=X(e=>M(e,e.children()),"sortNodesByHierarchy"),_=X(async(e,t,n,o,c,a)=>{i.warn("Graph in recursive render:XAX",p(t),c);const r=t.graph().rankdir;i.trace("Dir in recursive render - dir:",r);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const l=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),C=u.insert("g").attr("class","edgeLabels"),g=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(d){const s=t.node(d);if(c!==void 0){const w=JSON.parse(JSON.stringify(c.clusterData));i.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,d,`
3
+ data=`,w.height,`
4
+ Parent cluster`,c.height),t.setNode(c.id,w),t.parent(d)||(i.trace("Setting parent",d,c.id),t.setParent(d,c.id,w))}if(i.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),s!=null&&s.clusterNode){i.info("Cluster identified XBX",d,s.width,t.node(d));const{ranksep:w,nodesep:m}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:w+25,nodesep:m});const N=await _(g,s.graph,n,o,t.node(d),a),S=N.elem;q(s,S),s.diff=N.diff||0,i.info("New compound node after recursive render XAX",d,"width",s.width,"height",s.height),U(S,s)}else t.children(d).length>0?(i.trace("Cluster - the non recursive path XBX",d,s.id,s,s.width,"Graph:",t),i.trace(D(s.id,t)),f.set(s.id,{id:D(s.id,t),node:s})):(i.trace("Node - the non recursive path XAX",d,g,t.node(d),r),await $(g,t.node(d),{config:a,dir:r}))})),await X(async()=>{const d=t.edges().map(async function(s){const w=t.edge(s.v,s.w,s.name);i.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),i.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),i.info("Fix",f,"ids:",s.v,s.w,"Translating: ",f.get(s.v),f.get(s.w)),await Z(C,w)});await Promise.all(d)},"processEdges")(),i.info("Graph before layout:",JSON.stringify(p(t))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),I(t),i.info("Graph after layout:",JSON.stringify(p(t)));let E=0,{subGraphTitleTotalMargin:y}=z(a);return await Promise.all(ce(t).map(async function(d){var w;const s=t.node(d);if(i.info("Position XBX => "+d+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s!=null&&s.clusterNode)s.y+=y,i.info("A tainted cluster node XBX1",d,s.id,s.width,s.height,s.x,s.y,t.parent(d)),f.get(s.id).node=s,P(s);else if(t.children(d).length>0){i.info("A pure cluster node XBX1",d,s.id,s.x,s.y,s.width,s.height,t.parent(d)),s.height+=y,t.node(s.parentId);const m=(s==null?void 0:s.padding)/2||0,N=((w=s==null?void 0:s.labelBBox)==null?void 0:w.height)||0,S=N-m||0;i.debug("OffsetY",S,"labelHeight",N,"halfPadding",m),await K(l,s),f.get(s.id).node=s}else{const m=t.node(s.parentId);s.y+=y/2,i.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",m,m==null?void 0:m.offsetY,s),P(s)}})),t.edges().forEach(function(d){const s=t.edge(d);i.info("Edge "+d.v+" -> "+d.w+": "+JSON.stringify(s),s),s.points.forEach(S=>S.y+=y/2);const w=t.node(d.v);var m=t.node(d.w);const N=Q(h,s,f,n,w,m,o);W(s,N)}),t.nodes().forEach(function(d){const s=t.node(d);i.info(d,s.type,s.diff),s.isGroup&&(E=s.diff)}),i.warn("Returning from recursive render XAX",u,E),{elem:u,diff:E}},"recursiveRender"),ge=X(async(e,t)=>{var a,r,u,l,h,C;const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((a=e.config)==null?void 0:a.nodeSpacing)||((u=(r=e.config)==null?void 0:r.flowchart)==null?void 0:u.nodeSpacing)||e.nodeSpacing,ranksep:((l=e.config)==null?void 0:l.rankSpacing)||((C=(h=e.config)==null?void 0:h.flowchart)==null?void 0:C.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),o=t.select("g");j(o,e.markers,e.type,e.diagramId),F(),Y(),H(),ie(),e.nodes.forEach(g=>{n.setNode(g.id,{...g}),g.parentId&&n.setParent(g.id,g.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(g=>{if(g.start===g.end){const v=g.start,E=v+"---"+v+"---1",y=v+"---"+v+"---2",d=n.node(v);n.setNode(E,{domId:E,id:E,parentId:d.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(E,d.parentId),n.setNode(y,{domId:y,id:y,parentId:d.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(y,d.parentId);const s=structuredClone(g),w=structuredClone(g),m=structuredClone(g);s.label="",s.arrowTypeEnd="none",s.id=v+"-cyclic-special-1",w.arrowTypeStart="none",w.arrowTypeEnd="none",w.id=v+"-cyclic-special-mid",m.label="",d.isGroup&&(s.fromCluster=v,m.toCluster=v),m.id=v+"-cyclic-special-2",m.arrowTypeStart="none",n.setEdge(v,E,s,v+"-cyclic-special-0"),n.setEdge(E,y,w,v+"-cyclic-special-1"),n.setEdge(y,v,m,v+"-cyc<lic-special-2")}else n.setEdge(g.start,g.end,{...g},g.id)}),i.warn("Graph at first:",JSON.stringify(p(n))),ae(n),i.warn("Graph after XAX:",JSON.stringify(p(n)));const c=V();await _(o,n,e.type,e.diagramId,void 0,c)},"render");export{ge as render};
@@ -0,0 +1 @@
1
+ import{d as ne,r as k,ad as ie,c as h,m as D,C as e,F as Y,h as b,A as re,w as V,i as M,t as _,u as n,j as ae,n as pe,o as B,cp as Ie,aP as we,p as ue,L as be,cq as ke,cr as Pe,cs as Oe,ct as Be,g as W,aE as fe,O as Ce,b as Le,a6 as De,aW as Me,aY as Ee,l as de,ah as ce,cu as Ne,G as ze,a9 as Fe,E as He}from"./BM4vnZvX.js";import{_ as Ve,b as je,c as Ge}from"./BNYR501z.js";import{t as P,i as qe,a as Ue,b as Qe,m as Ke,k as We,g as Te,h as Ae,c as Xe,d as ye,e as Ye,f as Je,j as Ze,n as et,l as tt,S as st,o as nt,p as at,_ as $e,q as ot,r as _e,s as it,C as lt,u as rt,v as dt,E as me,w as ct,x as ut,y as pt,z as ft,A as mt,B as gt}from"./DnxDSFih.js";import{f as vt}from"./BKltSiU0.js";import{f as ht}from"./-lZvfnzr.js";import{_ as ve}from"./B_PBOfFN.js";import{b as se,a as bt}from"./BVmBXPoG.js";import{u as yt}from"./DWgjNKGq.js";import"./C2Ziircr.js";import"./CWkPMmwS.js";import"./Bdtn2mn5.js";var xe={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},_t=function(){function t(s){var l=this._condVal=ye(s)?new RegExp(s):Ye(s)?s:null;if(l==null){var f="";P(f)}}return t.prototype.evaluate=function(s){var l=typeof s;return ye(l)?this._condVal.test(s):Je(l)?this._condVal.test(s+""):!1},t}(),xt=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),St=function(){function t(){}return t.prototype.evaluate=function(){for(var s=this.children,l=0;l<s.length;l++)if(!s[l].evaluate())return!1;return!0},t}(),It=function(){function t(){}return t.prototype.evaluate=function(){for(var s=this.children,l=0;l<s.length;l++)if(s[l].evaluate())return!0;return!1},t}(),Ct=function(){function t(){}return t.prototype.evaluate=function(){return!this.child.evaluate()},t}(),Lt=function(){function t(){}return t.prototype.evaluate=function(){for(var s=!!this.valueParser,l=this.getValue,f=l(this.valueGetterParam),r=s?this.valueParser(f):null,v=0;v<this.subCondList.length;v++)if(!this.subCondList[v].evaluate(s?r:f))return!1;return!0},t}();function he(t,s){if(t===!0||t===!1){var l=new xt;return l.value=t,l}var f="";return Re(t)||P(f),t.and?Se("and",t,s):t.or?Se("or",t,s):t.not?Tt(t,s):At(t,s)}function Se(t,s,l){var f=s[t],r="";Qe(f)||P(r),f.length||P(r);var v=t==="and"?new St:new It;return v.children=Ke(f,function(x){return he(x,l)}),v.children.length||P(r),v}function Tt(t,s){var l=t.not,f="";Re(l)||P(f);var r=new Ct;return r.child=he(l,s),r.child||P(f),r}function At(t,s){for(var l="",f=s.prepareGetValue(t),r=[],v=We(t),x=t.parser,C=x?Te(x):null,c=0;c<v.length;c++){var m=v[c];if(!(m==="parser"||s.valueGetterAttrMap.get(m))){var S=Ae(xe,m)?xe[m]:m,$=t[m],L=C?C($):$,I=Xe(S,L)||S==="reg"&&new _t(L);I||P(l),r.push(I)}}r.length||P(l);var u=new Lt;return u.valueGetterParam=f,u.valueParser=C,u.getValue=s.getValue,u.subCondList=r,u}function Re(t){return qe(t)&&!Ue(t)}var $t=function(){function t(s,l){this._cond=he(s,l)}return t.prototype.evaluate=function(){return this._cond.evaluate()},t}();function Rt(t,s){return new $t(t,s)}var wt={type:"echarts:filter",transform:function(t){for(var s=t.upstream,l,f=Rt(t.config,{valueGetterAttrMap:Ze({dimension:!0}),prepareGetValue:function(C){var c="",m=C.dimension;Ae(C,"dimension")||P(c);var S=s.getDimensionInfo(m);return S||P(c),{dimIdx:S.index}},getValue:function(C){return s.retrieveValueFromItem(l,C.dimIdx)}}),r=[],v=0,x=s.count();v<x;v++)l=s.getRawDataItem(v),f.evaluate()&&r.push(l);return{data:r}}},kt={type:"echarts:sort",transform:function(t){var s=t.upstream,l=t.config,f="",r=et(l);r.length||P(f);var v=[];tt(r,function(S){var $=S.dimension,L=S.order,I=S.parser,u=S.incomparable;if($==null&&P(f),L!=="asc"&&L!=="desc"&&P(f),u&&u!=="min"&&u!=="max"){var i="";P(i)}if(L!=="asc"&&L!=="desc"){var o="";P(o)}var T=s.getDimensionInfo($);T||P(f);var R=I?Te(I):null;I&&!R&&P(f),v.push({dimIdx:T.index,parser:R,comparator:new st(L,u)})});var x=s.sourceFormat;x!==nt&&x!==at&&P(f);for(var C=[],c=0,m=s.count();c<m;c++)C.push(s.getRawDataItem(c));return C.sort(function(S,$){for(var L=0;L<v.length;L++){var I=v[L],u=s.retrieveValueFromItem(S,I.dimIdx),i=s.retrieveValueFromItem($,I.dimIdx);I.parser&&(u=I.parser(u),i=I.parser(i));var o=I.comparator.evaluate(u,i);if(o!==0)return o}return 0}),{data:C}}};function Pt(t){t.registerTransform(wt),t.registerTransform(kt)}var Ot=function(t){$e(s,t);function s(){var l=t!==null&&t.apply(this,arguments)||this;return l.type="dataset",l}return s.prototype.init=function(l,f,r){t.prototype.init.call(this,l,f,r),this._sourceManager=new ot(this),_e(this)},s.prototype.mergeOption=function(l,f){t.prototype.mergeOption.call(this,l,f),_e(this)},s.prototype.optionUpdated=function(){this._sourceManager.dirty()},s.prototype.getSourceManager=function(){return this._sourceManager},s.type="dataset",s.defaultOption={seriesLayoutBy:it},s}(lt),Bt=function(t){$e(s,t);function s(){var l=t!==null&&t.apply(this,arguments)||this;return l.type="dataset",l}return s.type="dataset",s}(rt);function Dt(t){t.registerComponentModel(Ot),t.registerComponentView(Bt)}const X=t=>ht(t??0),q=t=>t==null?"0.00/s":`${t.toFixed(2)}/s`,ge=t=>t==null?"0%":`${t.toFixed(2)}%`,le=t=>{if(!t)return"-";const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()},Mt=t=>{if(t==null)return"-";if(t<60)return`${t}s`;const s=Math.floor(t/60),l=t%60;if(s<60)return`${s}m ${l}s`;const f=Math.floor(s/60),r=s%60;return`${f}h ${r}m`},Et=t=>t==null||t<=0?"0 B":vt(t).replace(" bytes"," B"),Nt=t=>{if(!t)return"-";const s=t.replace(/\s+/g," ").trim();return s?s.length>320?`${s.slice(0,320)}...`:s:"-"},zt=t=>(t||"").toLowerCase().includes("idle in transaction"),Ft={class:"space-y-4"},Ht={class:"flex items-center justify-between"},Vt={key:0,class:"border border-red-300 bg-red-50 text-red-700 rounded-lg p-3 text-sm"},jt={class:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2.5"},Gt={class:"h-full border rounded-lg p-2.5 space-y-2"},qt={class:"flex items-center gap-1"},Ut={class:"text-sm font-semibold leading-none tabular-nums"},Qt={class:"grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]"},Kt={class:"text-muted-foreground"},Wt={class:"tabular-nums text-foreground"},Xt={class:"text-muted-foreground"},Yt={class:"tabular-nums text-foreground"},Jt={class:"text-muted-foreground"},Zt={class:"tabular-nums text-foreground"},es={class:"text-muted-foreground"},ts={class:"tabular-nums text-foreground"},ss={class:"h-full border rounded-lg p-2.5 space-y-2"},ns={class:"flex items-center gap-1"},as={class:"text-sm font-semibold leading-none tabular-nums"},os={class:"grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]"},is={class:"text-muted-foreground"},ls={class:"tabular-nums text-foreground"},rs={class:"text-muted-foreground"},ds={class:"tabular-nums text-foreground"},cs={class:"text-muted-foreground"},us={class:"tabular-nums text-foreground"},ps={class:"text-muted-foreground"},fs={class:"tabular-nums text-foreground"},ms={class:"h-full border rounded-lg p-2.5 space-y-2"},gs={class:"flex items-center gap-1"},vs={class:"text-sm font-semibold leading-none tabular-nums"},hs={class:"grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]"},bs={class:"text-muted-foreground"},ys={class:"tabular-nums text-foreground"},_s={class:"text-muted-foreground"},xs={class:"tabular-nums text-foreground"},Ss={class:"text-muted-foreground"},Is={class:"tabular-nums text-foreground"},Cs={class:"text-muted-foreground"},Ls={class:"tabular-nums text-foreground"},Ts={class:"h-full border rounded-lg p-2.5 space-y-2"},As={class:"flex items-center gap-1"},$s={class:"text-sm font-semibold leading-none tabular-nums"},Rs={class:"grid grid-cols-2 gap-x-3 gap-y-1 text-[11px]"},ws={class:"text-muted-foreground"},ks={class:"tabular-nums text-foreground"},Ps={class:"text-muted-foreground"},Os={class:"tabular-nums text-foreground"},Bs={class:"text-muted-foreground"},Ds={class:"tabular-nums text-foreground"},Ms={class:"text-muted-foreground"},Es={class:"tabular-nums text-foreground"},Ns={class:"grid grid-cols-1 xl:grid-cols-2 gap-3"},zs={class:"border rounded-lg p-2.5"},Fs={class:"insights-chart-container"},Hs={class:"border rounded-lg p-2.5"},Vs={class:"insights-chart-container"},js={class:"border rounded-lg p-2.5"},Gs={class:"insights-chart-container"},qs=ne({__name:"InstanceInsightsActivitySection",props:{dashboard:{},isLoading:{type:Boolean},isActionLoading:{type:Boolean},onRefresh:{type:Function}},setup(t){dt([ct,ut,pt,Dt,Pt,ft,mt,gt]);const s=t,l=k({}),f=k({}),r=k({}),v=(i,o)=>{o!=null&&o.selected&&(i.value={...o.selected})},x=i=>v(l,i),C=i=>v(f,i),c=i=>v(r,i),m=k([]);ie(()=>s.dashboard,i=>{if(!(i!=null&&i.capturedAt))return;const o=new Date(i.capturedAt).toLocaleTimeString(),T={capturedAt:i.capturedAt,label:o,sessionsTotal:i.sessions.total,sessionsActive:i.sessions.active,sessionsIdle:i.sessions.idle,tps:i.transactions.tps,commits:i.transactions.commitsPerSec,rollbacks:i.transactions.rollbacksPerSec,reads:i.blockIO.readsPerSec,hits:i.blockIO.hitsPerSec,hitRatio:i.blockIO.bufferHitRatio},R=m.value.findIndex(F=>F.capturedAt===T.capturedAt);if(R>=0){m.value[R]=T;return}m.value.push(T),m.value.length>80&&(m.value=m.value.slice(-80))},{immediate:!0,deep:!0});const S=h(()=>m.value.map((i,o)=>({...i,idx:o}))),$=i=>Object.keys(i).length?i:void 0,L=h(()=>({tooltip:{trigger:"axis"},legend:{top:0,selected:$(l.value)},dataset:[{id:"sessions_raw",source:S.value},{id:"sessions_filtered",fromDatasetId:"sessions_raw",transform:{type:"filter",config:{dimension:"idx",gte:0}}}],grid:{left:45,right:20,top:34,bottom:24},xAxis:{type:"category",boundaryGap:!1},yAxis:{type:"value"},series:[{name:"Total",type:"line",smooth:!0,datasetId:"sessions_filtered",encode:{x:"label",y:"sessionsTotal"}},{name:"Active",type:"line",smooth:!0,datasetId:"sessions_filtered",encode:{x:"label",y:"sessionsActive"}},{name:"Idle",type:"line",smooth:!0,datasetId:"sessions_filtered",encode:{x:"label",y:"sessionsIdle"}}]})),I=h(()=>({tooltip:{trigger:"axis"},legend:{top:0,selected:$(f.value)},dataset:[{id:"transactions_dataset",source:S.value}],grid:{left:45,right:20,top:34,bottom:24},xAxis:{type:"category",boundaryGap:!0},yAxis:[{type:"value",name:"TPS"},{type:"value",name:"Commit/Rollback"}],series:[{name:"TPS",type:"line",smooth:!0,yAxisIndex:0,datasetId:"transactions_dataset",encode:{x:"label",y:"tps"}},{name:"Commits/s",type:"bar",yAxisIndex:1,datasetId:"transactions_dataset",encode:{x:"label",y:"commits"}},{name:"Rollbacks/s",type:"bar",yAxisIndex:1,datasetId:"transactions_dataset",encode:{x:"label",y:"rollbacks"}}]})),u=h(()=>({tooltip:{trigger:"axis"},legend:{top:0,selected:$(r.value)},dataset:[{id:"block_io_dataset",source:S.value}],grid:{left:45,right:20,top:34,bottom:24},xAxis:{type:"category",boundaryGap:!0},yAxis:[{type:"value",name:"Blocks/s"},{type:"value",name:"Hit %",min:0,max:100}],series:[{name:"Reads/s",type:"bar",yAxisIndex:0,datasetId:"block_io_dataset",encode:{x:"label",y:"reads"}},{name:"Hits/s",type:"bar",yAxisIndex:0,datasetId:"block_io_dataset",encode:{x:"label",y:"hits"}},{name:"Buffer Hit Ratio",type:"line",smooth:!0,yAxisIndex:1,datasetId:"block_io_dataset",encode:{x:"label",y:"hitRatio"}}]}));return(i,o)=>{var F,d,a,g,w,O,z,U,Q,J,Z,E,A,j,K,ee,te,p,y,H,N;const T=ae,R=re;return B(),D("div",Ft,[e("div",Ht,[o[2]||(o[2]=e("div",null,[e("h3",{class:"text-sm font-medium"},"Activity Dashboard"),e("p",{class:"text-xs text-muted-foreground"}," Sessions, TPS, tuples and block I/O ")],-1)),b(R,{variant:"outline",size:"xs",disabled:i.isLoading||i.isActionLoading,class:"font-normal",onClick:o[0]||(o[0]=oe=>i.onRefresh())},{default:V(()=>[b(T,{name:"hugeicons:redo",class:pe(["size-4",i.isLoading&&"animate-spin"])},null,8,["class"]),o[1]||(o[1]=M(" Refresh Activity "))]),_:1},8,["disabled"])]),(F=i.dashboard)!=null&&F.sessions.exceedsThreshold?(B(),D("div",Vt,[o[3]||(o[3]=M(" Total connections are at ")),e("strong",null,_(n(ge)(i.dashboard.sessions.usagePercent)),1),o[4]||(o[4]=M(" of ")),o[5]||(o[5]=e("strong",null,"max_connections",-1)),o[6]||(o[6]=M(". Investigate connection pool usage. "))])):Y("",!0),e("div",jt,[e("div",Gt,[e("div",qt,[o[7]||(o[7]=e("p",{class:"text-xs uppercase text-muted-foreground"},"Sessions:",-1)),e("p",Ut,_(n(X)((d=i.dashboard)==null?void 0:d.sessions.total)),1)]),e("div",Qt,[e("p",Kt,[o[8]||(o[8]=e("span",null,"Active: ",-1)),e("span",Wt,_(n(X)((a=i.dashboard)==null?void 0:a.sessions.active)),1)]),e("p",Xt,[o[9]||(o[9]=e("span",null,"Idle: ",-1)),e("span",Yt,_(n(X)((g=i.dashboard)==null?void 0:g.sessions.idle)),1)]),e("p",Jt,[o[10]||(o[10]=e("span",null,"Max: ",-1)),e("span",Zt,_(n(X)((w=i.dashboard)==null?void 0:w.sessions.maxConnections)),1)]),e("p",es,[o[11]||(o[11]=e("span",null,"Usage: ",-1)),e("span",ts,_(n(ge)((O=i.dashboard)==null?void 0:O.sessions.usagePercent)),1)])])]),e("div",ss,[e("div",ns,[o[12]||(o[12]=e("p",{class:"text-xs uppercase text-muted-foreground"},"TPS:",-1)),e("p",as,_(n(q)((z=i.dashboard)==null?void 0:z.transactions.tps)),1)]),e("div",os,[e("p",is,[o[13]||(o[13]=e("span",null,"Commits/sec: ",-1)),e("span",ls,_(n(q)((U=i.dashboard)==null?void 0:U.transactions.commitsPerSec)),1)]),e("p",rs,[o[14]||(o[14]=e("span",null,"Rollbacks/sec: ",-1)),e("span",ds,_(n(q)((Q=i.dashboard)==null?void 0:Q.transactions.rollbacksPerSec)),1)]),e("p",cs,[o[15]||(o[15]=e("span",null,"Total Commits: ",-1)),e("span",us,_(n(X)((J=i.dashboard)==null?void 0:J.transactions.totalCommits)),1)]),e("p",ps,[o[16]||(o[16]=e("span",null,"Total Rollbacks: ",-1)),e("span",fs,_(n(X)((Z=i.dashboard)==null?void 0:Z.transactions.totalRollbacks)),1)])])]),e("div",ms,[e("div",gs,[o[17]||(o[17]=e("p",{class:"text-xs uppercase text-muted-foreground"},"Tuples:",-1)),e("p",vs,_(n(q)((E=i.dashboard)==null?void 0:E.tuples.insertsPerSec)),1)]),e("div",hs,[e("p",bs,[o[18]||(o[18]=e("span",null,"Updates: ",-1)),e("span",ys,_(n(q)((A=i.dashboard)==null?void 0:A.tuples.updatesPerSec)),1)]),e("p",_s,[o[19]||(o[19]=e("span",null,"Deletes: ",-1)),e("span",xs,_(n(q)((j=i.dashboard)==null?void 0:j.tuples.deletesPerSec)),1)]),e("p",Ss,[o[20]||(o[20]=e("span",null,"Fetched: ",-1)),e("span",Is,_(n(q)((K=i.dashboard)==null?void 0:K.tuples.fetchedPerSec)),1)]),e("p",Cs,[o[21]||(o[21]=e("span",null,"Returned: ",-1)),e("span",Ls,_(n(q)((ee=i.dashboard)==null?void 0:ee.tuples.returnedPerSec)),1)])])]),e("div",Ts,[e("div",As,[o[22]||(o[22]=e("p",{class:"text-xs uppercase text-muted-foreground"},"Block I/O:",-1)),e("p",$s,_(n(ge)((te=i.dashboard)==null?void 0:te.blockIO.bufferHitRatio)),1)]),e("div",Rs,[e("p",ws,[o[23]||(o[23]=e("span",null,"Reads/sec: ",-1)),e("span",ks,_(n(q)((p=i.dashboard)==null?void 0:p.blockIO.readsPerSec)),1)]),e("p",Ps,[o[24]||(o[24]=e("span",null,"Hits/sec: ",-1)),e("span",Os,_(n(q)((y=i.dashboard)==null?void 0:y.blockIO.hitsPerSec)),1)]),e("p",Bs,[o[25]||(o[25]=e("span",null,"Total Reads: ",-1)),e("span",Ds,_(n(X)((H=i.dashboard)==null?void 0:H.blockIO.totalReads)),1)]),e("p",Ms,[o[26]||(o[26]=e("span",null,"Total Hits: ",-1)),e("span",Es,_(n(X)((N=i.dashboard)==null?void 0:N.blockIO.totalHits)),1)])])])]),e("div",Ns,[e("div",zs,[o[27]||(o[27]=e("p",{class:"text-sm font-medium mb-1.5"},"Sessions Timeline",-1)),e("div",Fs,[b(n(me),{option:n(L),autoresize:"",class:"insights-chart",onLegendselectchanged:x},null,8,["option"])])]),e("div",Hs,[o[28]||(o[28]=e("p",{class:"text-sm font-medium mb-1.5"},"Transactions Timeline",-1)),e("div",Vs,[b(n(me),{option:n(I),autoresize:"",class:"insights-chart",onLegendselectchanged:C},null,8,["option"])])])]),e("div",js,[o[29]||(o[29]=e("p",{class:"text-sm font-medium mb-1.5"},"Block I/O Timeline",-1)),e("div",Gs,[b(n(me),{option:n(u),autoresize:"",class:"insights-chart",onLegendselectchanged:c},null,8,["option"])])])])}}}),Us=Ie(qs,[["__scopeId","data-v-ba36a884"]]),Qs={class:"space-y-4 h-full flex flex-col overflow-auto"},Ks={class:"flex items-center justify-between gap-2 flex-wrap"},Ws={class:"h-full"},Xs={class:"flex flex-col sm:flex-row sm:items-center gap-2 mb-2"},Ys={class:"relative flex-1"},Js=ne({__name:"InstanceInsightsConfigurationSection",props:{configuration:{},search:{},isLoading:{type:Boolean},isActionLoading:{type:Boolean},onRefresh:{type:Function}},emits:["update:search"],setup(t,{emit:s}){const l=t,f=s,r=h({get:()=>l.search,set:c=>f("update:search",c)}),v=h(()=>{var c;return((c=l.configuration)==null?void 0:c.rows)||[]}),x=h(()=>v.value.map(c=>({name:c.name,category:c.category,value:c.value,unit:c.unit||"-",requires_restart:c.pendingRestart?"yes":"no",description:c.description}))),C=h(()=>se(x.value));return(c,m)=>{const S=ae,$=re,L=we,I=ve;return B(),D("div",Qs,[e("div",Ks,[m[3]||(m[3]=e("div",null,[e("h3",{class:"text-sm font-medium"},"Configuration"),e("p",{class:"text-xs text-muted-foreground"},"Searchable pg_settings")],-1)),b($,{variant:"outline",size:"xs",disabled:c.isLoading||c.isActionLoading,class:"font-normal",onClick:m[0]||(m[0]=u=>c.onRefresh())},{default:V(()=>[b(S,{name:"hugeicons:redo",class:pe(["size-4",c.isLoading&&"animate-spin"])},null,8,["class"]),m[2]||(m[2]=M(" Refresh Configuration "))]),_:1},8,["disabled"])]),e("div",Ws,[e("div",Xs,[e("div",Ys,[b(S,{name:"hugeicons:search-01",class:"size-4 absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),b(L,{type:"text",placeholder:"Search setting name, category, or description...",class:"h-8 w-full pl-8 pr-3",modelValue:n(r),"onUpdate:modelValue":m[1]||(m[1]=u=>ue(r)?r.value=u:null)},null,8,["modelValue"])])]),b(I,{columns:n(C),data:n(x),class:"h-full border rounded-md",columnKeyBy:"field"},null,8,["columns","data"])])])}}}),Zs={class:"space-y-4"},en={class:"flex items-center justify-between"},tn={key:0,class:"border border-orange-300 bg-orange-50 text-orange-700 rounded-lg p-3 text-sm"},sn={class:"space-y-1.5"},nn={class:"space-y-1.5"},an={key:1,class:"border rounded-lg p-2.5"},on={class:"flex items-center justify-between gap-3 flex-wrap"},ln={class:"text-sm font-medium"},rn={class:"flex items-center gap-2"},dn=300,cn=120,un=44,pn=36,fn=ne({__name:"InstanceInsightsReplicationSection",props:{replication:{},isLoading:{type:Boolean},isActionLoading:{type:Boolean},onRefresh:{type:Function},onToggleSlotStatus:{type:Function},onDropSlot:{type:Function}},setup(t){const s=t,l=h(()=>{var d;return((d=s.replication)==null?void 0:d.replicationStats)||[]}),f=h(()=>{var d;return((d=s.replication)==null?void 0:d.replicationSlots)||[]}),r=k([]),v=d=>{r.value=d},x=h(()=>l.value.map(d=>({pid:d.pid,client_addr:d.clientAddr||"-",application:d.applicationName||"-",state:d.state||"-",sync_state:d.syncState||"-",reply_time:le(d.replyTime),write_lag:d.writeLag||"-",flush_lag:d.flushLag||"-",replay_lag:d.replayLag||"-"}))),C=["pid","client_addr","application","state","sync_state","reply_time","write_lag","flush_lag","replay_lag"],c=h(()=>x.value.length>0?se(x.value):bt(C)),m=h(()=>f.value.map(d=>({slot_name:d.slotName,slot_type:d.slotType,status:d.active?"on":"off",active_pid:d.activePid??"-",restart_lsn:d.restartLsn||"-",retained_wal:Et(d.retainedBytes),temporary:d.temporary?"yes":"no"}))),S=h(()=>se(m.value)),$=d=>d<=0?cn:Math.min(dn,un+d*pn),L=h(()=>`${$(x.value.length)}px`),I=h(()=>`${$(m.value.length)}px`),u=h(()=>{var a;const d=String(((a=r.value[0])==null?void 0:a.slot_name)||"");return d&&f.value.find(g=>g.slotName===d)||null}),i=h(()=>{var d;return(d=u.value)!=null&&d.active?"off":"on"}),o=h(()=>i.value==="off"?"Turn Off Slot":"Turn On Slot"),T=d=>window.confirm(d),R=async()=>{u.value&&T(`Drop replication slot "${u.value.slotName}"? This action cannot be undone.`)&&await s.onDropSlot(u.value.slotName)},F=async()=>{u.value&&T(`Switch replication slot "${u.value.slotName}" to ${i.value.toUpperCase()} status?`)&&await s.onToggleSlotStatus({slotName:u.value.slotName,desiredStatus:i.value,activePid:u.value.activePid,slotType:u.value.slotType})};return(d,a)=>{var z;const g=ae,w=re,O=ve;return B(),D("div",Zs,[e("div",en,[a[2]||(a[2]=e("div",null,[e("h3",{class:"text-sm font-medium"},"Replication"),e("p",{class:"text-xs text-muted-foreground"},"Replication stats and slots")],-1)),b(w,{variant:"outline",size:"xs",disabled:d.isLoading||d.isActionLoading,class:"font-normal",onClick:a[0]||(a[0]=U=>d.onRefresh())},{default:V(()=>[b(g,{name:"hugeicons:redo",class:pe(["size-4",d.isLoading&&"animate-spin"])},null,8,["class"]),a[1]||(a[1]=M(" Refresh Replication "))]),_:1},8,["disabled"])]),(z=d.replication)!=null&&z.staleSlotWarning?(B(),D("div",tn,_(d.replication.staleSlotWarning),1)):Y("",!0),e("div",sn,[a[3]||(a[3]=e("p",{class:"text-sm"},"Replication Stats",-1)),e("div",{class:"max-h-[300px]",style:be({height:n(L)})},[b(O,{columns:n(c),data:n(x),class:"h-full border rounded-md",columnKeyBy:"field"},null,8,["columns","data"])],4)]),e("div",nn,[a[4]||(a[4]=e("h4",{class:"text-sm font-normal"},"Replication Slots",-1)),e("div",{class:"max-h-[300px]",style:be({height:n(I)})},[b(O,{columns:n(S),data:n(m),selectedRows:n(r),class:"h-full border rounded-md",columnKeyBy:"field",onOnSelectedRows:v},null,8,["columns","data","selectedRows"])],4)]),n(u)?(B(),D("div",an,[e("div",on,[e("p",ln," Selected Slot: "+_(n(u).slotName)+" ("+_(n(u).active?"on":"off")+") · Active PID: "+_(n(u).activePid??"-"),1),e("div",rn,[b(w,{variant:"outline",size:"sm",disabled:d.isActionLoading,onClick:F},{default:V(()=>[M(_(n(o)),1)]),_:1},8,["disabled"]),b(w,{variant:"outline",size:"sm",disabled:d.isActionLoading,onClick:R},{default:V(()=>a[5]||(a[5]=[M(" Drop Slot ")])),_:1},8,["disabled"])])])])):Y("",!0)])}}}),mn={class:"space-y-4"},gn={class:"flex items-center justify-between"},vn={class:"space-y-1.5"},hn={class:"h-[360px]"},bn={key:0,class:"border rounded-lg p-2.5 space-y-2"},yn={class:"flex items-center justify-between gap-3 flex-wrap"},_n={class:"text-sm font-medium"},xn={class:"flex gap-2"},Sn=["innerHTML"],In={class:"grid grid-cols-1 xl:grid-cols-2 gap-3"},Cn={class:"space-y-1.5"},Ln={class:"h-[300px]"},Tn={class:"space-y-1.5"},An={class:"h-[300px]"},$n=ne({__name:"InstanceInsightsStateSection",props:{state:{},isLoading:{type:Boolean},isActionLoading:{type:Boolean},onRefresh:{type:Function},onCancelQuery:{type:Function},onTerminateConnection:{type:Function}},setup(t){const s=t,{highlightSql:l}=yt(),f=h(()=>{var a;return((a=s.state)==null?void 0:a.sessions)||[]}),r=h(()=>{var a;return((a=s.state)==null?void 0:a.locks)||[]}),v=h(()=>{var a;return((a=s.state)==null?void 0:a.preparedTransactions)||[]}),x=k([]),C=a=>{x.value=a},c=h(()=>f.value.map(a=>({pid:a.pid,user:a.user,application:a.application||"-",client:a.client||"-",state:a.state||"-",wait_event:a.waitEvent||"-",blocking_pids:a.blockingPids.length?a.blockingPids.join(", "):"-",backend_start:le(a.backendStart),transaction_start:le(a.transactionStart),query_duration:Mt(a.durationSeconds),sql:Nt(a.sql)}))),m=h(()=>se(c.value)),S=h(()=>r.value.map(a=>({lock_type:a.lockType,target_relation:a.targetRelation||"-",mode:a.mode,granted:a.granted?"yes":"no",pid:a.pid??"-",user:a.user||"-",state:a.state||"-"}))),$=h(()=>se(S.value)),L=h(()=>v.value.map(a=>({gid:a.gid,transaction:a.transaction,prepared:le(a.prepared),owner:a.owner,database:a.database}))),I=h(()=>se(L.value)),u=h(()=>{var g;const a=Number(((g=x.value[0])==null?void 0:g.pid)||0);return a&&f.value.find(w=>w.pid===a)||null}),i=a=>{if(!a||!a.trim())return"<pre><code>-</code></pre>";const g=a.replace(/\s+/g," ").trim(),w=g.length>900?`${g.slice(0,900)} ...`:g;return l(w)},o=h(()=>{var a;return i(((a=u.value)==null?void 0:a.sql)||null)}),T=(a,g)=>{const w=String(g.state||"");return zt(w)?"insights-danger-cell":void 0},R=a=>window.confirm(a),F=async()=>{u.value&&R(`Cancel query for PID ${u.value.pid}?`)&&await s.onCancelQuery(u.value.pid)},d=async()=>{u.value&&R(`Terminate connection for PID ${u.value.pid}?`)&&await s.onTerminateConnection(u.value.pid)};return(a,g)=>{const w=ae,O=re,z=ve;return B(),D("div",mn,[e("div",gn,[g[2]||(g[2]=e("div",null,[e("h3",{class:"text-sm font-medium"},"State"),e("p",{class:"text-xs text-muted-foreground"}," Active sessions, locks, prepared transactions ")],-1)),b(O,{variant:"outline",size:"xs",disabled:a.isLoading||a.isActionLoading,class:"font-normal",onClick:g[0]||(g[0]=U=>a.onRefresh())},{default:V(()=>[b(w,{name:"hugeicons:redo",class:pe(["size-4",a.isLoading&&"animate-spin"])},null,8,["class"]),g[1]||(g[1]=M(" Refresh State "))]),_:1},8,["disabled"])]),e("div",vn,[g[3]||(g[3]=e("h4",{class:"text-sm font-normal"},"Active Sessions",-1)),e("div",hn,[b(z,{columns:n(m),data:n(c),selectedRows:n(x),getCellClass:T,class:"h-full border rounded-md",columnKeyBy:"field",onOnSelectedRows:C},null,8,["columns","data","selectedRows"])])]),n(u)?(B(),D("div",bn,[e("div",yn,[e("p",_n," Selected PID: "+_(n(u).pid)+" ("+_(n(u).state||"-")+") ",1),e("div",xn,[b(O,{variant:"outline",size:"sm",disabled:a.isActionLoading,onClick:F},{default:V(()=>g[4]||(g[4]=[M(" Cancel Query ")])),_:1},8,["disabled"]),b(O,{variant:"outline",size:"sm",disabled:a.isActionLoading,onClick:d},{default:V(()=>g[5]||(g[5]=[M(" Terminate Connection ")])),_:1},8,["disabled"])])]),e("div",null,[g[6]||(g[6]=e("p",{class:"text-xs text-muted-foreground mb-1"},"SQL Preview",-1)),e("div",{class:"sql-preview border rounded-md overflow-hidden",innerHTML:n(o)},null,8,Sn)])])):Y("",!0),e("div",In,[e("div",Cn,[g[7]||(g[7]=e("h4",{class:"text-sm font-normal"},"Locks",-1)),e("div",Ln,[b(z,{columns:n($),data:n(S),class:"h-full border rounded-md",columnKeyBy:"field"},null,8,["columns","data"])])]),e("div",Tn,[g[8]||(g[8]=e("h4",{class:"text-sm font-normal"},"Prepared Transactions",-1)),e("div",An,[b(z,{columns:n(I),data:n(L),class:"h-full border rounded-md",columnKeyBy:"field"},null,8,["columns","data"])])])])])}}}),Rn=Ie($n,[["__scopeId","data-v-2eab93d6"]]),wn=5e3;function kn(t){const s=k("activity"),l=k(!0),f=k(wn),r=k(null),v=k(!1),x=k(!1),C=k(!1),c=k(!1),m=k(!1),S=k(!1),$=k(null),L=k(null),I=k(null),u=k(null),i=k(""),o=ke(i,350),T=h(()=>!!t.value),R=k(!0);Pe(()=>{R.value=!1}),Oe(()=>{R.value=!0});const F=()=>{r.value=null,$.value=null,L.value=null,I.value=null,u.value=null},d=async(p,y)=>{var H;try{return r.value=null,await p()}catch(N){const oe=((H=N==null?void 0:N.data)==null?void 0:H.message)||(N==null?void 0:N.message)||(N==null?void 0:N.statusMessage)||y;return r.value=oe,null}},a=async(p={})=>{if(!T.value)return null;p.silent||(C.value=!0);const y=await d(async()=>await $fetch("/api/instance-insights/dashboard",{method:"POST",body:{...W(t.value)}}),"Failed to fetch activity dashboard");return y&&($.value=y),p.silent||(C.value=!1),y},g=async(p={})=>{if(!T.value)return null;p.silent||(c.value=!0);const y=await d(async()=>await $fetch("/api/instance-insights/state",{method:"POST",body:{...W(t.value)}}),"Failed to fetch active sessions and locks");return y&&(L.value=y),p.silent||(c.value=!1),y},w=async(p={})=>{if(!T.value)return null;p.silent||(m.value=!0);const y=await d(async()=>await $fetch("/api/instance-insights/configuration",{method:"POST",body:{...W(t.value),search:o.value||void 0}}),"Failed to fetch PostgreSQL settings");return y&&(I.value=y),p.silent||(m.value=!1),y},O=async(p={})=>{if(!T.value)return null;p.silent||(S.value=!0);const y=await d(async()=>await $fetch("/api/instance-insights/replication",{method:"POST",body:{...W(t.value)}}),"Failed to fetch replication status");return y&&(u.value=y),p.silent||(S.value=!1),y},z=async(p=s.value,y={})=>{switch(p){case"activity":await a(y);break;case"state":await Promise.all([a({silent:!0}),g(y)]);break;case"configuration":await Promise.all([a({silent:!0}),w(y)]);break;case"replication":await Promise.all([a({silent:!0}),O(y)]);break;default:await a(y);break}},U=async(p={})=>{await Promise.all([a(p),g(p),w(p),O(p)])},Q=async(p,y)=>{if(!T.value)return!1;x.value=!0;const H=await d(p,"Action failed");return x.value=!1,H?(H.success?fe(y,{description:H.message}):fe(H.message,{description:"The server did not complete this action."}),H.success):(fe(r.value||"Action failed",{description:"Check database permissions and try again."}),!1)},J=async p=>{await Q(async()=>await $fetch("/api/instance-insights/cancel-query",{method:"POST",body:{...W(t.value),pid:p}}),`Cancelled query for PID ${p}`)&&await g({silent:!0})},Z=async p=>{await Q(async()=>await $fetch("/api/instance-insights/terminate-connection",{method:"POST",body:{...W(t.value),pid:p}}),`Terminated connection for PID ${p}`)&&(await g({silent:!0}),await a({silent:!0}))},E=async p=>{await Q(async()=>await $fetch("/api/instance-insights/drop-slot",{method:"POST",body:{...W(t.value),slotName:p}}),`Dropped replication slot "${p}"`)&&await O({silent:!0})},A=async p=>{await Q(async()=>await $fetch("/api/instance-insights/toggle-slot-status",{method:"POST",body:{...W(t.value),slotName:p.slotName,desiredStatus:p.desiredStatus,activePid:p.activePid??null,slotType:p.slotType??null}}),`Turned ${p.desiredStatus} slot "${p.slotName}"`)&&await O({silent:!0})},j=async()=>{if(!T.value){F();return}v.value=!0,await U(),v.value=!1};ie(()=>t.value,async p=>{if(!p){F();return}await j()},{immediate:!0}),ie(()=>o.value,async()=>{s.value!=="configuration"||!T.value||await w({silent:!0})}),ie(()=>s.value,async p=>{T.value&&(p==="state"&&!L.value&&await g(),p==="configuration"&&!I.value&&await w(),p==="replication"&&!u.value&&await O())});const{pause:K,resume:ee,isActive:te}=Be(async()=>{!T.value||!R.value||await z(s.value,{silent:!0})},f,{immediate:!1});return ie(()=>l.value,p=>{p?ee():K()},{immediate:!0}),{activeSection:s,autoRefresh:l,isAutoRefreshRunning:te,error:r,isInitialLoading:v,isActionLoading:x,isDashboardLoading:C,isStateLoading:c,isConfigurationLoading:m,isReplicationLoading:S,dashboard:$,state:L,configuration:I,replication:u,configurationSearch:i,refreshSection:z,refreshAll:U,fetchDashboard:a,fetchState:g,fetchConfiguration:w,fetchReplication:O,cancelQuery:J,terminateConnection:Z,dropReplicationSlot:E,toggleReplicationSlotStatus:A}}const Pn={class:"flex flex-col h-full p-3 gap-3 overflow-hidden"},On={class:"flex flex-col lg:flex-row lg:items-start lg:justify-between border rounded-lg p-3 gap-3 bg-background"},Bn={class:"space-y-1"},Dn={class:"flex items-center gap-2"},Mn={class:"text-sm text-muted-foreground flex items-center gap-0.5"},En={class:"flex items-center gap-0.5"},Nn={class:"font-medium text-foreground"},zn={key:0,class:"flex items-center gap-1.5 mt-0.5"},Fn={class:"flex items-center gap-2 flex-wrap"},Hn={class:"text-xs flex items-center gap-2"},Vn={class:"flex items-center justify-between gap-2"},jn={class:"text-xs text-muted-foreground"},Gn={key:0,class:"border border-red-300 bg-red-50 text-red-700 rounded-lg p-3 text-sm"},qn={key:1,class:"border rounded-lg p-6 flex items-center justify-center gap-2 text-muted-foreground"},Un={key:2,class:"flex-1 overflow-y-auto border rounded-lg p-3 bg-background"},Qn=ne({__name:"InstanceInsightsPanel",props:{dbConnectionString:{},databaseName:{},dbType:{}},setup(t){const s=[{id:"activity",tabLabel:"Activity",subtitle:"Sessions, TPS, tuples and block I/O",icon:"hugeicons:artificial-intelligence-08"},{id:"state",tabLabel:"State",subtitle:"Active sessions, locks, prepared transactions",icon:"hugeicons:shield-01"},{id:"configuration",tabLabel:"Config",subtitle:"Searchable pg_settings",icon:"hugeicons:settings-01"},{id:"replication",tabLabel:"Replication",subtitle:"Replication stats and slots",icon:"hugeicons:database"}],l=Ce(),f=h(()=>l.selectedConnection),{activeSection:r,autoRefresh:v,error:x,isInitialLoading:C,isActionLoading:c,isDashboardLoading:m,isStateLoading:S,isConfigurationLoading:$,isReplicationLoading:L,dashboard:I,state:u,configuration:i,replication:o,configurationSearch:T,refreshSection:R,refreshAll:F,cancelQuery:d,terminateConnection:a,dropReplicationSlot:g,toggleReplicationSlotStatus:w}=kn(f);h(()=>s.find(E=>E.id===r.value));const O=h(()=>{var E,A,j,K;return r.value==="activity"?(E=I.value)==null?void 0:E.capturedAt:r.value==="state"?(A=u.value)==null?void 0:A.capturedAt:r.value==="configuration"?(j=i.value)==null?void 0:j.capturedAt:(K=o.value)==null?void 0:K.capturedAt}),z=()=>R("activity"),U=()=>R("state"),Q=()=>R("configuration"),J=()=>R("replication"),Z=E=>w(E);return(E,A)=>{var N,oe;const j=ae,K=Me,ee=Ee,te=re,p=Ge,y=je,H=Ve;return B(),D("div",Pn,[e("div",On,[e("div",Bn,[e("div",Dn,[b(j,{name:"hugeicons:database",class:"size-5 text-primary"}),A[4]||(A[4]=e("h2",{class:"text-lg font-medium"},"Instance Insights",-1))]),e("div",Mn,[A[5]||(A[5]=M(" connection: ")),e("div",En,[E.dbType?(B(),Le(De((N=n(Ne)(E.dbType))==null?void 0:N.icon),{key:0,class:"size-4!"})):Y("",!0),e("span",Nn,_(E.databaseName),1)])]),(oe=n(I))!=null&&oe.version?(B(),D("div",zn,[b(K,{variant:"outline",class:"text-[10px] h-5 px-1.5 font-normal"},{default:V(()=>[M(" PostgreSQL "+_(n(I).version),1)]),_:1})])):Y("",!0)]),e("div",Fn,[e("div",Hn,[b(ee,{id:"insights-auto-refresh","model-value":n(v),"onUpdate:modelValue":A[0]||(A[0]=G=>ue(v)?v.value=G:null),class:"cursor-pointer"},null,8,["model-value"]),A[6]||(A[6]=e("label",{for:"insights-auto-refresh",class:"cursor-pointer"}," Auto refresh ",-1))]),b(te,{variant:"outline",size:"sm",disabled:n(C)||n(c),onClick:A[1]||(A[1]=G=>n(F)()),class:"font-normal"},{default:V(()=>[b(j,{name:"hugeicons:redo",class:"size-4"}),A[7]||(A[7]=M(" Refresh All "))]),_:1},8,["disabled"])])]),e("div",Vn,[b(H,{modelValue:n(r),"onUpdate:modelValue":A[2]||(A[2]=G=>ue(r)?r.value=G:null),class:"gap-0 flex-1 min-w-0"},{default:V(()=>[b(y,{class:"h-8 max-w-full overflow-x-auto justify-start!"},{default:V(()=>[(B(),D(ze,null,Fe(s,G=>b(p,{key:G.id,value:G.id,class:"text-xs px-1.5 rounded-sm cursor-pointer min-w-fit shrink-0",onClick:Xn=>n(R)(G.id,{silent:!0})},{default:V(()=>[b(j,{name:G.icon,class:"size-3.5!"},null,8,["name"]),M(" "+_(G.tabLabel),1)]),_:2},1032,["value","onClick"])),64))]),_:1})]),_:1},8,["modelValue"]),e("div",jn," Last updated: "+_(n(le)(n(O))),1)]),n(x)?(B(),D("div",Gn,_(n(x)),1)):Y("",!0),n(C)&&!n(I)?(B(),D("div",qn,[b(j,{name:"hugeicons:redo",class:"size-4 animate-spin"}),A[8]||(A[8]=M(" Loading instance insights... "))])):(B(),D("div",Un,[de(b(Us,{dashboard:n(I),isLoading:n(m),isActionLoading:n(c),onRefresh:z},null,8,["dashboard","isLoading","isActionLoading"]),[[ce,n(r)==="activity"]]),de(b(Rn,{state:n(u),isLoading:n(S),isActionLoading:n(c),onRefresh:U,onCancelQuery:n(d),onTerminateConnection:n(a)},null,8,["state","isLoading","isActionLoading","onCancelQuery","onTerminateConnection"]),[[ce,n(r)==="state"]]),de(b(Js,{search:n(T),"onUpdate:search":A[3]||(A[3]=G=>ue(T)?T.value=G:null),configuration:n(i),isLoading:n($),isActionLoading:n(c),onRefresh:Q},null,8,["search","configuration","isLoading","isActionLoading"]),[[ce,n(r)==="configuration"]]),de(b(fn,{replication:n(o),isLoading:n(L),isActionLoading:n(c),onRefresh:J,onDropSlot:n(g),onToggleSlotStatus:Z},null,8,["replication","isLoading","isActionLoading","onDropSlot"]),[[ce,n(r)==="replication"]])]))])}}}),Kn={class:"h-full"},Wn={key:0,class:"h-full p-4 flex flex-col items-center justify-center text-muted-foreground"},ra=ne({__name:"index",setup(t){const s=He(),l=Ce(),f=h(()=>String(s.params.connectionId||"")),r=h(()=>f.value?l.connections.find(c=>c.id===f.value):null),v=h(()=>{var c;return((c=r.value)==null?void 0:c.connectionString)||""}),x=h(()=>{var c;return(c=r.value)==null?void 0:c.type}),C=h(()=>{var c,m;return((c=r.value)==null?void 0:c.database)||((m=r.value)==null?void 0:m.name)||"database"});return(c,m)=>{const S=ae;return B(),D("div",Kn,[n(v)?(B(),Le(Qn,{key:1,"db-connection-string":n(v),"database-name":n(C),"db-type":n(x)},null,8,["db-connection-string","database-name","db-type"])):(B(),D("div",Wn,[b(S,{name:"hugeicons:plug-socket",class:"size-12 mb-2 opacity-50"}),m[0]||(m[0]=e("p",{class:"text-sm"},"Select a connection to open Instance Insights",-1))]))])}}});export{ra as default};
@@ -0,0 +1 @@
1
+ import{a as Y,b as O,d as Ee,e as q,c as K,f as qe,g as fe,h as Ke,j as Sn,k as Xe,s as jn,o as Mn,l as Rn,m as de,n as $n,p as se,r as Fn,q as He,t as Bn,u as Gn,v as Dn,U as Te,S as Pe,w as ce,x as le,y as U,z as ze,A as Je,B as Yn,C as Un,D as N,E as Vn,F as Wn,H as Le,I as qn,J as Ze,K as C,L as Kn,M as Xn,N as B,O as Qe,P as en,Q as Hn,R as he,T as nn,V as zn,W as rn,X as Jn,Y as Zn,G as E,Z as c,_ as Qn,i as x,$ as R,a0 as I,a1 as X}from"./qsFoMdT2.js";var er=/\s/;function nr(e){for(var n=e.length;n--&&er.test(e.charAt(n)););return n}var rr=/^\s+/;function tr(e){return e&&e.slice(0,nr(e)+1).replace(rr,"")}var Ne=NaN,ir=/^[-+]0x[0-9a-f]+$/i,ar=/^0b[01]+$/i,or=/^0o[0-7]+$/i,ur=parseInt;function fr(e){if(typeof e=="number")return e;if(Y(e))return Ne;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=tr(e);var r=ar.test(e);return r||or.test(e)?ur(e.slice(2),r?2:8):ir.test(e)?Ne:+e}var dr=1/0,sr=17976931348623157e292;function G(e){if(!e)return e===0?e:0;if(e=fr(e),e===dr||e===-1/0){var n=e<0?-1:1;return n*sr}return e===e?e:0}function cr(e){var n=G(e),r=n%1;return n===n?r?n-r:n:0}var Ie=Object.create,lr=function(){function e(){}return function(n){if(!O(n))return{};if(Ie)return Ie(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();function tn(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function H(e,n,r){n=="__proto__"&&Ee?Ee(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var hr=Object.prototype,vr=hr.hasOwnProperty;function z(e,n,r){var t=e[n];(!(vr.call(e,n)&&q(t,r))||r===void 0&&!(n in e))&&H(e,n,r)}function $(e,n,r,t){var i=!r;r||(r={});for(var o=-1,a=n.length;++o<a;){var u=n[o],f=void 0;f===void 0&&(f=e[u]),i?H(r,u,f):z(r,u,f)}return r}function S(e,n,r){if(!O(r))return!1;var t=typeof n;return(t=="number"?K(r)&&qe(n,r.length):t=="string"&&n in r)?q(r[n],e):!1}function pr(e){return fe(function(n,r){var t=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&S(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),n=Object(n);++t<i;){var u=r[t];u&&e(n,u,t,o)}return n})}function br(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var wr=Object.prototype,gr=wr.hasOwnProperty;function mr(e){if(!O(e))return br(e);var n=Ke(e),r=[];for(var t in e)t=="constructor"&&(n||!gr.call(e,t))||r.push(t);return r}function P(e){return K(e)?Sn(e,!0):mr(e)}function A(e){var n=e==null?0:e.length;return n?Xe(e):[]}function yr(e){return jn(Mn(e,void 0,A),e+"")}var ve=Rn(Object.getPrototypeOf,Object),xr="[object Object]",Or=Function.prototype,Er=Object.prototype,an=Or.toString,Tr=Er.hasOwnProperty,Pr=an.call(Object);function Lr(e){if(!de(e)||$n(e)!=xr)return!1;var n=ve(e);if(n===null)return!0;var r=Tr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&an.call(r)==Pr}function Nr(e,n){return e&&$(n,se(n),e)}function Ir(e,n){return e&&$(n,P(n),e)}var on=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_e=on&&typeof module=="object"&&module&&!module.nodeType&&module,_r=_e&&_e.exports===on,Ce=_r?Fn.Buffer:void 0,Ae=Ce?Ce.allocUnsafe:void 0;function un(e,n){if(n)return e.slice();var r=e.length,t=Ae?Ae(r):new e.constructor(r);return e.copy(t),t}function Cr(e,n){return $(e,He(e),n)}var Ar=Object.getOwnPropertySymbols,fn=Ar?function(e){for(var n=[];e;)Gn(n,He(e)),e=ve(e);return n}:Bn;function kr(e,n){return $(e,fn(e),n)}function Sr(e){return Dn(e,P,fn)}var jr=Object.prototype,Mr=jr.hasOwnProperty;function Rr(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&Mr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function pe(e){var n=new e.constructor(e.byteLength);return new Te(n).set(new Te(e)),n}function $r(e,n){var r=n?pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Fr=/\w*$/;function Br(e){var n=new e.constructor(e.source,Fr.exec(e));return n.lastIndex=e.lastIndex,n}var ke=Pe?Pe.prototype:void 0,Se=ke?ke.valueOf:void 0;function Gr(e){return Se?Object(Se.call(e)):{}}function dn(e,n){var r=n?pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Dr="[object Boolean]",Yr="[object Date]",Ur="[object Map]",Vr="[object Number]",Wr="[object RegExp]",qr="[object Set]",Kr="[object String]",Xr="[object Symbol]",Hr="[object ArrayBuffer]",zr="[object DataView]",Jr="[object Float32Array]",Zr="[object Float64Array]",Qr="[object Int8Array]",et="[object Int16Array]",nt="[object Int32Array]",rt="[object Uint8Array]",tt="[object Uint8ClampedArray]",it="[object Uint16Array]",at="[object Uint32Array]";function ot(e,n,r){var t=e.constructor;switch(n){case Hr:return pe(e);case Dr:case Yr:return new t(+e);case zr:return $r(e,r);case Jr:case Zr:case Qr:case et:case nt:case rt:case tt:case it:case at:return dn(e,r);case Ur:return new t;case Vr:case Kr:return new t(e);case Wr:return Br(e);case qr:return new t;case Xr:return Gr(e)}}function sn(e){return typeof e.constructor=="function"&&!Ke(e)?lr(ve(e)):{}}var ut="[object Map]";function ft(e){return de(e)&&ce(e)==ut}var je=U&&U.isMap,dt=je?le(je):ft,st="[object Set]";function ct(e){return de(e)&&ce(e)==st}var Me=U&&U.isSet,lt=Me?le(Me):ct,ht=1,vt=2,pt=4,cn="[object Arguments]",bt="[object Array]",wt="[object Boolean]",gt="[object Date]",mt="[object Error]",ln="[object Function]",yt="[object GeneratorFunction]",xt="[object Map]",Ot="[object Number]",hn="[object Object]",Et="[object RegExp]",Tt="[object Set]",Pt="[object String]",Lt="[object Symbol]",Nt="[object WeakMap]",It="[object ArrayBuffer]",_t="[object DataView]",Ct="[object Float32Array]",At="[object Float64Array]",kt="[object Int8Array]",St="[object Int16Array]",jt="[object Int32Array]",Mt="[object Uint8Array]",Rt="[object Uint8ClampedArray]",$t="[object Uint16Array]",Ft="[object Uint32Array]",b={};b[cn]=b[bt]=b[It]=b[_t]=b[wt]=b[gt]=b[Ct]=b[At]=b[kt]=b[St]=b[jt]=b[xt]=b[Ot]=b[hn]=b[Et]=b[Tt]=b[Pt]=b[Lt]=b[Mt]=b[Rt]=b[$t]=b[Ft]=!0;b[mt]=b[ln]=b[Nt]=!1;function D(e,n,r,t,i,o){var a,u=n&ht,f=n&vt,d=n&pt;if(a!==void 0)return a;if(!O(e))return e;var s=N(e);if(s){if(a=Rr(e),!u)return tn(e,a)}else{var l=ce(e),h=l==ln||l==yt;if(ze(e))return un(e,u);if(l==hn||l==cn||h&&!i){if(a=f||h?{}:sn(e),!u)return f?kr(e,Ir(a,e)):Cr(e,Nr(a,e))}else{if(!b[l])return i?e:{};a=ot(e,l,u)}}o||(o=new Je);var v=o.get(e);if(v)return v;o.set(e,a),lt(e)?e.forEach(function(m){a.add(D(m,n,r,m,e,o))}):dt(e)&&e.forEach(function(m,y){a.set(y,D(m,n,r,y,e,o))});var p=d?f?Sr:Yn:f?P:se,w=s?void 0:p(e);return Un(w||e,function(m,y){w&&(y=m,m=e[y]),z(a,y,D(m,n,r,y,e,o))}),a}var Bt=1,Gt=4;function Dt(e){return D(e,Bt|Gt)}var vn=Object.prototype,Yt=vn.hasOwnProperty,Ut=fe(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=P(o),u=-1,f=a.length;++u<f;){var d=a[u],s=e[d];(s===void 0||q(s,vn[d])&&!Yt.call(e,d))&&(e[d]=o[d])}return e});function ie(e,n,r){(r!==void 0&&!q(e[n],r)||r===void 0&&!(n in e))&&H(e,n,r)}function ae(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function Vt(e){return $(e,P(e))}function Wt(e,n,r,t,i,o,a){var u=ae(e,r),f=ae(n,r),d=a.get(f);if(d){ie(e,r,d);return}var s=o?o(u,f,r+"",e,n,a):void 0,l=s===void 0;if(l){var h=N(f),v=!h&&ze(f),p=!h&&!v&&Vn(f);s=f,h||v||p?N(u)?s=u:Wn(u)?s=tn(u):v?(l=!1,s=un(f,!0)):p?(l=!1,s=dn(f,!0)):s=[]:Lr(f)||Le(f)?(s=u,Le(u)?s=Vt(u):(!O(u)||qn(u))&&(s=sn(f))):l=!1}l&&(a.set(f,s),i(s,f,t,o,a),a.delete(f)),ie(e,r,s)}function pn(e,n,r,t,i){e!==n&&Ze(n,function(o,a){if(i||(i=new Je),O(o))Wt(e,n,a,r,pn,t,i);else{var u=t?t(ae(e,a),o,a+"",e,n,i):void 0;u===void 0&&(u=o),ie(e,a,u)}},P)}function V(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function qt(e){return function(n,r,t){var i=Object(n);if(!K(n)){var o=C(r);n=se(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var Kt=Math.max;function Xt(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:cr(r);return i<0&&(i=Kt(t+i,0)),Kn(e,C(n),i)}var be=qt(Xt);function bn(e,n){var r=-1,t=K(e)?Array(e.length):[];return Xn(e,function(i,o,a){t[++r]=n(i,o,a)}),t}function g(e,n){var r=N(e)?B:bn;return r(e,C(n))}function Ht(e,n){return e==null?e:Ze(e,Qe(n),P)}function zt(e,n){return e&&en(e,Qe(n))}function Jt(e,n){return e>n}var Zt=Object.prototype,Qt=Zt.hasOwnProperty;function ei(e,n){return e!=null&&Qt.call(e,n)}function wn(e,n){return e!=null&&Hn(e,n,ei)}function gn(e,n){return e<n}function J(e,n){var r={};return n=C(n),en(e,function(t,i,o){H(r,i,n(t,i,o))}),r}function we(e,n,r){for(var t=-1,i=e.length;++t<i;){var o=e[t],a=n(o);if(a!=null&&(u===void 0?a===a&&!Y(a):r(a,u)))var u=a,f=o}return f}function T(e){return e&&e.length?we(e,he,Jt):void 0}var oe=pr(function(e,n,r){pn(e,n,r)});function j(e){return e&&e.length?we(e,he,gn):void 0}function ge(e,n){return e&&e.length?we(e,C(n),gn):void 0}function ni(e,n,r,t){if(!O(e))return e;n=nn(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var f=zn(n[i]),d=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=a){var s=u[f];d=void 0,d===void 0&&(d=O(s)?s:qe(n[i+1])?[]:{})}z(u,f,d),u=u[f]}return e}function ri(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=rn(e,a);r(u,a)&&ni(o,nn(a,e),u)}return o}function ti(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function ii(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=Y(e),a=n!==void 0,u=n===null,f=n===n,d=Y(n);if(!u&&!d&&!o&&e>n||o&&a&&f&&!u&&!d||t&&a&&f||!r&&f||!i)return 1;if(!t&&!o&&!d&&e<n||d&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!f)return-1}return 0}function ai(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var f=ii(i[t],o[t]);if(f){if(t>=u)return f;var d=r[t];return f*(d=="desc"?-1:1)}}return e.index-n.index}function oi(e,n,r){n.length?n=B(n,function(o){return N(o)?function(a){return rn(a,o.length===1?o[0]:o)}:o}):n=[he];var t=-1;n=B(n,le(C));var i=bn(e,function(o,a,u){var f=B(n,function(d){return d(o)});return{criteria:f,index:++t,value:o}});return ti(i,function(o,a){return ai(o,a,r)})}function ui(e,n){return ri(e,n,function(r,t){return Jn(e,t)})}var W=yr(function(e,n){return e==null?{}:ui(e,n)}),fi=Math.ceil,di=Math.max;function si(e,n,r,t){for(var i=-1,o=di(fi((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function ci(e){return function(n,r,t){return t&&typeof t!="number"&&S(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),si(n,r,t)}}var _=ci(),F=fe(function(e,n){if(e==null)return[];var r=n.length;return r>1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),oi(e,Xe(n),[])}),li=0;function me(e){var n=++li;return Zn(e)+n}function hi(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function vi(e,n){return hi(e||[],n||[],z)}class pi{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return Re(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&Re(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,bi)),t=t._prev;return"["+n.join(", ")+"]"}}function Re(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function bi(e,n){if(e!=="_next"&&e!=="_prev")return n}var wi=Qn(1);function gi(e,n){if(e.nodeCount()<=1)return[];var r=yi(e,n||wi),t=mi(r.graph,r.buckets,r.zeroIdx);return A(g(t,function(i){return e.outEdges(i.v,i.w)}))}function mi(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)Q(e,n,r,a);for(;a=i.dequeue();)Q(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(Q(e,n,r,a,!0));break}}}return t}function Q(e,n,r,t,i){var o=i?[]:void 0;return c(e.inEdges(t.v),function(a){var u=e.edge(a),f=e.node(a.v);i&&o.push({v:a.v,w:a.w}),f.out-=u,ue(n,r,f)}),c(e.outEdges(t.v),function(a){var u=e.edge(a),f=a.w,d=e.node(f);d.in-=u,ue(n,r,d)}),e.removeNode(t.v),o}function yi(e,n){var r=new E,t=0,i=0;c(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),c(e.edges(),function(u){var f=r.edge(u.v,u.w)||0,d=n(u),s=f+d;r.setEdge(u.v,u.w,s),i=Math.max(i,r.node(u.v).out+=d),t=Math.max(t,r.node(u.w).in+=d)});var o=_(i+t+3).map(function(){return new pi}),a=t+1;return c(r.nodes(),function(u){ue(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function ue(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 xi(e){var n=e.graph().acyclicer==="greedy"?gi(e,r(e)):Oi(e);c(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,me("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Oi(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,c(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return c(e.nodes(),i),n}function Ei(e){c(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 k(e,n,r,t){var i;do i=me(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function Ti(e){var n=new E().setGraph(e.graph());return c(e.nodes(),function(r){n.setNode(r,e.node(r))}),c(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function mn(e){var n=new E({multigraph:e.isMultigraph()}).setGraph(e.graph());return c(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),c(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function $e(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var f,d;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),f=u*i/o,d=u):(i<0&&(a=-a),f=a,d=a*o/i),{x:r+f,y:t+d}}function Z(e){var n=g(_(yn(e)+1),function(){return[]});return c(e.nodes(),function(r){var t=e.node(r),i=t.rank;x(i)||(n[i][t.order]=r)}),n}function Pi(e){var n=j(g(e.nodes(),function(r){return e.node(r).rank}));c(e.nodes(),function(r){var t=e.node(r);wn(t,"rank")&&(t.rank-=n)})}function Li(e){var n=j(g(e.nodes(),function(o){return e.node(o).rank})),r=[];c(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;c(r,function(o,a){x(o)&&a%i!==0?--t:t&&c(o,function(u){e.node(u).rank+=t})})}function Fe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),k(e,"border",i,n)}function yn(e){return T(g(e.nodes(),function(n){var r=e.node(n).rank;if(!x(r))return r}))}function Ni(e,n){var r={lhs:[],rhs:[]};return c(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Ii(e,n){return n()}function _i(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&c(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Be(e,"borderLeft","_bl",r,i,o),Be(e,"borderRight","_br",r,i,o)}}c(e.children(),n)}function Be(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],f=k(e,"border",a,r);i[n][o]=f,e.setParent(f,t),u&&e.setEdge(u,f,{weight:1})}function Ci(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&xn(e)}function Ai(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&ki(e),(n==="lr"||n==="rl")&&(Si(e),xn(e))}function xn(e){c(e.nodes(),function(n){Ge(e.node(n))}),c(e.edges(),function(n){Ge(e.edge(n))})}function Ge(e){var n=e.width;e.width=e.height,e.height=n}function ki(e){c(e.nodes(),function(n){ee(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,ee),Object.prototype.hasOwnProperty.call(r,"y")&&ee(r)})}function ee(e){e.y=-e.y}function Si(e){c(e.nodes(),function(n){ne(e.node(n))}),c(e.edges(),function(n){var r=e.edge(n);c(r.points,ne),Object.prototype.hasOwnProperty.call(r,"x")&&ne(r)})}function ne(e){var n=e.x;e.x=e.y,e.y=n}function ji(e){e.graph().dummyChains=[],c(e.edges(),function(n){Mi(e,n)})}function Mi(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),f=u.labelRank;if(o!==t+1){e.removeEdge(n);var d=void 0,s,l;for(l=0,++t;t<o;++l,++t)u.points=[],d={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},s=k(e,"edge",d,"_d"),t===f&&(d.width=u.width,d.height=u.height,d.dummy="edge-label",d.labelpos=u.labelpos),e.setEdge(r,s,{weight:u.weight},a),l===0&&e.graph().dummyChains.push(s),r=s;e.setEdge(r,i,{weight:u.weight},a)}}function Ri(e){c(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=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=i,r=e.node(n)})}function ye(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=j(g(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}c(e.sources(),r)}function M(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function On(e){var n=new E({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;$i(n,e)<t;)i=Fi(n,e),o=n.hasNode(i.v)?M(e,i):-M(e,i),Bi(n,e,o);return n}function $i(e,n){function r(t){c(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!M(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return c(e.nodes(),r),e.nodeCount()}function Fi(e,n){return ge(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return M(n,r)})}function Bi(e,n,r){c(e.nodes(),function(t){n.node(t).rank+=r})}function Gi(){}Gi.prototype=new Error;function En(e,n,r){N(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return c(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);Tn(e,a,r==="post",o,t,i)}),i}function Tn(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),c(i(n),function(a){Tn(e,a,r,t,i,o)}),r&&o.push(n))}function Di(e,n){return En(e,n,"post")}function Yi(e,n){return En(e,n,"pre")}L.initLowLimValues=Oe;L.initCutValues=xe;L.calcCutValue=Pn;L.leaveEdge=Nn;L.enterEdge=In;L.exchangeEdges=_n;function L(e){e=Ti(e),ye(e);var n=On(e);Oe(n),xe(n,e);for(var r,t;r=Nn(n);)t=In(n,e,r),_n(n,e,r,t)}function xe(e,n){var r=Di(e,e.nodes());r=r.slice(0,r.length-1),c(r,function(t){Ui(e,n,t)})}function Ui(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=Pn(e,n,r)}function Pn(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,c(n.nodeEdges(r),function(f){var d=f.v===r,s=d?f.w:f.v;if(s!==i){var l=d===o,h=n.edge(f).weight;if(u+=l?h:-h,Wi(e,r,s)){var v=e.edge(r,s).cutvalue;u+=l?-v:v}}}),u}function Oe(e,n){arguments.length<2&&(n=e.nodes()[0]),Ln(e,{},1,n)}function Ln(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,c(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Ln(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Nn(e){return be(e.edges(),function(n){return e.edge(n).cutvalue<0})}function In(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,f=!1;o.lim>a.lim&&(u=a,f=!0);var d=R(n.edges(),function(s){return f===De(e,e.node(s.v),u)&&f!==De(e,e.node(s.w),u)});return ge(d,function(s){return M(n,s)})}function _n(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),Oe(e),xe(e,n),Vi(e,n)}function Vi(e,n){var r=be(e.nodes(),function(i){return!n.node(i).parent}),t=Yi(e,r);t=t.slice(1),c(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Wi(e,n,r){return e.hasEdge(n,r)}function De(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function qi(e){switch(e.graph().ranker){case"network-simplex":Ye(e);break;case"tight-tree":Xi(e);break;case"longest-path":Ki(e);break;default:Ye(e)}}var Ki=ye;function Xi(e){ye(e),On(e)}function Ye(e){L(e)}function Hi(e){var n=k(e,"root",{},"_root"),r=zi(e),t=T(I(r))-1,i=2*t+1;e.graph().nestingRoot=n,c(e.edges(),function(a){e.edge(a).minlen*=i});var o=Ji(e)+1;c(e.children(),function(a){Cn(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Cn(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var f=Fe(e,"_bt"),d=Fe(e,"_bb"),s=e.node(a);e.setParent(f,a),s.borderTop=f,e.setParent(d,a),s.borderBottom=d,c(u,function(l){Cn(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,w=h.borderTop?t:2*t,m=v!==p?1:i-o[a]+1;e.setEdge(f,v,{weight:w,minlen:m,nestingEdge:!0}),e.setEdge(p,d,{weight:w,minlen:m,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,f,{weight:0,minlen:i+o[a]})}function zi(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&c(o,function(a){r(a,i+1)}),n[t]=i}return c(e.children(),function(t){r(t,1)}),n}function Ji(e){return X(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Zi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,c(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Qi(e,n,r){var t={},i;c(r,function(o){for(var a=e.parent(o),u,f;a;){if(u=e.parent(a),u?(f=t[u],t[u]=a):(f=i,i=a),f&&f!==a){n.setEdge(f,a);return}a=u}})}function ea(e,n,r){var t=na(e),i=new E({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return c(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),c(e[r](o),function(f){var d=f.v===o?f.w:f.v,s=i.edge(d,o),l=x(s)?0:s.weight;i.setEdge(d,o,{weight:e.edge(f).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function na(e){for(var n;e.hasNode(n=me("_root")););return n}function ra(e,n){for(var r=0,t=1;t<n.length;++t)r+=ta(e,n[t-1],n[t]);return r}function ta(e,n,r){for(var t=vi(r,g(r,function(d,s){return s})),i=A(g(n,function(d){return F(g(e.outEdges(d),function(s){return{pos:t[s.w],weight:e.edge(s).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=g(new Array(a),function(){return 0}),f=0;return c(i.forEach(function(d){var s=d.pos+o;u[s]+=d.weight;for(var l=0;s>0;)s%2&&(l+=u[s+1]),s=s-1>>1,u[s]+=d.weight;f+=d.weight*l})),f}function ia(e){var n={},r=R(e.nodes(),function(u){return!e.children(u).length}),t=T(g(r,function(u){return e.node(u).rank})),i=g(_(t+1),function(){return[]});function o(u){if(!wn(n,u)){n[u]=!0;var f=e.node(u);i[f.rank].push(u),c(e.successors(u),o)}}var a=F(r,function(u){return e.node(u).rank});return c(a,o),i}function aa(e,n){return g(n,function(r){var t=e.inEdges(r);if(t.length){var i=X(t,function(o,a){var u=e.edge(a),f=e.node(a.v);return{sum:o.sum+u.weight*f.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function oa(e,n){var r={};c(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};x(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),c(n.edges(),function(i){var o=r[i.v],a=r[i.w];!x(o)&&!x(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=R(r,function(i){return!i.indegree});return ua(t)}function ua(e){var n=[];function r(o){return function(a){a.merged||(x(a.barycenter)||x(o.barycenter)||a.barycenter>=o.barycenter)&&fa(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),c(i.in.reverse(),r(i)),c(i.out,t(i))}return g(R(n,function(o){return!o.merged}),function(o){return W(o,["vs","i","barycenter","weight"])})}function fa(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 da(e,n){var r=Ni(e,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),t=r.lhs,i=F(r.rhs,function(s){return-s.i}),o=[],a=0,u=0,f=0;t.sort(sa(!!n)),f=Ue(o,i,f),c(t,function(s){f+=s.vs.length,o.push(s.vs),a+=s.barycenter*s.weight,u+=s.weight,f=Ue(o,i,f)});var d={vs:A(o)};return u&&(d.barycenter=a/u,d.weight=u),d}function Ue(e,n,r){for(var t;n.length&&(t=V(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function sa(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 An(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,f={};a&&(i=R(i,function(p){return p!==a&&p!==u}));var d=aa(e,i);c(d,function(p){if(e.children(p.v).length){var w=An(e,p.v,r,t);f[p.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&la(p,w)}});var s=oa(d,r);ca(s,f);var l=da(s,t);if(a&&(l.vs=A([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function ca(e,n){c(e,function(r){r.vs=A(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function la(e,n){x(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 ha(e){var n=yn(e),r=Ve(e,_(1,n+1),"inEdges"),t=Ve(e,_(n-1,-1,-1),"outEdges"),i=ia(e);We(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,f=0;f<4;++u,++f){va(u%2?r:t,u%4>=2),i=Z(e);var d=ra(e,i);d<o&&(f=0,a=Dt(i),o=d)}We(e,a)}function Ve(e,n,r){return g(n,function(t){return ea(e,t,r)})}function va(e,n){var r=new E;c(e,function(t){var i=t.graph().root,o=An(t,i,r,n);c(o.vs,function(a,u){t.node(a).order=u}),Qi(t,r,o.vs)})}function We(e,n){c(n,function(r){c(r,function(t,i){e.node(t).order=i})})}function pa(e){var n=wa(e);c(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=ba(e,n,i.v,i.w),a=o.path,u=o.lca,f=0,d=a[f],s=!0;r!==i.w;){if(t=e.node(r),s){for(;(d=a[f])!==u&&e.node(d).maxRank<t.rank;)f++;d===u&&(s=!1)}if(!s){for(;f<a.length-1&&e.node(d=a[f+1]).minRank<=t.rank;)f++;d=a[f]}e.setParent(r,d),r=e.successors(r)[0]}})}function ba(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),f,d;f=r;do f=e.parent(f),i.push(f);while(f&&(n[f].low>a||u>n[f].lim));for(d=f,f=t;(f=e.parent(f))!==d;)o.push(f);return{path:i.concat(o.reverse()),lca:d}}function wa(e){var n={},r=0;function t(i){var o=r;c(e.children(i),t),n[i]={low:o,lim:r++}}return c(e.children(),t),n}function ga(e,n){var r={};function t(i,o){var a=0,u=0,f=i.length,d=V(o);return c(o,function(s,l){var h=ya(e,s),v=h?e.node(h).order:f;(h||s===d)&&(c(o.slice(u,l+1),function(p){c(e.predecessors(p),function(w){var m=e.node(w),y=m.order;(y<a||v<y)&&!(m.dummy&&e.node(p).dummy)&&kn(r,w,p)})}),u=l+1,a=v)}),o}return X(n,t),r}function ma(e,n){var r={};function t(o,a,u,f,d){var s;c(_(a,u),function(l){s=o[l],e.node(s).dummy&&c(e.predecessors(s),function(h){var v=e.node(h);v.dummy&&(v.order<f||v.order>d)&&kn(r,h,s)})})}function i(o,a){var u=-1,f,d=0;return c(a,function(s,l){if(e.node(s).dummy==="border"){var h=e.predecessors(s);h.length&&(f=e.node(h[0]).order,t(a,d,l,u,f),d=l,u=f)}t(a,d,a.length,f,o.length)}),a}return X(n,i),r}function ya(e,n){if(e.node(n).dummy)return be(e.predecessors(n),function(r){return e.node(r).dummy})}function kn(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 i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function xa(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Oa(e,n,r,t){var i={},o={},a={};return c(n,function(u){c(u,function(f,d){i[f]=f,o[f]=f,a[f]=d})}),c(n,function(u){var f=-1;c(u,function(d){var s=t(d);if(s.length){s=F(s,function(w){return a[w]});for(var l=(s.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=s[h];o[d]===d&&f<a[p]&&!xa(r,d,p)&&(o[p]=d,o[d]=i[d]=i[p],f=a[p])}}})}),{root:i,align:o}}function Ea(e,n,r,t,i){var o={},a=Ta(e,n,r,i),u=i?"borderLeft":"borderRight";function f(l,h){for(var v=a.nodes(),p=v.pop(),w={};p;)w[p]?l(p):(w[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function d(l){o[l]=a.inEdges(l).reduce(function(h,v){return Math.max(h,o[v.v]+a.edge(v))},0)}function s(l){var h=a.outEdges(l).reduce(function(p,w){return Math.min(p,o[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[l]=Math.max(o[l],h))}return f(d,a.predecessors.bind(a)),f(s,a.successors.bind(a)),c(t,function(l){o[l]=o[r[l]]}),o}function Ta(e,n,r,t){var i=new E,o=e.graph(),a=_a(o.nodesep,o.edgesep,t);return c(n,function(u){var f;c(u,function(d){var s=r[d];if(i.setNode(s),f){var l=r[f],h=i.edge(l,s);i.setEdge(l,s,Math.max(a(e,d,f),h||0))}f=d})}),i}function Pa(e,n){return ge(I(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Ht(r,function(o,a){var u=Ca(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function La(e,n){var r=I(n),t=j(r),i=T(r);c(["u","d"],function(o){c(["l","r"],function(a){var u=o+a,f=e[u],d;if(f!==n){var s=I(f);d=a==="l"?t-j(s):i-T(s),d&&(e[u]=J(f,function(l){return l+d}))}})})}function Na(e,n){return J(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=F(g(e,t));return(i[1]+i[2])/2})}function Ia(e){var n=Z(e),r=oe(ga(e,n),ma(e,n)),t={},i;c(["u","d"],function(a){i=a==="u"?n:I(n).reverse(),c(["l","r"],function(u){u==="r"&&(i=g(i,function(l){return I(l).reverse()}));var f=(a==="u"?e.predecessors:e.successors).bind(e),d=Oa(e,i,r,f),s=Ea(e,i,d.root,d.align,u==="r");u==="r"&&(s=J(s,function(l){return-l})),t[a+u]=s})});var o=Pa(e,t);return La(t,o),Na(t,e.graph().align)}function _a(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),f=0,d;if(f+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":d=-a.width/2;break;case"r":d=a.width/2;break}if(d&&(f+=r?d:-d),d=0,f+=(a.dummy?n:e)/2,f+=(u.dummy?n:e)/2,f+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":d=u.width/2;break;case"r":d=-u.width/2;break}return d&&(f+=r?d:-d),d=0,f}}function Ca(e,n){return e.node(n).width}function Aa(e){e=mn(e),ka(e),zt(Ia(e),function(n,r){e.node(r).x=n})}function ka(e){var n=Z(e),r=e.graph().ranksep,t=0;c(n,function(i){var o=T(g(i,function(a){return e.node(a).height}));c(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function to(e,n){var r=Ii;r("layout",()=>{var t=r(" buildLayoutGraph",()=>Ua(e));r(" runLayout",()=>Sa(t,r)),r(" updateInputGraph",()=>ja(e,t))})}function Sa(e,n){n(" makeSpaceForEdgeLabels",()=>Va(e)),n(" removeSelfEdges",()=>Qa(e)),n(" acyclic",()=>xi(e)),n(" nestingGraph.run",()=>Hi(e)),n(" rank",()=>qi(mn(e))),n(" injectEdgeLabelProxies",()=>Wa(e)),n(" removeEmptyRanks",()=>Li(e)),n(" nestingGraph.cleanup",()=>Zi(e)),n(" normalizeRanks",()=>Pi(e)),n(" assignRankMinMax",()=>qa(e)),n(" removeEdgeLabelProxies",()=>Ka(e)),n(" normalize.run",()=>ji(e)),n(" parentDummyChains",()=>pa(e)),n(" addBorderSegments",()=>_i(e)),n(" order",()=>ha(e)),n(" insertSelfEdges",()=>eo(e)),n(" adjustCoordinateSystem",()=>Ci(e)),n(" position",()=>Aa(e)),n(" positionSelfEdges",()=>no(e)),n(" removeBorderNodes",()=>Za(e)),n(" normalize.undo",()=>Ri(e)),n(" fixupEdgeLabelCoords",()=>za(e)),n(" undoCoordinateSystem",()=>Ai(e)),n(" translateGraph",()=>Xa(e)),n(" assignNodeIntersects",()=>Ha(e)),n(" reversePoints",()=>Ja(e)),n(" acyclic.undo",()=>Ei(e))}function ja(e,n){c(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),c(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Ma=["nodesep","edgesep","ranksep","marginx","marginy"],Ra={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},$a=["acyclicer","ranker","rankdir","align"],Fa=["width","height"],Ba={width:0,height:0},Ga=["minlen","weight","width","height","labeloffset"],Da={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ya=["labelpos"];function Ua(e){var n=new E({multigraph:!0,compound:!0}),r=te(e.graph());return n.setGraph(oe({},Ra,re(r,Ma),W(r,$a))),c(e.nodes(),function(t){var i=te(e.node(t));n.setNode(t,Ut(re(i,Fa),Ba)),n.setParent(t,e.parent(t))}),c(e.edges(),function(t){var i=te(e.edge(t));n.setEdge(t,oe({},Da,re(i,Ga),W(i,Ya)))}),n}function Va(e){var n=e.graph();n.ranksep/=2,c(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 Wa(e){c(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};k(e,"edge-proxy",o,"_ep")}})}function qa(e){var n=0;c(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=T(n,t.maxRank))}),e.graph().maxRank=n}function Ka(e){c(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Xa(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function f(d){var s=d.x,l=d.y,h=d.width,v=d.height;n=Math.min(n,s-h/2),r=Math.max(r,s+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}c(e.nodes(),function(d){f(e.node(d))}),c(e.edges(),function(d){var s=e.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&f(s)}),n-=a,t-=u,c(e.nodes(),function(d){var s=e.node(d);s.x-=n,s.y-=t}),c(e.edges(),function(d){var s=e.edge(d);c(s.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=n),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Ha(e){c(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift($e(t,o)),r.points.push($e(i,a))})}function za(e){c(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 Ja(e){c(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Za(e){c(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(V(r.borderLeft)),a=e.node(V(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),c(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Qa(e){c(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 eo(e){var n=Z(e);c(n,function(r){var t=0;c(r,function(i,o){var a=e.node(i);a.order=o+t,c(a.selfEdges,function(u){k(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function no(e){c(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function re(e,n){return J(W(e,n),Number)}function te(e){var n={};return c(e,function(r,t){n[t.toLowerCase()]=r}),n}export{D as b,to as l,g as m};
@@ -1 +1 @@
1
- import{_ as d}from"./8_EuFD3X.js";import{_ as f}from"./D7EPcL9i.js";import{d as p,g as u,l as e,h as o,e as i,p as s,q as g,b as a,o as x}from"./FyrDS92w.js";import{_ as l}from"./qIKg23Pc.js";const _={class:"p-2 flex flex-col items-center justify-center h-full"},c={class:"text-muted-foreground text-sm"},b={class:"flex items-center pt-3 text-muted-foreground gap-0.5 text-sm"},v={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},B={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},C={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},z=p({__name:"index",setup(N){return(k,t)=>{const r=f,m=d,n=g;return x(),u("div",_,[e(m,{class:"rounded-2xl size-40"},{default:i(()=>[e(r,{src:"/logo.png",alt:"@unovue"})]),_:1}),t[9]||(t[9]=o("div",{class:"font-medium text-xl pt-2"},"No table is open",-1)),o("div",c,[t[0]||(t[0]=s(" Click on a database table from the sidebar to begin ")),e(n,{name:"hugeicons:artificial-intelligence-08",class:"size-4 min-w-4"})]),o("div",b,[e(n,{name:"hugeicons:settings-01"}),t[2]||(t[2]=s(" Open setting ")),e(a(l),{class:"pl-2"},{default:i(()=>t[1]||(t[1]=[s("(⌘,)")])),_:1})]),o("div",v,[e(n,{name:"hugeicons:command"}),t[4]||(t[4]=s(" Command Palette ")),e(a(l),{class:"pl-2"},{default:i(()=>t[3]||(t[3]=[s("(⌘K or ⌘P)")])),_:1})]),o("div",B,[e(n,{name:"hugeicons:sidebar-left"}),t[6]||(t[6]=s(" Toggle left sidebar ")),e(a(l),{class:"pl-2"},{default:i(()=>t[5]||(t[5]=[s("(⌘B)")])),_:1})]),o("div",C,[e(n,{name:"hugeicons:sidebar-right"}),t[8]||(t[8]=s(" Toggle right sidebar ")),e(a(l),{class:"pl-2"},{default:i(()=>t[7]||(t[7]=[s("(⇧⌘B)")])),_:1})])])}}});export{z as default};
1
+ import{_ as d}from"./C5p44jKD.js";import{_ as f}from"./BgolbRTO.js";import{d as u,m as p,h as e,C as o,w as i,i as s,j as g,u as a,o as x}from"./BM4vnZvX.js";import{_ as l}from"./J2CvNR3L.js";const _={class:"p-2 flex flex-col items-center justify-center h-full"},c={class:"text-muted-foreground text-sm"},v={class:"flex items-center pt-3 text-muted-foreground gap-0.5 text-sm"},b={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},B={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},C={class:"flex items-center pt-1 text-muted-foreground gap-0.5 text-sm"},j=u({__name:"index",setup(N){return(k,t)=>{const m=f,r=d,n=g;return x(),p("div",_,[e(r,{class:"rounded-2xl size-40"},{default:i(()=>[e(m,{src:"/logo.png",alt:"@unovue"})]),_:1}),t[9]||(t[9]=o("div",{class:"font-medium text-xl pt-2"},"No table is open",-1)),o("div",c,[t[0]||(t[0]=s(" Click on a database table from the sidebar to begin ")),e(n,{name:"hugeicons:artificial-intelligence-08",class:"size-4 min-w-4"})]),o("div",v,[e(n,{name:"hugeicons:settings-01"}),t[2]||(t[2]=s(" Open setting ")),e(a(l),{class:"pl-2"},{default:i(()=>t[1]||(t[1]=[s("(⌘,)")])),_:1})]),o("div",b,[e(n,{name:"hugeicons:command"}),t[4]||(t[4]=s(" Command Palette ")),e(a(l),{class:"pl-2"},{default:i(()=>t[3]||(t[3]=[s("(⌘K or ⌘P)")])),_:1})]),o("div",B,[e(n,{name:"hugeicons:sidebar-left"}),t[6]||(t[6]=s(" Toggle left sidebar ")),e(a(l),{class:"pl-2"},{default:i(()=>t[5]||(t[5]=[s("(⌘B)")])),_:1})]),o("div",C,[e(n,{name:"hugeicons:sidebar-right"}),t[8]||(t[8]=s(" Toggle right sidebar ")),e(a(l),{class:"pl-2"},{default:i(()=>t[7]||(t[7]=[s("(⇧⌘B)")])),_:1})])])}}});export{j as default};