@elevasis/ui 1.19.0 → 1.20.0

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 (611) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/auth/guards/AdminGuard.d.ts +32 -0
  3. package/dist/auth/guards/AdminGuard.d.ts.map +1 -0
  4. package/dist/auth/guards/ProtectedRoute.d.ts +60 -0
  5. package/dist/auth/guards/ProtectedRoute.d.ts.map +1 -0
  6. package/dist/auth/guards/__tests__/AdminGuard.test.d.ts +12 -0
  7. package/dist/auth/guards/__tests__/AdminGuard.test.d.ts.map +1 -0
  8. package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts +14 -0
  9. package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts.map +1 -0
  10. package/dist/auth/index.d.ts +14 -174
  11. package/dist/auth/index.d.ts.map +1 -0
  12. package/dist/auth/index.js +3 -3
  13. package/dist/charts/index.css +14 -0
  14. package/dist/charts/index.js +8 -6
  15. package/dist/chunk-4SY4EQSK.js +68 -0
  16. package/dist/{chunk-7ATCF6UL.js → chunk-ACD2QA6E.js} +11 -4
  17. package/dist/{chunk-2Z7LYTIX.js → chunk-AQ5MQDSS.js} +30 -17
  18. package/dist/chunk-AWMZCYKH.js +639 -0
  19. package/dist/chunk-BX565EOK.js +2921 -0
  20. package/dist/{chunk-WAPZN2U3.js → chunk-EMN755L5.js} +7 -41
  21. package/dist/{chunk-LBY7FVFD.js → chunk-ERVB3QJQ.js} +31 -715
  22. package/dist/chunk-GBMNCNHX.js +105 -0
  23. package/dist/{chunk-BVNAC4SQ.js → chunk-GH7ZO4VD.js} +38 -48
  24. package/dist/{chunk-KNJKCD73.js → chunk-I6EVLOP3.js} +4 -4
  25. package/dist/{chunk-MBZDE6UT.js → chunk-IOKL7BKE.js} +9 -1
  26. package/dist/{chunk-35UWYH2A.js → chunk-JFRG2JJE.js} +8 -2
  27. package/dist/{chunk-NUULWBAD.js → chunk-JHMJKDVU.js} +1 -1
  28. package/dist/chunk-JZEXFQ6N.js +671 -0
  29. package/dist/chunk-LGKLC5MG.js +44 -0
  30. package/dist/chunk-MG3NF7QL.js +63 -0
  31. package/dist/{chunk-KBLGVZBD.js → chunk-NNKKBSJN.js} +2 -22
  32. package/dist/{chunk-JNBHUCKW.js → chunk-NVOCKXUQ.js} +1 -1
  33. package/dist/chunk-PDHTXPSF.js +12 -0
  34. package/dist/chunk-QJ2S46NI.js +23 -0
  35. package/dist/{chunk-UANJP5P7.js → chunk-R7WLWGPO.js} +5 -5
  36. package/dist/{chunk-CC3SDRIF.js → chunk-RWQIFKMJ.js} +1 -1
  37. package/dist/chunk-U4CHEPIL.js +2622 -0
  38. package/dist/chunk-UMFPUM7Q.js +1281 -0
  39. package/dist/chunk-WWEMNIHW.js +37 -0
  40. package/dist/{chunk-UTWJZEOJ.js → chunk-XOTN3X3Z.js} +3 -3
  41. package/dist/{chunk-ZFCG5SHW.js → chunk-Z2BXCFAG.js} +1 -1
  42. package/dist/components/charts/ActivityTrendChart.d.ts +13 -0
  43. package/dist/components/charts/ActivityTrendChart.d.ts.map +1 -0
  44. package/dist/components/charts/CombinedTrendChart.d.ts +22 -0
  45. package/dist/components/charts/CombinedTrendChart.d.ts.map +1 -0
  46. package/dist/components/charts/CostTrendChart.d.ts +13 -0
  47. package/dist/components/charts/CostTrendChart.d.ts.map +1 -0
  48. package/dist/components/charts/HeroStatsRow.d.ts +15 -0
  49. package/dist/components/charts/HeroStatsRow.d.ts.map +1 -0
  50. package/dist/components/charts/index.d.ts +9 -0
  51. package/dist/components/charts/index.d.ts.map +1 -0
  52. package/dist/components/command-queue/TaskCard.d.ts +18 -0
  53. package/dist/components/command-queue/TaskCard.d.ts.map +1 -0
  54. package/dist/components/command-queue/index.d.ts +5 -0
  55. package/dist/components/command-queue/index.d.ts.map +1 -0
  56. package/dist/components/display/PageNotFound.d.ts +2 -0
  57. package/dist/components/display/PageNotFound.d.ts.map +1 -0
  58. package/dist/components/display/index.d.ts +26 -0
  59. package/dist/components/display/index.d.ts.map +1 -0
  60. package/dist/components/execution/ExecutionStats.d.ts +16 -0
  61. package/dist/components/execution/ExecutionStats.d.ts.map +1 -0
  62. package/dist/components/execution/index.d.ts +18 -0
  63. package/dist/components/execution/index.d.ts.map +1 -0
  64. package/dist/components/index.css +14 -0
  65. package/dist/components/index.d.ts +22 -5674
  66. package/dist/components/index.d.ts.map +1 -0
  67. package/dist/components/index.js +564 -5023
  68. package/dist/components/layout/backgrounds/AuroraBackground.d.ts +16 -0
  69. package/dist/components/layout/backgrounds/AuroraBackground.d.ts.map +1 -0
  70. package/dist/components/layout/backgrounds/AuroraBackground.js +169 -0
  71. package/dist/components/layout/backgrounds/EmberBackground.d.ts +16 -0
  72. package/dist/components/layout/backgrounds/EmberBackground.d.ts.map +1 -0
  73. package/dist/components/layout/backgrounds/EmberBackground.js +169 -0
  74. package/dist/components/layout/backgrounds/RoseGoldBackground.d.ts +16 -0
  75. package/dist/components/layout/backgrounds/RoseGoldBackground.d.ts.map +1 -0
  76. package/dist/components/layout/backgrounds/RoseGoldBackground.js +169 -0
  77. package/dist/components/monitoring/ErrorBreakdownTable.d.ts +12 -0
  78. package/dist/components/monitoring/ErrorBreakdownTable.d.ts.map +1 -0
  79. package/dist/components/monitoring/ResourceHealthPanel.d.ts +8 -0
  80. package/dist/components/monitoring/ResourceHealthPanel.d.ts.map +1 -0
  81. package/dist/components/monitoring/index.d.ts +16 -0
  82. package/dist/components/monitoring/index.d.ts.map +1 -0
  83. package/dist/components/navigation/index.js +2 -63
  84. package/dist/components/notifications/NotificationBell.d.ts +9 -0
  85. package/dist/components/notifications/NotificationBell.d.ts.map +1 -0
  86. package/dist/components/notifications/NotificationItem.d.ts +9 -0
  87. package/dist/components/notifications/NotificationItem.d.ts.map +1 -0
  88. package/dist/components/notifications/NotificationList.d.ts +10 -0
  89. package/dist/components/notifications/NotificationList.d.ts.map +1 -0
  90. package/dist/components/notifications/NotificationPanel.d.ts +10 -0
  91. package/dist/components/notifications/NotificationPanel.d.ts.map +1 -0
  92. package/dist/components/notifications/index.d.ts +5 -0
  93. package/dist/components/notifications/index.d.ts.map +1 -0
  94. package/dist/components/operations/calibration/CreateProjectModal.d.ts +9 -0
  95. package/dist/components/operations/calibration/CreateProjectModal.d.ts.map +1 -0
  96. package/dist/components/operations/calibration/ProjectCard.d.ts +9 -0
  97. package/dist/components/operations/calibration/ProjectCard.d.ts.map +1 -0
  98. package/dist/components/operations/command-queue/index.d.ts +3 -0
  99. package/dist/components/operations/command-queue/index.d.ts.map +1 -0
  100. package/dist/components/operations/command-queue/sidebar/CommandQueueSidebar.d.ts +17 -0
  101. package/dist/components/operations/command-queue/sidebar/CommandQueueSidebar.d.ts.map +1 -0
  102. package/dist/components/operations/command-queue/sidebar/CommandQueueSidebarMiddle.d.ts +17 -0
  103. package/dist/components/operations/command-queue/sidebar/CommandQueueSidebarMiddle.d.ts.map +1 -0
  104. package/dist/components/operations/command-queue/sidebar/index.d.ts +5 -0
  105. package/dist/components/operations/command-queue/sidebar/index.d.ts.map +1 -0
  106. package/dist/components/operations/command-view/CommandViewGraph.d.ts +22 -0
  107. package/dist/components/operations/command-view/CommandViewGraph.d.ts.map +1 -0
  108. package/dist/components/operations/command-view/index.d.ts +4 -0
  109. package/dist/components/operations/command-view/index.d.ts.map +1 -0
  110. package/dist/components/operations/executions/AgentExecutionLogs.d.ts +13 -0
  111. package/dist/components/operations/executions/AgentExecutionLogs.d.ts.map +1 -0
  112. package/dist/components/operations/executions/WorkflowExecutionLogs.d.ts +13 -0
  113. package/dist/components/operations/executions/WorkflowExecutionLogs.d.ts.map +1 -0
  114. package/dist/components/operations/executions/index.d.ts +4 -0
  115. package/dist/components/operations/executions/index.d.ts.map +1 -0
  116. package/dist/components/operations/index.d.ts +8 -0
  117. package/dist/components/operations/index.d.ts.map +1 -0
  118. package/dist/components/operations/knowledge-base/DocTreeNav.d.ts +14 -0
  119. package/dist/components/operations/knowledge-base/DocTreeNav.d.ts.map +1 -0
  120. package/dist/components/operations/knowledge-base/KnowledgeBasePage.d.ts +16 -0
  121. package/dist/components/operations/knowledge-base/KnowledgeBasePage.d.ts.map +1 -0
  122. package/dist/components/operations/knowledge-base/index.d.ts +3 -0
  123. package/dist/components/operations/knowledge-base/index.d.ts.map +1 -0
  124. package/dist/components/operations/shared/BaseExecutionLogs/BaseExecutionLogs.d.ts +16 -0
  125. package/dist/components/operations/shared/BaseExecutionLogs/BaseExecutionLogs.d.ts.map +1 -0
  126. package/dist/components/operations/shared/BaseExecutionLogs/BaseExecutionLogsHeader.d.ts +12 -0
  127. package/dist/components/operations/shared/BaseExecutionLogs/BaseExecutionLogsHeader.d.ts.map +1 -0
  128. package/dist/components/operations/shared/BaseExecutionLogs/ExecutionErrorSection.d.ts +12 -0
  129. package/dist/components/operations/shared/BaseExecutionLogs/ExecutionErrorSection.d.ts.map +1 -0
  130. package/dist/components/operations/shared/BaseExecutionLogs/index.d.ts +7 -0
  131. package/dist/components/operations/shared/BaseExecutionLogs/index.d.ts.map +1 -0
  132. package/dist/components/operations/shared/index.d.ts +5 -0
  133. package/dist/components/operations/shared/index.d.ts.map +1 -0
  134. package/dist/components/operations/shared/layouts/ResourceHeader.d.ts +11 -0
  135. package/dist/components/operations/shared/layouts/ResourceHeader.d.ts.map +1 -0
  136. package/dist/components/operations/shared/layouts/ResourceNotFoundState.d.ts +8 -0
  137. package/dist/components/operations/shared/layouts/ResourceNotFoundState.d.ts.map +1 -0
  138. package/dist/components/operations/shared/layouts/index.d.ts +4 -0
  139. package/dist/components/operations/shared/layouts/index.d.ts.map +1 -0
  140. package/dist/components/operations/task-scheduler/CreateScheduleModal.d.ts +7 -0
  141. package/dist/components/operations/task-scheduler/CreateScheduleModal.d.ts.map +1 -0
  142. package/dist/components/operations/task-scheduler/TaskScheduler.d.ts +2 -0
  143. package/dist/components/operations/task-scheduler/TaskScheduler.d.ts.map +1 -0
  144. package/dist/components/operations/task-scheduler/index.d.ts +11 -0
  145. package/dist/components/operations/task-scheduler/index.d.ts.map +1 -0
  146. package/dist/components/sdk-barrel.d.ts +26 -0
  147. package/dist/components/sdk-barrel.d.ts.map +1 -0
  148. package/dist/components/settings/api-keys/ApiKeyDisplayModal.d.ts +9 -0
  149. package/dist/components/settings/api-keys/ApiKeyDisplayModal.d.ts.map +1 -0
  150. package/dist/components/settings/api-keys/ApiKeyList.d.ts +8 -0
  151. package/dist/components/settings/api-keys/ApiKeyList.d.ts.map +1 -0
  152. package/dist/components/settings/api-keys/ApiKeySettings.d.ts +2 -0
  153. package/dist/components/settings/api-keys/ApiKeySettings.d.ts.map +1 -0
  154. package/dist/components/settings/api-keys/CreateApiKeyModal.d.ts +9 -0
  155. package/dist/components/settings/api-keys/CreateApiKeyModal.d.ts.map +1 -0
  156. package/dist/components/settings/api-keys/EditApiKeyModal.d.ts +8 -0
  157. package/dist/components/settings/api-keys/EditApiKeyModal.d.ts.map +1 -0
  158. package/dist/components/settings/api-keys/index.d.ts +6 -0
  159. package/dist/components/settings/api-keys/index.d.ts.map +1 -0
  160. package/dist/components/settings/credentials/CreateCredentialModal.d.ts +9 -0
  161. package/dist/components/settings/credentials/CreateCredentialModal.d.ts.map +1 -0
  162. package/dist/components/settings/credentials/CredentialList.d.ts +10 -0
  163. package/dist/components/settings/credentials/CredentialList.d.ts.map +1 -0
  164. package/dist/components/settings/credentials/CredentialSettings.d.ts +7 -0
  165. package/dist/components/settings/credentials/CredentialSettings.d.ts.map +1 -0
  166. package/dist/components/settings/credentials/index.d.ts +5 -0
  167. package/dist/components/settings/credentials/index.d.ts.map +1 -0
  168. package/dist/components/settings/deployments/DeploymentList.d.ts +8 -0
  169. package/dist/components/settings/deployments/DeploymentList.d.ts.map +1 -0
  170. package/dist/components/settings/deployments/DeploymentSettings.d.ts +2 -0
  171. package/dist/components/settings/deployments/DeploymentSettings.d.ts.map +1 -0
  172. package/dist/components/settings/deployments/index.d.ts +5 -0
  173. package/dist/components/settings/deployments/index.d.ts.map +1 -0
  174. package/dist/components/settings/index.d.ts +6 -0
  175. package/dist/components/settings/index.d.ts.map +1 -0
  176. package/dist/components/table/SortableHeader.d.ts +12 -0
  177. package/dist/components/table/SortableHeader.d.ts.map +1 -0
  178. package/dist/components/table/index.d.ts +4 -0
  179. package/dist/components/table/index.d.ts.map +1 -0
  180. package/dist/features/auth/AdminGuard.d.ts +38 -0
  181. package/dist/features/auth/AdminGuard.d.ts.map +1 -0
  182. package/dist/features/auth/FeatureGuard.d.ts +45 -0
  183. package/dist/features/auth/FeatureGuard.d.ts.map +1 -0
  184. package/dist/features/auth/ProtectedRoute.d.ts +43 -0
  185. package/dist/features/auth/ProtectedRoute.d.ts.map +1 -0
  186. package/dist/features/auth/index.css +579 -0
  187. package/dist/features/auth/index.d.ts +9 -0
  188. package/dist/features/auth/index.d.ts.map +1 -0
  189. package/dist/features/auth/index.js +125 -0
  190. package/dist/features/auth/useUserProfile.d.ts +10 -0
  191. package/dist/features/auth/useUserProfile.d.ts.map +1 -0
  192. package/dist/features/dashboard/Dashboard.d.ts +57 -0
  193. package/dist/features/dashboard/Dashboard.d.ts.map +1 -0
  194. package/dist/features/dashboard/RecentExecutionsByResource.d.ts +11 -0
  195. package/dist/features/dashboard/RecentExecutionsByResource.d.ts.map +1 -0
  196. package/dist/features/dashboard/ResourceOverview.d.ts +21 -0
  197. package/dist/features/dashboard/ResourceOverview.d.ts.map +1 -0
  198. package/dist/features/dashboard/UnresolvedErrorsTeaser.d.ts +7 -0
  199. package/dist/features/dashboard/UnresolvedErrorsTeaser.d.ts.map +1 -0
  200. package/dist/features/dashboard/index.css +579 -0
  201. package/dist/features/dashboard/index.d.ts +9 -0
  202. package/dist/features/dashboard/index.d.ts.map +1 -0
  203. package/dist/features/dashboard/index.js +650 -0
  204. package/dist/features/monitoring/ActivityFeed.d.ts +37 -0
  205. package/dist/features/monitoring/ActivityFeed.d.ts.map +1 -0
  206. package/dist/features/monitoring/ActivityLog.d.ts +8 -0
  207. package/dist/features/monitoring/ActivityLog.d.ts.map +1 -0
  208. package/dist/features/monitoring/CostAnalytics.d.ts +13 -0
  209. package/dist/features/monitoring/CostAnalytics.d.ts.map +1 -0
  210. package/dist/features/monitoring/ErrorDetailsModal.d.ts +13 -0
  211. package/dist/features/monitoring/ErrorDetailsModal.d.ts.map +1 -0
  212. package/dist/features/monitoring/ExecutionHealth.d.ts +9 -0
  213. package/dist/features/monitoring/ExecutionHealth.d.ts.map +1 -0
  214. package/dist/features/monitoring/ExecutionLogsPage.d.ts +20 -0
  215. package/dist/features/monitoring/ExecutionLogsPage.d.ts.map +1 -0
  216. package/dist/features/monitoring/NotificationCenter.d.ts +5 -0
  217. package/dist/features/monitoring/NotificationCenter.d.ts.map +1 -0
  218. package/dist/features/monitoring/index.css +579 -0
  219. package/dist/features/monitoring/index.d.ts +15 -0
  220. package/dist/features/monitoring/index.d.ts.map +1 -0
  221. package/dist/features/monitoring/index.js +538 -0
  222. package/dist/features/operations/CalibrationPage.d.ts +9 -0
  223. package/dist/features/operations/CalibrationPage.d.ts.map +1 -0
  224. package/dist/features/operations/CalibrationProjectDetailPage.d.ts +43 -0
  225. package/dist/features/operations/CalibrationProjectDetailPage.d.ts.map +1 -0
  226. package/dist/features/operations/CalibrationProjectsPage.d.ts +10 -0
  227. package/dist/features/operations/CalibrationProjectsPage.d.ts.map +1 -0
  228. package/dist/features/operations/CalibrationRunDetailPage.d.ts +35 -0
  229. package/dist/features/operations/CalibrationRunDetailPage.d.ts.map +1 -0
  230. package/dist/features/operations/CommandQueueDetailPage.d.ts +16 -0
  231. package/dist/features/operations/CommandQueueDetailPage.d.ts.map +1 -0
  232. package/dist/features/operations/CommandQueuePage.d.ts +13 -0
  233. package/dist/features/operations/CommandQueuePage.d.ts.map +1 -0
  234. package/dist/features/operations/CommandViewPage.d.ts +6 -0
  235. package/dist/features/operations/CommandViewPage.d.ts.map +1 -0
  236. package/dist/features/operations/CommandViewSidebarContent.d.ts +19 -0
  237. package/dist/features/operations/CommandViewSidebarContent.d.ts.map +1 -0
  238. package/dist/features/operations/ResourceDetailPage.d.ts +25 -0
  239. package/dist/features/operations/ResourceDetailPage.d.ts.map +1 -0
  240. package/dist/features/operations/ResourcesPage.d.ts +15 -0
  241. package/dist/features/operations/ResourcesPage.d.ts.map +1 -0
  242. package/dist/features/operations/ResourcesSidebar.d.ts +9 -0
  243. package/dist/features/operations/ResourcesSidebar.d.ts.map +1 -0
  244. package/dist/features/operations/calibration-components/ComparisonTable.d.ts +9 -0
  245. package/dist/features/operations/calibration-components/ComparisonTable.d.ts.map +1 -0
  246. package/dist/features/operations/executions/AgentExecutionPanel.d.ts +12 -0
  247. package/dist/features/operations/executions/AgentExecutionPanel.d.ts.map +1 -0
  248. package/dist/features/operations/executions/ExecutionPanel.d.ts +13 -0
  249. package/dist/features/operations/executions/ExecutionPanel.d.ts.map +1 -0
  250. package/dist/features/operations/executions/WorkflowExecutionPanel.d.ts +12 -0
  251. package/dist/features/operations/executions/WorkflowExecutionPanel.d.ts.map +1 -0
  252. package/dist/features/operations/executions/index.d.ts +7 -0
  253. package/dist/features/operations/executions/index.d.ts.map +1 -0
  254. package/dist/features/operations/index.css +14 -0
  255. package/dist/features/operations/index.d.ts +29 -98
  256. package/dist/features/operations/index.d.ts.map +1 -0
  257. package/dist/features/operations/index.js +2148 -28
  258. package/dist/features/operations/layouts/components/ResourceHeader.d.ts +11 -0
  259. package/dist/features/operations/layouts/components/ResourceHeader.d.ts.map +1 -0
  260. package/dist/features/operations/layouts/components/ResourceNotFoundState.d.ts +8 -0
  261. package/dist/features/operations/layouts/components/ResourceNotFoundState.d.ts.map +1 -0
  262. package/dist/features/operations/layouts/components/index.d.ts +4 -0
  263. package/dist/features/operations/layouts/components/index.d.ts.map +1 -0
  264. package/dist/features/settings/AccountSettings.d.ts +20 -0
  265. package/dist/features/settings/AccountSettings.d.ts.map +1 -0
  266. package/dist/features/settings/AppearanceSettings.d.ts +23 -0
  267. package/dist/features/settings/AppearanceSettings.d.ts.map +1 -0
  268. package/dist/features/settings/CreateWebhookEndpointModal.d.ts +8 -0
  269. package/dist/features/settings/CreateWebhookEndpointModal.d.ts.map +1 -0
  270. package/dist/features/settings/EditCredentialModal.d.ts +9 -0
  271. package/dist/features/settings/EditCredentialModal.d.ts.map +1 -0
  272. package/dist/features/settings/EditWebhookEndpointModal.d.ts +8 -0
  273. package/dist/features/settings/EditWebhookEndpointModal.d.ts.map +1 -0
  274. package/dist/features/settings/MemberConfigModal.d.ts +14 -0
  275. package/dist/features/settings/MemberConfigModal.d.ts.map +1 -0
  276. package/dist/features/settings/OAuthIntegrationsCard.d.ts +6 -0
  277. package/dist/features/settings/OAuthIntegrationsCard.d.ts.map +1 -0
  278. package/dist/features/settings/OrgMembersList.d.ts +5 -0
  279. package/dist/features/settings/OrgMembersList.d.ts.map +1 -0
  280. package/dist/features/settings/OrganizationSettings.d.ts +30 -0
  281. package/dist/features/settings/OrganizationSettings.d.ts.map +1 -0
  282. package/dist/features/settings/WebhookEndpointList.d.ts +9 -0
  283. package/dist/features/settings/WebhookEndpointList.d.ts.map +1 -0
  284. package/dist/features/settings/WebhookEndpointSettings.d.ts +6 -0
  285. package/dist/features/settings/WebhookEndpointSettings.d.ts.map +1 -0
  286. package/dist/features/settings/index.css +579 -0
  287. package/dist/features/settings/index.d.ts +23 -0
  288. package/dist/features/settings/index.d.ts.map +1 -0
  289. package/dist/features/settings/index.js +1437 -0
  290. package/dist/hooks/command-queue/index.d.ts +7 -0
  291. package/dist/hooks/command-queue/index.d.ts.map +1 -0
  292. package/dist/hooks/command-queue/useCommandQueue.d.ts +33 -0
  293. package/dist/hooks/command-queue/useCommandQueue.d.ts.map +1 -0
  294. package/dist/hooks/command-queue/useCommandQueueTotals.d.ts +17 -0
  295. package/dist/hooks/command-queue/useCommandQueueTotals.d.ts.map +1 -0
  296. package/dist/hooks/command-queue/useDeleteTask.d.ts +5 -0
  297. package/dist/hooks/command-queue/useDeleteTask.d.ts.map +1 -0
  298. package/dist/hooks/command-queue/usePatchTask.d.ts +6 -0
  299. package/dist/hooks/command-queue/usePatchTask.d.ts.map +1 -0
  300. package/dist/hooks/command-queue/useSubmitAction.d.ts +29 -0
  301. package/dist/hooks/command-queue/useSubmitAction.d.ts.map +1 -0
  302. package/dist/hooks/executions/index.d.ts +17 -0
  303. package/dist/hooks/executions/index.d.ts.map +1 -0
  304. package/dist/hooks/executions/useArchivedLogs.d.ts +14 -0
  305. package/dist/hooks/executions/useArchivedLogs.d.ts.map +1 -0
  306. package/dist/hooks/executions/useBulkDeleteExecutions.d.ts +15 -0
  307. package/dist/hooks/executions/useBulkDeleteExecutions.d.ts.map +1 -0
  308. package/dist/hooks/executions/useCancelExecution.d.ts +20 -0
  309. package/dist/hooks/executions/useCancelExecution.d.ts.map +1 -0
  310. package/dist/hooks/executions/useDeleteExecution.d.ts +13 -0
  311. package/dist/hooks/executions/useDeleteExecution.d.ts.map +1 -0
  312. package/dist/hooks/executions/useExecuteAsync.d.ts +21 -0
  313. package/dist/hooks/executions/useExecuteAsync.d.ts.map +1 -0
  314. package/dist/hooks/executions/useExecution.d.ts +10 -0
  315. package/dist/hooks/executions/useExecution.d.ts.map +1 -0
  316. package/dist/hooks/executions/useExecutions.d.ts +16 -0
  317. package/dist/hooks/executions/useExecutions.d.ts.map +1 -0
  318. package/dist/hooks/executions/useResourceDefinition.d.ts +9 -0
  319. package/dist/hooks/executions/useResourceDefinition.d.ts.map +1 -0
  320. package/dist/hooks/executions/useResources.d.ts +15 -0
  321. package/dist/hooks/executions/useResources.d.ts.map +1 -0
  322. package/dist/hooks/executions/useRetryExecution.d.ts +16 -0
  323. package/dist/hooks/executions/useRetryExecution.d.ts.map +1 -0
  324. package/dist/hooks/feature-access/createUseFeatureAccess.d.ts +41 -0
  325. package/dist/hooks/feature-access/createUseFeatureAccess.d.ts.map +1 -0
  326. package/dist/hooks/feature-access/index.d.ts +2 -0
  327. package/dist/hooks/feature-access/index.d.ts.map +1 -0
  328. package/dist/hooks/index.css +14 -0
  329. package/dist/hooks/index.d.ts +22 -6593
  330. package/dist/hooks/index.d.ts.map +1 -0
  331. package/dist/hooks/index.js +13 -13
  332. package/dist/hooks/monitoring/index.d.ts +11 -0
  333. package/dist/hooks/monitoring/index.d.ts.map +1 -0
  334. package/dist/hooks/monitoring/useActivities.d.ts +52 -0
  335. package/dist/hooks/monitoring/useActivities.d.ts.map +1 -0
  336. package/dist/hooks/monitoring/useCostSummary.d.ts +7 -0
  337. package/dist/hooks/monitoring/useCostSummary.d.ts.map +1 -0
  338. package/dist/hooks/monitoring/useExecutionHealth.d.ts +10 -0
  339. package/dist/hooks/monitoring/useExecutionHealth.d.ts.map +1 -0
  340. package/dist/hooks/monitoring/useExecutionLogs.d.ts +56 -0
  341. package/dist/hooks/monitoring/useExecutionLogs.d.ts.map +1 -0
  342. package/dist/hooks/monitoring/useNotificationCount.d.ts +26 -0
  343. package/dist/hooks/monitoring/useNotificationCount.d.ts.map +1 -0
  344. package/dist/hooks/monitoring/useNotifications.d.ts +11 -0
  345. package/dist/hooks/monitoring/useNotifications.d.ts.map +1 -0
  346. package/dist/hooks/notifications/index.d.ts +8 -0
  347. package/dist/hooks/notifications/index.d.ts.map +1 -0
  348. package/dist/hooks/notifications/useMarkAllAsRead.d.ts +2 -0
  349. package/dist/hooks/notifications/useMarkAllAsRead.d.ts.map +1 -0
  350. package/dist/hooks/notifications/useMarkAsRead.d.ts +2 -0
  351. package/dist/hooks/notifications/useMarkAsRead.d.ts.map +1 -0
  352. package/dist/hooks/notifications/useTestNotification.d.ts +16 -0
  353. package/dist/hooks/notifications/useTestNotification.d.ts.map +1 -0
  354. package/dist/hooks/observability/index.d.ts +25 -0
  355. package/dist/hooks/observability/index.d.ts.map +1 -0
  356. package/dist/hooks/observability/useBatchedResourcesHealth.d.ts +15 -0
  357. package/dist/hooks/observability/useBatchedResourcesHealth.d.ts.map +1 -0
  358. package/dist/hooks/observability/useBusinessImpact.d.ts +9 -0
  359. package/dist/hooks/observability/useBusinessImpact.d.ts.map +1 -0
  360. package/dist/hooks/observability/useCostBreakdown.d.ts +10 -0
  361. package/dist/hooks/observability/useCostBreakdown.d.ts.map +1 -0
  362. package/dist/hooks/observability/useCostByModel.d.ts +3 -0
  363. package/dist/hooks/observability/useCostByModel.d.ts.map +1 -0
  364. package/dist/hooks/observability/useCostTrends.d.ts +3 -0
  365. package/dist/hooks/observability/useCostTrends.d.ts.map +1 -0
  366. package/dist/hooks/observability/useDashboardMetrics.d.ts +3 -0
  367. package/dist/hooks/observability/useDashboardMetrics.d.ts.map +1 -0
  368. package/dist/hooks/observability/useErrorAnalysis.d.ts +7 -0
  369. package/dist/hooks/observability/useErrorAnalysis.d.ts.map +1 -0
  370. package/dist/hooks/observability/useErrorDetails.d.ts +20 -0
  371. package/dist/hooks/observability/useErrorDetails.d.ts.map +1 -0
  372. package/dist/hooks/observability/useErrorDistribution.d.ts +12 -0
  373. package/dist/hooks/observability/useErrorDistribution.d.ts.map +1 -0
  374. package/dist/hooks/observability/useErrorTrends.d.ts +12 -0
  375. package/dist/hooks/observability/useErrorTrends.d.ts.map +1 -0
  376. package/dist/hooks/observability/useRecentExecutionsByResource.d.ts +18 -0
  377. package/dist/hooks/observability/useRecentExecutionsByResource.d.ts.map +1 -0
  378. package/dist/hooks/observability/useResolveError.d.ts +17 -0
  379. package/dist/hooks/observability/useResolveError.d.ts.map +1 -0
  380. package/dist/hooks/observability/useResourcesHealth.d.ts +13 -0
  381. package/dist/hooks/observability/useResourcesHealth.d.ts.map +1 -0
  382. package/dist/hooks/observability/useTopFailingResources.d.ts +13 -0
  383. package/dist/hooks/observability/useTopFailingResources.d.ts.map +1 -0
  384. package/dist/hooks/observability/useUnresolvedErrors.d.ts +15 -0
  385. package/dist/hooks/observability/useUnresolvedErrors.d.ts.map +1 -0
  386. package/dist/hooks/operations/calibration/useCalibrationProjects.d.ts +24 -0
  387. package/dist/hooks/operations/calibration/useCalibrationProjects.d.ts.map +1 -0
  388. package/dist/hooks/operations/calibration/useCalibrationRunFull.d.ts +3 -0
  389. package/dist/hooks/operations/calibration/useCalibrationRunFull.d.ts.map +1 -0
  390. package/dist/hooks/operations/calibration/useCalibrationRuns.d.ts +35 -0
  391. package/dist/hooks/operations/calibration/useCalibrationRuns.d.ts.map +1 -0
  392. package/dist/hooks/operations/command-view/index.d.ts +8 -0
  393. package/dist/hooks/operations/command-view/index.d.ts.map +1 -0
  394. package/dist/hooks/operations/command-view/useCheckpointTasks.d.ts +24 -0
  395. package/dist/hooks/operations/command-view/useCheckpointTasks.d.ts.map +1 -0
  396. package/dist/hooks/operations/command-view/useCommandViewData.d.ts +11 -0
  397. package/dist/hooks/operations/command-view/useCommandViewData.d.ts.map +1 -0
  398. package/dist/hooks/operations/command-view/useCommandViewStats.d.ts +12 -0
  399. package/dist/hooks/operations/command-view/useCommandViewStats.d.ts.map +1 -0
  400. package/dist/hooks/operations/command-view/useResourceErrors.d.ts +22 -0
  401. package/dist/hooks/operations/command-view/useResourceErrors.d.ts.map +1 -0
  402. package/dist/hooks/operations/command-view/useResourceExecutions.d.ts +22 -0
  403. package/dist/hooks/operations/command-view/useResourceExecutions.d.ts.map +1 -0
  404. package/dist/hooks/operations/index.d.ts +4 -0
  405. package/dist/hooks/operations/index.d.ts.map +1 -0
  406. package/dist/hooks/operations/knowledge-base/index.d.ts +3 -0
  407. package/dist/hooks/operations/knowledge-base/index.d.ts.map +1 -0
  408. package/dist/hooks/operations/knowledge-base/useDeploymentDocs.d.ts +27 -0
  409. package/dist/hooks/operations/knowledge-base/useDeploymentDocs.d.ts.map +1 -0
  410. package/dist/hooks/operations/settings/index.d.ts +4 -0
  411. package/dist/hooks/operations/settings/index.d.ts.map +1 -0
  412. package/dist/hooks/operations/settings/useOAuthFlow.d.ts +17 -0
  413. package/dist/hooks/operations/settings/useOAuthFlow.d.ts.map +1 -0
  414. package/dist/hooks/operations/settings/useUpdateThemePreference.d.ts +17 -0
  415. package/dist/hooks/operations/settings/useUpdateThemePreference.d.ts.map +1 -0
  416. package/dist/hooks/operations/shared/index.d.ts +6 -0
  417. package/dist/hooks/operations/shared/index.d.ts.map +1 -0
  418. package/dist/hooks/operations/shared/queryKeys.d.ts +23 -0
  419. package/dist/hooks/operations/shared/queryKeys.d.ts.map +1 -0
  420. package/dist/hooks/operations/shared/useExecutionLogSSE.d.ts +11 -0
  421. package/dist/hooks/operations/shared/useExecutionLogSSE.d.ts.map +1 -0
  422. package/dist/hooks/operations/shared/useExecutionPanelState.d.ts +46 -0
  423. package/dist/hooks/operations/shared/useExecutionPanelState.d.ts.map +1 -0
  424. package/dist/hooks/published.css +14 -0
  425. package/dist/hooks/published.d.ts +21 -6037
  426. package/dist/hooks/published.d.ts.map +1 -0
  427. package/dist/hooks/published.js +12 -12
  428. package/dist/hooks/scheduling/index.d.ts +7 -0
  429. package/dist/hooks/scheduling/index.d.ts.map +1 -0
  430. package/dist/hooks/scheduling/useScheduledTasks.d.ts +19 -0
  431. package/dist/hooks/scheduling/useScheduledTasks.d.ts.map +1 -0
  432. package/dist/hooks/scheduling/useSchedules.d.ts +185 -0
  433. package/dist/hooks/scheduling/useSchedules.d.ts.map +1 -0
  434. package/dist/hooks/sessions/index.d.ts +8 -0
  435. package/dist/hooks/sessions/index.d.ts.map +1 -0
  436. package/dist/hooks/sessions/useSessionExecutions.d.ts +13 -0
  437. package/dist/hooks/sessions/useSessionExecutions.d.ts.map +1 -0
  438. package/dist/hooks/sessions/useSessionMessages.d.ts +7 -0
  439. package/dist/hooks/sessions/useSessionMessages.d.ts.map +1 -0
  440. package/dist/hooks/sessions/useSessions.d.ts +26 -0
  441. package/dist/hooks/sessions/useSessions.d.ts.map +1 -0
  442. package/dist/hooks/settings/api-keys/index.d.ts +7 -0
  443. package/dist/hooks/settings/api-keys/index.d.ts.map +1 -0
  444. package/dist/hooks/settings/api-keys/useCreateApiKey.d.ts +3 -0
  445. package/dist/hooks/settings/api-keys/useCreateApiKey.d.ts.map +1 -0
  446. package/dist/hooks/settings/api-keys/useDeleteApiKey.d.ts +2 -0
  447. package/dist/hooks/settings/api-keys/useDeleteApiKey.d.ts.map +1 -0
  448. package/dist/hooks/settings/api-keys/useListApiKeys.d.ts +2 -0
  449. package/dist/hooks/settings/api-keys/useListApiKeys.d.ts.map +1 -0
  450. package/dist/hooks/settings/api-keys/useUpdateApiKey.d.ts +5 -0
  451. package/dist/hooks/settings/api-keys/useUpdateApiKey.d.ts.map +1 -0
  452. package/dist/hooks/settings/credentials/index.d.ts +7 -0
  453. package/dist/hooks/settings/credentials/index.d.ts.map +1 -0
  454. package/dist/hooks/settings/credentials/useCreateCredential.d.ts +3 -0
  455. package/dist/hooks/settings/credentials/useCreateCredential.d.ts.map +1 -0
  456. package/dist/hooks/settings/credentials/useCredentials.d.ts +8 -0
  457. package/dist/hooks/settings/credentials/useCredentials.d.ts.map +1 -0
  458. package/dist/hooks/settings/credentials/useDeleteCredential.d.ts +2 -0
  459. package/dist/hooks/settings/credentials/useDeleteCredential.d.ts.map +1 -0
  460. package/dist/hooks/settings/credentials/useUpdateCredential.d.ts +10 -0
  461. package/dist/hooks/settings/credentials/useUpdateCredential.d.ts.map +1 -0
  462. package/dist/hooks/settings/deployments/index.d.ts +5 -0
  463. package/dist/hooks/settings/deployments/index.d.ts.map +1 -0
  464. package/dist/hooks/settings/deployments/useDeploymentActions.d.ts +4 -0
  465. package/dist/hooks/settings/deployments/useDeploymentActions.d.ts.map +1 -0
  466. package/dist/hooks/settings/deployments/useListDeployments.d.ts +2 -0
  467. package/dist/hooks/settings/deployments/useListDeployments.d.ts.map +1 -0
  468. package/dist/hooks/settings/index.d.ts +6 -0
  469. package/dist/hooks/settings/index.d.ts.map +1 -0
  470. package/dist/hooks/settings/organization/index.d.ts +6 -0
  471. package/dist/hooks/settings/organization/index.d.ts.map +1 -0
  472. package/dist/hooks/settings/organization/useDeactivateMembership.d.ts +11 -0
  473. package/dist/hooks/settings/organization/useDeactivateMembership.d.ts.map +1 -0
  474. package/dist/hooks/settings/organization/useReactivateMembership.d.ts +11 -0
  475. package/dist/hooks/settings/organization/useReactivateMembership.d.ts.map +1 -0
  476. package/dist/hooks/settings/organization/useUpdateMemberConfig.d.ts +8 -0
  477. package/dist/hooks/settings/organization/useUpdateMemberConfig.d.ts.map +1 -0
  478. package/dist/hooks/settings/organization/useUserMemberships.d.ts +3 -0
  479. package/dist/hooks/settings/organization/useUserMemberships.d.ts.map +1 -0
  480. package/dist/hooks/settings/webhooks/index.d.ts +7 -0
  481. package/dist/hooks/settings/webhooks/index.d.ts.map +1 -0
  482. package/dist/hooks/settings/webhooks/useCreateWebhookEndpoint.d.ts +18 -0
  483. package/dist/hooks/settings/webhooks/useCreateWebhookEndpoint.d.ts.map +1 -0
  484. package/dist/hooks/settings/webhooks/useDeleteWebhookEndpoint.d.ts +2 -0
  485. package/dist/hooks/settings/webhooks/useDeleteWebhookEndpoint.d.ts.map +1 -0
  486. package/dist/hooks/settings/webhooks/useListWebhookEndpoints.d.ts +14 -0
  487. package/dist/hooks/settings/webhooks/useListWebhookEndpoints.d.ts.map +1 -0
  488. package/dist/hooks/settings/webhooks/useUpdateWebhookEndpoint.d.ts +18 -0
  489. package/dist/hooks/settings/webhooks/useUpdateWebhookEndpoint.d.ts.map +1 -0
  490. package/dist/hooks/settings/webhooks/webhookEndpointService.d.ts +27 -0
  491. package/dist/hooks/settings/webhooks/webhookEndpointService.d.ts.map +1 -0
  492. package/dist/hooks/useOrganizationMembers.d.ts +18 -0
  493. package/dist/hooks/useOrganizationMembers.d.ts.map +1 -0
  494. package/dist/index.css +14 -0
  495. package/dist/index.d.ts +15 -8494
  496. package/dist/index.d.ts.map +1 -0
  497. package/dist/index.js +15 -15
  498. package/dist/initialization/InitializationProvider.d.ts +48 -0
  499. package/dist/initialization/InitializationProvider.d.ts.map +1 -0
  500. package/dist/initialization/hooks/useAppInitialization.d.ts +32 -0
  501. package/dist/initialization/hooks/useAppInitialization.d.ts.map +1 -0
  502. package/dist/initialization/index.d.ts +23 -2526
  503. package/dist/initialization/index.d.ts.map +1 -0
  504. package/dist/initialization/index.js +2 -2
  505. package/dist/layout/index.d.ts +7 -1
  506. package/dist/layout/index.js +7 -5
  507. package/dist/organization/context/OrganizationProvider.d.ts +24 -0
  508. package/dist/organization/context/OrganizationProvider.d.ts.map +1 -0
  509. package/dist/organization/hooks/useOrgInitialization.d.ts +56 -0
  510. package/dist/organization/hooks/useOrgInitialization.d.ts.map +1 -0
  511. package/dist/organization/index.d.ts +23 -274
  512. package/dist/organization/index.d.ts.map +1 -0
  513. package/dist/organization/index.js +2 -2
  514. package/dist/profile/context/ProfileProvider.d.ts +31 -0
  515. package/dist/profile/context/ProfileProvider.d.ts.map +1 -0
  516. package/dist/profile/hooks/useUserProfile.d.ts +38 -0
  517. package/dist/profile/hooks/useUserProfile.d.ts.map +1 -0
  518. package/dist/profile/index.d.ts +15 -2477
  519. package/dist/profile/index.d.ts.map +1 -0
  520. package/dist/provider/CoreAuthKitInner.d.ts +12 -0
  521. package/dist/provider/CoreAuthKitInner.d.ts.map +1 -0
  522. package/dist/provider/ElevasisCoreProvider.d.ts +25 -0
  523. package/dist/provider/ElevasisCoreProvider.d.ts.map +1 -0
  524. package/dist/provider/ElevasisServiceContext.d.ts +31 -0
  525. package/dist/provider/ElevasisServiceContext.d.ts.map +1 -0
  526. package/dist/provider/ElevasisUIProvider.d.ts +28 -0
  527. package/dist/provider/ElevasisUIProvider.d.ts.map +1 -0
  528. package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts +2 -0
  529. package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts.map +1 -0
  530. package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts +2 -0
  531. package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts.map +1 -0
  532. package/dist/provider/index.css +14 -0
  533. package/dist/provider/index.d.ts +11 -334
  534. package/dist/provider/index.d.ts.map +1 -0
  535. package/dist/provider/index.js +10 -10
  536. package/dist/provider/published.d.ts +11 -309
  537. package/dist/provider/published.d.ts.map +1 -0
  538. package/dist/provider/published.js +6 -6
  539. package/dist/provider/types.d.ts +151 -0
  540. package/dist/provider/types.d.ts.map +1 -0
  541. package/dist/sdk-barrel.d.ts +20 -0
  542. package/dist/sdk-barrel.d.ts.map +1 -0
  543. package/dist/theme/PresetsContext.d.ts +4 -0
  544. package/dist/theme/PresetsContext.d.ts.map +1 -0
  545. package/dist/theme/cssVariables.d.ts +12 -0
  546. package/dist/theme/cssVariables.d.ts.map +1 -0
  547. package/dist/theme/index.d.ts +10 -148
  548. package/dist/theme/index.d.ts.map +1 -0
  549. package/dist/theme/index.js +3 -3
  550. package/dist/theme/presets/__tests__/getPreset.test.d.ts +2 -0
  551. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +1 -0
  552. package/dist/theme/presets/abyss.d.ts +3 -0
  553. package/dist/theme/presets/abyss.d.ts.map +1 -0
  554. package/dist/theme/presets/aurora.d.ts +12 -0
  555. package/dist/theme/presets/aurora.d.ts.map +1 -0
  556. package/dist/theme/presets/canopy.d.ts +12 -0
  557. package/dist/theme/presets/canopy.d.ts.map +1 -0
  558. package/dist/theme/presets/canyon.d.ts +11 -0
  559. package/dist/theme/presets/canyon.d.ts.map +1 -0
  560. package/dist/theme/presets/cortex.d.ts +3 -0
  561. package/dist/theme/presets/cortex.d.ts.map +1 -0
  562. package/dist/theme/presets/cyber-punk.d.ts +11 -0
  563. package/dist/theme/presets/cyber-punk.d.ts.map +1 -0
  564. package/dist/theme/presets/cyber-strike.d.ts +13 -0
  565. package/dist/theme/presets/cyber-strike.d.ts.map +1 -0
  566. package/dist/theme/presets/cyber-volt.d.ts +12 -0
  567. package/dist/theme/presets/cyber-volt.d.ts.map +1 -0
  568. package/dist/theme/presets/default.d.ts +4 -0
  569. package/dist/theme/presets/default.d.ts.map +1 -0
  570. package/dist/theme/presets/ember.d.ts +12 -0
  571. package/dist/theme/presets/ember.d.ts.map +1 -0
  572. package/dist/theme/presets/helios.d.ts +3 -0
  573. package/dist/theme/presets/helios.d.ts.map +1 -0
  574. package/dist/theme/presets/honey.d.ts +12 -0
  575. package/dist/theme/presets/honey.d.ts.map +1 -0
  576. package/dist/theme/presets/index.d.ts +8 -0
  577. package/dist/theme/presets/index.d.ts.map +1 -0
  578. package/dist/theme/presets/midnight.d.ts +12 -0
  579. package/dist/theme/presets/midnight.d.ts.map +1 -0
  580. package/dist/theme/presets/nirvana.d.ts +16 -0
  581. package/dist/theme/presets/nirvana.d.ts.map +1 -0
  582. package/dist/theme/presets/obsidian.d.ts +3 -0
  583. package/dist/theme/presets/obsidian.d.ts.map +1 -0
  584. package/dist/theme/presets/regal.d.ts +8 -0
  585. package/dist/theme/presets/regal.d.ts.map +1 -0
  586. package/dist/theme/presets/rose-gold.d.ts +12 -0
  587. package/dist/theme/presets/rose-gold.d.ts.map +1 -0
  588. package/dist/theme/presets/slate.d.ts +3 -0
  589. package/dist/theme/presets/slate.d.ts.map +1 -0
  590. package/dist/theme/presets/synapse.d.ts +10 -0
  591. package/dist/theme/presets/synapse.d.ts.map +1 -0
  592. package/dist/theme/presets/tactical.d.ts +8 -0
  593. package/dist/theme/presets/tactical.d.ts.map +1 -0
  594. package/dist/theme/presets/types.d.ts +43 -0
  595. package/dist/theme/presets/types.d.ts.map +1 -0
  596. package/dist/theme/presets/verdant.d.ts +3 -0
  597. package/dist/theme/presets/verdant.d.ts.map +1 -0
  598. package/dist/theme/presets/wave.d.ts +14 -0
  599. package/dist/theme/presets/wave.d.ts.map +1 -0
  600. package/dist/theme/useAvailablePresets.d.ts +16 -0
  601. package/dist/theme/useAvailablePresets.d.ts.map +1 -0
  602. package/dist/types/index.d.ts +1 -1
  603. package/dist/utils/index.d.ts +12 -1
  604. package/dist/utils/index.js +1 -1
  605. package/dist/zustand/index.d.ts +80 -0
  606. package/dist/zustand/index.js +105 -0
  607. package/package.json +53 -2
  608. package/dist/chunk-2YW3LDFT.js +0 -1542
  609. package/dist/theme/presets/cyber-void.js +0 -75
  610. package/dist/{chunk-DVKEEY5J.js → chunk-TUXTSEAF.js} +1 -1
  611. package/dist/{chunk-U2522LSW.js → chunk-V7XHGJQZ.js} +1 -1
