prefect 3.6.14.dev7__py3-none-any.whl → 3.6.15__py3-none-any.whl

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 (215) hide show
  1. prefect/_build_info.py +3 -3
  2. prefect/events/clients.py +40 -21
  3. prefect/server/api/concurrency_limits_v2.py +5 -3
  4. prefect/server/ui-v2/assets/{artifact-card-9Cw_dMVb.js → artifact-card-BBzQR-Cj.js} +2 -2
  5. prefect/server/ui-v2/assets/{artifact-card-9Cw_dMVb.js.map → artifact-card-BBzQR-Cj.js.map} +1 -1
  6. prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js +2 -0
  7. prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js.map +1 -0
  8. prefect/server/ui-v2/assets/{automation-wizard-D7nVgckT.js → automation-wizard-EYSfXlQ7.js} +2 -2
  9. prefect/server/ui-v2/assets/{automation-wizard-D7nVgckT.js.map → automation-wizard-EYSfXlQ7.js.map} +1 -1
  10. prefect/server/ui-v2/assets/{automation._id-BhEFaDc6.js → automation._id-Dn7jABys.js} +2 -2
  11. prefect/server/ui-v2/assets/{automation._id-BhEFaDc6.js.map → automation._id-Dn7jABys.js.map} +1 -1
  12. prefect/server/ui-v2/assets/{automation_._id.edit-CffnUlbj.js → automation_._id.edit-COrqswD3.js} +2 -2
  13. prefect/server/ui-v2/assets/{automation_._id.edit-CffnUlbj.js.map → automation_._id.edit-COrqswD3.js.map} +1 -1
  14. prefect/server/ui-v2/assets/{automations-header-qb94agIp.js → automations-header-DN_dmMXW.js} +2 -2
  15. prefect/server/ui-v2/assets/{automations-header-qb94agIp.js.map → automations-header-DN_dmMXW.js.map} +1 -1
  16. prefect/server/ui-v2/assets/{base-job-template-form-section-DdDSFAJa.js → base-job-template-form-section-De2ACYbw.js} +2 -2
  17. prefect/server/ui-v2/assets/{base-job-template-form-section-DdDSFAJa.js.map → base-job-template-form-section-De2ACYbw.js.map} +1 -1
  18. prefect/server/ui-v2/assets/{block-type-details-2rIqbqoZ.js → block-type-details-Cklc7TkK.js} +2 -2
  19. prefect/server/ui-v2/assets/{block-type-details-2rIqbqoZ.js.map → block-type-details-Cklc7TkK.js.map} +1 -1
  20. prefect/server/ui-v2/assets/{block-type-logo-DV1pSkV0.js → block-type-logo-Cbpfxded.js} +2 -2
  21. prefect/server/ui-v2/assets/{block-type-logo-DV1pSkV0.js.map → block-type-logo-Cbpfxded.js.map} +1 -1
  22. prefect/server/ui-v2/assets/{block._id-OeCbdPeL.js → block._id-tuz1Bcj2.js} +2 -2
  23. prefect/server/ui-v2/assets/{block._id-OeCbdPeL.js.map → block._id-tuz1Bcj2.js.map} +1 -1
  24. prefect/server/ui-v2/assets/{block_._id.edit-CD22VllN.js → block_._id.edit-CFEYhF5R.js} +2 -2
  25. prefect/server/ui-v2/assets/{block_._id.edit-CD22VllN.js.map → block_._id.edit-CFEYhF5R.js.map} +1 -1
  26. prefect/server/ui-v2/assets/{catalog-Dj7lYV7b.js → catalog-CCPRo7nY.js} +2 -2
  27. prefect/server/ui-v2/assets/{catalog-Dj7lYV7b.js.map → catalog-CCPRo7nY.js.map} +1 -1
  28. prefect/server/ui-v2/assets/{catalog_._slug-NLgWS8vG.js → catalog_._slug-Bl2J2oI3.js} +2 -2
  29. prefect/server/ui-v2/assets/{catalog_._slug-NLgWS8vG.js.map → catalog_._slug-Bl2J2oI3.js.map} +1 -1
  30. prefect/server/ui-v2/assets/{catalog_._slug_.create-D0vc1Piy.js → catalog_._slug_.create-9UD_SxDN.js} +2 -2
  31. prefect/server/ui-v2/assets/{catalog_._slug_.create-D0vc1Piy.js.map → catalog_._slug_.create-9UD_SxDN.js.map} +1 -1
  32. prefect/server/ui-v2/assets/{collapsible-Dgk2Qvjj.js → collapsible-BVQTBG_U.js} +2 -2
  33. prefect/server/ui-v2/assets/{collapsible-Dgk2Qvjj.js.map → collapsible-BVQTBG_U.js.map} +1 -1
  34. prefect/server/ui-v2/assets/{concurrency-limit._id-BZiyM0NT.js → concurrency-limit._id-CsgRxA0a.js} +2 -2
  35. prefect/server/ui-v2/assets/{concurrency-limit._id-BZiyM0NT.js.map → concurrency-limit._id-CsgRxA0a.js.map} +1 -1
  36. prefect/server/ui-v2/assets/{create-H21iiYVl.js → create-BycfZHGQ.js} +2 -2
  37. prefect/server/ui-v2/assets/{create-H21iiYVl.js.map → create-BycfZHGQ.js.map} +1 -1
  38. prefect/server/ui-v2/assets/{create-1j1-8yhV.js → create-D--LHaji.js} +2 -2
  39. prefect/server/ui-v2/assets/{create-1j1-8yhV.js.map → create-D--LHaji.js.map} +1 -1
  40. prefect/server/ui-v2/assets/{data-table-DHlbTUL7.js → data-table-rlbkLcrY.js} +2 -2
  41. prefect/server/ui-v2/assets/{data-table-DHlbTUL7.js.map → data-table-rlbkLcrY.js.map} +1 -1
  42. prefect/server/ui-v2/assets/{delete-confirmation-dialog-B9-8JHV7.js → delete-confirmation-dialog-DHkm2p8m.js} +2 -2
  43. prefect/server/ui-v2/assets/{delete-confirmation-dialog-B9-8JHV7.js.map → delete-confirmation-dialog-DHkm2p8m.js.map} +1 -1
  44. prefect/server/ui-v2/assets/{deployment-action-header-DlD2GSJB.js → deployment-action-header-D5GOooPm.js} +2 -2
  45. prefect/server/ui-v2/assets/{deployment-action-header-DlD2GSJB.js.map → deployment-action-header-D5GOooPm.js.map} +1 -1
  46. prefect/server/ui-v2/assets/{deployment-form-CFcOIeIi.js → deployment-form-wfg6HeAJ.js} +3 -3
  47. prefect/server/ui-v2/assets/{deployment-form-CFcOIeIi.js.map → deployment-form-wfg6HeAJ.js.map} +1 -1
  48. prefect/server/ui-v2/assets/{deployment-links-DN2Oa0r1.js → deployment-links-6iugOgDh.js} +2 -2
  49. prefect/server/ui-v2/assets/{deployment-links-DN2Oa0r1.js.map → deployment-links-6iugOgDh.js.map} +1 -1
  50. prefect/server/ui-v2/assets/{deployment._id-C8NPwIIQ.js → deployment._id-Ci9zge5n.js} +2 -2
  51. prefect/server/ui-v2/assets/{deployment._id-C8NPwIIQ.js.map → deployment._id-Ci9zge5n.js.map} +1 -1
  52. prefect/server/ui-v2/assets/{deployment._id-DsVQUPNp.js → deployment._id-whsGcHdu.js} +2 -2
  53. prefect/server/ui-v2/assets/{deployment._id-DsVQUPNp.js.map → deployment._id-whsGcHdu.js.map} +1 -1
  54. prefect/server/ui-v2/assets/deployment_._id.duplicate-D9ZWkh8H.js +2 -0
  55. prefect/server/ui-v2/assets/{deployment_._id.duplicate-4uYFgdPg.js.map → deployment_._id.duplicate-D9ZWkh8H.js.map} +1 -1
  56. prefect/server/ui-v2/assets/deployment_._id.edit-CS7sObzC.js +2 -0
  57. prefect/server/ui-v2/assets/{deployment_._id.edit-Z859_W76.js.map → deployment_._id.edit-CS7sObzC.js.map} +1 -1
  58. prefect/server/ui-v2/assets/{deployment_._id.run-MW5q2SRM.js → deployment_._id.run-g7SZuDFi.js} +2 -2
  59. prefect/server/ui-v2/assets/{deployment_._id.run-MW5q2SRM.js.map → deployment_._id.run-g7SZuDFi.js.map} +1 -1
  60. prefect/server/ui-v2/assets/{dropdown-menu-DF4QR3Cp.js → dropdown-menu-0atiOSFo.js} +2 -2
  61. prefect/server/ui-v2/assets/{dropdown-menu-DF4QR3Cp.js.map → dropdown-menu-0atiOSFo.js.map} +1 -1
  62. prefect/server/ui-v2/assets/{event-resource-display-DR3zL_k_.js → event-resource-display-DHiAb1Up.js} +2 -2
  63. prefect/server/ui-v2/assets/{event-resource-display-DR3zL_k_.js.map → event-resource-display-DHiAb1Up.js.map} +1 -1
  64. prefect/server/ui-v2/assets/{event._eventDate._eventId-DfU7SalU.js → event._eventDate._eventId-D7Twzb22.js} +2 -2
  65. prefect/server/ui-v2/assets/{event._eventDate._eventId-DfU7SalU.js.map → event._eventDate._eventId-D7Twzb22.js.map} +1 -1
  66. prefect/server/ui-v2/assets/flow-run-graph-BhzuSJLm.js +2 -0
  67. prefect/server/ui-v2/assets/{flow-run-graph-Bf9t75GK.js.map → flow-run-graph-BhzuSJLm.js.map} +1 -1
  68. prefect/server/ui-v2/assets/{flow-run._id-RL0qeSLl.js → flow-run._id-CqpH6bvx.js} +2 -2
  69. prefect/server/ui-v2/assets/{flow-run._id-RL0qeSLl.js.map → flow-run._id-CqpH6bvx.js.map} +1 -1
  70. prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js +4 -0
  71. prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js.map +1 -0
  72. prefect/server/ui-v2/assets/{flow-run._id-DTsj_xO3.js → flow-run._id-lIIQBD7H.js} +2 -2
  73. prefect/server/ui-v2/assets/{flow-run._id-DTsj_xO3.js.map → flow-run._id-lIIQBD7H.js.map} +1 -1
  74. prefect/server/ui-v2/assets/{flow-runs-pagination-Bfelp8UO.js → flow-runs-pagination-BATUweRV.js} +2 -2
  75. prefect/server/ui-v2/assets/{flow-runs-pagination-Bfelp8UO.js.map → flow-runs-pagination-BATUweRV.js.map} +1 -1
  76. prefect/server/ui-v2/assets/{flow._id-DuQ5AUjj.js → flow._id-BdQGWPKP.js} +2 -2
  77. prefect/server/ui-v2/assets/{flow._id-DuQ5AUjj.js.map → flow._id-BdQGWPKP.js.map} +1 -1
  78. prefect/server/ui-v2/assets/{form-DHWphysD.js → form-DLrbC7rV.js} +2 -2
  79. prefect/server/ui-v2/assets/{form-DHWphysD.js.map → form-DLrbC7rV.js.map} +1 -1
  80. prefect/server/ui-v2/assets/{header-BK_NuSng.js → header-BTAWyeXv.js} +2 -2
  81. prefect/server/ui-v2/assets/{header-BK_NuSng.js.map → header-BTAWyeXv.js.map} +1 -1
  82. prefect/server/ui-v2/assets/{header-nu-ZKuen.js → header-ChFAx5uR.js} +2 -2
  83. prefect/server/ui-v2/assets/{header-nu-ZKuen.js.map → header-ChFAx5uR.js.map} +1 -1
  84. prefect/server/ui-v2/assets/{header-B9SuuoZx.js → header-CyQqOj1w.js} +2 -2
  85. prefect/server/ui-v2/assets/{header-B9SuuoZx.js.map → header-CyQqOj1w.js.map} +1 -1
  86. prefect/server/ui-v2/assets/{index-Dl_iSX0z.js → index-7i4X9TeK.js} +2 -2
  87. prefect/server/ui-v2/assets/{index-Dl_iSX0z.js.map → index-7i4X9TeK.js.map} +1 -1
  88. prefect/server/ui-v2/assets/{index-BPXdHXTb.js → index-BaWDC4da.js} +2 -2
  89. prefect/server/ui-v2/assets/{index-BPXdHXTb.js.map → index-BaWDC4da.js.map} +1 -1
  90. prefect/server/ui-v2/assets/{index-CqUa3fbN.js → index-BkiGTHwU.js} +2 -2
  91. prefect/server/ui-v2/assets/{index-CqUa3fbN.js.map → index-BkiGTHwU.js.map} +1 -1
  92. prefect/server/ui-v2/assets/{index-DNuhJlQK.js → index-Btb_-PDp.js} +2 -2
  93. prefect/server/ui-v2/assets/{index-DNuhJlQK.js.map → index-Btb_-PDp.js.map} +1 -1
  94. prefect/server/ui-v2/assets/{index-DcMpyvW7.js → index-BwCLKpNb.js} +2 -2
  95. prefect/server/ui-v2/assets/{index-DcMpyvW7.js.map → index-BwCLKpNb.js.map} +1 -1
  96. prefect/server/ui-v2/assets/{index-DVsNA4UN.js → index-CHf6xi9j.js} +2 -2
  97. prefect/server/ui-v2/assets/{index-DVsNA4UN.js.map → index-CHf6xi9j.js.map} +1 -1
  98. prefect/server/ui-v2/assets/{index-DSBmxhwG.js → index-CKGj5lSu.js} +2 -2
  99. prefect/server/ui-v2/assets/{index-DSBmxhwG.js.map → index-CKGj5lSu.js.map} +1 -1
  100. prefect/server/ui-v2/assets/index-COouj_0-.css +1 -0
  101. prefect/server/ui-v2/assets/{index-vRbn9rG4.js → index-CQnWiUE5.js} +2 -2
  102. prefect/server/ui-v2/assets/{index-vRbn9rG4.js.map → index-CQnWiUE5.js.map} +1 -1
  103. prefect/server/ui-v2/assets/{index-DWGx9irM.js → index-CiSFHkhI.js} +2 -2
  104. prefect/server/ui-v2/assets/{index-DWGx9irM.js.map → index-CiSFHkhI.js.map} +1 -1
  105. prefect/server/ui-v2/assets/{index-DFS5GNpT.js → index-CnlN-VC_.js} +2 -2
  106. prefect/server/ui-v2/assets/{index-DFS5GNpT.js.map → index-CnlN-VC_.js.map} +1 -1
  107. prefect/server/ui-v2/assets/{index-mj9GNKt7.js → index-CxUfZRkN.js} +2 -2
  108. prefect/server/ui-v2/assets/{index-mj9GNKt7.js.map → index-CxUfZRkN.js.map} +1 -1
  109. prefect/server/ui-v2/assets/{index-DsK1RlS9.js → index-D5RT-SAp.js} +2 -2
  110. prefect/server/ui-v2/assets/{index-DsK1RlS9.js.map → index-D5RT-SAp.js.map} +1 -1
  111. prefect/server/ui-v2/assets/{index-BqwU5GSv.js → index-DATPYZfT.js} +2 -2
  112. prefect/server/ui-v2/assets/{index-BqwU5GSv.js.map → index-DATPYZfT.js.map} +1 -1
  113. prefect/server/ui-v2/assets/{index-BCR-yD58.js → index-DNh9ZBy4.js} +2 -2
  114. prefect/server/ui-v2/assets/{index-BCR-yD58.js.map → index-DNh9ZBy4.js.map} +1 -1
  115. prefect/server/ui-v2/assets/{index-DtrQRjt_.js → index-DQGif3jm.js} +2 -2
  116. prefect/server/ui-v2/assets/{index-DtrQRjt_.js.map → index-DQGif3jm.js.map} +1 -1
  117. prefect/server/ui-v2/assets/{index-Cj5ihRiw.js → index-Eqdr6Ff7.js} +2 -2
  118. prefect/server/ui-v2/assets/{index-Cj5ihRiw.js.map → index-Eqdr6Ff7.js.map} +1 -1
  119. prefect/server/ui-v2/assets/{index-CYjH7t93.js → index-VH4TnZ4e.js} +2 -2
  120. prefect/server/ui-v2/assets/{index-CYjH7t93.js.map → index-VH4TnZ4e.js.map} +1 -1
  121. prefect/server/ui-v2/assets/{index-CPFMHkRh.js → index-kP_I5Qfd.js} +2 -2
  122. prefect/server/ui-v2/assets/{index-CPFMHkRh.js.map → index-kP_I5Qfd.js.map} +1 -1
  123. prefect/server/ui-v2/assets/{index-C0MMjoUe.js → index-lyQav_XM.js} +2 -2
  124. prefect/server/ui-v2/assets/{index-C0MMjoUe.js.map → index-lyQav_XM.js.map} +1 -1
  125. prefect/server/ui-v2/assets/{index-_0OOjqn5.js → index-m48E4KcG.js} +4 -4
  126. prefect/server/ui-v2/assets/{index-_0OOjqn5.js.map → index-m48E4KcG.js.map} +1 -1
  127. prefect/server/ui-v2/assets/{json-input-CMZiW5M2.js → json-input-Ba-BeBcw.js} +2 -2
  128. prefect/server/ui-v2/assets/{json-input-CMZiW5M2.js.map → json-input-Ba-BeBcw.js.map} +1 -1
  129. prefect/server/ui-v2/assets/key-value-DkSKn6jE.js +2 -0
  130. prefect/server/ui-v2/assets/key-value-DkSKn6jE.js.map +1 -0
  131. prefect/server/ui-v2/assets/{key._key-CdonPtNh.js → key._key-Cjx57ymg.js} +2 -2
  132. prefect/server/ui-v2/assets/{key._key-CdonPtNh.js.map → key._key-Cjx57ymg.js.map} +1 -1
  133. prefect/server/ui-v2/assets/{lazy-markdown-CKcd9ksG.js → lazy-markdown-Du2Xu3Yp.js} +2 -2
  134. prefect/server/ui-v2/assets/{lazy-markdown-CKcd9ksG.js.map → lazy-markdown-Du2Xu3Yp.js.map} +1 -1
  135. prefect/server/ui-v2/assets/{login-Dnd-tV90.js → login-DxMF9Jvj.js} +2 -2
  136. prefect/server/ui-v2/assets/{login-Dnd-tV90.js.map → login-DxMF9Jvj.js.map} +1 -1
  137. prefect/server/ui-v2/assets/{markdown-input-D6rfyTa_.js → markdown-input-DPi8zyRr.js} +2 -2
  138. prefect/server/ui-v2/assets/{markdown-input-D6rfyTa_.js.map → markdown-input-DPi8zyRr.js.map} +1 -1
  139. prefect/server/ui-v2/assets/{python-example-snippet-eWuRXCxE.js → python-example-snippet-DfCFYPN_.js} +3 -3
  140. prefect/server/ui-v2/assets/{python-example-snippet-eWuRXCxE.js.map → python-example-snippet-DfCFYPN_.js.map} +1 -1
  141. prefect/server/ui-v2/assets/{python-input-itfwkkBT.js → python-input-mr6GD840.js} +2 -2
  142. prefect/server/ui-v2/assets/{python-input-itfwkkBT.js.map → python-input-mr6GD840.js.map} +1 -1
  143. prefect/server/ui-v2/assets/{radio-group-DeN-_krn.js → radio-group-Co3cN0Kv.js} +2 -2
  144. prefect/server/ui-v2/assets/{radio-group-DeN-_krn.js.map → radio-group-Co3cN0Kv.js.map} +1 -1
  145. prefect/server/ui-v2/assets/{route-error-state-tYzhKCqH.js → route-error-state-DnBaNT2T.js} +2 -2
  146. prefect/server/ui-v2/assets/{route-error-state-tYzhKCqH.js.map → route-error-state-DnBaNT2T.js.map} +1 -1
  147. prefect/server/ui-v2/assets/{schema-form-DDUzvjpL.js → schema-form-CWDHSME9.js} +2 -2
  148. prefect/server/ui-v2/assets/{schema-form-DDUzvjpL.js.map → schema-form-CWDHSME9.js.map} +1 -1
  149. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DrpJmvST.js → schema-form-input-string-format-datetime-BSWlW_aQ.js} +4 -4
  150. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DrpJmvST.js.map → schema-form-input-string-format-datetime-BSWlW_aQ.js.map} +1 -1
  151. prefect/server/ui-v2/assets/{settings-OdrJDFrk.js → settings-DU5y6tJE.js} +2 -2
  152. prefect/server/ui-v2/assets/{settings-OdrJDFrk.js.map → settings-DU5y6tJE.js.map} +1 -1
  153. prefect/server/ui-v2/assets/{sort-filter-DaBGDmua.js → sort-filter-DpuWNkQo.js} +2 -2
  154. prefect/server/ui-v2/assets/{sort-filter-DaBGDmua.js.map → sort-filter-DpuWNkQo.js.map} +1 -1
  155. prefect/server/ui-v2/assets/{table-4GUC4YOD.js → table-bBL6C0ZK.js} +2 -2
  156. prefect/server/ui-v2/assets/{table-4GUC4YOD.js.map → table-bBL6C0ZK.js.map} +1 -1
  157. prefect/server/ui-v2/assets/{tags-input-BvH9UY8h.js → tags-input-BLPMVWpZ.js} +2 -2
  158. prefect/server/ui-v2/assets/{tags-input-BvH9UY8h.js.map → tags-input-BLPMVWpZ.js.map} +1 -1
  159. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CLZz3kwW.js → task-run-concurrency-limits-reset-dialog-S69sih55.js} +2 -2
  160. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CLZz3kwW.js.map → task-run-concurrency-limits-reset-dialog-S69sih55.js.map} +1 -1
  161. prefect/server/ui-v2/assets/{task-run._id-DHHzTQ9d.js → task-run._id-B_tIDm4K.js} +2 -2
  162. prefect/server/ui-v2/assets/{task-run._id-DHHzTQ9d.js.map → task-run._id-B_tIDm4K.js.map} +1 -1
  163. prefect/server/ui-v2/assets/{task-run._id-DgXFfCuq.js → task-run._id-Dl3Azs8t.js} +2 -2
  164. prefect/server/ui-v2/assets/{task-run._id-DgXFfCuq.js.map → task-run._id-Dl3Azs8t.js.map} +1 -1
  165. prefect/server/ui-v2/assets/{task-runs-pagination-fR9zqj38.js → task-runs-pagination-VdR-LO4r.js} +2 -2
  166. prefect/server/ui-v2/assets/{task-runs-pagination-fR9zqj38.js.map → task-runs-pagination-VdR-LO4r.js.map} +1 -1
  167. prefect/server/ui-v2/assets/{textarea-DL9UCBaB.js → textarea-B3_TtPRi.js} +2 -2
  168. prefect/server/ui-v2/assets/{textarea-DL9UCBaB.js.map → textarea-B3_TtPRi.js.map} +1 -1
  169. prefect/server/ui-v2/assets/{timezone-select-qBEoPcyO.js → timezone-select-BuPYznge.js} +2 -2
  170. prefect/server/ui-v2/assets/{timezone-select-qBEoPcyO.js.map → timezone-select-BuPYznge.js.map} +1 -1
  171. prefect/server/ui-v2/assets/{toggle-group-Cf-ZSSDP.js → toggle-group-Cn07UIim.js} +2 -2
  172. prefect/server/ui-v2/assets/{toggle-group-Cf-ZSSDP.js.map → toggle-group-Cn07UIim.js.map} +1 -1
  173. prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DRX9Kvie.js → use-delete-automation-confirmation-dialog-DpdsLH4t.js} +2 -2
  174. prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DRX9Kvie.js.map → use-delete-automation-confirmation-dialog-DpdsLH4t.js.map} +1 -1
  175. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-CogrfdiO.js → use-delete-block-document-confirmation-dialog-Cq5nGhzr.js} +2 -2
  176. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-CogrfdiO.js.map → use-delete-block-document-confirmation-dialog-Cq5nGhzr.js.map} +1 -1
  177. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-CdMKKvm5.js → use-flow-runs-selected-rows-DmQSWBTu.js} +2 -2
  178. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-CdMKKvm5.js.map → use-flow-runs-selected-rows-DmQSWBTu.js.map} +1 -1
  179. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-Be1qg-IF.js → use-get-artifacts-flow-task-runs-DTwcWiqW.js} +2 -2
  180. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-Be1qg-IF.js.map → use-get-artifacts-flow-task-runs-DTwcWiqW.js.map} +1 -1
  181. prefect/server/ui-v2/assets/{use-quick-run-DXDfXpvs.js → use-quick-run-CPempwLh.js} +2 -2
  182. prefect/server/ui-v2/assets/{use-quick-run-DXDfXpvs.js.map → use-quick-run-CPempwLh.js.map} +1 -1
  183. prefect/server/ui-v2/assets/{use-state-favicon-Dhkg1tqx.js → use-state-favicon-M09DmrNy.js} +2 -2
  184. prefect/server/ui-v2/assets/{use-state-favicon-Dhkg1tqx.js.map → use-state-favicon-M09DmrNy.js.map} +1 -1
  185. prefect/server/ui-v2/assets/{use-stepper-jTTsXpho.js → use-stepper-CDucnvzp.js} +2 -2
  186. prefect/server/ui-v2/assets/{use-stepper-jTTsXpho.js.map → use-stepper-CDucnvzp.js.map} +1 -1
  187. prefect/server/ui-v2/assets/{utilities-CgJi7g2F.js → utilities-BRCNRcQl.js} +2 -2
  188. prefect/server/ui-v2/assets/{utilities-CgJi7g2F.js.map → utilities-BRCNRcQl.js.map} +1 -1
  189. prefect/server/ui-v2/assets/{work-pool-filter-DLkRAAHz.js → work-pool-filter-C2tpSS-w.js} +2 -2
  190. prefect/server/ui-v2/assets/{work-pool-filter-DLkRAAHz.js.map → work-pool-filter-C2tpSS-w.js.map} +1 -1
  191. prefect/server/ui-v2/assets/{work-pool-queue-toggle-BFodtXQe.js → work-pool-queue-toggle-BQ9b-Wxy.js} +2 -2
  192. prefect/server/ui-v2/assets/{work-pool-queue-toggle-BFodtXQe.js.map → work-pool-queue-toggle-BQ9b-Wxy.js.map} +1 -1
  193. prefect/server/ui-v2/assets/{work-pool._workPoolName-Bjh_bO5G.js → work-pool._workPoolName-C_LiL3SE.js} +2 -2
  194. prefect/server/ui-v2/assets/{work-pool._workPoolName-Bjh_bO5G.js.map → work-pool._workPoolName-C_LiL3SE.js.map} +1 -1
  195. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-B-gnp5dc.js → work-pool_._workPoolName.edit-DBHlrVVx.js} +2 -2
  196. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-B-gnp5dc.js.map → work-pool_._workPoolName.edit-DBHlrVVx.js.map} +1 -1
  197. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-C7aVwLhH.js → work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js} +2 -2
  198. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-C7aVwLhH.js.map → work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js.map} +1 -1
  199. prefect/server/ui-v2/assets/{work-queue-icon-text-BK_qfkJJ.js → work-queue-icon-text-D4BWBVDN.js} +2 -2
  200. prefect/server/ui-v2/assets/{work-queue-icon-text-BK_qfkJJ.js.map → work-queue-icon-text-D4BWBVDN.js.map} +1 -1
  201. prefect/server/ui-v2/index.html +2 -2
  202. prefect/testing/fixtures.py +14 -13
  203. {prefect-3.6.14.dev7.dist-info → prefect-3.6.15.dist-info}/METADATA +2 -2
  204. {prefect-3.6.14.dev7.dist-info → prefect-3.6.15.dist-info}/RECORD +207 -205
  205. prefect/server/ui-v2/assets/artifact._id-zuZ8P2RD.js +0 -2
  206. prefect/server/ui-v2/assets/artifact._id-zuZ8P2RD.js.map +0 -1
  207. prefect/server/ui-v2/assets/deployment_._id.duplicate-4uYFgdPg.js +0 -2
  208. prefect/server/ui-v2/assets/deployment_._id.edit-Z859_W76.js +0 -2
  209. prefect/server/ui-v2/assets/flow-run-graph-Bf9t75GK.js +0 -2
  210. prefect/server/ui-v2/assets/flow-run._id-33WKPXsZ.js +0 -4
  211. prefect/server/ui-v2/assets/flow-run._id-33WKPXsZ.js.map +0 -1
  212. prefect/server/ui-v2/assets/index-Br7MUvka.css +0 -1
  213. {prefect-3.6.14.dev7.dist-info → prefect-3.6.15.dist-info}/WHEEL +0 -0
  214. {prefect-3.6.14.dev7.dist-info → prefect-3.6.15.dist-info}/entry_points.txt +0 -0
  215. {prefect-3.6.14.dev7.dist-info → prefect-3.6.15.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"flow-run-graph-Bf9t75GK.js","sources":["../../src/components/flow-runs/flow-run-graph/api.ts","../../src/components/flow-runs/flow-run-graph/consts.ts","../../src/components/flow-runs/flow-run-graph/utilities.ts","../../src/components/flow-runs/flow-run-graph/flow-run-graph-center-button.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-fullscreen-button.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-settings.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-settings-button.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-actions.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-artifact-drawer.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-artifacts-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-event-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-events-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-selection-panel.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-state-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph.tsx"],"sourcesContent":["import type {\n\tEventRelatedResource,\n\tRunGraphArtifact,\n\tRunGraphData,\n\tRunGraphEvent,\n\tRunGraphEventResource,\n\tRunGraphFetchEventsContext,\n\tRunGraphNode,\n\tRunGraphStateEvent,\n} from \"@prefecthq/graphs\";\nimport { parseISO } from \"date-fns\";\nimport type { components } from \"@/api/prefect\";\nimport { getQueryService } from \"@/api/service\";\n\n/**\n * Fetches the graph data for a flow run.\n * @param id - The ID of the flow run.\n * @returns The graph data for the flow run.\n */\nexport async function fetchFlowRunGraph(id: string): Promise<RunGraphData> {\n\tconst { data } = await (await getQueryService()).GET(\n\t\t\"/flow_runs/{id}/graph-v2\",\n\t\t{\n\t\t\tparams: { path: { id } },\n\t\t},\n\t);\n\n\tif (!data) {\n\t\tthrow new Error(\"No data returned from API\");\n\t}\n\n\treturn mapApiResponseToRunGraphData(data);\n}\n\n/**\n * Fetches events for a flow run.\n * @param since - The start date of the events to fetch.\n * @param until - The end date of the events to fetch.\n * @param nodeId - The flowRunId of the node to fetch events for.\n * @returns The events for the flow run.\n */\nexport async function fetchFlowRunEvents({\n\tsince,\n\tuntil,\n\tnodeId,\n}: RunGraphFetchEventsContext): Promise<RunGraphEvent[]> {\n\tconst { data } = await (await getQueryService()).POST(\"/events/filter\", {\n\t\tbody: {\n\t\t\tfilter: {\n\t\t\t\tany_resource: {\n\t\t\t\t\tid: [`prefect.flow-run.${nodeId}`],\n\t\t\t\t},\n\t\t\t\tevent: {\n\t\t\t\t\texclude_prefix: [\"prefect.log.write\", \"prefect.task-run.\"],\n\t\t\t\t},\n\t\t\t\toccurred: {\n\t\t\t\t\tsince: since.toISOString(),\n\t\t\t\t\tuntil: until.toISOString(),\n\t\t\t\t},\n\t\t\t\torder: \"ASC\",\n\t\t\t},\n\t\t\tlimit: 50,\n\t\t},\n\t});\n\n\tif (!data) {\n\t\tthrow new Error(\"No data returned from API\");\n\t}\n\n\treturn mapApiResponseToRunGraphEvents(data);\n}\n\ntype GraphResponse = components[\"schemas\"][\"Graph\"];\ntype GraphResponseNode = GraphResponse[\"nodes\"][number];\ntype GraphResponseArtifact = GraphResponse[\"artifacts\"][number];\ntype GraphResponseState = NonNullable<GraphResponse[\"states\"]>[number];\ntype EventsResponse = components[\"schemas\"][\"EventPage\"];\n\nfunction mapApiResponseToRunGraphData(response: GraphResponse): RunGraphData {\n\tif (!response.start_time) {\n\t\tthrow new Error(\"Start time is required\");\n\t}\n\n\treturn {\n\t\troot_node_ids: response.root_node_ids,\n\t\tstart_time: parseISO(response.start_time),\n\t\tend_time: response.end_time ? parseISO(response.end_time) : null,\n\t\tnodes: new Map(response.nodes.map((node) => mapNode(node))),\n\t\tstates: response.states?.map(mapState) ?? [],\n\t};\n}\n\nexport function mapApiResponseToRunGraphEvents(\n\tresponse: EventsResponse,\n): RunGraphEvent[] {\n\treturn response.events.map((event) => {\n\t\tif (!event.received) {\n\t\t\tthrow new Error(\"Received is required\");\n\t\t}\n\n\t\tconst runGraphEvent: RunGraphEvent = {\n\t\t\tid: event.id,\n\t\t\treceived: parseISO(event.received),\n\t\t\toccurred: parseISO(event.occurred),\n\t\t\tevent: event.event,\n\t\t\tresource: event.resource as RunGraphEventResource,\n\t\t\tpayload: event.payload,\n\t\t\trelated: (event.related ?? []) as EventRelatedResource[],\n\t\t};\n\n\t\treturn runGraphEvent;\n\t});\n}\n\nfunction mapNode([id, node]: GraphResponseNode): [string, RunGraphNode] {\n\tif (!node.start_time) {\n\t\tthrow new Error(\"Start time is required\");\n\t}\n\n\treturn [\n\t\tid,\n\t\t{\n\t\t\tkind: node.kind,\n\t\t\tid: node.id,\n\t\t\tlabel: node.label,\n\t\t\tstate_type: node.state_type,\n\t\t\tstart_time: parseISO(node.start_time),\n\t\t\tend_time: node.end_time ? parseISO(node.end_time) : null,\n\t\t\tparents: node.parents,\n\t\t\tchildren: node.children,\n\t\t\tartifacts: node.artifacts.map(mapArtifact),\n\t\t},\n\t];\n}\n\nfunction mapState(state: GraphResponseState): RunGraphStateEvent {\n\treturn {\n\t\tid: state.id,\n\t\ttimestamp: parseISO(state.timestamp),\n\t\ttype: state.type,\n\t\tname: state.name,\n\t};\n}\n\nfunction mapArtifact(artifact: GraphResponseArtifact): RunGraphArtifact {\n\tif (!artifact.type) {\n\t\tthrow new Error(\"Artifact type is required\");\n\t}\n\n\tif (artifact.type === \"progress\" && typeof artifact.data === \"number\") {\n\t\treturn {\n\t\t\tid: artifact.id,\n\t\t\tcreated: parseISO(artifact.created),\n\t\t\tkey: artifact.key ?? undefined,\n\t\t\ttype: artifact.type,\n\t\t\tdata: artifact.data,\n\t\t};\n\t}\n\n\treturn {\n\t\tid: artifact.id,\n\t\tcreated: parseISO(artifact.created),\n\t\tkey: artifact.key ?? undefined,\n\t\ttype: artifact.type as Exclude<RunGraphArtifact[\"type\"], \"progress\">,\n\t};\n}\n","import type { StateType } from \"@prefecthq/graphs\";\n\n/**\n * Shade values for each state type, used with getStateColor().\n * Different states use different shades for visual distinction.\n * See: ui-v2/src/index.css for the CSS variable definitions.\n */\nexport const stateTypeShades: Record<StateType, number> = {\n\tCOMPLETED: 600,\n\tRUNNING: 700,\n\tSCHEDULED: 700,\n\tPENDING: 800,\n\tFAILED: 700,\n\tCANCELLED: 600,\n\tCANCELLING: 600,\n\tCRASHED: 600,\n\tPAUSED: 800,\n};\n","export function isEventTargetInput(target: EventTarget | null): boolean {\n\tif (!target || !(target instanceof HTMLElement)) {\n\t\treturn false;\n\t}\n\treturn [\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(target.tagName);\n}\n","import { centerViewport } from \"@prefecthq/graphs\";\nimport { useEffect } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons/icon\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { isEventTargetInput } from \"./utilities\";\n\nconst center = () => {\n\tvoid centerViewport({ animate: true });\n};\n\nexport function FlowRunGraphCenterButton() {\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\n\t\tdocument.addEventListener(\n\t\t\t\"keydown\",\n\t\t\t(event: KeyboardEvent) => {\n\t\t\t\tif (\n\t\t\t\t\tisEventTargetInput(event.target) ||\n\t\t\t\t\tevent.metaKey ||\n\t\t\t\t\tevent.ctrlKey\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.key === \"c\") {\n\t\t\t\t\tcenter();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\n\t\treturn () => controller.abort();\n\t}, []);\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>\n\t\t\t\t<Button variant=\"ghost\" size=\"icon\" onClick={center}>\n\t\t\t\t\t<Icon id=\"Crosshair\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</TooltipTrigger>\n\t\t\t<TooltipContent>Recenter (c)</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n","import { useCallback, useEffect } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons/icon\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { isEventTargetInput } from \"./utilities\";\n\ntype FlowRunGraphFullscreenButtonProps = {\n\tfullscreen: boolean;\n\tonFullscreenChange: (fullscreen: boolean) => void;\n};\n\nexport function FlowRunGraphFullscreenButton({\n\tfullscreen,\n\tonFullscreenChange,\n}: FlowRunGraphFullscreenButtonProps) {\n\tconst toggleFullscreen = useCallback(() => {\n\t\tonFullscreenChange(!fullscreen);\n\t}, [fullscreen, onFullscreenChange]);\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\n\t\tdocument.addEventListener(\n\t\t\t\"keydown\",\n\t\t\t(event: KeyboardEvent) => {\n\t\t\t\tif (\n\t\t\t\t\tisEventTargetInput(event.target) ||\n\t\t\t\t\tevent.metaKey ||\n\t\t\t\t\tevent.ctrlKey\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.key === \"f\") {\n\t\t\t\t\ttoggleFullscreen();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\ttoggleFullscreen();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\n\t\treturn () => controller.abort();\n\t}, [toggleFullscreen]);\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>\n\t\t\t\t<Button variant=\"ghost\" size=\"icon\" onClick={toggleFullscreen}>\n\t\t\t\t\t<Icon id=\"Expand\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</TooltipTrigger>\n\t\t\t<TooltipContent>Fullscreen (f)</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n","import {\n\tDEFAULT_HORIZONTAL_SCALE_MULTIPLIER,\n\ttype HorizontalMode,\n\tisHorizontalMode,\n\tisVerticalMode,\n\tlayout,\n\tresetHorizontalScaleMultiplier,\n\tsetDisabledArtifacts,\n\tsetDisabledEdges,\n\tsetDisabledEvents,\n\tsetHorizontalMode,\n\tsetHorizontalScaleMultiplier,\n\tsetVerticalMode,\n\ttype VerticalMode,\n} from \"@prefecthq/graphs\";\nimport { useCallback, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Label } from \"@/components/ui/label\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { Typography } from \"@/components/ui/typography\";\n\ntype LayoutOption = `${HorizontalMode}_${VerticalMode}`;\n\nconst layoutOptions: { label: string; value: LayoutOption }[] = [\n\t{\n\t\tlabel: \"Temporal dependency\",\n\t\tvalue: \"temporal_nearest-parent\",\n\t},\n\t{\n\t\tlabel: \"Temporal sequence\",\n\t\tvalue: \"temporal_waterfall\",\n\t},\n\t{\n\t\tlabel: \"Dependency grid\",\n\t\tvalue: \"dependency_nearest-parent\",\n\t},\n\t{\n\t\tlabel: \"Sequential grid\",\n\t\tvalue: \"dependency_waterfall\",\n\t},\n\t{\n\t\tlabel: \"Comparative duration\",\n\t\tvalue: \"left-aligned_duration-sorted\",\n\t},\n];\n\nconst increaseScale = () => {\n\tconst multiplier = DEFAULT_HORIZONTAL_SCALE_MULTIPLIER + 1;\n\tconst scale = layout.horizontalScaleMultiplier * multiplier;\n\tsetHorizontalScaleMultiplier(scale);\n};\n\nconst decreaseScale = () => {\n\tconst multiplier = Math.abs(DEFAULT_HORIZONTAL_SCALE_MULTIPLIER - 1);\n\tconst scale = layout.horizontalScaleMultiplier * multiplier;\n\tsetHorizontalScaleMultiplier(scale);\n};\n\nconst resetScale = () => {\n\tresetHorizontalScaleMultiplier();\n};\n\nfunction isLayoutOption(value: string): value is LayoutOption {\n\tconst [horizontal, vertical] = value.split(\"_\");\n\treturn isHorizontalMode(horizontal) && isVerticalMode(vertical);\n}\n\nexport function FlowRunGraphSettings() {\n\tconst [selectedLayoutOption, setSelectedLayoutOption] = useState(\n\t\t`${layout.horizontal}_${layout.vertical}`,\n\t);\n\tconst [hideEdges, setHideEdges] = useState(layout.disableEdges);\n\tconst [hideArtifacts, setHideArtifacts] = useState(layout.disableArtifacts);\n\tconst [hideEvents, setHideEvents] = useState(layout.disableEvents);\n\n\tconst handleLayoutChange = useCallback((value: string) => {\n\t\tif (!isLayoutOption(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [horizontal, vertical] = value.split(\"_\");\n\n\t\tif (!isHorizontalMode(horizontal) || !isVerticalMode(vertical)) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectedLayoutOption(value);\n\t\tsetHorizontalMode(horizontal);\n\t\tsetVerticalMode(vertical);\n\t}, []);\n\n\tconst handleHideEdgesChange = useCallback((value: boolean) => {\n\t\tsetHideEdges(value);\n\t\tsetDisabledEdges(value);\n\t}, []);\n\n\tconst handleHideArtifactsChange = useCallback((value: boolean) => {\n\t\tsetHideArtifacts(value);\n\t\tsetDisabledArtifacts(value);\n\t}, []);\n\n\tconst handleHideEventsChange = useCallback((value: boolean) => {\n\t\tsetHideEvents(value);\n\t\tsetDisabledEvents(value);\n\t}, []);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t<Typography variant=\"bodyLarge\">Layout</Typography>\n\t\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t\t{layoutOptions.map((option) => (\n\t\t\t\t\t\t<div key={option.value} className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tid={option.value}\n\t\t\t\t\t\t\t\tname=\"layout\"\n\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\tchecked={selectedLayoutOption === option.value}\n\t\t\t\t\t\t\t\tonChange={(e) => handleLayoutChange(e.target.value)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Label htmlFor={option.value}>{option.label}</Label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{(layout.isTemporal() || layout.isLeftAligned()) && (\n\t\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t\t<Typography variant=\"bodyLarge\">Scaling</Typography>\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={decreaseScale}\n\t\t\t\t\t\t\ttitle=\"Decrease scale (-)\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t-\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={increaseScale}\n\t\t\t\t\t\t\ttitle=\"Increase scale (+)\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button variant=\"outline\" size=\"sm\" onClick={resetScale}>\n\t\t\t\t\t\t\tReset\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<hr className=\"my-4\" />\n\n\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Switch\n\t\t\t\t\t\tid=\"hideEdges\"\n\t\t\t\t\t\tchecked={hideEdges}\n\t\t\t\t\t\tonCheckedChange={handleHideEdgesChange}\n\t\t\t\t\t/>\n\t\t\t\t\t<Label htmlFor=\"hideEdges\">Hide dependency arrows</Label>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Switch\n\t\t\t\t\t\tid=\"hideArtifacts\"\n\t\t\t\t\t\tchecked={hideArtifacts}\n\t\t\t\t\t\tonCheckedChange={handleHideArtifactsChange}\n\t\t\t\t\t/>\n\t\t\t\t\t<Label htmlFor=\"hideArtifacts\">Hide artifacts</Label>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Switch\n\t\t\t\t\t\tid=\"hideEvents\"\n\t\t\t\t\t\tchecked={hideEvents}\n\t\t\t\t\t\tonCheckedChange={handleHideEventsChange}\n\t\t\t\t\t/>\n\t\t\t\t\t<Label htmlFor=\"hideEvents\">Hide events</Label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons/icon\";\nimport {\n\tPopover,\n\tPopoverContent,\n\tPopoverTrigger,\n} from \"@/components/ui/popover\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { FlowRunGraphSettings } from \"./flow-run-graph-settings\";\n\nexport function FlowRunGraphSettingsButton() {\n\treturn (\n\t\t<Popover>\n\t\t\t<PopoverTrigger>\n\t\t\t\t<Tooltip>\n\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon\">\n\t\t\t\t\t\t\t<Icon id=\"Cog\" className=\"size-4\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t<TooltipContent>Settings</TooltipContent>\n\t\t\t\t</Tooltip>\n\t\t\t</PopoverTrigger>\n\t\t\t<PopoverContent>\n\t\t\t\t<FlowRunGraphSettings />\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import { FlowRunGraphCenterButton } from \"./flow-run-graph-center-button\";\nimport { FlowRunGraphFullscreenButton } from \"./flow-run-graph-fullscreen-button\";\nimport { FlowRunGraphSettingsButton } from \"./flow-run-graph-settings-button\";\n\ntype FlowRunGraphActionsProps = {\n\tfullscreen: boolean;\n\tonFullscreenChange: (fullscreen: boolean) => void;\n};\n\nexport function FlowRunGraphActions({\n\tfullscreen,\n\tonFullscreenChange,\n}: FlowRunGraphActionsProps) {\n\treturn (\n\t\t<div className=\"flex gap-2\">\n\t\t\t<FlowRunGraphCenterButton />\n\t\t\t<FlowRunGraphFullscreenButton\n\t\t\t\tfullscreen={fullscreen}\n\t\t\t\tonFullscreenChange={onFullscreenChange}\n\t\t\t/>\n\t\t\t<FlowRunGraphSettingsButton />\n\t\t</div>\n\t);\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense } from \"react\";\nimport { buildGetArtifactQuery } from \"@/api/artifacts\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport {\n\tSheet,\n\tSheetContent,\n\tSheetHeader,\n\tSheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Typography } from \"@/components/ui/typography\";\n\ntype FlowRunGraphArtifactDrawerProps = {\n\tartifactId: string | null;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphArtifactDrawer({\n\tartifactId,\n\tonClose,\n}: FlowRunGraphArtifactDrawerProps) {\n\treturn (\n\t\t<Sheet\n\t\t\topen={artifactId !== null}\n\t\t\tonOpenChange={(open) => !open && onClose()}\n\t\t>\n\t\t\t<SheetContent>\n\t\t\t\t<SheetHeader>\n\t\t\t\t\t<SheetTitle>Artifact Details</SheetTitle>\n\t\t\t\t</SheetHeader>\n\t\t\t\t{artifactId && (\n\t\t\t\t\t<Suspense fallback={<ArtifactContentSkeleton />}>\n\t\t\t\t\t\t<ArtifactContent artifactId={artifactId} />\n\t\t\t\t\t</Suspense>\n\t\t\t\t)}\n\t\t\t</SheetContent>\n\t\t</Sheet>\n\t);\n}\n\nfunction ArtifactContentSkeleton() {\n\treturn (\n\t\t<div className=\"space-y-4 p-4\">\n\t\t\t<Skeleton className=\"h-6 w-32\" />\n\t\t\t<Skeleton className=\"h-4 w-24\" />\n\t\t\t<Skeleton className=\"h-4 w-48\" />\n\t\t\t<Skeleton className=\"h-32 w-full\" />\n\t\t</div>\n\t);\n}\n\nfunction ArtifactContent({ artifactId }: { artifactId: string }) {\n\tconst { data: artifact } = useSuspenseQuery(\n\t\tbuildGetArtifactQuery(artifactId),\n\t);\n\n\treturn (\n\t\t<div className=\"space-y-4 p-4\">\n\t\t\t<KeyValue\n\t\t\t\tlabel=\"Key\"\n\t\t\t\tvalue={\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"font-medium\">\n\t\t\t\t\t\t{artifact.key ?? \"Unnamed\"}\n\t\t\t\t\t</Typography>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{artifact.type && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Type\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"uppercase\">\n\t\t\t\t\t\t\t{artifact.type}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{artifact.description && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Description\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Typography variant=\"bodySmall\">{artifact.description}</Typography>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{artifact.created && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<FormattedDate date={artifact.created} />}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{artifact.data !== undefined && artifact.data !== null && (\n\t\t\t\t<div className=\"space-y-2\">\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\tData\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<pre className=\"bg-muted p-3 rounded-md text-sm overflow-auto max-h-64\">\n\t\t\t\t\t\t{typeof artifact.data === \"string\"\n\t\t\t\t\t\t\t? artifact.data\n\t\t\t\t\t\t\t: JSON.stringify(artifact.data, null, 2)}\n\t\t\t\t\t</pre>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import type { ArtifactsSelection } from \"@prefecthq/graphs\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { buildListArtifactsQuery } from \"@/api/artifacts\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\nimport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverContent,\n} from \"@/components/ui/popover\";\nimport { Typography } from \"@/components/ui/typography\";\n\ntype FlowRunGraphArtifactsPopoverProps = {\n\tselection: ArtifactsSelection;\n\tonClose: () => void;\n\tonViewArtifact: (artifactId: string) => void;\n};\n\nexport function FlowRunGraphArtifactsPopover({\n\tselection,\n\tonClose,\n\tonViewArtifact,\n}: FlowRunGraphArtifactsPopoverProps) {\n\tconst { data: artifacts, isLoading } = useQuery(\n\t\tbuildListArtifactsQuery({\n\t\t\tartifacts: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tid: { any_: selection.ids },\n\t\t\t},\n\t\t\tsort: \"CREATED_DESC\",\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst anchorStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t};\n\n\treturn (\n\t\t<Popover open onOpenChange={(open) => !open && onClose()}>\n\t\t\t<PopoverAnchor style={anchorStyle} />\n\t\t\t<PopoverContent align=\"center\" side=\"bottom\" className=\"w-72\">\n\t\t\t\t<div className=\"flex items-center justify-between mb-3\">\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"font-semibold\">\n\t\t\t\t\t\tArtifacts\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<div className=\"flex items-center justify-center py-4\">\n\t\t\t\t\t\t<Icon id=\"Loader2\" className=\"size-4 animate-spin\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"space-y-2 max-h-64 overflow-y-auto\">\n\t\t\t\t\t\t{artifacts\n\t\t\t\t\t\t\t?.filter((artifact) => artifact.id !== undefined)\n\t\t\t\t\t\t\t.map((artifact) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={artifact.id}\n\t\t\t\t\t\t\t\t\tclassName=\"flex items-center justify-between gap-2 p-2 rounded-md border bg-muted/50\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"flex flex-col min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"bodySmall\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"font-medium truncate\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{artifact.key ?? \"Unnamed\"}\n\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t{artifact.type && (\n\t\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"xsmall\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-muted-foreground uppercase\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{artifact.type}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => onViewArtifact(artifact.id as string)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import type { EventSelection } from \"@prefecthq/graphs\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { format, isValid, parseISO } from \"date-fns\";\nimport { Suspense } from \"react\";\nimport { buildGetEventQuery, type Event } from \"@/api/events\";\nimport type { components } from \"@/api/prefect\";\nimport {\n\tEventResourceLink,\n\textractResourceId,\n\tparseResourceType,\n\tResourceDisplaySkeleton,\n\tResourceDisplayWithIcon,\n} from \"@/components/events/event-resource-display\";\nimport { ResolvedResourceDisplay } from \"@/components/events/event-resource-display/resolved-resource-display\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverContent,\n} from \"@/components/ui/popover\";\n\ntype RelatedResource = components[\"schemas\"][\"RelatedResource\"];\n\ntype FlowRunGraphEventPopoverProps = {\n\tselection: EventSelection;\n\tonClose: () => void;\n};\n\n/**\n * Converts an event name like \"prefect.flow-run.Running\" to a human-readable label\n * like \"Flow run running\"\n */\nfunction getEventLabel(eventName: string): string {\n\t// Remove \"prefect.\" or \"prefect-cloud.\" prefix\n\tlet label = eventName;\n\tif (label.startsWith(\"prefect.\")) {\n\t\tlabel = label.slice(8);\n\t} else if (label.startsWith(\"prefect-cloud.\")) {\n\t\tlabel = label.slice(14);\n\t}\n\n\t// Replace dots, dashes, and underscores with spaces\n\tlabel = label.replace(/[._-]/g, \" \");\n\n\t// Capitalize first letter, lowercase the rest\n\treturn label.charAt(0).toUpperCase() + label.slice(1).toLowerCase();\n}\n\n/**\n * Formats a date to numeric format like \"2026/01/25 08:18:11 PM\"\n */\nfunction formatDateNumeric(date: string | Date): string {\n\tlet parsedDate: Date;\n\tif (typeof date === \"string\") {\n\t\tparsedDate = parseISO(date);\n\t} else {\n\t\tparsedDate = date;\n\t}\n\n\tif (!isValid(parsedDate)) {\n\t\treturn \"Invalid date\";\n\t}\n\n\treturn format(parsedDate, \"yyyy/MM/dd hh:mm:ss a\");\n}\n\nfunction getResourceName(resource: Record<string, string>): string | null {\n\treturn (\n\t\tresource[\"prefect.resource.name\"] ||\n\t\tresource[\"prefect.name\"] ||\n\t\tresource[\"prefect-cloud.name\"] ||\n\t\tnull\n\t);\n}\n\ntype EventResourceSectionProps = {\n\tevent: Event;\n};\n\nfunction EventResourceSection({ event }: EventResourceSectionProps) {\n\tconst resourceName = getResourceName(event.resource);\n\tconst prefectResourceId = event.resource[\"prefect.resource.id\"] || \"\";\n\tconst resourceType = parseResourceType(prefectResourceId);\n\tconst extractedId = extractResourceId(prefectResourceId);\n\tconst relatedResources = event.related ?? [];\n\n\t// If we have a resource name, display it with the appropriate icon\n\tif (resourceName) {\n\t\treturn (\n\t\t\t<Suspense fallback={<ResourceDisplaySkeleton />}>\n\t\t\t\t<EventResourceLink\n\t\t\t\t\tresource={event.resource as RelatedResource}\n\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t>\n\t\t\t\t\t<ResourceDisplayWithIcon\n\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\tdisplayText={resourceName}\n\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t/>\n\t\t\t\t</EventResourceLink>\n\t\t\t</Suspense>\n\t\t);\n\t}\n\n\t// If we have an extracted ID but no name, try to fetch the resource name via API\n\tif (extractedId && resourceType !== \"unknown\") {\n\t\treturn (\n\t\t\t<Suspense fallback={<ResourceDisplaySkeleton />}>\n\t\t\t\t<EventResourceLink\n\t\t\t\t\tresource={event.resource as RelatedResource}\n\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t>\n\t\t\t\t\t<ResolvedResourceDisplay\n\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\tresourceId={extractedId}\n\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t/>\n\t\t\t\t</EventResourceLink>\n\t\t\t</Suspense>\n\t\t);\n\t}\n\n\t// Fallback: show the raw resource ID\n\treturn (\n\t\t<span className=\"text-sm text-muted-foreground font-mono\">\n\t\t\t{prefectResourceId || \"Unknown\"}\n\t\t</span>\n\t);\n}\n\ntype RelatedResourcesSectionProps = {\n\trelatedResources: RelatedResource[];\n};\n\nfunction RelatedResourcesSection({\n\trelatedResources,\n}: RelatedResourcesSectionProps) {\n\t// Filter out tag resources and only show meaningful related resources\n\tconst filteredResources = relatedResources.filter((resource) => {\n\t\tconst role = resource[\"prefect.resource.role\"];\n\t\tconst resourceId = resource[\"prefect.resource.id\"] || \"\";\n\t\t// Exclude tags and resources without a valid type\n\t\tif (role === \"tag\" || resourceId.startsWith(\"prefect.tag.\")) {\n\t\t\treturn false;\n\t\t}\n\t\tconst resourceType = parseResourceType(resourceId);\n\t\treturn resourceType !== \"unknown\";\n\t});\n\n\tif (filteredResources.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<KeyValue\n\t\t\tlabel=\"Related Resources\"\n\t\t\tvalue={\n\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t{filteredResources.map((resource) => {\n\t\t\t\t\t\tconst resourceName = getResourceName(resource);\n\t\t\t\t\t\tconst prefectResourceId = resource[\"prefect.resource.id\"] || \"\";\n\t\t\t\t\t\tconst resourceType = parseResourceType(prefectResourceId);\n\t\t\t\t\t\tconst extractedId = extractResourceId(prefectResourceId);\n\n\t\t\t\t\t\tif (resourceName) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Suspense\n\t\t\t\t\t\t\t\t\tkey={prefectResourceId}\n\t\t\t\t\t\t\t\t\tfallback={<ResourceDisplaySkeleton />}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EventResourceLink\n\t\t\t\t\t\t\t\t\t\tresource={resource}\n\t\t\t\t\t\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\t\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ResourceDisplayWithIcon\n\t\t\t\t\t\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\t\t\t\t\t\tdisplayText={resourceName}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</EventResourceLink>\n\t\t\t\t\t\t\t\t</Suspense>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (extractedId && resourceType !== \"unknown\") {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Suspense\n\t\t\t\t\t\t\t\t\tkey={prefectResourceId}\n\t\t\t\t\t\t\t\t\tfallback={<ResourceDisplaySkeleton />}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EventResourceLink\n\t\t\t\t\t\t\t\t\t\tresource={resource}\n\t\t\t\t\t\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\t\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ResolvedResourceDisplay\n\t\t\t\t\t\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\t\t\t\t\t\tresourceId={extractedId}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</EventResourceLink>\n\t\t\t\t\t\t\t\t</Suspense>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tkey={prefectResourceId}\n\t\t\t\t\t\t\t\tclassName=\"text-sm text-muted-foreground font-mono\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{prefectResourceId}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport function FlowRunGraphEventPopover({\n\tselection,\n\tonClose,\n}: FlowRunGraphEventPopoverProps) {\n\tconst { data: event, isLoading } = useQuery(\n\t\tbuildGetEventQuery(selection.id, selection.occurred),\n\t);\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst anchorStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t};\n\n\tconst eventName = event?.event ?? \"\";\n\tconst eventLabel = eventName ? getEventLabel(eventName) : \"Loading...\";\n\tconst relatedResources = event?.related ?? [];\n\n\treturn (\n\t\t<Popover open onOpenChange={(open) => !open && onClose()}>\n\t\t\t<PopoverAnchor style={anchorStyle} />\n\t\t\t<PopoverContent align=\"center\" side=\"bottom\" className=\"w-80\">\n\t\t\t\t<div className=\"flex justify-between items-start mb-3\">\n\t\t\t\t\t<span className=\"text-sm text-muted-foreground\">Event</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t\t\tclassName=\"-mt-1 -mr-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<div className=\"flex items-center justify-center py-4\">\n\t\t\t\t\t\t<Icon id=\"Loader2\" className=\"size-4 animate-spin\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"space-y-3\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-0.5\">\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto=\"/events\"\n\t\t\t\t\t\t\t\tsearch={{ event: [eventName] }}\n\t\t\t\t\t\t\t\tclassName=\"text-sm text-primary hover:underline font-medium\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{eventLabel}\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t<span className=\"text-xs text-muted-foreground\">{eventName}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<KeyValue\n\t\t\t\t\t\t\tlabel=\"Occurred\"\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t<span className=\"text-sm\">\n\t\t\t\t\t\t\t\t\t{formatDateNumeric(selection.occurred)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{event && (\n\t\t\t\t\t\t\t<KeyValue\n\t\t\t\t\t\t\t\tlabel=\"Resource\"\n\t\t\t\t\t\t\t\tvalue={<EventResourceSection event={event} />}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{relatedResources.length > 0 && (\n\t\t\t\t\t\t\t<RelatedResourcesSection relatedResources={relatedResources} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import type { EventsSelection } from \"@prefecthq/graphs\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { buildGetEventQuery } from \"@/api/events\";\nimport { Button } from \"@/components/ui/button\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { Icon } from \"@/components/ui/icons\";\nimport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverContent,\n} from \"@/components/ui/popover\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\n\ntype FlowRunGraphEventsPopoverProps = {\n\tselection: EventsSelection;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphEventsPopover({\n\tselection,\n\tonClose,\n}: FlowRunGraphEventsPopoverProps) {\n\tconst eventQueries = useQueries({\n\t\tqueries: selection.ids.map((id) =>\n\t\t\tbuildGetEventQuery(id, selection.occurred ?? new Date()),\n\t\t),\n\t});\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst anchorStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t};\n\n\tconst isLoading = eventQueries.some((q) => q.isLoading);\n\tconst events = eventQueries\n\t\t.map((q) => q.data)\n\t\t.filter((e): e is NonNullable<typeof e> => e !== undefined);\n\n\treturn (\n\t\t<Popover open onOpenChange={(open) => !open && onClose()}>\n\t\t\t<PopoverAnchor style={anchorStyle} />\n\t\t\t<PopoverContent align=\"center\" side=\"bottom\" className=\"w-80\">\n\t\t\t\t<div className=\"flex items-center justify-between mb-2\">\n\t\t\t\t\t<span className=\"text-sm font-medium\">\n\t\t\t\t\t\t{selection.ids.length} Events\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<div className=\"flex items-center justify-center py-4\">\n\t\t\t\t\t\t<Icon id=\"Loader2\" className=\"size-4 animate-spin\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<ScrollArea className=\"max-h-64\">\n\t\t\t\t\t\t<div className=\"space-y-3\">\n\t\t\t\t\t\t\t{events.map((event) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={event.id}\n\t\t\t\t\t\t\t\t\tclassName=\"border-b pb-2 last:border-b-0 last:pb-0\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"text-sm font-mono truncate\"\n\t\t\t\t\t\t\t\t\t\ttitle={event.event}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.event}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t<FormattedDate date={new Date(event.occurred)} />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ScrollArea>\n\t\t\t\t)}\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import { type GraphItemSelection, isNodeSelection } from \"@prefecthq/graphs\";\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { buildGetFlowRunDetailsQuery } from \"@/api/flow-runs\";\nimport { buildGetTaskRunQuery } from \"@/api/task-runs\";\nimport { Button } from \"@/components/ui/button\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport { secondsToApproximateString } from \"@/utils/seconds\";\n\ntype FlowRunGraphSelectionPanelProps = {\n\tselection: GraphItemSelection;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphSelectionPanel({\n\tselection,\n\tonClose,\n}: FlowRunGraphSelectionPanelProps) {\n\tif (!isNodeSelection(selection)) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"absolute top-4 right-4 z-10 w-72 rounded-lg border bg-card p-4 shadow-md\">\n\t\t\t<Suspense fallback={<SelectionPanelSkeleton onClose={onClose} />}>\n\t\t\t\t{selection.kind === \"task-run\" && (\n\t\t\t\t\t<TaskRunDetails taskRunId={selection.id} onClose={onClose} />\n\t\t\t\t)}\n\t\t\t\t{selection.kind === \"flow-run\" && (\n\t\t\t\t\t<FlowRunDetails flowRunId={selection.id} onClose={onClose} />\n\t\t\t\t)}\n\t\t\t</Suspense>\n\t\t</div>\n\t);\n}\n\ntype SelectionPanelSkeletonProps = {\n\tonClose: () => void;\n};\n\nfunction SelectionPanelSkeleton({ onClose }: SelectionPanelSkeletonProps) {\n\treturn (\n\t\t<div className=\"space-y-3\">\n\t\t\t<div className=\"flex items-start justify-between gap-2\">\n\t\t\t\t<Skeleton className=\"h-6 w-3/4\" />\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close panel\"\n\t\t\t\t\tclassName=\"shrink-0 -mt-1 -mr-2\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<Skeleton className=\"h-5 w-1/2\" />\n\t\t\t<Skeleton className=\"h-5 w-full\" />\n\t\t\t<Skeleton className=\"h-5 w-2/3\" />\n\t\t\t<Skeleton className=\"h-5 w-1/2\" />\n\t\t</div>\n\t);\n}\n\ntype TaskRunDetailsProps = {\n\ttaskRunId: string;\n\tonClose: () => void;\n};\n\nfunction TaskRunDetails({ taskRunId, onClose }: TaskRunDetailsProps) {\n\tconst { data: taskRun } = useSuspenseQuery(buildGetTaskRunQuery(taskRunId));\n\n\tconst duration =\n\t\ttaskRun.estimated_run_time && taskRun.estimated_run_time > 0\n\t\t\t? taskRun.estimated_run_time\n\t\t\t: (taskRun.total_run_time ?? 0);\n\n\treturn (\n\t\t<div className=\"space-y-3\">\n\t\t\t<div className=\"flex items-start justify-between gap-2\">\n\t\t\t\t<h3 className=\"font-semibold text-base\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto=\"/runs/task-run/$id\"\n\t\t\t\t\t\tparams={{ id: taskRunId }}\n\t\t\t\t\t\tclassName=\"hover:underline text-foreground\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{taskRun.name}\n\t\t\t\t\t</Link>\n\t\t\t\t</h3>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close panel\"\n\t\t\t\t\tclassName=\"shrink-0 -mt-1 -mr-2\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<div className=\"space-y-3\">\n\t\t\t\t{taskRun.state && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"State\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t<StateBadge type={taskRun.state.type} name={taskRun.state.name} />\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<KeyValue label=\"Task Run ID\" value={taskRun.id} copyable />\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Duration\"\n\t\t\t\t\tvalue={duration > 0 ? secondsToApproximateString(duration) : \"-\"}\n\t\t\t\t/>\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<FormattedDate date={taskRun.created} />}\n\t\t\t\t/>\n\t\t\t\t{taskRun.tags && taskRun.tags.length > 0 && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"Tags\"\n\t\t\t\t\t\tvalue={<TagBadgeGroup tags={taskRun.tags} />}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\ntype FlowRunDetailsProps = {\n\tflowRunId: string;\n\tonClose: () => void;\n};\n\nfunction FlowRunDetails({ flowRunId, onClose }: FlowRunDetailsProps) {\n\tconst { data: flowRun } = useSuspenseQuery(\n\t\tbuildGetFlowRunDetailsQuery(flowRunId),\n\t);\n\n\tconst duration = flowRun.total_run_time ?? 0;\n\n\treturn (\n\t\t<div className=\"space-y-3\">\n\t\t\t<div className=\"flex items-start justify-between gap-2\">\n\t\t\t\t<h3 className=\"font-semibold text-base\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto=\"/runs/flow-run/$id\"\n\t\t\t\t\t\tparams={{ id: flowRunId }}\n\t\t\t\t\t\tclassName=\"hover:underline text-foreground\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{flowRun.name}\n\t\t\t\t\t</Link>\n\t\t\t\t</h3>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close panel\"\n\t\t\t\t\tclassName=\"shrink-0 -mt-1 -mr-2\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<div className=\"space-y-3\">\n\t\t\t\t{flowRun.state && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"State\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t<StateBadge type={flowRun.state.type} name={flowRun.state.name} />\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<KeyValue label=\"Flow Run ID\" value={flowRun.id} copyable />\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Duration\"\n\t\t\t\t\tvalue={duration > 0 ? secondsToApproximateString(duration) : \"-\"}\n\t\t\t\t/>\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<FormattedDate date={flowRun.created} />}\n\t\t\t\t/>\n\t\t\t\t{flowRun.tags && flowRun.tags.length > 0 && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"Tags\"\n\t\t\t\t\t\tvalue={<TagBadgeGroup tags={flowRun.tags} />}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import type { StateSelection } from \"@prefecthq/graphs\";\nimport { useEffect, useRef } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\n\ntype FlowRunGraphStatePopoverProps = {\n\tselection: StateSelection;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphStatePopover({\n\tselection,\n\tonClose,\n}: FlowRunGraphStatePopoverProps) {\n\tconst popoverRef = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tif (\n\t\t\t\tpopoverRef.current &&\n\t\t\t\t!popoverRef.current.contains(event.target as Node)\n\t\t\t) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tif (event.key === \"Escape\") {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener(\"mousedown\", handleClickOutside);\n\t\tdocument.addEventListener(\"keydown\", handleEscape);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousedown\", handleClickOutside);\n\t\t\tdocument.removeEventListener(\"keydown\", handleEscape);\n\t\t};\n\t}, [onClose]);\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst popoverStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t\ttransform: \"translateX(-50%)\",\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tref={popoverRef}\n\t\t\tclassName=\"z-50 w-64 rounded-lg border bg-card p-4 shadow-md\"\n\t\t\tstyle={popoverStyle}\n\t\t>\n\t\t\t<div className=\"flex justify-end absolute top-2 right-2\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<div className=\"space-y-3\">\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"State\"\n\t\t\t\t\tvalue={<StateBadge type={selection.type} name={selection.name} />}\n\t\t\t\t/>\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Occurred\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<FormattedDate date={selection.timestamp} format=\"timestamp\" />\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import {\n\temitter,\n\ttype GraphItemSelection,\n\tisArtifactsSelection,\n\tisEventSelection,\n\tisEventsSelection,\n\tisNodeSelection,\n\tisStateSelection,\n\ttype RunGraphConfig,\n\ttype RunGraphNode,\n\ttype RunGraphStateEvent,\n\tselectItem,\n\tsetConfig,\n\tstart,\n\tstop,\n\tupdateViewportFromDateRange,\n\ttype ViewportDateRange,\n} from \"@prefecthq/graphs\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useTheme } from \"next-themes\";\nimport {\n\ttype CSSProperties,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport { buildCountFlowRunsQuery } from \"@/api/flow-runs\";\nimport { buildCountTaskRunsQuery } from \"@/api/task-runs\";\nimport { getStateColor } from \"@/utils/state-colors\";\nimport { fetchFlowRunEvents, fetchFlowRunGraph } from \"./api\";\nimport { stateTypeShades } from \"./consts\";\nimport { FlowRunGraphActions } from \"./flow-run-graph-actions\";\nimport { FlowRunGraphArtifactDrawer } from \"./flow-run-graph-artifact-drawer\";\nimport { FlowRunGraphArtifactsPopover } from \"./flow-run-graph-artifacts-popover\";\nimport { FlowRunGraphEventPopover } from \"./flow-run-graph-event-popover\";\nimport { FlowRunGraphEventsPopover } from \"./flow-run-graph-events-popover\";\nimport { FlowRunGraphSelectionPanel } from \"./flow-run-graph-selection-panel\";\nimport { FlowRunGraphStatePopover } from \"./flow-run-graph-state-popover\";\n\nconst TERMINAL_STATES = [\"COMPLETED\", \"FAILED\", \"CANCELLED\", \"CRASHED\"];\n\ntype FlowRunGraphProps = {\n\tflowRunId: string;\n\tstateType?: string;\n\tviewport?: ViewportDateRange;\n\tonViewportChange?: (viewport: ViewportDateRange) => void;\n\tselected?: GraphItemSelection;\n\tonSelectedChange?: (selected: GraphItemSelection | undefined) => void;\n\tfullscreen?: boolean;\n\tonFullscreenChange?: (fullscreen: boolean) => void;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n};\n\nexport function FlowRunGraph({\n\tflowRunId,\n\tstateType,\n\tviewport,\n\tonViewportChange,\n\tselected: controlledSelected,\n\tonSelectedChange,\n\tclassName,\n\tstyle,\n\tfullscreen: controlledFullscreen,\n\tonFullscreenChange,\n}: FlowRunGraphProps) {\n\tconst stageRef = useRef<HTMLDivElement>(null);\n\tconst [internalFullscreen, setInternalFullscreen] = useState(false);\n\tconst [internalSelected, setInternalSelected] = useState<\n\t\tGraphItemSelection | undefined\n\t>(undefined);\n\tconst [selectedArtifactId, setSelectedArtifactId] = useState<string | null>(\n\t\tnull,\n\t);\n\tconst { resolvedTheme } = useTheme();\n\n\tconst fullscreen = controlledFullscreen ?? internalFullscreen;\n\tconst selected = controlledSelected ?? internalSelected;\n\tconst isTerminal = stateType && TERMINAL_STATES.includes(stateType);\n\n\tconst { data: taskRunCount } = useQuery(\n\t\tbuildCountTaskRunsQuery({\n\t\t\ttask_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tflow_run_id: { operator: \"and_\", any_: [flowRunId], is_null_: false },\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst { data: subflowRunCount } = useQuery(\n\t\tbuildCountFlowRunsQuery({\n\t\t\tflow_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tparent_flow_run_id: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tany_: [flowRunId],\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst hasNodes =\n\t\ttaskRunCount === undefined ||\n\t\tsubflowRunCount === undefined ||\n\t\ttaskRunCount > 0 ||\n\t\tsubflowRunCount > 0;\n\n\tconst updateFullscreen = useCallback(\n\t\t(value: boolean) => {\n\t\t\tsetInternalFullscreen(value);\n\t\t\tonFullscreenChange?.(value);\n\t\t},\n\t\t[onFullscreenChange],\n\t);\n\n\tconst config = useMemo<RunGraphConfig>(\n\t\t() => ({\n\t\t\trunId: flowRunId,\n\t\t\tfetch: fetchFlowRunGraph,\n\t\t\tfetchEvents: fetchFlowRunEvents,\n\t\t\tstyles: () => ({\n\t\t\t\tnode: (node: RunGraphNode) => ({\n\t\t\t\t\tbackground: getStateColor(\n\t\t\t\t\t\tnode.state_type,\n\t\t\t\t\t\tstateTypeShades[node.state_type],\n\t\t\t\t\t),\n\t\t\t\t}),\n\t\t\t\tstate: (event: RunGraphStateEvent) => ({\n\t\t\t\t\tbackground: getStateColor(event.type, stateTypeShades[event.type]),\n\t\t\t\t}),\n\t\t\t}),\n\t\t\ttheme: resolvedTheme === \"dark\" ? \"dark\" : \"light\",\n\t\t}),\n\t\t[flowRunId, resolvedTheme],\n\t);\n\n\tuseEffect(() => {\n\t\tsetConfig(config);\n\t}, [config]);\n\n\tuseEffect(() => {\n\t\tif (!stageRef.current) {\n\t\t\tthrow new Error(\"Stage does not exist\");\n\t\t}\n\n\t\tstart({\n\t\t\tstage: stageRef.current,\n\t\t\tconfig,\n\t\t});\n\n\t\treturn () => {\n\t\t\tstop();\n\t\t};\n\t}, [config]);\n\n\tuseEffect(() => {\n\t\tselectItem(selected ?? null);\n\t}, [selected]);\n\n\tuseEffect(() => {\n\t\tvoid updateViewportFromDateRange(viewport);\n\t}, [viewport]);\n\n\tuseEffect(() => {\n\t\tconst offItemSelected = emitter.on(\"itemSelected\", (nodeId) => {\n\t\t\tconst selection = nodeId ?? undefined;\n\t\t\tsetInternalSelected(selection);\n\t\t\tonSelectedChange?.(selection);\n\t\t});\n\t\tconst offViewportDateRangeUpdated = emitter.on(\n\t\t\t\"viewportDateRangeUpdated\",\n\t\t\t(range) => onViewportChange?.(range),\n\t\t);\n\n\t\treturn () => {\n\t\t\toffItemSelected();\n\t\t\toffViewportDateRangeUpdated();\n\t\t};\n\t}, [onSelectedChange, onViewportChange]);\n\n\tconst heightClass = fullscreen\n\t\t? \"fixed inset-0 z-50 bg-background\"\n\t\t: hasNodes\n\t\t\t? \"relative h-96 w-full\"\n\t\t\t: \"relative h-40 w-full\";\n\n\treturn (\n\t\t<div className={`${heightClass} ${className ?? \"\"}`} style={style}>\n\t\t\t<div ref={stageRef} className=\"size-full [&>canvas]:size-full\" />\n\t\t\t{!hasNodes && (\n\t\t\t\t<div className=\"absolute inset-0 flex items-center justify-center bg-background/50\">\n\t\t\t\t\t<p className=\"text-muted-foreground\">\n\t\t\t\t\t\t{isTerminal\n\t\t\t\t\t\t\t? \"This flow run did not generate any task or subflow runs\"\n\t\t\t\t\t\t\t: \"This flow run has not yet generated any task or subflow runs\"}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div className=\"absolute bottom-2 right-2\">\n\t\t\t\t<FlowRunGraphActions\n\t\t\t\t\tfullscreen={fullscreen}\n\t\t\t\t\tonFullscreenChange={updateFullscreen}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{selected && isNodeSelection(selected) && (\n\t\t\t\t<FlowRunGraphSelectionPanel\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isStateSelection(selected) && (\n\t\t\t\t<FlowRunGraphStatePopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isEventSelection(selected) && (\n\t\t\t\t<FlowRunGraphEventPopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isEventsSelection(selected) && (\n\t\t\t\t<FlowRunGraphEventsPopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isArtifactsSelection(selected) && (\n\t\t\t\t<FlowRunGraphArtifactsPopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t\tonViewArtifact={(artifactId) => {\n\t\t\t\t\t\tsetSelectedArtifactId(artifactId);\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<FlowRunGraphArtifactDrawer\n\t\t\t\tartifactId={selectedArtifactId}\n\t\t\t\tonClose={() => setSelectedArtifactId(null)}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"names":["fetchFlowRunGraph","id","data","getQueryService","mapApiResponseToRunGraphData","fetchFlowRunEvents","since","until","nodeId","mapApiResponseToRunGraphEvents","response","parseISO","node","mapNode","mapState","event","mapArtifact","state","artifact","stateTypeShades","isEventTargetInput","target","center","centerViewport","FlowRunGraphCenterButton","useEffect","controller","Tooltip","jsx","TooltipTrigger","Button","Icon","TooltipContent","FlowRunGraphFullscreenButton","fullscreen","onFullscreenChange","toggleFullscreen","useCallback","layoutOptions","increaseScale","multiplier","DEFAULT_HORIZONTAL_SCALE_MULTIPLIER","scale","layout","setHorizontalScaleMultiplier","decreaseScale","resetScale","resetHorizontalScaleMultiplier","isLayoutOption","value","horizontal","vertical","isHorizontalMode","isVerticalMode","FlowRunGraphSettings","selectedLayoutOption","setSelectedLayoutOption","useState","hideEdges","setHideEdges","hideArtifacts","setHideArtifacts","hideEvents","setHideEvents","handleLayoutChange","setHorizontalMode","setVerticalMode","handleHideEdgesChange","setDisabledEdges","handleHideArtifactsChange","setDisabledArtifacts","handleHideEventsChange","setDisabledEvents","jsxs","Typography","option","e","Label","Switch","FlowRunGraphSettingsButton","Popover","PopoverTrigger","PopoverContent","FlowRunGraphActions","FlowRunGraphArtifactDrawer","artifactId","onClose","Sheet","open","SheetContent","SheetHeader","SheetTitle","Suspense","ArtifactContentSkeleton","ArtifactContent","Skeleton","useSuspenseQuery","buildGetArtifactQuery","KeyValue","FormattedDate","FlowRunGraphArtifactsPopover","selection","onViewArtifact","artifacts","isLoading","useQuery","buildListArtifactsQuery","position","anchorStyle","PopoverAnchor","getEventLabel","eventName","label","formatDateNumeric","date","parsedDate","isValid","format","getResourceName","resource","EventResourceSection","resourceName","prefectResourceId","resourceType","parseResourceType","extractedId","extractResourceId","relatedResources","ResourceDisplaySkeleton","EventResourceLink","ResourceDisplayWithIcon","ResolvedResourceDisplay","RelatedResourcesSection","filteredResources","role","resourceId","FlowRunGraphEventPopover","buildGetEventQuery","eventLabel","Link","FlowRunGraphEventsPopover","eventQueries","useQueries","q","events","ScrollArea","FlowRunGraphSelectionPanel","isNodeSelection","SelectionPanelSkeleton","TaskRunDetails","FlowRunDetails","taskRunId","taskRun","buildGetTaskRunQuery","duration","StateBadge","secondsToApproximateString","TagBadgeGroup","flowRunId","flowRun","buildGetFlowRunDetailsQuery","FlowRunGraphStatePopover","popoverRef","useRef","handleClickOutside","handleEscape","popoverStyle","TERMINAL_STATES","FlowRunGraph","stateType","viewport","onViewportChange","controlledSelected","onSelectedChange","className","style","controlledFullscreen","stageRef","internalFullscreen","setInternalFullscreen","internalSelected","setInternalSelected","selectedArtifactId","setSelectedArtifactId","resolvedTheme","useTheme","selected","isTerminal","taskRunCount","buildCountTaskRunsQuery","subflowRunCount","buildCountFlowRunsQuery","hasNodes","updateFullscreen","config","useMemo","getStateColor","setConfig","start","stop","selectItem","updateViewportFromDateRange","offItemSelected","emitter","offViewportDateRangeUpdated","range","heightClass","isStateSelection","isEventSelection","isEventsSelection","isArtifactsSelection"],"mappings":"2nDAmBA,eAAsBA,GAAkBC,EAAmC,CAC1E,KAAM,CAAE,KAAAC,CAAA,EAAS,MAAO,MAAMC,MAAmB,IAChD,2BACA,CACC,OAAQ,CAAE,KAAM,CAAE,GAAAF,EAAG,CAAE,CACxB,EAGD,GAAI,CAACC,EACJ,MAAM,IAAI,MAAM,2BAA2B,EAG5C,OAAOE,GAA6BF,CAAI,CACzC,CASA,eAAsBG,GAAmB,CACxC,MAAAC,EACA,MAAAC,EACA,OAAAC,CACD,EAAyD,CACxD,KAAM,CAAE,KAAAN,GAAS,MAAO,MAAMC,GAAA,GAAmB,KAAK,iBAAkB,CACvE,KAAM,CACL,OAAQ,CACP,aAAc,CACb,GAAI,CAAC,oBAAoBK,CAAM,EAAE,CAAA,EAElC,MAAO,CACN,eAAgB,CAAC,oBAAqB,mBAAmB,CAAA,EAE1D,SAAU,CACT,MAAOF,EAAM,YAAA,EACb,MAAOC,EAAM,YAAA,CAAY,EAE1B,MAAO,KAAA,EAER,MAAO,EAAA,CACR,CACA,EAED,GAAI,CAACL,EACJ,MAAM,IAAI,MAAM,2BAA2B,EAG5C,OAAOO,GAA+BP,CAAI,CAC3C,CAQA,SAASE,GAA6BM,EAAuC,CAC5E,GAAI,CAACA,EAAS,WACb,MAAM,IAAI,MAAM,wBAAwB,EAGzC,MAAO,CACN,cAAeA,EAAS,cACxB,WAAYC,EAASD,EAAS,UAAU,EACxC,SAAUA,EAAS,SAAWC,EAASD,EAAS,QAAQ,EAAI,KAC5D,MA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AACgH,GAAA,CACA,UAAW8C,EACX,QAAS,IAAM,CACdL,EAAoB,MAAS,EAC7BR,IAAmB,MAAS,CAC7B,CAAA,CAAA,EAGDa,GAAYwB,GAAqBxB,CAAQ,GACzC9J,EAAAA,IAACwE,GAAA,CACA,UAAWsF,EACX,QAAS,IAAM,CACdL,EAAoB,MAAS,EAC7BR,IAAmB,MAAS,CAC7B,EACA,eAAiBxF,GAAe,CAC/BkG,EAAsBlG,CAAU,EAChCgG,EAAoB,MAAS,EAC7BR,IAAmB,MAAS,CAC7B,CAAA,CAAA,EAGFjJ,EAAAA,IAACwD,GAAA,CACA,WAAYkG,GACZ,QAAS,IAAMC,EAAsB,IAAI,CAAA,CAAA,CAC1C,EACD,CAEF"}
1
+ {"version":3,"file":"flow-run-graph-BhzuSJLm.js","sources":["../../src/components/flow-runs/flow-run-graph/api.ts","../../src/components/flow-runs/flow-run-graph/consts.ts","../../src/components/flow-runs/flow-run-graph/utilities.ts","../../src/components/flow-runs/flow-run-graph/flow-run-graph-center-button.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-fullscreen-button.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-settings.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-settings-button.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-actions.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-artifact-drawer.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-artifacts-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-event-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-events-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-selection-panel.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph-state-popover.tsx","../../src/components/flow-runs/flow-run-graph/flow-run-graph.tsx"],"sourcesContent":["import type {\n\tEventRelatedResource,\n\tRunGraphArtifact,\n\tRunGraphData,\n\tRunGraphEvent,\n\tRunGraphEventResource,\n\tRunGraphFetchEventsContext,\n\tRunGraphNode,\n\tRunGraphStateEvent,\n} from \"@prefecthq/graphs\";\nimport { parseISO } from \"date-fns\";\nimport type { components } from \"@/api/prefect\";\nimport { getQueryService } from \"@/api/service\";\n\n/**\n * Fetches the graph data for a flow run.\n * @param id - The ID of the flow run.\n * @returns The graph data for the flow run.\n */\nexport async function fetchFlowRunGraph(id: string): Promise<RunGraphData> {\n\tconst { data } = await (await getQueryService()).GET(\n\t\t\"/flow_runs/{id}/graph-v2\",\n\t\t{\n\t\t\tparams: { path: { id } },\n\t\t},\n\t);\n\n\tif (!data) {\n\t\tthrow new Error(\"No data returned from API\");\n\t}\n\n\treturn mapApiResponseToRunGraphData(data);\n}\n\n/**\n * Fetches events for a flow run.\n * @param since - The start date of the events to fetch.\n * @param until - The end date of the events to fetch.\n * @param nodeId - The flowRunId of the node to fetch events for.\n * @returns The events for the flow run.\n */\nexport async function fetchFlowRunEvents({\n\tsince,\n\tuntil,\n\tnodeId,\n}: RunGraphFetchEventsContext): Promise<RunGraphEvent[]> {\n\tconst { data } = await (await getQueryService()).POST(\"/events/filter\", {\n\t\tbody: {\n\t\t\tfilter: {\n\t\t\t\tany_resource: {\n\t\t\t\t\tid: [`prefect.flow-run.${nodeId}`],\n\t\t\t\t},\n\t\t\t\tevent: {\n\t\t\t\t\texclude_prefix: [\"prefect.log.write\", \"prefect.task-run.\"],\n\t\t\t\t},\n\t\t\t\toccurred: {\n\t\t\t\t\tsince: since.toISOString(),\n\t\t\t\t\tuntil: until.toISOString(),\n\t\t\t\t},\n\t\t\t\torder: \"ASC\",\n\t\t\t},\n\t\t\tlimit: 50,\n\t\t},\n\t});\n\n\tif (!data) {\n\t\tthrow new Error(\"No data returned from API\");\n\t}\n\n\treturn mapApiResponseToRunGraphEvents(data);\n}\n\ntype GraphResponse = components[\"schemas\"][\"Graph\"];\ntype GraphResponseNode = GraphResponse[\"nodes\"][number];\ntype GraphResponseArtifact = GraphResponse[\"artifacts\"][number];\ntype GraphResponseState = NonNullable<GraphResponse[\"states\"]>[number];\ntype EventsResponse = components[\"schemas\"][\"EventPage\"];\n\nfunction mapApiResponseToRunGraphData(response: GraphResponse): RunGraphData {\n\tif (!response.start_time) {\n\t\tthrow new Error(\"Start time is required\");\n\t}\n\n\treturn {\n\t\troot_node_ids: response.root_node_ids,\n\t\tstart_time: parseISO(response.start_time),\n\t\tend_time: response.end_time ? parseISO(response.end_time) : null,\n\t\tnodes: new Map(response.nodes.map((node) => mapNode(node))),\n\t\tstates: response.states?.map(mapState) ?? [],\n\t};\n}\n\nexport function mapApiResponseToRunGraphEvents(\n\tresponse: EventsResponse,\n): RunGraphEvent[] {\n\treturn response.events.map((event) => {\n\t\tif (!event.received) {\n\t\t\tthrow new Error(\"Received is required\");\n\t\t}\n\n\t\tconst runGraphEvent: RunGraphEvent = {\n\t\t\tid: event.id,\n\t\t\treceived: parseISO(event.received),\n\t\t\toccurred: parseISO(event.occurred),\n\t\t\tevent: event.event,\n\t\t\tresource: event.resource as RunGraphEventResource,\n\t\t\tpayload: event.payload,\n\t\t\trelated: (event.related ?? []) as EventRelatedResource[],\n\t\t};\n\n\t\treturn runGraphEvent;\n\t});\n}\n\nfunction mapNode([id, node]: GraphResponseNode): [string, RunGraphNode] {\n\tif (!node.start_time) {\n\t\tthrow new Error(\"Start time is required\");\n\t}\n\n\treturn [\n\t\tid,\n\t\t{\n\t\t\tkind: node.kind,\n\t\t\tid: node.id,\n\t\t\tlabel: node.label,\n\t\t\tstate_type: node.state_type,\n\t\t\tstart_time: parseISO(node.start_time),\n\t\t\tend_time: node.end_time ? parseISO(node.end_time) : null,\n\t\t\tparents: node.parents,\n\t\t\tchildren: node.children,\n\t\t\tartifacts: node.artifacts.map(mapArtifact),\n\t\t},\n\t];\n}\n\nfunction mapState(state: GraphResponseState): RunGraphStateEvent {\n\treturn {\n\t\tid: state.id,\n\t\ttimestamp: parseISO(state.timestamp),\n\t\ttype: state.type,\n\t\tname: state.name,\n\t};\n}\n\nfunction mapArtifact(artifact: GraphResponseArtifact): RunGraphArtifact {\n\tif (!artifact.type) {\n\t\tthrow new Error(\"Artifact type is required\");\n\t}\n\n\tif (artifact.type === \"progress\" && typeof artifact.data === \"number\") {\n\t\treturn {\n\t\t\tid: artifact.id,\n\t\t\tcreated: parseISO(artifact.created),\n\t\t\tkey: artifact.key ?? undefined,\n\t\t\ttype: artifact.type,\n\t\t\tdata: artifact.data,\n\t\t};\n\t}\n\n\treturn {\n\t\tid: artifact.id,\n\t\tcreated: parseISO(artifact.created),\n\t\tkey: artifact.key ?? undefined,\n\t\ttype: artifact.type as Exclude<RunGraphArtifact[\"type\"], \"progress\">,\n\t};\n}\n","import type { StateType } from \"@prefecthq/graphs\";\n\n/**\n * Shade values for each state type, used with getStateColor().\n * Different states use different shades for visual distinction.\n * See: ui-v2/src/index.css for the CSS variable definitions.\n */\nexport const stateTypeShades: Record<StateType, number> = {\n\tCOMPLETED: 600,\n\tRUNNING: 700,\n\tSCHEDULED: 700,\n\tPENDING: 800,\n\tFAILED: 700,\n\tCANCELLED: 600,\n\tCANCELLING: 600,\n\tCRASHED: 600,\n\tPAUSED: 800,\n};\n","export function isEventTargetInput(target: EventTarget | null): boolean {\n\tif (!target || !(target instanceof HTMLElement)) {\n\t\treturn false;\n\t}\n\treturn [\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(target.tagName);\n}\n","import { centerViewport } from \"@prefecthq/graphs\";\nimport { useEffect } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons/icon\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { isEventTargetInput } from \"./utilities\";\n\nconst center = () => {\n\tvoid centerViewport({ animate: true });\n};\n\nexport function FlowRunGraphCenterButton() {\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\n\t\tdocument.addEventListener(\n\t\t\t\"keydown\",\n\t\t\t(event: KeyboardEvent) => {\n\t\t\t\tif (\n\t\t\t\t\tisEventTargetInput(event.target) ||\n\t\t\t\t\tevent.metaKey ||\n\t\t\t\t\tevent.ctrlKey\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.key === \"c\") {\n\t\t\t\t\tcenter();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\n\t\treturn () => controller.abort();\n\t}, []);\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>\n\t\t\t\t<Button variant=\"ghost\" size=\"icon\" onClick={center}>\n\t\t\t\t\t<Icon id=\"Crosshair\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</TooltipTrigger>\n\t\t\t<TooltipContent>Recenter (c)</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n","import { useCallback, useEffect } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons/icon\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { isEventTargetInput } from \"./utilities\";\n\ntype FlowRunGraphFullscreenButtonProps = {\n\tfullscreen: boolean;\n\tonFullscreenChange: (fullscreen: boolean) => void;\n};\n\nexport function FlowRunGraphFullscreenButton({\n\tfullscreen,\n\tonFullscreenChange,\n}: FlowRunGraphFullscreenButtonProps) {\n\tconst toggleFullscreen = useCallback(() => {\n\t\tonFullscreenChange(!fullscreen);\n\t}, [fullscreen, onFullscreenChange]);\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\n\t\tdocument.addEventListener(\n\t\t\t\"keydown\",\n\t\t\t(event: KeyboardEvent) => {\n\t\t\t\tif (\n\t\t\t\t\tisEventTargetInput(event.target) ||\n\t\t\t\t\tevent.metaKey ||\n\t\t\t\t\tevent.ctrlKey\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.key === \"f\") {\n\t\t\t\t\ttoggleFullscreen();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\ttoggleFullscreen();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ signal: controller.signal },\n\t\t);\n\n\t\treturn () => controller.abort();\n\t}, [toggleFullscreen]);\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>\n\t\t\t\t<Button variant=\"ghost\" size=\"icon\" onClick={toggleFullscreen}>\n\t\t\t\t\t<Icon id=\"Expand\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</TooltipTrigger>\n\t\t\t<TooltipContent>Fullscreen (f)</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n","import {\n\tDEFAULT_HORIZONTAL_SCALE_MULTIPLIER,\n\ttype HorizontalMode,\n\tisHorizontalMode,\n\tisVerticalMode,\n\tlayout,\n\tresetHorizontalScaleMultiplier,\n\tsetDisabledArtifacts,\n\tsetDisabledEdges,\n\tsetDisabledEvents,\n\tsetHorizontalMode,\n\tsetHorizontalScaleMultiplier,\n\tsetVerticalMode,\n\ttype VerticalMode,\n} from \"@prefecthq/graphs\";\nimport { useCallback, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Label } from \"@/components/ui/label\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { Typography } from \"@/components/ui/typography\";\n\ntype LayoutOption = `${HorizontalMode}_${VerticalMode}`;\n\nconst layoutOptions: { label: string; value: LayoutOption }[] = [\n\t{\n\t\tlabel: \"Temporal dependency\",\n\t\tvalue: \"temporal_nearest-parent\",\n\t},\n\t{\n\t\tlabel: \"Temporal sequence\",\n\t\tvalue: \"temporal_waterfall\",\n\t},\n\t{\n\t\tlabel: \"Dependency grid\",\n\t\tvalue: \"dependency_nearest-parent\",\n\t},\n\t{\n\t\tlabel: \"Sequential grid\",\n\t\tvalue: \"dependency_waterfall\",\n\t},\n\t{\n\t\tlabel: \"Comparative duration\",\n\t\tvalue: \"left-aligned_duration-sorted\",\n\t},\n];\n\nconst increaseScale = () => {\n\tconst multiplier = DEFAULT_HORIZONTAL_SCALE_MULTIPLIER + 1;\n\tconst scale = layout.horizontalScaleMultiplier * multiplier;\n\tsetHorizontalScaleMultiplier(scale);\n};\n\nconst decreaseScale = () => {\n\tconst multiplier = Math.abs(DEFAULT_HORIZONTAL_SCALE_MULTIPLIER - 1);\n\tconst scale = layout.horizontalScaleMultiplier * multiplier;\n\tsetHorizontalScaleMultiplier(scale);\n};\n\nconst resetScale = () => {\n\tresetHorizontalScaleMultiplier();\n};\n\nfunction isLayoutOption(value: string): value is LayoutOption {\n\tconst [horizontal, vertical] = value.split(\"_\");\n\treturn isHorizontalMode(horizontal) && isVerticalMode(vertical);\n}\n\nexport function FlowRunGraphSettings() {\n\tconst [selectedLayoutOption, setSelectedLayoutOption] = useState(\n\t\t`${layout.horizontal}_${layout.vertical}`,\n\t);\n\tconst [hideEdges, setHideEdges] = useState(layout.disableEdges);\n\tconst [hideArtifacts, setHideArtifacts] = useState(layout.disableArtifacts);\n\tconst [hideEvents, setHideEvents] = useState(layout.disableEvents);\n\n\tconst handleLayoutChange = useCallback((value: string) => {\n\t\tif (!isLayoutOption(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [horizontal, vertical] = value.split(\"_\");\n\n\t\tif (!isHorizontalMode(horizontal) || !isVerticalMode(vertical)) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectedLayoutOption(value);\n\t\tsetHorizontalMode(horizontal);\n\t\tsetVerticalMode(vertical);\n\t}, []);\n\n\tconst handleHideEdgesChange = useCallback((value: boolean) => {\n\t\tsetHideEdges(value);\n\t\tsetDisabledEdges(value);\n\t}, []);\n\n\tconst handleHideArtifactsChange = useCallback((value: boolean) => {\n\t\tsetHideArtifacts(value);\n\t\tsetDisabledArtifacts(value);\n\t}, []);\n\n\tconst handleHideEventsChange = useCallback((value: boolean) => {\n\t\tsetHideEvents(value);\n\t\tsetDisabledEvents(value);\n\t}, []);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t<Typography variant=\"bodyLarge\">Layout</Typography>\n\t\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t\t{layoutOptions.map((option) => (\n\t\t\t\t\t\t<div key={option.value} className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tid={option.value}\n\t\t\t\t\t\t\t\tname=\"layout\"\n\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\tchecked={selectedLayoutOption === option.value}\n\t\t\t\t\t\t\t\tonChange={(e) => handleLayoutChange(e.target.value)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Label htmlFor={option.value}>{option.label}</Label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{(layout.isTemporal() || layout.isLeftAligned()) && (\n\t\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t\t<Typography variant=\"bodyLarge\">Scaling</Typography>\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={decreaseScale}\n\t\t\t\t\t\t\ttitle=\"Decrease scale (-)\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t-\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tonClick={increaseScale}\n\t\t\t\t\t\t\ttitle=\"Increase scale (+)\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t+\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button variant=\"outline\" size=\"sm\" onClick={resetScale}>\n\t\t\t\t\t\t\tReset\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<hr className=\"my-4\" />\n\n\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Switch\n\t\t\t\t\t\tid=\"hideEdges\"\n\t\t\t\t\t\tchecked={hideEdges}\n\t\t\t\t\t\tonCheckedChange={handleHideEdgesChange}\n\t\t\t\t\t/>\n\t\t\t\t\t<Label htmlFor=\"hideEdges\">Hide dependency arrows</Label>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Switch\n\t\t\t\t\t\tid=\"hideArtifacts\"\n\t\t\t\t\t\tchecked={hideArtifacts}\n\t\t\t\t\t\tonCheckedChange={handleHideArtifactsChange}\n\t\t\t\t\t/>\n\t\t\t\t\t<Label htmlFor=\"hideArtifacts\">Hide artifacts</Label>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Switch\n\t\t\t\t\t\tid=\"hideEvents\"\n\t\t\t\t\t\tchecked={hideEvents}\n\t\t\t\t\t\tonCheckedChange={handleHideEventsChange}\n\t\t\t\t\t/>\n\t\t\t\t\t<Label htmlFor=\"hideEvents\">Hide events</Label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons/icon\";\nimport {\n\tPopover,\n\tPopoverContent,\n\tPopoverTrigger,\n} from \"@/components/ui/popover\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { FlowRunGraphSettings } from \"./flow-run-graph-settings\";\n\nexport function FlowRunGraphSettingsButton() {\n\treturn (\n\t\t<Popover>\n\t\t\t<PopoverTrigger>\n\t\t\t\t<Tooltip>\n\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon\">\n\t\t\t\t\t\t\t<Icon id=\"Cog\" className=\"size-4\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t<TooltipContent>Settings</TooltipContent>\n\t\t\t\t</Tooltip>\n\t\t\t</PopoverTrigger>\n\t\t\t<PopoverContent>\n\t\t\t\t<FlowRunGraphSettings />\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import { FlowRunGraphCenterButton } from \"./flow-run-graph-center-button\";\nimport { FlowRunGraphFullscreenButton } from \"./flow-run-graph-fullscreen-button\";\nimport { FlowRunGraphSettingsButton } from \"./flow-run-graph-settings-button\";\n\ntype FlowRunGraphActionsProps = {\n\tfullscreen: boolean;\n\tonFullscreenChange: (fullscreen: boolean) => void;\n};\n\nexport function FlowRunGraphActions({\n\tfullscreen,\n\tonFullscreenChange,\n}: FlowRunGraphActionsProps) {\n\treturn (\n\t\t<div className=\"flex gap-2\">\n\t\t\t<FlowRunGraphCenterButton />\n\t\t\t<FlowRunGraphFullscreenButton\n\t\t\t\tfullscreen={fullscreen}\n\t\t\t\tonFullscreenChange={onFullscreenChange}\n\t\t\t/>\n\t\t\t<FlowRunGraphSettingsButton />\n\t\t</div>\n\t);\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense } from \"react\";\nimport { buildGetArtifactQuery } from \"@/api/artifacts\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport {\n\tSheet,\n\tSheetContent,\n\tSheetHeader,\n\tSheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Typography } from \"@/components/ui/typography\";\n\ntype FlowRunGraphArtifactDrawerProps = {\n\tartifactId: string | null;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphArtifactDrawer({\n\tartifactId,\n\tonClose,\n}: FlowRunGraphArtifactDrawerProps) {\n\treturn (\n\t\t<Sheet\n\t\t\topen={artifactId !== null}\n\t\t\tonOpenChange={(open) => !open && onClose()}\n\t\t>\n\t\t\t<SheetContent>\n\t\t\t\t<SheetHeader>\n\t\t\t\t\t<SheetTitle>Artifact Details</SheetTitle>\n\t\t\t\t</SheetHeader>\n\t\t\t\t{artifactId && (\n\t\t\t\t\t<Suspense fallback={<ArtifactContentSkeleton />}>\n\t\t\t\t\t\t<ArtifactContent artifactId={artifactId} />\n\t\t\t\t\t</Suspense>\n\t\t\t\t)}\n\t\t\t</SheetContent>\n\t\t</Sheet>\n\t);\n}\n\nfunction ArtifactContentSkeleton() {\n\treturn (\n\t\t<div className=\"space-y-4 p-4\">\n\t\t\t<Skeleton className=\"h-6 w-32\" />\n\t\t\t<Skeleton className=\"h-4 w-24\" />\n\t\t\t<Skeleton className=\"h-4 w-48\" />\n\t\t\t<Skeleton className=\"h-32 w-full\" />\n\t\t</div>\n\t);\n}\n\nfunction ArtifactContent({ artifactId }: { artifactId: string }) {\n\tconst { data: artifact } = useSuspenseQuery(\n\t\tbuildGetArtifactQuery(artifactId),\n\t);\n\n\treturn (\n\t\t<div className=\"space-y-4 p-4\">\n\t\t\t<KeyValue\n\t\t\t\tlabel=\"Key\"\n\t\t\t\tvalue={\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"font-medium\">\n\t\t\t\t\t\t{artifact.key ?? \"Unnamed\"}\n\t\t\t\t\t</Typography>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{artifact.type && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Type\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"uppercase\">\n\t\t\t\t\t\t\t{artifact.type}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{artifact.description && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Description\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Typography variant=\"bodySmall\">{artifact.description}</Typography>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{artifact.created && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<FormattedDate date={artifact.created} />}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{artifact.data !== undefined && artifact.data !== null && (\n\t\t\t\t<div className=\"space-y-2\">\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-muted-foreground\">\n\t\t\t\t\t\tData\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<pre className=\"bg-muted p-3 rounded-md text-sm overflow-auto max-h-64\">\n\t\t\t\t\t\t{typeof artifact.data === \"string\"\n\t\t\t\t\t\t\t? artifact.data\n\t\t\t\t\t\t\t: JSON.stringify(artifact.data, null, 2)}\n\t\t\t\t\t</pre>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import type { ArtifactsSelection } from \"@prefecthq/graphs\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { buildListArtifactsQuery } from \"@/api/artifacts\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\nimport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverContent,\n} from \"@/components/ui/popover\";\nimport { Typography } from \"@/components/ui/typography\";\n\ntype FlowRunGraphArtifactsPopoverProps = {\n\tselection: ArtifactsSelection;\n\tonClose: () => void;\n\tonViewArtifact: (artifactId: string) => void;\n};\n\nexport function FlowRunGraphArtifactsPopover({\n\tselection,\n\tonClose,\n\tonViewArtifact,\n}: FlowRunGraphArtifactsPopoverProps) {\n\tconst { data: artifacts, isLoading } = useQuery(\n\t\tbuildListArtifactsQuery({\n\t\t\tartifacts: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tid: { any_: selection.ids },\n\t\t\t},\n\t\t\tsort: \"CREATED_DESC\",\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst anchorStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t};\n\n\treturn (\n\t\t<Popover open onOpenChange={(open) => !open && onClose()}>\n\t\t\t<PopoverAnchor style={anchorStyle} />\n\t\t\t<PopoverContent align=\"center\" side=\"bottom\" className=\"w-72\">\n\t\t\t\t<div className=\"flex items-center justify-between mb-3\">\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"font-semibold\">\n\t\t\t\t\t\tArtifacts\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<div className=\"flex items-center justify-center py-4\">\n\t\t\t\t\t\t<Icon id=\"Loader2\" className=\"size-4 animate-spin\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"space-y-2 max-h-64 overflow-y-auto\">\n\t\t\t\t\t\t{artifacts\n\t\t\t\t\t\t\t?.filter((artifact) => artifact.id !== undefined)\n\t\t\t\t\t\t\t.map((artifact) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={artifact.id}\n\t\t\t\t\t\t\t\t\tclassName=\"flex items-center justify-between gap-2 p-2 rounded-md border bg-muted/50\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"flex flex-col min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"bodySmall\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"font-medium truncate\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{artifact.key ?? \"Unnamed\"}\n\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t{artifact.type && (\n\t\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"xsmall\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-muted-foreground uppercase\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{artifact.type}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => onViewArtifact(artifact.id as string)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import type { EventSelection } from \"@prefecthq/graphs\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { format, isValid, parseISO } from \"date-fns\";\nimport { Suspense } from \"react\";\nimport { buildGetEventQuery, type Event } from \"@/api/events\";\nimport type { components } from \"@/api/prefect\";\nimport {\n\tEventResourceLink,\n\textractResourceId,\n\tparseResourceType,\n\tResourceDisplaySkeleton,\n\tResourceDisplayWithIcon,\n} from \"@/components/events/event-resource-display\";\nimport { ResolvedResourceDisplay } from \"@/components/events/event-resource-display/resolved-resource-display\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverContent,\n} from \"@/components/ui/popover\";\n\ntype RelatedResource = components[\"schemas\"][\"RelatedResource\"];\n\ntype FlowRunGraphEventPopoverProps = {\n\tselection: EventSelection;\n\tonClose: () => void;\n};\n\n/**\n * Converts an event name like \"prefect.flow-run.Running\" to a human-readable label\n * like \"Flow run running\"\n */\nfunction getEventLabel(eventName: string): string {\n\t// Remove \"prefect.\" or \"prefect-cloud.\" prefix\n\tlet label = eventName;\n\tif (label.startsWith(\"prefect.\")) {\n\t\tlabel = label.slice(8);\n\t} else if (label.startsWith(\"prefect-cloud.\")) {\n\t\tlabel = label.slice(14);\n\t}\n\n\t// Replace dots, dashes, and underscores with spaces\n\tlabel = label.replace(/[._-]/g, \" \");\n\n\t// Capitalize first letter, lowercase the rest\n\treturn label.charAt(0).toUpperCase() + label.slice(1).toLowerCase();\n}\n\n/**\n * Formats a date to numeric format like \"2026/01/25 08:18:11 PM\"\n */\nfunction formatDateNumeric(date: string | Date): string {\n\tlet parsedDate: Date;\n\tif (typeof date === \"string\") {\n\t\tparsedDate = parseISO(date);\n\t} else {\n\t\tparsedDate = date;\n\t}\n\n\tif (!isValid(parsedDate)) {\n\t\treturn \"Invalid date\";\n\t}\n\n\treturn format(parsedDate, \"yyyy/MM/dd hh:mm:ss a\");\n}\n\nfunction getResourceName(resource: Record<string, string>): string | null {\n\treturn (\n\t\tresource[\"prefect.resource.name\"] ||\n\t\tresource[\"prefect.name\"] ||\n\t\tresource[\"prefect-cloud.name\"] ||\n\t\tnull\n\t);\n}\n\ntype EventResourceSectionProps = {\n\tevent: Event;\n};\n\nfunction EventResourceSection({ event }: EventResourceSectionProps) {\n\tconst resourceName = getResourceName(event.resource);\n\tconst prefectResourceId = event.resource[\"prefect.resource.id\"] || \"\";\n\tconst resourceType = parseResourceType(prefectResourceId);\n\tconst extractedId = extractResourceId(prefectResourceId);\n\tconst relatedResources = event.related ?? [];\n\n\t// If we have a resource name, display it with the appropriate icon\n\tif (resourceName) {\n\t\treturn (\n\t\t\t<Suspense fallback={<ResourceDisplaySkeleton />}>\n\t\t\t\t<EventResourceLink\n\t\t\t\t\tresource={event.resource as RelatedResource}\n\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t>\n\t\t\t\t\t<ResourceDisplayWithIcon\n\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\tdisplayText={resourceName}\n\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t/>\n\t\t\t\t</EventResourceLink>\n\t\t\t</Suspense>\n\t\t);\n\t}\n\n\t// If we have an extracted ID but no name, try to fetch the resource name via API\n\tif (extractedId && resourceType !== \"unknown\") {\n\t\treturn (\n\t\t\t<Suspense fallback={<ResourceDisplaySkeleton />}>\n\t\t\t\t<EventResourceLink\n\t\t\t\t\tresource={event.resource as RelatedResource}\n\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t>\n\t\t\t\t\t<ResolvedResourceDisplay\n\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\tresourceId={extractedId}\n\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t/>\n\t\t\t\t</EventResourceLink>\n\t\t\t</Suspense>\n\t\t);\n\t}\n\n\t// Fallback: show the raw resource ID\n\treturn (\n\t\t<span className=\"text-sm text-muted-foreground font-mono\">\n\t\t\t{prefectResourceId || \"Unknown\"}\n\t\t</span>\n\t);\n}\n\ntype RelatedResourcesSectionProps = {\n\trelatedResources: RelatedResource[];\n};\n\nfunction RelatedResourcesSection({\n\trelatedResources,\n}: RelatedResourcesSectionProps) {\n\t// Filter out tag resources and only show meaningful related resources\n\tconst filteredResources = relatedResources.filter((resource) => {\n\t\tconst role = resource[\"prefect.resource.role\"];\n\t\tconst resourceId = resource[\"prefect.resource.id\"] || \"\";\n\t\t// Exclude tags and resources without a valid type\n\t\tif (role === \"tag\" || resourceId.startsWith(\"prefect.tag.\")) {\n\t\t\treturn false;\n\t\t}\n\t\tconst resourceType = parseResourceType(resourceId);\n\t\treturn resourceType !== \"unknown\";\n\t});\n\n\tif (filteredResources.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<KeyValue\n\t\t\tlabel=\"Related Resources\"\n\t\t\tvalue={\n\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t{filteredResources.map((resource) => {\n\t\t\t\t\t\tconst resourceName = getResourceName(resource);\n\t\t\t\t\t\tconst prefectResourceId = resource[\"prefect.resource.id\"] || \"\";\n\t\t\t\t\t\tconst resourceType = parseResourceType(prefectResourceId);\n\t\t\t\t\t\tconst extractedId = extractResourceId(prefectResourceId);\n\n\t\t\t\t\t\tif (resourceName) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Suspense\n\t\t\t\t\t\t\t\t\tkey={prefectResourceId}\n\t\t\t\t\t\t\t\t\tfallback={<ResourceDisplaySkeleton />}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EventResourceLink\n\t\t\t\t\t\t\t\t\t\tresource={resource}\n\t\t\t\t\t\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\t\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ResourceDisplayWithIcon\n\t\t\t\t\t\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\t\t\t\t\t\tdisplayText={resourceName}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</EventResourceLink>\n\t\t\t\t\t\t\t\t</Suspense>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (extractedId && resourceType !== \"unknown\") {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Suspense\n\t\t\t\t\t\t\t\t\tkey={prefectResourceId}\n\t\t\t\t\t\t\t\t\tfallback={<ResourceDisplaySkeleton />}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EventResourceLink\n\t\t\t\t\t\t\t\t\t\tresource={resource}\n\t\t\t\t\t\t\t\t\t\trelatedResources={relatedResources}\n\t\t\t\t\t\t\t\t\t\tclassName=\"hover:underline text-primary\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ResolvedResourceDisplay\n\t\t\t\t\t\t\t\t\t\t\tresourceType={resourceType}\n\t\t\t\t\t\t\t\t\t\t\tresourceId={extractedId}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"text-sm\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</EventResourceLink>\n\t\t\t\t\t\t\t\t</Suspense>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tkey={prefectResourceId}\n\t\t\t\t\t\t\t\tclassName=\"text-sm text-muted-foreground font-mono\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{prefectResourceId}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport function FlowRunGraphEventPopover({\n\tselection,\n\tonClose,\n}: FlowRunGraphEventPopoverProps) {\n\tconst { data: event, isLoading } = useQuery(\n\t\tbuildGetEventQuery(selection.id, selection.occurred),\n\t);\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst anchorStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t};\n\n\tconst eventName = event?.event ?? \"\";\n\tconst eventLabel = eventName ? getEventLabel(eventName) : \"Loading...\";\n\tconst relatedResources = event?.related ?? [];\n\n\treturn (\n\t\t<Popover open onOpenChange={(open) => !open && onClose()}>\n\t\t\t<PopoverAnchor style={anchorStyle} />\n\t\t\t<PopoverContent align=\"center\" side=\"bottom\" className=\"w-80\">\n\t\t\t\t<div className=\"flex justify-between items-start mb-3\">\n\t\t\t\t\t<span className=\"text-sm text-muted-foreground\">Event</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t\t\tclassName=\"-mt-1 -mr-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<div className=\"flex items-center justify-center py-4\">\n\t\t\t\t\t\t<Icon id=\"Loader2\" className=\"size-4 animate-spin\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"space-y-3\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-0.5\">\n\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\tto=\"/events\"\n\t\t\t\t\t\t\t\tsearch={{ event: [eventName] }}\n\t\t\t\t\t\t\t\tclassName=\"text-sm text-primary hover:underline font-medium\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{eventLabel}\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t<span className=\"text-xs text-muted-foreground\">{eventName}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<KeyValue\n\t\t\t\t\t\t\tlabel=\"Occurred\"\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t<span className=\"text-sm\">\n\t\t\t\t\t\t\t\t\t{formatDateNumeric(selection.occurred)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{event && (\n\t\t\t\t\t\t\t<KeyValue\n\t\t\t\t\t\t\t\tlabel=\"Resource\"\n\t\t\t\t\t\t\t\tvalue={<EventResourceSection event={event} />}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{relatedResources.length > 0 && (\n\t\t\t\t\t\t\t<RelatedResourcesSection relatedResources={relatedResources} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import type { EventsSelection } from \"@prefecthq/graphs\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { buildGetEventQuery } from \"@/api/events\";\nimport { Button } from \"@/components/ui/button\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { Icon } from \"@/components/ui/icons\";\nimport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverContent,\n} from \"@/components/ui/popover\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\n\ntype FlowRunGraphEventsPopoverProps = {\n\tselection: EventsSelection;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphEventsPopover({\n\tselection,\n\tonClose,\n}: FlowRunGraphEventsPopoverProps) {\n\tconst eventQueries = useQueries({\n\t\tqueries: selection.ids.map((id) =>\n\t\t\tbuildGetEventQuery(id, selection.occurred ?? new Date()),\n\t\t),\n\t});\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst anchorStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t};\n\n\tconst isLoading = eventQueries.some((q) => q.isLoading);\n\tconst events = eventQueries\n\t\t.map((q) => q.data)\n\t\t.filter((e): e is NonNullable<typeof e> => e !== undefined);\n\n\treturn (\n\t\t<Popover open onOpenChange={(open) => !open && onClose()}>\n\t\t\t<PopoverAnchor style={anchorStyle} />\n\t\t\t<PopoverContent align=\"center\" side=\"bottom\" className=\"w-80\">\n\t\t\t\t<div className=\"flex items-center justify-between mb-2\">\n\t\t\t\t\t<span className=\"text-sm font-medium\">\n\t\t\t\t\t\t{selection.ids.length} Events\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<div className=\"flex items-center justify-center py-4\">\n\t\t\t\t\t\t<Icon id=\"Loader2\" className=\"size-4 animate-spin\" />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<ScrollArea className=\"max-h-64\">\n\t\t\t\t\t\t<div className=\"space-y-3\">\n\t\t\t\t\t\t\t{events.map((event) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tkey={event.id}\n\t\t\t\t\t\t\t\t\tclassName=\"border-b pb-2 last:border-b-0 last:pb-0\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"text-sm font-mono truncate\"\n\t\t\t\t\t\t\t\t\t\ttitle={event.event}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{event.event}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t<FormattedDate date={new Date(event.occurred)} />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ScrollArea>\n\t\t\t\t)}\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import { type GraphItemSelection, isNodeSelection } from \"@prefecthq/graphs\";\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { buildGetFlowRunDetailsQuery } from \"@/api/flow-runs\";\nimport { buildGetTaskRunQuery } from \"@/api/task-runs\";\nimport { Button } from \"@/components/ui/button\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport { secondsToApproximateString } from \"@/utils/seconds\";\n\ntype FlowRunGraphSelectionPanelProps = {\n\tselection: GraphItemSelection;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphSelectionPanel({\n\tselection,\n\tonClose,\n}: FlowRunGraphSelectionPanelProps) {\n\tif (!isNodeSelection(selection)) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"absolute top-4 right-4 z-10 w-72 rounded-lg border bg-card p-4 shadow-md\">\n\t\t\t<Suspense fallback={<SelectionPanelSkeleton onClose={onClose} />}>\n\t\t\t\t{selection.kind === \"task-run\" && (\n\t\t\t\t\t<TaskRunDetails taskRunId={selection.id} onClose={onClose} />\n\t\t\t\t)}\n\t\t\t\t{selection.kind === \"flow-run\" && (\n\t\t\t\t\t<FlowRunDetails flowRunId={selection.id} onClose={onClose} />\n\t\t\t\t)}\n\t\t\t</Suspense>\n\t\t</div>\n\t);\n}\n\ntype SelectionPanelSkeletonProps = {\n\tonClose: () => void;\n};\n\nfunction SelectionPanelSkeleton({ onClose }: SelectionPanelSkeletonProps) {\n\treturn (\n\t\t<div className=\"space-y-3\">\n\t\t\t<div className=\"flex items-start justify-between gap-2\">\n\t\t\t\t<Skeleton className=\"h-6 w-3/4\" />\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close panel\"\n\t\t\t\t\tclassName=\"shrink-0 -mt-1 -mr-2\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<Skeleton className=\"h-5 w-1/2\" />\n\t\t\t<Skeleton className=\"h-5 w-full\" />\n\t\t\t<Skeleton className=\"h-5 w-2/3\" />\n\t\t\t<Skeleton className=\"h-5 w-1/2\" />\n\t\t</div>\n\t);\n}\n\ntype TaskRunDetailsProps = {\n\ttaskRunId: string;\n\tonClose: () => void;\n};\n\nfunction TaskRunDetails({ taskRunId, onClose }: TaskRunDetailsProps) {\n\tconst { data: taskRun } = useSuspenseQuery(buildGetTaskRunQuery(taskRunId));\n\n\tconst duration =\n\t\ttaskRun.estimated_run_time && taskRun.estimated_run_time > 0\n\t\t\t? taskRun.estimated_run_time\n\t\t\t: (taskRun.total_run_time ?? 0);\n\n\treturn (\n\t\t<div className=\"space-y-3\">\n\t\t\t<div className=\"flex items-start justify-between gap-2\">\n\t\t\t\t<h3 className=\"font-semibold text-base\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto=\"/runs/task-run/$id\"\n\t\t\t\t\t\tparams={{ id: taskRunId }}\n\t\t\t\t\t\tclassName=\"hover:underline text-foreground\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{taskRun.name}\n\t\t\t\t\t</Link>\n\t\t\t\t</h3>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close panel\"\n\t\t\t\t\tclassName=\"shrink-0 -mt-1 -mr-2\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<div className=\"space-y-3\">\n\t\t\t\t{taskRun.state && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"State\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t<StateBadge type={taskRun.state.type} name={taskRun.state.name} />\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<KeyValue label=\"Task Run ID\" value={taskRun.id} copyable />\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Duration\"\n\t\t\t\t\tvalue={duration > 0 ? secondsToApproximateString(duration) : \"-\"}\n\t\t\t\t/>\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<FormattedDate date={taskRun.created} />}\n\t\t\t\t/>\n\t\t\t\t{taskRun.tags && taskRun.tags.length > 0 && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"Tags\"\n\t\t\t\t\t\tvalue={<TagBadgeGroup tags={taskRun.tags} />}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\ntype FlowRunDetailsProps = {\n\tflowRunId: string;\n\tonClose: () => void;\n};\n\nfunction FlowRunDetails({ flowRunId, onClose }: FlowRunDetailsProps) {\n\tconst { data: flowRun } = useSuspenseQuery(\n\t\tbuildGetFlowRunDetailsQuery(flowRunId),\n\t);\n\n\tconst duration = flowRun.total_run_time ?? 0;\n\n\treturn (\n\t\t<div className=\"space-y-3\">\n\t\t\t<div className=\"flex items-start justify-between gap-2\">\n\t\t\t\t<h3 className=\"font-semibold text-base\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto=\"/runs/flow-run/$id\"\n\t\t\t\t\t\tparams={{ id: flowRunId }}\n\t\t\t\t\t\tclassName=\"hover:underline text-foreground\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{flowRun.name}\n\t\t\t\t\t</Link>\n\t\t\t\t</h3>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close panel\"\n\t\t\t\t\tclassName=\"shrink-0 -mt-1 -mr-2\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<div className=\"space-y-3\">\n\t\t\t\t{flowRun.state && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"State\"\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t<StateBadge type={flowRun.state.type} name={flowRun.state.name} />\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<KeyValue label=\"Flow Run ID\" value={flowRun.id} copyable />\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Duration\"\n\t\t\t\t\tvalue={duration > 0 ? secondsToApproximateString(duration) : \"-\"}\n\t\t\t\t/>\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<FormattedDate date={flowRun.created} />}\n\t\t\t\t/>\n\t\t\t\t{flowRun.tags && flowRun.tags.length > 0 && (\n\t\t\t\t\t<KeyValue\n\t\t\t\t\t\tlabel=\"Tags\"\n\t\t\t\t\t\tvalue={<TagBadgeGroup tags={flowRun.tags} />}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import type { StateSelection } from \"@prefecthq/graphs\";\nimport { useEffect, useRef } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { FormattedDate } from \"@/components/ui/formatted-date/formatted-date\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\n\ntype FlowRunGraphStatePopoverProps = {\n\tselection: StateSelection;\n\tonClose: () => void;\n};\n\nexport function FlowRunGraphStatePopover({\n\tselection,\n\tonClose,\n}: FlowRunGraphStatePopoverProps) {\n\tconst popoverRef = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tif (\n\t\t\t\tpopoverRef.current &&\n\t\t\t\t!popoverRef.current.contains(event.target as Node)\n\t\t\t) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tif (event.key === \"Escape\") {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener(\"mousedown\", handleClickOutside);\n\t\tdocument.addEventListener(\"keydown\", handleEscape);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousedown\", handleClickOutside);\n\t\t\tdocument.removeEventListener(\"keydown\", handleEscape);\n\t\t};\n\t}, [onClose]);\n\n\tconst position = selection.position;\n\tif (!position) {\n\t\treturn null;\n\t}\n\n\tconst popoverStyle = {\n\t\tposition: \"absolute\" as const,\n\t\tleft: `${position.x + position.width / 2}px`,\n\t\ttop: `${position.y + position.height}px`,\n\t\ttransform: \"translateX(-50%)\",\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tref={popoverRef}\n\t\t\tclassName=\"z-50 w-64 rounded-lg border bg-card p-4 shadow-md\"\n\t\t\tstyle={popoverStyle}\n\t\t>\n\t\t\t<div className=\"flex justify-end absolute top-2 right-2\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t\taria-label=\"Close popover\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"X\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<div className=\"space-y-3\">\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"State\"\n\t\t\t\t\tvalue={<StateBadge type={selection.type} name={selection.name} />}\n\t\t\t\t/>\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Occurred\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<FormattedDate date={selection.timestamp} format=\"timestamp\" />\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import {\n\temitter,\n\ttype GraphItemSelection,\n\tisArtifactsSelection,\n\tisEventSelection,\n\tisEventsSelection,\n\tisNodeSelection,\n\tisStateSelection,\n\ttype RunGraphConfig,\n\ttype RunGraphNode,\n\ttype RunGraphStateEvent,\n\tselectItem,\n\tsetConfig,\n\tstart,\n\tstop,\n\tupdateViewportFromDateRange,\n\ttype ViewportDateRange,\n} from \"@prefecthq/graphs\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useTheme } from \"next-themes\";\nimport {\n\ttype CSSProperties,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport { buildCountFlowRunsQuery } from \"@/api/flow-runs\";\nimport { buildCountTaskRunsQuery } from \"@/api/task-runs\";\nimport { getStateColor } from \"@/utils/state-colors\";\nimport { fetchFlowRunEvents, fetchFlowRunGraph } from \"./api\";\nimport { stateTypeShades } from \"./consts\";\nimport { FlowRunGraphActions } from \"./flow-run-graph-actions\";\nimport { FlowRunGraphArtifactDrawer } from \"./flow-run-graph-artifact-drawer\";\nimport { FlowRunGraphArtifactsPopover } from \"./flow-run-graph-artifacts-popover\";\nimport { FlowRunGraphEventPopover } from \"./flow-run-graph-event-popover\";\nimport { FlowRunGraphEventsPopover } from \"./flow-run-graph-events-popover\";\nimport { FlowRunGraphSelectionPanel } from \"./flow-run-graph-selection-panel\";\nimport { FlowRunGraphStatePopover } from \"./flow-run-graph-state-popover\";\n\nconst TERMINAL_STATES = [\"COMPLETED\", \"FAILED\", \"CANCELLED\", \"CRASHED\"];\n\ntype FlowRunGraphProps = {\n\tflowRunId: string;\n\tstateType?: string;\n\tviewport?: ViewportDateRange;\n\tonViewportChange?: (viewport: ViewportDateRange) => void;\n\tselected?: GraphItemSelection;\n\tonSelectedChange?: (selected: GraphItemSelection | undefined) => void;\n\tfullscreen?: boolean;\n\tonFullscreenChange?: (fullscreen: boolean) => void;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n};\n\nexport function FlowRunGraph({\n\tflowRunId,\n\tstateType,\n\tviewport,\n\tonViewportChange,\n\tselected: controlledSelected,\n\tonSelectedChange,\n\tclassName,\n\tstyle,\n\tfullscreen: controlledFullscreen,\n\tonFullscreenChange,\n}: FlowRunGraphProps) {\n\tconst stageRef = useRef<HTMLDivElement>(null);\n\tconst [internalFullscreen, setInternalFullscreen] = useState(false);\n\tconst [internalSelected, setInternalSelected] = useState<\n\t\tGraphItemSelection | undefined\n\t>(undefined);\n\tconst [selectedArtifactId, setSelectedArtifactId] = useState<string | null>(\n\t\tnull,\n\t);\n\tconst { resolvedTheme } = useTheme();\n\n\tconst fullscreen = controlledFullscreen ?? internalFullscreen;\n\tconst selected = controlledSelected ?? internalSelected;\n\tconst isTerminal = stateType && TERMINAL_STATES.includes(stateType);\n\n\tconst { data: taskRunCount } = useQuery(\n\t\tbuildCountTaskRunsQuery({\n\t\t\ttask_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tflow_run_id: { operator: \"and_\", any_: [flowRunId], is_null_: false },\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst { data: subflowRunCount } = useQuery(\n\t\tbuildCountFlowRunsQuery({\n\t\t\tflow_runs: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tparent_flow_run_id: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tany_: [flowRunId],\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst hasNodes =\n\t\ttaskRunCount === undefined ||\n\t\tsubflowRunCount === undefined ||\n\t\ttaskRunCount > 0 ||\n\t\tsubflowRunCount > 0;\n\n\tconst updateFullscreen = useCallback(\n\t\t(value: boolean) => {\n\t\t\tsetInternalFullscreen(value);\n\t\t\tonFullscreenChange?.(value);\n\t\t},\n\t\t[onFullscreenChange],\n\t);\n\n\tconst config = useMemo<RunGraphConfig>(\n\t\t() => ({\n\t\t\trunId: flowRunId,\n\t\t\tfetch: fetchFlowRunGraph,\n\t\t\tfetchEvents: fetchFlowRunEvents,\n\t\t\tstyles: () => ({\n\t\t\t\tnode: (node: RunGraphNode) => ({\n\t\t\t\t\tbackground: getStateColor(\n\t\t\t\t\t\tnode.state_type,\n\t\t\t\t\t\tstateTypeShades[node.state_type],\n\t\t\t\t\t),\n\t\t\t\t}),\n\t\t\t\tstate: (event: RunGraphStateEvent) => ({\n\t\t\t\t\tbackground: getStateColor(event.type, stateTypeShades[event.type]),\n\t\t\t\t}),\n\t\t\t}),\n\t\t\ttheme: resolvedTheme === \"dark\" ? \"dark\" : \"light\",\n\t\t}),\n\t\t[flowRunId, resolvedTheme],\n\t);\n\n\tuseEffect(() => {\n\t\tsetConfig(config);\n\t}, [config]);\n\n\tuseEffect(() => {\n\t\tif (!stageRef.current) {\n\t\t\tthrow new Error(\"Stage does not exist\");\n\t\t}\n\n\t\tstart({\n\t\t\tstage: stageRef.current,\n\t\t\tconfig,\n\t\t});\n\n\t\treturn () => {\n\t\t\tstop();\n\t\t};\n\t}, [config]);\n\n\tuseEffect(() => {\n\t\tselectItem(selected ?? null);\n\t}, [selected]);\n\n\tuseEffect(() => {\n\t\tvoid updateViewportFromDateRange(viewport);\n\t}, [viewport]);\n\n\tuseEffect(() => {\n\t\tconst offItemSelected = emitter.on(\"itemSelected\", (nodeId) => {\n\t\t\tconst selection = nodeId ?? undefined;\n\t\t\tsetInternalSelected(selection);\n\t\t\tonSelectedChange?.(selection);\n\t\t});\n\t\tconst offViewportDateRangeUpdated = emitter.on(\n\t\t\t\"viewportDateRangeUpdated\",\n\t\t\t(range) => onViewportChange?.(range),\n\t\t);\n\n\t\treturn () => {\n\t\t\toffItemSelected();\n\t\t\toffViewportDateRangeUpdated();\n\t\t};\n\t}, [onSelectedChange, onViewportChange]);\n\n\tconst heightClass = fullscreen\n\t\t? \"fixed inset-0 z-50 bg-background\"\n\t\t: hasNodes\n\t\t\t? \"relative h-96 w-full\"\n\t\t\t: \"relative h-40 w-full\";\n\n\treturn (\n\t\t<div className={`${heightClass} ${className ?? \"\"}`} style={style}>\n\t\t\t<div ref={stageRef} className=\"size-full [&>canvas]:size-full\" />\n\t\t\t{!hasNodes && (\n\t\t\t\t<div className=\"absolute inset-0 flex items-center justify-center bg-background/50\">\n\t\t\t\t\t<p className=\"text-muted-foreground\">\n\t\t\t\t\t\t{isTerminal\n\t\t\t\t\t\t\t? \"This flow run did not generate any task or subflow runs\"\n\t\t\t\t\t\t\t: \"This flow run has not yet generated any task or subflow runs\"}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div className=\"absolute bottom-2 right-2\">\n\t\t\t\t<FlowRunGraphActions\n\t\t\t\t\tfullscreen={fullscreen}\n\t\t\t\t\tonFullscreenChange={updateFullscreen}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{selected && isNodeSelection(selected) && (\n\t\t\t\t<FlowRunGraphSelectionPanel\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isStateSelection(selected) && (\n\t\t\t\t<FlowRunGraphStatePopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isEventSelection(selected) && (\n\t\t\t\t<FlowRunGraphEventPopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isEventsSelection(selected) && (\n\t\t\t\t<FlowRunGraphEventsPopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{selected && isArtifactsSelection(selected) && (\n\t\t\t\t<FlowRunGraphArtifactsPopover\n\t\t\t\t\tselection={selected}\n\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t\tonViewArtifact={(artifactId) => {\n\t\t\t\t\t\tsetSelectedArtifactId(artifactId);\n\t\t\t\t\t\tsetInternalSelected(undefined);\n\t\t\t\t\t\tonSelectedChange?.(undefined);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<FlowRunGraphArtifactDrawer\n\t\t\t\tartifactId={selectedArtifactId}\n\t\t\t\tonClose={() => setSelectedArtifactId(null)}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"names":["fetchFlowRunGraph","id","data","getQueryService","mapApiResponseToRunGraphData","fetchFlowRunEvents","since","until","nodeId","mapApiResponseToRunGraphEvents","response","parseISO","node","mapNode","mapState","event","mapArtifact","state","artifact","stateTypeShades","isEventTargetInput","target","center","centerViewport","FlowRunGraphCenterButton","useEffect","controller","Tooltip","jsx","TooltipTrigger","Button","Icon","TooltipContent","FlowRunGraphFullscreenButton","fullscreen","onFullscreenChange","toggleFullscreen","useCallback","layoutOptions","increaseScale","multiplier","DEFAULT_HORIZONTAL_SCALE_MULTIPLIER","scale","layout","setHorizontalScaleMultiplier","decreaseScale","resetScale","resetHorizontalScaleMultiplier","isLayoutOption","value","horizontal","vertical","isHorizontalMode","isVerticalMode","FlowRunGraphSettings","selectedLayoutOption","setSelectedLayoutOption","useState","hideEdges","setHideEdges","hideArtifacts","setHideArtifacts","hideEvents","setHideEvents","handleLayoutChange","setHorizontalMode","setVerticalMode","handleHideEdgesChange","setDisabledEdges","handleHideArtifactsChange","setDisabledArtifacts","handleHideEventsChange","setDisabledEvents","jsxs","Typography","option","e","Label","Switch","FlowRunGraphSettingsButton","Popover","PopoverTrigger","PopoverContent","FlowRunGraphActions","FlowRunGraphArtifactDrawer","artifactId","onClose","Sheet","open","SheetContent","SheetHeader","SheetTitle","Suspense","ArtifactContentSkeleton","ArtifactContent","Skeleton","useSuspenseQuery","buildGetArtifactQuery","KeyValue","FormattedDate","FlowRunGraphArtifactsPopover","selection","onViewArtifact","artifacts","isLoading","useQuery","buildListArtifactsQuery","position","anchorStyle","PopoverAnchor","getEventLabel","eventName","label","formatDateNumeric","date","parsedDate","isValid","format","getResourceName","resource","EventResourceSection","resourceName","prefectResourceId","resourceType","parseResourceType","extractedId","extractResourceId","relatedResources","ResourceDisplaySkeleton","EventResourceLink","ResourceDisplayWithIcon","ResolvedResourceDisplay","RelatedResourcesSection","filteredResources","role","resourceId","FlowRunGraphEventPopover","buildGetEventQuery","eventLabel","Link","FlowRunGraphEventsPopover","eventQueries","useQueries","q","events","ScrollArea","FlowRunGraphSelectionPanel","isNodeSelection","SelectionPanelSkeleton","TaskRunDetails","FlowRunDetails","taskRunId","taskRun","buildGetTaskRunQuery","duration","StateBadge","secondsToApproximateString","TagBadgeGroup","flowRunId","flowRun","buildGetFlowRunDetailsQuery","FlowRunGraphStatePopover","popoverRef","useRef","handleClickOutside","handleEscape","popoverStyle","TERMINAL_STATES","FlowRunGraph","stateType","viewport","onViewportChange","controlledSelected","onSelectedChange","className","style","controlledFullscreen","stageRef","internalFullscreen","setInternalFullscreen","internalSelected","setInternalSelected","selectedArtifactId","setSelectedArtifactId","resolvedTheme","useTheme","selected","isTerminal","taskRunCount","buildCountTaskRunsQuery","subflowRunCount","buildCountFlowRunsQuery","hasNodes","updateFullscreen","config","useMemo","getStateColor","setConfig","start","stop","selectItem","updateViewportFromDateRange","offItemSelected","emitter","offViewportDateRangeUpdated","range","heightClass","isStateSelection","isEventSelection","isEventsSelection","isArtifactsSelection"],"mappings":"g+BAmBA,eAAsBA,GAAkBC,EAAmC,CAC1E,KAAM,CAAE,KAAAC,CAAA,EAAS,MAAO,MAAMC,MAAmB,IAChD,2BACA,CACC,OAAQ,CAAE,KAAM,CAAE,GAAAF,EAAG,CAAE,CACxB,EAGD,GAAI,CAACC,EACJ,MAAM,IAAI,MAAM,2BAA2B,EAG5C,OAAOE,GAA6BF,CAAI,CACzC,CASA,eAAsBG,GAAmB,CACxC,MAAAC,EACA,MAAAC,EACA,OAAAC,CACD,EAAyD,CACxD,KAAM,CAAE,KAAAN,GAAS,MAAO,MAAMC,GAAA,GAAmB,KAAK,iBAAkB,CACvE,KAAM,CACL,OAAQ,CACP,aAAc,CACb,GAAI,CAAC,oBAAoBK,CAAM,EAAE,CAAA,EAElC,MAAO,CACN,eAAgB,CAAC,oBAAqB,mBAAmB,CAAA,EAE1D,SAAU,CACT,MAAOF,EAAM,YAAA,EACb,MAAOC,EAAM,YAAA,CAAY,EAE1B,MAAO,KAAA,EAER,MAAO,EAAA,CACR,CACA,EAED,GAAI,CAACL,EACJ,MAAM,IAAI,MAAM,2BAA2B,EAG5C,OAAOO,GAA+BP,CAAI,CAC3C,CAQA,SAASE,GAA6BM,EAAuC,CAC5E,GAAI,CAACA,EAAS,WACb,MAAM,IAAI,MAAM,wBAAwB,EAGzC,MAAO,CACN,cAAeA,EAAS,cACxB,WAAYC,EAASD,EAAS,UAAU,EACxC,SAAUA,EAAS,SAAWC,EAASD,EAAS,QAAQ,EAAI,KAC5D,MAAO,IAAI,IAAIA,EAAS,MAAM,IAAKE,GAASC,GAAQD,CAAI,CAAC,CAAC,EAC1D,OAAQF,EA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AC7B,CAAA,CAAA,EAGDa,GAAYwB,GAAqBxB,CAAQ,GACzC9J,EAAAA,IAACwE,GAAA,CACA,UAAWsF,EACX,QAAS,IAAM,CACdL,EAAoB,MAAS,EAC7BR,IAAmB,MAAS,CAC7B,EACA,eAAiBxF,GAAe,CAC/BkG,EAAsBlG,CAAU,EAChCgG,EAAoB,MAAS,EAC7BR,IAAmB,MAAS,CAC7B,CAAA,CAAA,EAGFjJ,EAAAA,IAACwD,GAAA,CACA,WAAYkG,GACZ,QAAS,IAAMC,EAAsB,IAAI,CAAA,CAAA,CAC1C,EACD,CAEF"}
@@ -1,2 +1,2 @@
1
- import{j as r}from"./vendor-tanstack-BcZfOOfy.js";import{s}from"./index-_0OOjqn5.js";import{R as a}from"./route-error-state-tYzhKCqH.js";import{o as i,e as m}from"./vendor-forms-ClCIacbh.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-date-wwuDAncJ.js";i({tab:m(["Logs","TaskRuns","SubflowRuns","Artifacts","Details","Parameters","JobVariables"]).default("Logs").catch("Logs")});function R({error:o,reset:e}){const t=s(o,"Failed to load flow run");return r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-2xl font-semibold",children:"Flow Run"})}),r.jsx(a,{error:t,onRetry:e})]})}export{R as errorComponent};
2
- //# sourceMappingURL=flow-run._id-RL0qeSLl.js.map
1
+ import{j as r}from"./vendor-tanstack-BcZfOOfy.js";import{s}from"./index-m48E4KcG.js";import{R as a}from"./route-error-state-DnBaNT2T.js";import{o as i,e as m}from"./vendor-forms-ClCIacbh.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-date-wwuDAncJ.js";i({tab:m(["Logs","TaskRuns","SubflowRuns","Artifacts","Details","Parameters","JobVariables"]).default("Logs").catch("Logs")});function R({error:o,reset:e}){const t=s(o,"Failed to load flow run");return r.jsxs("div",{className:"flex flex-col gap-4",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-2xl font-semibold",children:"Flow Run"})}),r.jsx(a,{error:t,onRetry:e})]})}export{R as errorComponent};
2
+ //# sourceMappingURL=flow-run._id-CqpH6bvx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow-run._id-RL0qeSLl.js","sources":["../../src/routes/runs/flow-run.$id.tsx?tsr-split=errorComponent"],"sourcesContent":["import type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute, notFound, useNavigate } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { buildListArtifactsQuery } from \"@/api/artifacts\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildGetFlowRunDetailsQuery } from \"@/api/flow-runs\";\nimport { buildInfiniteFilterLogsQuery } from \"@/api/logs\";\nimport { buildPaginateTaskRunsQuery } from \"@/api/task-runs\";\nimport { FlowRunDetailsPage } from \"@/components/flow-runs/flow-run-details-page\";\nimport { FlowRunNotFound } from \"@/components/flow-runs/flow-run-not-found\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\nconst searchParams = z.object({\n\ttab: z\n\t\t.enum([\n\t\t\t\"Logs\",\n\t\t\t\"TaskRuns\",\n\t\t\t\"SubflowRuns\",\n\t\t\t\"Artifacts\",\n\t\t\t\"Details\",\n\t\t\t\"Parameters\",\n\t\t\t\"JobVariables\",\n\t\t])\n\t\t.default(\"Logs\")\n\t\t.catch(\"Logs\"),\n});\n\nexport type FlowRunDetailsTabOptions = z.infer<typeof searchParams>[\"tab\"];\n\nfunction FlowRunErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load flow run\");\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div>\n\t\t\t\t<h1 className=\"text-2xl font-semibold\">Flow Run</h1>\n\t\t\t</div>\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/runs/flow-run/$id\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\tloader: async ({ params, context: { queryClient } }) => {\n\t\t// ----- Deferred data\n\t\tvoid queryClient.prefetchInfiniteQuery(\n\t\t\tbuildInfiniteFilterLogsQuery({\n\t\t\t\tlimit: 50,\n\t\t\t\tsort: \"TIMESTAMP_ASC\",\n\t\t\t\tlogs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tlevel: {\n\t\t\t\t\t\tge_: 0,\n\t\t\t\t\t},\n\t\t\t\t\tflow_run_id: {\n\t\t\t\t\t\tany_: [params.id],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\tvoid queryClient.prefetchQuery(\n\t\t\tbuildListArtifactsQuery({\n\t\t\t\tartifacts: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tflow_run_id: {\n\t\t\t\t\t\tany_: [params.id],\n\t\t\t\t\t},\n\t\t\t\t\ttype: {\n\t\t\t\t\t\tnot_any_: [\"result\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t);\n\n\t\tvoid queryClient.prefetchQuery(\n\t\t\tbuildPaginateTaskRunsQuery({\n\t\t\t\tpage: 1,\n\t\t\t\tsort: \"EXPECTED_START_TIME_DESC\",\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [params.id],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\t// ----- Critical data\n\t\ttry {\n\t\t\tawait queryClient.ensureQueryData(buildGetFlowRunDetailsQuery(params.id));\n\t\t} catch (error) {\n\t\t\t// Only treat \"not found\" errors as 404, rethrow other errors\n\t\t\tif (error instanceof Error && /not found/i.test(error.message)) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/only-throw-error\n\t\t\t\tthrow notFound();\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t},\n\twrapInSuspense: true,\n\terrorComponent: FlowRunErrorComponent,\n\tnotFoundComponent: FlowRunNotFound,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\tconst { tab } = Route.useSearch();\n\tconst navigate = useNavigate();\n\n\tconst onTabChange = (tab: FlowRunDetailsTabOptions) => {\n\t\tvoid navigate({\n\t\t\tto: \".\",\n\t\t\tsearch: (prev) => ({\n\t\t\t\t...prev,\n\t\t\t\ttab,\n\t\t\t}),\n\t\t});\n\t};\n\n\treturn <FlowRunDetailsPage id={id} tab={tab} onTabChange={onTabChange} />;\n}\n"],"names":["z","tab","default","catch","FlowRunErrorComponent","error","reset","serverError","categorizeError","jsxs","jsx","RouteErrorState"],"mappings":"6UAaqBA,EAAS,CAC7BC,IAAKD,EACE,CACL,OACA,WACA,cACA,YACA,UACA,aACA,cAAc,CACd,EACAE,QAAQ,MAAM,EACdC,MAAM,MAAM,CACf,CAAC,EAID,SAASC,EAAsB,CAAEC,MAAAA,EAAOC,MAAAA,CAA2B,EAAG,CACrE,MAAMC,EAAcC,EAAgBH,EAAO,yBAAyB,EACpE,OACCI,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAC,EAAAA,IAAC,OACA,SAAAA,EAAAA,IAAC,KAAA,CAAG,UAAU,yBAAyB,oBAAQ,CAAA,CAChD,EACAA,EAAAA,IAACC,EAAA,CAAgB,MAAOJ,EAAa,QAASD,CAAAA,CAAM,CAAA,EACrD,CAEF"}
1
+ {"version":3,"file":"flow-run._id-CqpH6bvx.js","sources":["../../src/routes/runs/flow-run.$id.tsx?tsr-split=errorComponent"],"sourcesContent":["import type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { createFileRoute, notFound, useNavigate } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { buildListArtifactsQuery } from \"@/api/artifacts\";\nimport { categorizeError } from \"@/api/error-utils\";\nimport { buildGetFlowRunDetailsQuery } from \"@/api/flow-runs\";\nimport { buildInfiniteFilterLogsQuery } from \"@/api/logs\";\nimport { buildPaginateTaskRunsQuery } from \"@/api/task-runs\";\nimport { FlowRunDetailsPage } from \"@/components/flow-runs/flow-run-details-page\";\nimport { FlowRunNotFound } from \"@/components/flow-runs/flow-run-not-found\";\nimport { RouteErrorState } from \"@/components/ui/route-error-state\";\n\nconst searchParams = z.object({\n\ttab: z\n\t\t.enum([\n\t\t\t\"Logs\",\n\t\t\t\"TaskRuns\",\n\t\t\t\"SubflowRuns\",\n\t\t\t\"Artifacts\",\n\t\t\t\"Details\",\n\t\t\t\"Parameters\",\n\t\t\t\"JobVariables\",\n\t\t])\n\t\t.default(\"Logs\")\n\t\t.catch(\"Logs\"),\n});\n\nexport type FlowRunDetailsTabOptions = z.infer<typeof searchParams>[\"tab\"];\n\nfunction FlowRunErrorComponent({ error, reset }: ErrorComponentProps) {\n\tconst serverError = categorizeError(error, \"Failed to load flow run\");\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div>\n\t\t\t\t<h1 className=\"text-2xl font-semibold\">Flow Run</h1>\n\t\t\t</div>\n\t\t\t<RouteErrorState error={serverError} onRetry={reset} />\n\t\t</div>\n\t);\n}\n\nexport const Route = createFileRoute(\"/runs/flow-run/$id\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: RouteComponent,\n\tloader: async ({ params, context: { queryClient } }) => {\n\t\t// ----- Deferred data\n\t\tvoid queryClient.prefetchInfiniteQuery(\n\t\t\tbuildInfiniteFilterLogsQuery({\n\t\t\t\tlimit: 50,\n\t\t\t\tsort: \"TIMESTAMP_ASC\",\n\t\t\t\tlogs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tlevel: {\n\t\t\t\t\t\tge_: 0,\n\t\t\t\t\t},\n\t\t\t\t\tflow_run_id: {\n\t\t\t\t\t\tany_: [params.id],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\tvoid queryClient.prefetchQuery(\n\t\t\tbuildListArtifactsQuery({\n\t\t\t\tartifacts: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tflow_run_id: {\n\t\t\t\t\t\tany_: [params.id],\n\t\t\t\t\t},\n\t\t\t\t\ttype: {\n\t\t\t\t\t\tnot_any_: [\"result\"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsort: \"ID_DESC\",\n\t\t\t\toffset: 0,\n\t\t\t}),\n\t\t);\n\n\t\tvoid queryClient.prefetchQuery(\n\t\t\tbuildPaginateTaskRunsQuery({\n\t\t\t\tpage: 1,\n\t\t\t\tsort: \"EXPECTED_START_TIME_DESC\",\n\t\t\t\tflow_runs: {\n\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\tid: {\n\t\t\t\t\t\tany_: [params.id],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\t// ----- Critical data\n\t\ttry {\n\t\t\tawait queryClient.ensureQueryData(buildGetFlowRunDetailsQuery(params.id));\n\t\t} catch (error) {\n\t\t\t// Only treat \"not found\" errors as 404, rethrow other errors\n\t\t\tif (error instanceof Error && /not found/i.test(error.message)) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/only-throw-error\n\t\t\t\tthrow notFound();\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t},\n\twrapInSuspense: true,\n\terrorComponent: FlowRunErrorComponent,\n\tnotFoundComponent: FlowRunNotFound,\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\tconst { tab } = Route.useSearch();\n\tconst navigate = useNavigate();\n\n\tconst onTabChange = (tab: FlowRunDetailsTabOptions) => {\n\t\tvoid navigate({\n\t\t\tto: \".\",\n\t\t\tsearch: (prev) => ({\n\t\t\t\t...prev,\n\t\t\t\ttab,\n\t\t\t}),\n\t\t});\n\t};\n\n\treturn <FlowRunDetailsPage id={id} tab={tab} onTabChange={onTabChange} />;\n}\n"],"names":["z","tab","default","catch","FlowRunErrorComponent","error","reset","serverError","categorizeError","jsxs","jsx","RouteErrorState"],"mappings":"6UAaqBA,EAAS,CAC7BC,IAAKD,EACE,CACL,OACA,WACA,cACA,YACA,UACA,aACA,cAAc,CACd,EACAE,QAAQ,MAAM,EACdC,MAAM,MAAM,CACf,CAAC,EAID,SAASC,EAAsB,CAAEC,MAAAA,EAAOC,MAAAA,CAA2B,EAAG,CACrE,MAAMC,EAAcC,EAAgBH,EAAO,yBAAyB,EACpE,OACCI,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAC,EAAAA,IAAC,OACA,SAAAA,EAAAA,IAAC,KAAA,CAAG,UAAU,yBAAyB,oBAAQ,CAAA,CAChD,EACAA,EAAAA,IAACC,EAAA,CAAgB,MAAOJ,EAAa,QAASD,CAAAA,CAAM,CAAA,EACrD,CAEF"}
@@ -0,0 +1,4 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/flow-run-graph-BhzuSJLm.js","assets/vendor-tanstack-BcZfOOfy.js","assets/vendor-react-Bce9NwRC.js","assets/vendor-graphs-_sWgqfe-.js","assets/index-m48E4KcG.js","assets/vendor-radix-BTiKGWfR.js","assets/vendor-recharts-BAN776s_.js","assets/vendor-forms-ClCIacbh.js","assets/vendor-date-wwuDAncJ.js","assets/index-COouj_0-.css","assets/state-colors-CAAf0Eg3.js","assets/key-value-DkSKn6jE.js","assets/event-resource-display-DHiAb1Up.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as n,s as $,t as D,L as G,I as Ge,n as J,g as Qe,d as Ve}from"./vendor-tanstack-BcZfOOfy.js";import{b5 as x,cc as qe,cd as $e,q as b,ce as Be,aW as K,bv as We,C as he,o as pe,c6 as He,bM as te,X as je,cf as B,aN as ge,cg as fe,ch as ye,ci as Ne,cj as ve,ck as _e,aq as C,ak as q,i as be,cl as Se,cm as Ce,cn as we,y,_ as X,$ as Y,a0 as Z,a1 as ee,a2 as se,p as Je,co as ke,a3 as ae,cp as De,cq as re,cr as Ke,aD as Fe,B as Xe,g as Ye,h as le,bs as Ze,bB as es,bD as ss,H as as,I as _,aM as ts,c5 as rs,bQ as ls,bR as ns,bS as is,bT as os,cs,c8 as ds,S as Te,a as Ee,c as Ae,e as H,b as us,bN as Le,aC as ms,aE as ne,ab as xs,al as U,O as Pe,ct as ie,cu as W,aF as oe,an as hs,cv as ps,cw as js,cx as gs,cy as fs,cz as ys,L as ce,aw as Ns,ax as vs,ay as L,az as P,cA as de}from"./index-m48E4KcG.js";import{R as _s,b as bs,C as Ss,a as Cs,u as ws}from"./use-state-favicon-M09DmrNy.js";import{A as ks}from"./artifact-card-BBzQR-Cj.js";import{T as Ds,a as ue}from"./toggle-group-Cn07UIim.js";import{K as S}from"./key-value-DkSKn6jE.js";import{u as Fs,L as Ts}from"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import{L as Es}from"./lazy-markdown-Du2Xu3Yp.js";import{D as As}from"./delete-confirmation-dialog-DHkm2p8m.js";import{u as Ls}from"./use-delete-confirmation-dialog-CUdii6Lo.js";import{D as Ie,a as ze,b as Me,d as w,e as Ps}from"./dropdown-menu-0atiOSFo.js";import{S as Is}from"./sort-filter-DpuWNkQo.js";import{S as zs,a as Ms,F as Rs}from"./flow-runs-pagination-BATUweRV.js";import{T as Os,b as Us,a as Gs}from"./task-runs-pagination-VdR-LO4r.js";import{T as Qs}from"./tags-input-BLPMVWpZ.js";import{o as Vs,e as qs}from"./vendor-forms-ClCIacbh.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-date-wwuDAncJ.js";import"./index-BwCLKpNb.js";import"./zod-Cuos7J7w.js";import"./use-debounce-callback-CSs1BjLI.js";import"./timezone-select-BuPYznge.js";import"./form-DLrbC7rV.js";const $s=["RUNNING","SCHEDULED","PENDING","PAUSED"],Bs=["COMPLETED","FAILED","CANCELLED","CRASHED"];function Ws(s){return s!=null&&$s.includes(s)}function Hs(s){return s==="RUNNING"}function Js(s){return s==="PAUSED"}function Ks(s){return s!=null&&Bs.includes(s)}const Xs=n.lazy(()=>qe(()=>import("./flow-run-graph-BhzuSJLm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(s=>({default:s.FlowRunGraph})));function Ys(s){return e.jsx(n.Suspense,{fallback:e.jsx(x,{className:"h-[500px] w-full"}),children:e.jsx(Xs,{...s})})}class Q extends n.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){if(this.state.hasError){const{fallback:t}=this.props;return typeof t=="function"?t(this.state.error??new Error("Unknown error")):t}return this.props.children}}function V({error:s,onRetry:t,isRetrying:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-2 mb-3",children:e.jsx($e,{className:"size-6 text-destructive"})}),e.jsxs("div",{className:"space-y-1 mb-4",children:[e.jsx("p",{className:"font-medium",children:s.message}),s.details&&e.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:s.details})]}),t&&e.jsxs(b,{variant:"outline",size:"sm",onClick:t,disabled:a,className:"gap-2",children:[e.jsx(Be,{className:K("size-3",a&&"animate-spin")}),a?"Retrying...":"Retry"]})]})}const Zs=({flowRun:s})=>{const[t,a]=n.useState("grid"),{data:c}=$(We({artifacts:{operator:"and_",flow_run_id:{any_:[s.id]},type:{not_any_:["result"]}},sort:"ID_DESC",offset:0}));return c.length===0?e.jsx(he,{children:e.jsx(pe,{className:"text-center",children:e.jsxs("p",{children:["This flow run did not produce any artifacts; for more information on creating artifacts, see the"," ",e.jsx("a",{href:"https://docs.prefect.io/v3/develop/artifacts",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500",children:"documentation"}),"."]})})}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(Ds,{type:"single",variant:"outline",value:t,onValueChange:r=>a(r),children:[e.jsx(ue,{value:"grid","aria-label":"Grid view",children:e.jsx(He,{className:"w-4 h-4"})}),e.jsx(ue,{value:"list","aria-label":"List view",children:e.jsx(_s,{className:"w-4 h-4"})})]})}),e.jsx("div",{className:K("grid",t==="grid"?"grid-cols-1 lg:grid-cols-2 xl:grid-cols-3":"grid-cols-1","gap-4"),"data-testid":"flow-run-artifacts-grid",children:c.map(r=>e.jsx(ks,{artifact:r,compact:t==="list"},r.id))})]})};function ea({flowRun:s}){return s?e.jsxs("div",{className:"space-y-4",children:[e.jsx(S,{label:"Run Count",value:s.run_count}),e.jsx(S,{label:"Created",value:e.jsx(te,{date:s.created})}),s.created_by?.display_value&&e.jsx(S,{label:"Created By",value:s.created_by.display_value}),e.jsx(S,{label:"Last Updated",value:e.jsx(te,{date:s.updated})}),s.idempotency_key&&e.jsx(S,{label:"Idempotency Key",value:s.idempotency_key}),s.tags&&s.tags.length>0&&e.jsx(S,{label:"Tags",value:e.jsx(je,{tags:s.tags})}),e.jsx(S,{label:"Flow Run ID",value:s.id,copyable:!0}),s.state?.message&&e.jsx(S,{label:"State Message",value:s.state.message}),s.flow_version&&e.jsx(S,{label:"Flow Version",value:s.flow_version}),s.empirical_policy?.retries!=null&&e.jsxs(e.Fragment,{children:[e.jsx(S,{label:"Retries",value:s.empirical_policy.retries}),e.jsx(S,{label:"Retry Delay",value:s.empirical_policy.retry_delay})]})]}):e.jsx("div",{className:"flex flex-col gap-2 bg-gray-100 p-4 rounded-md",children:e.jsx("span",{className:"text-gray-500",children:"No flow run details available"})})}const sa=({flowRun:s,open:t,onOpenChange:a})=>{const[c,r]=n.useState(!1),{setFlowRunState:m,isPending:o}=B(),{data:d=[]}=D({...ge({flow_runs:{operator:"and_",parent_flow_run_id:{operator:"and_",any_:[s.id]},state:{operator:"and_",type:{any_:["RUNNING","SCHEDULED","PENDING","PAUSED"]}}},sort:"START_TIME_DESC",limit:100,offset:0}),enabled:t}),i=d.length>0,j=u=>{for(const h of d)m({id:h.id,state:{type:"CANCELLING",name:"Cancelling"},force:!0},{onError:()=>{u.push(h.name??h.id)}})},l=()=>{m({id:s.id,state:{type:"CANCELLING",name:"Cancelling"},force:!0},{onSuccess:()=>{if(c&&d.length>0){const u=[];j(u),u.length>0?y.error(`Failed to cancel some sub-flows: ${u.join(", ")}`):y.success(`Flow run and ${d.length} sub-flow${d.length===1?"":"s"} cancelled`)}else y.success("Flow run cancelled");a(!1)},onError:u=>{y.error(u.message||"Failed to cancel flow run")}})};return e.jsx(fe,{open:t,onOpenChange:a,children:e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ve,{children:"Cancel Flow Run"}),e.jsx(_e,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Are you sure you want to cancel"," ",e.jsx("span",{className:"font-medium",children:s.name}),"?"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Will become:"}),e.jsx(C,{type:"CANCELLING",name:"Cancelling"})]})]})})]}),i&&e.jsxs("div",{className:"flex items-center space-x-2 py-2",children:[e.jsx(q,{id:"cancel-subflows",checked:c,onCheckedChange:u=>r(u===!0)}),e.jsxs(be,{htmlFor:"cancel-subflows",className:"text-sm cursor-pointer",children:["Also cancel ",d.length," sub-flow run",d.length===1?"":"s"]})]}),e.jsxs(Se,{children:[e.jsx(Ce,{disabled:o,children:"Cancel"}),e.jsx(we,{onClick:u=>{u.preventDefault(),l()},disabled:o,children:o?"Cancelling...":"Cancel Flow Run"})]})]})})},aa=({flowRun:s,open:t,onOpenChange:a})=>{const[c,r]=n.useState(300),{setFlowRunState:m,isPending:o}=B(),d=()=>{const j=new Date(Date.now()+c*1e3).toISOString();m({id:s.id,state:{type:"PAUSED",name:"Suspended",state_details:{pause_timeout:j,pause_reschedule:!0,deferred:!1,untrackable_result:!1}},force:!0},{onSuccess:()=>{y.success("Flow run paused"),a(!1)},onError:l=>{y.error(l.message||"Failed to pause flow run")}})},i=c>=5;return e.jsx(X,{open:t,onOpenChange:a,children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Pause Flow Run"}),e.jsx(se,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Pause ",e.jsx("span",{className:"font-medium",children:s.name})," for a specified duration. The flow will automatically resume after the timeout."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Will become:"}),e.jsx(C,{type:"PAUSED",name:"Suspended"})]})]})})]}),e.jsxs("div",{className:"space-y-2 py-4",children:[e.jsx(be,{htmlFor:"timeout",children:"Timeout (seconds)"}),e.jsx(Je,{id:"timeout",type:"number",min:5,value:c,onChange:j=>r(Number.parseInt(j.target.value,10)||5)}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Will pause for ",ke(c),". Minimum 5 seconds."]})]}),e.jsxs(ae,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:o,children:"Cancel"}),e.jsx(b,{onClick:d,disabled:o||!i,loading:o,children:"Pause Flow Run"})]})]})})},ta=({flowRun:s,open:t,onOpenChange:a})=>{const c=s.state?.state_details?.run_input_keyset;return c&&c.schema?e.jsx(X,{open:t,onOpenChange:a,children:e.jsx(Y,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:e.jsx(n.Suspense,{fallback:e.jsx(Re,{}),children:e.jsx(la,{flowRun:s,keyset:c,onOpenChange:a})})})}):e.jsx(ra,{flowRun:s,open:t,onOpenChange:a})},ra=({flowRun:s,open:t,onOpenChange:a})=>{const{resumeFlowRun:c,isPending:r}=De(),m=()=>{c({id:s.id},{onSuccess:()=>{y.success("Flow run resumed"),a(!1)},onError:o=>{y.error(o.message||"Failed to resume flow run")}})};return e.jsx(X,{open:t,onOpenChange:a,children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Resume Flow Run"}),e.jsx(se,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Resume the paused flow run"," ",e.jsx("span",{className:"font-medium",children:s.name}),"?"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]})]})})]}),e.jsxs(ae,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:r,children:"Cancel"}),e.jsx(b,{onClick:m,disabled:r,loading:r,children:"Resume"})]})]})})},la=({flowRun:s,keyset:t,onOpenChange:a})=>{const{resumeFlowRun:c,isPending:r}=De(),{values:m,setValues:o,errors:d,validateForm:i}=Fs(),{data:j}=D({...re(s.id,t.schema),select:h=>h}),{data:l}=D({...re(s.id,t.description??""),enabled:!!t.description,select:h=>h});n.useEffect(()=>{o({})},[o]);const u=async()=>{if(j)try{if(await i({schema:m}),d.length>0)return;c({id:s.id,runInput:m},{onSuccess:()=>{y.success("Flow run resumed"),a(!1)},onError:h=>{y.error(h.message||"Failed to resume flow run")}})}catch{y.error("Failed to validate input")}};return j?e.jsxs(e.Fragment,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Resume Flow Run"}),e.jsx(se,{asChild:!0,children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:["Provide input to resume"," ",e.jsx("span",{className:"font-medium",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]})]})})]}),l&&e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none py-2 px-3 bg-muted/50 rounded-md",children:e.jsx(Es,{children:l})}),e.jsx("div",{className:"py-4",children:e.jsx(Ts,{schema:j,values:m,onValuesChange:o,errors:d,kinds:["json"]})}),e.jsxs(ae,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:r,children:"Cancel"}),e.jsx(b,{onClick:()=>{u()},disabled:r,loading:r,children:"Resume"})]})]}):e.jsx(Re,{})},Re=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(x,{className:"h-6 w-48"}),e.jsx(x,{className:"h-4 w-full"}),e.jsx(x,{className:"h-32 w-full"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(x,{className:"h-10 w-20"}),e.jsx(x,{className:"h-10 w-20"})]})]}),na=({flowRun:s,open:t,onOpenChange:a})=>{const{setFlowRunState:c,isPending:r}=B(),m=()=>{c({id:s.id,state:{type:"SCHEDULED",name:"AwaitingRetry",message:"Retry from the UI"},force:!0},{onSuccess:()=>{y.success("Flow run scheduled for retry"),a(!1)},onError:o=>{y.error(o.message||"Failed to retry flow run")}})};return e.jsx(fe,{open:t,onOpenChange:a,children:e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ve,{children:"Retry Flow Run"}),e.jsx(_e,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Retry the flow run"," ",e.jsx("span",{className:"font-medium",children:s.name}),"?"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Will become:"}),e.jsx(C,{type:"SCHEDULED",name:"AwaitingRetry"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Task runs with persisted results will use cached values. Task runs without persisted results will be re-executed."})]})})]}),e.jsxs(Se,{children:[e.jsx(Ce,{disabled:r,children:"Cancel"}),e.jsx(we,{onClick:o=>{o.preventDefault(),m()},disabled:r,children:r?"Retrying...":"Retry"})]})]})})};function ia({flowRun:s,onDeleteClick:t}){const[a,c]=Ls(),{open:r,onOpenChange:m,openDialog:o}=bs(),[d,i]=n.useState(!1),[j,l]=n.useState(!1),[u,h]=n.useState(!1),[v,g]=n.useState(!1),{setFlowRunState:F,isPending:T}=B(),E=s.state_type&&["COMPLETED","FAILED","CANCELLED","CRASHED"].includes(s.state_type),A=Ws(s.state_type)&&s.deployment_id,I=Hs(s.state_type)&&s.deployment_id,z=Js(s.state_type),M=Ks(s.state_type)&&s.deployment_id,R=k=>{F({id:s.id,state:{type:k.type,name:k.type.charAt(0)+k.type.slice(1).toLowerCase(),message:k.message},force:!0},{onSuccess:()=>{y.success("Flow run state changed"),m(!1)},onError:Ue=>{y.error(Ue.message||"Failed to change state")}})},{data:N}=D({...Ke(s.deployment_id??""),enabled:!!s.deployment_id}),{data:p}=D({...Fe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s.id],is_null_:!1}}})}),{data:f}=D({...ge({sort:"START_TIME_DESC",offset:0,limit:1,task_runs:{operator:"and_",id:{any_:[s.parent_task_run_id??""]}}}),enabled:!!s.parent_task_run_id}),O=f?.[0],Oe=k=>k===void 0?"...":k===0?"None":`${k} Task run${k===1?"":"s"}`;return e.jsxs("div",{className:"flex flex-row justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{children:e.jsxs(Ye,{children:[e.jsx(le,{children:e.jsx(Ze,{to:"/runs",className:"text-xl font-semibold",children:"Runs"})}),e.jsx(es,{}),e.jsxs(le,{className:"text-xl",children:[e.jsx(ss,{className:"font-semibold",children:s.name}),s.work_pool_name&&e.jsx(as,{variant:"outline",className:"ml-2",children:s.work_pool_name}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"ml-2",children:e.jsx(je,{tags:s.tags,maxTagsDisplayed:3})})]})]})}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name}),s.start_time&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(_,{id:"Calendar",className:"size-4"}),e.jsx("span",{children:ts(s.start_time,"dateTimeNumeric")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(_,{id:"Clock",className:"size-4"}),e.jsx("span",{children:ke(s.total_run_time??0)})]}),e.jsxs("div",{className:`flex items-center gap-1 ${p===0?"text-muted-foreground/60":""}`,children:[e.jsx(_,{id:"ListTodo",className:"size-4"}),e.jsx("span",{children:Oe(p)})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm flex-wrap",children:[s.flow_id&&e.jsx(rs,{flowId:s.flow_id}),s.deployment_id&&e.jsxs(G,{to:"/deployments/deployment/$id",params:{id:s.deployment_id},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"Rocket",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Deployment"}),e.jsx("span",{children:N?.name??"..."})]}),s.work_pool_name&&e.jsxs(G,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.work_pool_name},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"Server",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Work Pool"}),e.jsx("span",{children:s.work_pool_name})]}),s.work_pool_name&&s.work_queue_name&&e.jsxs(G,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.work_pool_name},search:{tab:"Work Queues"},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"ListOrdered",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Work Queue"}),e.jsx("span",{children:s.work_queue_name})]}),O&&e.jsxs(G,{to:"/runs/flow-run/$id",params:{id:O.id},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"Workflow",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Parent Run"}),e.jsx("span",{children:O.name??"..."})]})]})]}),e.jsxs(Ie,{children:[e.jsx(ze,{asChild:!0,children:e.jsx(b,{variant:"outline",className:"p-2",children:e.jsx(ls,{className:"w-4 h-4"})})}),e.jsxs(Me,{children:[A&&e.jsx(w,{onClick:()=>i(!0),children:"Cancel"}),I&&e.jsx(w,{onClick:()=>l(!0),children:"Pause"}),z&&e.jsx(w,{onClick:()=>h(!0),children:"Resume"}),M&&e.jsx(w,{onClick:()=>g(!0),children:"Retry"}),E&&e.jsx(w,{onClick:o,children:"Change state"}),(A||I||z||M||E)&&e.jsx(Ps,{}),e.jsx(w,{onClick:()=>{navigator.clipboard.writeText(s.id),y.success("Copied flow run ID to clipboard")},children:"Copy ID"}),e.jsx(w,{onClick:()=>c({title:"Delete Flow Run",description:`Are you sure you want to delete flow run ${s.name}?`,onConfirm:t}),children:"Delete"})]})]}),e.jsx(As,{...a}),e.jsx(Ss,{open:r,onOpenChange:m,currentState:s.state?{type:s.state.type,name:s.state.name??s.state.type.charAt(0)+s.state.type.slice(1).toLowerCase()}:null,label:"Flow Run",onConfirm:R,isLoading:T}),e.jsx(sa,{flowRun:s,open:d,onOpenChange:i}),e.jsx(aa,{flowRun:s,open:j,onOpenChange:l}),e.jsx(ta,{flowRun:s,open:u,onOpenChange:h}),e.jsx(na,{flowRun:s,open:v,onOpenChange:g})]})}function oa({flowRun:s}){const[t,a]=n.useState(!1),c=async()=>{a(!0);try{const m=await(await cs()).GET("/flow_runs/{id}/logs/download",{params:{path:{id:s.id}},parseAs:"blob"});if(!m.data)throw new Error("No data received from server");const o=URL.createObjectURL(m.data),d=document.createElement("a"),i=s.name??"logs";d.href=o,d.setAttribute("download",`${i}.csv`),d.click(),URL.revokeObjectURL(o)}catch(r){console.error(r),y.error("Failed to download logs")}finally{a(!1)}};return e.jsxs(ns,{children:[e.jsx(is,{asChild:!0,children:e.jsx(b,{variant:"outline",size:"icon",onClick:()=>{c()},disabled:t,"aria-label":"Download logs",children:t?e.jsx(_,{id:"Loader2",className:"size-4 animate-spin"}):e.jsx(_,{id:"Download",className:"size-4"})})}),e.jsx(os,{children:"Download all logs as CSV"})]})}const ca=({flowRun:s,virtualize:t=!0})=>{const[a,c]=n.useState(0),[r,m]=n.useState("TIMESTAMP_ASC"),o=n.useMemo(()=>({...ds({limit:50,sort:r,logs:{operator:"and_",level:{ge_:a},flow_run_id:{any_:[s.id]}}}),refetchInterval:s.state_type==="RUNNING"?5e3:!1}),[a,r,s.id,s.state_type]),{data:d,hasNextPage:i,fetchNextPage:j,isFetchingNextPage:l}=Ge(o),u=d.pages.length===1&&d.pages[0].length===0;let h="This run did not produce any logs.";return u&&(a>0?h="No logs match your filter criteria":s.state_type==="SCHEDULED"&&s.state_name==="Scheduled"?h="Run has not yet started. Check back soon for logs.":s.state_type==="RUNNING"&&(h="Waiting for logs...")),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-row gap-2 justify-end",children:[e.jsx(da,{levelFilter:a,setLevelFilter:c}),e.jsx(ua,{sortOrder:r,setSortOrder:m}),e.jsx(oa,{flowRun:s})]}),u?e.jsx("div",{className:"flex flex-col gap-2 text-center bg-muted p-2 rounded-md",children:e.jsx("span",{className:"text-muted-foreground",children:h})}):e.jsx("div",{className:"rounded-md",children:e.jsx(Cs,{logs:d.pages.flat(),onBottomReached:()=>{i&&!l&&j().catch(v=>{console.error(v)})},className:"max-h-[85vh]",virtualize:t})})]})},me=[{label:"All",value:0},{label:"Critical only",value:50},{label:"Error and above",value:40},{label:"Warning and above",value:30},{label:"Info and above",value:20},{label:"Debug and above",value:10}],da=({levelFilter:s,setLevelFilter:t})=>e.jsxs(Te,{value:s.toString(),onValueChange:a=>t(Number(a)),children:[e.jsx(Ee,{"aria-label":"log level filter",children:e.jsx("span",{children:`Level:
3
+ ${me.find(a=>a.value===s)?.label}`})}),e.jsx(Ae,{children:me.map(a=>e.jsx(H,{value:a.value.toString(),children:a.label},a.value))})]}),ua=({sortOrder:s,setSortOrder:t})=>e.jsxs(Te,{value:s,onValueChange:a=>t(a),children:[e.jsx(Ee,{"aria-label":"log sort order",children:e.jsx(us,{placeholder:"Sort log order"})}),e.jsxs(Ae,{children:[e.jsx(H,{value:"TIMESTAMP_ASC",children:"Oldest to newest"}),e.jsx(H,{value:"TIMESTAMP_DESC",children:"Newest to oldest"})]})]}),ma=({parentFlowRunId:s})=>{const t=J(),[a,c]=n.useState(""),[r,m]=n.useState(new Set),[o,d]=n.useState("START_TIME_DESC"),[i,j]=n.useState({page:1,limit:10}),l=Le(a,300),u=n.useMemo(()=>({flow_runs:{operator:"and_",parent_flow_run_id:{operator:"and_",any_:[s]}}}),[s]),{data:h}=$(ms(u,3e4)),v=n.useMemo(()=>({page:i.page,limit:i.limit,sort:o,flow_runs:{operator:"and_",parent_flow_run_id:{operator:"and_",any_:[s]},name:l?{like_:l}:void 0,state:r.size>0?{operator:"and_",name:{any_:Array.from(r)}}:void 0}}),[s,i,o,l,r]),{data:g}=D(ne(v,3e4)),F=n.useMemo(()=>[...new Set((g?.results??[]).map(p=>p.flow_id))],[g?.results]),{data:T}=D(xs({flows:{operator:"and_",id:{any_:F}},offset:0,sort:"NAME_ASC"},{enabled:F.length>0})),E=n.useMemo(()=>{if(!g?.results)return[];const p=new Map(T?.map(f=>[f.id,f])??[]);return g.results.map(f=>{const O=p.get(f.flow_id);return O?{...f,flow:O}:{...f,flow:void 0}}).filter(f=>f!==null)},[g?.results,T]),A=p=>{c(p.target.value),j(f=>({...f,page:1}))},I=p=>{m(p),j(f=>({...f,page:1}))},z=p=>{d(p),j(f=>({...f,page:1}))},M=()=>{c(""),m(new Set),j(p=>({...p,page:1}))},R=p=>{t.prefetchQuery(ne({...v,page:p},3e4))},N=a||r.size>0;return h===0?e.jsx("div",{className:"flex items-center justify-center h-48 border rounded-lg bg-muted/50",children:e.jsx(U,{className:"text-muted-foreground",children:"No subflow runs found for this flow run."})}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-12 items-center gap-2",children:[e.jsx("div",{className:"flex flex-col gap-1 xl:col-span-3 md:col-span-12 col-span-6 md:order-0 order-2",children:e.jsxs(U,{variant:"bodySmall",className:"text-muted-foreground",children:[h," Subflow run",h!==1?"s":""]})}),e.jsx("div",{className:"xl:col-span-4 col-span-12 md:order-1 order-0",children:e.jsx(Pe,{value:a,onChange:A,placeholder:"Search by run name","aria-label":"Search by run name",debounceMs:300})}),e.jsx("div",{className:"xl:col-span-3 md:col-span-6 col-span-12 md:order-2 order-1",children:e.jsx(zs,{selectedFilters:r,onSelectFilter:I})}),e.jsx("div",{className:"xl:border-l xl:border-border xl:pl-2 xl:col-span-2 md:col-span-6 col-span-6 md:order-3 order-3",children:e.jsx(Is,{value:o,onSelect:z})})]}),e.jsx(Ms,{flowRuns:E,onClearFilters:N?M:void 0}),g&&g.pages>0&&e.jsx(Rs,{pagination:i,onChangePagination:j,count:g.count,pages:g.pages,onPrefetchPage:R})]})},xe=2,xa=({selectedFilters:s,onSelectFilter:t,className:a})=>{const[c,r]=n.useState(!1),m=n.useMemo(()=>{const l=new Set(ie);return s.has("Scheduled")||l.size!==s.size?!1:Array.from(s).every(u=>l.has(u))},[s]),o=()=>{t(new Set(ie))},d=()=>{t(new Set)},i=l=>{if(m){t(new Set([l]));return}const u=new Set(s);s.has(l)?u.delete(l):u.add(l),t(u)},j=()=>{if(s.size===0)return"All run states";if(m)return"All except scheduled";const l=Array.from(s),u=l.slice(0,xe),h=l.length-xe;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:u.map(v=>e.jsx(C,{name:v,type:W[v]},v))}),h>0&&e.jsxs(U,{variant:"bodySmall",className:"shrink-0",children:["+ ",h]})]})};return e.jsxs(Ie,{open:c,onOpenChange:r,children:[e.jsx(ze,{asChild:!0,children:e.jsxs(b,{variant:"outline",className:K("justify-between w-full",a),children:[e.jsx("span",{className:"flex-1 min-w-0",children:j()}),e.jsx(_,{id:"ChevronDown",className:"ml-2 size-4 shrink-0"})]})}),e.jsxs(Me,{className:"max-h-96 overflow-x-hidden overflow-y-auto",children:[e.jsxs(w,{onSelect:l=>{l.preventDefault(),o()},children:[e.jsx(q,{checked:m,className:"mr-2"}),"All except scheduled"]}),e.jsxs(w,{onSelect:l=>{l.preventDefault(),d()},children:[e.jsx(q,{checked:s.size===0,className:"mr-2"}),"All run states"]}),Object.keys(W).map(l=>e.jsxs(w,{"aria-label":l,onSelect:u=>{u.preventDefault(),i(l)},children:[e.jsx(q,{"aria-label":l,className:"mr-2",checked:!m&&s.has(l)}),e.jsx(C,{name:l,type:W[l]})]},l))]})]})},ha=({flowRunId:s})=>{const t=J(),[a,c]=n.useState(""),[r,m]=n.useState(new Set),[o,d]=n.useState(new Set),[i,j]=n.useState("EXPECTED_START_TIME_DESC"),[l,u]=n.useState({page:1,limit:20}),h=Le(a,300),{data:v}=$(Fe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s],is_null_:!1},subflow_runs:{exists_:!1}}},3e4)),{data:g}=D(oe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s],is_null_:!1},subflow_runs:{exists_:!1},name:h?{like_:h}:void 0,state:r.size>0?{operator:"and_",name:{any_:Array.from(r)}}:void 0,tags:o.size>0?{operator:"and_",all_:Array.from(o)}:void 0},sort:i,page:l.page,limit:l.limit},3e4)),F=N=>{c(N.target.value),u(p=>({...p,page:1}))},T=N=>{m(N),u(p=>({...p,page:1}))},E=N=>{j(N),u(p=>({...p,page:1}))},A=N=>{const p=Array.isArray(N)?N:[];d(new Set(p)),u(f=>({...f,page:1}))},I=()=>{c(""),m(new Set),d(new Set),u(N=>({...N,page:1}))},z=N=>{t.prefetchQuery(oe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s],is_null_:!1},subflow_runs:{exists_:!1},name:h?{like_:h}:void 0,state:r.size>0?{operator:"and_",name:{any_:Array.from(r)}}:void 0,tags:o.size>0?{operator:"and_",all_:Array.from(o)}:void 0},sort:i,page:N,limit:l.limit},3e4))},M=a||r.size>0||o.size>0,R=n.useMemo(()=>{if(!g?.results)return null;const N=new Map;for(const p of g.results){const f=String(p.state?.name??"Unknown");N.set(f,(N.get(f)??0)+1)}return Array.from(N.entries()).map(([p,f])=>`${f} ${p}`).join(", ")},[g?.results]);return v===0?e.jsx("div",{className:"flex items-center justify-center h-48 border rounded-lg bg-muted/50",children:e.jsx(U,{className:"text-muted-foreground",children:"No task runs found for this flow run."})}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-12 items-center gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1 xl:col-span-3 md:col-span-12 col-span-6 md:order-0 order-3",children:[e.jsxs(U,{variant:"bodySmall",className:"text-muted-foreground",children:[v," Task run",v!==1?"s":""]}),R&&e.jsxs(U,{variant:"bodySmall",className:"text-muted-foreground text-xs capitalize",children:["(",R,")"]})]}),e.jsx("div",{className:"xl:col-span-3 md:col-span-6 col-span-12 md:order-1 order-0",children:e.jsx(Pe,{value:a,onChange:F,placeholder:"Search by run name","aria-label":"Search by run name",debounceMs:300})}),e.jsx("div",{className:"xl:col-span-2 md:col-span-6 col-span-12 md:order-2 order-1",children:e.jsx(xa,{selectedFilters:r,onSelectFilter:T})}),e.jsx("div",{className:"xl:col-span-2 md:col-span-6 col-span-12 md:order-3 order-2",children:e.jsx(Qs,{value:Array.from(o),onChange:A,placeholder:"All tags"})}),e.jsx("div",{className:"xl:border-l xl:border-border xl:pl-2 xl:col-span-2 md:col-span-6 col-span-6 md:order-4 order-4",children:e.jsx(Os,{value:i,onSelect:E})})]}),e.jsx(Us,{taskRuns:g?.results,onClearFilters:M?I:void 0}),g&&g.pages>0&&e.jsx(Gs,{pagination:l,onChangePagination:u,count:g.count,pages:g.pages,onPrefetchPage:z})]})},pa=({id:s,tab:t,onTabChange:a})=>{const[c,r]=n.useState(!1),[m,o]=n.useState(!1),d=J(),{data:i}=$({...hs(s),refetchInterval:c}),{deleteFlowRun:j}=ps(),{navigate:l}=Qe(),u=i.state_type==="PENDING";ws(i?.state_type),n.useEffect(()=>{i.state_type==="RUNNING"||i.state_type==="PENDING"?r(5e3):r(!1)},[i]);const h=()=>{j(i.id,{onSuccess:()=>{r(!1),y.success("Flow run deleted"),l({to:"/runs",replace:!0})},onError:E=>{const A=E.message||"Unknown error while deleting flow run.";y.error(A)}})},v=n.useCallback(()=>{d.invalidateQueries({queryKey:js.all()})},[d]),g=n.useCallback(()=>{d.invalidateQueries({queryKey:gs.all()})},[d]),F=n.useCallback(()=>{d.invalidateQueries({queryKey:fs.lists()})},[d]),T=n.useCallback(()=>{d.invalidateQueries({queryKey:ys.all()})},[d]);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-col gap-2",children:e.jsx(ia,{flowRun:i,onDeleteClick:h})}),!u&&e.jsx(he,{className:"py-0",children:e.jsx(pe,{className:"p-0",children:e.jsx(Ys,{flowRunId:i.id,stateType:i.state_type??void 0,fullscreen:m,onFullscreenChange:o})})}),e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(ja,{currentTab:t,onTabChange:a,flowRun:i,logsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load logs",details:"An error occurred while loading log data. Please try again."},onRetry:v}),children:e.jsx(n.Suspense,{fallback:e.jsx(ga,{}),children:e.jsx(ca,{flowRun:i})})}),taskRunsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load task runs",details:"An error occurred while loading task run data. Please try again."},onRetry:g}),children:e.jsx(n.Suspense,{fallback:e.jsx(fa,{}),children:e.jsx(ha,{flowRunId:s})})}),subflowRunsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load subflow runs",details:"An error occurred while loading subflow run data. Please try again."},onRetry:F}),children:e.jsx(n.Suspense,{fallback:e.jsx(Na,{}),children:e.jsx(ma,{parentFlowRunId:s})})}),artifactsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load artifacts",details:"An error occurred while loading artifact data. Please try again."},onRetry:T}),children:e.jsx(n.Suspense,{fallback:e.jsx(ya,{}),children:e.jsx(Zs,{flowRun:i})})}),detailsContent:e.jsx(n.Suspense,{fallback:e.jsx(va,{}),children:e.jsx(ea,{flowRun:i})}),parametersContent:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{y.success("Copied parameters to clipboard"),navigator.clipboard.writeText(JSON.stringify(i.parameters??{},null,2))},children:[e.jsx(_,{id:"Copy",className:"size-4 mr-2"}),"Copy parameters"]})}),e.jsx(ce,{value:JSON.stringify(i.parameters??{},null,2),disabled:!0})]}),jobVariablesContent:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{y.success("Copied job variables to clipboard"),navigator.clipboard.writeText(JSON.stringify(i.job_variables??{},null,2))},children:[e.jsx(_,{id:"Copy",className:"size-4 mr-2"}),"Copy job variables"]})}),e.jsx(ce,{value:JSON.stringify(i.job_variables??{},null,2),disabled:!0})]})})})]})},ja=({currentTab:s,onTabChange:t,flowRun:a,logsContent:c,taskRunsContent:r,subflowRunsContent:m,artifactsContent:o,detailsContent:d,parametersContent:i,jobVariablesContent:j})=>e.jsxs(Ns,{value:s,onValueChange:l=>t(l),children:[e.jsxs(vs,{children:[e.jsx(L,{value:"Details",children:"Details"}),e.jsx(L,{value:"Logs",children:"Logs"}),a.state_type!=="PENDING"&&e.jsx(L,{value:"TaskRuns",children:"Task Runs"}),a.state_type!=="PENDING"&&e.jsx(L,{value:"SubflowRuns",children:"Subflow Runs"}),e.jsx(L,{value:"Artifacts",children:"Artifacts"}),e.jsx(L,{value:"Parameters",children:"Parameters"}),e.jsx(L,{value:"JobVariables",children:"Job Variables"})]}),e.jsx(P,{value:"Details",children:d}),e.jsx(P,{value:"Logs",children:c}),e.jsx(P,{value:"TaskRuns",children:r}),e.jsx(P,{value:"SubflowRuns",children:m}),e.jsx(P,{value:"Artifacts",children:o}),e.jsx(P,{value:"Parameters",children:i}),e.jsx(P,{value:"JobVariables",children:j})]}),ga=()=>e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-row gap-2 justify-end",children:[e.jsx(x,{className:"h-8 w-25"}),e.jsx(x,{className:"h-8 w-32"}),e.jsx(x,{className:"h-8 w-8"})," "]}),e.jsx(x,{className:"h-32"})]}),fa=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(x,{className:"h-4 w-24"})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(x,{className:"h-9 flex-1"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{className:"h-9 w-48"}),e.jsx(x,{className:"h-9 w-40"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"})]})]}),ya=()=>e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(x,{className:"h-8 w-12"})}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3",children:[e.jsx(x,{className:"h-40"}),e.jsx(x,{className:"h-40"}),e.jsx(x,{className:"h-40"}),e.jsx(x,{className:"h-40"})]})]}),Na=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(x,{className:"h-4 w-24"})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(x,{className:"h-9 flex-1"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{className:"h-9 w-48"}),e.jsx(x,{className:"h-9 w-40"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"})]})]}),va=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-20"}),e.jsx(x,{className:"h-5 w-12"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-16"}),e.jsx(x,{className:"h-5 w-32"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-24"}),e.jsx(x,{className:"h-5 w-32"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-24"}),e.jsx(x,{className:"h-5 w-64"})]})]});Vs({tab:qs(["Logs","TaskRuns","SubflowRuns","Artifacts","Details","Parameters","JobVariables"]).default("Logs").catch("Logs")});function Wa(){const{id:s}=de.useParams(),{tab:t}=de.useSearch(),a=Ve(),c=r=>{a({to:".",search:m=>({...m,tab:r})})};return e.jsx(pa,{id:s,tab:t,onTabChange:c})}export{Wa as component};
4
+ //# sourceMappingURL=flow-run._id-RLy2kBh0.js.map