@hotmeshio/long-tail 0.17.1 → 0.17.2

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 (183) hide show
  1. package/dashboard/dist/assets/{AdminDashboard-D-YHIR8w.js → AdminDashboard-B_AVB7tk.js} +2 -2
  2. package/dashboard/dist/assets/{AdminDashboard-D-YHIR8w.js.map → AdminDashboard-B_AVB7tk.js.map} +1 -1
  3. package/dashboard/dist/assets/{AgentConfigPage-CG54Ll2A.js → AgentConfigPage-JoZko3JB.js} +2 -2
  4. package/dashboard/dist/assets/{AgentConfigPage-CG54Ll2A.js.map → AgentConfigPage-JoZko3JB.js.map} +1 -1
  5. package/dashboard/dist/assets/{AgentDetailPage-rTcofeW4.js → AgentDetailPage-DfpR2Fgg.js} +3 -3
  6. package/dashboard/dist/assets/{AgentDetailPage-rTcofeW4.js.map → AgentDetailPage-DfpR2Fgg.js.map} +1 -1
  7. package/dashboard/dist/assets/{AgentsPage-B7PNjrkn.js → AgentsPage-F2ixDk1Q.js} +2 -2
  8. package/dashboard/dist/assets/{AgentsPage-B7PNjrkn.js.map → AgentsPage-F2ixDk1Q.js.map} +1 -1
  9. package/dashboard/dist/assets/AvailableEscalationsPage-D-W4OP55.js +2 -0
  10. package/dashboard/dist/assets/{AvailableEscalationsPage-CEDwyzlx.js.map → AvailableEscalationsPage-D-W4OP55.js.map} +1 -1
  11. package/dashboard/dist/assets/{BotPicker-cg1qXRF3.js → BotPicker-B8Yal8Mm.js} +2 -2
  12. package/dashboard/dist/assets/{BotPicker-cg1qXRF3.js.map → BotPicker-B8Yal8Mm.js.map} +1 -1
  13. package/dashboard/dist/assets/BulkAssignModal-ySfoaF7f.js +2 -0
  14. package/dashboard/dist/assets/{BulkAssignModal-BDzaHGAb.js.map → BulkAssignModal-ySfoaF7f.js.map} +1 -1
  15. package/dashboard/dist/assets/{CapabilitiesPage-CswExj9-.js → CapabilitiesPage-BSJ2oFj6.js} +2 -2
  16. package/dashboard/dist/assets/{CapabilitiesPage-CswExj9-.js.map → CapabilitiesPage-BSJ2oFj6.js.map} +1 -1
  17. package/dashboard/dist/assets/{CollapsibleSection-CpVKfkkq.js → CollapsibleSection-CcV88IUy.js} +2 -2
  18. package/dashboard/dist/assets/{CollapsibleSection-CpVKfkkq.js.map → CollapsibleSection-CcV88IUy.js.map} +1 -1
  19. package/dashboard/dist/assets/{CountdownTimer-ClJhYGg1.js → CountdownTimer-C-E9MXMk.js} +2 -2
  20. package/dashboard/dist/assets/{CountdownTimer-ClJhYGg1.js.map → CountdownTimer-C-E9MXMk.js.map} +1 -1
  21. package/dashboard/dist/assets/{CredentialsPage-DYBp7v8W.js → CredentialsPage-DrydlZ65.js} +2 -2
  22. package/dashboard/dist/assets/{CredentialsPage-DYBp7v8W.js.map → CredentialsPage-DrydlZ65.js.map} +1 -1
  23. package/dashboard/dist/assets/{CronLabel-Bd_fipHy.js → CronLabel-BxQmJXos.js} +2 -2
  24. package/dashboard/dist/assets/{CronLabel-Bd_fipHy.js.map → CronLabel-BxQmJXos.js.map} +1 -1
  25. package/dashboard/dist/assets/{ElapsedCell-B-Wn6Y8B.js → ElapsedCell-lszUXiyP.js} +2 -2
  26. package/dashboard/dist/assets/{ElapsedCell-B-Wn6Y8B.js.map → ElapsedCell-lszUXiyP.js.map} +1 -1
  27. package/dashboard/dist/assets/{EntityTimelinePanel-DcgFUbk4.js → EntityTimelinePanel-CwzIV87U.js} +2 -2
  28. package/dashboard/dist/assets/{EntityTimelinePanel-DcgFUbk4.js.map → EntityTimelinePanel-CwzIV87U.js.map} +1 -1
  29. package/dashboard/dist/assets/{EscalationListSchemaPage-DpnorXeU.js → EscalationListSchemaPage-D16uUVcG.js} +3 -3
  30. package/dashboard/dist/assets/{EscalationListSchemaPage-DpnorXeU.js.map → EscalationListSchemaPage-D16uUVcG.js.map} +1 -1
  31. package/dashboard/dist/assets/{EscalationSchemaPage-LPTJJDfP.js → EscalationSchemaPage-BLM3dUEw.js} +2 -2
  32. package/dashboard/dist/assets/{EscalationSchemaPage-LPTJJDfP.js.map → EscalationSchemaPage-BLM3dUEw.js.map} +1 -1
  33. package/dashboard/dist/assets/{EscalationsOverview-Bq5_ICUt.js → EscalationsOverview-BlFjoKlR.js} +2 -2
  34. package/dashboard/dist/assets/{EscalationsOverview-Bq5_ICUt.js.map → EscalationsOverview-BlFjoKlR.js.map} +1 -1
  35. package/dashboard/dist/assets/{EventTable-Cinbdm1u.js → EventTable-rTkMR8Zf.js} +2 -2
  36. package/dashboard/dist/assets/{EventTable-Cinbdm1u.js.map → EventTable-rTkMR8Zf.js.map} +1 -1
  37. package/dashboard/dist/assets/{FilterBar-DyojX5m4.js → FilterBar-BeVBUdfJ.js} +2 -2
  38. package/dashboard/dist/assets/{FilterBar-DyojX5m4.js.map → FilterBar-BeVBUdfJ.js.map} +1 -1
  39. package/dashboard/dist/assets/{GraphInvokePage-Ba5fNcgv.js → GraphInvokePage-BV60xkVy.js} +2 -2
  40. package/dashboard/dist/assets/{GraphInvokePage-Ba5fNcgv.js.map → GraphInvokePage-BV60xkVy.js.map} +1 -1
  41. package/dashboard/dist/assets/{HomePage-DuFXqfz3.js → HomePage-BA0RYzFc.js} +2 -2
  42. package/dashboard/dist/assets/{HomePage-DuFXqfz3.js.map → HomePage-BA0RYzFc.js.map} +1 -1
  43. package/dashboard/dist/assets/{ListToolbar-GpwHcjkZ.js → ListToolbar-4IfsUXfV.js} +2 -2
  44. package/dashboard/dist/assets/{ListToolbar-GpwHcjkZ.js.map → ListToolbar-4IfsUXfV.js.map} +1 -1
  45. package/dashboard/dist/assets/{McpOverview-Bi23-hih.js → McpOverview-gDegMXvF.js} +2 -2
  46. package/dashboard/dist/assets/{McpOverview-Bi23-hih.js.map → McpOverview-gDegMXvF.js.map} +1 -1
  47. package/dashboard/dist/assets/{McpQueryDetailPage-FhHSfX9W.js → McpQueryDetailPage-CnCffPks.js} +2 -2
  48. package/dashboard/dist/assets/{McpQueryDetailPage-FhHSfX9W.js.map → McpQueryDetailPage-CnCffPks.js.map} +1 -1
  49. package/dashboard/dist/assets/{McpQueryPage-czMlM7vR.js → McpQueryPage-CLEMtLOG.js} +2 -2
  50. package/dashboard/dist/assets/{McpQueryPage-czMlM7vR.js.map → McpQueryPage-CLEMtLOG.js.map} +1 -1
  51. package/dashboard/dist/assets/{McpRunDetailPage-BOh2M0Ca.js → McpRunDetailPage-tr-lrWVv.js} +2 -2
  52. package/dashboard/dist/assets/{McpRunDetailPage-BOh2M0Ca.js.map → McpRunDetailPage-tr-lrWVv.js.map} +1 -1
  53. package/dashboard/dist/assets/{McpRunsPage-DfJzbGYM.js → McpRunsPage-nE0d_1Px.js} +2 -2
  54. package/dashboard/dist/assets/{McpRunsPage-DfJzbGYM.js.map → McpRunsPage-nE0d_1Px.js.map} +1 -1
  55. package/dashboard/dist/assets/{OperationsPage-BS8blKLj.js → OperationsPage-C8h1DN5Q.js} +2 -2
  56. package/dashboard/dist/assets/{OperationsPage-BS8blKLj.js.map → OperationsPage-C8h1DN5Q.js.map} +1 -1
  57. package/dashboard/dist/assets/{OperatorDashboard-BWtTKrcJ.js → OperatorDashboard-DCG8BFKE.js} +2 -2
  58. package/dashboard/dist/assets/{OperatorDashboard-BWtTKrcJ.js.map → OperatorDashboard-DCG8BFKE.js.map} +1 -1
  59. package/dashboard/dist/assets/{PersonaDetailPage-VkhuauBf.js → PersonaDetailPage-BEVeJr1q.js} +2 -2
  60. package/dashboard/dist/assets/{PersonaDetailPage-VkhuauBf.js.map → PersonaDetailPage-BEVeJr1q.js.map} +1 -1
  61. package/dashboard/dist/assets/PersonasPage-B5fj2AK6.js +2 -0
  62. package/dashboard/dist/assets/{PersonasPage-DRoneLfx.js.map → PersonasPage-B5fj2AK6.js.map} +1 -1
  63. package/dashboard/dist/assets/ProcessDetailPage-CWGby6KD.js +2 -0
  64. package/dashboard/dist/assets/{ProcessDetailPage-B5mmkHS0.js.map → ProcessDetailPage-CWGby6KD.js.map} +1 -1
  65. package/dashboard/dist/assets/{ProcessesListPage-BV0e2OfH.js → ProcessesListPage-nFdLMlfb.js} +2 -2
  66. package/dashboard/dist/assets/{ProcessesListPage-BV0e2OfH.js.map → ProcessesListPage-nFdLMlfb.js.map} +1 -1
  67. package/dashboard/dist/assets/RoleDetailPage-OmOdRm1F.js +8 -0
  68. package/dashboard/dist/assets/{RoleDetailPage-eenl_a5Z.js.map → RoleDetailPage-OmOdRm1F.js.map} +1 -1
  69. package/dashboard/dist/assets/{RolesPage-BLfJcFf7.js → RolesPage-DwprdPCA.js} +2 -2
  70. package/dashboard/dist/assets/{RolesPage-BLfJcFf7.js.map → RolesPage-DwprdPCA.js.map} +1 -1
  71. package/dashboard/dist/assets/{RunAsSelector-BnLKKs51.js → RunAsSelector-DGw9EKSR.js} +2 -2
  72. package/dashboard/dist/assets/{RunAsSelector-BnLKKs51.js.map → RunAsSelector-DGw9EKSR.js.map} +1 -1
  73. package/dashboard/dist/assets/{ScanCodesPage-BWIcjnr4.js → ScanCodesPage-RPi4qZ_l.js} +2 -2
  74. package/dashboard/dist/assets/{ScanCodesPage-BWIcjnr4.js.map → ScanCodesPage-RPi4qZ_l.js.map} +1 -1
  75. package/dashboard/dist/assets/{ScanSchemeDetailPage-sAuU8cZj.js → ScanSchemeDetailPage-BKc4lUjc.js} +2 -2
  76. package/dashboard/dist/assets/{ScanSchemeDetailPage-sAuU8cZj.js.map → ScanSchemeDetailPage-BKc4lUjc.js.map} +1 -1
  77. package/dashboard/dist/assets/{ScanStationPage-CA_q1uaI.js → ScanStationPage-DUfxcntB.js} +2 -2
  78. package/dashboard/dist/assets/{ScanStationPage-CA_q1uaI.js.map → ScanStationPage-DUfxcntB.js.map} +1 -1
  79. package/dashboard/dist/assets/{StickyPagination-sVI21e82.js → StickyPagination-DXOk5z5X.js} +2 -2
  80. package/dashboard/dist/assets/{StickyPagination-sVI21e82.js.map → StickyPagination-DXOk5z5X.js.map} +1 -1
  81. package/dashboard/dist/assets/{StreamMessageDetail-Djm_zQAv.js → StreamMessageDetail-BB1h2zZN.js} +2 -2
  82. package/dashboard/dist/assets/{StreamMessageDetail-Djm_zQAv.js.map → StreamMessageDetail-BB1h2zZN.js.map} +1 -1
  83. package/dashboard/dist/assets/{SwimlaneTimeline-CwxXRmRQ.js → SwimlaneTimeline-CapKokLg.js} +2 -2
  84. package/dashboard/dist/assets/{SwimlaneTimeline-CwxXRmRQ.js.map → SwimlaneTimeline-CapKokLg.js.map} +1 -1
  85. package/dashboard/dist/assets/{TaskDetailPage-SiBSTsfp.js → TaskDetailPage-Dfzdp97x.js} +2 -2
  86. package/dashboard/dist/assets/{TaskDetailPage-SiBSTsfp.js.map → TaskDetailPage-Dfzdp97x.js.map} +1 -1
  87. package/dashboard/dist/assets/{TasksListPage-CBTFz3Bp.js → TasksListPage-DxlS7PTD.js} +2 -2
  88. package/dashboard/dist/assets/{TasksListPage-CBTFz3Bp.js.map → TasksListPage-DxlS7PTD.js.map} +1 -1
  89. package/dashboard/dist/assets/{TimeAgo-Ctwwdamz.js → TimeAgo-Bv5viQ1m.js} +2 -2
  90. package/dashboard/dist/assets/{TimeAgo-Ctwwdamz.js.map → TimeAgo-Bv5viQ1m.js.map} +1 -1
  91. package/dashboard/dist/assets/{TimestampCell-CI8UrDuQ.js → TimestampCell-DXNBf_eb.js} +2 -2
  92. package/dashboard/dist/assets/{TimestampCell-CI8UrDuQ.js.map → TimestampCell-DXNBf_eb.js.map} +1 -1
  93. package/dashboard/dist/assets/{ToolTestPanel-Cf9ZEBF7.js → ToolTestPanel-f32mir7Q.js} +2 -2
  94. package/dashboard/dist/assets/{ToolTestPanel-Cf9ZEBF7.js.map → ToolTestPanel-f32mir7Q.js.map} +1 -1
  95. package/dashboard/dist/assets/{TopicDetailPage-BYIOSVNy.js → TopicDetailPage-D-N8Vsd4.js} +2 -2
  96. package/dashboard/dist/assets/{TopicDetailPage-BYIOSVNy.js.map → TopicDetailPage-D-N8Vsd4.js.map} +1 -1
  97. package/dashboard/dist/assets/{TopicsPage-C9x4tIEi.js → TopicsPage-hqlu32wg.js} +2 -2
  98. package/dashboard/dist/assets/{TopicsPage-C9x4tIEi.js.map → TopicsPage-hqlu32wg.js.map} +1 -1
  99. package/dashboard/dist/assets/UserName-BhA_ItNN.js +2 -0
  100. package/dashboard/dist/assets/{UserName-Ck-eLb-1.js.map → UserName-BhA_ItNN.js.map} +1 -1
  101. package/dashboard/dist/assets/{WorkflowExecutionPage-BPxoPK8g.js → WorkflowExecutionPage-BAgMKnhe.js} +2 -2
  102. package/dashboard/dist/assets/{WorkflowExecutionPage-BPxoPK8g.js.map → WorkflowExecutionPage-BAgMKnhe.js.map} +1 -1
  103. package/dashboard/dist/assets/{WorkflowsDashboard-CDHQUYEr.js → WorkflowsDashboard-B2wYT_hj.js} +2 -2
  104. package/dashboard/dist/assets/{WorkflowsDashboard-CDHQUYEr.js.map → WorkflowsDashboard-B2wYT_hj.js.map} +1 -1
  105. package/dashboard/dist/assets/{WorkflowsOverview-DGp8J0G2.js → WorkflowsOverview--jC5F9lz.js} +2 -2
  106. package/dashboard/dist/assets/{WorkflowsOverview-DGp8J0G2.js.map → WorkflowsOverview--jC5F9lz.js.map} +1 -1
  107. package/dashboard/dist/assets/{YamlWorkflowDetailPage-B112bGAY.js → YamlWorkflowDetailPage-BdB5eX8s.js} +2 -2
  108. package/dashboard/dist/assets/{YamlWorkflowDetailPage-B112bGAY.js.map → YamlWorkflowDetailPage-BdB5eX8s.js.map} +1 -1
  109. package/dashboard/dist/assets/{YamlWorkflowsPage-Cw5wddH7.js → YamlWorkflowsPage-BUQQU9II.js} +2 -2
  110. package/dashboard/dist/assets/{YamlWorkflowsPage-Cw5wddH7.js.map → YamlWorkflowsPage-BUQQU9II.js.map} +1 -1
  111. package/dashboard/dist/assets/{agents-CZ8WIdWH.js → agents-BF_S1J_z.js} +2 -2
  112. package/dashboard/dist/assets/{agents-CZ8WIdWH.js.map → agents-BF_S1J_z.js.map} +1 -1
  113. package/dashboard/dist/assets/{bots-Xu3MUuXN.js → bots-CGlEoWAu.js} +2 -2
  114. package/dashboard/dist/assets/{bots-Xu3MUuXN.js.map → bots-CGlEoWAu.js.map} +1 -1
  115. package/dashboard/dist/assets/{capabilities-XJukFiLn.js → capabilities-Pq8pG0kX.js} +2 -2
  116. package/dashboard/dist/assets/{capabilities-XJukFiLn.js.map → capabilities-Pq8pG0kX.js.map} +1 -1
  117. package/dashboard/dist/assets/{controlplane-D8ZQQUAV.js → controlplane-dY6a4iYT.js} +2 -2
  118. package/dashboard/dist/assets/{controlplane-D8ZQQUAV.js.map → controlplane-dY6a4iYT.js.map} +1 -1
  119. package/dashboard/dist/assets/{escalation-columns-C1GyAMeK.js → escalation-columns-CBUTda5U.js} +2 -2
  120. package/dashboard/dist/assets/{escalation-columns-C1GyAMeK.js.map → escalation-columns-CBUTda5U.js.map} +1 -1
  121. package/dashboard/dist/assets/{index-CRxbF5vt.js → index-BHfISWyn.js} +2 -2
  122. package/dashboard/dist/assets/{index-CRxbF5vt.js.map → index-BHfISWyn.js.map} +1 -1
  123. package/dashboard/dist/assets/{index-DCaGxwKU.js → index-BTksPQZe.js} +2 -2
  124. package/dashboard/dist/assets/{index-DCaGxwKU.js.map → index-BTksPQZe.js.map} +1 -1
  125. package/dashboard/dist/assets/{index-Dc43wixL.js → index-BWtW5puE.js} +2 -2
  126. package/dashboard/dist/assets/{index-Dc43wixL.js.map → index-BWtW5puE.js.map} +1 -1
  127. package/dashboard/dist/assets/{index-D_5_1D7U.js → index-Bn-6MP9-.js} +2 -2
  128. package/dashboard/dist/assets/{index-D_5_1D7U.js.map → index-Bn-6MP9-.js.map} +1 -1
  129. package/dashboard/dist/assets/{index-CHAmwNDI.js → index-BrFGgfjR.js} +2 -2
  130. package/dashboard/dist/assets/{index-CHAmwNDI.js.map → index-BrFGgfjR.js.map} +1 -1
  131. package/dashboard/dist/assets/{index-DFmV19fc.js → index-ByYeo8P7.js} +2 -2
  132. package/dashboard/dist/assets/{index-DFmV19fc.js.map → index-ByYeo8P7.js.map} +1 -1
  133. package/dashboard/dist/assets/{index-CgGR0kM6.js → index-CivQGQpu.js} +3 -3
  134. package/dashboard/dist/assets/{index-CgGR0kM6.js.map → index-CivQGQpu.js.map} +1 -1
  135. package/dashboard/dist/assets/{index-DeRM0-Xz.js → index-CwQn-nhR.js} +2 -2
  136. package/dashboard/dist/assets/{index-DeRM0-Xz.js.map → index-CwQn-nhR.js.map} +1 -1
  137. package/dashboard/dist/assets/{index-COtlcGK_.js → index-D0bjzVum.js} +2 -2
  138. package/dashboard/dist/assets/{index-COtlcGK_.js.map → index-D0bjzVum.js.map} +1 -1
  139. package/dashboard/dist/assets/{index-DWhyH1kV.js → index-D1KCPoRr.js} +2 -2
  140. package/dashboard/dist/assets/{index-DWhyH1kV.js.map → index-D1KCPoRr.js.map} +1 -1
  141. package/dashboard/dist/assets/index-D9rtK9QF.js +67 -0
  142. package/dashboard/dist/assets/index-D9rtK9QF.js.map +1 -0
  143. package/dashboard/dist/assets/{index-DYIy3uT5.js → index-DrlZc3C0.js} +2 -2
  144. package/dashboard/dist/assets/{index-DYIy3uT5.js.map → index-DrlZc3C0.js.map} +1 -1
  145. package/dashboard/dist/assets/index-U7HShN30.js +2 -0
  146. package/dashboard/dist/assets/{index-CR96SICL.js.map → index-U7HShN30.js.map} +1 -1
  147. package/dashboard/dist/assets/{knowledge-sjJNIdJY.js → knowledge-8_TilyaY.js} +2 -2
  148. package/dashboard/dist/assets/{knowledge-sjJNIdJY.js.map → knowledge-8_TilyaY.js.map} +1 -1
  149. package/dashboard/dist/assets/{mcp-CQeu19Jf.js → mcp-hY3O2HJa.js} +2 -2
  150. package/dashboard/dist/assets/{mcp-CQeu19Jf.js.map → mcp-hY3O2HJa.js.map} +1 -1
  151. package/dashboard/dist/assets/{mcp-query-B9GuC88j.js → mcp-query-CA8NEf2e.js} +2 -2
  152. package/dashboard/dist/assets/{mcp-query-B9GuC88j.js.map → mcp-query-CA8NEf2e.js.map} +1 -1
  153. package/dashboard/dist/assets/{personas-CQr9sXg3.js → personas-DrWgQ94s.js} +2 -2
  154. package/dashboard/dist/assets/{personas-CQr9sXg3.js.map → personas-DrWgQ94s.js.map} +1 -1
  155. package/dashboard/dist/assets/{pipelines-DzMf-VE7.js → pipelines-DdgSlafC.js} +2 -2
  156. package/dashboard/dist/assets/{pipelines-DzMf-VE7.js.map → pipelines-DdgSlafC.js.map} +1 -1
  157. package/dashboard/dist/assets/{tasks-QKuXlyLe.js → tasks-UyjER1TA.js} +2 -2
  158. package/dashboard/dist/assets/{tasks-QKuXlyLe.js.map → tasks-UyjER1TA.js.map} +1 -1
  159. package/dashboard/dist/assets/{topics-DQAQnGV7.js → topics-CIc5SpT_.js} +2 -2
  160. package/dashboard/dist/assets/{topics-DQAQnGV7.js.map → topics-CIc5SpT_.js.map} +1 -1
  161. package/dashboard/dist/assets/{useDebouncedValue-DuE9Mj3I.js → useDebouncedValue-CmUqBRK4.js} +2 -2
  162. package/dashboard/dist/assets/{useDebouncedValue-DuE9Mj3I.js.map → useDebouncedValue-CmUqBRK4.js.map} +1 -1
  163. package/dashboard/dist/assets/{useNamespace-BTCrNkwo.js → useNamespace-BOZOwXTE.js} +2 -2
  164. package/dashboard/dist/assets/{useNamespace-BTCrNkwo.js.map → useNamespace-BOZOwXTE.js.map} +1 -1
  165. package/dashboard/dist/assets/{useYamlActivityEvents-_aa1_rNu.js → useYamlActivityEvents-BsTpIsba.js} +2 -2
  166. package/dashboard/dist/assets/{useYamlActivityEvents-_aa1_rNu.js.map → useYamlActivityEvents-BsTpIsba.js.map} +1 -1
  167. package/dashboard/dist/assets/{workflows-CEWX3imM.js → workflows-BkFI3IwE.js} +2 -2
  168. package/dashboard/dist/assets/{workflows-CEWX3imM.js.map → workflows-BkFI3IwE.js.map} +1 -1
  169. package/dashboard/dist/assets/{yaml-workflows-Bek1Mg86.js → yaml-workflows-CeeqNi9k.js} +2 -2
  170. package/dashboard/dist/assets/{yaml-workflows-Bek1Mg86.js.map → yaml-workflows-CeeqNi9k.js.map} +1 -1
  171. package/dashboard/dist/index.html +1 -1
  172. package/package.json +1 -1
  173. package/dashboard/dist/assets/AvailableEscalationsPage-CEDwyzlx.js +0 -2
  174. package/dashboard/dist/assets/BulkAssignModal-BDzaHGAb.js +0 -2
  175. package/dashboard/dist/assets/PersonasPage-DRoneLfx.js +0 -2
  176. package/dashboard/dist/assets/ProcessDetailPage-B5mmkHS0.js +0 -2
  177. package/dashboard/dist/assets/RoleDetailPage-eenl_a5Z.js +0 -8
  178. package/dashboard/dist/assets/UserName-Ck-eLb-1.js +0 -2
  179. package/dashboard/dist/assets/index-BEeGFfuP.js +0 -67
  180. package/dashboard/dist/assets/index-BEeGFfuP.js.map +0 -1
  181. package/dashboard/dist/assets/index-CR96SICL.js +0 -2
  182. package/dashboard/dist/assets/users-D-DhFQBy.js +0 -2
  183. package/dashboard/dist/assets/users-D-DhFQBy.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-workflows-Bek1Mg86.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