@@ -0,0 +1,1437 @@
1
+ import { useAvailablePresets } from '../../chunk-Z2BXCFAG.js';
2
+ import { OrganizationMembershipsList, WebhookUrlDisplayModal, MembershipFeaturePanel, MembershipStatusBadge, getCredentialSchema, OAuthConnectModal, buildCredentialValue } from '../../chunk-JZEXFQ6N.js';
3
+ import '../../chunk-PDHTXPSF.js';
4
+ import { CustomModal } from '../../chunk-GBMNCNHX.js';
5
+ import { PageTitleCaption, EmptyState, CardHeader, ListSkeleton, StatCard } from '../../chunk-AWMZCYKH.js';
6
+ import '../../chunk-NNKKBSJN.js';
7
+ import { AppShellLoader } from '../../chunk-WWEMNIHW.js';
8
+ import '../../chunk-QJ2S46NI.js';
9
+ import { useUserMemberships, useUpdateWebhookEndpoint, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas, showErrorNotification } from '../../chunk-XOTN3X3Z.js';
10
+ import { useResources } from '../../chunk-AQ5MQDSS.js';
11
+ import '../../chunk-NJJ3NQ7B.js';
12
+ import '../../chunk-LXHZYSMQ.js';
13
+ import '../../chunk-MHW43EOH.js';
14
+ import '../../chunk-F6RBK7NJ.js';
15
+ import '../../chunk-ELJIFLCB.js';
16
+ import '../../chunk-L4XXM55J.js';
17
+ import '../../chunk-SLVC5OJ2.js';
18
+ import '../../chunk-RNP5R5I3.js';
19
+ import '../../chunk-I6EVLOP3.js';
20
+ import '../../chunk-JHMJKDVU.js';
21
+ import '../../chunk-SZHARWKU.js';
22
+ import '../../chunk-BX565EOK.js';
23
+ import '../../chunk-ACD2QA6E.js';
24
+ import '../../chunk-R7WLWGPO.js';
25
+ import '../../chunk-NVOCKXUQ.js';
26
+ import '../../chunk-V7XHGJQZ.js';
27
+ import '../../chunk-QJ2KCHKX.js';
28
+ import { formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from '../../chunk-IOKL7BKE.js';
29
+ import '../../chunk-RWQIFKMJ.js';
30
+ import '../../chunk-ALA56RGZ.js';
31
+ import { useInitialization } from '../../chunk-TUXTSEAF.js';
32
+ import '../../chunk-DD3CCMCZ.js';
33
+ import { useElevasisServices } from '../../chunk-QEPXAWE2.js';
34
+ import '../../chunk-BRJ3QZ4E.js';
35
+ import '../../chunk-Q7DJKLEN.js';
36
+ import { Paper, Stack, Group, ThemeIcon, Text, Code, CopyButton, Tooltip, ActionIcon, Button, Alert, useMantineColorScheme, SimpleGrid, UnstyledButton, Card, Title, Badge, TextInput, Switch, Table, Divider, Select, Textarea, Center, Loader, PasswordInput } from '@mantine/core';
37
+ import { IconUser, IconCheck, IconCopy, IconMail, IconRefresh, IconAlertCircle, IconBuilding, IconPalette, IconSun, IconEye, IconSparkles, IconTrendingUp, IconSearch, IconWebhook, IconExclamationMark, IconPencil, IconClock, IconPlayerPause, IconPlayerPlay, IconTrash, IconAlertTriangle, IconPlus, IconActivity, IconUsers, IconSettings, IconBrandDropbox, IconRocket, IconBrandGithub, IconBrandGmail, IconBrandGoogleDrive, IconPlug, IconBrandSlack, IconMoon, IconDeviceDesktop } from '@tabler/icons-react';
38
+ import { notifications } from '@mantine/notifications';
39
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
40
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
41
+ import { useRef, useEffect, useMemo, useState, useCallback } from 'react';
42
+ import { create } from 'zustand';
43
+ import { useForm } from '@mantine/form';
44
+
45
+ // ../core/src/integrations/oauth/provider-registry.ts
46
+ var OAUTH_PROVIDERS = {
47
+ "google-sheets": {
48
+ id: "google-sheets",
49
+ name: "Google Sheets",
50
+ authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
51
+ tokenUrl: "https://oauth2.googleapis.com/token",
52
+ authParams: {
53
+ access_type: "offline",
54
+ // Required for refresh token
55
+ prompt: "consent"
56
+ // Force consent to get refresh token on reconnect
57
+ },
58
+ tokenExchange: "form-encoded",
59
+ scopes: ["https://www.googleapis.com/auth/spreadsheets"]
60
+ },
61
+ dropbox: {
62
+ id: "dropbox",
63
+ name: "Dropbox",
64
+ authUrl: "https://www.dropbox.com/oauth2/authorize",
65
+ tokenUrl: "https://api.dropboxapi.com/oauth2/token",
66
+ authParams: {
67
+ token_access_type: "offline"
68
+ // Required for refresh token
69
+ },
70
+ tokenExchange: "form-encoded",
71
+ scopes: ["files.content.write", "files.content.read", "files.metadata.write"]
72
+ }
73
+ };
74
+ function AccountSettings({
75
+ user,
76
+ userProfile,
77
+ profileLoading,
78
+ onRefetchProfile,
79
+ onNavigate
80
+ }) {
81
+ const { apiRequest } = useElevasisServices();
82
+ const userConfig = userProfile?.config;
83
+ const hasCompletedOnboarding = userConfig?.onboarding?.completed;
84
+ const resetWelcomeFlow = useMutation({
85
+ mutationFn: async () => {
86
+ return apiRequest("/users/me", {
87
+ method: "PATCH",
88
+ body: JSON.stringify({
89
+ config: {
90
+ onboarding: {
91
+ completed: false,
92
+ completedAt: null,
93
+ role: null,
94
+ primaryUseCase: null,
95
+ experienceLevel: null
96
+ }
97
+ }
98
+ })
99
+ });
100
+ },
101
+ onSuccess: async () => {
102
+ notifications.show({
103
+ title: "Welcome Flow Reset",
104
+ message: "Redirecting to the welcome flow...",
105
+ color: "teal"
106
+ });
107
+ await onRefetchProfile();
108
+ onNavigate("/welcome");
109
+ },
110
+ onError: (err) => {
111
+ notifications.show({
112
+ title: "Error",
113
+ message: err instanceof Error ? err.message : "Failed to reset welcome flow",
114
+ color: "red"
115
+ });
116
+ }
117
+ });
118
+ const { data: memberships = [], isLoading, error } = useUserMemberships(user?.id || "");
119
+ const handleEditRole = (_membershipId) => {
120
+ notifications.show({
121
+ title: "Edit Role",
122
+ message: "Role editing functionality coming soon",
123
+ color: "blue"
124
+ });
125
+ };
126
+ const handleLeaveOrganization = (_membershipId) => {
127
+ notifications.show({
128
+ title: "Leave Organization",
129
+ message: "Leave organization functionality coming soon",
130
+ color: "orange"
131
+ });
132
+ };
133
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
134
+ /* @__PURE__ */ jsx(PageTitleCaption, { title: "Account Settings", caption: "Manage your account and organization memberships" }),
135
+ user && /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
136
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
137
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", children: /* @__PURE__ */ jsx(IconUser, { size: 18 }) }),
138
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { flex: 1 }, children: [
139
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Name" }),
140
+ /* @__PURE__ */ jsxs(Text, { size: "lg", fw: 600, style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: [
141
+ user.firstName,
142
+ " ",
143
+ user.lastName
144
+ ] })
145
+ ] }),
146
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
147
+ /* @__PURE__ */ jsx(Code, { children: user.id }),
148
+ /* @__PURE__ */ jsx(CopyButton, { value: user.id, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied!" : "Copy User ID", withArrow: true, position: "top", children: /* @__PURE__ */ jsx(
149
+ ActionIcon,
150
+ {
151
+ color: copied ? "teal" : "gray",
152
+ variant: copied ? "filled" : "subtle",
153
+ onClick: copy,
154
+ size: "sm",
155
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy, { size: 14 })
156
+ }
157
+ ) }) })
158
+ ] })
159
+ ] }),
160
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
161
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: "green", children: /* @__PURE__ */ jsx(IconMail, { size: 18 }) }),
162
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { flex: 1 }, children: [
163
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Email" }),
164
+ /* @__PURE__ */ jsx(Text, { size: "lg", fw: 600, style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: user.email })
165
+ ] })
166
+ ] }),
167
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "center", children: [
168
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
169
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: "teal", children: /* @__PURE__ */ jsx(IconRefresh, { size: 18 }) }),
170
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
171
+ /* @__PURE__ */ jsx(Text, { fw: 600, children: "Welcome Flow" }),
172
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: hasCompletedOnboarding ? "Re-run the onboarding flow to update your preferences" : "You have not completed the welcome flow yet" })
173
+ ] })
174
+ ] }),
175
+ /* @__PURE__ */ jsx(
176
+ Button,
177
+ {
178
+ variant: "light",
179
+ leftSection: profileLoading ? void 0 : /* @__PURE__ */ jsx(IconRefresh, { size: 16 }),
180
+ onClick: () => resetWelcomeFlow.mutate(),
181
+ loading: profileLoading || resetWelcomeFlow.isPending,
182
+ disabled: profileLoading,
183
+ children: profileLoading ? "" : hasCompletedOnboarding ? "Reset & Redo" : "Start"
184
+ }
185
+ )
186
+ ] })
187
+ ] }) }),
188
+ /* @__PURE__ */ jsx(
189
+ OrganizationMembershipsList,
190
+ {
191
+ memberships,
192
+ loading: isLoading,
193
+ error,
194
+ onEditRole: handleEditRole,
195
+ onLeaveOrganization: handleLeaveOrganization
196
+ }
197
+ ),
198
+ error && /* @__PURE__ */ jsxs(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), title: "Error", color: "red", children: [
199
+ "Failed to load organization memberships: ",
200
+ error.message
201
+ ] }),
202
+ !isLoading && !error && memberships.length === 0 && /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(
203
+ EmptyState,
204
+ {
205
+ icon: IconBuilding,
206
+ title: "No Organization Memberships",
207
+ description: "You are not currently a member of any organizations. Contact an administrator to be added to an organization."
208
+ }
209
+ ) })
210
+ ] });
211
+ }
212
+ var useInternalThemeStore = create((set) => ({
213
+ preset: "default",
214
+ colorScheme: "auto",
215
+ setPreset: (preset) => set({ preset }),
216
+ setColorScheme: (colorScheme) => set({ colorScheme }),
217
+ setTheme: (theme) => set(theme)
218
+ }));
219
+
220
+ // src/hooks/operations/settings/useUpdateThemePreference.ts
221
+ var DEBOUNCE_MS = 500;
222
+ function useUpdateThemePreference() {
223
+ const { apiRequest } = useElevasisServices();
224
+ const setTheme = useInternalThemeStore((s) => s.setTheme);
225
+ const timerRef = useRef(null);
226
+ const updateTheme = useCallback(
227
+ (theme) => {
228
+ if (theme.preset !== void 0 && theme.colorScheme !== void 0) {
229
+ setTheme({ preset: theme.preset, colorScheme: theme.colorScheme });
230
+ } else {
231
+ const current = useInternalThemeStore.getState();
232
+ setTheme({
233
+ preset: theme.preset ?? current.preset,
234
+ colorScheme: theme.colorScheme ?? current.colorScheme
235
+ });
236
+ }
237
+ if (timerRef.current) clearTimeout(timerRef.current);
238
+ timerRef.current = setTimeout(async () => {
239
+ try {
240
+ await apiRequest("/users/me", {
241
+ method: "PATCH",
242
+ body: JSON.stringify({ config: { theme } })
243
+ });
244
+ } catch (error) {
245
+ showErrorNotification(error instanceof Error ? error : new Error("Failed to update appearance"));
246
+ }
247
+ }, DEBOUNCE_MS);
248
+ },
249
+ [apiRequest, setTheme]
250
+ );
251
+ return { updateTheme };
252
+ }
253
+ var COLOR_SCHEMES = [
254
+ { value: "light", label: "Light", icon: /* @__PURE__ */ jsx(IconSun, { size: 16 }) },
255
+ { value: "dark", label: "Dark", icon: /* @__PURE__ */ jsx(IconMoon, { size: 16 }) },
256
+ { value: "auto", label: "System", icon: /* @__PURE__ */ jsx(IconDeviceDesktop, { size: 16 }) }
257
+ ];
258
+ function AppearanceSettings({ initialTheme, onThemeChange }) {
259
+ const preset = useInternalThemeStore((s) => s.preset);
260
+ const colorScheme = useInternalThemeStore((s) => s.colorScheme);
261
+ const setInternalTheme = useInternalThemeStore((s) => s.setTheme);
262
+ const { updateTheme } = useUpdateThemePreference();
263
+ const { setColorScheme: setMantineColorScheme } = useMantineColorScheme();
264
+ const availablePresets = useAvailablePresets();
265
+ const hydratedRef = useRef(false);
266
+ if (!hydratedRef.current) {
267
+ setInternalTheme(initialTheme);
268
+ hydratedRef.current = true;
269
+ }
270
+ useEffect(() => {
271
+ if (!hydratedRef.current) return;
272
+ onThemeChange?.({ preset, colorScheme });
273
+ }, [preset, colorScheme]);
274
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
275
+ /* @__PURE__ */ jsx(PageTitleCaption, { title: "Appearance", caption: "Customize how the command center looks" }),
276
+ /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
277
+ /* @__PURE__ */ jsx(
278
+ CardHeader,
279
+ {
280
+ icon: /* @__PURE__ */ jsx(IconPalette, { size: 18 }),
281
+ title: "Theme",
282
+ subtitle: "Choose a color palette for the command center"
283
+ }
284
+ ),
285
+ /* @__PURE__ */ jsx(Stack, { gap: "md", children: /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 2, sm: 3, md: 4 }, children: availablePresets.map((p) => {
286
+ const isActive = p.value === preset;
287
+ return /* @__PURE__ */ jsx(
288
+ UnstyledButton,
289
+ {
290
+ onClick: () => {
291
+ if (!isActive) {
292
+ updateTheme({ preset: p.value, colorScheme });
293
+ }
294
+ },
295
+ children: /* @__PURE__ */ jsx(
296
+ Card,
297
+ {
298
+ style: {
299
+ cursor: "pointer",
300
+ border: isActive ? "var(--active-border)" : "1px solid var(--color-border)",
301
+ backgroundColor: isActive ? "var(--active-background)" : "var(--color-surface)",
302
+ transition: `all var(--duration-fast) var(--easing)`
303
+ },
304
+ children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
305
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "center", children: [
306
+ /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", children: p.label }),
307
+ /* @__PURE__ */ jsx(
308
+ "div",
309
+ {
310
+ style: {
311
+ width: 14,
312
+ height: 14,
313
+ borderRadius: "50%",
314
+ backgroundColor: p.colors[0],
315
+ border: "1px solid var(--color-border)",
316
+ flexShrink: 0
317
+ }
318
+ }
319
+ )
320
+ ] }),
321
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: p.description })
322
+ ] })
323
+ }
324
+ )
325
+ },
326
+ p.value
327
+ );
328
+ }) }) })
329
+ ] }),
330
+ /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
331
+ /* @__PURE__ */ jsx(
332
+ CardHeader,
333
+ {
334
+ icon: /* @__PURE__ */ jsx(IconSun, { size: 18 }),
335
+ title: "Color Scheme",
336
+ subtitle: "Light, dark, or match your system preference"
337
+ }
338
+ ),
339
+ /* @__PURE__ */ jsx(Stack, { gap: "md", children: /* @__PURE__ */ jsx(SimpleGrid, { cols: 3, children: COLOR_SCHEMES.map((s) => {
340
+ const isActive = s.value === colorScheme;
341
+ return /* @__PURE__ */ jsx(
342
+ UnstyledButton,
343
+ {
344
+ onClick: () => {
345
+ if (!isActive) {
346
+ setMantineColorScheme(s.value);
347
+ updateTheme({ preset, colorScheme: s.value });
348
+ }
349
+ },
350
+ style: { borderRadius: "var(--mantine-radius-md)" },
351
+ children: /* @__PURE__ */ jsx(
352
+ Card,
353
+ {
354
+ padding: "md",
355
+ style: {
356
+ cursor: "pointer",
357
+ border: isActive ? "var(--active-border)" : "1px solid var(--color-border)",
358
+ backgroundColor: isActive ? "var(--active-background)" : "var(--color-surface)",
359
+ transition: `all var(--duration-fast) var(--easing)`
360
+ },
361
+ children: /* @__PURE__ */ jsxs(Group, { gap: 6, justify: "center", wrap: "nowrap", children: [
362
+ s.icon,
363
+ /* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", children: s.label }),
364
+ isActive && /* @__PURE__ */ jsx(IconCheck, { size: 14, color: "var(--color-primary)", style: { flexShrink: 0 } })
365
+ ] })
366
+ }
367
+ )
368
+ },
369
+ s.value
370
+ );
371
+ }) }) })
372
+ ] }),
373
+ /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
374
+ /* @__PURE__ */ jsx(
375
+ CardHeader,
376
+ {
377
+ icon: /* @__PURE__ */ jsx(IconEye, { size: 18 }),
378
+ title: "Preview",
379
+ subtitle: "See how common UI elements look with your current theme"
380
+ }
381
+ ),
382
+ /* @__PURE__ */ jsxs(Stack, { gap: "lg", children: [
383
+ /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
384
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Page Layout" }),
385
+ /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
386
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", children: [
387
+ /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
388
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Operations Overview" }),
389
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Monitor recent activity across your workspace" })
390
+ ] }),
391
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
392
+ /* @__PURE__ */ jsx(Button, { variant: "default", size: "xs", children: "Export" }),
393
+ /* @__PURE__ */ jsx(Button, { size: "xs", leftSection: /* @__PURE__ */ jsx(IconSparkles, { size: 14 }), children: "New Workflow" })
394
+ ] })
395
+ ] }),
396
+ /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 1, sm: 3 }, spacing: "sm", children: [
397
+ { label: "Active Workflows", value: "24", trend: "+12%" },
398
+ { label: "Executions Today", value: "1,284", trend: "+8.3%" },
399
+ { label: "Success Rate", value: "98.2%", trend: "+0.4%" }
400
+ ].map((stat) => /* @__PURE__ */ jsx(
401
+ Card,
402
+ {
403
+ padding: "sm",
404
+ withBorder: true,
405
+ style: {
406
+ transition: `all var(--duration-fast) var(--easing)`
407
+ },
408
+ children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
409
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: stat.label }),
410
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-end", wrap: "nowrap", children: [
411
+ /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, children: stat.value }),
412
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "green", leftSection: /* @__PURE__ */ jsx(IconTrendingUp, { size: 10 }), children: stat.trend })
413
+ ] })
414
+ ] })
415
+ },
416
+ stat.label
417
+ )) })
418
+ ] }) })
419
+ ] }),
420
+ /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, md: 2 }, spacing: "md", children: [
421
+ /* @__PURE__ */ jsx(Card, { padding: "md", withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
422
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Buttons" }),
423
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
424
+ /* @__PURE__ */ jsx(Button, { size: "xs", children: "Primary" }),
425
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "light", children: "Light" }),
426
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "outline", children: "Outline" }),
427
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "default", children: "Default" }),
428
+ /* @__PURE__ */ jsx(Button, { size: "xs", variant: "subtle", children: "Subtle" })
429
+ ] })
430
+ ] }) }),
431
+ /* @__PURE__ */ jsx(Card, { padding: "md", withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
432
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Status Badges" }),
433
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
434
+ /* @__PURE__ */ jsx(Badge, { variant: "light", children: "Active" }),
435
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "green", children: "Success" }),
436
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "yellow", children: "Pending" }),
437
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "red", children: "Failed" }),
438
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", children: "Draft" })
439
+ ] })
440
+ ] }) }),
441
+ /* @__PURE__ */ jsx(Card, { padding: "md", withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
442
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Inputs" }),
443
+ /* @__PURE__ */ jsx(TextInput, { placeholder: "Search workflows...", leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 14 }), size: "xs" }),
444
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
445
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: "Enable notifications" }),
446
+ /* @__PURE__ */ jsx(Switch, { defaultChecked: true, size: "sm" })
447
+ ] })
448
+ ] }) }),
449
+ /* @__PURE__ */ jsx(Card, { padding: "md", withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
450
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Typography" }),
451
+ /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
452
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Section Heading" }),
453
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: "The quick brown fox jumps over the lazy dog." }),
454
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Secondary text with dimmed color for less emphasis." }),
455
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
456
+ /* @__PURE__ */ jsx(Text, { span: true, c: "var(--color-primary)", fw: 600, inherit: true, children: "Link" }),
457
+ " ",
458
+ "styled with primary color token."
459
+ ] })
460
+ ] })
461
+ ] }) })
462
+ ] }),
463
+ /* @__PURE__ */ jsx(Card, { padding: "md", withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
464
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Table" }),
465
+ /* @__PURE__ */ jsx(Table.ScrollContainer, { minWidth: 400, children: /* @__PURE__ */ jsxs(Table, { verticalSpacing: "xs", horizontalSpacing: "sm", children: [
466
+ /* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
467
+ /* @__PURE__ */ jsx(Table.Th, { children: "Workflow" }),
468
+ /* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
469
+ /* @__PURE__ */ jsx(Table.Th, { children: "Runs" }),
470
+ /* @__PURE__ */ jsx(Table.Th, { children: "Last Run" })
471
+ ] }) }),
472
+ /* @__PURE__ */ jsx(Table.Tbody, { children: [
473
+ { name: "deal-enrichment", status: "Active", color: "green", runs: "482", last: "2m ago" },
474
+ { name: "ist-campaign-review", status: "Active", color: "green", runs: "156", last: "14m ago" },
475
+ { name: "tomba-email-finder", status: "Paused", color: "yellow", runs: "89", last: "3h ago" }
476
+ ].map((row) => /* @__PURE__ */ jsxs(Table.Tr, { children: [
477
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", ff: "monospace", children: row.name }) }),
478
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: row.color, size: "xs", children: row.status }) }),
479
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", children: row.runs }) }),
480
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: row.last }) })
481
+ ] }, row.name)) })
482
+ ] }) })
483
+ ] }) }),
484
+ /* @__PURE__ */ jsx(Divider, {}),
485
+ /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
486
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, children: "Alerts" }),
487
+ /* @__PURE__ */ jsx(Alert, { variant: "light", color: "blue", icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), title: "Informational", children: "This is how informational alerts look with your current theme." }),
488
+ /* @__PURE__ */ jsx(Alert, { variant: "light", color: "green", icon: /* @__PURE__ */ jsx(IconCheck, { size: 16 }), title: "Success", children: "Operation completed successfully." })
489
+ ] })
490
+ ] })
491
+ ] })
492
+ ] });
493
+ }
494
+ function EditWebhookEndpointModal({ opened, endpoint, onClose }) {
495
+ const updateEndpoint = useUpdateWebhookEndpoint();
496
+ const { data: resourcesData } = useResources();
497
+ const resourceOptions = useMemo(() => {
498
+ if (!resourcesData) return [];
499
+ const workflowOptions = (resourcesData.workflows || []).filter((w) => w?.resourceId).map((w) => ({
500
+ value: w.resourceId,
501
+ label: `Workflow: ${w.resourceId}`
502
+ }));
503
+ const agentOptions = (resourcesData.agents || []).filter((a) => a?.resourceId).map((a) => ({
504
+ value: a.resourceId,
505
+ label: `Agent: ${a.resourceId}`
506
+ }));
507
+ return [...workflowOptions, ...agentOptions];
508
+ }, [resourcesData]);
509
+ const form = useForm({
510
+ initialValues: {
511
+ name: "",
512
+ resourceId: ""
513
+ },
514
+ validate: {
515
+ name: (value) => {
516
+ if (!value.trim()) return "Name is required";
517
+ if (value.trim().length < 2) return "Name must be at least 2 characters";
518
+ if (value.trim().length > 100) return "Name must be less than 100 characters";
519
+ return null;
520
+ }
521
+ }
522
+ });
523
+ useEffect(() => {
524
+ if (endpoint && opened) {
525
+ form.setValues({
526
+ name: endpoint.name,
527
+ resourceId: endpoint.resourceId ?? ""
528
+ });
529
+ }
530
+ }, [endpoint, opened]);
531
+ const handleSubmit = async (values) => {
532
+ if (!endpoint) return;
533
+ try {
534
+ await updateEndpoint.mutateAsync({
535
+ endpointId: endpoint.id,
536
+ data: {
537
+ name: values.name.trim(),
538
+ resourceId: values.resourceId || void 0
539
+ }
540
+ });
541
+ onClose();
542
+ } catch (error) {
543
+ console.error("Failed to update webhook endpoint:", error);
544
+ }
545
+ };
546
+ const handleClose = () => {
547
+ if (!updateEndpoint.isPending) {
548
+ onClose();
549
+ }
550
+ };
551
+ return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "md", loading: updateEndpoint.isPending, children: /* @__PURE__ */ jsx("form", { onSubmit: form.onSubmit(handleSubmit), children: /* @__PURE__ */ jsxs(Stack, { children: [
552
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Edit Webhook Endpoint" }),
553
+ /* @__PURE__ */ jsx(
554
+ TextInput,
555
+ {
556
+ label: "Name",
557
+ description: "A descriptive label for this endpoint",
558
+ leftSection: /* @__PURE__ */ jsx(IconWebhook, { size: 16 }),
559
+ required: true,
560
+ ...form.getInputProps("name"),
561
+ disabled: updateEndpoint.isPending
562
+ }
563
+ ),
564
+ /* @__PURE__ */ jsx(
565
+ Select,
566
+ {
567
+ label: "Target Resource",
568
+ description: "The workflow or agent to trigger on each inbound request",
569
+ placeholder: resourcesData ? "Select a workflow or agent" : "Loading resources...",
570
+ data: resourceOptions,
571
+ searchable: true,
572
+ clearable: true,
573
+ ...form.getInputProps("resourceId"),
574
+ disabled: !resourcesData || updateEndpoint.isPending
575
+ }
576
+ ),
577
+ updateEndpoint.error && /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconExclamationMark, { size: 16 }), color: "red", children: updateEndpoint.error instanceof Error ? updateEndpoint.error.message : "An error occurred while updating the webhook endpoint" }),
578
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "sm", children: [
579
+ /* @__PURE__ */ jsx(Button, { variant: "subtle", onClick: handleClose, disabled: updateEndpoint.isPending, children: "Cancel" }),
580
+ /* @__PURE__ */ jsx(Button, { type: "submit", loading: updateEndpoint.isPending, leftSection: /* @__PURE__ */ jsx(IconPencil, { size: 16 }), children: "Save Changes" })
581
+ ] })
582
+ ] }) }) });
583
+ }
584
+ function getWebhookUrl(apiUrl, key) {
585
+ return `${apiUrl}/api/webhooks/inbound/${key}`;
586
+ }
587
+ function WebhookEndpointList({ endpoints, isLoading, apiUrl }) {
588
+ const [deleteTarget, setDeleteTarget] = useState(null);
589
+ const [editTarget, setEditTarget] = useState(null);
590
+ const deleteMutation = useDeleteWebhookEndpoint();
591
+ const updateMutation = useUpdateWebhookEndpoint();
592
+ const handleDelete = () => {
593
+ if (deleteTarget) {
594
+ deleteMutation.mutate(deleteTarget.id);
595
+ setDeleteTarget(null);
596
+ }
597
+ };
598
+ const handleCloseDelete = () => {
599
+ if (!deleteMutation.isPending) {
600
+ setDeleteTarget(null);
601
+ }
602
+ };
603
+ const handleToggleStatus = (endpoint) => {
604
+ const newStatus = endpoint.status === "active" ? "paused" : "active";
605
+ updateMutation.mutate({ endpointId: endpoint.id, data: { status: newStatus } });
606
+ };
607
+ if (isLoading) {
608
+ return /* @__PURE__ */ jsx(ListSkeleton, { rows: 3, rowHeight: 50 });
609
+ }
610
+ if (endpoints.length === 0) {
611
+ return /* @__PURE__ */ jsx(
612
+ EmptyState,
613
+ {
614
+ icon: IconWebhook,
615
+ title: "No webhook endpoints yet",
616
+ description: "Create your first webhook endpoint to let third-party apps trigger your resources"
617
+ }
618
+ );
619
+ }
620
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
621
+ /* @__PURE__ */ jsxs(Table, { children: [
622
+ /* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
623
+ /* @__PURE__ */ jsx(Table.Th, { children: "Name" }),
624
+ /* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
625
+ /* @__PURE__ */ jsx(Table.Th, { children: "Target Resource" }),
626
+ /* @__PURE__ */ jsx(Table.Th, { children: "URL" }),
627
+ /* @__PURE__ */ jsx(Table.Th, { children: "Last Triggered" }),
628
+ /* @__PURE__ */ jsx(Table.Th, { children: "Requests" }),
629
+ /* @__PURE__ */ jsx(Table.Th, { w: 120 })
630
+ ] }) }),
631
+ /* @__PURE__ */ jsx(Table.Tbody, { children: endpoints.map((endpoint) => {
632
+ const webhookUrl = getWebhookUrl(apiUrl, endpoint.key);
633
+ const truncatedUrl = webhookUrl.length > 50 ? `...${endpoint.key.slice(-16)}` : webhookUrl;
634
+ const isToggling = updateMutation.isPending;
635
+ return /* @__PURE__ */ jsxs(Table.Tr, { children: [
636
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
637
+ /* @__PURE__ */ jsx(IconWebhook, { size: 16, style: { opacity: 0.6 } }),
638
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
639
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: endpoint.name }),
640
+ endpoint.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: endpoint.description })
641
+ ] })
642
+ ] }) }),
643
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { color: endpoint.status === "active" ? "teal" : "gray", variant: "light", children: endpoint.status }) }),
644
+ /* @__PURE__ */ jsx(Table.Td, { children: endpoint.resourceId ? /* @__PURE__ */ jsx(Code, { children: endpoint.resourceId }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "Not configured" }) }),
645
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Paper, { withBorder: true, style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
646
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", ff: "monospace", style: { userSelect: "all" }, children: truncatedUrl }),
647
+ /* @__PURE__ */ jsx(CopyButton, { value: webhookUrl, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied!" : "Copy URL", position: "top", children: /* @__PURE__ */ jsx(
648
+ ActionIcon,
649
+ {
650
+ color: copied ? "teal" : "gray",
651
+ variant: copied ? "filled" : "subtle",
652
+ onClick: copy,
653
+ size: "sm",
654
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 12 }) : /* @__PURE__ */ jsx(IconCopy, { size: 12 })
655
+ }
656
+ ) }) })
657
+ ] }) }),
658
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
659
+ /* @__PURE__ */ jsx(IconClock, { size: 14, style: { opacity: 0.5 } }),
660
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: formatDateTime(endpoint.lastTriggeredAt) })
661
+ ] }) }),
662
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", children: endpoint.requestCount.toLocaleString() }) }),
663
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", justify: "flex-end", children: [
664
+ /* @__PURE__ */ jsx(Tooltip, { label: "Edit endpoint", position: "left", children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "blue", onClick: () => setEditTarget(endpoint), children: /* @__PURE__ */ jsx(IconPencil, { size: 16 }) }) }),
665
+ /* @__PURE__ */ jsx(
666
+ Tooltip,
667
+ {
668
+ label: endpoint.status === "active" ? "Pause endpoint" : "Resume endpoint",
669
+ position: "left",
670
+ children: /* @__PURE__ */ jsx(
671
+ ActionIcon,
672
+ {
673
+ variant: "subtle",
674
+ color: endpoint.status === "active" ? "yellow" : "teal",
675
+ onClick: () => handleToggleStatus(endpoint),
676
+ disabled: isToggling,
677
+ children: endpoint.status === "active" ? /* @__PURE__ */ jsx(IconPlayerPause, { size: 16 }) : /* @__PURE__ */ jsx(IconPlayerPlay, { size: 16 })
678
+ }
679
+ )
680
+ }
681
+ ),
682
+ /* @__PURE__ */ jsx(Tooltip, { label: "Delete endpoint", position: "left", children: /* @__PURE__ */ jsx(
683
+ ActionIcon,
684
+ {
685
+ variant: "subtle",
686
+ color: "red",
687
+ onClick: () => setDeleteTarget(endpoint),
688
+ disabled: deleteMutation.isPending,
689
+ children: /* @__PURE__ */ jsx(IconTrash, { size: 16 })
690
+ }
691
+ ) })
692
+ ] }) })
693
+ ] }, endpoint.id);
694
+ }) })
695
+ ] }),
696
+ /* @__PURE__ */ jsx(EditWebhookEndpointModal, { opened: !!editTarget, endpoint: editTarget, onClose: () => setEditTarget(null) }),
697
+ /* @__PURE__ */ jsx(CustomModal, { opened: !!deleteTarget, onClose: handleCloseDelete, size: "md", loading: deleteMutation.isPending, children: /* @__PURE__ */ jsxs(Stack, { children: [
698
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
699
+ /* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, color: "var(--color-error)" }),
700
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Delete Webhook Endpoint" })
701
+ ] }),
702
+ /* @__PURE__ */ jsxs(Text, { size: "sm", children: [
703
+ "Are you sure you want to delete",
704
+ " ",
705
+ /* @__PURE__ */ jsxs(Text, { span: true, fw: 600, children: [
706
+ '"',
707
+ deleteTarget?.name,
708
+ '"'
709
+ ] }),
710
+ "?"
711
+ ] }),
712
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone. Any third-party apps posting to this URL will receive a 404. The URL and its key will be permanently revoked." }),
713
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "sm", children: [
714
+ /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleCloseDelete, disabled: deleteMutation.isPending, children: "Cancel" }),
715
+ /* @__PURE__ */ jsx(
716
+ Button,
717
+ {
718
+ color: "red",
719
+ onClick: handleDelete,
720
+ loading: deleteMutation.isPending,
721
+ leftSection: /* @__PURE__ */ jsx(IconTrash, { size: 16 }),
722
+ children: "Delete Endpoint"
723
+ }
724
+ )
725
+ ] })
726
+ ] }) })
727
+ ] });
728
+ }
729
+ function CreateWebhookEndpointModal({ opened, onClose, onSuccess }) {
730
+ const createEndpoint = useCreateWebhookEndpoint();
731
+ const { data: resourcesData } = useResources();
732
+ const resourceOptions = useMemo(() => {
733
+ if (!resourcesData) return [];
734
+ const workflowOptions = (resourcesData.workflows || []).filter((w) => w?.resourceId).map((w) => ({
735
+ value: w.resourceId,
736
+ label: `Workflow: ${w.resourceId}`
737
+ }));
738
+ const agentOptions = (resourcesData.agents || []).filter((a) => a?.resourceId).map((a) => ({
739
+ value: a.resourceId,
740
+ label: `Agent: ${a.resourceId}`
741
+ }));
742
+ return [...workflowOptions, ...agentOptions];
743
+ }, [resourcesData]);
744
+ const form = useForm({
745
+ initialValues: {
746
+ name: "",
747
+ resourceId: "",
748
+ description: ""
749
+ },
750
+ validate: {
751
+ name: (value) => {
752
+ if (!value.trim()) return "Name is required";
753
+ if (value.trim().length < 2) return "Name must be at least 2 characters";
754
+ if (value.trim().length > 100) return "Name must be less than 100 characters";
755
+ return null;
756
+ }
757
+ }
758
+ });
759
+ const handleSubmit = async (values) => {
760
+ try {
761
+ const result = await createEndpoint.mutateAsync({
762
+ name: values.name.trim(),
763
+ ...values.resourceId ? { resourceId: values.resourceId } : {},
764
+ ...values.description.trim() ? { description: values.description.trim() } : {}
765
+ });
766
+ form.reset();
767
+ onSuccess(result);
768
+ } catch (error) {
769
+ console.error("Failed to create webhook endpoint:", error);
770
+ }
771
+ };
772
+ const handleClose = () => {
773
+ if (!createEndpoint.isPending) {
774
+ form.reset();
775
+ onClose();
776
+ }
777
+ };
778
+ return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "md", loading: createEndpoint.isPending, children: /* @__PURE__ */ jsx("form", { onSubmit: form.onSubmit(handleSubmit), children: /* @__PURE__ */ jsxs(Stack, { children: [
779
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Create Webhook Endpoint" }),
780
+ /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconExclamationMark, { size: 16 }), color: "blue", children: "A unique URL will be generated that any third-party app can POST to, triggering your target resource. The URL contains a secret key \u2014 treat it like a credential." }),
781
+ /* @__PURE__ */ jsx(
782
+ TextInput,
783
+ {
784
+ label: "Name",
785
+ description: "A descriptive label for this endpoint",
786
+ placeholder: "e.g., Zapier Lead Intake, Typeform Responses",
787
+ leftSection: /* @__PURE__ */ jsx(IconWebhook, { size: 16 }),
788
+ required: true,
789
+ ...form.getInputProps("name"),
790
+ disabled: createEndpoint.isPending
791
+ }
792
+ ),
793
+ /* @__PURE__ */ jsx(
794
+ Select,
795
+ {
796
+ label: "Target Resource",
797
+ description: "The workflow or agent to trigger on each inbound request (can be set later)",
798
+ placeholder: resourcesData ? "Select a workflow or agent" : "Loading resources...",
799
+ data: resourceOptions,
800
+ searchable: true,
801
+ clearable: true,
802
+ ...form.getInputProps("resourceId"),
803
+ disabled: !resourcesData || createEndpoint.isPending
804
+ }
805
+ ),
806
+ /* @__PURE__ */ jsx(
807
+ Textarea,
808
+ {
809
+ label: "Description",
810
+ description: "Optional notes about what this endpoint is for",
811
+ placeholder: "e.g., Receives new lead submissions from Zapier",
812
+ rows: 3,
813
+ ...form.getInputProps("description"),
814
+ disabled: createEndpoint.isPending
815
+ }
816
+ ),
817
+ createEndpoint.error && /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconExclamationMark, { size: 16 }), color: "red", children: createEndpoint.error instanceof Error ? createEndpoint.error.message : "An error occurred while creating the webhook endpoint" }),
818
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "sm", children: [
819
+ /* @__PURE__ */ jsx(Button, { variant: "subtle", onClick: handleClose, disabled: createEndpoint.isPending, children: "Cancel" }),
820
+ /* @__PURE__ */ jsx(Button, { type: "submit", loading: createEndpoint.isPending, leftSection: /* @__PURE__ */ jsx(IconWebhook, { size: 16 }), children: "Create Endpoint" })
821
+ ] })
822
+ ] }) }) });
823
+ }
824
+ function getWebhookUrl2(apiUrl, key) {
825
+ return `${apiUrl}/api/webhooks/inbound/${key}`;
826
+ }
827
+ function WebhookEndpointSettings({ apiUrl }) {
828
+ const { organizationReady } = useInitialization();
829
+ const [showCreateModal, setShowCreateModal] = useState(false);
830
+ const [newEndpoint, setNewEndpoint] = useState(null);
831
+ const { data: endpoints = [], isLoading } = useListWebhookEndpoints();
832
+ if (!organizationReady) return /* @__PURE__ */ jsx(AppShellLoader, {});
833
+ const handleEndpointCreated = (endpoint) => {
834
+ setNewEndpoint(endpoint);
835
+ setShowCreateModal(false);
836
+ };
837
+ const activeCount = endpoints.filter((e) => e.status === "active").length;
838
+ const totalRequests = endpoints.reduce((sum, e) => sum + e.requestCount, 0);
839
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
840
+ /* @__PURE__ */ jsx(
841
+ PageTitleCaption,
842
+ {
843
+ title: "Webhooks",
844
+ caption: "Create webhook URLs that third-party apps can send data to, triggering your resources.",
845
+ rightSection: /* @__PURE__ */ jsx(Button, { leftSection: /* @__PURE__ */ jsx(IconPlus, { size: 16 }), onClick: () => setShowCreateModal(true), variant: "light", children: "Create Endpoint" })
846
+ }
847
+ ),
848
+ /* @__PURE__ */ jsxs(SimpleGrid, { cols: 2, children: [
849
+ /* @__PURE__ */ jsx(
850
+ StatCard,
851
+ {
852
+ variant: "hero",
853
+ icon: IconWebhook,
854
+ value: activeCount,
855
+ label: "Active Endpoints",
856
+ isLoading
857
+ }
858
+ ),
859
+ /* @__PURE__ */ jsx(
860
+ StatCard,
861
+ {
862
+ variant: "hero",
863
+ icon: IconActivity,
864
+ value: totalRequests,
865
+ label: "Total Requests",
866
+ isLoading
867
+ }
868
+ )
869
+ ] }),
870
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(WebhookEndpointList, { endpoints, isLoading, apiUrl }) }),
871
+ /* @__PURE__ */ jsx(
872
+ CreateWebhookEndpointModal,
873
+ {
874
+ opened: showCreateModal,
875
+ onClose: () => setShowCreateModal(false),
876
+ onSuccess: handleEndpointCreated
877
+ }
878
+ ),
879
+ newEndpoint && /* @__PURE__ */ jsx(
880
+ WebhookUrlDisplayModal,
881
+ {
882
+ opened: true,
883
+ endpoint: newEndpoint,
884
+ webhookUrl: getWebhookUrl2(apiUrl, newEndpoint.key),
885
+ onClose: () => setNewEndpoint(null)
886
+ }
887
+ )
888
+ ] });
889
+ }
890
+ function MemberConfigModal({ opened, onClose, member }) {
891
+ const [localConfig, setLocalConfig] = useState(void 0);
892
+ const mutation = useUpdateMemberConfig();
893
+ useEffect(() => {
894
+ if (member) {
895
+ setLocalConfig(member.config);
896
+ }
897
+ }, [member]);
898
+ useEffect(() => {
899
+ if (!opened) {
900
+ setLocalConfig(void 0);
901
+ }
902
+ }, [opened]);
903
+ if (!member) return null;
904
+ const handleSave = async () => {
905
+ if (!localConfig) {
906
+ onClose();
907
+ return;
908
+ }
909
+ try {
910
+ await mutation.mutateAsync({
911
+ membershipId: member.id,
912
+ config: localConfig
913
+ });
914
+ onClose();
915
+ } catch {
916
+ }
917
+ };
918
+ const handleClose = () => {
919
+ if (!mutation.isPending) {
920
+ onClose();
921
+ }
922
+ };
923
+ return /* @__PURE__ */ jsx(CustomModal, { opened, onClose: handleClose, size: "md", loading: mutation.isPending, children: /* @__PURE__ */ jsxs(Stack, { children: [
924
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Configure Member Access" }),
925
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
926
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: member.name }),
927
+ /* @__PURE__ */ jsx(Badge, { variant: "light", size: "sm", children: member.role })
928
+ ] }),
929
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: member.email }),
930
+ /* @__PURE__ */ jsx(
931
+ MembershipFeaturePanel,
932
+ {
933
+ currentConfig: localConfig ?? member.config,
934
+ onConfigChange: (newConfig) => setLocalConfig(newConfig),
935
+ disabled: mutation.isPending
936
+ }
937
+ ),
938
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", mt: "md", children: [
939
+ /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleClose, disabled: mutation.isPending, children: "Cancel" }),
940
+ /* @__PURE__ */ jsx(Button, { onClick: handleSave, loading: mutation.isPending, children: "Save Changes" })
941
+ ] })
942
+ ] }) });
943
+ }
944
+ function transformMemberForModal(member) {
945
+ const firstName = member.user?.firstName || "";
946
+ const lastName = member.user?.lastName || "";
947
+ const name = firstName && lastName ? `${firstName} ${lastName}` : member.user?.email || "Unknown User";
948
+ return {
949
+ id: member.id,
950
+ name,
951
+ email: member.user?.email || "Unknown",
952
+ role: member.role.slug,
953
+ config: member.config
954
+ };
955
+ }
956
+ function OrgMembersList({ orgId }) {
957
+ const { data: members, isLoading, error } = useOrganizationMembers(orgId);
958
+ const [selectedMember, setSelectedMember] = useState(null);
959
+ const [modalOpened, setModalOpened] = useState(false);
960
+ const handleConfigClick = (member) => {
961
+ setSelectedMember(member);
962
+ setModalOpened(true);
963
+ };
964
+ const handleModalClose = () => {
965
+ setModalOpened(false);
966
+ setSelectedMember(null);
967
+ };
968
+ if (isLoading) {
969
+ return /* @__PURE__ */ jsx(Center, { py: "xl", children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "sm", children: [
970
+ /* @__PURE__ */ jsx(Loader, { size: "md" }),
971
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Loading members..." })
972
+ ] }) });
973
+ }
974
+ if (error) {
975
+ return /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), title: "Error loading members", color: "red", variant: "light", children: error.message || "Failed to load organization members. Please try again." });
976
+ }
977
+ if (!members || members.length === 0) {
978
+ return /* @__PURE__ */ jsx(EmptyState, { icon: IconUsers, title: "No members found" });
979
+ }
980
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
981
+ /* @__PURE__ */ jsx(Table.ScrollContainer, { minWidth: 500, children: /* @__PURE__ */ jsxs(Table, { children: [
982
+ /* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
983
+ /* @__PURE__ */ jsx(Table.Th, { children: "Name" }),
984
+ /* @__PURE__ */ jsx(Table.Th, { children: "Email" }),
985
+ /* @__PURE__ */ jsx(Table.Th, { children: "Role" }),
986
+ /* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
987
+ /* @__PURE__ */ jsx(Table.Th, { children: "Actions" })
988
+ ] }) }),
989
+ /* @__PURE__ */ jsx(Table.Tbody, { children: members.map((member) => {
990
+ const firstName = member.user?.firstName || "";
991
+ const lastName = member.user?.lastName || "";
992
+ const displayName = firstName && lastName ? `${firstName} ${lastName}` : member.user?.email || "Unknown User";
993
+ return /* @__PURE__ */ jsxs(Table.Tr, { children: [
994
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, size: "sm", children: displayName }) }),
995
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: member.user?.email || "Unknown" }) }),
996
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: "blue", size: "sm", children: member.role.slug }) }),
997
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(MembershipStatusBadge, { status: member.status }) }),
998
+ /* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Group, { gap: "xs", children: /* @__PURE__ */ jsx(
999
+ ActionIcon,
1000
+ {
1001
+ variant: "light",
1002
+ size: "sm",
1003
+ color: "gray",
1004
+ onClick: () => handleConfigClick(member),
1005
+ title: "Configure member access",
1006
+ children: /* @__PURE__ */ jsx(IconSettings, { size: 14 })
1007
+ }
1008
+ ) }) })
1009
+ ] }, member.id);
1010
+ }) })
1011
+ ] }) }),
1012
+ /* @__PURE__ */ jsx(
1013
+ MemberConfigModal,
1014
+ {
1015
+ opened: modalOpened,
1016
+ onClose: handleModalClose,
1017
+ member: selectedMember ? transformMemberForModal(selectedMember) : null
1018
+ }
1019
+ )
1020
+ ] });
1021
+ }
1022
+ function OrganizationSettings({ user, currentMembership, isOrgAdmin }) {
1023
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1024
+ /* @__PURE__ */ jsx(PageTitleCaption, { title: "Organization Settings", caption: "Manage your current organization" }),
1025
+ currentMembership?.organization && /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
1026
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1027
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: "green", children: /* @__PURE__ */ jsx(IconBuilding, { size: 18 }) }),
1028
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { flex: 1 }, children: [
1029
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Current Organization" }),
1030
+ /* @__PURE__ */ jsx(Text, { size: "lg", fw: 600, style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: currentMembership.organization.name })
1031
+ ] }),
1032
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1033
+ /* @__PURE__ */ jsx(Code, { children: currentMembership.organization.id }),
1034
+ /* @__PURE__ */ jsx(CopyButton, { value: currentMembership.organization.id, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied!" : "Copy ID", withArrow: true, position: "top", children: /* @__PURE__ */ jsx(
1035
+ ActionIcon,
1036
+ {
1037
+ color: copied ? "teal" : "gray",
1038
+ variant: copied ? "filled" : "subtle",
1039
+ onClick: copy,
1040
+ size: "sm",
1041
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy, { size: 14 })
1042
+ }
1043
+ ) }) })
1044
+ ] })
1045
+ ] }),
1046
+ user && /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1047
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: "blue", children: /* @__PURE__ */ jsx(IconUsers, { size: 18 }) }),
1048
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, style: { flex: 1 }, children: [
1049
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Signed in as" }),
1050
+ /* @__PURE__ */ jsxs(Text, { size: "lg", fw: 600, style: { fontFamily: "var(--elevasis-font-family-subtitle)" }, children: [
1051
+ user.firstName,
1052
+ " ",
1053
+ user.lastName,
1054
+ " \u2022 ",
1055
+ user.email
1056
+ ] })
1057
+ ] }),
1058
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1059
+ /* @__PURE__ */ jsx(Code, { children: currentMembership.userId }),
1060
+ /* @__PURE__ */ jsx(CopyButton, { value: currentMembership.userId, timeout: 2e3, children: ({ copied, copy }) => /* @__PURE__ */ jsx(Tooltip, { label: copied ? "Copied!" : "Copy User ID", withArrow: true, position: "top", children: /* @__PURE__ */ jsx(
1061
+ ActionIcon,
1062
+ {
1063
+ color: copied ? "teal" : "gray",
1064
+ variant: copied ? "filled" : "subtle",
1065
+ onClick: copy,
1066
+ size: "sm",
1067
+ children: copied ? /* @__PURE__ */ jsx(IconCheck, { size: 14 }) : /* @__PURE__ */ jsx(IconCopy, { size: 14 })
1068
+ }
1069
+ ) }) })
1070
+ ] })
1071
+ ] })
1072
+ ] }) }),
1073
+ isOrgAdmin && currentMembership?.organization && /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
1074
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "Manage Members" }),
1075
+ /* @__PURE__ */ jsx(Text, { c: "dimmed", size: "sm", children: "Configure feature access for organization members." }),
1076
+ /* @__PURE__ */ jsx(OrgMembersList, { orgId: currentMembership.organization.id })
1077
+ ] }) })
1078
+ ] });
1079
+ }
1080
+ function useOAuthFlow({ apiUrl }) {
1081
+ const [isAuthorizing, setIsAuthorizing] = useState(false);
1082
+ const [error, setError] = useState(null);
1083
+ const { organizationId, isReady } = useElevasisServices();
1084
+ const authorize = useCallback(
1085
+ async (provider, credentialName) => {
1086
+ if (!isReady || !organizationId) {
1087
+ setError("Organization context not ready");
1088
+ return;
1089
+ }
1090
+ setIsAuthorizing(true);
1091
+ setError(null);
1092
+ try {
1093
+ const authorizeUrl = new URL(`${apiUrl}/api/oauth/authorize/${provider}`);
1094
+ authorizeUrl.searchParams.set("credentialName", credentialName);
1095
+ authorizeUrl.searchParams.set("organizationId", organizationId);
1096
+ const width = 600;
1097
+ const height = 700;
1098
+ const left = Math.round(window.screen.width / 2 - width / 2);
1099
+ const top = Math.round(window.screen.height / 2 - height / 2);
1100
+ const popup = window.open(
1101
+ authorizeUrl.toString(),
1102
+ `oauth-${provider}`,
1103
+ `width=${width},height=${height},left=${left},top=${top}`
1104
+ );
1105
+ if (!popup) {
1106
+ throw new Error("popup_blocked");
1107
+ }
1108
+ await waitForOAuthCallback(popup);
1109
+ } catch (err) {
1110
+ const rawError = err instanceof Error ? err.message : "unknown";
1111
+ if (rawError.includes("popup_blocked")) {
1112
+ setError("Please enable popups and try again");
1113
+ } else if (rawError.includes("cancelled")) {
1114
+ setError("Authorization cancelled");
1115
+ } else if (rawError.includes("timeout")) {
1116
+ setError("Authorization timed out. Please try again.");
1117
+ } else if (rawError.includes("token_exchange_failed")) {
1118
+ setError("Failed to obtain access token. Please try again.");
1119
+ } else if (rawError.includes("invalid_state")) {
1120
+ setError("Security validation failed. Please try again.");
1121
+ } else if (rawError.includes("state_expired")) {
1122
+ setError("Authorization expired. Please try again.");
1123
+ } else {
1124
+ setError(`Failed to connect: ${rawError}`);
1125
+ }
1126
+ throw err;
1127
+ } finally {
1128
+ setIsAuthorizing(false);
1129
+ }
1130
+ },
1131
+ [isReady, organizationId, apiUrl]
1132
+ );
1133
+ const waitForOAuthCallback = (popup) => {
1134
+ return new Promise((resolve, reject) => {
1135
+ const messageHandler = (event) => {
1136
+ const expectedOrigin = window.location.origin;
1137
+ if (event.origin !== expectedOrigin) {
1138
+ return;
1139
+ }
1140
+ if (event.data.type === "oauth-complete") {
1141
+ cleanup();
1142
+ if (event.data.status === "success") {
1143
+ resolve();
1144
+ } else {
1145
+ reject(new Error(event.data.error || "oauth_failed"));
1146
+ }
1147
+ }
1148
+ };
1149
+ window.addEventListener("message", messageHandler);
1150
+ const checkClosed = setInterval(() => {
1151
+ if (popup.closed) {
1152
+ cleanup();
1153
+ reject(new Error("cancelled"));
1154
+ }
1155
+ }, OAUTH_POPUP_CHECK_INTERVAL);
1156
+ const timeout = setTimeout(() => {
1157
+ cleanup();
1158
+ popup.close();
1159
+ reject(new Error("timeout"));
1160
+ }, OAUTH_FLOW_TIMEOUT);
1161
+ const cleanup = () => {
1162
+ clearInterval(checkClosed);
1163
+ clearTimeout(timeout);
1164
+ window.removeEventListener("message", messageHandler);
1165
+ };
1166
+ });
1167
+ };
1168
+ return { authorize, isAuthorizing, error };
1169
+ }
1170
+ function EditCredentialModal({ apiUrl, credential, onClose }) {
1171
+ const [credentialName, setCredentialName] = useState("");
1172
+ const [nameError, setNameError] = useState(null);
1173
+ const [fieldValues, setFieldValues] = useState({});
1174
+ const { authorize, isAuthorizing, error: oauthError } = useOAuthFlow({ apiUrl });
1175
+ const updateMutation = useUpdateCredential();
1176
+ useEffect(() => {
1177
+ if (credential) {
1178
+ setCredentialName(credential.name);
1179
+ }
1180
+ }, [credential]);
1181
+ if (!credential) return null;
1182
+ const credentialType = credential.type || "api-key";
1183
+ const schema = getCredentialSchema(credentialType);
1184
+ const provider = credential.provider;
1185
+ const isOAuth = !!provider || schema.type === "oauth";
1186
+ const hasMetadataChanged = credentialName !== credential.name;
1187
+ const isPending = isAuthorizing || updateMutation.isPending;
1188
+ const handleClose = () => {
1189
+ if (!isPending) {
1190
+ onClose();
1191
+ }
1192
+ };
1193
+ const handleOAuthReconnect = async () => {
1194
+ if (!provider) return;
1195
+ try {
1196
+ await authorize(provider, credential.name);
1197
+ onClose();
1198
+ } catch (err) {
1199
+ console.error("Reconnect failed:", err);
1200
+ }
1201
+ };
1202
+ const handleSaveChanges = async () => {
1203
+ const nameValidation = CredentialSchemas.UpdateRequest.shape.name.safeParse(credentialName);
1204
+ if (!nameValidation.success) {
1205
+ setNameError(nameValidation.error.issues[0]?.message || "Invalid credential name");
1206
+ return;
1207
+ }
1208
+ setNameError(null);
1209
+ const updateData = { name: credentialName };
1210
+ const validationResult = CredentialSchemas.UpdateRequest.safeParse(updateData);
1211
+ if (!validationResult.success) {
1212
+ console.error("Validation failed:", validationResult.error);
1213
+ return;
1214
+ }
1215
+ try {
1216
+ await updateMutation.mutateAsync({
1217
+ credentialId: credential.id,
1218
+ updates: updateData
1219
+ });
1220
+ onClose();
1221
+ } catch (err) {
1222
+ console.error("Save changes failed:", err);
1223
+ }
1224
+ };
1225
+ const handleCredentialUpdate = async () => {
1226
+ const hasValues = Object.values(fieldValues).some((v) => v.trim());
1227
+ if (!hasValues) return;
1228
+ try {
1229
+ const credentialValue = buildCredentialValue(credentialType, fieldValues);
1230
+ const updateData = { value: credentialValue };
1231
+ const validationResult = CredentialSchemas.UpdateRequest.safeParse(updateData);
1232
+ if (!validationResult.success) {
1233
+ console.error("Validation failed:", validationResult.error);
1234
+ return;
1235
+ }
1236
+ await updateMutation.mutateAsync({
1237
+ credentialId: credential.id,
1238
+ updates: updateData
1239
+ });
1240
+ onClose();
1241
+ } catch (err) {
1242
+ console.error("Update failed:", err);
1243
+ }
1244
+ };
1245
+ const handleFieldChange = (key, value) => {
1246
+ setFieldValues((prev) => ({ ...prev, [key]: value }));
1247
+ };
1248
+ const handleNameChange = (value) => {
1249
+ setCredentialName(value);
1250
+ if (nameError) setNameError(null);
1251
+ };
1252
+ const hasFieldValues = Object.values(fieldValues).some((v) => v.trim());
1253
+ return /* @__PURE__ */ jsx(CustomModal, { opened: true, onClose: handleClose, loading: isPending, children: /* @__PURE__ */ jsxs(Stack, { children: [
1254
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1255
+ /* @__PURE__ */ jsx(IconSettings, { size: 24 }),
1256
+ /* @__PURE__ */ jsx(Title, { order: 3, children: isOAuth ? "Manage OAuth Credential" : "Edit API Key" })
1257
+ ] }),
1258
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1259
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: "Type:" }),
1260
+ /* @__PURE__ */ jsx(Badge, { variant: "light", size: "sm", children: schema.label })
1261
+ ] }),
1262
+ /* @__PURE__ */ jsx(
1263
+ TextInput,
1264
+ {
1265
+ label: "Name",
1266
+ value: credentialName,
1267
+ onChange: (e) => handleNameChange(e.target.value),
1268
+ disabled: isPending,
1269
+ maxLength: 100,
1270
+ description: "Lowercase letters, numbers, and hyphens only (e.g., gmail-dev, notion-prod)",
1271
+ error: nameError
1272
+ }
1273
+ ),
1274
+ isOAuth && /* @__PURE__ */ jsxs(Fragment, { children: [
1275
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: 'OAuth credentials are managed by the provider. You can update the name above, or click "Reconnect" to refresh your connection and update access tokens.' }),
1276
+ oauthError && /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "red", title: "Connection Failed", children: oauthError }),
1277
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "sm", children: [
1278
+ /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleClose, disabled: isPending, children: "Cancel" }),
1279
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1280
+ /* @__PURE__ */ jsx(
1281
+ Button,
1282
+ {
1283
+ variant: "light",
1284
+ onClick: handleSaveChanges,
1285
+ loading: updateMutation.isPending,
1286
+ disabled: !hasMetadataChanged || isAuthorizing,
1287
+ children: "Save Changes"
1288
+ }
1289
+ ),
1290
+ /* @__PURE__ */ jsx(
1291
+ Button,
1292
+ {
1293
+ color: "blue",
1294
+ onClick: handleOAuthReconnect,
1295
+ loading: isAuthorizing,
1296
+ leftSection: /* @__PURE__ */ jsx(IconRefresh, { size: 16 }),
1297
+ disabled: updateMutation.isPending,
1298
+ children: "Reconnect OAuth"
1299
+ }
1300
+ )
1301
+ ] })
1302
+ ] })
1303
+ ] }),
1304
+ !isOAuth && /* @__PURE__ */ jsxs(Fragment, { children: [
1305
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Current values are encrypted and cannot be displayed. Enter new values below to replace them." }),
1306
+ schema.fields?.map((field) => /* @__PURE__ */ jsx(
1307
+ PasswordInput,
1308
+ {
1309
+ label: `New ${field.label}`,
1310
+ placeholder: field.placeholder || `Enter new ${field.label.toLowerCase()}`,
1311
+ value: fieldValues[field.key] || "",
1312
+ onChange: (e) => handleFieldChange(field.key, e.target.value),
1313
+ description: field.description,
1314
+ disabled: isPending
1315
+ },
1316
+ field.key
1317
+ )),
1318
+ updateMutation.error && /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "red", title: "Update Failed", children: "Failed to update credential" }),
1319
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "sm", children: [
1320
+ /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleClose, disabled: isPending, children: "Cancel" }),
1321
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1322
+ /* @__PURE__ */ jsx(
1323
+ Button,
1324
+ {
1325
+ variant: "light",
1326
+ onClick: handleSaveChanges,
1327
+ loading: updateMutation.isPending,
1328
+ disabled: !hasMetadataChanged,
1329
+ children: "Save Name"
1330
+ }
1331
+ ),
1332
+ /* @__PURE__ */ jsx(Button, { onClick: handleCredentialUpdate, loading: updateMutation.isPending, disabled: !hasFieldValues, children: "Save Credential" })
1333
+ ] })
1334
+ ] })
1335
+ ] })
1336
+ ] }) });
1337
+ }
1338
+ var PROVIDER_ICONS = {
1339
+ slack: IconBrandSlack,
1340
+ attio: IconPlug,
1341
+ // Attio doesn't have a brand icon
1342
+ "google-sheets": IconBrandGoogleDrive,
1343
+ gmail: IconBrandGmail,
1344
+ github: IconBrandGithub,
1345
+ linear: IconRocket,
1346
+ dropbox: IconBrandDropbox
1347
+ };
1348
+ var MOCK_PROVIDERS = [
1349
+ { id: "google-sheets", name: "Google Sheets", available: false },
1350
+ { id: "gmail", name: "Gmail", available: false },
1351
+ { id: "github", name: "GitHub", available: false },
1352
+ { id: "linear", name: "Linear", available: false }
1353
+ ];
1354
+ function OAuthIntegrationsCard({ apiUrl }) {
1355
+ const [selectedProviderId, setSelectedProviderId] = useState(null);
1356
+ const [modalOpened, setModalOpened] = useState(false);
1357
+ const { authorize, isAuthorizing, error } = useOAuthFlow({ apiUrl });
1358
+ const queryClient = useQueryClient();
1359
+ const handleConnect = async (credentialName) => {
1360
+ if (!selectedProviderId) return;
1361
+ try {
1362
+ await authorize(selectedProviderId, credentialName);
1363
+ setModalOpened(false);
1364
+ setSelectedProviderId(null);
1365
+ queryClient.invalidateQueries({ queryKey: ["credentials"] });
1366
+ } catch (err) {
1367
+ console.error("OAuth flow failed:", err);
1368
+ }
1369
+ };
1370
+ const handleOpenModal = (providerId) => {
1371
+ setSelectedProviderId(providerId);
1372
+ setModalOpened(true);
1373
+ };
1374
+ const realProviders = Object.values(OAUTH_PROVIDERS).map((p) => ({
1375
+ ...p,
1376
+ available: true
1377
+ }));
1378
+ const allProviders = [...realProviders, ...MOCK_PROVIDERS];
1379
+ const selectedProvider = selectedProviderId ? OAUTH_PROVIDERS[selectedProviderId] : null;
1380
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1381
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { children: [
1382
+ /* @__PURE__ */ jsx(Group, { justify: "space-between", children: /* @__PURE__ */ jsxs("div", { children: [
1383
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "OAuth Integrations" }),
1384
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", mt: 4, children: "Connect third-party services using OAuth 2.0" })
1385
+ ] }) }),
1386
+ /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 1, sm: 2, md: 3 }, children: allProviders.map((provider) => {
1387
+ const Icon = PROVIDER_ICONS[provider.id] || IconPlug;
1388
+ return /* @__PURE__ */ jsx(
1389
+ Card,
1390
+ {
1391
+ withBorder: true,
1392
+ style: {
1393
+ opacity: provider.available ? 1 : 0.6
1394
+ },
1395
+ children: /* @__PURE__ */ jsxs(Stack, { children: [
1396
+ /* @__PURE__ */ jsx(Group, { justify: "space-between", align: "flex-start", children: /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1397
+ /* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: provider.available ? "blue" : "gray", children: /* @__PURE__ */ jsx(Icon, { size: 20 }) }),
1398
+ /* @__PURE__ */ jsxs("div", { children: [
1399
+ /* @__PURE__ */ jsx(Text, { fw: 600, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: provider.name }),
1400
+ !provider.available && /* @__PURE__ */ jsx(Badge, { color: "gray", variant: "light", size: "xs", mt: 4, children: "Coming Soon" })
1401
+ ] })
1402
+ ] }) }),
1403
+ /* @__PURE__ */ jsx(
1404
+ Button,
1405
+ {
1406
+ variant: "filled",
1407
+ size: "sm",
1408
+ onClick: () => handleOpenModal(provider.id),
1409
+ disabled: !provider.available,
1410
+ fullWidth: true,
1411
+ children: "Connect"
1412
+ }
1413
+ )
1414
+ ] })
1415
+ },
1416
+ provider.id
1417
+ );
1418
+ }) })
1419
+ ] }) }),
1420
+ /* @__PURE__ */ jsx(
1421
+ OAuthConnectModal,
1422
+ {
1423
+ opened: modalOpened,
1424
+ onClose: () => {
1425
+ setModalOpened(false);
1426
+ setSelectedProviderId(null);
1427
+ },
1428
+ provider: selectedProvider,
1429
+ onConnect: handleConnect,
1430
+ error,
1431
+ isLoading: isAuthorizing
1432
+ }
1433
+ )
1434
+ ] });
1435
+ }
1436
+
1437
+ export { AccountSettings, AppearanceSettings, CreateWebhookEndpointModal, EditCredentialModal, EditWebhookEndpointModal, MemberConfigModal, OAuthIntegrationsCard, OrgMembersList, OrganizationSettings, WebhookEndpointList, WebhookEndpointSettings };