prefect 3.6.15__py3-none-any.whl → 3.6.16.dev2__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 (257) hide show
  1. prefect/__init__.py +20 -0
  2. prefect/_build_info.py +3 -3
  3. prefect/_internal/analytics/__init__.py +80 -0
  4. prefect/_internal/analytics/_config.py +2 -0
  5. prefect/_internal/analytics/ci_detection.py +39 -0
  6. prefect/_internal/analytics/client.py +132 -0
  7. prefect/_internal/analytics/device_id.py +55 -0
  8. prefect/_internal/analytics/emit.py +90 -0
  9. prefect/_internal/analytics/enabled.py +33 -0
  10. prefect/_internal/analytics/events.py +14 -0
  11. prefect/_internal/analytics/milestones.py +177 -0
  12. prefect/_internal/analytics/notice.py +60 -0
  13. prefect/_internal/analytics/service.py +238 -0
  14. prefect/analytics/__init__.py +67 -0
  15. prefect/deployments/runner.py +20 -0
  16. prefect/flow_engine.py +16 -0
  17. prefect/flows.py +8 -0
  18. prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js → artifact-card-BclosG8t.js} +2 -2
  19. prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js.map → artifact-card-BclosG8t.js.map} +1 -1
  20. prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js +2 -0
  21. prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js.map +1 -0
  22. prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js → automation-wizard-Bmgt6nn8.js} +2 -2
  23. prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js.map → automation-wizard-Bmgt6nn8.js.map} +1 -1
  24. prefect/server/ui-v2/assets/automation._id-Ccke3KJz.js +2 -0
  25. prefect/server/ui-v2/assets/{automation._id-Dn7jABys.js.map → automation._id-Ccke3KJz.js.map} +1 -1
  26. prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js → automation_._id.edit-BlKPUTVf.js} +2 -2
  27. prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js.map → automation_._id.edit-BlKPUTVf.js.map} +1 -1
  28. prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js → automations-header-Df2zw3SC.js} +2 -2
  29. prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js.map → automations-header-Df2zw3SC.js.map} +1 -1
  30. prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js → base-job-template-form-section-oZD6U-RW.js} +2 -2
  31. prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js.map → base-job-template-form-section-oZD6U-RW.js.map} +1 -1
  32. prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js → block-type-details-CYrdaLot.js} +2 -2
  33. prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js.map → block-type-details-CYrdaLot.js.map} +1 -1
  34. prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js +2 -0
  35. prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js.map +1 -0
  36. prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js → block._id-CBgHrpTP.js} +2 -2
  37. prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js.map → block._id-CBgHrpTP.js.map} +1 -1
  38. prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js → block_._id.edit-CW-kdi4O.js} +2 -2
  39. prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js.map → block_._id.edit-CW-kdi4O.js.map} +1 -1
  40. prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js → catalog-Brh0kn1I.js} +2 -2
  41. prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js.map → catalog-Brh0kn1I.js.map} +1 -1
  42. prefect/server/ui-v2/assets/catalog_._slug-MCgzguIZ.js +2 -0
  43. prefect/server/ui-v2/assets/{catalog_._slug-Bl2J2oI3.js.map → catalog_._slug-MCgzguIZ.js.map} +1 -1
  44. prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js → catalog_._slug_.create-DBaeHi9Q.js} +2 -2
  45. prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js.map → catalog_._slug_.create-DBaeHi9Q.js.map} +1 -1
  46. prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js → collapsible-B_NJS0uJ.js} +2 -2
  47. prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js.map → collapsible-B_NJS0uJ.js.map} +1 -1
  48. prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js → concurrency-limit._id-qzNUQzQa.js} +2 -2
  49. prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js.map → concurrency-limit._id-qzNUQzQa.js.map} +1 -1
  50. prefect/server/ui-v2/assets/create-BwXG6EIb.js +2 -0
  51. prefect/server/ui-v2/assets/{create-D--LHaji.js.map → create-BwXG6EIb.js.map} +1 -1
  52. prefect/server/ui-v2/assets/{create-BycfZHGQ.js → create-MoiIE9Ms.js} +2 -2
  53. prefect/server/ui-v2/assets/{create-BycfZHGQ.js.map → create-MoiIE9Ms.js.map} +1 -1
  54. prefect/server/ui-v2/assets/data-table-CPkppyg6.js +2 -0
  55. prefect/server/ui-v2/assets/data-table-CPkppyg6.js.map +1 -0
  56. prefect/server/ui-v2/assets/delete-confirmation-dialog-CwDK_2QS.js +2 -0
  57. prefect/server/ui-v2/assets/{delete-confirmation-dialog-DHkm2p8m.js.map → delete-confirmation-dialog-CwDK_2QS.js.map} +1 -1
  58. prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js → deployment-action-header-Vp9YsCJO.js} +2 -2
  59. prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js.map → deployment-action-header-Vp9YsCJO.js.map} +1 -1
  60. prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js → deployment-form-CJcg_6DJ.js} +3 -3
  61. prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js.map → deployment-form-CJcg_6DJ.js.map} +1 -1
  62. prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js → deployment-links-CIkJIuHh.js} +2 -2
  63. prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js.map → deployment-links-CIkJIuHh.js.map} +1 -1
  64. prefect/server/ui-v2/assets/deployment._id-C6XrGMp_.js +2 -0
  65. prefect/server/ui-v2/assets/{deployment._id-Ci9zge5n.js.map → deployment._id-C6XrGMp_.js.map} +1 -1
  66. prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js → deployment._id-CWgTYmTG.js} +2 -2
  67. prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js.map → deployment._id-CWgTYmTG.js.map} +1 -1
  68. prefect/server/ui-v2/assets/deployment_._id.duplicate-Bg0s0ZJn.js +2 -0
  69. prefect/server/ui-v2/assets/{deployment_._id.duplicate-D9ZWkh8H.js.map → deployment_._id.duplicate-Bg0s0ZJn.js.map} +1 -1
  70. prefect/server/ui-v2/assets/deployment_._id.edit-CnoB0UeG.js +2 -0
  71. prefect/server/ui-v2/assets/{deployment_._id.edit-CS7sObzC.js.map → deployment_._id.edit-CnoB0UeG.js.map} +1 -1
  72. prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js → deployment_._id.run-BqPK6rTB.js} +2 -2
  73. prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js.map → deployment_._id.run-BqPK6rTB.js.map} +1 -1
  74. prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js → dropdown-menu-D7Gwbd15.js} +2 -2
  75. prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js.map → dropdown-menu-D7Gwbd15.js.map} +1 -1
  76. prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js → event-resource-display-CDRgVKd4.js} +2 -2
  77. prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js.map → event-resource-display-CDRgVKd4.js.map} +1 -1
  78. prefect/server/ui-v2/assets/event._eventDate._eventId-C73GMDkK.js +2 -0
  79. prefect/server/ui-v2/assets/{event._eventDate._eventId-D7Twzb22.js.map → event._eventDate._eventId-C73GMDkK.js.map} +1 -1
  80. prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js → flow-run-graph-ckiE3mA9.js} +2 -2
  81. prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js.map → flow-run-graph-ckiE3mA9.js.map} +1 -1
  82. prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js → flow-run._id-BukrNCAq.js} +2 -2
  83. prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js.map → flow-run._id-BukrNCAq.js.map} +1 -1
  84. prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js → flow-run._id-CtI5VZ2M.js} +2 -2
  85. prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js.map → flow-run._id-CtI5VZ2M.js.map} +1 -1
  86. prefect/server/ui-v2/assets/flow-run._id-s1UJuakA.js +4 -0
  87. prefect/server/ui-v2/assets/{flow-run._id-RLy2kBh0.js.map → flow-run._id-s1UJuakA.js.map} +1 -1
  88. prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js → flow-runs-pagination-SLbYtvaR.js} +2 -2
  89. prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js.map → flow-runs-pagination-SLbYtvaR.js.map} +1 -1
  90. prefect/server/ui-v2/assets/flow._id-CZ5P0v4N.js +2 -0
  91. prefect/server/ui-v2/assets/{flow._id-BdQGWPKP.js.map → flow._id-CZ5P0v4N.js.map} +1 -1
  92. prefect/server/ui-v2/assets/{form-DLrbC7rV.js → form-mws4law8.js} +2 -2
  93. prefect/server/ui-v2/assets/{form-DLrbC7rV.js.map → form-mws4law8.js.map} +1 -1
  94. prefect/server/ui-v2/assets/{header-BTAWyeXv.js → header-Bes1LmY7.js} +2 -2
  95. prefect/server/ui-v2/assets/{header-BTAWyeXv.js.map → header-Bes1LmY7.js.map} +1 -1
  96. prefect/server/ui-v2/assets/{header-ChFAx5uR.js → header-Bj_zBR-a.js} +2 -2
  97. prefect/server/ui-v2/assets/{header-ChFAx5uR.js.map → header-Bj_zBR-a.js.map} +1 -1
  98. prefect/server/ui-v2/assets/{header-CyQqOj1w.js → header-CPxTHSvz.js} +2 -2
  99. prefect/server/ui-v2/assets/{header-CyQqOj1w.js.map → header-CPxTHSvz.js.map} +1 -1
  100. prefect/server/ui-v2/assets/{index-m48E4KcG.js → index-B8vo2Lrg.js} +5 -5
  101. prefect/server/ui-v2/assets/{index-m48E4KcG.js.map → index-B8vo2Lrg.js.map} +1 -1
  102. prefect/server/ui-v2/assets/{index-D5RT-SAp.js → index-BBeh-3Nh.js} +2 -2
  103. prefect/server/ui-v2/assets/{index-D5RT-SAp.js.map → index-BBeh-3Nh.js.map} +1 -1
  104. prefect/server/ui-v2/assets/index-BLnEvHia.js +2 -0
  105. prefect/server/ui-v2/assets/{index-7i4X9TeK.js.map → index-BLnEvHia.js.map} +1 -1
  106. prefect/server/ui-v2/assets/index-BpKoubXu.js +2 -0
  107. prefect/server/ui-v2/assets/index-BpKoubXu.js.map +1 -0
  108. prefect/server/ui-v2/assets/index-By6YGqR3.js +2 -0
  109. prefect/server/ui-v2/assets/index-By6YGqR3.js.map +1 -0
  110. prefect/server/ui-v2/assets/index-CEi3BlKI.js +2 -0
  111. prefect/server/ui-v2/assets/index-CEi3BlKI.js.map +1 -0
  112. prefect/server/ui-v2/assets/{index-BaWDC4da.js → index-CS-zxv7Z.js} +2 -2
  113. prefect/server/ui-v2/assets/{index-BaWDC4da.js.map → index-CS-zxv7Z.js.map} +1 -1
  114. prefect/server/ui-v2/assets/{index-kP_I5Qfd.js → index-CToHKh4q.js} +2 -2
  115. prefect/server/ui-v2/assets/{index-kP_I5Qfd.js.map → index-CToHKh4q.js.map} +1 -1
  116. prefect/server/ui-v2/assets/{index-CKGj5lSu.js → index-CUVvZndW.js} +2 -2
  117. prefect/server/ui-v2/assets/{index-CKGj5lSu.js.map → index-CUVvZndW.js.map} +1 -1
  118. prefect/server/ui-v2/assets/{index-CxUfZRkN.js → index-CYVn-I3i.js} +2 -2
  119. prefect/server/ui-v2/assets/{index-CxUfZRkN.js.map → index-CYVn-I3i.js.map} +1 -1
  120. prefect/server/ui-v2/assets/{index-CnlN-VC_.js → index-Cun0JN4t.js} +2 -2
  121. prefect/server/ui-v2/assets/{index-CnlN-VC_.js.map → index-Cun0JN4t.js.map} +1 -1
  122. prefect/server/ui-v2/assets/{index-BwCLKpNb.js → index-D6ynV6U7.js} +2 -2
  123. prefect/server/ui-v2/assets/{index-BwCLKpNb.js.map → index-D6ynV6U7.js.map} +1 -1
  124. prefect/server/ui-v2/assets/{index-CHf6xi9j.js → index-DdNUJLRW.js} +2 -2
  125. prefect/server/ui-v2/assets/{index-CHf6xi9j.js.map → index-DdNUJLRW.js.map} +1 -1
  126. prefect/server/ui-v2/assets/{index-CQnWiUE5.js → index-DlHOXQhu.js} +2 -2
  127. prefect/server/ui-v2/assets/{index-CQnWiUE5.js.map → index-DlHOXQhu.js.map} +1 -1
  128. prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js → index-DyVw8YE8.js} +2 -2
  129. prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js.map → index-DyVw8YE8.js.map} +1 -1
  130. prefect/server/ui-v2/assets/{index-Btb_-PDp.js → index-DzRz7D2P.js} +2 -2
  131. prefect/server/ui-v2/assets/{index-Btb_-PDp.js.map → index-DzRz7D2P.js.map} +1 -1
  132. prefect/server/ui-v2/assets/{index-DQGif3jm.js → index-DzUcVNZg.js} +2 -2
  133. prefect/server/ui-v2/assets/{index-DQGif3jm.js.map → index-DzUcVNZg.js.map} +1 -1
  134. prefect/server/ui-v2/assets/{index-DNh9ZBy4.js → index-IBvMMs6S.js} +2 -2
  135. prefect/server/ui-v2/assets/{index-DNh9ZBy4.js.map → index-IBvMMs6S.js.map} +1 -1
  136. prefect/server/ui-v2/assets/index-_kpA__te.js +2 -0
  137. prefect/server/ui-v2/assets/{index-CiSFHkhI.js.map → index-_kpA__te.js.map} +1 -1
  138. prefect/server/ui-v2/assets/index-m9O-nIOl.css +1 -0
  139. prefect/server/ui-v2/assets/{index-lyQav_XM.js → index-wOvyf10b.js} +2 -2
  140. prefect/server/ui-v2/assets/{index-lyQav_XM.js.map → index-wOvyf10b.js.map} +1 -1
  141. prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js → json-input-Ce-HlRqa.js} +2 -2
  142. prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js.map → json-input-Ce-HlRqa.js.map} +1 -1
  143. prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js → key-value-XHEZOtZX.js} +2 -2
  144. prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js.map → key-value-XHEZOtZX.js.map} +1 -1
  145. prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js → key._key-LpsMf3zD.js} +2 -2
  146. prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js.map → key._key-LpsMf3zD.js.map} +1 -1
  147. prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js → lazy-markdown-1Hz0xzca.js} +2 -2
  148. prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js.map → lazy-markdown-1Hz0xzca.js.map} +1 -1
  149. prefect/server/ui-v2/assets/{login-DxMF9Jvj.js → login-D5uepl9L.js} +2 -2
  150. prefect/server/ui-v2/assets/{login-DxMF9Jvj.js.map → login-D5uepl9L.js.map} +1 -1
  151. prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js → markdown-input-CG6M9zD0.js} +2 -2
  152. prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js.map → markdown-input-CG6M9zD0.js.map} +1 -1
  153. prefect/server/ui-v2/assets/python-example-snippet-DRHcUlCX.js +3 -0
  154. prefect/server/ui-v2/assets/{python-example-snippet-DfCFYPN_.js.map → python-example-snippet-DRHcUlCX.js.map} +1 -1
  155. prefect/server/ui-v2/assets/{python-input-mr6GD840.js → python-input-BsUS8fw1.js} +2 -2
  156. prefect/server/ui-v2/assets/{python-input-mr6GD840.js.map → python-input-BsUS8fw1.js.map} +1 -1
  157. prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js → radio-group-BUsmwdrt.js} +2 -2
  158. prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js.map → radio-group-BUsmwdrt.js.map} +1 -1
  159. prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js → route-error-state-BFBpiIhD.js} +2 -2
  160. prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js.map → route-error-state-BFBpiIhD.js.map} +1 -1
  161. prefect/server/ui-v2/assets/{schema-form-CWDHSME9.js → schema-form-BwTmkvJk.js} +2 -2
  162. prefect/server/ui-v2/assets/{schema-form-CWDHSME9.js.map → schema-form-BwTmkvJk.js.map} +1 -1
  163. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js → schema-form-input-string-format-datetime-nrb3g-JJ.js} +4 -4
  164. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js.map → schema-form-input-string-format-datetime-nrb3g-JJ.js.map} +1 -1
  165. prefect/server/ui-v2/assets/{settings-DU5y6tJE.js → settings-CUBtK5aW.js} +2 -2
  166. prefect/server/ui-v2/assets/{settings-DU5y6tJE.js.map → settings-CUBtK5aW.js.map} +1 -1
  167. prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js → sort-filter-Cv8zAXMp.js} +2 -2
  168. prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js.map → sort-filter-Cv8zAXMp.js.map} +1 -1
  169. prefect/server/ui-v2/assets/{table-bBL6C0ZK.js → table-BBNGfPra.js} +2 -2
  170. prefect/server/ui-v2/assets/{table-bBL6C0ZK.js.map → table-BBNGfPra.js.map} +1 -1
  171. prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js → tags-input-DHrnkwjQ.js} +2 -2
  172. prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js.map → tags-input-DHrnkwjQ.js.map} +1 -1
  173. prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js +2 -0
  174. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-S69sih55.js.map → task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js.map} +1 -1
  175. prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js → task-run._id-BY58gqs2.js} +2 -2
  176. prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js.map → task-run._id-BY58gqs2.js.map} +1 -1
  177. prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js → task-run._id-u73Jxfqw.js} +3 -3
  178. prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js.map → task-run._id-u73Jxfqw.js.map} +1 -1
  179. prefect/server/ui-v2/assets/task-runs-pagination-DUy3147A.js +2 -0
  180. prefect/server/ui-v2/assets/{task-runs-pagination-VdR-LO4r.js.map → task-runs-pagination-DUy3147A.js.map} +1 -1
  181. prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js → textarea-DUhh6-kq.js} +2 -2
  182. prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js.map → textarea-DUhh6-kq.js.map} +1 -1
  183. prefect/server/ui-v2/assets/timezone-select-D4Q6VBtD.js +2 -0
  184. prefect/server/ui-v2/assets/{timezone-select-BuPYznge.js.map → timezone-select-D4Q6VBtD.js.map} +1 -1
  185. prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js → toggle-group-7WUJn2Tx.js} +2 -2
  186. prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js.map → toggle-group-7WUJn2Tx.js.map} +1 -1
  187. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-D4AD5Ndf.js +2 -0
  188. prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DpdsLH4t.js.map → use-delete-automation-confirmation-dialog-D4AD5Ndf.js.map} +1 -1
  189. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js → use-delete-block-document-confirmation-dialog-DnwWEGUY.js} +2 -2
  190. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js.map → use-delete-block-document-confirmation-dialog-DnwWEGUY.js.map} +1 -1
  191. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js → use-flow-runs-selected-rows-C-tehPRB.js} +2 -2
  192. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js.map → use-flow-runs-selected-rows-C-tehPRB.js.map} +1 -1
  193. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js → use-get-artifacts-flow-task-runs-DRWRrmrb.js} +2 -2
  194. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js.map → use-get-artifacts-flow-task-runs-DRWRrmrb.js.map} +1 -1
  195. prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js → use-quick-run-B4Xj-YQQ.js} +2 -2
  196. prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js.map → use-quick-run-B4Xj-YQQ.js.map} +1 -1
  197. prefect/server/ui-v2/assets/use-state-favicon-au2TZdMV.js +2 -0
  198. prefect/server/ui-v2/assets/{use-state-favicon-M09DmrNy.js.map → use-state-favicon-au2TZdMV.js.map} +1 -1
  199. prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js → use-stepper-DyIb3vlq.js} +2 -2
  200. prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js.map → use-stepper-DyIb3vlq.js.map} +1 -1
  201. prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js → utilities-D9Y2wo66.js} +2 -2
  202. prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js.map → utilities-D9Y2wo66.js.map} +1 -1
  203. prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js +34 -0
  204. prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js.map +1 -0
  205. prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js → work-pool-filter-CSOATj2D.js} +2 -2
  206. prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js.map → work-pool-filter-CSOATj2D.js.map} +1 -1
  207. prefect/server/ui-v2/assets/work-pool-queue-toggle-Dh7B1zMo.js +2 -0
  208. prefect/server/ui-v2/assets/{work-pool-queue-toggle-BQ9b-Wxy.js.map → work-pool-queue-toggle-Dh7B1zMo.js.map} +1 -1
  209. prefect/server/ui-v2/assets/work-pool._workPoolName-B_NFWXKS.js +2 -0
  210. prefect/server/ui-v2/assets/{work-pool._workPoolName-C_LiL3SE.js.map → work-pool._workPoolName-B_NFWXKS.js.map} +1 -1
  211. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js → work-pool_._workPoolName.edit-Cyzn8g-S.js} +2 -2
  212. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js.map → work-pool_._workPoolName.edit-Cyzn8g-S.js.map} +1 -1
  213. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js} +2 -2
  214. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js.map → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js.map} +1 -1
  215. prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js → work-queue-icon-text-BOpcJ8YU.js} +2 -2
  216. prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js.map → work-queue-icon-text-BOpcJ8YU.js.map} +1 -1
  217. prefect/server/ui-v2/index.html +3 -3
  218. {prefect-3.6.15.dist-info → prefect-3.6.16.dev2.dist-info}/METADATA +2 -1
  219. {prefect-3.6.15.dist-info → prefect-3.6.16.dev2.dist-info}/RECORD +222 -210
  220. prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js +0 -2
  221. prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js.map +0 -1
  222. prefect/server/ui-v2/assets/automation._id-Dn7jABys.js +0 -2
  223. prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js +0 -2
  224. prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js.map +0 -1
  225. prefect/server/ui-v2/assets/catalog_._slug-Bl2J2oI3.js +0 -2
  226. prefect/server/ui-v2/assets/create-D--LHaji.js +0 -2
  227. prefect/server/ui-v2/assets/data-table-rlbkLcrY.js +0 -2
  228. prefect/server/ui-v2/assets/data-table-rlbkLcrY.js.map +0 -1
  229. prefect/server/ui-v2/assets/delete-confirmation-dialog-DHkm2p8m.js +0 -2
  230. prefect/server/ui-v2/assets/deployment._id-Ci9zge5n.js +0 -2
  231. prefect/server/ui-v2/assets/deployment_._id.duplicate-D9ZWkh8H.js +0 -2
  232. prefect/server/ui-v2/assets/deployment_._id.edit-CS7sObzC.js +0 -2
  233. prefect/server/ui-v2/assets/event._eventDate._eventId-D7Twzb22.js +0 -2
  234. prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js +0 -4
  235. prefect/server/ui-v2/assets/flow._id-BdQGWPKP.js +0 -2
  236. prefect/server/ui-v2/assets/index-7i4X9TeK.js +0 -2
  237. prefect/server/ui-v2/assets/index-BkiGTHwU.js +0 -2
  238. prefect/server/ui-v2/assets/index-BkiGTHwU.js.map +0 -1
  239. prefect/server/ui-v2/assets/index-COouj_0-.css +0 -1
  240. prefect/server/ui-v2/assets/index-CiSFHkhI.js +0 -2
  241. prefect/server/ui-v2/assets/index-DATPYZfT.js +0 -2
  242. prefect/server/ui-v2/assets/index-DATPYZfT.js.map +0 -1
  243. prefect/server/ui-v2/assets/index-VH4TnZ4e.js +0 -2
  244. prefect/server/ui-v2/assets/index-VH4TnZ4e.js.map +0 -1
  245. prefect/server/ui-v2/assets/python-example-snippet-DfCFYPN_.js +0 -3
  246. prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-S69sih55.js +0 -2
  247. prefect/server/ui-v2/assets/task-runs-pagination-VdR-LO4r.js +0 -2
  248. prefect/server/ui-v2/assets/timezone-select-BuPYznge.js +0 -2
  249. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DpdsLH4t.js +0 -2
  250. prefect/server/ui-v2/assets/use-state-favicon-M09DmrNy.js +0 -2
  251. prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js +0 -34
  252. prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js.map +0 -1
  253. prefect/server/ui-v2/assets/work-pool-queue-toggle-BQ9b-Wxy.js +0 -2
  254. prefect/server/ui-v2/assets/work-pool._workPoolName-C_LiL3SE.js +0 -2
  255. {prefect-3.6.15.dist-info → prefect-3.6.16.dev2.dist-info}/WHEEL +0 -0
  256. {prefect-3.6.15.dist-info → prefect-3.6.16.dev2.dist-info}/entry_points.txt +0 -0
  257. {prefect-3.6.15.dist-info → prefect-3.6.16.dev2.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- {"version":3,"mappings":";0GAIA,MAAMA,EAAkBC,OAAK,IAAAC,EAAA,IAC5B,OAAO,4BAAgB,0CAAE,KAAMC,IAAS,CAAE,QAASA,EAAI,aAAc,CACtE,EAIO,SAASC,EAAgB,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CAC9E,OACCC,MAACC,WAAA,CACA,SAAUD,MAACE,EAAA,CAAS,UAAW,iBAAiBJ,GAAa,EAAE,GAAI,EAEnE,SAAAE,MAACP,EAAA,CAAgB,UAAAK,EAAuB,GAAGC,CAAA,CAAO,GAGrD,CCXO,SAASI,EAAmB,CAClC,YAAAC,EACA,KAAAC,CACD,EAA4B,CAC3B,MAAMC,EAAUC,UAAQ,IAAM,CAC7B,KAAM,EAAGC,EAAiB,EAAE,EAC3BJ,EAAY,MAAM,wBAAwB,GAAK,GAKhD,OAJsBI,EAAe,QACpC,aACAH,GAAQ,cAEY,MACtB,EAAG,CAACD,EAAaC,CAAI,CAAC,EAEtB,OACCL,MAAC,OAAI,UAAU,sBACd,SAAAA,MAACS,EAAA,CACA,UAAU,MACV,MAAOH,EACP,SAAQ,GACR,KAAI,GACJ,gBAAe,KAEjB,CAEF","names":["PythonInputLazy","lazy","__vitePreload","mod","LazyPythonInput","className","props","jsx","Suspense","Skeleton","PythonBlockSnippet","codeExample","name","snippet","useMemo","genericSnippet","PythonInput"],"ignoreList":[],"sources":["../../src/components/ui/python-input-lazy.tsx","../../src/components/blocks/python-example-snippet.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { lazy, Suspense } from \"react\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nconst PythonInputLazy = lazy(() =>\n\timport(\"./python-input\").then((mod) => ({ default: mod.PythonInput })),\n);\n\ntype LazyPythonInputProps = ComponentProps<typeof PythonInputLazy>;\n\nexport function LazyPythonInput({ className, ...props }: LazyPythonInputProps) {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={<Skeleton className={`min-h-[200px] ${className ?? \"\"}`} />}\n\t\t>\n\t\t\t<PythonInputLazy className={className} {...props} />\n\t\t</Suspense>\n\t);\n}\n","import { useMemo } from \"react\";\nimport { LazyPythonInput as PythonInput } from \"@/components/ui/python-input-lazy\";\n\ntype PythonBlockSnippetProps = {\n\tcodeExample: string;\n\tname: string | undefined | null;\n};\nexport function PythonBlockSnippet({\n\tcodeExample,\n\tname,\n}: PythonBlockSnippetProps) {\n\tconst snippet = useMemo(() => {\n\t\tconst [, genericSnippet = \"\"] =\n\t\t\tcodeExample.match(/```python([\\S\\s]*?)```/) ?? [];\n\t\tconst customSnippet = genericSnippet.replace(\n\t\t\t\"BLOCK_NAME\",\n\t\t\tname ?? \"block-name\",\n\t\t);\n\t\treturn customSnippet.trim();\n\t}, [codeExample, name]);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<PythonInput\n\t\t\t\tclassName=\"p-2\"\n\t\t\t\tvalue={snippet}\n\t\t\t\tdisabled\n\t\t\t\tcopy\n\t\t\t\thideLineNumbers\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"file":"python-example-snippet-DfCFYPN_.js"}
1
+ {"version":3,"mappings":";0GAIA,MAAMA,EAAkBC,OAAK,IAAAC,EAAA,IAC5B,OAAO,4BAAgB,0CAAE,KAAMC,IAAS,CAAE,QAASA,EAAI,aAAc,CACtE,EAIO,SAASC,EAAgB,CAAE,UAAAC,EAAW,GAAGC,GAA+B,CAC9E,OACCC,MAACC,WAAA,CACA,SAAUD,MAACE,EAAA,CAAS,UAAW,iBAAiBJ,GAAa,EAAE,GAAI,EAEnE,SAAAE,MAACP,EAAA,CAAgB,UAAAK,EAAuB,GAAGC,CAAA,CAAO,GAGrD,CCXO,SAASI,EAAmB,CAClC,YAAAC,EACA,KAAAC,CACD,EAA4B,CAC3B,MAAMC,EAAUC,UAAQ,IAAM,CAC7B,KAAM,EAAGC,EAAiB,EAAE,EAC3BJ,EAAY,MAAM,wBAAwB,GAAK,GAKhD,OAJsBI,EAAe,QACpC,aACAH,GAAQ,cAEY,MACtB,EAAG,CAACD,EAAaC,CAAI,CAAC,EAEtB,OACCL,MAAC,OAAI,UAAU,sBACd,SAAAA,MAACS,EAAA,CACA,UAAU,MACV,MAAOH,EACP,SAAQ,GACR,KAAI,GACJ,gBAAe,KAEjB,CAEF","names":["PythonInputLazy","lazy","__vitePreload","mod","LazyPythonInput","className","props","jsx","Suspense","Skeleton","PythonBlockSnippet","codeExample","name","snippet","useMemo","genericSnippet","PythonInput"],"ignoreList":[],"sources":["../../src/components/ui/python-input-lazy.tsx","../../src/components/blocks/python-example-snippet.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { lazy, Suspense } from \"react\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\nconst PythonInputLazy = lazy(() =>\n\timport(\"./python-input\").then((mod) => ({ default: mod.PythonInput })),\n);\n\ntype LazyPythonInputProps = ComponentProps<typeof PythonInputLazy>;\n\nexport function LazyPythonInput({ className, ...props }: LazyPythonInputProps) {\n\treturn (\n\t\t<Suspense\n\t\t\tfallback={<Skeleton className={`min-h-[200px] ${className ?? \"\"}`} />}\n\t\t>\n\t\t\t<PythonInputLazy className={className} {...props} />\n\t\t</Suspense>\n\t);\n}\n","import { useMemo } from \"react\";\nimport { LazyPythonInput as PythonInput } from \"@/components/ui/python-input-lazy\";\n\ntype PythonBlockSnippetProps = {\n\tcodeExample: string;\n\tname: string | undefined | null;\n};\nexport function PythonBlockSnippet({\n\tcodeExample,\n\tname,\n}: PythonBlockSnippetProps) {\n\tconst snippet = useMemo(() => {\n\t\tconst [, genericSnippet = \"\"] =\n\t\t\tcodeExample.match(/```python([\\S\\s]*?)```/) ?? [];\n\t\tconst customSnippet = genericSnippet.replace(\n\t\t\t\"BLOCK_NAME\",\n\t\t\tname ?? \"block-name\",\n\t\t);\n\t\treturn customSnippet.trim();\n\t}, [codeExample, name]);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<PythonInput\n\t\t\t\tclassName=\"p-2\"\n\t\t\t\tvalue={snippet}\n\t\t\t\tdisabled\n\t\t\t\tcopy\n\t\t\t\thideLineNumbers\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"file":"python-example-snippet-DRHcUlCX.js"}
@@ -1,2 +1,2 @@
1
- import{c as d,r as c,j as s}from"./vendor-tanstack-BcZfOOfy.js";import{u as g,p as x,E as y}from"./vendor-codemirror-LnHkUyAP.js";import{aW as b,q as v,I as C,y as j}from"./index-m48E4KcG.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";const w=[x(),y.lineWrapping],E=d.forwardRef(({className:l,value:o,onChange:p,copy:u=!1,onBlur:N,disabled:r,hideLineNumbers:h=!1,...f},i)=>{const e=c.useRef(null);let n;r&&(n={lineNumbers:!h,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:w,value:o,onChange:p,indentWithTab:!1,editable:!r,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const m=t=>{j.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return s.jsx("div",{className:b("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...f,children:u&&o&&s.jsx(v,{onClick:()=>m(o),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:s.jsx(C,{id:"Copy",className:"size-2"})})})});E.displayName="PythonInput";export{E as PythonInput};
2
- //# sourceMappingURL=python-input-mr6GD840.js.map
1
+ import{c as d,r as c,j as s}from"./vendor-tanstack-BcZfOOfy.js";import{u as g,p as x,E as y}from"./vendor-codemirror-LnHkUyAP.js";import{a_ as b,q as v,I as C,y as j}from"./index-B8vo2Lrg.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BvvJP9Po.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";const w=[x(),y.lineWrapping],E=d.forwardRef(({className:l,value:o,onChange:p,copy:u=!1,onBlur:N,disabled:r,hideLineNumbers:h=!1,...f},i)=>{const e=c.useRef(null);let n;r&&(n={lineNumbers:!h,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:w,value:o,onChange:p,indentWithTab:!1,editable:!r,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const m=t=>{j.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return s.jsx("div",{className:b("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...f,children:u&&o&&s.jsx(v,{onClick:()=>m(o),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:s.jsx(C,{id:"Copy",className:"size-2"})})})});E.displayName="PythonInput";export{E as PythonInput};
2
+ //# sourceMappingURL=python-input-BsUS8fw1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"python-input-mr6GD840.js","sources":["../../src/components/ui/python-input.tsx"],"sourcesContent":["import { python } from \"@codemirror/lang-python\";\nimport {\n\ttype BasicSetupOptions,\n\tEditorView,\n\tuseCodeMirror,\n} from \"@uiw/react-codemirror\";\nimport React, { useEffect, useRef } from \"react\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/utils\";\nimport { Button } from \"./button\";\nimport { Icon } from \"./icons\";\n\nconst extensions = [python(), EditorView.lineWrapping];\n\ntype PythonInputProps = React.ComponentProps<\"div\"> & {\n\tvalue?: string;\n\tonChange?: (value: string) => void;\n\tonBlur?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport const PythonInput = React.forwardRef<HTMLDivElement, PythonInputProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tcopy = false,\n\t\t\tonBlur,\n\t\t\tdisabled,\n\t\t\thideLineNumbers = false,\n\t\t\t...props\n\t\t},\n\t\tforwardedRef,\n\t) => {\n\t\tconst editor = useRef<HTMLDivElement | null>(null);\n\t\t// Setting `basicSetup` messes up the tab order. We only change the basic setup\n\t\t// if the input is disabled, so we leave it undefined to maintain the tab order.\n\t\tlet basicSetup: BasicSetupOptions | undefined;\n\t\tif (disabled) {\n\t\t\tbasicSetup = {\n\t\t\t\tlineNumbers: !hideLineNumbers,\n\t\t\t\thighlightActiveLine: false,\n\t\t\t\tfoldGutter: false,\n\t\t\t\thighlightActiveLineGutter: false,\n\t\t\t};\n\t\t}\n\t\tconst { setContainer } = useCodeMirror({\n\t\t\tcontainer: editor.current,\n\t\t\textensions,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tonBlur,\n\t\t\tindentWithTab: false,\n\t\t\teditable: !disabled,\n\t\t\tbasicSetup,\n\t\t});\n\n\t\tuseEffect(() => {\n\t\t\tif (editor.current) {\n\t\t\t\tsetContainer(editor.current);\n\t\t\t}\n\t\t}, [setContainer]);\n\n\t\tconst handleCopy = (_value: string) => {\n\t\t\ttoast.success(\"Copied to clipboard\");\n\t\t\tvoid navigator.clipboard.writeText(_value);\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t\tif (typeof forwardedRef === \"function\") {\n\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{copy && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={() => handleCopy(value)}\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nPythonInput.displayName = \"PythonInput\";\n"],"names":["extensions","python","EditorView","PythonInput","React","className","value","onChange","copy","onBlur","disabled","hideLineNumbers","props","forwardedRef","editor","useRef","basicSetup","setContainer","useCodeMirror","useEffect","handleCopy","_value","toast","jsx","cn","node","Button","Icon"],"mappings":"iXAYA,MAAMA,EAAa,CAACC,IAAUC,EAAW,YAAY,EAYxCC,EAAcC,EAAM,WAChC,CACC,CACC,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,GACP,OAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAASC,EAAAA,OAA8B,IAAI,EAGjD,IAAIC,EACAN,IACHM,EAAa,CACZ,YAAa,CAACL,EACd,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,GAG7B,KAAM,CAAE,aAAAM,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAAd,EACA,MAAAM,EACA,SAAAC,EAEA,cAAe,GACf,SAAU,CAACG,EACX,WAAAM,CAAA,CACA,EAEDG,EAAAA,UAAU,IAAM,CACXL,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMG,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACCE,EAAAA,IAAC,MAAA,CACA,UAAWC,EACV,8HACAnB,CAAA,EAED,IAAMoB,GAAS,CACdX,EAAO,QAAUW,EACb,OAAOZ,GAAiB,WAC3BA,EAAaY,CAAI,EACPZ,IACVA,EAAa,QAAUY,EAEzB,EACC,GAAGb,EAEH,YAAQN,GACRiB,EAAAA,IAACG,EAAA,CACA,QAAS,IAAMN,EAAWd,CAAK,EAC/B,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAiB,EAAAA,IAACI,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CAIJ,CACD,EAEAxB,EAAY,YAAc"}
1
+ {"version":3,"file":"python-input-BsUS8fw1.js","sources":["../../src/components/ui/python-input.tsx"],"sourcesContent":["import { python } from \"@codemirror/lang-python\";\nimport {\n\ttype BasicSetupOptions,\n\tEditorView,\n\tuseCodeMirror,\n} from \"@uiw/react-codemirror\";\nimport React, { useEffect, useRef } from \"react\";\nimport { toast } from \"sonner\";\nimport { cn } from \"@/utils\";\nimport { Button } from \"./button\";\nimport { Icon } from \"./icons\";\n\nconst extensions = [python(), EditorView.lineWrapping];\n\ntype PythonInputProps = React.ComponentProps<\"div\"> & {\n\tvalue?: string;\n\tonChange?: (value: string) => void;\n\tonBlur?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\thideLineNumbers?: boolean;\n\tcopy?: boolean;\n};\n\nexport const PythonInput = React.forwardRef<HTMLDivElement, PythonInputProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tcopy = false,\n\t\t\tonBlur,\n\t\t\tdisabled,\n\t\t\thideLineNumbers = false,\n\t\t\t...props\n\t\t},\n\t\tforwardedRef,\n\t) => {\n\t\tconst editor = useRef<HTMLDivElement | null>(null);\n\t\t// Setting `basicSetup` messes up the tab order. We only change the basic setup\n\t\t// if the input is disabled, so we leave it undefined to maintain the tab order.\n\t\tlet basicSetup: BasicSetupOptions | undefined;\n\t\tif (disabled) {\n\t\t\tbasicSetup = {\n\t\t\t\tlineNumbers: !hideLineNumbers,\n\t\t\t\thighlightActiveLine: false,\n\t\t\t\tfoldGutter: false,\n\t\t\t\thighlightActiveLineGutter: false,\n\t\t\t};\n\t\t}\n\t\tconst { setContainer } = useCodeMirror({\n\t\t\tcontainer: editor.current,\n\t\t\textensions,\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tonBlur,\n\t\t\tindentWithTab: false,\n\t\t\teditable: !disabled,\n\t\t\tbasicSetup,\n\t\t});\n\n\t\tuseEffect(() => {\n\t\t\tif (editor.current) {\n\t\t\t\tsetContainer(editor.current);\n\t\t\t}\n\t\t}, [setContainer]);\n\n\t\tconst handleCopy = (_value: string) => {\n\t\t\ttoast.success(\"Copied to clipboard\");\n\t\t\tvoid navigator.clipboard.writeText(_value);\n\t\t};\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t\tif (typeof forwardedRef === \"function\") {\n\t\t\t\t\t\tforwardedRef(node);\n\t\t\t\t\t} else if (forwardedRef) {\n\t\t\t\t\t\tforwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{copy && value && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={() => handleCopy(value)}\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nPythonInput.displayName = \"PythonInput\";\n"],"names":["extensions","python","EditorView","PythonInput","React","className","value","onChange","copy","onBlur","disabled","hideLineNumbers","props","forwardedRef","editor","useRef","basicSetup","setContainer","useCodeMirror","useEffect","handleCopy","_value","toast","jsx","cn","node","Button","Icon"],"mappings":"iXAYA,MAAMA,EAAa,CAACC,IAAUC,EAAW,YAAY,EAYxCC,EAAcC,EAAM,WAChC,CACC,CACC,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,GACP,OAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,GAClB,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAASC,EAAAA,OAA8B,IAAI,EAGjD,IAAIC,EACAN,IACHM,EAAa,CACZ,YAAa,CAACL,EACd,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,GAG7B,KAAM,CAAE,aAAAM,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAAd,EACA,MAAAM,EACA,SAAAC,EAEA,cAAe,GACf,SAAU,CAACG,EACX,WAAAM,CAAA,CACA,EAEDG,EAAAA,UAAU,IAAM,CACXL,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMG,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACCE,EAAAA,IAAC,MAAA,CACA,UAAWC,EACV,8HACAnB,CAAA,EAED,IAAMoB,GAAS,CACdX,EAAO,QAAUW,EACb,OAAOZ,GAAiB,WAC3BA,EAAaY,CAAI,EACPZ,IACVA,EAAa,QAAUY,EAEzB,EACC,GAAGb,EAEH,YAAQN,GACRiB,EAAAA,IAACG,EAAA,CACA,QAAS,IAAMN,EAAWd,CAAK,EAC/B,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAiB,EAAAA,IAACI,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CAIJ,CACD,EAEAxB,EAAY,YAAc"}
@@ -1,2 +1,2 @@
1
- import{r as o,j as r}from"./vendor-tanstack-BcZfOOfy.js";import{ap as i,aq as t,ar as l}from"./vendor-radix-BTiKGWfR.js";import{aW as c,d3 as n}from"./index-m48E4KcG.js";const d=o.forwardRef(({className:a,...s},e)=>r.jsx(i,{className:c("grid gap-2",a),...s,ref:e}));d.displayName=i.displayName;const m=o.forwardRef(({className:a,...s},e)=>r.jsx(t,{ref:e,className:c("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...s,children:r.jsx(l,{className:"flex items-center justify-center",children:r.jsx(n,{className:"h-2.5 w-2.5 fill-current text-current"})})}));m.displayName=t.displayName;export{d as R,m as a};
2
- //# sourceMappingURL=radio-group-Co3cN0Kv.js.map
1
+ import{r as o,j as r}from"./vendor-tanstack-BcZfOOfy.js";import{ap as i,aq as t,ar as l}from"./vendor-radix-BTiKGWfR.js";import{a_ as c,d6 as n}from"./index-B8vo2Lrg.js";const d=o.forwardRef(({className:a,...s},e)=>r.jsx(i,{className:c("grid gap-2",a),...s,ref:e}));d.displayName=i.displayName;const m=o.forwardRef(({className:a,...s},e)=>r.jsx(t,{ref:e,className:c("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...s,children:r.jsx(l,{className:"flex items-center justify-center",children:r.jsx(n,{className:"h-2.5 w-2.5 fill-current text-current"})})}));m.displayName=t.displayName;export{d as R,m as a};
2
+ //# sourceMappingURL=radio-group-BUsmwdrt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-Co3cN0Kv.js","sources":["../../src/components/ui/radio-group.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst RadioGroup = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Root\n\t\t\tclassName={cn(\"grid gap-2\", className)}\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t/>\n\t);\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n\t\t\t\t<Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t);\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n"],"names":["RadioGroup","React.forwardRef","className","props","ref","jsx","RadioGroupPrimitive.Root","cn","RadioGroupItem","RadioGroupPrimitive.Item","RadioGroupPrimitive.Indicator","Circle"],"mappings":"0KAMA,MAAMA,EAAaC,EAAAA,WAGjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACC,EAAA,CACA,UAAWC,EAAG,aAAcL,CAAS,EACpC,GAAGC,EACJ,IAAAC,CAAA,CAAA,CAGF,EACDJ,EAAW,YAAcM,EAAyB,YAElD,MAAME,EAAiBP,EAAAA,WAGrB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACI,EAAA,CACA,IAAAL,EACA,UAAWG,EACV,2OACAL,CAAA,EAEA,GAAGC,EAEJ,SAAAE,EAAAA,IAACK,EAAA,CAA8B,UAAU,mCACxC,SAAAL,EAAAA,IAACM,EAAA,CAAO,UAAU,uCAAA,CAAwC,CAAA,CAC3D,CAAA,CAAA,CAGF,EACDH,EAAe,YAAcC,EAAyB"}
1
+ {"version":3,"file":"radio-group-BUsmwdrt.js","sources":["../../src/components/ui/radio-group.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst RadioGroup = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Root\n\t\t\tclassName={cn(\"grid gap-2\", className)}\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t/>\n\t);\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n\treturn (\n\t\t<RadioGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n\t\t\t\t<Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t);\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n"],"names":["RadioGroup","React.forwardRef","className","props","ref","jsx","RadioGroupPrimitive.Root","cn","RadioGroupItem","RadioGroupPrimitive.Item","RadioGroupPrimitive.Indicator","Circle"],"mappings":"0KAMA,MAAMA,EAAaC,EAAAA,WAGjB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACC,EAAA,CACA,UAAWC,EAAG,aAAcL,CAAS,EACpC,GAAGC,EACJ,IAAAC,CAAA,CAAA,CAGF,EACDJ,EAAW,YAAcM,EAAyB,YAElD,MAAME,EAAiBP,EAAAA,WAGrB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAA,EAASC,IAE1BC,EAAAA,IAACI,EAAA,CACA,IAAAL,EACA,UAAWG,EACV,2OACAL,CAAA,EAEA,GAAGC,EAEJ,SAAAE,EAAAA,IAACK,EAAA,CAA8B,UAAU,mCACxC,SAAAL,EAAAA,IAACM,EAAA,CAAO,UAAU,uCAAA,CAAwC,CAAA,CAC3D,CAAA,CAAA,CAGF,EACDH,EAAe,YAAcC,EAAyB"}
@@ -1,2 +1,2 @@
1
- import{r as s,j as e}from"./vendor-tanstack-BcZfOOfy.js";import{C as f,o as R,cd as h,q as g,ce as j,aW as p}from"./index-m48E4KcG.js";const N=5e3,v=3e4;function u(a){const t=N*2**a;return Math.min(t,v)}function E({error:a,onRetry:t}){const r=s.useRef(0),[m,l]=s.useState(u(0)/1e3),[c,n]=s.useState(!1),d=s.useCallback(()=>{n(!0),t(),r.current+=1;const i=u(r.current);l(i/1e3),setTimeout(()=>n(!1),500)},[t]),x=s.useCallback(()=>{n(!0),t(),r.current=0,l(u(0)/1e3),setTimeout(()=>n(!1),500)},[t]);return s.useEffect(()=>{const i=setInterval(()=>{l(o=>o<=1?(d(),o):o-1)},1e3);return()=>clearInterval(i)},[d]),e.jsx(f,{className:"mx-auto max-w-md",children:e.jsxs(R,{className:"flex flex-col items-center gap-4 pt-6 text-center",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-3",children:e.jsx(h,{className:"size-8 text-destructive"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.message}),a.details&&e.jsx("p",{className:"text-sm text-muted-foreground",children:a.details})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs(g,{onClick:x,disabled:c,variant:"outline",className:"gap-2",children:[e.jsx(j,{className:p("size-4",c&&"animate-spin")}),c?"Retrying...":"Retry"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retrying in ",m,"s"]})]})]})})}export{E as R};
2
- //# sourceMappingURL=route-error-state-DnBaNT2T.js.map
1
+ import{r as s,j as e}from"./vendor-tanstack-BcZfOOfy.js";import{C as f,o as R,cg as h,q as g,ch as j,a_ as p}from"./index-B8vo2Lrg.js";const N=5e3,v=3e4;function u(a){const t=N*2**a;return Math.min(t,v)}function E({error:a,onRetry:t}){const r=s.useRef(0),[m,l]=s.useState(u(0)/1e3),[c,n]=s.useState(!1),d=s.useCallback(()=>{n(!0),t(),r.current+=1;const i=u(r.current);l(i/1e3),setTimeout(()=>n(!1),500)},[t]),x=s.useCallback(()=>{n(!0),t(),r.current=0,l(u(0)/1e3),setTimeout(()=>n(!1),500)},[t]);return s.useEffect(()=>{const i=setInterval(()=>{l(o=>o<=1?(d(),o):o-1)},1e3);return()=>clearInterval(i)},[d]),e.jsx(f,{className:"mx-auto max-w-md",children:e.jsxs(R,{className:"flex flex-col items-center gap-4 pt-6 text-center",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-3",children:e.jsx(h,{className:"size-8 text-destructive"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a.message}),a.details&&e.jsx("p",{className:"text-sm text-muted-foreground",children:a.details})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsxs(g,{onClick:x,disabled:c,variant:"outline",className:"gap-2",children:[e.jsx(j,{className:p("size-4",c&&"animate-spin")}),c?"Retrying...":"Retry"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retrying in ",m,"s"]})]})]})})}export{E as R};
2
+ //# sourceMappingURL=route-error-state-BFBpiIhD.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-error-state-DnBaNT2T.js","sources":["../../src/components/ui/route-error-state.tsx"],"sourcesContent":["import { AlertCircle, RefreshCw } from \"lucide-react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ServerError } from \"@/api/error-utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { cn } from \"@/utils\";\n\nconst BASE_RETRY_INTERVAL_MS = 5000;\nconst MAX_RETRY_INTERVAL_MS = 30000;\n\nfunction getRetryInterval(attempt: number): number {\n\tconst interval = BASE_RETRY_INTERVAL_MS * 2 ** attempt;\n\treturn Math.min(interval, MAX_RETRY_INTERVAL_MS);\n}\n\ntype RouteErrorStateProps = {\n\terror: ServerError;\n\tonRetry: () => void;\n};\n\nexport function RouteErrorState({ error, onRetry }: RouteErrorStateProps) {\n\tconst retryAttemptRef = useRef(0);\n\tconst [secondsUntilRetry, setSecondsUntilRetry] = useState(\n\t\tgetRetryInterval(0) / 1000,\n\t);\n\tconst [isRetrying, setIsRetrying] = useState(false);\n\n\tconst handleAutoRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current += 1;\n\t\tconst nextInterval = getRetryInterval(retryAttemptRef.current);\n\t\tsetSecondsUntilRetry(nextInterval / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tconst handleManualRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current = 0;\n\t\tsetSecondsUntilRetry(getRetryInterval(0) / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tuseEffect(() => {\n\t\tconst interval = setInterval(() => {\n\t\t\tsetSecondsUntilRetry((prev) => {\n\t\t\t\tif (prev <= 1) {\n\t\t\t\t\thandleAutoRetry();\n\t\t\t\t\treturn prev;\n\t\t\t\t}\n\t\t\t\treturn prev - 1;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [handleAutoRetry]);\n\n\treturn (\n\t\t<Card className=\"mx-auto max-w-md\">\n\t\t\t<CardContent className=\"flex flex-col items-center gap-4 pt-6 text-center\">\n\t\t\t\t<div className=\"rounded-full bg-destructive/10 p-3\">\n\t\t\t\t\t<AlertCircle className=\"size-8 text-destructive\" />\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t<h2 className=\"text-lg font-semibold\">{error.message}</h2>\n\t\t\t\t\t{error.details && (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">{error.details}</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex flex-col items-center gap-2\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={handleManualRetry}\n\t\t\t\t\t\tdisabled={isRetrying}\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tclassName=\"gap-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<RefreshCw className={cn(\"size-4\", isRetrying && \"animate-spin\")} />\n\t\t\t\t\t\t{isRetrying ? \"Retrying...\" : \"Retry\"}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<p className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\tRetrying in {secondsUntilRetry}s\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n"],"names":["BASE_RETRY_INTERVAL_MS","MAX_RETRY_INTERVAL_MS","getRetryInterval","attempt","interval","RouteErrorState","error","onRetry","retryAttemptRef","useRef","secondsUntilRetry","setSecondsUntilRetry","useState","isRetrying","setIsRetrying","handleAutoRetry","useCallback","nextInterval","handleManualRetry","useEffect","prev","Card","jsxs","CardContent","jsx","AlertCircle","Button","RefreshCw","cn"],"mappings":"uIAOA,MAAMA,EAAyB,IACzBC,EAAwB,IAE9B,SAASC,EAAiBC,EAAyB,CAClD,MAAMC,EAAWJ,EAAyB,GAAKG,EAC/C,OAAO,KAAK,IAAIC,EAAUH,CAAqB,CAChD,CAOO,SAASI,EAAgB,CAAE,MAAAC,EAAO,QAAAC,GAAiC,CACzE,MAAMC,EAAkBC,EAAAA,OAAO,CAAC,EAC1B,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SACjDV,EAAiB,CAAC,EAAI,GAAA,EAEjB,CAACW,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAK,EAE5CG,EAAkBC,EAAAA,YAAY,IAAM,CACzCF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,SAAW,EAC3B,MAAMS,EAAef,EAAiBM,EAAgB,OAAO,EAC7DG,EAAqBM,EAAe,GAAI,EACxC,WAAW,IAAMH,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAENW,EAAoBF,EAAAA,YAAY,IAAM,CAC3CF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,QAAU,EAC1BG,EAAqBT,EAAiB,CAAC,EAAI,GAAI,EAC/C,WAAW,IAAMY,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAEZY,OAAAA,EAAAA,UAAU,IAAM,CACf,MAAMf,EAAW,YAAY,IAAM,CAClCO,EAAsBS,GACjBA,GAAQ,GACXL,EAAA,EACOK,GAEDA,EAAO,CACd,CACF,EAAG,GAAI,EAEP,MAAO,IAAM,cAAchB,CAAQ,CACpC,EAAG,CAACW,CAAe,CAAC,QAGlBM,EAAA,CAAK,UAAU,mBACf,SAAAC,EAAAA,KAACC,EAAA,CAAY,UAAU,oDACtB,SAAA,CAAAC,EAAAA,IAAC,OAAI,UAAU,qCACd,eAACC,EAAA,CAAY,UAAU,0BAA0B,CAAA,CAClD,EAEAH,EAAAA,KAAC,MAAA,CAAI,UAAU,YACd,SAAA,CAAAE,EAAAA,IAAC,KAAA,CAAG,UAAU,wBAAyB,SAAAlB,EAAM,QAAQ,EACpDA,EAAM,SACNkB,EAAAA,IAAC,KAAE,UAAU,gCAAiC,WAAM,OAAA,CAAQ,CAAA,EAE9D,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,mCACd,SAAA,CAAAA,EAAAA,KAACI,EAAA,CACA,QAASR,EACT,SAAUL,EACV,QAAQ,UACR,UAAU,QAEV,SAAA,CAAAW,MAACG,GAAU,UAAWC,EAAG,SAAUf,GAAc,cAAc,EAAG,EACjEA,EAAa,cAAgB,OAAA,CAAA,CAAA,EAG/BS,EAAAA,KAAC,IAAA,CAAE,UAAU,gCAAgC,SAAA,CAAA,eAC/BZ,EAAkB,GAAA,CAAA,CAChC,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF"}
1
+ {"version":3,"file":"route-error-state-BFBpiIhD.js","sources":["../../src/components/ui/route-error-state.tsx"],"sourcesContent":["import { AlertCircle, RefreshCw } from \"lucide-react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ServerError } from \"@/api/error-utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { cn } from \"@/utils\";\n\nconst BASE_RETRY_INTERVAL_MS = 5000;\nconst MAX_RETRY_INTERVAL_MS = 30000;\n\nfunction getRetryInterval(attempt: number): number {\n\tconst interval = BASE_RETRY_INTERVAL_MS * 2 ** attempt;\n\treturn Math.min(interval, MAX_RETRY_INTERVAL_MS);\n}\n\ntype RouteErrorStateProps = {\n\terror: ServerError;\n\tonRetry: () => void;\n};\n\nexport function RouteErrorState({ error, onRetry }: RouteErrorStateProps) {\n\tconst retryAttemptRef = useRef(0);\n\tconst [secondsUntilRetry, setSecondsUntilRetry] = useState(\n\t\tgetRetryInterval(0) / 1000,\n\t);\n\tconst [isRetrying, setIsRetrying] = useState(false);\n\n\tconst handleAutoRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current += 1;\n\t\tconst nextInterval = getRetryInterval(retryAttemptRef.current);\n\t\tsetSecondsUntilRetry(nextInterval / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tconst handleManualRetry = useCallback(() => {\n\t\tsetIsRetrying(true);\n\t\tonRetry();\n\t\tretryAttemptRef.current = 0;\n\t\tsetSecondsUntilRetry(getRetryInterval(0) / 1000);\n\t\tsetTimeout(() => setIsRetrying(false), 500);\n\t}, [onRetry]);\n\n\tuseEffect(() => {\n\t\tconst interval = setInterval(() => {\n\t\t\tsetSecondsUntilRetry((prev) => {\n\t\t\t\tif (prev <= 1) {\n\t\t\t\t\thandleAutoRetry();\n\t\t\t\t\treturn prev;\n\t\t\t\t}\n\t\t\t\treturn prev - 1;\n\t\t\t});\n\t\t}, 1000);\n\n\t\treturn () => clearInterval(interval);\n\t}, [handleAutoRetry]);\n\n\treturn (\n\t\t<Card className=\"mx-auto max-w-md\">\n\t\t\t<CardContent className=\"flex flex-col items-center gap-4 pt-6 text-center\">\n\t\t\t\t<div className=\"rounded-full bg-destructive/10 p-3\">\n\t\t\t\t\t<AlertCircle className=\"size-8 text-destructive\" />\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t<h2 className=\"text-lg font-semibold\">{error.message}</h2>\n\t\t\t\t\t{error.details && (\n\t\t\t\t\t\t<p className=\"text-sm text-muted-foreground\">{error.details}</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex flex-col items-center gap-2\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={handleManualRetry}\n\t\t\t\t\t\tdisabled={isRetrying}\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tclassName=\"gap-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<RefreshCw className={cn(\"size-4\", isRetrying && \"animate-spin\")} />\n\t\t\t\t\t\t{isRetrying ? \"Retrying...\" : \"Retry\"}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<p className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\tRetrying in {secondsUntilRetry}s\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n"],"names":["BASE_RETRY_INTERVAL_MS","MAX_RETRY_INTERVAL_MS","getRetryInterval","attempt","interval","RouteErrorState","error","onRetry","retryAttemptRef","useRef","secondsUntilRetry","setSecondsUntilRetry","useState","isRetrying","setIsRetrying","handleAutoRetry","useCallback","nextInterval","handleManualRetry","useEffect","prev","Card","jsxs","CardContent","jsx","AlertCircle","Button","RefreshCw","cn"],"mappings":"uIAOA,MAAMA,EAAyB,IACzBC,EAAwB,IAE9B,SAASC,EAAiBC,EAAyB,CAClD,MAAMC,EAAWJ,EAAyB,GAAKG,EAC/C,OAAO,KAAK,IAAIC,EAAUH,CAAqB,CAChD,CAOO,SAASI,EAAgB,CAAE,MAAAC,EAAO,QAAAC,GAAiC,CACzE,MAAMC,EAAkBC,EAAAA,OAAO,CAAC,EAC1B,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SACjDV,EAAiB,CAAC,EAAI,GAAA,EAEjB,CAACW,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAK,EAE5CG,EAAkBC,EAAAA,YAAY,IAAM,CACzCF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,SAAW,EAC3B,MAAMS,EAAef,EAAiBM,EAAgB,OAAO,EAC7DG,EAAqBM,EAAe,GAAI,EACxC,WAAW,IAAMH,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAENW,EAAoBF,EAAAA,YAAY,IAAM,CAC3CF,EAAc,EAAI,EAClBP,EAAA,EACAC,EAAgB,QAAU,EAC1BG,EAAqBT,EAAiB,CAAC,EAAI,GAAI,EAC/C,WAAW,IAAMY,EAAc,EAAK,EAAG,GAAG,CAC3C,EAAG,CAACP,CAAO,CAAC,EAEZY,OAAAA,EAAAA,UAAU,IAAM,CACf,MAAMf,EAAW,YAAY,IAAM,CAClCO,EAAsBS,GACjBA,GAAQ,GACXL,EAAA,EACOK,GAEDA,EAAO,CACd,CACF,EAAG,GAAI,EAEP,MAAO,IAAM,cAAchB,CAAQ,CACpC,EAAG,CAACW,CAAe,CAAC,QAGlBM,EAAA,CAAK,UAAU,mBACf,SAAAC,EAAAA,KAACC,EAAA,CAAY,UAAU,oDACtB,SAAA,CAAAC,EAAAA,IAAC,OAAI,UAAU,qCACd,eAACC,EAAA,CAAY,UAAU,0BAA0B,CAAA,CAClD,EAEAH,EAAAA,KAAC,MAAA,CAAI,UAAU,YACd,SAAA,CAAAE,EAAAA,IAAC,KAAA,CAAG,UAAU,wBAAyB,SAAAlB,EAAM,QAAQ,EACpDA,EAAM,SACNkB,EAAAA,IAAC,KAAE,UAAU,gCAAiC,WAAM,OAAA,CAAQ,CAAA,EAE9D,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,mCACd,SAAA,CAAAA,EAAAA,KAACI,EAAA,CACA,QAASR,EACT,SAAUL,EACV,QAAQ,UACR,UAAU,QAEV,SAAA,CAAAW,MAACG,GAAU,UAAWC,EAAG,SAAUf,GAAc,cAAc,EAAG,EACjEA,EAAa,cAAgB,OAAA,CAAA,CAAA,EAG/BS,EAAAA,KAAC,IAAA,CAAE,UAAU,gCAAgC,SAAA,CAAA,eAC/BZ,EAAkB,GAAA,CAAA,CAChC,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAEF"}
@@ -1,2 +1,2 @@
1
- import{r as f,j as r,s as J}from"./vendor-tanstack-BcZfOOfy.js";import{u as Pe}from"./use-debounce-callback-CSs1BjLI.js";import{bH as Z,C as ee,q as L,I as ne,ac as te,ad as re,ae as se,af as oe,ah as ie,ag as ae,aj as z,bp as De,ai as X,df as Fe,dj as Ee,b5 as Q,G as Ae,p as W,L as ce,a6 as Ve,cR as Me,cS as Te,aW as $e,at as Be,cT as Ke,cU as Le,i as Ue}from"./index-m48E4KcG.js";import{D as Je,a as ze,b as Re,d as C,e as We}from"./dropdown-menu-0atiOSFo.js";import{m as U,c as D,i as fe,p as Ge,g as qe,d as Qe,C as He,e as Ye,f as me,D as Xe,h as Ze,S as en,v as nn,s as tn,K as rn,P as sn,j as on,B as an,k as cn,l as ln}from"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import{H as un,a4 as dn,e as fn,f as he}from"./vendor-date-wwuDAncJ.js";import{T as mn,a as hn}from"./toggle-group-Cn07UIim.js";import{B as xn}from"./block-type-logo-Cbpfxded.js";import{T as jn}from"./textarea-B3_TtPRi.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./zod-Cuos7J7w.js";import"./timezone-select-BuPYznge.js";import"./form-DLrbC7rV.js";const pn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bn=Z("eye-off",pn);const gn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],yn=Z("eye",gn);const Sn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_n=Z("grip-vertical",Sn);function k(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!un(e)}function O(e){return Array.isArray(e)}function vn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function V(e){return"$ref"in e}function ge(e){return"anyOf"in e&&k(e.anyOf)}function wn(e){return"oneOf"in e&&k(e.oneOf)}function kn(e){return"allOf"in e&&k(e.allOf)}function In(e){return"items"in e&&k(e.items)}function Nn(e){return"definitions"in e&&N(e.definitions)}function M(e,n){if(Nn(e)){const t=n.replace("#/definitions/",""),s=e.definitions?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),s=e.$defs?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}throw new Error("Schema does not contain definitions")}function ye(e,n){if(V(e)&&typeof e.$ref=="string"){const{$ref:t,...s}=e;return U({},M(n,t),s)}return e}function Cn({property:e,value:n,onValueChange:t,errors:s,id:o}){const{schema:i}=D(),c=f.useMemo(()=>{const{allOf:a,...d}=e,u=a.reduce((h,p)=>{if(V(p)){const l=M(i,p.$ref);return U({},h,l)}return U({},h,p)},{});return U({},u,d)},[e,i]);return r.jsx(ue,{value:n,onValueChange:t,errors:s,property:c,id:o})}function On({value:e,property:n,schema:t}){const s=k(e)?e:n.default;if(!k(s))return 0;const o=Pn(n,t);switch(typeof s){case"string":return o.findIndex(i=>i.type==="string");case"number":return o.findIndex(i=>i.type==="number"||i.type==="integer");case"boolean":return o.findIndex(i=>i.type==="boolean");case"object":return Dn(s,o);default:return-1}}function Pn(e,n){return e.anyOf?e.anyOf.map(t=>V(t)?M(n,t.$ref):t):[]}function Dn(e,n){return N(e)?Fn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Fn(e,n){if(vn(e))return n.findIndex(i=>i.type==="object");const t=Object.keys(e),[s,o]=n.reduce(([i,c],a,d)=>{if(!("properties"in a)||!a.properties)return[i,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[d,h]:[i,c]},[0,0]);return o===0?-1:s}const En={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function An(e){if(e.type&&typeof e.type=="string")return En[e.type]}function le(e,n){if(V(e)){const s=M(n,e.$ref);return le(s,n)}const t=An(e)??"Field";return e.title??e.format??t}function H({value:e,property:n,onValueChange:t,errors:s}){const{schema:o}=D(),[i,c]=f.useState(On({value:e,property:n,schema:o})),a=f.useRef(new Map);function d(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(i,e),c(h),t(a.current.get(h))}return r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(mn,{size:"sm",variant:"outline",type:"single",value:i.toString(),onValueChange:d,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=le(u,o);return r.jsx(hn,{value:h.toString(),children:p},p)})}),r.jsx(ee,{className:"p-2",children:r.jsx(Ce,{value:e,property:n.anyOf[i],onValueChange:t,errors:s,showLabel:!1,nested:!1,required:!1})})]})}const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function Vn(e,n=0){return(g[e[n+0]]+g[e[n+1]]+g[e[n+2]]+g[e[n+3]]+"-"+g[e[n+4]]+g[e[n+5]]+"-"+g[e[n+6]]+g[e[n+7]]+"-"+g[e[n+8]]+g[e[n+9]]+"-"+g[e[n+10]]+g[e[n+11]]+g[e[n+12]]+g[e[n+13]]+g[e[n+14]]+g[e[n+15]]).toLowerCase()}let Y;const Mn=new Uint8Array(16);function Tn(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(Mn)}const $n=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xe={randomUUID:$n};function Bn(e,n,t){e=e||{};const s=e.random??e.rng?.()??Tn();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Vn(s)}function je(e,n,t){return xe.randomUUID&&!e?xe.randomUUID():Bn(e)}function Kn(e){return typeof e=="string"}function Se(e){return N(e)&&"property"in e}function _e(e){return N(e)&&"index"in e}function ve({errors:e}){const n=f.useMemo(()=>e.filter(t=>Kn(t)),[e]);return n.length===0?null:n.length===1?r.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):r.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>r.jsx("li",{children:t},t))})}function we(e){return K(e)?e.__prefect_kind:null}function K(e,n){return N(e)&&fe(e.__prefect_kind)?fe(n)?e.__prefect_kind===n:!0:!1}function Ln({value:e,property:n,schema:t,to:s}){const o=we(e);try{switch(o){case"json":return Un({json:e,property:n,schema:t,to:s});case"jinja":return Jn({jinja:e,property:n,schema:t,to:s});case"workspace_variable":return zn({workspaceVariable:e,to:s});case null:return Rn({value:e,property:n,schema:t,to:s});default:throw new Error(`Unknown prefect kind value: ${o}`)}}catch(i){console.error(i);return}}function Un({json:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e.value};case"json":return e;case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.value===void 0)return;try{const o=JSON.parse(e.value);return G({value:o,property:n,schema:t})}catch{throw new ke("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function Jn({jinja:e,property:n,schema:t,to:s}){switch(s){case"jinja":return e;case"json":return{__prefect_kind:"json",value:e.template};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.template===void 0)return;try{const o=JSON.parse(e.template);return G({value:o,property:n,schema:t})}catch{throw new ke("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function zn({workspaceVariable:e,to:n}){switch(n){case"workspace_variable":return e;case"jinja":return{__prefect_kind:"jinja",template:void 0};case"json":return{__prefect_kind:"json",value:void 0};case null:return;default:throw new Error(`mapSchemaValueWorkspaceVariable missing case for kind: ${n}`)}}function Rn({value:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e===void 0?void 0:JSON.stringify(e,null,2)};case"json":return{__prefect_kind:"json",value:e===void 0?void 0:JSON.stringify(e,null,2)};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:return G({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${s}`)}}function G({value:e,property:n,schema:t}){return O(n)?n.map(o=>R({value:e,property:o,schema:t})).find(o=>o!==void 0):R({value:e,property:n,schema:t})}function R({value:e,property:n,schema:t}){const s=ye(n,t);if(ge(s))return G({value:e,property:s.anyOf,schema:t});switch(s.type){case"null":return null;case"string":return typeof e=="string"?e:void 0;case"boolean":return typeof e=="boolean"?e:void 0;case"number":return typeof e=="number"?e:void 0;case"integer":return typeof e=="number"?Math.round(e):void 0;case"array":return Wn({value:e,property:s,schema:t});case"object":return Gn({value:e,property:s,schema:t});default:if(O(s.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${s.type}`)}}function Wn({value:e,property:n,schema:t}){return O(e)?[...e].map(o=>R({value:o,property:n,schema:t})):void 0}function Gn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const s={...e};for(const[o,i]of Object.entries(n.properties))R({value:e[o],property:i,schema:t})===void 0&&delete s[o];return s}class ke extends Error{constructor(n,t){super(`Unable to convert prefect kind value from "${n}" to "${t??"null"}"`)}}const Ie=({value:e,onValueChange:n,property:t,children:s,disableKinds:o,defaultValue:i,hasDefaultValue:c})=>{const{schema:a,kinds:d}=D(),[u,h]=f.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(i);function l(){c&&n(i)}function x(v){const S=Ln({value:e,property:t,schema:a,to:v});n(S)}const y=f.useMemo(()=>{const v=we(e);return Ge.filter(S=>S!==v&&(d.includes(S)||S===null)&&!o)},[e,d,o]);return r.jsxs(Je,{open:u,onOpenChange:h,children:[r.jsx(ze,{asChild:!0,children:r.jsxs(L,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[r.jsx("span",{className:"sr-only",children:"Open menu"}),r.jsx(ne,{id:"MoreVertical",className:"size-4"})]})}),r.jsxs(Re,{align:"end",children:[y.map(v=>r.jsx(C,{onClick:()=>x(v),children:qe(v)},v)),c&&r.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),r.jsx(We,{}),s]})]})};function qn({itemKey:e,items:n,value:t,onValueChange:s,errors:o,onDelete:i,first:c,last:a,canMove:d,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=D(),y=f.useId(),{attributes:v,listeners:S,setNodeRef:I,transform:F,transition:E,isDragging:$}=Qe({id:e,disabled:!d}),B={transform:He.Transform.toString(F),transition:E,opacity:$?.5:1},w=f.useMemo(()=>O(n)?{anyOf:n}:V(n)?M(x,n.$ref):n,[n,x]);return r.jsxs("div",{ref:I,style:B,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[d?r.jsx("button",{type:"button",className:"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none","aria-label":"Drag to reorder",...v,...S,children:r.jsx(_n,{className:"h-5 w-5"})}):r.jsx("div",{className:"w-5"}),r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(ue,{value:t,onValueChange:s,property:w,errors:o,id:y}),r.jsx(ve,{errors:o})]}),r.jsxs(Ie,{value:t,onValueChange:s,property:n,children:[r.jsx(C,{onClick:i,children:"Delete"}),d&&!c&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:p,children:"Move to top"}),r.jsx(C,{onClick:u,children:"Move up"})]}),d&&!a&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:h,children:"Move down"}),r.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function Qn({property:e,values:n,onValuesChange:t,errors:s}){const o=n===void 0||n.length===0,i=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=Ye(me(sn),me(rn,{coordinateGetter:tn})),[d,u]=f.useState(n?.map(m=>({key:je(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return s.filter(b=>_e(b)&&b.index===m).flatMap(b=>b.errors)}function l(m){return m===0}function x(m){return m===(n?.length??0)-1}function y(m){return!(O(e.prefixItems)&&m<e.prefixItems.length)}function v(m,b){u(d.map(j=>j.key===m?{...j,value:b}:j))}function S(){const m=[...d,{key:je(),value:void 0}];u(m),t(m.map(({value:b})=>b))}function I(m,b){const j=[...d];j.splice(b,0,j.splice(m,1)[0]),u(j),t(j.map(({value:A})=>A))}function F(m){I(m,0)}function E(m){I(m,d.length-1)}function $(m){const b=d.filter(j=>j.key!==m);u(b),t(b.map(({value:j})=>j))}function B(m){const{active:b,over:j}=m;if(j&&b.id!==j.id){const A=d.findIndex(q=>q.key===b.id),de=d.findIndex(q=>q.key===j.id);A!==-1&&de!==-1&&I(A,de)}}const w=d.slice(c).map(m=>m.key);return r.jsxs(ee,{className:"flex flex-col gap-2 p-2",children:[o&&r.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),r.jsx(Xe,{sensors:a,collisionDetection:Ze,onDragEnd:B,children:r.jsx(en,{items:w,strategy:nn,children:d?.map(({key:m,value:b},j)=>r.jsx(qn,{itemKey:m,items:h(j),value:b,onValueChange:A=>v(m,A),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>I(j,j-1),moveDown:()=>I(j,j+1),moveToTop:()=>F(j),moveToBottom:()=>E(j)},m))})}),i&&r.jsx("div",{className:"flex justify-end",children:r.jsx(L,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!i&&r.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[s,o]=f.useState(""),i=f.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(s.toLowerCase()))),[e.enum,s]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function d(l){const x=i[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){o("");const x=i[l];return t.multiple?p(x):h(x)}function h(l){if(t.multiple)throw new Error("onSingleSelect called on multiple value input");t.onValueChange(l)}function p(l){if(!t.multiple)throw new Error("onMultipleSelect called on single value input");if(!t.values){t.onValuesChange([l]);return}if(t.values?.includes(l)){t.onValuesChange(t.values.filter(x=>x!==l));return}t.onValuesChange([...t.values,l])}return r.jsxs(te,{children:[r.jsx(re,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),r.jsxs(se,{children:[r.jsx(oe,{value:s,onValueChange:o,placeholder:"Search..."}),r.jsx(ie,{children:"No values found"}),r.jsx(ae,{children:Object.entries(i).map(([l,x])=>r.jsx(z,{value:l,onSelect:u,selected:d(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>on(typeof n))}function _(e,n){if(typeof e==typeof n())return e}function Hn(e){if(N(e))return e}function Yn(e){return _(e,String)??_(e,Number)??_(e,Boolean)}function Ne(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>_(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>_(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>_(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>_(t,String)??_(t,Number)??_(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function Xn({values:e,property:n,onValuesChange:t,errors:s,id:o}){const{schema:i}=D();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(In(n)&&N(n.items)){let a=n.items;if(V(a)&&(a=M(i,a.$ref)),P(a)){const d={...n,...a};return r.jsx(T,{multiple:!0,values:Ne(e,"primitive"),property:d,onValuesChange:c,id:o})}}return r.jsx(Qn,{property:n,values:e,onValuesChange:c,errors:s})}const Zn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>r.jsx(f.Suspense,{children:r.jsx(et,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})}),et=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>{const[o,i]=f.useState(""),c=f.useDeferredValue(o),{data:a}=J(De({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_types:{slug:{any_:[e]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1},...c?{name:{like_:c}}:{}},limit:50})),d=f.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=f.useMemo(()=>a.find(h=>h.id===n),[a,n]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),r.jsxs(se,{children:[r.jsx(oe,{value:o,onValueChange:i,placeholder:"Search for a block..."}),r.jsx(ie,{children:"No block found"}),r.jsxs(ae,{children:[r.jsx(X,{children:d.map(h=>r.jsx(z,{selected:n===h.id,onSelect:p=>{t(p),i("")},value:h.id,children:h.name},h.id))}),s&&r.jsx(X,{children:r.jsxs(z,{onSelect:()=>{s(),i("")},value:"__create_new__",closeOnSelect:!0,children:[r.jsx(ne,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function nt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){return r.jsx(f.Suspense,{fallback:r.jsx(tt,{}),children:r.jsx(rt,{value:e,onValueChange:n,blockTypeSlug:t,id:s})})}function tt(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{className:"size-8 rounded"}),r.jsx(Q,{className:"h-9 flex-1"}),r.jsx(Q,{className:"h-9 w-20"})]})}function rt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){const[o,i]=f.useState(!1),{data:c}=J(Fe(t)),{data:a}=J(Ee({block_types:{slug:{any_:[t]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1}},include_secrets:!1,sort:"BLOCK_TYPE_AND_NAME_ASC",offset:0})),d=a>0,u=e?.$ref,h=l=>{n(l?{$ref:l}:void 0)},p=l=>{n({$ref:l})};return r.jsxs("div",{id:s,className:"flex items-center gap-2",children:[r.jsx(xn,{logoUrl:c.logo_url,alt:c.name}),d&&r.jsx("div",{className:"flex-1",children:r.jsx(Zn,{blockTypeSlug:t,selectedBlockDocumentId:u,onSelect:h,onCreateNew:()=>i(!0)})}),r.jsxs(L,{type:"button",variant:"outline",onClick:()=>i(!0),children:["Add",r.jsx(ne,{id:"Plus",className:"ml-2 size-4"})]}),r.jsx(an,{open:o,onOpenChange:i,blockTypeSlug:t,onCreated:p})]})}function st({value:e,onValueChange:n,property:t,id:s}){function o(i){n(_(i,Boolean))}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s}):r.jsx(Ae,{checked:e,onCheckedChange:o,id:s})}function ot({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:i=>o(i.target.value),id:s})}function it(){return r.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function at({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:i=>o(i.target.value),id:s})}function ct({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"jinja",template:o||void 0})};return r.jsx(ce,{value:e.template,onChange:s,id:t})}function lt({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"json",value:o||void 0})};return r.jsx(ce,{value:e.value,onChange:s,id:t})}const ut=({selectedVariableName:e,onSelect:n})=>r.jsx(f.Suspense,{children:r.jsx(dt,{selectedVariableName:e,onSelect:n})}),dt=({selectedVariableName:e,onSelect:n})=>{const[t,s]=f.useState(""),o=f.useDeferredValue(t),{data:i}=J(Ve({offset:0,sort:"NAME_ASC",variables:o?{operator:"and_",name:{like_:o}}:void 0,limit:50})),c=f.useMemo(()=>i.filter(a=>a.name.toLowerCase().includes(o.toLowerCase())),[i,o]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),r.jsxs(se,{children:[r.jsx(oe,{value:t,onValueChange:s,placeholder:"Search for a variable..."}),r.jsx(ie,{children:"No variable found"}),r.jsx(ae,{children:r.jsx(X,{children:c.map(a=>r.jsx(z,{selected:e===a.name,onSelect:d=>{n(d),s("")},value:a.name,children:a.name},a.id))})})]})]})};function ft({value:e,onValueChange:n,id:t}){const s=o=>{n({__prefect_kind:"workspace_variable",variable_name:o})};return r.jsx("div",{id:t,children:r.jsx(ut,{selectedVariableName:e.variable_name,onSelect:s})})}const pe="yyyy-MM-dd";function mt({value:e,onValueChange:n,id:t}){const s=e?dn(e,pe,fn()):void 0,[o,i]=f.useState(s);function c(a){i(a),n(a?he(a,pe):void 0)}return r.jsxs(Me,{children:[r.jsx(Te,{asChild:!0,children:r.jsxs(L,{variant:"outline",className:$e("justify-start text-left font-normal w-full",!o&&"text-muted-foreground"),id:t,children:[r.jsx(Be,{className:"mr-2 h-4 w-4"}),o?he(o,"PPP"):r.jsx("span",{children:"Pick a date"})]})}),r.jsx(Ke,{className:"w-auto p-0",children:r.jsx(Le,{mode:"single",selected:o,onSelect:c,required:!0,autoFocus:!0})})]})}function ht({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n(o||void 0)};return r.jsx(ce,{value:e,onChange:s,id:t})}function xt({value:e,onValueChange:n,id:t}){const[s,o]=f.useState(!1),i=c=>{n(c.target.value||void 0)};return r.jsxs("div",{className:"relative",children:[r.jsx(W,{id:t,type:s?"text":"password",value:e??"",onChange:i,autoComplete:"off",className:"pr-10"}),r.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>o(!s),"aria-label":s?"Hide password":"Show password",children:s?r.jsx(bn,{className:"h-4 w-4"}):r.jsx(yn,{className:"h-4 w-4"})})]})}function jt({value:e,onValueChange:n,id:t}){function s(o){const i=o.target.value;if(i===""){n(void 0);return}const c=Number(i);Number.isNaN(c)||n(String(c))}return r.jsx(W,{type:"number",value:e??"",onChange:s,id:t,placeholder:"Duration in seconds",min:0})}function pt({value:e,onValueChange:n,property:t,id:s}){function o(i){n(i||void 0)}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:o,id:s}):t.format==="date"?r.jsx(mt,{value:e,onValueChange:o,id:s}):t.format==="date-time"?r.jsx(cn,{value:e,onValueChange:o,id:s}):t.format==="json-string"?r.jsx(ht,{value:e,onValueChange:o,id:s}):t.format==="time-delta"?r.jsx(jt,{value:e,onValueChange:o,id:s}):t.format==="password"?r.jsx(xt,{value:e,onValueChange:o,id:s}):r.jsx(jn,{value:e??"",rows:1,className:"min-h-min",onChange:i=>o(i.target.value),id:s})}function bt({value:e,onValueChange:n,property:t,id:s}){return f.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?r.jsx(T,{multiple:!1,value:Yn(e),property:t,onValueChange:n,id:s}):null}function ue({value:e,onValueChange:n,errors:t,property:s,id:o,nested:i=!0}){if(K(e)){if(K(e,"json"))return r.jsx(lt,{value:e,onValueChange:n,id:o});if(K(e,"jinja"))return r.jsx(ct,{value:e,onValueChange:n,id:o});if(K(e,"workspace_variable"))return r.jsx(ft,{value:e,onValueChange:n,id:o});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("block_type_slug"in s){const c=s.block_type_slug;if(typeof c=="string")return r.jsx(nt,{value:e,onValueChange:n,blockTypeSlug:c,id:o})}if(ge(s))return r.jsx(H,{value:e,property:s,onValueChange:n,errors:t});if(wn(s)){const c={...s,anyOf:s.oneOf};return r.jsx(H,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(s.type)){const c={...s,anyOf:Object.values(s.type).map(a=>({type:a}))};return r.jsx(H,{value:e,property:c,onValueChange:n,errors:t})}if(kn(s))return r.jsx(Cn,{value:e,onValueChange:n,errors:t,property:s,id:o});if(s.type==="string")return r.jsx(pt,{value:_(e,String),onValueChange:n,property:s,id:o});if(s.type==="integer")return r.jsx(ot,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="number")return r.jsx(at,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="boolean")return r.jsx(st,{value:_(e,Boolean),onValueChange:n,property:s,id:o});if(s.type==="object")return r.jsx(Oe,{values:Hn(e),property:s,onValuesChange:n,errors:t,nested:i});if(s.type==="array")return r.jsx(Xn,{values:Ne(e),property:s,onValuesChange:n,errors:t,id:o});if(s.type==="null")return r.jsx(it,{});if(s.type===void 0)return r.jsx(bt,{value:e,onValueChange:n,property:s,id:o});throw new Error(`Schema type not implemented: ${String(s.type)}`)}function be({property:e}){const n=f.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&r.jsx("p",{className:"text-sm text-gray-500",children:n})}function gt({property:e,required:n,id:t}){const{schema:s}=D(),o=f.useMemo(()=>{const i=le(e,s);return n?i:`${i} (Optional)`},[e,n,s]);return r.jsx(Ue,{htmlFor:t,children:o})}function Ce({property:e,value:n,onValueChange:t,required:s,errors:o,showLabel:i=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:d}=D(),u=f.useMemo(()=>ye(e,a),[e,a]),h=f.useMemo(()=>!k(u.type),[u.type]),p=f.useMemo(()=>o.filter(w=>Se(w)||_e(w)),[o]),[l,x]=f.useState(!1),[y,v]=f.useState(B),[S,I]=f.useState(!1),F=f.useId(),E=f.useCallback(w=>{v(w),t(w)},[t]),$=f.useCallback(()=>{const w=!S;I(w),t(w?void 0:y)},[S,t,y]);f.useEffect(()=>{l||d||(k(u.default)&&!k(n)&&t(u.default),x(!0))},[l,d,t,u.default,n]);function B(){if(k(n))return n;if(k(u.default)&&!d)return u.default}return r.jsxs("div",{className:"flex flex-col gap-2 group",children:[i&&r.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(gt,{property:u,required:s,id:F}),r.jsx(be,{property:u})]}),r.jsx("div",{className:"ml-auto",children:r.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:k(u.default),children:r.jsx(C,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!i&&r.jsx(be,{property:u}),r.jsx("fieldset",{disabled:S,children:r.jsx(ue,{property:u,value:y,onValueChange:E,errors:p,id:F,nested:c})}),r.jsx(ve,{errors:o})]})}function yt(e,n){return(e.position??0)-(n.position??0)}function Oe({values:e,onValuesChange:n,property:t,errors:s,nested:o}){const i=f.useRef([]),c=Pe(f.useCallback(()=>{const l={...e};for(const{key:x,value:y}of i.current)l[x]=y,y===void 0&&delete l[x];if(i.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){i.current.push({key:l,value:x}),c()}function d(l){return e?.[l]}function u(l){return s.filter(Se).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=f.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>yt(l,x)),[t.properties]),p=r.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>r.jsx(Ce,{value:d(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return o?r.jsx(ee,{className:"p-2",children:p}):p}const St=({children:e,...n})=>r.jsx(ln.Provider,{value:n,children:e}),$t=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:s,onValuesChange:o,errors:i})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=f.useCallback(u=>{if(u===void 0){o({});return}o(u)},[o]),d={values:s,property:e,onValuesChange:a,errors:i};return r.jsx("div",{className:"flex flex-col gap-4",children:r.jsx(St,{...c,children:r.jsx(Oe,{...d,nested:!1})})})};export{$t as SchemaForm};
2
- //# sourceMappingURL=schema-form-CWDHSME9.js.map
1
+ import{r as f,j as r,s as J}from"./vendor-tanstack-BcZfOOfy.js";import{u as Pe}from"./use-debounce-callback-CSs1BjLI.js";import{bL as Z,C as ee,q as L,I as ne,ag as te,ah as re,ai as se,aj as oe,al as ie,ak as ae,an as z,bt as De,am as X,di as Fe,dm as Ee,b9 as Q,G as Ve,p as W,L as ce,aa as Ae,cU as Me,cV as Te,a_ as $e,ax as Be,cW as Ke,cX as Le,i as Ue}from"./index-B8vo2Lrg.js";import{D as Je,a as ze,b as Re,d as C,e as We}from"./dropdown-menu-D7Gwbd15.js";import{m as U,c as D,i as fe,p as Ge,g as qe,d as Qe,C as Ye,e as He,f as me,D as Xe,h as Ze,S as en,v as nn,s as tn,K as rn,P as sn,j as on,B as an,k as cn,l as ln}from"./schema-form-input-string-format-datetime-nrb3g-JJ.js";import{H as un,a4 as dn,e as fn,f as he}from"./vendor-date-wwuDAncJ.js";import{T as mn,a as hn}from"./toggle-group-7WUJn2Tx.js";import{B as xn}from"./block-type-logo-CyAWq7mC.js";import{T as jn}from"./textarea-DUhh6-kq.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BvvJP9Po.js";import"./vendor-forms-ClCIacbh.js";import"./zod-Cuos7J7w.js";import"./timezone-select-D4Q6VBtD.js";import"./form-mws4law8.js";const pn=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],bn=Z("eye-off",pn);const gn=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],yn=Z("eye",gn);const Sn=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_n=Z("grip-vertical",Sn);function k(e){return e!==void 0}function N(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&!un(e)}function O(e){return Array.isArray(e)}function vn(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null&&Object.keys(e).length===0}function A(e){return"$ref"in e}function ge(e){return"anyOf"in e&&k(e.anyOf)}function wn(e){return"oneOf"in e&&k(e.oneOf)}function kn(e){return"allOf"in e&&k(e.allOf)}function In(e){return"items"in e&&k(e.items)}function Nn(e){return"definitions"in e&&N(e.definitions)}function M(e,n){if(Nn(e)){const t=n.replace("#/definitions/",""),s=e.definitions?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}if("$defs"in e&&N(e.$defs)){const t=n.replace("#/$defs/",""),s=e.$defs?.[t];if(!s)throw new Error(`Definition not found for ${n}`);return s}throw new Error("Schema does not contain definitions")}function ye(e,n){if(A(e)&&typeof e.$ref=="string"){const{$ref:t,...s}=e;return U({},M(n,t),s)}return e}function Cn({property:e,value:n,onValueChange:t,errors:s,id:o}){const{schema:i}=D(),c=f.useMemo(()=>{const{allOf:a,...d}=e,u=a.reduce((h,p)=>{if(A(p)){const l=M(i,p.$ref);return U({},h,l)}return U({},h,p)},{});return U({},u,d)},[e,i]);return r.jsx(ue,{value:n,onValueChange:t,errors:s,property:c,id:o})}function On({value:e,property:n,schema:t}){const s=k(e)?e:n.default;if(!k(s))return 0;const o=Pn(n,t);switch(typeof s){case"string":return o.findIndex(i=>i.type==="string");case"number":return o.findIndex(i=>i.type==="number"||i.type==="integer");case"boolean":return o.findIndex(i=>i.type==="boolean");case"object":return Dn(s,o);default:return-1}}function Pn(e,n){return e.anyOf?e.anyOf.map(t=>A(t)?M(n,t.$ref):t):[]}function Dn(e,n){return N(e)?Fn(e,n):O(e)?n.findIndex(t=>t.type==="array"):e===null?n.findIndex(t=>t.type==="null"):-1}function Fn(e,n){if(vn(e))return n.findIndex(i=>i.type==="object");const t=Object.keys(e),[s,o]=n.reduce(([i,c],a,d)=>{if(!("properties"in a)||!a.properties)return[i,c];const u=Object.keys(a.properties),h=t.filter(p=>u.includes(p)).length;return h>c?[d,h]:[i,c]},[0,0]);return o===0?-1:s}const En={null:"None",string:"str",boolean:"bool",integer:"int",number:"float",array:"list",object:"dict"};function Vn(e){if(e.type&&typeof e.type=="string")return En[e.type]}function le(e,n){if(A(e)){const s=M(n,e.$ref);return le(s,n)}const t=Vn(e)??"Field";return e.title??e.format??t}function Y({value:e,property:n,onValueChange:t,errors:s}){const{schema:o}=D(),[i,c]=f.useState(On({value:e,property:n,schema:o})),a=f.useRef(new Map);function d(u){const h=Number.parseInt(u,10);if(Number.isNaN(h))throw new Error(`Invalid index: ${u}`);a.current.set(i,e),c(h),t(a.current.get(h))}return r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(mn,{size:"sm",variant:"outline",type:"single",value:i.toString(),onValueChange:d,className:"justify-start",children:n.anyOf.map((u,h)=>{const p=le(u,o);return r.jsx(hn,{value:h.toString(),children:p},p)})}),r.jsx(ee,{className:"p-2",children:r.jsx(Ce,{value:e,property:n.anyOf[i],onValueChange:t,errors:s,showLabel:!1,nested:!1,required:!1})})]})}const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function An(e,n=0){return(g[e[n+0]]+g[e[n+1]]+g[e[n+2]]+g[e[n+3]]+"-"+g[e[n+4]]+g[e[n+5]]+"-"+g[e[n+6]]+g[e[n+7]]+"-"+g[e[n+8]]+g[e[n+9]]+"-"+g[e[n+10]]+g[e[n+11]]+g[e[n+12]]+g[e[n+13]]+g[e[n+14]]+g[e[n+15]]).toLowerCase()}let H;const Mn=new Uint8Array(16);function Tn(){if(!H){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(Mn)}const $n=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xe={randomUUID:$n};function Bn(e,n,t){e=e||{};const s=e.random??e.rng?.()??Tn();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,An(s)}function je(e,n,t){return xe.randomUUID&&!e?xe.randomUUID():Bn(e)}function Kn(e){return typeof e=="string"}function Se(e){return N(e)&&"property"in e}function _e(e){return N(e)&&"index"in e}function ve({errors:e}){const n=f.useMemo(()=>e.filter(t=>Kn(t)),[e]);return n.length===0?null:n.length===1?r.jsx("p",{className:"text-red-500 text-sm",children:n[0]}):r.jsx("ul",{className:"list-disc text-red-500 text-sm pl-4",children:n.map(t=>r.jsx("li",{children:t},t))})}function we(e){return K(e)?e.__prefect_kind:null}function K(e,n){return N(e)&&fe(e.__prefect_kind)?fe(n)?e.__prefect_kind===n:!0:!1}function Ln({value:e,property:n,schema:t,to:s}){const o=we(e);try{switch(o){case"json":return Un({json:e,property:n,schema:t,to:s});case"jinja":return Jn({jinja:e,property:n,schema:t,to:s});case"workspace_variable":return zn({workspaceVariable:e,to:s});case null:return Rn({value:e,property:n,schema:t,to:s});default:throw new Error(`Unknown prefect kind value: ${o}`)}}catch(i){console.error(i);return}}function Un({json:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e.value};case"json":return e;case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.value===void 0)return;try{const o=JSON.parse(e.value);return G({value:o,property:n,schema:t})}catch{throw new ke("json",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function Jn({jinja:e,property:n,schema:t,to:s}){switch(s){case"jinja":return e;case"json":return{__prefect_kind:"json",value:e.template};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:if(e.template===void 0)return;try{const o=JSON.parse(e.template);return G({value:o,property:n,schema:t})}catch{throw new ke("jinja",null)}default:throw new Error(`mapSchemaValueJson missing case for kind: ${s}`)}}function zn({workspaceVariable:e,to:n}){switch(n){case"workspace_variable":return e;case"jinja":return{__prefect_kind:"jinja",template:void 0};case"json":return{__prefect_kind:"json",value:void 0};case null:return;default:throw new Error(`mapSchemaValueWorkspaceVariable missing case for kind: ${n}`)}}function Rn({value:e,property:n,schema:t,to:s}){switch(s){case"jinja":return{__prefect_kind:"jinja",template:e===void 0?void 0:JSON.stringify(e,null,2)};case"json":return{__prefect_kind:"json",value:e===void 0?void 0:JSON.stringify(e,null,2)};case"workspace_variable":return{__prefect_kind:"workspace_variable",variable_name:void 0};case null:return G({value:e,property:n,schema:t});default:throw new Error(`mapSchemaValueNull missing case for kind: ${s}`)}}function G({value:e,property:n,schema:t}){return O(n)?n.map(o=>R({value:e,property:o,schema:t})).find(o=>o!==void 0):R({value:e,property:n,schema:t})}function R({value:e,property:n,schema:t}){const s=ye(n,t);if(ge(s))return G({value:e,property:s.anyOf,schema:t});switch(s.type){case"null":return null;case"string":return typeof e=="string"?e:void 0;case"boolean":return typeof e=="boolean"?e:void 0;case"number":return typeof e=="number"?e:void 0;case"integer":return typeof e=="number"?Math.round(e):void 0;case"array":return Wn({value:e,property:s,schema:t});case"object":return Gn({value:e,property:s,schema:t});default:if(O(s.type)){console.error(new Error("Array types are not supported for schema coercing values to schema properties"));return}throw new Error(`Unsupported property type: ${s.type}`)}}function Wn({value:e,property:n,schema:t}){return O(e)?[...e].map(o=>R({value:o,property:n,schema:t})):void 0}function Gn({value:e,property:n,schema:t}){if(!N(e))return;if(n.properties===void 0)return e;const s={...e};for(const[o,i]of Object.entries(n.properties))R({value:e[o],property:i,schema:t})===void 0&&delete s[o];return s}class ke extends Error{constructor(n,t){super(`Unable to convert prefect kind value from "${n}" to "${t??"null"}"`)}}const Ie=({value:e,onValueChange:n,property:t,children:s,disableKinds:o,defaultValue:i,hasDefaultValue:c})=>{const{schema:a,kinds:d}=D(),[u,h]=f.useState(!1),p=!c||JSON.stringify(e)===JSON.stringify(i);function l(){c&&n(i)}function x(v){const S=Ln({value:e,property:t,schema:a,to:v});n(S)}const y=f.useMemo(()=>{const v=we(e);return Ge.filter(S=>S!==v&&(d.includes(S)||S===null)&&!o)},[e,d,o]);return r.jsxs(Je,{open:u,onOpenChange:h,children:[r.jsx(ze,{asChild:!0,children:r.jsxs(L,{variant:"ghost","data-open":u,className:"h-8 w-8 p-0",children:[r.jsx("span",{className:"sr-only",children:"Open menu"}),r.jsx(ne,{id:"MoreVertical",className:"size-4"})]})}),r.jsxs(Re,{align:"end",children:[y.map(v=>r.jsx(C,{onClick:()=>x(v),children:qe(v)},v)),c&&r.jsx(C,{onClick:l,disabled:p,children:"Use default value"}),r.jsx(We,{}),s]})]})};function qn({itemKey:e,items:n,value:t,onValueChange:s,errors:o,onDelete:i,first:c,last:a,canMove:d,moveUp:u,moveDown:h,moveToTop:p,moveToBottom:l}){const{schema:x}=D(),y=f.useId(),{attributes:v,listeners:S,setNodeRef:I,transform:F,transition:E,isDragging:$}=Qe({id:e,disabled:!d}),B={transform:Ye.Transform.toString(F),transition:E,opacity:$?.5:1},w=f.useMemo(()=>O(n)?{anyOf:n}:A(n)?M(x,n.$ref):n,[n,x]);return r.jsxs("div",{ref:I,style:B,className:"grid grid-cols-[auto_1fr_auto] gap-2",children:[d?r.jsx("button",{type:"button",className:"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none","aria-label":"Drag to reorder",...v,...S,children:r.jsx(_n,{className:"h-5 w-5"})}):r.jsx("div",{className:"w-5"}),r.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[r.jsx(ue,{value:t,onValueChange:s,property:w,errors:o,id:y}),r.jsx(ve,{errors:o})]}),r.jsxs(Ie,{value:t,onValueChange:s,property:n,children:[r.jsx(C,{onClick:i,children:"Delete"}),d&&!c&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:p,children:"Move to top"}),r.jsx(C,{onClick:u,children:"Move up"})]}),d&&!a&&r.jsxs(r.Fragment,{children:[r.jsx(C,{onClick:h,children:"Move down"}),r.jsx(C,{onClick:l,children:"Move to bottom"})]})]})]})}function Qn({property:e,values:n,onValuesChange:t,errors:s}){const o=n===void 0||n.length===0,i=e.maxItems===void 0||(n?.length??0)<(e.maxItems??Number.POSITIVE_INFINITY),c=O(e.prefixItems)?e.prefixItems.length:0,a=He(me(sn),me(rn,{coordinateGetter:tn})),[d,u]=f.useState(n?.map(m=>({key:je(),value:m}))??[]);function h(m){return O(e.prefixItems)&&m<e.prefixItems.length?e.prefixItems[m]:e.items??{type:"string"}}function p(m){return s.filter(b=>_e(b)&&b.index===m).flatMap(b=>b.errors)}function l(m){return m===0}function x(m){return m===(n?.length??0)-1}function y(m){return!(O(e.prefixItems)&&m<e.prefixItems.length)}function v(m,b){u(d.map(j=>j.key===m?{...j,value:b}:j))}function S(){const m=[...d,{key:je(),value:void 0}];u(m),t(m.map(({value:b})=>b))}function I(m,b){const j=[...d];j.splice(b,0,j.splice(m,1)[0]),u(j),t(j.map(({value:V})=>V))}function F(m){I(m,0)}function E(m){I(m,d.length-1)}function $(m){const b=d.filter(j=>j.key!==m);u(b),t(b.map(({value:j})=>j))}function B(m){const{active:b,over:j}=m;if(j&&b.id!==j.id){const V=d.findIndex(q=>q.key===b.id),de=d.findIndex(q=>q.key===j.id);V!==-1&&de!==-1&&I(V,de)}}const w=d.slice(c).map(m=>m.key);return r.jsxs(ee,{className:"flex flex-col gap-2 p-2",children:[o&&r.jsx("p",{className:"text-sm text-subdued italic",children:"No items in this list"}),r.jsx(Xe,{sensors:a,collisionDetection:Ze,onDragEnd:B,children:r.jsx(en,{items:w,strategy:nn,children:d?.map(({key:m,value:b},j)=>r.jsx(qn,{itemKey:m,items:h(j),value:b,onValueChange:V=>v(m,V),errors:p(j),onDelete:()=>$(m),first:l(j),last:x(j),canMove:y(j),moveUp:()=>I(j,j-1),moveDown:()=>I(j,j+1),moveToTop:()=>F(j),moveToBottom:()=>E(j)},m))})}),i&&r.jsx("div",{className:"flex justify-end",children:r.jsx(L,{size:"sm",variant:"outline",onClick:S,children:"Add item"})}),!i&&r.jsx("p",{className:"text-sm text-subdued text-right",children:"You can't add more items"})]})}function T({property:e,id:n,...t}){const[s,o]=f.useState(""),i=f.useMemo(()=>Object.fromEntries(Object.entries(e.enum).filter(([,l])=>String(l).toLowerCase().includes(s.toLowerCase()))),[e.enum,s]),c=!!(t.multiple?t.values?.length:t.value),a=t.multiple?t.values?.join(", "):String(t.value);function d(l){const x=i[l];return t.multiple?t.values?.includes(x):t.value===x}function u(l){o("");const x=i[l];return t.multiple?p(x):h(x)}function h(l){if(t.multiple)throw new Error("onSingleSelect called on multiple value input");t.onValueChange(l)}function p(l){if(!t.multiple)throw new Error("onMultipleSelect called on single value input");if(!t.values){t.onValuesChange([l]);return}if(t.values?.includes(l)){t.onValuesChange(t.values.filter(x=>x!==l));return}t.onValuesChange([...t.values,l])}return r.jsxs(te,{children:[r.jsx(re,{selected:c,"aria-label":`Select ${e.title}`,id:n,children:c?a:"Select"}),r.jsxs(se,{children:[r.jsx(oe,{value:s,onValueChange:o,placeholder:"Search..."}),r.jsx(ie,{children:"No values found"}),r.jsx(ae,{children:Object.entries(i).map(([l,x])=>r.jsx(z,{value:l,onSelect:u,selected:d(l),closeOnSelect:!t.multiple,children:String(x)},l))})]})]})}function P(e){return"enum"in e&&Array.isArray(e.enum)&&e.enum.every(n=>on(typeof n))}function _(e,n){if(typeof e==typeof n())return e}function Yn(e){if(N(e))return e}function Hn(e){return _(e,String)??_(e,Number)??_(e,Boolean)}function Ne(e,n){if(n===void 0&&Array.isArray(e))return e;if(Array.isArray(e))switch(n){case String:return e.map(t=>_(t,String)).filter(t=>t!==void 0);case Number:return e.map(t=>_(t,Number)).filter(t=>t!==void 0);case Boolean:return e.map(t=>_(t,Boolean)).filter(t=>t!==void 0);case"primitive":return e.map(t=>_(t,String)??_(t,Number)??_(t,Boolean)).filter(t=>t!==void 0);default:throw new Error(`Invalid array type: ${n}`)}}function Xn({values:e,property:n,onValuesChange:t,errors:s,id:o}){const{schema:i}=D();function c(a){if(a===void 0||a.length===0){t(void 0);return}t(a)}if(In(n)&&N(n.items)){let a=n.items;if(A(a)&&(a=M(i,a.$ref)),P(a)){const d={...n,...a};return r.jsx(T,{multiple:!0,values:Ne(e,"primitive"),property:d,onValuesChange:c,id:o})}}return r.jsx(Qn,{property:n,values:e,onValuesChange:c,errors:s})}const Zn=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>r.jsx(f.Suspense,{children:r.jsx(et,{blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})}),et=({blockTypeSlug:e,selectedBlockDocumentId:n,onSelect:t,onCreateNew:s})=>{const[o,i]=f.useState(""),c=f.useDeferredValue(o),{data:a}=J(De({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_types:{slug:{any_:[e]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1},...c?{name:{like_:c}}:{}},limit:50})),d=f.useMemo(()=>a.filter(h=>h.name?.toLowerCase().includes(c.toLowerCase())),[a,c]),u=f.useMemo(()=>a.find(h=>h.id===n),[a,n]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!n,"aria-label":"Select a block",children:u?.name??"Select a block..."}),r.jsxs(se,{children:[r.jsx(oe,{value:o,onValueChange:i,placeholder:"Search for a block..."}),r.jsx(ie,{children:"No block found"}),r.jsxs(ae,{children:[r.jsx(X,{children:d.map(h=>r.jsx(z,{selected:n===h.id,onSelect:p=>{t(p),i("")},value:h.id,children:h.name},h.id))}),s&&r.jsx(X,{children:r.jsxs(z,{onSelect:()=>{s(),i("")},value:"__create_new__",closeOnSelect:!0,children:[r.jsx(ne,{id:"Plus",className:"mr-2 size-4"}),"Create new block"]})})]})]})]})};function nt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){return r.jsx(f.Suspense,{fallback:r.jsx(tt,{}),children:r.jsx(rt,{value:e,onValueChange:n,blockTypeSlug:t,id:s})})}function tt(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Q,{className:"size-8 rounded"}),r.jsx(Q,{className:"h-9 flex-1"}),r.jsx(Q,{className:"h-9 w-20"})]})}function rt({value:e,onValueChange:n,blockTypeSlug:t,id:s}){const[o,i]=f.useState(!1),{data:c}=J(Fe(t)),{data:a}=J(Ee({block_types:{slug:{any_:[t]}},block_documents:{operator:"and_",is_anonymous:{eq_:!1}},include_secrets:!1,sort:"BLOCK_TYPE_AND_NAME_ASC",offset:0})),d=a>0,u=e?.$ref,h=l=>{n(l?{$ref:l}:void 0)},p=l=>{n({$ref:l})};return r.jsxs("div",{id:s,className:"flex items-center gap-2",children:[r.jsx(xn,{logoUrl:c.logo_url,alt:c.name}),d&&r.jsx("div",{className:"flex-1",children:r.jsx(Zn,{blockTypeSlug:t,selectedBlockDocumentId:u,onSelect:h,onCreateNew:()=>i(!0)})}),r.jsxs(L,{type:"button",variant:"outline",onClick:()=>i(!0),children:["Add",r.jsx(ne,{id:"Plus",className:"ml-2 size-4"})]}),r.jsx(an,{open:o,onOpenChange:i,blockTypeSlug:t,onCreated:p})]})}function st({value:e,onValueChange:n,property:t,id:s}){function o(i){n(_(i,Boolean))}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s}):r.jsx(Ve,{checked:e,onCheckedChange:o,id:s})}function ot({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",step:"1",onChange:i=>o(i.target.value),id:s})}function it(){return r.jsx("p",{className:"text-subdued text-sm",children:'Property is type "None"'})}function at({value:e,onValueChange:n,property:t,id:s}){if(P(t))return r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:n,id:s});function o(i){n(i===""?void 0:Number(i))}return r.jsx(W,{type:"number",min:t.minimum,max:t.maximum,value:e??"",onChange:i=>o(i.target.value),id:s})}function ct({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"jinja",template:o||void 0})};return r.jsx(ce,{value:e.template,onChange:s,id:t})}function lt({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n({__prefect_kind:"json",value:o||void 0})};return r.jsx(ce,{value:e.value,onChange:s,id:t})}const ut=({selectedVariableName:e,onSelect:n})=>r.jsx(f.Suspense,{children:r.jsx(dt,{selectedVariableName:e,onSelect:n})}),dt=({selectedVariableName:e,onSelect:n})=>{const[t,s]=f.useState(""),o=f.useDeferredValue(t),{data:i}=J(Ae({offset:0,sort:"NAME_ASC",variables:o?{operator:"and_",name:{like_:o}}:void 0,limit:50})),c=f.useMemo(()=>i.filter(a=>a.name.toLowerCase().includes(o.toLowerCase())),[i,o]);return r.jsxs(te,{children:[r.jsx(re,{selected:!!e,"aria-label":"Select a variable",children:e??"Select a variable..."}),r.jsxs(se,{children:[r.jsx(oe,{value:t,onValueChange:s,placeholder:"Search for a variable..."}),r.jsx(ie,{children:"No variable found"}),r.jsx(ae,{children:r.jsx(X,{children:c.map(a=>r.jsx(z,{selected:e===a.name,onSelect:d=>{n(d),s("")},value:a.name,children:a.name},a.id))})})]})]})};function ft({value:e,onValueChange:n,id:t}){const s=o=>{n({__prefect_kind:"workspace_variable",variable_name:o})};return r.jsx("div",{id:t,children:r.jsx(ut,{selectedVariableName:e.variable_name,onSelect:s})})}const pe="yyyy-MM-dd";function mt({value:e,onValueChange:n,id:t}){const s=e?dn(e,pe,fn()):void 0,[o,i]=f.useState(s);function c(a){i(a),n(a?he(a,pe):void 0)}return r.jsxs(Me,{children:[r.jsx(Te,{asChild:!0,children:r.jsxs(L,{variant:"outline",className:$e("justify-start text-left font-normal w-full",!o&&"text-muted-foreground"),id:t,children:[r.jsx(Be,{className:"mr-2 h-4 w-4"}),o?he(o,"PPP"):r.jsx("span",{children:"Pick a date"})]})}),r.jsx(Ke,{className:"w-auto p-0",children:r.jsx(Le,{mode:"single",selected:o,onSelect:c,required:!0,autoFocus:!0})})]})}function ht({value:e,onValueChange:n,id:t}){const s=o=>{(typeof o=="string"||o===void 0)&&n(o||void 0)};return r.jsx(ce,{value:e,onChange:s,id:t})}function xt({value:e,onValueChange:n,id:t}){const[s,o]=f.useState(!1),i=c=>{n(c.target.value||void 0)};return r.jsxs("div",{className:"relative",children:[r.jsx(W,{id:t,type:s?"text":"password",value:e??"",onChange:i,autoComplete:"off",className:"pr-10"}),r.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>o(!s),"aria-label":s?"Hide password":"Show password",children:s?r.jsx(bn,{className:"h-4 w-4"}):r.jsx(yn,{className:"h-4 w-4"})})]})}function jt({value:e,onValueChange:n,id:t}){function s(o){const i=o.target.value;if(i===""){n(void 0);return}const c=Number(i);Number.isNaN(c)||n(String(c))}return r.jsx(W,{type:"number",value:e??"",onChange:s,id:t,placeholder:"Duration in seconds",min:0})}function pt({value:e,onValueChange:n,property:t,id:s}){function o(i){n(i||void 0)}return P(t)?r.jsx(T,{multiple:!1,value:e,property:t,onValueChange:o,id:s}):t.format==="date"?r.jsx(mt,{value:e,onValueChange:o,id:s}):t.format==="date-time"?r.jsx(cn,{value:e,onValueChange:o,id:s}):t.format==="json-string"?r.jsx(ht,{value:e,onValueChange:o,id:s}):t.format==="time-delta"?r.jsx(jt,{value:e,onValueChange:o,id:s}):t.format==="password"?r.jsx(xt,{value:e,onValueChange:o,id:s}):r.jsx(jn,{value:e??"",rows:1,className:"min-h-min",onChange:i=>o(i.target.value),id:s})}function bt({value:e,onValueChange:n,property:t,id:s}){return f.useEffect(()=>{P(t)||n({__prefect_kind:"json"})},[t,n]),P(t)?r.jsx(T,{multiple:!1,value:Hn(e),property:t,onValueChange:n,id:s}):null}function ue({value:e,onValueChange:n,errors:t,property:s,id:o,nested:i=!0}){if(K(e)){if(K(e,"json"))return r.jsx(lt,{value:e,onValueChange:n,id:o});if(K(e,"jinja"))return r.jsx(ct,{value:e,onValueChange:n,id:o});if(K(e,"workspace_variable"))return r.jsx(ft,{value:e,onValueChange:n,id:o});throw new Error(`Prefect kind not implemented: ${e.__prefect_kind}`)}if("block_type_slug"in s){const c=s.block_type_slug;if(typeof c=="string")return r.jsx(nt,{value:e,onValueChange:n,blockTypeSlug:c,id:o})}if(ge(s))return r.jsx(Y,{value:e,property:s,onValueChange:n,errors:t});if(wn(s)){const c={...s,anyOf:s.oneOf};return r.jsx(Y,{value:e,property:c,onValueChange:n,errors:t})}if(Array.isArray(s.type)){const c={...s,anyOf:Object.values(s.type).map(a=>({type:a}))};return r.jsx(Y,{value:e,property:c,onValueChange:n,errors:t})}if(kn(s))return r.jsx(Cn,{value:e,onValueChange:n,errors:t,property:s,id:o});if(s.type==="string")return r.jsx(pt,{value:_(e,String),onValueChange:n,property:s,id:o});if(s.type==="integer")return r.jsx(ot,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="number")return r.jsx(at,{value:_(e,Number),onValueChange:n,property:s,id:o});if(s.type==="boolean")return r.jsx(st,{value:_(e,Boolean),onValueChange:n,property:s,id:o});if(s.type==="object")return r.jsx(Oe,{values:Yn(e),property:s,onValuesChange:n,errors:t,nested:i});if(s.type==="array")return r.jsx(Xn,{values:Ne(e),property:s,onValuesChange:n,errors:t,id:o});if(s.type==="null")return r.jsx(it,{});if(s.type===void 0)return r.jsx(bt,{value:e,onValueChange:n,property:s,id:o});throw new Error(`Schema type not implemented: ${String(s.type)}`)}function be({property:e}){const n=f.useMemo(()=>e.description?.replace(/\n(?!\n)/g," "),[e.description]);return n&&r.jsx("p",{className:"text-sm text-gray-500",children:n})}function gt({property:e,required:n,id:t}){const{schema:s}=D(),o=f.useMemo(()=>{const i=le(e,s);return n?i:`${i} (Optional)`},[e,n,s]);return r.jsx(Ue,{htmlFor:t,children:o})}function Ce({property:e,value:n,onValueChange:t,required:s,errors:o,showLabel:i=!0,nested:c=!0}){const{schema:a,skipDefaultValueInitialization:d}=D(),u=f.useMemo(()=>ye(e,a),[e,a]),h=f.useMemo(()=>!k(u.type),[u.type]),p=f.useMemo(()=>o.filter(w=>Se(w)||_e(w)),[o]),[l,x]=f.useState(!1),[y,v]=f.useState(B),[S,I]=f.useState(!1),F=f.useId(),E=f.useCallback(w=>{v(w),t(w)},[t]),$=f.useCallback(()=>{const w=!S;I(w),t(w?void 0:y)},[S,t,y]);f.useEffect(()=>{l||d||(k(u.default)&&!k(n)&&t(u.default),x(!0))},[l,d,t,u.default,n]);function B(){if(k(n))return n;if(k(u.default)&&!d)return u.default}return r.jsxs("div",{className:"flex flex-col gap-2 group",children:[i&&r.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx(gt,{property:u,required:s,id:F}),r.jsx(be,{property:u})]}),r.jsx("div",{className:"ml-auto",children:r.jsx(Ie,{value:n,onValueChange:E,property:u,disableKinds:h,defaultValue:u.default,hasDefaultValue:k(u.default),children:r.jsx(C,{onClick:$,children:S?"Include value":"Omit value"})})})]}),!i&&r.jsx(be,{property:u}),r.jsx("fieldset",{disabled:S,children:r.jsx(ue,{property:u,value:y,onValueChange:E,errors:p,id:F,nested:c})}),r.jsx(ve,{errors:o})]})}function yt(e,n){return(e.position??0)-(n.position??0)}function Oe({values:e,onValuesChange:n,property:t,errors:s,nested:o}){const i=f.useRef([]),c=Pe(f.useCallback(()=>{const l={...e};for(const{key:x,value:y}of i.current)l[x]=y,y===void 0&&delete l[x];if(i.current=[],Object.keys(l).length===0){n(void 0);return}n(l)},[e,n]),10);function a(l,x){i.current.push({key:l,value:x}),c()}function d(l){return e?.[l]}function u(l){return s.filter(Se).filter(x=>x.property===l).flatMap(x=>x.errors)}const h=f.useMemo(()=>Object.entries(t.properties??{}).sort(([,l],[,x])=>yt(l,x)),[t.properties]),p=r.jsx("div",{className:"flex flex-col gap-4",children:h.map(([l,x])=>r.jsx(Ce,{value:d(l),onValueChange:y=>a(l,y),property:x,errors:u(l),required:!!t.required?.includes(l)},l))});return o?r.jsx(ee,{className:"p-2",children:p}):p}const St=({children:e,...n})=>r.jsx(ln.Provider,{value:n,children:e}),$t=({schema:e,kinds:n,skipDefaultValueInitialization:t,values:s,onValuesChange:o,errors:i})=>{const c={schema:e,kinds:n,skipDefaultValueInitialization:t},a=f.useCallback(u=>{if(u===void 0){o({});return}o(u)},[o]),d={values:s,property:e,onValuesChange:a,errors:i};return r.jsx("div",{className:"flex flex-col gap-4",children:r.jsx(St,{...c,children:r.jsx(Oe,{...d,nested:!1})})})};export{$t as SchemaForm};
2
+ //# sourceMappingURL=schema-form-BwTmkvJk.js.map