1
+ {"version":3,"file":"yaml-workflows-CeeqNi9k.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"qGAmBO,SAASA,EAAiBC,EAA+B,GAAI,CAClE,MAAMC,EAAS,IAAI,gBACnB,OAAID,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,aAAaC,EAAO,IAAI,cAAeD,EAAQ,WAAW,EAClEA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,OAAOC,EAAO,IAAI,QAAS,OAAOD,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWC,EAAO,IAAI,SAAU,OAAOD,EAAQ,MAAM,CAAC,EAEtEE,EAAmC,CACxC,SAAU,CAAC,gBAAiBF,CAAO,EACnC,QAAS,IAAMG,EAAS,mBAAmBF,CAAM,EAAE,CAAA,CACpD,CACH,CAEO,SAASG,GAAwB,CACtC,OAAOF,EAAgC,CACrC,SAAU,CAAC,oBAAoB,EAC/B,QAAS,IAAMC,EAAS,yBAAyB,CAAA,CAClD,CACH,CAcO,SAASE,EAAgBC,EAAY,CAC1C,OAAOJ,EAA+B,CACpC,SAAU,CAAC,gBAAiBI,CAAE,EAC9B,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,EAAE,EAC/C,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASC,GAAwB,CACtC,MAAMC,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaC,GAWXR,EAA+B,kBAAmB,CAChD,OAAQ,OACR,KAAM,KAAK,UAAUQ,CAAK,CAAA,CAC3B,EACH,UAAW,IAAM,CACfH,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASI,GAAwB,CACtC,MAAMJ,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,UAAW,CAC7D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASK,GAA0B,CACxC,MAAML,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,YAAa,CAC/D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASM,GAAwB,CACtC,MAAMN,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,KAAAS,EAAM,KAAAC,EAAM,WAAAC,KAC7Bd,EAAgD,mBAAmBG,CAAE,UAAW,CAC9E,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,KAAAS,EAAM,KAAAC,EAAM,GAAIC,EAAa,CAAE,WAAAA,CAAA,EAAe,GAAK,CAAA,CAC3E,EACH,UAAW,IAAM,CACfT,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASU,GAA4B,CAC1C,MAAMV,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,WAAAa,EAAY,qBAAAC,KAC7BjB,EAA+B,mBAAmBG,CAAE,cAAe,CACjE,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,WAAAa,EAAY,qBAAAC,EAAsB,CAAA,CAC1D,EACH,UAAW,IAAM,CACfZ,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASa,GAAyB,CACvC,MAAMb,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,WAAY,CAC9D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASc,GAAyB,CACvC,MAAMd,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,WAAY,CAC9D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,EACjFA,EAAY,kBAAkB,CAAE,SAAU,CAAC,cAAc,EAAG,YAAa,MAAO,CAClF,CAAA,CACD,CACH,CAEO,SAASe,GAAwB,CACtC,MAAMf,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,GAAGkB,KACpBrB,EAA+B,mBAAmBG,CAAE,GAAI,CACtD,OAAQ,MACR,KAAM,KAAK,UAAUkB,CAAO,CAAA,CAC7B,EACH,UAAW,IAAM,CACfhB,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASiB,GAAwB,CACtC,MAAMjB,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,GAAI,CACtD,OAAQ,QAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAsCO,SAASkB,EAAwBpB,EAAY,CAClD,OAAOJ,EAA+D,CACpE,SAAU,CAAC,gBAAiBI,EAAI,UAAU,EAC1C,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,WAAW,EACxD,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASqB,EAAuBrB,EAAYsB,EAAwB,CACzE,OAAO1B,EAAgC,CACrC,SAAU,CAAC,gBAAiBI,EAAI,WAAYsB,CAAO,EACnD,QAAS,IAAMzB,EAAS,mBAAmBG,CAAE,aAAasB,CAAO,EAAE,EACnE,QAAS,CAAC,CAACtB,GAAMsB,IAAY,IAAA,CAC9B,CACH"}
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="./assets/index-BEeGFfuP.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-D9rtK9QF.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="./assets/vendor-query-RUZdMvN6.js">
13
13
  <link rel="modulepreload" crossorigin href="./assets/vendor-react-CdqEC2zv.js">
14
14
  <link rel="modulepreload" crossorigin href="./assets/vendor-icons-h-jlRSb9.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,2 +0,0 @@
1
- import{j as e,a as b}from"./vendor-query-RUZdMvN6.js";import{b as $t,t as Ft,v as _e,w as Rt,x as Lt,y as _t,z as Bt,A as zt,B as Ut,E as qt,G as Dt,H as It,I as Vt,K as Gt,p as Ht,L as Qt,M as Kt,O as Wt,Q as Xt,R as Yt,T as Zt,U as Jt,V as es,W as ts,X as ss,Y as as,Z as ns,_ as rs,$ as is,a0 as ls,a1 as os}from"./index-BEeGFfuP.js";import{i as cs}from"./task-queues-7-sHKPsN.js";import{X as se,ag as ds,ah as us,C as xs,c as ms,ai as hs,aj as ps,t as fs,s as gs,ak as bs,B as ys,al as vs,am as js,Q as Ns,h as Cs,an as ks,P as ws,ao as Ss}from"./vendor-icons-h-jlRSb9.js";import{u as Ke,C as Ps,r as Ms,B as Ts,a as As}from"./BulkAssignModal-BDzaHGAb.js";import{m as Es,E as Os,a as $s}from"./escalation-columns-C1GyAMeK.js";import{i as We,s as Fs,E as Rs}from"./CountdownTimer-ClJhYGg1.js";import{u as Ls}from"./useFilterParams-crmlBw_l.js";import{u as _s}from"./useDebouncedValue-DuE9Mj3I.js";import{D as Bs}from"./DataTable-DFPMeqyQ.js";import{S as zs}from"./StickyPagination-sVI21e82.js";import{P as Us}from"./constants-BHkpVaqx.js";import{M as Xe}from"./Modal-BU7No9NH.js";import{R as qs,a as Ds}from"./RowActions-eYrzgQSj.js";import{L as Be,u as Is,f as Vs,a as Gs}from"./vendor-react-CdqEC2zv.js";import"./users-D-DhFQBy.js";import"./EntityTimelinePanel-DcgFUbk4.js";import"./FilterBar-DyojX5m4.js";import"./PriorityBadge-BETdj4M-.js";import"./RolePill-Di_5hfvw.js";import"./WorkflowPill-CN-952iI.js";import"./StatusBadge-BDeUwPtb.js";import"./EmptyState-lpUFYfun.js";const Hs=["<","<=",">",">=","="],Qs=["priority","created_at","updated_at","status","role"],B="input text-xs py-1",ze="select text-xs py-1",J="text-text-tertiary hover:text-text-primary transition-colors";function Ue(t){return t==="true"?!0:t==="false"?!1:t.trim()!==""&&!Number.isNaN(Number(t))?Number(t):t}const Ks=t=>Object.entries(t??{}).map(([s,i])=>({key:s,value:String(i)})),Ws=t=>(t??[]).map(s=>{const[i,r]=Object.entries(s)[0]??["",""];return{key:i,value:String(r)}});function L({title:t,hint:s,children:i}){return e.jsxs("div",{className:"border-t border-surface-border/50 py-3 first:border-t-0 first:pt-1",children:[e.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between",children:[e.jsx("span",{className:"text-2xs font-medium uppercase tracking-wide text-text-tertiary",children:t}),s&&e.jsx("span",{className:"text-2xs font-mono text-text-tertiary/70",children:s})]}),i]})}function ee({value:t,onChange:s,placeholder:i}){return e.jsx("input",{list:"lt-facet-keys",className:`${B} w-40`,placeholder:i,value:t,onChange:r=>s(r.target.value)})}function Xs({value:t,onChange:s,facetKeys:i=[],search:r="",onSearchChange:g}){const x=Ks(t.facets),m=Ws(t.block),p=t.range??[],o=t.exists??[],y=t.orderBy??[],N=n=>{const u={};for(const d of n)d.key&&(u[d.key]=Ue(d.value));s({...t,facets:Object.keys(u).length?u:void 0})},S=n=>{const u=n.filter(d=>d.key).map(d=>({[d.key]:Ue(d.value)}));s({...t,block:u.length?u:void 0})},M=n=>s({...t,range:n.length?n:void 0}),j=n=>s({...t,exists:n.length?n:void 0}),P=n=>s({...t,orderBy:n.length?n:void 0});return e.jsxs("div",{className:"text-xs",children:[e.jsx("datalist",{id:"lt-facet-keys",children:i.map(n=>e.jsx("option",{value:n},n))}),e.jsxs("datalist",{id:"lt-sort-fields",children:[Qs.map(n=>e.jsx("option",{value:n},n)),i.map(n=>e.jsx("option",{value:`metadata.${n}`},n))]}),g&&e.jsx(L,{title:"Match id",hint:"id · workflow · origin",children:e.jsx("input",{className:`${B} w-full`,placeholder:"Exact escalation, workflow, or origin id…",value:r,onChange:n=>g(n.target.value)})}),e.jsx(L,{title:"Has facet",hint:"metadata @>",children:[...x,{key:"",value:""}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.key,placeholder:"key",onChange:d=>{const l=[...x];l[u]={...n,key:d},N(l)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${B} w-40`,placeholder:"value",value:n.value,onChange:d=>{const l=[...x];l[u]={...n,value:d.target.value},N(l)}}),u<x.length&&e.jsx("button",{className:J,onClick:()=>N(x.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Range",hint:"numeric",children:[...p,{facet:"",op:"<=",value:0}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.facet,placeholder:"numeric facet",onChange:d=>{const l=[...p];l[u]={...n,facet:d},M(l.filter(c=>c.facet))}}),e.jsx("select",{className:ze,value:n.op,onChange:d=>{const l=[...p];l[u]={...n,op:d.target.value},M(l.filter(c=>c.facet))},children:Hs.map(d=>e.jsx("option",{value:d,children:d},d))}),e.jsx("input",{type:"number",className:`${B} w-24`,value:n.value,onChange:d=>{const l=[...p];l[u]={...n,value:Number(d.target.value)},M(l.filter(c=>c.facet))}}),u<p.length&&e.jsx("button",{className:J,onClick:()=>M(p.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Has key",hint:"metadata ? key",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(n=>e.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent/15 px-1.5 py-0.5 text-accent",children:[n,e.jsx("button",{className:"text-accent/70 hover:text-accent",onClick:()=>j(o.filter(u=>u!==n)),children:"×"})]},n)),e.jsx(ee,{value:"",placeholder:"+ key",onChange:n=>{n&&!o.includes(n)&&j([...o,n])}})]})}),e.jsx(L,{title:"Exclude",hint:"NOT @>",children:[...m,{key:"",value:""}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.key,placeholder:"key",onChange:d=>{const l=[...m];l[u]={...n,key:d},S(l)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${B} w-40`,placeholder:"value",value:n.value,onChange:d=>{const l=[...m];l[u]={...n,value:d.target.value},S(l)}}),u<m.length&&e.jsx("button",{className:J,onClick:()=>S(m.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Sort by",children:[...y,{field:"",direction:"asc"}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx("input",{list:"lt-sort-fields",className:`${B} w-44`,placeholder:"column or metadata.key",value:n.field,onChange:d=>{const l=[...y];l[u]={...n,field:d.target.value},P(l.filter(c=>c.field))}}),e.jsxs("select",{className:ze,value:n.direction??"asc",onChange:d=>{const l=[...y];l[u]={...n,direction:d.target.value},P(l.filter(c=>c.field))},children:[e.jsx("option",{value:"asc",children:"asc"}),e.jsx("option",{value:"desc",children:"desc"})]}),e.jsxs("label",{className:"flex items-center gap-1 text-text-tertiary",children:[e.jsx("input",{type:"checkbox",checked:!!n.numeric,onChange:d=>{const l=[...y];l[u]={...n,numeric:d.target.checked},P(l.filter(c=>c.field))}}),"num"]}),u<y.length&&e.jsx("button",{className:J,onClick:()=>P(y.filter((d,l)=>l!==u)),children:"×"})]},u))})]})}function Ys({value:t,onChange:s,facetKeys:i,search:r,onSearchChange:g,activeFacetCount:x,onClear:m,onClose:p}){return e.jsxs("div",{className:"h-full overflow-y-auto",children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 bg-surface-raised border-b border-surface-border/50",children:[e.jsx("span",{className:"text-xs font-semibold text-text-primary",children:"Faceted query"}),e.jsxs("div",{className:"flex items-center gap-2",children:[x>0&&e.jsx("button",{onClick:m,className:"text-2xs text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsx("button",{onClick:p,className:"p-1 rounded hover:bg-surface-hover text-text-tertiary hover:text-text-primary transition-colors",title:"Close",children:e.jsx(se,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"px-4 py-2",children:[e.jsxs("p",{className:"mb-2 text-2xs leading-snug text-text-tertiary",children:["Precise metadata facets plus exact correlation-id lookup — they compose in one SQL query. Facet keys are the ones that actually exist in your visible escalations. Set status to ",e.jsx("span",{className:"font-medium",children:"All"})," to find an order across every status; the whole query is shareable via the URL."]}),e.jsx(Xs,{value:t,onChange:s,facetKeys:i,search:r,onSearchChange:g})]})]})}const qe="created_at";function he(t){return t.replace(/^metadata\./,"")}function Zs({orderBy:t,onChange:s}){const i=t==null?void 0:t[0],r=(i==null?void 0:i.field)??qe,g=(i==null?void 0:i.direction)??"desc",x=r===qe,m=p=>s([{...i??{},field:r,direction:p}]);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[!x&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2 py-0.5 text-2xs font-medium text-accent/90",children:[e.jsx("span",{className:"text-text-quaternary",children:"sort"}),e.jsx("span",{className:"font-mono max-w-[120px] truncate",title:r,children:he(r)}),e.jsx("button",{onClick:()=>s(void 0),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":"Reset sort to created date",children:e.jsx(se,{className:"w-2.5 h-2.5"})})]}),e.jsxs("div",{className:"flex items-center rounded overflow-hidden border border-surface-border",role:"radiogroup","aria-label":"Sort direction",children:[e.jsx("button",{type:"button",role:"radio","aria-checked":g==="desc",onClick:()=>m("desc"),className:`px-1.5 py-1 transition-colors ${g==="desc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:x?"Newest first":`${he(r)} descending`,children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",role:"radio","aria-checked":g==="asc",onClick:()=>m("asc"),className:`px-1.5 py-1 border-l border-surface-border transition-colors ${g==="asc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:x?"Oldest first":`${he(r)} ascending`,children:e.jsx(us,{className:"w-3.5 h-3.5"})})]})]})}const Js=t=>t.isPriorityPending||t.isClaimPending||t.isAssignPending||t.isUnassignPending||t.isTriagePending||t.isCancelPending,te="inline-flex items-center h-7 px-2.5 text-2xs font-medium text-text-secondary bg-surface border border-surface-border rounded-[4px] hover:border-accent/50 hover:text-text-primary transition-colors disabled:opacity-50 disabled:hover:border-surface-border",De=`${te} appearance-none cursor-pointer`,ea="inline-flex items-center h-7 px-2.5 text-2xs font-medium text-status-error bg-surface border border-status-error/30 rounded-[4px] hover:border-status-error hover:bg-status-error/5 transition-colors disabled:opacity-50";function ta(t){var p;const s=Js(t),i=Ke(),{data:r}=$t(),g=Ft(),x=g!==null?g:((p=r==null?void 0:r.ai)==null?void 0:p.enabled)===!0,m=t.selectedCount>0;return e.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${m?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0 pointer-events-none"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-2.5 pl-3 pr-2 mt-4 mb-3 bg-surface-sunken/60 border-l-2 border-l-accent",children:[e.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-accent tabular-nums",children:[t.selectedCount," selected"]}),e.jsx("div",{className:"mx-1 h-4 w-px bg-surface-border"}),e.jsxs("select",{onChange:o=>{o.target.value&&(t.onSetPriority(parseInt(o.target.value)),o.target.value="")},disabled:s,className:De,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Priority…"}),Us.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))]}),e.jsxs("select",{onChange:o=>{o.target.value&&(t.onClaim(parseInt(o.target.value)),o.target.value="")},disabled:s,className:De,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Claim for…"}),i.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))]}),e.jsx("button",{onClick:t.onAssign,disabled:s,className:te,children:t.isAssignPending?"Assigning…":"Assign to…"}),e.jsx("button",{onClick:t.onUnassign,disabled:s,className:te,children:t.isUnassignPending?"Unassigning…":"Unassign"}),x&&e.jsx("button",{onClick:t.onTriage,disabled:s,className:te,children:t.isTriagePending?"Triaging…":"Triage"}),t.cancelLabel!==!1&&e.jsx("button",{onClick:t.onCancel,disabled:s,className:ea,children:t.isCancelPending?t.cancelLabel?`${t.cancelLabel}…`:"Cancelling…":t.cancelLabel||"Cancel"}),e.jsx("div",{className:"flex-1"}),s&&e.jsx("span",{className:"text-2xs text-text-tertiary animate-pulse",children:"Processing…"}),e.jsx("button",{onClick:t.onClearSelection,className:"px-1 text-2xs font-medium text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"})]})})})}function sa({open:t,onClose:s,selectedCount:i,onSubmit:r,isPending:g}){const[x,m]=b.useState(""),p=()=>{r(x||void 0)};return e.jsx(Xe,{open:t,onClose:s,title:"Submit for AI Triage",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Submit ",e.jsx("span",{className:"font-medium text-text-primary",children:i})," escalation(s) for AI triage? The triage orchestrator will take over resolution."]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium text-text-secondary block mb-1",children:["Triage hint ",e.jsx("span",{className:"text-text-tertiary",children:"(optional)"})]}),e.jsx("input",{type:"text",value:x,onChange:o=>m(o.target.value),placeholder:"e.g., image_orientation",className:"input text-xs font-mono w-full"}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Guides the triage workflow on what remediation to apply"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:s,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:p,disabled:g,className:"btn-primary text-xs",children:g?"Submitting...":"Submit for Triage"})]})]})})}function _(t,s,i){return r=>{t.mutate(r,{onSuccess:()=>{s(),i==null||i()}})}}function aa(t){const s=()=>[...t.selectedIds];return{handleSetPriority:o=>{_(t.setPriority,t.clearSelection)({ids:s(),priority:o})},handleBulkClaim:o=>{_(t.bulkClaim,t.clearSelection)({ids:s(),durationMinutes:o})},handleBulkTriage:o=>{_(t.bulkTriage,t.clearSelection,t.closeTriageModal)({ids:s(),hint:o})},handleBulkAssign:(o,y,N)=>{_(t.bulkAssign,t.clearSelection,t.closeAssignModal)({ids:s(),targetUserId:o,durationMinutes:y,reassign:N})},handleBulkUnassign:()=>{_(t.bulkUnassign,t.clearSelection)({ids:s()})},handleBulkCancel:()=>{_(t.bulkCancel,t.clearSelection,t.closeCancelModal)({ids:s()})}}}function na({claimTarget:t,onClose:s,claimDuration:i,onDurationChange:r,claimDurations:g,onCustomClaimChange:x,onClaim:m,isPending:p}){return e.jsx(Xe,{open:!!t,onClose:s,title:"Claim Escalation",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claim ",e.jsx("span",{className:"font-medium text-text-primary",children:t==null?void 0:t.type})," for:"]}),e.jsxs("select",{value:i,onChange:o=>{r(o.target.value)},className:"select w-full text-sm",children:[g.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),i==="custom"&&e.jsx(Ps,{onChange:x,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:s,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:m,className:"btn-primary text-xs",disabled:p,children:p?"Claiming...":"Claim"})]})]})})}const Ye={pending:"--lt-status-queued-graphic",claimed:"--lt-status-claimed-graphic",resolved:"--lt-status-success-graphic",cancelled:"--lt-text-quaternary",expired:"--lt-text-tertiary"},Ze="--lt-text-quaternary";function ra(t){return Ye[t]??Ze}const V=Object.fromEntries(Object.entries(Ye).map(([t,s])=>[t,`rgb(var(${s}))`])),Ie=40,ia=64,la=24,Ve=3;function Je(t){return t<6e4?`${Math.round(t/1e3)}s`:t<36e5?`${Math.round(t/6e4)}m`:t<864e5?`${(t/36e5).toFixed(1)}h`:`${(t/864e5).toFixed(1)}d`}function Ge(t){const s=Date.now()-t;return s<6e4?"just now":s<36e5?`${Math.round(s/6e4)}m ago`:s<864e5?`${Math.round(s/36e5)}h ago`:`${Math.round(s/864e5)}d ago`}function He(t){return t.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function oa(t,s){return t?[...s.filter(r=>r in t),...Object.keys(t).filter(r=>!s.includes(r))].map(r=>[r,t[r]]):[]}function ca({e:t}){const s=t.endMs-t.startMs;if(s<=0)return null;const i=V.pending,r=V.claimed,g=t.status==="cancelled"||t.status==="expired"?V.cancelled:V.resolved;let x=100,m=0,p=0;return t.claimedMs!==null?(x=Math.max(0,Math.min(100,(t.claimedMs-t.startMs)/s*100)),t.isOpen?m=100-x:(m=Math.max(0,Math.min(100-x,(t.endMs-t.claimedMs)/s*100)),p=Math.max(0,100-x-m))):t.isOpen||(p=100,x=0),e.jsxs("div",{className:"mt-2 h-0.5 rounded-full overflow-hidden flex bg-surface-sunken",children:[x>0&&e.jsx("div",{style:{width:`${x}%`,backgroundColor:i,opacity:.6}}),m>0&&e.jsx("div",{style:{width:`${m}%`,backgroundColor:r,opacity:.6}}),p>0&&e.jsx("div",{style:{width:`${p}%`,backgroundColor:g,opacity:.6}})]})}function da({gapMs:t,heightPx:s}){return e.jsx("div",{className:"relative flex items-center justify-center",style:{height:s},children:t>=6e4&&e.jsx("span",{className:"text-2xs text-text-quaternary font-mono bg-surface px-2 relative z-10",children:Je(t)})})}function Qe({e:t,highlightKeys:s,onRowClick:i}){const[r,g]=b.useState(!1),x=V[t.displayStatus]??`rgb(var(${Ze}))`,m=oa(t.metadata,s),p=r?m:m.slice(0,Ve),o=m.length-Ve;return e.jsxs("div",{className:"cursor-pointer max-w-[460px] min-w-[260px] w-full bg-surface-raised rounded-lg shadow-sm border border-surface-border/60 px-3.5 pt-2.5 pb-2 hover:shadow-md hover:border-surface-border transition-all duration-150",style:{borderTopWidth:"3px",borderTopColor:x},onClick:()=>i==null?void 0:i(t),children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-widest text-text-quaternary shrink-0",children:He(t.role)}),e.jsxs("span",{className:"text-xs font-semibold text-text-primary truncate",title:t.type,children:[t.type,t.subtype&&t.subtype!==t.type&&t.subtype!==""&&e.jsxs("span",{className:"font-normal text-text-tertiary",children:[" · ",t.subtype]})]})]}),p.length>0&&e.jsxs("div",{className:"border-t border-surface-border/40 pt-1 space-y-px",children:[p.map(([y,N])=>{const S=String(N),M=s.includes(y);return e.jsxs("div",{className:"group/row flex items-center gap-1.5 -mx-1 px-1 py-[2px] rounded",children:[e.jsx("span",{className:`shrink-0 w-[60px] text-2xs font-mono uppercase tracking-wide truncate ${M?"text-accent":"text-text-quaternary"}`,title:y,children:y}),e.jsx("span",{className:`flex-1 min-w-0 text-2xs font-medium truncate ${M?"text-text-primary":"text-text-tertiary"}`,title:S,children:S}),e.jsxs("span",{className:"flex items-center gap-px shrink-0 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[e.jsx(Be,{to:_e(y,N,t.role),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${He(t.role)}: ${y} = ${S}`,onClick:j=>j.stopPropagation(),children:e.jsx(hs,{className:"w-2.5 h-2.5"})}),e.jsx(Be,{to:_e(y,N),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${y} = ${S}`,onClick:j=>j.stopPropagation(),children:e.jsx(ps,{className:"w-2.5 h-2.5"})})]})]},y)}),o>0&&e.jsx("button",{className:"flex items-center gap-0.5 text-2xs text-text-quaternary hover:text-accent transition-colors mt-0.5 -mx-1 px-1 py-px",onClick:y=>{y.stopPropagation(),g(N=>!N)},children:r?e.jsxs(e.Fragment,{children:[e.jsx(fs,{className:"w-2.5 h-2.5"})," less"]}):e.jsxs(e.Fragment,{children:[e.jsx(gs,{className:"w-2.5 h-2.5"})," ",o," more"]})})]}),e.jsx(ca,{e:t})]})}function ua({escalations:t,highlightKeys:s=[],onRowClick:i,total:r,page:g,totalPages:x,onPageChange:m}){var d,l;const p=Date.now(),y=t.map(c=>{const k=new Date(c.created_at).getTime(),w=c.resolved_at?new Date(c.resolved_at).getTime():null,f=c.claimed_at?new Date(c.claimed_at).getTime():null,C=!w&&c.status!=="cancelled"&&c.status!=="expired",$=w??(C?p:k+3e4),E=c.status==="pending"&&We(c)?"claimed":c.status;return{...c,startMs:k,claimedMs:f,endMs:$,isOpen:C,displayStatus:E}});if(y.length===0)return e.jsx("p",{className:"mt-12 text-center text-sm text-text-tertiary",children:"No escalations matched."});const N=y.length,M=Math.max(Math.abs((((d=y[N-1])==null?void 0:d.startMs)??0)-(((l=y[0])==null?void 0:l.startMs)??0)),1)/Math.max(N-1,1),j=ia/Math.max(M,1),n=new Set(y.map(c=>new Date(c.startMs).toDateString())).size>1;function u(c){const k=new Date(c),w=k.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return n?k.toLocaleDateString([],{month:"short",day:"numeric"})+" "+w:w}return e.jsxs("div",{className:"mt-4 pb-24",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-1/2 -translate-x-px inset-y-0 w-px bg-surface-border/80"}),y.map((c,k)=>{const w=y[k-1],f=w?Math.abs(c.startMs-w.startMs):null,C=f!==null?Math.max(la,Math.round(f*j)):0,$=k%2===0,E=ra(c.displayStatus),z=`rgb(var(${E}))`,G=c.endMs-c.startMs,U=c.isOpen?Ge(c.startMs):`${Ge(c.startMs)} · ${Je(G)}`;return e.jsxs("div",{children:[k>0&&e.jsx(da,{gapMs:f,heightPx:C}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 flex justify-end items-center",children:$?e.jsxs("div",{className:"flex items-center",children:[e.jsx(Qe,{e:c,highlightKeys:s,onRowClick:i}),e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:Ie}})]}):e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pr-3",children:U})}),e.jsx("div",{className:"relative z-10 flex-shrink-0 w-3.5 h-3.5 rounded-full border-2 border-surface cursor-pointer transition-all duration-150 hover:scale-[1.5]",style:{backgroundColor:z,boxShadow:`0 0 0 3px rgb(var(${E}) / 0.16), 0 1px 3px rgb(var(${E}) / 0.19)`},onClick:()=>i==null?void 0:i(c)}),e.jsx("div",{className:"flex-1 flex justify-start items-center",children:$?e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pl-3",children:U}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:Ie}}),e.jsx(Qe,{e:c,highlightKeys:s,onRowClick:i})]})})]}),e.jsx("div",{className:"flex justify-center relative z-10 mt-0.5",children:e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums bg-surface px-1.5",children:u(c.startMs)})})]},c.id)})]}),x>1&&e.jsxs("div",{className:"sticky bottom-0 z-20 bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-page-x px-page-x pt-2 pb-4 flex items-center justify-between mt-10",children:[e.jsxs("span",{className:"text-2xs text-text-tertiary",children:["Page ",e.jsx("span",{className:"font-medium text-text-secondary",children:g})," ","of ",e.jsx("span",{className:"font-medium text-text-secondary",children:x})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>m(g-1),disabled:g<=1,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(xs,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>m(g+1),disabled:g>=x,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(ms,{className:"w-4 h-4"})})]})]})]})}function Ra(){var Fe,Re,Le;const t=Is(),{filters:s,setFilter:i,pagination:r}=Ls({filters:{role:"",type:"",priority:"",status:"available",search:""}});Rt({role:s.role||null,verbs:["created","claimed"]});const g=_s(s.search),x=Ke(),[m,p]=b.useState(null),[o,y]=b.useState("30"),[N,S]=b.useState(0),M=b.useCallback(a=>S(a),[]),[j,P]=b.useState(new Set),n=b.useRef(null),u=b.useRef(null),d=b.useCallback(a=>{var v;if((v=u.current)==null||v.disconnect(),u.current=null,!a||typeof ResizeObserver>"u")return;const h=new ResizeObserver(()=>{var Z;(Z=n.current)==null||Z.style.setProperty("--lt-sticky-top",`${a.offsetHeight-1}px`)});h.observe(a),u.current=h},[]),[l,c]=b.useState(!1),[k,w]=Vs(),f=b.useMemo(()=>Lt(k),[k]),C=b.useCallback(a=>{w(h=>{const v=new URLSearchParams(h);return _t(v,a),v.delete("page"),v})},[w]),{data:$}=Bt(l),E=zt(f)+(s.search?1:0),z="facet-query",{setPanel:G,closePanel:U,open:et,ownerKey:tt}=Ut();b.useEffect(()=>{if(!l){U(z);return}G(e.jsx(Ys,{value:f,onChange:C,facetKeys:($==null?void 0:$.keys)??[],search:s.search??"",onSearchChange:a=>i("search",a),activeFacetCount:E,onClear:()=>{C({}),i("search","")},onClose:()=>c(!1)}),{width:420,key:z})},[l,f,C,$,s.search,i,E,G,U]);const pe=et&&tt===z,ae=b.useRef(!1);b.useEffect(()=>{if(pe){ae.current=!0;return}ae.current&&(ae.current=!1,c(!1))},[pe]);const[st,ne]=b.useState(!1),[at,re]=b.useState(!1),[nt,ie]=b.useState(!1),rt=b.useCallback(a=>C({...f,orderBy:a}),[f,C]),H=Gs(),{data:Q}=qt(),fe=Dt(),it=b.useCallback(()=>{var v;const a=window.prompt("Pin label:");if(!(a!=null&&a.trim()))return;const h=((v=Q==null?void 0:Q.preferences)==null?void 0:v.pinnedViews)??[];fe.mutate({pinnedViews:[...h,{id:It(),label:a.trim(),url:H.pathname+H.search,badge:!0}]})},[H.pathname,H.search,Q,fe]),{canBulk:lt}=Vt(),{kiosk:le}=Gt(),ge=f.facets?Object.keys(f.facets):[],oe=k.get("view"),ot=b.useCallback(a=>{w(h=>{const v=new URLSearchParams(h);return a?v.set("view",a):v.delete("view"),v},{replace:!0})},[w]),q=oe==="timeline",ct=b.useCallback(a=>{const{[a]:h,...v}=f.facets??{};C({...f,facets:Object.keys(v).length>0?v:void 0})},[f,C]),be=Ht(),ye=Qt(),ve=Kt(),ce=Wt(),je=Xt(),de=Yt(),K=Zt(),{data:ue}=Jt(),{data:F}=es(),{data:xe}=ts(),{user:W,isSuperAdmin:dt,hasRoleType:ut}=ss(),Ne=dt||ut("admin"),Ce=b.useMemo(()=>new Set(((W==null?void 0:W.roles)??[]).map(a=>a.role)),[W]),xt=b.useMemo(()=>{const a=(F==null?void 0:F.roles)??[];return(Ne?a:a.filter(v=>Ce.has(v.role)&&!cs(v.role))).map(v=>({value:v.role,label:as(v)})).sort((v,Z)=>v.label.localeCompare(Z.label))},[F,Ne,Ce]);b.useEffect(()=>{P(new Set)},[s.role,s.type,s.priority,s.status,g,r.page,r.pageSize]);const D=s.status||"",X=D==="available",ke=D==="claimed",mt=ke?"pending":D==="resolved"?"resolved":D==="cancelled"?"cancelled":D==="expired"?"expired":void 0,T=s.role||(((Fe=f.roles)==null?void 0:Fe.length)===1?f.roles[0]:null),we=ns(T??"",void 0,!!T),ht=rs(T??"",void 0,!!T),me=T?Ms((Re=ht.data)==null?void 0:Re.form_schema).cancel:void 0,I=((Le=we.data)==null?void 0:Le.list_schema)??null,Se=!T||we.isFetched,Pe=100,Me={role:s.role||void 0,type:s.type||void 0,priority:s.priority?parseInt(s.priority):void 0,limit:q?Pe:r.pageSize,offset:r.offset,sort_by:"created_at",order:"desc",search:g||void 0,...f,include:Fs(I)?"envelope":void 0},pt=is({...Me,enabled:X&&Se}),ft=ls({status:mt,claimed:ke||void 0,...Me,enabled:!X&&Se}),gt=X?pt:ft,{data:R,isLoading:bt,error:Y,refetch:yt,isFetching:Te}=gt,A=(R==null?void 0:R.escalations)??[],O=(R==null?void 0:R.total)??0,Ae=!!T&&!!I&&!!I["x-lt-layout"]&&I["x-lt-layout"]!=="table",Ee=Ae&&!q&&(oe?oe==="rich":!0),Oe=q?"timeline":Ee?"rich":"table",$e=b.useMemo(()=>{if(!f.jeopardy||!T)return null;const a=((F==null?void 0:F.roles)??[]).find(v=>v.role===T),h=(a==null?void 0:a.priority_threshold_minutes)??(a==null?void 0:a.sla_minutes)??null;return h!=null?os(h*6e4):null},[f.jeopardy,T,F]),vt=b.useMemo(()=>{const a=new Set;for(const h of A)j.has(h.id)&&a.add(h.role);return[...a]},[A,j]),jt=b.useMemo(()=>A.filter(a=>j.has(a.id)&&We(a)).length,[A,j]),Nt=b.useCallback(()=>P(new Set),[]),Ct=()=>{if(!m)return;const a=o==="custom"?N:parseInt(o);!a||a<=0||be.mutate({id:m.id,durationMinutes:a},{onSuccess:()=>{p(null),t(`/escalations/detail/${m.id}`)}})},{handleSetPriority:kt,handleBulkClaim:wt,handleBulkTriage:St,handleBulkAssign:Pt,handleBulkUnassign:Mt,handleBulkCancel:Tt}=aa({selectedIds:j,clearSelection:Nt,setPriority:ye,bulkClaim:ve,bulkTriage:de,bulkAssign:ce,bulkUnassign:je,bulkCancel:K,closeTriageModal:()=>ne(!1),closeAssignModal:()=>re(!1),closeCancelModal:()=>ie(!1)}),At=a=>{const h=new Set(j);h.has(a)?h.delete(a):h.add(a),P(h)},Et=()=>{j.size===A.length?P(new Set):P(new Set(A.map(a=>a.id)))},Ot=[lt?{key:"select",label:e.jsx("input",{type:"checkbox",checked:A.length>0&&j.size===A.length,onChange:Et,className:"rounded"}),render:a=>e.jsx("input",{type:"checkbox",checked:j.has(a.id),onChange:h=>{h.stopPropagation(),At(a.id)},onClick:h=>h.stopPropagation(),className:"rounded"}),className:"w-10",priority:1}:{key:"spacer",label:"",render:()=>null,className:"w-10",priority:3},...Es({highlightKeys:ge}),{key:"actions",label:"",render:a=>e.jsx(qs,{children:e.jsx(Ds,{icon:bs,title:"Claim escalation",onClick:()=>p(a),alwaysVisible:!0,colorClass:"text-accent/40 hover:text-accent",size:"sm"})}),className:"w-10 text-right"}];return e.jsxs("div",{ref:n,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-10 min-w-0",children:[e.jsx(Os,{role:s.role,options:xt,onChange:a=>i("role",a),locked:le}),!le&&e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:all-escalations"},className:"text-text-quaternary hover:text-accent transition-colors mt-1 shrink-0",title:"Open docs for this page",children:e.jsx(ys,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsxs("div",{ref:d,className:"sticky top-0 z-20 bg-surface",children:[e.jsx($s,{filters:s,setFilter:i,roles:(ue==null?void 0:ue.roles)??[],types:(xe==null?void 0:xe.types)??[],showStatus:!0,showSearch:!1,showRole:!le,actions:e.jsxs(e.Fragment,{children:[q&&e.jsxs("span",{className:"text-2xs text-text-tertiary whitespace-nowrap",children:[O>100&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-medium text-text-secondary",children:[(r.page-1)*100+1,"–",Math.min(r.page*100,O)]})," of "]}),e.jsx("span",{className:"font-medium text-text-secondary",children:O})," ",O===1?"escalation":"escalations"]}),e.jsx(Zs,{orderBy:f.orderBy,onChange:rt}),e.jsx("div",{role:"radiogroup","aria-label":"List view",className:"flex items-center rounded overflow-hidden border border-surface-border",children:[{key:"table",title:"Table view",Icon:vs},{key:"rich",title:"Rich view",Icon:js},{key:"timeline",title:"Timeline view",Icon:Ns}].filter(a=>a.key!=="rich"||Ae).map(({key:a,title:h,Icon:v})=>e.jsx("button",{role:"radio","aria-checked":Oe===a,onClick:()=>ot(a),className:`px-1.5 py-1 transition-colors ${Oe===a?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:h,children:e.jsx(v,{className:"w-3.5 h-3.5"})},a))}),e.jsxs("button",{onClick:()=>c(a=>!a),"aria-pressed":l,className:`relative rounded border border-surface-border px-1.5 py-1 transition-colors ${l?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:"Faceted query",children:[e.jsx(Cs,{className:"w-3.5 h-3.5"}),E>0&&e.jsx("span",{className:"absolute -right-1 -top-1 flex h-3.5 min-w-[14px] items-center justify-center rounded-full bg-accent px-0.5 text-2xs font-medium text-text-inverse",children:E})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>yt(),disabled:Te,className:"inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover disabled:opacity-50",title:"Refresh",children:e.jsx(ks,{className:`w-4 h-4 ${Te?"animate-spin":""}`})}),e.jsx("button",{onClick:it,className:"inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover",title:"Pin this view — save the current filters to your Pinned section","data-testid":"pin-current-view",children:e.jsx(ws,{className:"w-4 h-4"})})]})]})}),e.jsx(ta,{selectedCount:j.size,onClearSelection:()=>P(new Set),onSetPriority:kt,onClaim:wt,onAssign:()=>re(!0),onUnassign:Mt,onTriage:()=>ne(!0),onCancel:()=>ie(!0),isPriorityPending:ye.isPending,isClaimPending:ve.isPending,isAssignPending:ce.isPending,isUnassignPending:je.isPending,isTriagePending:de.isPending,isCancelPending:K.isPending,cancelLabel:me}),(f.facets&&Object.keys(f.facets).length>0||f.jeopardy)&&e.jsxs("div",{className:"bg-surface/98 backdrop-blur-sm border-b border-surface-border/30 -mx-page-x px-page-x py-2 flex items-center gap-1.5 flex-wrap",children:[f.jeopardy&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-status-error px-2.5 py-0.5 text-2xs font-semibold text-text-inverse",children:[e.jsx(Ss,{className:"w-2.5 h-2.5",strokeWidth:2.5}),"in jeopardy",$e&&e.jsxs("span",{className:"font-mono font-normal opacity-90",children:["> ",$e]}),e.jsx("button",{onClick:()=>C({...f,jeopardy:void 0}),className:"ml-0.5 -mr-0.5 flex items-center text-text-inverse/70 hover:text-text-inverse transition-colors","aria-label":"Clear jeopardy filter",children:e.jsx(se,{className:"w-2.5 h-2.5"})})]}),Object.entries(f.facets??{}).map(([a,h])=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2.5 py-0.5 text-2xs font-medium text-accent/90",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:a}),e.jsx("span",{className:"text-text-quaternary",children:"="}),e.jsx("span",{className:"font-mono max-w-[160px] truncate",title:String(h),children:String(h)}),e.jsx("button",{onClick:()=>ct(a),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":`Remove ${a} filter`,children:e.jsx(se,{className:"w-2.5 h-2.5"})})]},a)),Object.keys(f.facets??{}).length>1&&e.jsx("button",{onClick:()=>C({...f,facets:void 0}),className:"text-2xs text-text-quaternary hover:text-text-secondary transition-colors px-1",children:"clear all"})]})]}),Y&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-md bg-status-error/10 border border-status-error/20 text-xs text-status-error",children:Y.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${Y.message}`}),q?e.jsx(ua,{escalations:A,highlightKeys:ge,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),total:O,page:r.page,totalPages:Math.ceil(O/Pe),onPageChange:r.setPage}):Ee?e.jsx(Rs,{role:T,listSchema:I,activeEscalations:A,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),onOpenGroup:a=>t(a),onAddFacet:(a,h)=>C({...f,facets:{...f.facets??{},[a]:typeof h=="object"&&h!==null?JSON.stringify(h):h}}),total:O,page:r.page,totalPages:r.totalPages(O),pageSize:r.pageSize,onPageChange:r.setPage,onPageSizeChange:r.setPageSize}):e.jsxs(e.Fragment,{children:[e.jsx(Bs,{columns:Ot,data:A,layout:"fixed",keyFn:a=>a.id,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),isLoading:bt,emptyMessage:Y?"Unable to load data":"No escalations"}),e.jsx(zs,{page:r.page,totalPages:r.totalPages(O),onPageChange:r.setPage,total:O,pageSize:r.pageSize,onPageSizeChange:r.setPageSize})]}),e.jsx(na,{claimTarget:m,onClose:()=>p(null),claimDuration:o,onDurationChange:a=>{y(a),S(0)},claimDurations:x,customClaimMinutes:N,onCustomClaimChange:M,onClaim:Ct,isPending:be.isPending}),e.jsx(sa,{open:st,onClose:()=>ne(!1),selectedCount:j.size,onSubmit:St,isPending:de.isPending}),e.jsx(Ts,{open:at,onClose:()=>re(!1),selectedCount:j.size,selectedRoles:vt,claimedCount:jt,onSubmit:Pt,isPending:ce.isPending}),e.jsx(As,{open:nt,onClose:()=>ie(!1),onConfirm:Tt,selectedCount:j.size,isPending:K.isPending,error:K.error,actionLabel:typeof me=="string"?me:void 0})]})}export{Ra as AvailableEscalationsPage};
2
- //# sourceMappingURL=AvailableEscalationsPage-CEDwyzlx.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,a as u}from"./vendor-query-RUZdMvN6.js";import{M as L}from"./Modal-BU7No9NH.js";import{a as U}from"./users-D-DhFQBy.js";import{b as B,X as I}from"./index-BEeGFfuP.js";import{D as q,f as O}from"./constants-BHkpVaqx.js";import{u as R}from"./useDebouncedValue-DuE9Mj3I.js";function P({open:a,onClose:i,onConfirm:l,selectedCount:s,isPending:r,error:c,actionLabel:d}){const x=!!s&&s>1,o=d||"Cancel",m=x?`${o} ${s} Items`:o==="Cancel"?"Cancel Item":o,n=x?`Are you sure you want to ${o}? This removes ${s} items from the work queue.`:`Are you sure you want to ${o}? This removes the item from the work queue.`;return e.jsx(L,{open:a,onClose:i,title:m,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:n}),e.jsx("p",{className:"text-xs text-text-tertiary",children:"This action cannot be undone."}),c&&e.jsx("p",{className:"text-xs text-status-error",children:c.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:i,disabled:r,className:"btn-secondary text-xs",children:"Keep"}),e.jsx("button",{onClick:l,disabled:r,className:"bg-status-error text-text-inverse px-3 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity disabled:opacity-50",children:r?"Working...":`Yes, ${o}`})]})]})})}const W="x-lt-labels",X=["claim","cancel","submit","escalate","release"];function ee(a){const i=a==null?void 0:a[W];if(!i||typeof i!="object"||Array.isArray(i))return{};const l=i,s={};l.cancel===!1&&(s.cancel=!1);for(const r of X){const c=l[r];typeof c=="string"&&c.trim().length>0&&(s[r]=c.trim())}return s}function z(){const{data:a}=B();return u.useMemo(()=>{var l;return(((l=a==null?void 0:a.escalation)==null?void 0:l.claimDurations)??q).map(s=>({value:String(s),label:O(s)}))},[a])}const G=[{value:1,label:"minutes"},{value:60,label:"hours"}];function K({onChange:a,compact:i,autoFocus:l,"data-testid":s="custom-duration-input"}){const[r,c]=u.useState(""),[d,x]=u.useState(1);u.useEffect(()=>{const n=parseInt(r);a(n>0?n*d:0)},[r,d,a]);const o=i?"text-xs":"text-sm",m=i?"w-16":"w-20";return e.jsxs("div",{className:"flex items-center gap-2","data-testid":s,children:[e.jsx("input",{type:"number",min:1,max:d===60?24:1440,value:r,onChange:n=>c(n.target.value),placeholder:d===60?"hrs":"min",className:`input ${o} ${m} text-center`,autoFocus:l,"data-testid":`${s}-quantity`}),e.jsx("select",{value:d,onChange:n=>x(parseInt(n.target.value)),className:`select ${o} py-1`,"data-testid":`${s}-unit`,children:G.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))})]})}function te({open:a,onClose:i,selectedCount:l,selectedRoles:s,onSubmit:r,isPending:c,claimedCount:d=0,result:x=null}){const{isSuperAdmin:o}=I(),m=z(),[n,f]=u.useState("user"),[p,b]=u.useState(null),[g,v]=u.useState(""),[h,N]=u.useState("30"),[$,j]=u.useState(0),[k,S]=u.useState(!1),T=u.useCallback(t=>j(t),[]),_=!o&&s.length===1?s[0]:void 0,D=R(g,250),{data:y,isLoading:C}=U({role:_,status:"active",search:D.trim()||void 0,limit:200}),A=(y==null?void 0:y.users)??[],w=()=>{f("user"),b(null),v(""),N("30"),j(0),S(!1),i()},E=t=>{b(t),f("duration")},M=()=>{f("user")},F=()=>{if(!p)return;const t=h==="custom"?$:parseInt(h);!t||t<=0||r(p.id,t,k)};return e.jsx(L,{open:a,onClose:w,title:"Assign Escalations",children:e.jsxs("div",{className:"space-y-4",children:[n==="user"&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Select a user to assign"," ",e.jsx("span",{className:"font-medium text-text-primary",children:l})," ","escalation(s) to:"]}),e.jsx("input",{type:"text",value:g,onChange:t=>v(t.target.value),placeholder:"Search by name or email...",className:"input text-xs w-full",autoFocus:!0}),e.jsxs("div",{className:"max-h-60 overflow-y-auto border border-surface-border rounded-lg divide-y divide-surface-border",children:[C&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"Loading users..."}),!C&&A.length===0&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"No users found"}),A.map(t=>e.jsxs("button",{onClick:()=>E(t),className:"w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors",children:[e.jsx("p",{className:"text-xs font-medium text-text-primary",children:t.display_name||t.external_id}),t.email&&e.jsx("p",{className:"text-2xs text-text-tertiary",children:t.email})]},t.id))]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:w,className:"btn-secondary text-xs",children:"Cancel"})})]}),n==="duration"&&p&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Assign to"," ",e.jsx("span",{className:"font-medium text-text-primary",children:p.display_name||p.external_id})," ","for:"]}),e.jsxs("select",{value:h,onChange:t=>{N(t.target.value),j(0)},className:"select w-full text-sm",children:[m.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),h==="custom"&&e.jsx(K,{onChange:T,autoFocus:!0}),d>0&&e.jsxs("label",{className:"flex items-start gap-2 text-xs text-text-secondary",children:[e.jsx("input",{type:"checkbox",checked:k,onChange:t=>S(t.target.checked),className:"mt-0.5"}),e.jsxs("span",{children:["Also reassign ",e.jsx("span",{className:"font-medium text-text-primary",children:d})," ","item(s) with a live claim — the current holder loses the item. Unchecked, those are skipped."]})]}),x&&x.skipped>0&&e.jsxs("p",{className:"text-xs text-status-warning","data-testid":"assign-skip-note",children:["Assigned ",x.assigned," · skipped ",x.skipped," with live claims."]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:M,className:"btn-secondary text-xs",children:"Back"}),e.jsx("button",{onClick:F,disabled:c,className:"btn-primary text-xs",children:c?"Assigning...":"Assign"})]})]})]})})}export{te as B,K as C,P as a,ee as r,z as u};
2
- //# sourceMappingURL=BulkAssignModal-BDzaHGAb.js.map
@@ -1,2 +0,0 @@
1
- import{a as l,j as e}from"./vendor-query-RUZdMvN6.js";import{d as L,e as A,b as I,c as T,u as U}from"./personas-CQr9sXg3.js";import{F as K,a as D}from"./FilterBar-DyojX5m4.js";import{P as q}from"./PageHeader-CFVw67M6.js";import{R as O}from"./RolePill-Di_5hfvw.js";import{e as F,a5 as M}from"./index-BEeGFfuP.js";import{M as H}from"./Modal-BU7No9NH.js";import{u as R}from"./vendor-react-CdqEC2zv.js";import{a as V}from"./users-D-DhFQBy.js";import{u as W}from"./useDebouncedValue-DuE9Mj3I.js";import{X as z,a7 as G}from"./vendor-icons-h-jlRSb9.js";function Y({open:s,onClose:u}){const r=R(),t=L(),[o,c]=l.useState(""),[n,a]=l.useState(""),[d,i]=l.useState(""),[f,h]=l.useState(s);s!==f&&(h(s),s&&(c(""),a(""),i(""),t.reset()));const g=()=>{const m=o.trim().toLowerCase();m&&t.mutate({key:m,title:n.trim()||void 0,description:d.trim()||void 0},{onSuccess:()=>{u(),r(`/admin/personas/${encodeURIComponent(m)}`)}})};return e.jsx(H,{open:s,onClose:u,title:"Create Persona",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Key (required)"}),e.jsx("input",{type:"text",value:o,onChange:m=>c(m.target.value),placeholder:"e.g., floor-manager",className:"input text-xs w-full font-mono",onKeyDown:m=>{m.key==="Enter"&&g()}}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Lowercase letters, numbers, hyphens, and underscores only. Stable — it names the persona everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Title"}),e.jsx("input",{type:"text",value:n,onChange:m=>a(m.target.value),placeholder:"e.g., Floor Manager",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("textarea",{value:d,onChange:m=>i(m.target.value),placeholder:"The day in the life, one paragraph.",rows:3,className:"input text-xs w-full resize-y"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:u,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:g,disabled:!o.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function X({selected:s,onSelect:u,excludeIds:r=[],placeholder:t="Search users…"}){const[o,c]=l.useState(!1),[n,a]=l.useState(""),d=l.useRef(null),i=W(n),f=20,{data:h,isFetching:g}=V({search:i.trim()||void 0,limit:f});l.useEffect(()=>{if(!o)return;function x(v){d.current&&!d.current.contains(v.target)&&c(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const m=l.useMemo(()=>new Set(r),[r]),y=((h==null?void 0:h.users)??[]).filter(x=>!m.has(x.id)),p=(h==null?void 0:h.total)??0,b=p>((h==null?void 0:h.users.length)??0),j=(s==null?void 0:s.label)??"",N=o?n:j;return e.jsxs("div",{ref:d,className:"relative",children:[e.jsx("input",{type:"text",value:N,onFocus:()=>{c(!0),a("")},onChange:x=>{a(x.target.value),x.target.value||u(null),o||c(!0)},placeholder:t,className:"input text-xs w-full min-w-0","aria-label":"User"}),o&&e.jsxs("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:[y.map(x=>{const v=x.display_name||x.external_id;return e.jsxs("button",{type:"button",onClick:()=>{u({id:x.id,label:v}),a(""),c(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 min-w-0 ${(s==null?void 0:s.id)===x.id?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-xs text-text-primary truncate",children:v}),x.email&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:x.email})]},x.id)}),y.length===0&&e.jsx("p",{className:"px-3 py-4 text-center text-2xs text-text-quaternary",children:g?"Searching…":n?`No users match "${n}"`:"No users available"}),b&&e.jsxs("p",{className:"px-3 py-1.5 text-2xs text-text-quaternary border-t border-surface-border/60 tabular-nums",children:[y.length," of ",p," — type to narrow"]})]})]})}const S="text-2xs font-semibold uppercase tracking-widest text-text-tertiary";function B({personaKey:s,onClose:u}){const{data:r}=A(s??""),t=I(),o=T(),[c,n]=l.useState(null),a=(r==null?void 0:r.assignees)??[],d=()=>{!r||!c||t.mutate({userId:c.id,key:r.key},{onSuccess:()=>n(null)})};return e.jsxs("div",{className:"h-full overflow-y-auto px-5 pt-4 pb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("p",{className:S,children:"Assignees"}),u&&e.jsx("button",{onClick:u,className:"icon-link",title:"Close","aria-label":"Close",children:e.jsx(z,{className:"w-4 h-4"})})]}),r?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:r.title||r.key}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:[r.roles.length," role",r.roles.length===1?"":"s"," per assignment"]})]}),a.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Assign a user to compose their whole surface in one step."}):e.jsx("div",{className:"flex flex-col gap-2",children:a.map(i=>e.jsxs("span",{className:"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate",title:i.external_id,children:i.display_name||i.external_id}),e.jsx("span",{className:"shrink-0 text-2xs text-text-tertiary",children:e.jsx(F,{date:i.assigned_at})}),e.jsx("button",{onClick:()=>o.mutate({userId:i.id,key:r.key}),className:"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1",title:`Unassign ${i.display_name||i.external_id}`,children:"×"})]},i.id))}),e.jsxs("div",{className:"pt-3 border-t border-surface-border space-y-2",children:[e.jsx("p",{className:S,children:"Assign User"}),e.jsx(X,{selected:c,onSelect:n,excludeIds:a.map(i=>i.id)}),e.jsx("div",{className:"flex justify-end pt-1",children:e.jsx("button",{onClick:d,disabled:!c||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Assign"})}),(t.error||o.error)&&e.jsx("p",{className:"text-2xs text-status-error",children:(t.error||o.error).message})]})]}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a persona to assign users. An assignee joins every linked role at its scope — sidebar pins and forms compose from the roles."})]})}const $="persona-assignees",_="180px 140px 1fr 220px 56px 40px",E="text-text-secondary transition-colors group-hover/row:text-text-primary",P="text-2xs font-semibold uppercase tracking-widest text-text-quaternary",w="py-2",C="py-2.5";function k(s){return s.title?s.title:s.key.replace(/[-_]+/g," ").replace(/\b\w/g,u=>u.toUpperCase())}function J(){return e.jsxs("div",{className:"grid gap-4 px-3 border-b border-surface-border bg-surface",style:{gridTemplateColumns:_},children:[e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Persona"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Key"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Description"}),e.jsx("span",{className:`${P} ${w} flex items-center`,children:"Roles"}),e.jsx("span",{className:`${P} ${w} flex items-center justify-end`,children:"Users"}),e.jsx("span",{className:w})]})}const Q=3;function Z({persona:s,active:u,onClick:r,onConfigure:t}){const o=s.roles??[],c=o.slice(0,Q),n=o.length-c.length;return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&r()},className:`grid gap-4 px-3 cursor-pointer group/row transition-colors ${u?"bg-surface-hover/60":"hover:bg-surface-hover/30"}`,style:{gridTemplateColumns:_},children:[e.jsx("span",{className:`flex items-center min-w-0 text-sm truncate ${C} ${E}`,children:k(s)}),e.jsx("span",{className:`flex items-center text-xs font-mono truncate ${C} text-text-tertiary transition-colors group-hover/row:text-text-secondary`,children:s.key}),e.jsx("span",{className:`flex items-center min-w-0 text-xs text-text-tertiary truncate ${C} transition-colors group-hover/row:text-text-secondary`,children:s.description??""}),e.jsxs("div",{className:`flex items-center flex-wrap gap-x-2.5 gap-y-0.5 min-w-0 ${C}`,children:[c.map(a=>e.jsx("span",{className:"min-w-0 truncate text-text-secondary",children:e.jsx(O,{role:a.role,tone:"inherit"})},a.role)),n>0&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums",children:["+",n]})]}),e.jsx("span",{className:`flex items-center justify-end text-sm tabular-nums ${C} transition-colors ${E}`,children:s.user_count>0?s.user_count:""}),e.jsx("span",{className:`flex items-center justify-end ${C}`,children:e.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-text-quaternary/70 hover:text-accent transition-colors",title:`Configure ${k(s)}`,"aria-label":`Configure ${k(s)}`,children:e.jsx(G,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})]})}function ue(){const s=R(),{data:u,isLoading:r}=U(),t=M(),[o,c]=l.useState(!1),[n,a]=l.useState(""),[d,i]=l.useState(null),f=(u==null?void 0:u.personas)??[],h=l.useRef(null),g=l.useRef(!1);l.useEffect(()=>{t&&d!==h.current&&(h.current=d,d?t.setPanel(e.jsx(B,{personaKey:d,onClose:()=>i(null)}),{key:$,width:360}):(g.current=!1,t.closePanel($)))},[d,t]),l.useEffect(()=>{if(!(!t||!d)){if(t.open&&t.ownerKey===$){g.current=!0;return}g.current&&(g.current=!1,i(null))}},[t,d]);const m=l.useRef(t);m.current=t,l.useEffect(()=>()=>{var p;h.current&&((p=m.current)==null||p.closePanel($))},[]);const y=l.useMemo(()=>{const p=[...f].sort((j,N)=>k(j).localeCompare(k(N)));if(!n.trim())return p;const b=n.toLowerCase();return p.filter(j=>{var N,x;return j.key.toLowerCase().includes(b)||k(j).toLowerCase().includes(b)||((N=j.description)==null?void 0:N.toLowerCase().includes(b))||((x=j.roles)==null?void 0:x.some(v=>v.role.toLowerCase().includes(b)))})},[f,n]);return e.jsxs("div",{children:[e.jsx(q,{title:"Personas",docsHash:"#docs:dashboard.md:personas",actions:e.jsx("button",{onClick:()=>c(!0),className:"btn-primary text-xs flex items-center gap-1.5",children:"+ Add Persona"})}),!r&&f.length>0&&e.jsxs(K,{children:[e.jsx(D,{label:"Search",value:n,onChange:a,placeholder:`${f.length} personas…`}),n&&y.length!==f.length&&e.jsxs("span",{className:"text-2xs text-text-quaternary tabular-nums shrink-0",children:[y.length," of ",f.length]})]}),e.jsxs("div",{className:"overflow-x-clip",children:[!r&&f.length>0&&y.length>0&&e.jsx("div",{className:"sticky top-[60px] z-10 bg-surface",children:e.jsx(J,{})}),r?e.jsx("div",{className:"animate-pulse space-y-3 mt-6",children:[1,2,3].map(p=>e.jsx("div",{className:"h-10 bg-surface-sunken rounded w-full"},p))}):y.length===0?e.jsx("p",{className:"text-sm text-text-tertiary mt-8",children:n?"Clear the search to see all personas.":"Create a persona to bundle roles into a one-step assignment."}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:y.map(p=>e.jsx(Z,{persona:p,active:p.key===d,onClick:()=>i(p.key),onConfigure:()=>s(`/admin/personas/${encodeURIComponent(p.key)}`)},p.key))})]}),e.jsx(Y,{open:o,onClose:()=>c(!1)})]})}export{ue as PersonasPage};
2
- //# sourceMappingURL=PersonasPage-DRoneLfx.js.map
@@ -1,2 +0,0 @@
1
- import{a as b,j as e}from"./vendor-query-RUZdMvN6.js";import{a as z}from"./tasks-QKuXlyLe.js";import{D as S,f as L,C as V,a as J,b as q,c as G,J as P,S as T}from"./index-BEeGFfuP.js";import{P as K}from"./PageHeaderWithStats-D9tQxILm.js";import{S as W}from"./StatusBadge-BDeUwPtb.js";import{W as Q}from"./WorkflowPill-CN-952iI.js";import{T as y}from"./TimestampCell-CI8UrDuQ.js";import{L as D,e as X}from"./vendor-react-CdqEC2zv.js";import{R as Y}from"./RolePill-Di_5hfvw.js";import{U as Z}from"./UserName-Ck-eLb-1.js";import"./vendor-icons-h-jlRSb9.js";import"./users-D-DhFQBy.js";const ee="bg-stripes animate-pulse opacity-70";function $(t){switch(t){case"completed":return"text-status-success";case"in_progress":case"pending":return"text-status-warning";case"needs_intervention":return"text-status-error";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function I(t){switch(t){case"resolved":return"text-status-success";case"pending":return"text-status-warning";case"cancelled":return"text-text-tertiary";default:return"text-text-tertiary"}}function te(t,a,l){return`${t==="task"?"Task":l?"Notification":"Escalation"} is ${a.replace(/_/g," ")}`}function se(t,a){if(a)return ee;switch(t){case"completed":case"resolved":return"bg-status-success";case"pending":case"in_progress":case"needs_intervention":return"bg-status-warning";case"cancelled":return"bg-status-error";default:return"bg-text-tertiary"}}function ae(t){return t.startsWith("mcp")||t.startsWith("Mcp")}function E(t){return!t.workflow_type}function A(t,a){if(t.length<=a)return t;const l=Math.floor((a-1)/2);return`${t.slice(0,l)}…${t.slice(t.length-l)}`}function ne(t,a){const l=Date.now(),c=new Map,x=[];for(const s of a)s.task_id?(c.has(s.task_id)||c.set(s.task_id,[]),c.get(s.task_id).push(s)):x.push(s);const r=[...t].sort((s,d)=>new Date(s.created_at).getTime()-new Date(d.created_at).getTime()),i=[];for(const s of t)i.push(new Date(s.created_at).getTime()),s.completed_at&&i.push(new Date(s.completed_at).getTime());for(const s of a)i.push(new Date(s.created_at).getTime()),s.resolved_at&&i.push(new Date(s.resolved_at).getTime()),s.claimed_at&&i.push(new Date(s.claimed_at).getTime());if(i.length===0)return{lanes:[],timeMin:0,timeMax:1};const o=Math.min(...i),f=t.some(s=>!s.completed_at)||a.some(s=>!s.resolved_at)?Math.max(l,Math.max(...i)):Math.max(...i),p=f-o||1,m=s=>(s-o)/p*100,h=[];for(const s of r){const d=new Date(s.created_at).getTime(),j=s.completed_at?new Date(s.completed_at).getTime():l,g=!s.completed_at;h.push({kind:"task",id:s.id,label:s.workflow_type,taskId:s.id,startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:g,task:s});const v=(c.get(s.id)||[]).sort((n,u)=>new Date(n.created_at).getTime()-new Date(u.created_at).getTime());for(const n of v){const u=new Date(n.created_at).getTime(),N=n.resolved_at?new Date(n.resolved_at).getTime():l,M=!n.resolved_at;let w=null;if(n.claimed_at){const U=new Date(n.claimed_at).getTime(),H=N-u||1;w=(U-u)/H*100}h.push({kind:"escalation",id:n.id,label:n.role,taskId:s.id,startMs:u,endMs:N,startPct:m(u),widthPct:Math.max((N-u)/p*100,.5),durationMs:N-u,isOpen:M,escalation:n,claimPct:w})}}for(const s of x){const d=new Date(s.created_at).getTime(),j=s.resolved_at?new Date(s.resolved_at).getTime():l;let g=null;if(s.claimed_at){const v=new Date(s.claimed_at).getTime(),n=j-d||1;g=(v-d)/n*100}h.push({kind:"escalation",id:s.id,label:s.role,taskId:"",startMs:d,endMs:j,startPct:m(d),widthPct:Math.max((j-d)/p*100,.5),durationMs:j-d,isOpen:!s.resolved_at,escalation:s,claimPct:g})}return{lanes:h,timeMin:o,timeMax:f}}function re(t,a,l,c=500){const[x,r]=b.useState(0),i=b.useRef(null),o=l-a||1;b.useEffect(()=>{if(t===0)return;i.current=null,r(0);let f;const p=m=>{i.current===null&&(i.current=m);const h=m-i.current,s=Math.min(h/c,1),d=1-Math.pow(1-s,3);r(d),s<1&&(f=requestAnimationFrame(p))};return f=requestAnimationFrame(p),()=>cancelAnimationFrame(f)},[t,c]);const k=b.useCallback(f=>{const p=(f.startMs-a)/o,m=(f.endMs-a)/o;if(x<p)return{width:0,opacity:0};const h=m-p||.001,s=Math.min((x-p)/h,1),d=f.widthPct*s,j=Math.min(s/.1,1);return{width:d,opacity:j}},[x,a,o]);return{progress:x,animatedBar:k}}function R({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})})}function B({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})})}function F({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}function ie({allExpanded:t,onToggleAll:a}){return e.jsxs("div",{className:"flex items-center gap-4 mb-4 flex-wrap",children:[e.jsx("button",{onClick:a,className:"text-2xs text-accent hover:underline",children:t?"Collapse all":"Expand all"}),e.jsxs("div",{className:"flex items-center gap-4 ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"AI Task"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Escalation"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Notification"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Done"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-warning"}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:"Active"})]})]})]})}function oe({ticks:t}){return e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"w-52 shrink-0"}),e.jsx("div",{className:"flex-1 relative h-6 border-b border-surface-border",children:t.map(a=>e.jsx("span",{className:"absolute text-2xs font-mono text-text-tertiary -translate-x-1/2 bottom-1 whitespace-nowrap",style:{left:`${a.pct}%`},children:a.label},a.pct))})]})}function _({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-0.5",children:t}),e.jsx("div",{className:"text-xs text-text-primary",children:a})]})}function le({traceId:t,href:a}){const[l,c]=b.useState(!1),x=i=>{i.stopPropagation(),navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),1500)},r=i=>{i.stopPropagation(),a&&window.open(a,"_blank","noopener,noreferrer")};return e.jsxs("span",{className:"group/trace inline-flex items-center gap-1.5",children:[a&&e.jsx("button",{onClick:r,title:"Open trace",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:"w-3 h-3 text-text-tertiary hover:text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5-4.5h6m0 0v6m0-6L10.5 15"})})}),e.jsx("button",{onClick:x,title:"Copy trace ID",className:"opacity-0 group-hover/trace:opacity-100 transition-opacity p-0.5",children:e.jsx("svg",{className:`w-3 h-3 transition-colors ${l?"text-status-success":"text-text-tertiary hover:text-accent"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}),e.jsx("span",{className:"text-2xs text-accent",children:"Trace Details"})]})}function ce({task:t,traceUrl:a}){const l=t.completed_at?new Date(t.completed_at).getTime()-new Date(t.created_at).getTime():Date.now()-new Date(t.created_at).getTime();return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Q,{type:t.workflow_type})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Started",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Completed",children:t.completed_at?e.jsx(y,{date:t.completed_at}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"In progress"})}),e.jsx(_,{label:"Duration",children:e.jsx(S,{ms:l,className:"font-mono text-sm"})})]}),t.milestones.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Milestones"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.milestones.map((c,x)=>e.jsxs("span",{className:"px-2 py-0.5 text-2xs font-mono bg-accent-faint/50 rounded text-text-secondary",children:[c.name,": ",String(c.value)]},x))})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-2xs text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/workflows/tasks/detail/${t.id}`,className:"block text-2xs text-accent hover:underline",children:"Task Details"}),t.trace_id&&e.jsx(le,{traceId:t.trace_id,href:a?a.replace("{traceId}",t.trace_id):void 0})]})]})}function de({escalation:t}){const a=new Date(t.created_at).getTime(),l=t.claimed_at?new Date(t.claimed_at).getTime()-a:null,c=t.resolved_at?new Date(t.resolved_at).getTime()-a:null;return e.jsxs("div",{className:"grid grid-cols-[3fr_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{status:t.status}),e.jsx(Y,{role:t.role}),t.type&&e.jsxs("span",{className:"text-2xs text-text-tertiary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(_,{label:"Created",children:e.jsx(y,{date:t.created_at})}),e.jsx(_,{label:"Claimed",children:t.claimed_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.claimed_at}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:["after ",e.jsx(S,{ms:l}),t.assigned_to&&e.jsxs(e.Fragment,{children:[" ","by"," ",e.jsx("span",{className:"text-text-secondary font-medium",children:e.jsx(Z,{userId:t.assigned_to})})]})]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Unclaimed"})}),e.jsx(_,{label:"Resolved",children:t.resolved_at?e.jsxs(e.Fragment,{children:[e.jsx(y,{date:t.resolved_at}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-0.5",children:[e.jsx(S,{ms:c})," total"]})]}):e.jsx("span",{className:"text-text-tertiary italic text-xs",children:"Pending"})})]}),t.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("p",{className:"text-2xs text-text-secondary leading-relaxed",children:t.description})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[t.workflow_id&&e.jsx(D,{to:`/workflows/executions/${encodeURIComponent(t.workflow_id)}`,className:"block text-2xs text-accent hover:underline",children:"Execution Details"}),e.jsx(D,{to:`/escalations/detail/${t.id}`,className:"block text-2xs text-accent hover:underline",children:"Escalation Details"})]})]})}function xe({lane:t,ticks:a,isExpanded:l,onToggle:c,anim:x,animDone:r,traceUrl:i}){var m,h;const o=t.kind==="task",k=o?t.task.status:t.escalation.status,f=se(k,t.isOpen),p=x.opacity>0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center border-b border-surface-border cursor-pointer hover:bg-surface-sunken/40 transition-colors",onClick:c,children:[e.jsxs("div",{className:`w-52 shrink-0 py-3 pr-4 flex items-center gap-2 ${o?"":"pl-6"}`,style:{opacity:p?1:0,transition:"opacity 0.15s ease-out"},children:[o?ae(t.task.workflow_type)?e.jsx(B,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):e.jsx(R,{className:`w-4 h-4 shrink-0 ${$(t.task.status)}`}):E(t.escalation)?e.jsx(O,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}):e.jsx(F,{className:`w-4 h-4 shrink-0 ${I(t.escalation.status)}`}),e.jsx("p",{className:"text-xs font-mono text-text-secondary whitespace-nowrap overflow-hidden",title:te(t.kind,o?t.task.status:t.escalation.status,!o&&E(t.escalation)),children:o?A(t.label,24):A(((m=t.escalation)==null?void 0:m.role)??t.label,20)})]}),e.jsxs("div",{className:"flex-1 relative h-10",children:[a.map(s=>e.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-surface-border opacity-30",style:{left:`${s.pct}%`}},s.pct)),e.jsxs("div",{className:`absolute top-2 h-6 rounded-sm ${l?`${f} ring-2 ring-accent ring-offset-1`:`${f} hover:opacity-80`}`,style:{left:`${t.startPct}%`,width:p?`${Math.max(x.width,.3)}%`:"0%",minWidth:p?"4px":"0px",opacity:x.opacity},title:`${t.label} — ${L(t.durationMs)} — ${new Date(t.startMs).toLocaleTimeString()}`,children:[x.width>8&&r&&e.jsx("span",{className:"absolute inset-0 flex items-center px-1.5 text-2xs font-mono text-text-inverse truncate",children:L(t.durationMs)}),t.claimPct!=null&&r&&e.jsx("div",{className:"absolute top-0 bottom-0 w-px border-l border-dashed border-text-inverse/70",style:{left:`${t.claimPct}%`},title:(h=t.escalation)!=null&&h.assigned_to?`Claimed by ${t.escalation.assigned_to}`:"Claimed",children:e.jsx("div",{className:"absolute -top-1 -left-[3px] w-[7px] h-[7px] rounded-full bg-text-inverse border border-status-warning"})})]})]})]}),e.jsx(V,{open:l,children:e.jsx("div",{className:"py-4 px-6 pl-52 border-b border-surface-border bg-surface-sunken/20",children:o&&t.task?e.jsx(ce,{task:t.task,traceUrl:i}):t.escalation?e.jsx(de,{escalation:t.escalation}):null})})]})}function me({tasks:t,escalations:a,traceUrl:l}){const[c,x]=b.useState(new Set),{lanes:r,timeMin:i,timeMax:o}=b.useMemo(()=>ne(t,a),[t,a]),k=o-i||1,{progress:f,animatedBar:p}=re(r.length,i,o);if(r.length===0)return e.jsx("p",{className:"text-sm text-text-tertiary py-8 text-center",children:"No events in this process."});const m=5,h=Array.from({length:m+1},(n,u)=>({pct:u/m*100,label:L(Math.round(u/m*k))})),s=n=>{x(u=>{const N=new Set(u);return N.has(n)?N.delete(n):N.add(n),N})},d=r.map(n=>n.id),j=d.length>0&&d.every(n=>c.has(n)),g=()=>{x(j?new Set:new Set(d))},v=f>=1;return e.jsxs("div",{className:"py-2",children:[e.jsx(ie,{allExpanded:j,onToggleAll:g}),e.jsx(oe,{ticks:h}),r.map(n=>e.jsx(xe,{lane:n,ticks:h,isExpanded:c.has(n.id),onToggle:()=>s(n.id),anim:p(n),animDone:v,traceUrl:l},`${n.kind}-${n.id}`))]})}function C(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}function ue(t){return t.length===0?null:[...t].sort((a,l)=>new Date(a.created_at).getTime()-new Date(l.created_at).getTime())[0]}function Me(){var j;const{originId:t}=X();J(t);const{data:a,isLoading:l}=z(t??""),{data:c}=q(),x=((j=c==null?void 0:c.telemetry)==null?void 0:j.traceUrl)??null,r=(a==null?void 0:a.tasks)??[],i=(a==null?void 0:a.escalations)??[],o=b.useMemo(()=>ue(r),[r]),k=b.useMemo(()=>C(o==null?void 0:o.envelope),[o]),f=b.useMemo(()=>{if(o!=null&&o.data)return C(o.data);const g=r.filter(v=>v.status==="completed"&&v.data).sort((v,n)=>new Date(n.completed_at).getTime()-new Date(v.completed_at).getTime());return g.length>0?C(g[0].data):null},[o,r]),p=b.useMemo(()=>r.length>0&&r.some(g=>g.status!=="completed"&&g.status!=="cancelled"),[r]),m=b.useMemo(()=>{const g=r.filter(u=>u.status==="completed").length,v=r.filter(u=>u.status==="needs_intervention").length,n=i.filter(u=>u.status==="resolved").length;return{tasks:r.length,completed:g,escalated:v,escalations:i.length,resolved:n}},[r,i]),h=b.useMemo(()=>{if(r.length===0&&i.length===0)return null;const v=[...r.map(w=>w.created_at),...i.map(w=>w.created_at)].sort()[0],n=r.every(w=>w.status==="completed"||w.status==="cancelled"),u=i.every(w=>w.status==="resolved"),N=r.length>0&&n&&u,M=N?[...r.map(w=>w.completed_at),...i.map(w=>w.resolved_at)].filter(Boolean).sort().pop()??null:null;return{startIso:v,endIso:M,isFinished:N,elapsed:G(v,M)}},[r,i]),s=b.useMemo(()=>{const g=[];return h&&g.push({label:h.isFinished?"Completed":"Running",value:h.elapsed,dotClass:h.isFinished?"bg-status-success":"bg-status-pending animate-pulse"}),g.push({label:"Tasks",value:`${m.completed}/${m.tasks}`},{label:"Escalations",value:`${m.resolved}/${m.escalations}`}),g},[h,m]);if(l&&r.length===0)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]});const d=k||f||p;return e.jsxs("div",{children:[e.jsx(K,{title:"Process Detail",docsHash:"#docs:dashboard.md:process-detail",subtitle:t,stats:s}),d&&e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-2 gap-8 mb-10",children:[e.jsx("div",{children:k?e.jsx(P,{data:k,label:"Input",defaultMode:"json",defaultCollapsed:!0}):e.jsxs("div",{children:[e.jsx(T,{children:"Input"}),e.jsx("div",{className:"font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-tertiary italic mt-2",children:"Waiting for task..."})]})}),e.jsx("div",{children:f?e.jsx(P,{data:f,label:"Output",defaultMode:"json",defaultCollapsed:!0}):p?e.jsxs("div",{children:[e.jsx(T,{children:"Output"}),e.jsxs("div",{className:"flex items-center gap-2 font-mono text-xs bg-surface-sunken rounded-md p-4 text-text-secondary mt-2",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-pending animate-pulse"}),"Processing..."]})]}):null})]}),e.jsx(T,{className:"mb-6",children:"Timeline"}),e.jsx(me,{tasks:r,escalations:i,traceUrl:x})]})}export{Me as ProcessDetailPage};
2
- //# sourceMappingURL=ProcessDetailPage-B5mmkHS0.js.map
@@ -1,8 +0,0 @@
1
- import{j as e,a as u}from"./vendor-query-RUZdMvN6.js";import{ao as X,ap as E,J as ee,V as te}from"./index-BEeGFfuP.js";import{a as se}from"./users-D-DhFQBy.js";import{A as ae}from"./AutoGrowTextarea-DgEQeRQw.js";import{C as ne}from"./ConfirmDeleteModal-CQsJUzEa.js";import{aN as U,T as re,L as J,aO as B,aP as ie,Y as K,aE as oe,n as L,am as le,P as W,I as F,B as ce,o as V,a8 as de,aQ as xe}from"./vendor-icons-h-jlRSb9.js";import{u as me,L as I,e as he,f as ue}from"./vendor-react-CdqEC2zv.js";import"./Modal-BU7No9NH.js";function pe({role:t}){const{data:a}=se({role:t,limit:100}),s=(a==null?void 0:a.users)??[];return s.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Assign users to this role to staff its queue. Members see and resolve escalations here according to their read/write scope; admins manage the role itself."}):e.jsx("div",{className:"divide-y divide-surface-border/40",children:s.map(i=>{const c=i.roles.find(n=>n.role===t);return c?e.jsxs("div",{className:"flex items-center justify-between py-1.5 gap-2",children:[e.jsx("span",{className:"text-xs text-text-secondary truncate",children:i.display_name||i.external_id}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono shrink-0",children:fe(c)})]},i.id):null})})}function fe(t){return t.type==="superadmin"||t.type==="admin"?t.type:`member · read ${t.read_scope} · write ${t.write_scope}`}function T(t){return t==null?"":JSON.stringify(t,null,2)}function S(t){const a=t.trim();if(!a)return{ok:!0,value:void 0};try{const s=JSON.parse(a);return typeof s!="object"||Array.isArray(s)||s===null?{ok:!1}:{ok:!0,value:s}}catch{return{ok:!1}}}const M=/^[a-zA-Z0-9_]+$/;function be(t){var s;const a=S(t);return a.ok&&((s=a.value)==null?void 0:s.kiosk)===!0}function ve(t){const a=S(t);if(!a.ok)return null;const s={...a.value??{}};return s.kiosk===!0?delete s.kiosk:s.kiosk=!0,JSON.stringify(s,null,2)}const je={title:"",description:"",ops_visible:!1,ops_home_default:!1,enforce_schema:!1,parent_role:"",metadata_schema:"",properties:"{}",sla_minutes:"",target_per_hour:"",worker_count:"",priority_threshold_minutes:"",priority_facet:"",entity_facet:"",entity_state_source:"role"};function ye(t){return{title:t.title??"",description:t.description??"",ops_visible:t.ops_visible,ops_home_default:t.ops_home_default,enforce_schema:t.enforce_schema,parent_role:t.parent_role??"",metadata_schema:T(t.metadata_schema),properties:T(t.properties)||"{}",sla_minutes:t.sla_minutes!=null?String(t.sla_minutes):"",target_per_hour:t.target_per_hour!=null?String(t.target_per_hour):"",worker_count:t.worker_count!=null?String(t.worker_count):"",priority_threshold_minutes:t.priority_threshold_minutes!=null?String(t.priority_threshold_minutes):"",priority_facet:t.priority_facet??"",entity_facet:t.entity_facet??"",entity_state_source:t.entity_state_source??"role"}}function p({icon:t,label:a,annotation:s,aside:i,accent:c=!1,children:n}){const r=c?"text-accent":"text-text-tertiary";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(t,{className:`w-3 h-3 ${r} shrink-0`,strokeWidth:1.5}),e.jsx("span",{className:`text-2xs font-semibold uppercase tracking-widest ${r}`,children:a}),s&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",s]})]}),i]}),e.jsx("div",{className:`border-l-2 pl-5 ${c?"border-accent/15":"border-surface-border/60"}`,children:n})]})}function G(){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-status-success",children:"Live"})]})}function q({checked:t,onChange:a,title:s}){return e.jsx("button",{onClick:a,title:s,className:`w-9 h-5 rounded-full transition-colors relative shrink-0 ${t?"bg-accent":"bg-surface-border"}`,children:e.jsx("span",{className:`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-text-inverse transition-transform shadow ${t?"translate-x-[18px]":"translate-x-[3px]"}`})})}function ge({items:t,empty:a,onRemove:s}){return t.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:a}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(i=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs bg-accent/10 rounded-sm font-mono text-accent",children:[i,e.jsx("button",{onClick:()=>s(i),className:"text-accent/50 hover:text-status-error transition-colors leading-none ml-0.5",children:"×"})]},i))})}function _e({role:t,draft:a,update:s}){const i=me(),c=X(),[n,r]=u.useState(!1),m=t.user_count>0||t.chain_count>0||t.workflow_count>0;return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:U,label:"Identity",annotation:"name and description",accent:!0,children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Display Name"}),e.jsx("input",{type:"text",value:a.title,onChange:o=>s({title:o.target.value}),placeholder:`e.g., ${t.role.charAt(0).toUpperCase()+t.role.slice(1)}`,className:"input text-sm w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Description"}),e.jsx(ae,{value:a.description,onChange:o=>s({description:o}),placeholder:"A short description shown on role cards and in the operations view.",rows:2})]})]})}),e.jsx("div",{className:"border-t border-surface-border/40 pt-6",children:m?e.jsxs("p",{className:"text-2xs text-text-quaternary leading-relaxed",children:["This role is referenced by"," ",[t.user_count>0?`${t.user_count} member${t.user_count===1?"":"s"}`:null,t.workflow_count>0?`${t.workflow_count} workflow${t.workflow_count===1?"":"s"}`:null,t.chain_count>0?"routing config":null].filter(Boolean).join(", ")," ","and cannot be deleted."]}):e.jsxs("button",{onClick:()=>r(!0),className:"px-3 py-1.5 text-xs rounded-md text-status-error/60 hover:text-status-error hover:bg-status-error/10 transition-colors flex items-center gap-1",children:[e.jsx(re,{className:"w-3 h-3"})," Delete this role"]})}),e.jsx(ne,{open:n,onClose:()=>r(!1),onConfirm:()=>c.mutate(t.role,{onSuccess:()=>i("/admin/roles")}),title:"Delete Role",description:e.jsxs(e.Fragment,{children:["Delete role ",e.jsx("span",{className:"font-medium font-mono text-text-primary",children:t.role}),"? This cannot be undone."]}),isPending:c.isPending,error:c.error})]})}function Ne({role:t,allRoles:a,draft:s,update:i,errors:c}){const n=parseFloat(s.sla_minutes),r=parseFloat(s.target_per_hour),m=parseFloat(s.worker_count),o=!isNaN(n)&&n>0,f=!isNaN(r)&&r>0,y=!isNaN(m)&&m>0,d=o&&y&&!f?`→ target ≈ ${(m/(n/60)).toFixed(1)}/h`:o&&f&&!y?`→ workers ≈ ${(r*(n/60)).toFixed(1)}`:f&&y&&!o?`→ SLA ≈ ${(m/r*60).toFixed(0)}m`:null,v=u.useMemo(()=>a.filter(l=>{if(l.role===t.role)return!1;let h=l;const j=new Set;for(;h!=null&&h.parent_role;){if(h.parent_role===t.role)return!1;if(j.has(h.parent_role))break;j.add(h.parent_role),h=a.find(w=>w.role===h.parent_role)}return!0}),[a,t]);return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:J,label:"Station",annotation:"this role on the Pace Board",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Show as a station on the Pace Board"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Stations appear on the Operations chart and table with live counts, pace, and the time-in-state mix."})]}),e.jsx(q,{checked:s.ops_visible,onChange:()=>i({ops_visible:!s.ops_visible}),title:"Show as a station on the Pace Board"})]})}),e.jsx(p,{icon:B,label:"Capacity",annotation:"throughput = workers / (sla / 60)",children:e.jsxs("div",{className:"flex items-end gap-6",children:[[{key:"sla_minutes",label:"SLA",unit:"min",placeholder:"30"},{key:"target_per_hour",label:"Target",unit:"/h",placeholder:"20"},{key:"worker_count",label:"Workers",unit:"",placeholder:"4"}].map(({key:l,label:h,unit:j,placeholder:w})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:[h,j&&e.jsx("span",{className:"normal-case font-normal ml-1",children:j})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s[l],onChange:$=>i({[l]:$.target.value}),placeholder:w,className:"input text-xs w-20 font-mono"})]},l)),d&&e.jsx("span",{className:"text-2xs text-accent font-mono whitespace-nowrap pb-2",children:d})]})}),e.jsxs(p,{icon:B,label:"Priority",annotation:"when a pending item counts as overdue",children:[e.jsxs("div",{className:"flex items-end gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:["Threshold",e.jsx("span",{className:"normal-case font-normal ml-1",children:"min"})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:s.priority_threshold_minutes,onChange:l=>i({priority_threshold_minutes:l.target.value}),placeholder:s.sla_minutes||"60",className:"input text-xs w-20 font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:"Age Facet"}),e.jsx("input",{type:"text",value:s.priority_facet,onChange:l=>i({priority_facet:l.target.value}),placeholder:"created_at",className:"input text-xs w-36 font-mono"}),c.priority_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:c.priority_facet})]})]}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["Pending unclaimed items older than the threshold count as priority. Age is measured from the metadata facet (an ISO 8601 UTC timestamp, e.g. ",e.jsx("code",{className:"font-mono",children:"authorized_at"}),") or from"," ",e.jsx("code",{className:"font-mono",children:"created_at"})," when blank; the threshold falls back to SLA when blank."]})]}),e.jsxs(p,{icon:ie,label:"Entity",annotation:"what moves through this station",accent:!0,children:[e.jsx("input",{type:"text",value:s.entity_facet,onChange:l=>i({entity_facet:l.target.value}),placeholder:"serialNumber",className:"input text-xs w-44 font-mono"}),c.entity_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:c.entity_facet}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["The metadata key naming the entity that moves through this station —"," ",e.jsx("code",{className:"font-mono",children:"serialNumber"}),","," ",e.jsx("code",{className:"font-mono",children:"orderId"}),". Roles sharing a key form that entity's system: its state mix, per-entity dwell, and timelines all derive from it. Blank = the role has no entity notion."]}),s.entity_facet.trim()!==""&&e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1.5",children:"States from"}),e.jsx("div",{className:"flex items-center gap-1",children:[{value:"role",label:"Station"},{value:"subtype",label:"Subtypes"}].map(({value:l,label:h})=>e.jsx("button",{onClick:()=>i({entity_state_source:l}),className:`px-2.5 py-1 text-2xs rounded transition-colors ${s.entity_state_source===l?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:h},l))}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:["How this station names the entity's state. ",e.jsx("strong",{children:"Station"}),": being here is one state (a servicing or harvesting queue)."," ",e.jsx("strong",{children:"Subtypes"}),": this one role holds several states, named by each escalation's subtype (a fleet role parking"," ",e.jsx("code",{className:"font-mono",children:"ready"})," /"," ",e.jsx("code",{className:"font-mono",children:"printing"}),")."]})]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-out ${s.ops_visible?"opacity-100 max-h-[900px]":"opacity-0 max-h-0 pointer-events-none"}`,"aria-hidden":!s.ops_visible,children:e.jsx(p,{icon:K,label:"Sequence",annotation:"where this station sits on the floor",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Prior Step"}),e.jsxs("select",{value:s.parent_role,onChange:l=>i({parent_role:l.target.value}),className:"select text-sm w-full font-mono",children:[e.jsx("option",{value:"",children:"None — root process"}),v.map(l=>e.jsx("option",{value:l.role,children:l.title?`${l.role} — ${l.title}`:l.role},l.role))]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Places this role in one Pace Board sequence. A role with no prior step starts its own sequence."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Upstream Inputs"}),e.jsx(G,{})]}),e.jsx(we,{role:t,allRoles:a})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Home Segment"}),e.jsx(q,{checked:s.ops_home_default,onChange:()=>i({ops_home_default:!s.ops_home_default}),title:"Lead the home Pace Board with this role's sequence"})]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Lead the home page's Pace Board with this role's sequence. One role holds this — saving it here releases the previous holder. Unset everywhere, the board opens on its first sequence."})]})]})})})]})}function we({role:t,allRoles:a}){const s=E(),[i,c]=u.useState(""),n=t.upstream_roles??[],r=u.useMemo(()=>a.map(o=>o.role).filter(o=>o!==t.role&&o!=="superadmin"&&!n.includes(o)),[a,t.role,n]),m=o=>s.mutate({role:t.role,upstream_roles:o},{onSuccess:()=>c("")});return e.jsxs("div",{className:"space-y-2",children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:o=>c(o.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add upstream input…"}),r.map(o=>e.jsx("option",{value:o,children:o},o))]}),e.jsx("button",{onClick:()=>{i&&m([...n,i])},disabled:!i||s.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:s.isPending?"…":"Add"})]}),e.jsx(ge,{items:n,empty:"Roles from other sequences this station draws input from. Add one above and it lands here.",onRemove:o=>m(n.filter(f=>f!==o))}),s.error&&e.jsx("p",{className:"text-2xs text-status-error",children:s.error.message})]})}function ke({role:t,draft:a,update:s,errors:i,editingJson:c,startEditingJson:n,setMetadataSchemaError:r}){return e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:oe,label:"Enforcement",annotation:"server-side resolver validation",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Enforce the escalation form schema"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Every resolve surface — API, MCP, CLI — validates submitted payloads against this role's form schema and rejects violations with field-level errors before any state changes."})]}),e.jsx(q,{checked:a.enforce_schema,onChange:()=>s({enforce_schema:!a.enforce_schema}),title:"Validate every resolve payload against this role's form schema"})]})}),e.jsxs(p,{icon:L,label:"Escalation Schema",annotation:"the resolve form",accent:!0,aside:t.current_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_schema_version," in use"]}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["The form a person completes to resolve this role's escalations. Versioned — each save adds one; workflows pin any version via"," ",e.jsx("code",{className:"font-mono",children:"schemaVersion"}),"."]}),e.jsx(I,{to:`/admin/roles/${encodeURIComponent(t.role)}/schema`,className:"text-xs text-accent hover:underline",children:t.form_schema?`Open schema editor — v${t.current_schema_version??1} in use →`:"Define the escalation form →"})]}),e.jsxs(p,{icon:le,label:"Escalations List Schema",annotation:"rich list view",aside:t.current_list_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_list_schema_version," in use"]}):void 0,children:[e.jsx("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:"Richly formats the escalation list when it's scoped to just this role. Versioned on its own timeline — separate from the resolve form."}),e.jsx(I,{to:`/admin/roles/${encodeURIComponent(t.role)}/list-schema`,className:"text-xs text-accent hover:underline",children:t.list_schema?`Open list schema editor — v${t.current_list_schema_version??1} in use →`:"Define the list view →"})]}),e.jsxs(p,{icon:L,label:"Metadata Schema",annotation:"validates metadata at creation",aside:!c.has("metadata_schema")&&t.metadata_schema?e.jsx("button",{onClick:()=>n("metadata_schema"),className:"text-2xs text-accent hover:underline",children:"Edit"}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["Validates ",e.jsx("code",{className:"font-mono",children:"metadata"})," at creation time. Keys appear in faceted search autocomplete."]}),!c.has("metadata_schema")&&t.metadata_schema?e.jsx(ee,{data:t.metadata_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:a.metadata_schema,onChange:m=>{const o=m.target.value;s({metadata_schema:o}),r(S(o).ok?void 0:"Invalid JSON")},rows:10,spellCheck:!1,className:"input text-xs font-mono w-full resize-y",placeholder:`{
2
- "type": "object",
3
- "properties": {
4
- "order_id": { "type": "string" }
5
- },
6
- "required": ["order_id"]
7
- }`}),i.metadata_schema&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:i.metadata_schema})]})]})]})}function Se({role:t}){return e.jsx(p,{icon:W,label:"Default Pins",annotation:"pinned views every member starts with",aside:e.jsx(G,{}),accent:!0,children:e.jsx(Ce,{role:t})})}function Ce({role:t}){const a=E(),[s,i]=u.useState(""),[c,n]=u.useState(""),[r,m]=u.useState(!0),o=t.default_pins??[],f=d=>a.mutate({role:t.role,default_pins:d.length?d:null},{onSuccess:()=>{i(""),n(""),m(!0)}}),y=s.trim()!==""&&c.trim().startsWith("/");return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:s,onChange:d=>i(d.target.value),placeholder:"Label — e.g. Needs harvesting",className:"input text-xs w-40 shrink-0"}),e.jsx("input",{type:"text",value:c,onChange:d=>n(d.target.value),placeholder:"/escalations/available?role=…",className:"input text-xs font-mono flex-1"}),e.jsxs("label",{className:"flex items-center gap-1 text-2xs text-text-tertiary shrink-0",title:"Show a live count beside the label",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:d=>m(d.target.checked),className:"w-3 h-3 accent-accent"}),"count"]}),e.jsx("button",{onClick:()=>{y&&f([...o,{label:s.trim(),url:c.trim(),badge:r}])},disabled:!y||a.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:a.isPending?"…":"Add"})]}),o.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"Pinned views every member starts with — the persona's exact queries. Add one above and it lands here."}):e.jsx("div",{className:"space-y-1",children:o.map(d=>e.jsxs("div",{className:"flex items-baseline gap-2 text-2xs",children:[e.jsx("span",{className:"font-medium text-text-secondary shrink-0",children:d.label}),d.badge&&e.jsx("span",{className:"text-2xs text-accent shrink-0",title:"Shows a live count",children:"count"}),e.jsx("span",{className:"font-mono text-text-quaternary truncate flex-1",title:d.url,children:d.url}),e.jsx("button",{onClick:()=>f(o.filter(v=>v.label!==d.label)),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove pin ${d.label}`,children:"×"})]},d.label))}),a.error&&e.jsx("p",{className:"text-2xs text-status-error",children:a.error.message})]})}const z=[{key:"identity",label:"Identity",icon:U},{key:"pace-board",label:"Pace Board",icon:J},{key:"schemas",label:"Schemas",icon:L},{key:"members",label:"Members",icon:V},{key:"pins",label:"Pins",icon:W}],Pe=t=>z.some(a=>a.key===t);function Be(){const{role:t}=he(),{data:a,isLoading:s}=te(),i=E(),c=(a==null?void 0:a.roles)??[],n=c.find(x=>x.role===t),[r,m]=u.useState(je),[o,f]=u.useState(!1),[y,d]=u.useState(!1),[v,l]=u.useState({}),[h,j]=u.useState(new Set),w=x=>j(b=>new Set([...b,x])),[$,R]=ue(),D=$.get("section"),_=Pe(D)?D:"identity",H=u.useCallback(x=>{R(b=>{const g=new URLSearchParams(b);return g.set("section",x),g},{replace:!0})},[R]);u.useEffect(()=>{n&&(m(ye(n)),f(!1),d(!1),l({}),j(new Set))},[t,n==null?void 0:n.role]);const C=x=>{m(b=>({...b,...x})),f(!0),d(!1)},Y=()=>{if(!n)return;const x=S(r.metadata_schema),b=S(r.properties),g=r.priority_facet.trim(),A=r.entity_facet.trim(),N={};if(x.ok||(N.metadata_schema="Invalid JSON"),b.ok||(N.properties="Invalid JSON"),g&&!M.test(g)&&(N.priority_facet="Letters, numbers, underscores only"),A&&!M.test(A)&&(N.entity_facet="Letters, numbers, underscores only"),l(N),Object.keys(N).length)return;const P=O=>{const k=parseFloat(O);return isNaN(k)?null:k},Z=O=>{const k=P(O);return k==null?null:Math.round(k)};i.mutate({role:n.role,title:r.title.trim()||null,description:r.description.trim()||null,ops_visible:r.ops_visible,ops_home_default:r.ops_home_default,enforce_schema:r.enforce_schema,parent_role:r.parent_role||null,metadata_schema:x.value??null,properties:b.value??{},sla_minutes:P(r.sla_minutes),target_per_hour:P(r.target_per_hour),worker_count:Z(r.worker_count),priority_threshold_minutes:P(r.priority_threshold_minutes),priority_facet:g||null,entity_facet:A||null,entity_state_source:r.entity_state_source},{onSuccess:()=>{f(!1),d(!0),j(new Set),window.setTimeout(()=>d(!1),2500)}})};if(s)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded"})]});if(!n)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx(F,{className:"w-12 h-12 text-text-quaternary mb-4",strokeWidth:1}),e.jsx("h2",{className:"heading-3 mb-2",children:"Role not found"})]});const Q=o&&!Object.values(v).some(Boolean);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx(F,{className:"w-5 h-5 text-accent",strokeWidth:1.5}),e.jsx("h1",{className:"text-lg font-mono font-medium text-text-primary",children:n.role}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:role-detail"},className:"text-text-quaternary hover:text-accent transition-colors",title:"Open docs for this page",children:e.jsx(ce,{className:"w-4 h-4",strokeWidth:1.5})}),n.parent_role&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-text-quaternary font-mono",children:[e.jsx(K,{className:"w-3 h-3"})," ",n.parent_role]})]}),n.title&&e.jsx("p",{className:"text-sm text-text-secondary pl-8",children:n.title})]}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:z.map(x=>{const b=x.icon,g=_===x.key;return e.jsxs("button",{onClick:()=>H(x.key),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${g?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(b,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:x.label})]},x.key)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:Y,disabled:!Q||i.isPending,className:"w-full px-3 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i.isPending?"Saving…":o?"Save changes":"Save"}),y&&e.jsxs("span",{className:"flex items-center justify-center gap-1 text-xs text-status-success animate-page-enter",children:[e.jsx(de,{className:"w-3 h-3"})," Saved"]}),i.error&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:i.error.message}),Object.values(v).some(Boolean)&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:"Fix the highlighted fields before saving."})]})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2 max-w-3xl",children:[_==="identity"&&e.jsx(_e,{role:n,draft:r,update:C,errors:v}),_==="pace-board"&&e.jsx(Ne,{role:n,allRoles:c,draft:r,update:C,errors:v}),_==="schemas"&&e.jsx(ke,{role:n,draft:r,update:C,errors:v,editingJson:h,startEditingJson:w,setMetadataSchemaError:x=>l(b=>({...b,metadata_schema:x}))}),_==="members"&&e.jsxs("div",{className:"space-y-14",children:[e.jsx(p,{icon:V,label:"Members",annotation:"read = what appears · write = what they can act on",accent:!0,children:e.jsx(pe,{role:n.role})}),e.jsx(p,{icon:xe,label:"Station Kiosk",annotation:"the locked viewport for single-role logins",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Lock single-role members to this queue"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"A member who holds only this role signs in to a locked viewport: no side navigation, this queue as home, held to the list, the item detail, and the scan screens. Members with other roles keep the full dashboard."})]}),e.jsx(q,{checked:be(r.properties),onChange:()=>{const x=ve(r.properties);x!==null&&C({properties:x})},title:"Kiosk station viewport"})]})})]}),_==="pins"&&e.jsx(Se,{role:n})]})]})]})}export{Be as RoleDetailPage};
8
- //# sourceMappingURL=RoleDetailPage-eenl_a5Z.js.map
@@ -1,2 +0,0 @@
1
- import{j as r}from"./vendor-query-RUZdMvN6.js";import{u as a}from"./users-D-DhFQBy.js";function m({userId:s,fallback:t}){const{data:e}=a(s);return e?r.jsx(r.Fragment,{children:e.display_name||e.email||e.external_id}):r.jsx(r.Fragment,{children:t??`${s.slice(0,8)}…`})}export{m as U};
2
- //# sourceMappingURL=UserName-Ck-eLb-1.js.map