decocms 4.76.76 → 4.76.78

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 (235) hide show
  1. package/dist/client/assets/{AlertCircle-BVlB73Gd.js → AlertCircle-DBEuJvXd.js} +1 -1
  2. package/dist/client/assets/{AreaChart-C1SgmDdh.js → AreaChart-RJnPaDTO.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BcoNWaDn.js → ArrowUp-OqBYOpu3.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-COlnzfbE.js → ArrowUpRight-3xkp-kWm.js} +1 -1
  5. package/dist/client/assets/{Check-ylcp47jh.js → Check-Oxo5mPeL.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-jaIqf58w.js → CheckCircle-DAvZWWWn.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DorDM-K-.js → ChevronDown-DCZlSvzQ.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-NJ1RHqa7.js → ChevronRight-L_rxCnv3.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-C85SxyPM.js → ChevronUp-BXrO8J56.js} +1 -1
  10. package/dist/client/assets/{Circle-BGJOKhru.js → Circle-DLL8alCD.js} +1 -1
  11. package/dist/client/assets/{Copy01-C5M0y3sD.js → Copy01-uwiMYWRU.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Ckk9mZsT.js → DotsVertical-B0IViKUD.js} +1 -1
  13. package/dist/client/assets/{Eye-ByzbJOuX.js → Eye-DVo1_Pm2.js} +1 -1
  14. package/dist/client/assets/{FilterLines-hGzDxUbQ.js → FilterLines-CAdlDh3I.js} +1 -1
  15. package/dist/client/assets/{Flag01-D6FA8Gqb.js → Flag01-fXAeu3l9.js} +1 -1
  16. package/dist/client/assets/{Globe01-DwjnaG3m.js → Globe01-By9gtoyg.js} +1 -1
  17. package/dist/client/assets/{Globe04-KMRfe3Ap.js → Globe04-uOyvHHk7.js} +1 -1
  18. package/dist/client/assets/{HardDrive-BLW7r-EP.js → HardDrive-D38nWE_J.js} +1 -1
  19. package/dist/client/assets/{Image01-DID7YK1H.js → Image01-B-uMMK1I.js} +1 -1
  20. package/dist/client/assets/{Key01-BNdv9d9e.js → Key01-ChBXFLCM.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-DP-M8mno.js → LayoutLeft-DPtsS7J4.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CJELREUW.js → LinkExternal01-C3luIiQr.js} +1 -1
  23. package/dist/client/assets/{List-B6zsWjbc.js → List-CgvHjjyd.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DGMiqS2G.js → Monitor01-BbnHlrzQ.js} +1 -1
  25. package/dist/client/assets/{Package-Cys9wdnk.js → Package-CJkGCd9M.js} +1 -1
  26. package/dist/client/assets/{Palette-CjpYx7Ii.js → Palette-Dem2eeFJ.js} +1 -1
  27. package/dist/client/assets/{Play-BIDZ3Qx4.js → Play-02R_l1hm.js} +1 -1
  28. package/dist/client/assets/{Plus-OGxa0fdn.js → Plus-D8fSfWhL.js} +1 -1
  29. package/dist/client/assets/{SearchLg-BkGBAC6u.js → SearchLg-BKY8fQrj.js} +1 -1
  30. package/dist/client/assets/{SearchMd-DhGVvJ2r.js → SearchMd-Di7fRkvt.js} +1 -1
  31. package/dist/client/assets/{Settings02-s4dN6VnR.js → Settings02-CJygIZBg.js} +1 -1
  32. package/dist/client/assets/{Shield01-C2gwqyT0.js → Shield01-bU8ewL-C.js} +1 -1
  33. package/dist/client/assets/{Star01-CdWOUCGL.js → Star01-CAO22TgC.js} +1 -1
  34. package/dist/client/assets/{Stars01-Ce7N7beA.js → Stars01-BbGPjqZd.js} +1 -1
  35. package/dist/client/assets/{Stars02-Brbdnmc2.js → Stars02-Bs0TEaNy.js} +1 -1
  36. package/dist/client/assets/{Sun-DrhefHVP.js → Sun-BZaKEOLT.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-CQC-VHSM.js → SwitchHorizontal01-DqE-u_vC.js} +1 -1
  38. package/dist/client/assets/{Tool01-CQ5Yi4Y5.js → Tool01-DHJpebK1.js} +1 -1
  39. package/dist/client/assets/{Tool02-B5mtXP4w.js → Tool02-DlSNNbnL.js} +1 -1
  40. package/dist/client/assets/{Trash01-9Yhy1NDp.js → Trash01-BGwW4PUs.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-CUYb4fKq.js → TrendUp01-Lnwj2rUh.js} +1 -1
  42. package/dist/client/assets/{Upload01-BGaIkl8C.js → Upload01-DVcY511n.js} +1 -1
  43. package/dist/client/assets/{User01-DY8EdPzH.js → User01-joygJQdk.js} +1 -1
  44. package/dist/client/assets/{UserPlus01-ByXfLuOW.js → UserPlus01-DvdLIpOn.js} +1 -1
  45. package/dist/client/assets/{Users01-DnUyZ4sc.js → Users01-BVTwFHJb.js} +1 -1
  46. package/dist/client/assets/{Users03-DQHSM-ip.js → Users03-FhX9tiey.js} +1 -1
  47. package/dist/client/assets/{X-8dZUy9dd.js → X-Bs0u_0yh.js} +1 -1
  48. package/dist/client/assets/{XCircle-DY5ehXOb.js → XCircle-DGorVz-d.js} +1 -1
  49. package/dist/client/assets/{XClose-IT2oT79e.js → XClose-hq2LkF75.js} +1 -1
  50. package/dist/client/assets/{Zap-UNZ6wjOU.js → Zap-CT4kcBoV.js} +1 -1
  51. package/dist/client/assets/{ZapSquare-CIT8HcpR.js → ZapSquare-DivgtbPr.js} +1 -1
  52. package/dist/client/assets/{ZoomOut-DoDMe5dD.js → ZoomOut-B2C9WPW-.js} +1 -1
  53. package/dist/client/assets/{access-gate-BjqlcKiO.js → access-gate-B4pZWmwl.js} +1 -1
  54. package/dist/client/assets/{add-section-modal-C8E813YY.js → add-section-modal-JBdSC8cO.js} +1 -1
  55. package/dist/client/assets/{agent-icon-DCK7PpQ3.js → agent-icon-Xdz_mRuJ.js} +1 -1
  56. package/dist/client/assets/{agents-list-Bwjyc61n.js → agents-list-2gWOzqrw.js} +1 -1
  57. package/dist/client/assets/{ai-providers-peEIA4y0.js → ai-providers-N4FbEwVk.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-iGippWYX.js → alert-dialog-CWlVUd73.js} +1 -1
  59. package/dist/client/assets/{alert-CMPxdRHq.js → alert-j61mFoia.js} +1 -1
  60. package/dist/client/assets/{app-editor-CuUlGlJd.js → app-editor-BRpM18eX.js} +1 -1
  61. package/dist/client/assets/{auth-BBryGktV.js → auth-DDOP_TUe.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-CVb1uch8.js → auth-catchall-B0LUMpZy.js} +1 -1
  63. package/dist/client/assets/{auth-entry-C6Y1Coh9.js → auth-entry-wtr1fLwN.js} +1 -1
  64. package/dist/client/assets/{auth-split-layout-C7bMt_tF.js → auth-split-layout-Bifmzv2W.js} +1 -1
  65. package/dist/client/assets/{authenticate-and-persist-oauth-BVhm4ZHQ.js → authenticate-and-persist-oauth-BcKcvBur.js} +1 -1
  66. package/dist/client/assets/{automation-list-row-CW2Mr4ne.js → automation-list-row-CWbyvM3t.js} +1 -1
  67. package/dist/client/assets/{automation-runs-DtF_plhA.js → automation-runs-ewxrJgPk.js} +1 -1
  68. package/dist/client/assets/automations-C5v25H5e.js +1 -0
  69. package/dist/client/assets/{autosend-YOQ-CO-z.js → autosend-sntJRLit.js} +1 -1
  70. package/dist/client/assets/{avatar-6ZpKSJQ1.js → avatar-BumqAYVV.js} +1 -1
  71. package/dist/client/assets/{badge-Brm7dRFm.js → badge-DuwyDvgL.js} +1 -1
  72. package/dist/client/assets/{block-document-BE7E93rt.js → block-document-COkNQDU1.js} +1 -1
  73. package/dist/client/assets/{brand-context-CMCsnbCM.js → brand-context-DJ55kBWm.js} +1 -1
  74. package/dist/client/assets/{buckets-sTBT-mWR.js → buckets-CZaQ9-E2.js} +1 -1
  75. package/dist/client/assets/{bulk-category-panel-CnXvOLen.js → bulk-category-panel-C4UbsY4X.js} +1 -1
  76. package/dist/client/assets/{calendar-C8mrI2UH.js → calendar-Dpt7QB2d.js} +1 -1
  77. package/dist/client/assets/{capability-load-error-u8-vFMPG.js → capability-load-error-CVQ-0IvS.js} +1 -1
  78. package/dist/client/assets/{card-DmJEBNvh.js → card-whir3-TU.js} +1 -1
  79. package/dist/client/assets/{category-editor-BS7auS6b.js → category-editor-DSjyTevO.js} +1 -1
  80. package/dist/client/assets/{chat-context-DeX0VT17.js → chat-context-CZYpc7lP.js} +1 -1
  81. package/dist/client/assets/{checkbox-YjFOYgvp.js → checkbox-DbEZ6b_D.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-CYFaZSY8.js → cli-auth-success-DhmnJDJJ.js} +1 -1
  83. package/dist/client/assets/{collection-detail-DM2ekT5E.js → collection-detail-B32MmFU7.js} +1 -1
  84. package/dist/client/assets/{collection-display-button-B5vJJ8M2.js → collection-display-button--OVhArve.js} +1 -1
  85. package/dist/client/assets/{collection-search-BebQySxJ.js → collection-search-26JlKJRJ.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-D1lST78v.js → collection-table-wrapper-DPtPbXkO.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-DhPjZGgE.js → collection-tabs-CMkX9SJV.js} +1 -1
  88. package/dist/client/assets/{command-DgNLNLpt.js → command-BoNCgAXF.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-Di2Fzvlr.js → commerce-onboarding-DbO5ycXJ.js} +1 -1
  90. package/dist/client/assets/{companions-core-BXSVQzy2.js → companions-core-C3l18hJe.js} +1 -1
  91. package/dist/client/assets/{connect-desktop-dialog-BFe8wpxN.js → connect-desktop-dialog-DR3AZpl6.js} +1 -1
  92. package/dist/client/assets/{connection-card-B0Odymge.js → connection-card-ClbjHgoq.js} +1 -1
  93. package/dist/client/assets/{connection-detail-B00fRni_.js → connection-detail-B8ktqErv.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-Cfzc9ntz.js → connection-form-helpers-CkjvvPa_.js} +1 -1
  95. package/dist/client/assets/{connections-CDGkbkgV.js → connections-BcUWe8c_.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-DpwU6Fnw.js → decopilot-sse-pool-ByDpDqQ2.js} +1 -1
  97. package/dist/client/assets/{dialog-C6_0qLBU.js → dialog-hBUfi5DB.js} +1 -1
  98. package/dist/client/assets/{domain-settings-Bhf5R19l.js → domain-settings-DnawB_fV.js} +1 -1
  99. package/dist/client/assets/{drawer-BtRJAb0M.js → drawer-CrQJ-4Ry.js} +1 -1
  100. package/dist/client/assets/{dropdown-menu-96rpJkjm.js → dropdown-menu-BDW1EJyx.js} +1 -1
  101. package/dist/client/assets/{empty-state-jjn-bhGa.js → empty-state-LUctNkh2.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-BKfZXo3n.js → extract-connection-data-BFgBaCrk.js} +1 -1
  103. package/dist/client/assets/{file-explorer-CeKeprFE.js → file-explorer-1FqRLQQ5.js} +1 -1
  104. package/dist/client/assets/{file-type-icon-cPIVgg9x.js → file-type-icon-CaoqUw2g.js} +1 -1
  105. package/dist/client/assets/{files-Bn3ru1FT.js → files-BpPo_clL.js} +1 -1
  106. package/dist/client/assets/{form-BLqlEubb.js → form-B8zhOVR3.js} +1 -1
  107. package/dist/client/assets/{general-CKz0uKhP.js → general-DxlJNW0F.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-CiS_eOYq.js → github-repo-picker-D93GRlsF.js} +1 -1
  109. package/dist/client/assets/{hooks-B5swj9vo.js → hooks-DNLn_ut2.js} +1 -1
  110. package/dist/client/assets/{index-Dliz359x.js → index-BUTM8e7t.js} +1 -1
  111. package/dist/client/assets/{index-DPSWF_0V.js → index-CWrnaczo.js} +1 -1
  112. package/dist/client/assets/{index-CqkHhPgZ.js → index-Cag8mnTh.js} +1 -1
  113. package/dist/client/assets/{index-CM-AY9Fy.js → index-CdyljS_N.js} +1 -1
  114. package/dist/client/assets/{index-Bb3luPLV.js → index-DArYfizl.js} +1 -1
  115. package/dist/client/assets/{index-BUWOf6-H.js → index-DGQdC8j6.js} +3 -3
  116. package/dist/client/assets/{index-BYdleGn4.js → index-DTiOXvtP.js} +1 -1
  117. package/dist/client/assets/{index-C_fgqMB7.js → index-F-ZMCKP-.js} +2 -2
  118. package/dist/client/assets/{index-_AfOMAmM.js → index-MnX4iOa5.js} +1 -1
  119. package/dist/client/assets/{index-gNz_kq5D.js → index-gpoC3ssJ.js} +28 -28
  120. package/dist/client/assets/{index-CWxmaANj.js → index-ivY09p7e.js} +1 -1
  121. package/dist/client/assets/{index-BdUl5bJN.js → index-qg-bT8JA.js} +1 -1
  122. package/dist/client/assets/{index-redirect-CmPVrw8O.js → index-redirect-UnLDnJlQ.js} +1 -1
  123. package/dist/client/assets/{index-C9TMdwOy.js → index-sveg7vlb.js} +1 -1
  124. package/dist/client/assets/{index-Qvw8OnY1.js → index-vt02LGOF.js} +1 -1
  125. package/dist/client/assets/{input-C2XNQcRH.js → input-DwWe5Hqk.js} +1 -1
  126. package/dist/client/assets/{integration-icon-IezBYdjm.js → integration-icon-CfaWXLBn.js} +1 -1
  127. package/dist/client/assets/{invite-member-dialog-DdEYWFzF.js → invite-member-dialog-D3eUhcy1.js} +1 -1
  128. package/dist/client/assets/{label-CK1XiDPB.js → label-DdsuSm6M.js} +1 -1
  129. package/dist/client/assets/{layout-DdW7yJtW.js → layout-Bts6NJ_J.js} +1 -1
  130. package/dist/client/assets/{login-dKsCPJDm.js → login-Dd4NGdu8.js} +1 -1
  131. package/dist/client/assets/{mcp-oauth-BtnOcT8N.js → mcp-oauth-SHxAJnkD.js} +1 -1
  132. package/dist/client/assets/{members-OHD_cH5V.js → members-6mHVnRNm.js} +1 -1
  133. package/dist/client/assets/{monaco-editor-45RX9-wa.js → monaco-editor-DGONpAoN.js} +1 -1
  134. package/dist/client/assets/{monitoring-stats-row-Pf0PyiYb.js → monitoring-stats-row-CfSW2sgf.js} +1 -1
  135. package/dist/client/assets/{multi-select-B1IegP8Y.js → multi-select-CD32kF2s.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-NJnfVzCp.js → oauth-callback-Bzq_-z2r.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-ai-provider-CTrqu6Je.js → oauth-callback-ai-provider-DxKql_z0.js} +1 -1
  138. package/dist/client/assets/{onboarding-VNgiRiDL.js → onboarding-BwDunMKX.js} +1 -1
  139. package/dist/client/assets/{org-install-DH3udQUZ.js → org-install-BR62T5jO.js} +1 -1
  140. package/dist/client/assets/{org-layout-BwVt-wlI.js → org-layout-BHG4t6-u.js} +1 -1
  141. package/dist/client/assets/{organization-choice-CA519nnl.js → organization-choice-DlY0QjY5.js} +1 -1
  142. package/dist/client/assets/{orgs-CyzbToZq.js → orgs-Bsar34iG.js} +1 -1
  143. package/dist/client/assets/{page-seo-form-txb12Kn3.js → page-seo-form-D8JddRAG.js} +1 -1
  144. package/dist/client/assets/page-seo-sheet-CaWQpVxd.js +1 -0
  145. package/dist/client/assets/{popover-B2zk9niv.js → popover-BoSjy_J9.js} +1 -1
  146. package/dist/client/assets/{post-editor-DrrNmiiH.js → post-editor-BeOF_jnK.js} +1 -1
  147. package/dist/client/assets/{primitives-DlChEJzy.js → primitives-cDJctbRp.js} +1 -1
  148. package/dist/client/assets/{profile-Ds0StJLd.js → profile-BpIHCO3e.js} +1 -1
  149. package/dist/client/assets/project-app-view-CD4EGdca.js +1 -0
  150. package/dist/client/assets/record-editor-DpnQ11Qy.js +1 -0
  151. package/dist/client/assets/redirect-editor-DTyzzd3k.js +1 -0
  152. package/dist/client/assets/registry-B76hNPE7.js +2 -0
  153. package/dist/client/assets/{registry-layout-Dalyr-dX.js → registry-layout-BTDmQem2.js} +1 -1
  154. package/dist/client/assets/{reports-zmHYxym4.js → reports-rH-WO9Po.js} +1 -1
  155. package/dist/client/assets/{require-capability-qkGmH7NG.js → require-capability--U_vi60H.js} +1 -1
  156. package/dist/client/assets/{required-auth-layout-DJSVKequ.js → required-auth-layout-B-_kB-P-.js} +1 -1
  157. package/dist/client/assets/{reset-password-BQvQW_Yc.js → reset-password-BbwEGkWF.js} +1 -1
  158. package/dist/client/assets/{roles-BO1zYp8H.js → roles-BRucDg6D.js} +1 -1
  159. package/dist/client/assets/{search-input-DoQewDAM.js → search-input-B0lumlG7.js} +1 -1
  160. package/dist/client/assets/{secrets-CwEm2qB4.js → secrets-Cx316kN4.js} +1 -1
  161. package/dist/client/assets/{sections-editor-CeZVcic7.js → sections-editor-DUBW607x.js} +1 -1
  162. package/dist/client/assets/{select-model-w8ZEBOqQ.js → select-model-BltF0usx.js} +1 -1
  163. package/dist/client/assets/{select-BVg_AKhS.js → select-vVirKMnE.js} +1 -1
  164. package/dist/client/assets/{self-tool-result-8XOi1iaO.js → self-tool-result-hAvB5Ojq.js} +1 -1
  165. package/dist/client/assets/{seo-editor-Ctu5yT8I.js → seo-editor-CWtXZnRQ.js} +1 -1
  166. package/dist/client/assets/{settings-layout-Dpo54nzI.js → settings-layout-Bew9lvu0.js} +1 -1
  167. package/dist/client/assets/{settings-section-Cd7MHbmE.js → settings-section-CvpT3RW4.js} +1 -1
  168. package/dist/client/assets/{shell-controls-IB_xzFFr.js → shell-controls-C-g_XIqJ.js} +1 -1
  169. package/dist/client/assets/{shell-layout-BDvpeGAX.js → shell-layout-b2wj0DO7.js} +1 -1
  170. package/dist/client/assets/{sidebar-Bg21lFNS.js → sidebar-C_llE2r0.js} +1 -1
  171. package/dist/client/assets/{skeleton-JjNP43lD.js → skeleton-CB7DUvyX.js} +1 -1
  172. package/dist/client/assets/{sso-C_5vX52P.js → sso-CUBuMbRD.js} +1 -1
  173. package/dist/client/assets/{store-DDBShmzT.js → store-B1pmnLUq.js} +1 -1
  174. package/dist/client/assets/store-registry-UxzRtugx.js +2 -0
  175. package/dist/client/assets/{studio-tools-JGMjsS9V.js → studio-tools-DII0jqi8.js} +1 -1
  176. package/dist/client/assets/{switch-Dbe5CgqQ.js → switch-DW7tjnTv.js} +1 -1
  177. package/dist/client/assets/{table-kChvW90I.js → table-DqN44BtI.js} +1 -1
  178. package/dist/client/assets/{tabs-D6exMqkv.js → tabs-DoePSWje.js} +1 -1
  179. package/dist/client/assets/{textarea-C-upgcvq.js → textarea-BH3kgWLk.js} +1 -1
  180. package/dist/client/assets/{toggle-group-CSfYzN1e.js → toggle-group-Dbv18C0K.js} +1 -1
  181. package/dist/client/assets/{toolbar-CdhDSP7U.js → toolbar-CFkubGs8.js} +1 -1
  182. package/dist/client/assets/{toolbar-icon-button--2c5nPA5.js → toolbar-icon-button-B2gRcy3Z.js} +1 -1
  183. package/dist/client/assets/{tooltip-cXMPTvhQ.js → tooltip-CO1zVhUs.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-cFLtai6A.js → use-ai-providers-DuJIHuvT.js} +1 -1
  185. package/dist/client/assets/{use-automations-ljR2TnPA.js → use-automations-CjVm1klr.js} +1 -1
  186. package/dist/client/assets/{use-autosave-hI5b40ec.js → use-autosave-IhKsmyqJ.js} +1 -1
  187. package/dist/client/assets/{use-capability-BI2Ao-_m.js → use-capability-CEIYeJxR.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-BJ7X5vRI.js → use-clock-tick-BDXFn1B6.js} +1 -1
  189. package/dist/client/assets/{use-collections-7ERyEkIU.js → use-collections-BqfJEMNR.js} +1 -1
  190. package/dist/client/assets/{use-connection-CD2Fnptb.js → use-connection-DM8eKjeN.js} +1 -1
  191. package/dist/client/assets/{use-copy-BhzNp8tf.js → use-copy-eCXRBbSs.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-C-AFRt9S.js → use-create-virtual-mcp-C4Sbw3ia.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-CZ0xTx2w.js → use-debounced-autosave-DQFgMtID.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-B52whIH7.js → use-debounced-value-CMoeorqx.js} +1 -1
  195. package/dist/client/assets/{use-deco-credits-Cfgq3ZjW.js → use-deco-credits-C0lExqRa.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-BNjf3dpu.js → use-decopilot-events-qGOD1WG0.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-zsTP85HZ.js → use-delete-connection-BOFCmtMj.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-C6GJURpg.js → use-deployment-admin-Cwn49qZM.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-1u4ZUq9F.js → use-file-configs-Nmeyll7B.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-DiSaAQPl.js → use-infinite-scroll-DW-B2iyn.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-U5r9xSzr.js → use-join-requests-Dz8x0kbW.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-dq4wRd85.js → use-mcp-auth-status-D-ki6Fzr.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-qnk43eG1.js → use-mcp-client-Csg0Ohl1.js} +1 -1
  204. package/dist/client/assets/{use-mcp-tools-SncKc9ct.js → use-mcp-tools-DF4E3rLo.js} +1 -1
  205. package/dist/client/assets/{use-members-Dey3M7mC.js → use-members-B1t5oiJJ.js} +1 -1
  206. package/dist/client/assets/{use-mobile-oSorlQMv.js → use-mobile-DVuyUrh-.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-7gJqLFkE.js → use-navigate-to-agent-BL2c2hni.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-aAeyG-Cs.js → use-org-auth-client-dM7W8lCQ.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-De26T__u.js → use-org-sso-w2vntLws.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-DNlG9eUj.js → use-organization-roles-7B2EryzT.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-DrhRsJWG.js → use-organization-settings-Dfv3IVMe.js} +1 -1
  212. package/dist/client/assets/{use-registry-connections-CmItta1b.js → use-registry-connections-DMVj_IUs.js} +1 -1
  213. package/dist/client/assets/{use-secrets-DDzz0qxd.js → use-secrets-j8nq_pg4.js} +1 -1
  214. package/dist/client/assets/{use-status-sounds-4kB8txsU.js → use-status-sounds-CQv-RBYC.js} +1 -1
  215. package/dist/client/assets/{use-view-mode-CtgJ6di_.js → use-view-mode-DJr2m2Jz.js} +1 -1
  216. package/dist/client/assets/{use-virtual-mcp-BJxeG1T-.js → use-virtual-mcp-6yApsgIW.js} +1 -1
  217. package/dist/client/assets/useInfiniteQuery-CzbwdXBh.js +1 -0
  218. package/dist/client/assets/{useRouterState-DRz1wrvb.js → useRouterState-D5zTQX9l.js} +1 -1
  219. package/dist/client/assets/useSuspenseInfiniteQuery-0mVVL1tH.js +1 -0
  220. package/dist/client/assets/{users-CUTUKT6m.js → users-Dji-ZHlw.js} +1 -1
  221. package/dist/client/assets/{variant-calendar-HHl2ENnf.js → variant-calendar-UBPoL6eu.js} +1 -1
  222. package/dist/client/assets/{view-mode-toggle-DqoxH_gE.js → view-mode-toggle-BxM9Rzzk.js} +1 -1
  223. package/dist/client/index.html +1 -1
  224. package/dist/server/cli.js +1 -1
  225. package/dist/server/server.js +1 -1
  226. package/package.json +1 -1
  227. package/dist/client/assets/automations-TF-uE_JU.js +0 -1
  228. package/dist/client/assets/page-seo-sheet-B7-vAcY0.js +0 -1
  229. package/dist/client/assets/project-app-view-Dtfecj3R.js +0 -1
  230. package/dist/client/assets/record-editor-5g7SCJ1d.js +0 -1
  231. package/dist/client/assets/redirect-editor-BVp57v49.js +0 -1
  232. package/dist/client/assets/registry-ddiHAuZI.js +0 -2
  233. package/dist/client/assets/store-registry-D43DIoAy.js +0 -2
  234. package/dist/client/assets/useInfiniteQuery-C6UXsGIP.js +0 -1
  235. package/dist/client/assets/useSuspenseInfiniteQuery-Cn5B2KcA.js +0 -1
@@ -1 +1 @@
1
- import{c as p,j as m}from"./index-BUWOf6-H.js";import{u as l}from"./use-capability-BI2Ao-_m.js";import{A as u}from"./access-gate-BjqlcKiO.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
1
+ import{c as p,j as m}from"./index-DGQdC8j6.js";import{u as l}from"./use-capability-CEIYeJxR.js";import{A as u}from"./access-gate-B4pZWmwl.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
@@ -1 +1 @@
1
- import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-BUWOf6-H.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
1
+ import{c as l,j as s,A as a,S as m,f as h,h as u,N as f}from"./index-DGQdC8j6.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(f,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function g(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{g as R};
@@ -1 +1 @@
1
- import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-BUWOf6-H.js";import{I as L}from"./input-C2XNQcRH.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
1
+ import{c as q,u as Y,b as A,r as B,d as G,j as s,B as z,a as K}from"./index-DGQdC8j6.js";import{I as L}from"./input-DwWe5Hqk.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let g;e[22]!==a||e[23]!==t?(g=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=g):g=e[24];let f;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(f=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=f):f=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==g||e[42]!==f||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,g,f,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=g,e[42]=f,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
@@ -1 +1 @@
1
- import{r as F,C as Ne,K as re,b4 as ct,m as Ce,j as s,l as K,i as fe,B as le,c as H,H as we,ad as be,I as se,af as Le,ag as Pe,n as ze,M as dt,J as mt,d as Ye,t as he,p as Ae,w as Fe,x as ut,E as ft,b as ht,u as xt}from"./index-BUWOf6-H.js";import{u as pt}from"./use-organization-roles-DNlG9eUj.js";import{u as Re}from"./use-org-auth-client-aAeyG-Cs.js";import{g as $e,a as gt}from"./role-color-DVw_ATb1.js";import{B as xe}from"./badge-Brm7dRFm.js";import{f as Ke,a as Qe,b as He,c as qe,d as Ze,A as Je,e as Xe,g as We}from"./alert-dialog-iGippWYX.js";import{D as Tt,a as Et,c as _t,d as It}from"./dropdown-menu-96rpJkjm.js";import{i as bt}from"./DotsVertical-Ckk9mZsT.js";import{s as Se}from"./Plus-OGxa0fdn.js";import{s as Nt}from"./Trash01-9Yhy1NDp.js";import{C as St}from"./collection-table-wrapper-D1lST78v.js";import{P as te}from"./index-BdUl5bJN.js";import{E as De}from"./empty-state-jjn-bhGa.js";import{S as Oe}from"./search-input-DoQewDAM.js";import{P as et,D as tt}from"./ai-providers-logos-DD3qZ33J.js";import{I as je}from"./integration-icon-IezBYdjm.js";import{u as Ct}from"./use-infinite-scroll-DiSaAQPl.js";import{C as ve}from"./checkbox-YjFOYgvp.js";import{b as At}from"./Settings02-s4dN6VnR.js";import{u as Rt}from"./useSuspenseInfiniteQuery-Cn5B2KcA.js";import{u as Ot}from"./use-mcp-client-qnk43eG1.js";import{S as jt}from"./constants-D_FQAPnt.js";import{C as vt}from"./collection-search-BebQySxJ.js";import{u as st}from"./use-members-Dey3M7mC.js";import{g as lt}from"./get-initials-D-f_fDFw.js";import{u as yt}from"./use-connection-CD2Fnptb.js";import{u as Mt,c as wt}from"./use-ai-providers-cFLtai6A.js";import{A as nt}from"./avatar-6ZpKSJQ1.js";import{S as pe}from"./switch-Dbe5CgqQ.js";import{c as ge,b as Te,T as Ee,a as _e}from"./tooltip-cXMPTvhQ.js";import{S as ke,a as Ge,b as Ue}from"./settings-section-Cd7MHbmE.js";import{t as Lt}from"./ChevronDown-DorDM-K-.js";import{i as Pt}from"./ChevronRight-NJ1RHqa7.js";import{i as Be}from"./X-8dZUy9dd.js";import{a as Dt}from"./use-capability-BI2Ao-_m.js";import{A as kt}from"./access-gate-BjqlcKiO.js";import"./Check-ylcp47jh.js";import"./Circle-BGJOKhru.js";import"./table-kChvW90I.js";import"./ArrowUp-BcoNWaDn.js";import"./sidebar-Bg21lFNS.js";import"./LayoutLeft-DP-M8mno.js";import"./use-mobile-oSorlQMv.js";import"./SearchMd-DhGVvJ2r.js";import"./Tool02-B5mtXP4w.js";import"./agent-icon-DCK7PpQ3.js";import"./AlertCircle-BVlB73Gd.js";import"./UserPlus01-ByXfLuOW.js";import"./Tool01-CQ5Yi4Y5.js";import"./XCircle-DY5ehXOb.js";import"./ArrowUpRight-COlnzfbE.js";import"./TrendUp01-CUYb4fKq.js";import"./ZapSquare-CIT8HcpR.js";import"./ZoomOut-DoDMe5dD.js";import"./Users03-DQHSM-ip.js";import"./CheckCircle-jaIqf58w.js";import"./ChevronUp-C85SxyPM.js";import"./Stars02-Brbdnmc2.js";import"./Copy01-C5M0y3sD.js";import"./Globe01-DwjnaG3m.js";import"./Eye-ByzbJOuX.js";import"./FilterLines-hGzDxUbQ.js";import"./Flag01-D6FA8Gqb.js";import"./Star01-CdWOUCGL.js";import"./Globe04-KMRfe3Ap.js";import"./SwitchHorizontal01-CQC-VHSM.js";import"./HardDrive-BLW7r-EP.js";import"./Image01-DID7YK1H.js";import"./Key01-BNdv9d9e.js";import"./LinkExternal01-CJELREUW.js";import"./List-B6zsWjbc.js";import"./Monitor01-DGMiqS2G.js";import"./Sun-DrhefHVP.js";import"./Package-Cys9wdnk.js";import"./Palette-CjpYx7Ii.js";import"./Play-BIDZ3Qx4.js";import"./SearchLg-BkGBAC6u.js";import"./Shield01-C2gwqyT0.js";import"./Stars01-Ce7N7beA.js";import"./Upload01-BGaIkl8C.js";import"./User01-DY8EdPzH.js";import"./Users01-DnUyZ4sc.js";import"./XClose-IT2oT79e.js";import"./Zap-UNZ6wjOU.js";import"./auth-BBryGktV.js";import"./use-collections-7ERyEkIU.js";import"./studio-tools-JGMjsS9V.js";import"./card-DmJEBNvh.js";import"./capability-load-error-u8-vFMPG.js";const ye="basic-usage",Me=[{id:ye,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===ye)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===ye)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function Bt(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function Vt(t,e,l){if(l){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function zt(t){const e=H.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,x=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==x?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",x),e[0]=x,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(je,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let p;e[5]!==l.title?(p=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=p):p=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==p?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,p]}),e[7]=h,e[8]=a,e[9]=p,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==l.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(ve,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=l.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let N;return e[17]!==f||e[18]!==o||e[19]!==m?(N=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=N):N=e[20],N}function Yt(t){return t.stopPropagation()}function Ft(t){const e=H.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:r}=t,d=`tool-${l}-${n.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let x;e[2]!==c||e[3]!==n.name?(x=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:n.name})}),e[2]=c,e[3]=n.name,e[4]=x):x=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==x||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,f]}),e[7]=x,e[8]=f,e[9]=a):a=e[9];const p=`tool-${l}-${n.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==p?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ve,{id:p,checked:i,onCheckedChange:r,onClick:$t})}),e[10]=i,e[11]=r,e[12]=p,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function $t(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[i,r]=F.useState(""),d=n!==void 0?n:i,h=F.useDeferredValue(d),[c,x]=F.useState("all"),[f,a]=F.useState(!1),p=F.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,_=h.trim(),E=_?{operator:"or",conditions:[{field:["title"],operator:"contains",value:_},{field:["description"],operator:"contains",value:_}]}:void 0,S=!!l,C={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:g,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:T,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,D)=>{if(T?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),b=I?.pages.flatMap(T=>T?.items??[])??[],j=Ct(R,g??!1,O),u=l?b.filter(T=>T.connection_type!=="VIRTUAL"?!0:ct(T.connection_url)!==l):b,M=p.current,A=[...M.values()].map(T=>u.find(D=>D.id===T)).filter(T=>T!==void 0),k=u.filter(T=>!M.has(T.id)),G=[...A,...k],U=T=>{const D=t[T];return D!==void 0&&D.length>0},B=G.filter(T=>{if(c==="all")return!0;const D=U(T.id);return c==="selected"?D:c==="unselected"?!D:!0}),[w,z]=F.useState(G[0]?.id??null),y=w?G.find(T=>T.id===w)??null:null,{data:L,isFetching:Y}=Ce({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",w??""),queryFn:async()=>w?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:w}})).structuredContent?.item??null:null,enabled:!!w,staleTime:3e4}),$=L?.tools??[],J=(T,D)=>t[T]?.includes(D)??!1,X=(T,D)=>{const Q=t[T]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[T]:W[T]=Z}else W[T]=[...Q,D];e(W)},ne=T=>{const D=T===w?$:[];if(!D.length)return;const Q=t[T]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[T]:(Z[T]=q,z(T)),e(Z)},oe=T=>{z(T),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[n===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>x("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>x("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>x("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(T=>{const D=w===T.id,Q=D?$.length:0,q=t[T.id]?.length??0;return s.jsx(zt,{connection:{...T,tools:D?$:T.tools},isSelected:D,hasToolsEnabled:U(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(T.id),onToggle:()=>ne(T.id)},T.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(le,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(je,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:$.map(T=>s.jsx(Ft,{connectionId:y.id,tool:T,isSelected:J(y.id,T.name),onToggle:()=>X(y.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Qt=we({role:we({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:Pe(),staticPermissions:be(se()),toolSet:Le(se(),be(se())),allowAllModels:Pe(),modelSet:Le(se(),be(se())),memberIds:be(se())});function Ve(t,e,l){const n=s.jsx(pe,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):n}function Ht(t){const e=H.c(28),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let x;e[0]!==h?(x=h.trim().toLowerCase(),e[0]=h,e[1]=x):x=e[1];const f=F.useDeferredValue(x);let a;if(e[2]!==l||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==n){const p=Ut(),o=(v,I)=>{if(!c){if(l&&I){const R=p.flatMap(Jt).flatMap(Zt);i(!1),r(R.filter(g=>!v.tools.includes(g)));return}l||r(Vt(v,n,!I))}};let m;e[10]!==f?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(g=>!f||g.label.toLowerCase().includes(f)||g.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=p.map(m).filter(qt);let _;e[12]!==l||e[13]!==i||e[14]!==r?(_=()=>{i(!l),r([])},e[12]=l,e[13]=i,e[14]=r,e[15]=_):_=e[15];let E;e[16]!==l||e[17]!==c||e[18]!==_?(E=Ve(l,c,_),e[16]=l,e[17]=c,e[18]=_,e[19]=E):E=e[19];let S;e[20]!==l||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!l),r([])},e[20]=l,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==E||e[26]!==S?(C=s.jsx(ke,{title:"General",children:s.jsx(Ge,{children:s.jsx(Ue,{title:"All organization permissions",description:"Grant full access to all features below",action:E,onClick:S})})}),e[25]=E,e[26]=S,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,N.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):N.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(ke,{title:I,children:s.jsx(Ge,{children:R.map(g=>{const O=Bt(g,n,l);return s.jsx(Ue,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[g.label,g.dangerous&&s.jsx(ut,{size:12,className:"text-warning shrink-0"})]}),description:g.description,action:Ve(O,c,()=>o(g,O)),onClick:c?void 0:()=>o(g,O)},g.id)})})},I)})]})}),e[2]=l,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=n,e[9]=a}else a=e[9];return a}function qt(t){return t.capabilities.length>0}function Zt(t){return t.tools}function Jt(t){return t.capabilities}const ot={anthropic:"Anthropic",openrouter:"OpenRouter"},Xt={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Wt(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function es(t){return Xt[t]??ot[t]??t}function ts(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const it=30;function ss(t){const e=H.c(44),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:x,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:p,readOnly:o,defaultExpanded:m}=t,[N,_]=F.useState(m),E=m||N,S=_,[C,v]=F.useState(it);let I;e[0]!==f||e[1]!==x||e[2]!==c?(I=j=>x||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=x,e[2]=c,e[3]=I):I=e[3];const R=I;let g;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],g=d.filter(j),e[4]=R,e[5]=d,e[6]=g}else g=e[6];const O=g.length;let b;if(e[9]!==h||e[10]!==x||e[11]!==l||e[12]!==O||e[13]!==E||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==p||e[18]!==a||e[19]!==o||e[20]!==n||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let M;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(is),e[24]=M):M=e[24];const A=r??et[n]??tt;let k;e[25]!==i||e[26]!==A?(k=s.jsx(je,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(xe,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let w;e[36]!==E?(w=E?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=E,e[37]=w):w=e[37];let z;e[38]!==w||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,w]}),e[38]=w,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:M,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],b=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),$=()=>{if(!o){if(x){p(l,h,L.id);return}a(l,L.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:$,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:os,children:o?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:Y,disabled:!0,onCheckedChange:ns})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:Y,onCheckedChange:$})})]},L.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(ls),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=x,e[11]=l,e[12]=O,e[13]=E,e[14]=r,e[15]=R,e[16]=d,e[17]=p,e[18]=a,e[19]=o,e[20]=n,e[21]=i,e[22]=C,e[23]=b}else b=e[23];return b}function ls(t){return t+it}function ns(){}function os(t){return t.stopPropagation()}function is(t){return!t}function rs(t){const e=H.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:x}=t,f=wt(l.id);let a,p,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==x||e[9]!==c||e[10]!==n){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==l.label?(S=A=>({...A,id:A.modelId,provider:l.label}),e[16]=l.label,e[17]=S):S=e[17];const C=f.filter(ms).map(S),v=c.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){N=null;break e}const R=new Map;for(const A of I){const k=Wt(A.id,l.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ts(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const g=Array.from(R.entries()).map(ds).sort(cs),O=g.length===1||v.length>0;o="flex flex-col gap-3";const b=et[l.providerId]??tt;let j;e[18]!==l.providerId||e[19]!==b?(j=s.jsx("img",{src:b,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=b,e[20]=j):j=e[20];const u=ot[l.providerId]??l.providerId;let M;e[21]!==u?(M=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=M):M=e[22],e[23]!==M||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,M]}),e[23]=M,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",p=g.map(A=>s.jsx(ss,{connectionId:l.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(as),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:x,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=x,e[9]=c,e[10]=n,e[11]=a,e[12]=p,e[13]=o,e[14]=m,e[15]=N}else a=e[11],p=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let _;e[26]!==a||e[27]!==p?(_=s.jsx("div",{className:a,children:p}),e[26]=a,e[27]=p,e[28]=_):_=e[28];let E;return e[29]!==o||e[30]!==m||e[31]!==_?(E=s.jsxs("div",{className:o,children:[m,_]}),e[29]=o,e[30]=m,e[31]=_,e[32]=E):E=e[32],E}function as(t){return t.id}function cs(t,e){return t.name.localeCompare(e.name)}function ds(t){const[e,l]=t;return{id:e,name:es(e),logo:l.logo,models:l.models}}function ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function us(t){const e=H.c(35),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,x=F.useDeferredValue(h),f=Mt();let a;e[0]!==n||e[1]!==r?(a=(g,O)=>{const b=n[g]??[],j={...n};if(b.includes(O)){const u=b.filter(M=>M!==O);u.length===0?delete j[g]:j[g]=u}else j[g]=[...b,O];r(j)},e[0]=n,e[1]=r,e[2]=a):a=e[2];const p=a;let o;e[3]!==n||e[4]!==i||e[5]!==r?(o=(g,O,b)=>{i(!1),r({...n,[g]:O.filter(j=>j!==b)})},e[3]=n,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,N=!c&&"hover:bg-muted/50 cursor-pointer";let _;e[7]!==N?(_=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=_):_=e[8];let E;e[9]!==l||e[10]!==i||e[11]!==r||e[12]!==c?(E=()=>{if(c)return;const g=!l;i(g),g&&r({})},e[9]=l,e[10]=i,e[11]=r,e[12]=c,e[13]=E):E=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=S):S=e[14];let C;e[15]!==l||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:hs,children:c?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:l,disabled:!0,onCheckedChange:fs})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:l,onCheckedChange:g=>{i(g),g&&r({})}})}),e[15]=l,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==_||e[21]!==E||e[22]!==C?(v=s.jsxs("div",{className:_,onClick:E,children:[S,C]}),e[20]=_,e[21]=E,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==f||e[25]!==l||e[26]!==x||e[27]!==m||e[28]!==n||e[29]!==c||e[30]!==p?(I=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(g=>s.jsx(F.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(rs,{connection:g,selectedModels:n[g.id]??[],allowAllModels:l,onToggleModel:p,onExitAllowAll:m,allConnectionModelsSelected:(n[g.id]??[]).includes("*"),searchQuery:x,readOnly:c})},g.id)),e[24]=f,e[25]=l,e[26]=x,e[27]=m,e[28]=n,e[29]=c,e[30]=p,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,e[33]=v,e[34]=R):R=e[34],R}function fs(){}function hs(t){return t.stopPropagation()}function xs(t){const e=H.c(52),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=F.useState(""),c=F.useDeferredValue(d);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[f,a]=F.useState(x),{data:p}=st();let o,m,N,_,E,S,C,v,I,R,g;if(e[1]!==p?.data?.members||e[2]!==c||e[3]!==r||e[4]!==n||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==i){const U=p?.data?.members??[];let B;e[20]!==c?(B=y=>{const L=c.toLowerCase();return y.user?.name?.toLowerCase().includes(L)||y.user?.email?.toLowerCase().includes(L)},e[20]=c,e[21]=B):B=e[21];const w=U.filter(B);let z;e[22]!==r||e[23]!==n||e[24]!==f?(z=()=>{r(f),a([]),n(!1)},e[22]=r,e[23]=n,e[24]=f,e[25]=z):z=e[25],N=z,m=Ke,R=l,g=n,o=Qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(qe,{children:"Add Members to Role"}),s.jsx(Ze,{children:"Select members to add to this role."})]}),e[26]=I):I=e[26],S="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Oe,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],_="flex-1 overflow-auto",E=w.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:w.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),$=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!L||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ve,{checked:$||Y,onCheckedChange:()=>{!L||Y||a(J=>J.includes(y.id)?J.filter(X=>X!==y.id):[...J,y.id])},disabled:!L||Y}),s.jsx(nt,{url:y.user?.image??void 0,fallback:lt(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!L&&s.jsx(xe,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(xe,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=p?.data?.members,e[2]=c,e[3]=r,e[4]=n,e[5]=l,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=_,e[13]=E,e[14]=S,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=g}else o=e[9],m=e[10],N=e[11],_=e[12],E=e[13],S=e[14],C=e[15],v=e[16],I=e[17],R=e[18],g=e[19];let O;e[29]!==_||e[30]!==E?(O=s.jsx("div",{className:_,children:E}),e[29]=_,e[30]=E,e[31]=O):O=e[31];let b;e[32]!==O||e[33]!==S||e[34]!==C?(b=s.jsxs("div",{className:S,children:[C,O]}),e[32]=O,e[33]=S,e[34]=C,e[35]=b):b=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,M=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==M?(A=s.jsxs(Xe,{className:"px-6 pb-6",children:[j,s.jsxs(We,{onClick:N,disabled:u,children:["Add ",M]})]}),e[37]=N,e[38]=u,e[39]=M,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==b||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(o,{className:v,children:[I,b,A]}),e[41]=o,e[42]=b,e[43]=A,e[44]=v,e[45]=I,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==g?(G=s.jsx(m,{open:R,onOpenChange:g,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=g,e[51]=G):G=e[51],G}function ps(t){const e=H.c(29),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,x=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=F.useDeferredValue(d),{data:p}=st();let o,m,N;if(e[0]!==p?.data?.members||e[1]!==a||e[2]!==l||e[3]!==n||e[4]!==x||e[5]!==f||e[6]!==d){const v=p?.data?.members??[];let I;e[10]!==l?(I=b=>l.includes(b.id),e[10]=l,e[11]=I):I=e[11];const R=v.filter(I);let g;e[12]!==a?(g=b=>{const j=a.toLowerCase();return b.user?.name?.toLowerCase().includes(j)||b.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=g):g=e[13];const O=R.filter(g);N="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(b=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(nt,{url:b.user?.image??void 0,fallback:lt(b.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:b.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.user?.email})]}),x?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(le,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Be,{size:16})})})}),s.jsx(_e,{children:s.jsx("p",{children:f})})]})}):s.jsx(le,{variant:"ghost",size:"sm",onClick:()=>n(l.filter(j=>j!==b.id)),children:s.jsx(Be,{size:16})})]},b.id))}),e[0]=p?.data?.members,e[1]=a,e[2]=l,e[3]=n,e[4]=x,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=N}else o=e[7],m=e[8],N=e[9];let _;e[14]!==o||e[15]!==m?(_=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=_):_=e[16];let E;e[17]!==l||e[18]!==n?(E=v=>n([...l,...v]),e[17]=l,e[18]=n,e[19]=E):E=e[19];let S;e[20]!==h||e[21]!==l||e[22]!==c||e[23]!==E?(S=s.jsx(xs,{open:h,onOpenChange:c,selectedMemberIds:l,onAddMembers:E}),e[20]=h,e[21]=l,e[22]=c,e[23]=E,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==_||e[27]!==S?(C=s.jsxs("div",{className:N,children:[_,S]}),e[25]=N,e[26]=_,e[27]=S,e[28]=C):C=e[28],C}function gs(t){const e=H.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(F.Suspense,{fallback:l,children:s.jsx(ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Ts={owner:[],admin:[],user:[]};function Es(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Ts[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function _s(t,e,l){const n=t.permission||{},i=n.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,p]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const o of l)h[o.id]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p;else{const o=l.find(m=>m.id===a);o&&(h[a]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p)}const c=n.models||[],x=c.length===0||c.includes("*:*"),f={};if(!x)for(const a of c){const p=a.indexOf(":");if(p===-1)continue;const o=a.slice(0,p),m=a.slice(p+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:x,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Is(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===n)?.tools?.map(h=>h.name)??[];l[n]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)n.push(`${i}:${d}`);n.length>0&&(l.models=n)}return l}function bs(t,e,l){return t.kind==="builtin"?Es(t.role,e,void 0):t.kind==="custom"?_s(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ns(t){const e=H.c(6),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,r=n===void 0?"Owner membership cannot be changed":n;if(l){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(le,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Se,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let x;return e[1]!==r?(x=s.jsx(ge,{children:s.jsxs(Te,{children:[c,s.jsx(_e,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=x):x=e[2],x}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(le,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Ss(t){const e=H.c(14),{locator:l}=Ne(),n=Re(),i=yt();let r;e[0]!==l?(r=re.members(l),e[0]=l,e[1]=r):r=e[1];let d;e[2]!==n?(d=()=>n.organization.listMembers(),e[2]=n,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:x}=Ce(h);if(x||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let p;return e[10]!==i||e[11]!==a||e[12]!==t?(p=s.jsx(Cs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=p):p=e[13],p}function Cs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const{locator:r}=Ne(),d=Re(),h=ze(),c=t.kind==="builtin",x=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,p]=F.useState(c?"org":"mcp"),o=dt({resolver:mt(Qt),defaultValues:bs(t,n,i)}),m=o.formState.isValid,N=o.formState.isDirty,_=Ye({mutationFn:async u=>{const M=Is(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const w=n.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!w.includes(L)),y=w.filter(L=>!u.memberIds.includes(L));for(const L of z){const Y=await d.organization.updateMemberRole({memberId:L,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const L of y){const Y=await d.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,w=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:M,...w?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(w?U:B,w?B:void 0),w?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:M});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const w=await d.organization.updateMemberRole({memberId:B,role:[A]});if(w?.error)throw new Error(w.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,M)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!M.role.id&&!M.role.slug,k=M.role.slug==="owner"&&!M.role.id;Ae(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:M.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),l(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),E=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}_.mutate(u)}),S=!x,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...x?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=F.useState(""),[g,O]=F.useState(!1),b=u=>{p(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:S&&s.jsxs(s.Fragment,{children:[s.jsx(le,{variant:"outline",size:"sm",onClick:e,disabled:_.isPending,children:"Cancel"}),s.jsx(le,{size:"sm",onClick:E,disabled:_.isPending||!m||!N,children:_.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?$e(t.role,!0):gt(o.watch("role.label")))}),x&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>b(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Oe,{value:I,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(Ns,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!x&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Ht,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="models"&&s.jsx(us,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="members"&&s.jsx(gs,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:I,addMemberDialogOpen:g,onAddMemberDialogOpenChange:O})]})})]})})}function As(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Rs(t){const e=H.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==l||e[1]!==n||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:l,children:n}),e[0]=l,e[1]=n,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const Os=[{role:"owner",label:"Owner"},{role:"admin",label:"Admin"},{role:"user",label:"User"}];function js(){const t=H.c(77),[e,l]=F.useState(""),[n,i]=F.useState(null),r=ht();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Ne(),x=Re(),f=ze(),{customRoles:a,refetch:p}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let N;e:{if(!h){N=null;break e}if(h==="new"){N={kind:"new"};break e}if(h.startsWith("builtin-")){N={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);N=V?{kind:"custom",role:V}:null}const _=N;let E;t[5]!==c?(E=re.members(c),t[5]=c,t[6]=E):E=t[6];let S;t[7]!==x?(S=()=>x.organization.listMembers(),t[7]=x,t[8]=S):S=t[8];let C;t[9]!==E||t[10]!==S?(C={queryKey:E,queryFn:S},t[9]=E,t[10]=S,t[11]=C):C=t[11];const{data:v}=Ce(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;let g;t[14]!==R?(g=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=g):g=t[15];const O=g;let b;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=Os.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const rt=a.map(ae);if(b=[...V,...rt],e){const ce=e.toLowerCase();b=b.filter(at=>at.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=b}else b=t[19];let j;t[24]!==x?(j=async P=>{const V=await x.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=x,t[25]=j):j=t[25];const u=Ye({mutationFn:j,onSuccess:(P,V)=>{Ae("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),p(),_?.kind==="custom"&&_.role.id===V&&m(void 0)},onError:Ds});let M,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Ps,cellClassName:"flex-1 min-w-0",sortable:!0},M={id:"type",header:"Type",render:Ls,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:ws,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Ms,cellClassName:"w-24 shrink-0"},t[26]=M,t[27]=A,t[28]=k,t[29]=G):(M=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,M,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ys,children:s.jsx(bt,{size:16})})}),s.jsx(_t,{align:"end",onClick:vs,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(Nt,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let w;t[31]!==m?(w=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=w):w=t[32];const z=w;if(_){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==p||t[36]!==m?(V=()=>{p(),m(void 0)},t[35]=p,t[36]=m,t[37]=V):V=t[37],s.jsx(Ss,{target:_,onBack:P,onSaved:V},As(_))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=P=>{P.key==="Escape"&&(l(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(Oe,{value:e,onChange:l,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let $;t[42]!==m?($=()=>m("new"),t[42]=m,t[43]=$):$=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Se,{size:16}),t[44]=J):J=t[44];let X;t[45]!==$?(X=s.jsxs(le,{onClick:$,children:[J,"Create Role"]}),t[45]=$,t[46]=X):X=t[46];let ne;t[47]!==Y||t[48]!==X?(ne=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,X]}),t[47]=Y,t[48]=X,t[49]=ne):ne=t[49];let oe;t[50]!==e?(oe=e?s.jsx(De,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(De,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==b||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(St,{columns:B,data:b,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=b,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let T;t[57]!==ne||t[58]!==ie?(T=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,ne,ie]})})}),t[57]=ne,t[58]=ie,t[59]=T):T=t[59];const D=n!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(qe,{children:"Delete Role"}),t[61]=q):q=t[61];const W=n?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[q,s.jsxs(Ze,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==n?(de=s.jsxs(Xe,{children:[ee,s.jsx(We,{onClick:()=>{n?.id&&u.mutate(n.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=n,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(Qe,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Ke,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let Ie;return t[74]!==T||t[75]!==ue?(Ie=s.jsxs(te,{children:[T,ue]}),t[74]=T,t[75]=ue,t[76]=Ie):Ie=t[76],Ie}function vs(t){return t.stopPropagation()}function ys(t){return t.stopPropagation()}function Ms(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function ws(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,l=[];return e.allowsAllStaticPermissions?l.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&l.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?l.push("All connections"):e.connectionCount&&e.connectionCount>0&&l.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:l.length>0?l.join(", "):"No permissions"})}function Ls(t){return t.kind==="builtin"?s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(xe,{variant:"outline",className:"text-xs",children:"Custom"})}function Ps(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",$e(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Fe,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ds(t,e){Ae("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function ks(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ft,{fallback:e,children:s.jsx(F.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(js,{})})}),t[1]=l):l=t[1],l}function _n(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Rs,{area:"roles",children:s.jsx(ks,{})}),t[0]=e):e=t[0],e}export{_n as default};
1
+ import{r as F,C as Ne,K as re,b4 as ct,m as Ce,j as s,l as K,i as fe,B as le,c as H,H as we,ad as be,I as se,af as Le,ag as Pe,n as ze,M as dt,J as mt,d as Ye,t as he,p as Ae,w as Fe,x as ut,E as ft,b as ht,u as xt}from"./index-DGQdC8j6.js";import{u as pt}from"./use-organization-roles-7B2EryzT.js";import{u as Re}from"./use-org-auth-client-dM7W8lCQ.js";import{g as $e,a as gt}from"./role-color-DVw_ATb1.js";import{B as xe}from"./badge-DuwyDvgL.js";import{f as Ke,a as Qe,b as He,c as qe,d as Ze,A as Je,e as Xe,g as We}from"./alert-dialog-CWlVUd73.js";import{D as Tt,a as Et,c as _t,d as It}from"./dropdown-menu-BDW1EJyx.js";import{i as bt}from"./DotsVertical-B0IViKUD.js";import{s as Se}from"./Plus-D8fSfWhL.js";import{s as Nt}from"./Trash01-BGwW4PUs.js";import{C as St}from"./collection-table-wrapper-DPtPbXkO.js";import{P as te}from"./index-qg-bT8JA.js";import{E as De}from"./empty-state-LUctNkh2.js";import{S as Oe}from"./search-input-B0lumlG7.js";import{P as et,D as tt}from"./ai-providers-logos-DD3qZ33J.js";import{I as je}from"./integration-icon-CfaWXLBn.js";import{u as Ct}from"./use-infinite-scroll-DW-B2iyn.js";import{C as ve}from"./checkbox-DbEZ6b_D.js";import{b as At}from"./Settings02-CJygIZBg.js";import{u as Rt}from"./useSuspenseInfiniteQuery-0mVVL1tH.js";import{u as Ot}from"./use-mcp-client-Csg0Ohl1.js";import{S as jt}from"./constants-D_FQAPnt.js";import{C as vt}from"./collection-search-26JlKJRJ.js";import{u as st}from"./use-members-B1t5oiJJ.js";import{g as lt}from"./get-initials-D-f_fDFw.js";import{u as yt}from"./use-connection-DM8eKjeN.js";import{u as Mt,c as wt}from"./use-ai-providers-DuJIHuvT.js";import{A as nt}from"./avatar-BumqAYVV.js";import{S as pe}from"./switch-DW7tjnTv.js";import{c as ge,b as Te,T as Ee,a as _e}from"./tooltip-CO1zVhUs.js";import{S as ke,a as Ge,b as Ue}from"./settings-section-CvpT3RW4.js";import{t as Lt}from"./ChevronDown-DCZlSvzQ.js";import{i as Pt}from"./ChevronRight-L_rxCnv3.js";import{i as Be}from"./X-Bs0u_0yh.js";import{a as Dt}from"./use-capability-CEIYeJxR.js";import{A as kt}from"./access-gate-B4pZWmwl.js";import"./Check-Oxo5mPeL.js";import"./Circle-DLL8alCD.js";import"./table-DqN44BtI.js";import"./ArrowUp-OqBYOpu3.js";import"./sidebar-C_llE2r0.js";import"./LayoutLeft-DPtsS7J4.js";import"./use-mobile-DVuyUrh-.js";import"./SearchMd-Di7fRkvt.js";import"./Tool02-DlSNNbnL.js";import"./agent-icon-Xdz_mRuJ.js";import"./AlertCircle-DBEuJvXd.js";import"./UserPlus01-DvdLIpOn.js";import"./Tool01-DHJpebK1.js";import"./XCircle-DGorVz-d.js";import"./ArrowUpRight-3xkp-kWm.js";import"./TrendUp01-Lnwj2rUh.js";import"./ZapSquare-DivgtbPr.js";import"./ZoomOut-B2C9WPW-.js";import"./Users03-FhX9tiey.js";import"./CheckCircle-DAvZWWWn.js";import"./ChevronUp-BXrO8J56.js";import"./Stars02-Bs0TEaNy.js";import"./Copy01-uwiMYWRU.js";import"./Globe01-By9gtoyg.js";import"./Eye-DVo1_Pm2.js";import"./FilterLines-CAdlDh3I.js";import"./Flag01-fXAeu3l9.js";import"./Star01-CAO22TgC.js";import"./Globe04-uOyvHHk7.js";import"./SwitchHorizontal01-DqE-u_vC.js";import"./HardDrive-D38nWE_J.js";import"./Image01-B-uMMK1I.js";import"./Key01-ChBXFLCM.js";import"./LinkExternal01-C3luIiQr.js";import"./List-CgvHjjyd.js";import"./Monitor01-BbnHlrzQ.js";import"./Sun-BZaKEOLT.js";import"./Package-CJkGCd9M.js";import"./Palette-Dem2eeFJ.js";import"./Play-02R_l1hm.js";import"./SearchLg-BKY8fQrj.js";import"./Shield01-bU8ewL-C.js";import"./Stars01-BbGPjqZd.js";import"./Upload01-DVcY511n.js";import"./User01-joygJQdk.js";import"./Users01-BVTwFHJb.js";import"./XClose-hq2LkF75.js";import"./Zap-CT4kcBoV.js";import"./auth-DDOP_TUe.js";import"./use-collections-BqfJEMNR.js";import"./studio-tools-DII0jqi8.js";import"./card-whir3-TU.js";import"./capability-load-error-CVQ-0IvS.js";const ye="basic-usage",Me=[{id:ye,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Me.find(t=>t.id===ye)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Me.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Me){if(e.id===ye)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function Bt(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function Vt(t,e,l){if(l){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function zt(t){const e=H.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,x=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==x?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",x),e[0]=x,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(je,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let p;e[5]!==l.title?(p=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=p):p=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==p?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,p]}),e[7]=h,e[8]=a,e[9]=p,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==l.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(ve,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=l.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let N;return e[17]!==f||e[18]!==o||e[19]!==m?(N=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=N):N=e[20],N}function Yt(t){return t.stopPropagation()}function Ft(t){const e=H.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:r}=t,d=`tool-${l}-${n.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let x;e[2]!==c||e[3]!==n.name?(x=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:n.name})}),e[2]=c,e[3]=n.name,e[4]=x):x=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==x||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,f]}),e[7]=x,e[8]=f,e[9]=a):a=e[9];const p=`tool-${l}-${n.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==p?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ve,{id:p,checked:i,onCheckedChange:r,onClick:$t})}),e[10]=i,e[11]=r,e[12]=p,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function $t(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const[i,r]=F.useState(""),d=n!==void 0?n:i,h=F.useDeferredValue(d),[c,x]=F.useState("all"),[f,a]=F.useState(!1),p=F.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,_=h.trim(),E=_?{operator:"or",conditions:[{field:["title"],operator:"contains",value:_},{field:["description"],operator:"contains",value:_}]}:void 0,S=!!l,C={...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:I,fetchNextPage:R,hasNextPage:g,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:T=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...E&&{where:E},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:T,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,D)=>{if(T?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),b=I?.pages.flatMap(T=>T?.items??[])??[],j=Ct(R,g??!1,O),u=l?b.filter(T=>T.connection_type!=="VIRTUAL"?!0:ct(T.connection_url)!==l):b,M=p.current,A=[...M.values()].map(T=>u.find(D=>D.id===T)).filter(T=>T!==void 0),k=u.filter(T=>!M.has(T.id)),G=[...A,...k],U=T=>{const D=t[T];return D!==void 0&&D.length>0},B=G.filter(T=>{if(c==="all")return!0;const D=U(T.id);return c==="selected"?D:c==="unselected"?!D:!0}),[w,z]=F.useState(G[0]?.id??null),y=w?G.find(T=>T.id===w)??null:null,{data:L,isFetching:Y}=Ce({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",w??""),queryFn:async()=>w?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:w}})).structuredContent?.item??null:null,enabled:!!w,staleTime:3e4}),$=L?.tools??[],J=(T,D)=>t[T]?.includes(D)??!1,X=(T,D)=>{const Q=t[T]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[T]:W[T]=Z}else W[T]=[...Q,D];e(W)},ne=T=>{const D=T===w?$:[];if(!D.length)return;const Q=t[T]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[T]:(Z[T]=q,z(T)),e(Z)},oe=T=>{z(T),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[n===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>x("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>x("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>x("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(T=>{const D=w===T.id,Q=D?$.length:0,q=t[T.id]?.length??0;return s.jsx(zt,{connection:{...T,tools:D?$:T.tools},isSelected:D,hasToolsEnabled:U(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(T.id),onToggle:()=>ne(T.id)},T.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(le,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(je,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:$.map(T=>s.jsx(Ft,{connectionId:y.id,tool:T,isSelected:J(y.id,T.name),onToggle:()=>X(y.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Qt=we({role:we({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:Pe(),staticPermissions:be(se()),toolSet:Le(se(),be(se())),allowAllModels:Pe(),modelSet:Le(se(),be(se())),memberIds:be(se())});function Ve(t,e,l){const n=s.jsx(pe,{checked:t,disabled:e,onCheckedChange:l});return e?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):n}function Ht(t){const e=H.c(28),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let x;e[0]!==h?(x=h.trim().toLowerCase(),e[0]=h,e[1]=x):x=e[1];const f=F.useDeferredValue(x);let a;if(e[2]!==l||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==n){const p=Ut(),o=(v,I)=>{if(!c){if(l&&I){const R=p.flatMap(Jt).flatMap(Zt);i(!1),r(R.filter(g=>!v.tools.includes(g)));return}l||r(Vt(v,n,!I))}};let m;e[10]!==f?(m=v=>{const{section:I,capabilities:R}=v;return{section:I,capabilities:R.filter(g=>!f||g.label.toLowerCase().includes(f)||g.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=p.map(m).filter(qt);let _;e[12]!==l||e[13]!==i||e[14]!==r?(_=()=>{i(!l),r([])},e[12]=l,e[13]=i,e[14]=r,e[15]=_):_=e[15];let E;e[16]!==l||e[17]!==c||e[18]!==_?(E=Ve(l,c,_),e[16]=l,e[17]=c,e[18]=_,e[19]=E):E=e[19];let S;e[20]!==l||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!l),r([])},e[20]=l,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==E||e[26]!==S?(C=s.jsx(ke,{title:"General",children:s.jsx(Ge,{children:s.jsx(Ue,{title:"All organization permissions",description:"Grant full access to all features below",action:E,onClick:S})})}),e[25]=E,e[26]=S,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,N.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):N.map(v=>{const{section:I,capabilities:R}=v;return s.jsx(ke,{title:I,children:s.jsx(Ge,{children:R.map(g=>{const O=Bt(g,n,l);return s.jsx(Ue,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[g.label,g.dangerous&&s.jsx(ut,{size:12,className:"text-warning shrink-0"})]}),description:g.description,action:Ve(O,c,()=>o(g,O)),onClick:c?void 0:()=>o(g,O)},g.id)})})},I)})]})}),e[2]=l,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=n,e[9]=a}else a=e[9];return a}function qt(t){return t.capabilities.length>0}function Zt(t){return t.tools}function Jt(t){return t.capabilities}const ot={anthropic:"Anthropic",openrouter:"OpenRouter"},Xt={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Wt(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function es(t){return Xt[t]??ot[t]??t}function ts(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const it=30;function ss(t){const e=H.c(44),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:x,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:p,readOnly:o,defaultExpanded:m}=t,[N,_]=F.useState(m),E=m||N,S=_,[C,v]=F.useState(it);let I;e[0]!==f||e[1]!==x||e[2]!==c?(I=j=>x||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=x,e[2]=c,e[3]=I):I=e[3];const R=I;let g;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],g=d.filter(j),e[4]=R,e[5]=d,e[6]=g}else g=e[6];const O=g.length;let b;if(e[9]!==h||e[10]!==x||e[11]!==l||e[12]!==O||e[13]!==E||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==p||e[18]!==a||e[19]!==o||e[20]!==n||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let M;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(is),e[24]=M):M=e[24];const A=r??et[n]??tt;let k;e[25]!==i||e[26]!==A?(k=s.jsx(je,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(xe,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let w;e[36]!==E?(w=E?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=E,e[37]=w):w=e[37];let z;e[38]!==w||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,w]}),e[38]=w,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:M,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],b=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,E&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),$=()=>{if(!o){if(x){p(l,h,L.id);return}a(l,L.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:$,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:os,children:o?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:Y,disabled:!0,onCheckedChange:ns})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:Y,onCheckedChange:$})})]},L.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(ls),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=x,e[11]=l,e[12]=O,e[13]=E,e[14]=r,e[15]=R,e[16]=d,e[17]=p,e[18]=a,e[19]=o,e[20]=n,e[21]=i,e[22]=C,e[23]=b}else b=e[23];return b}function ls(t){return t+it}function ns(){}function os(t){return t.stopPropagation()}function is(t){return!t}function rs(t){const e=H.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:x}=t,f=wt(l.id);let a,p,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==x||e[9]!==c||e[10]!==n){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==l.label?(S=A=>({...A,id:A.modelId,provider:l.label}),e[16]=l.label,e[17]=S):S=e[17];const C=f.filter(ms).map(S),v=c.trim().toLowerCase(),I=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(I.length===0){N=null;break e}const R=new Map;for(const A of I){const k=Wt(A.id,l.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ts(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const g=Array.from(R.entries()).map(ds).sort(cs),O=g.length===1||v.length>0;o="flex flex-col gap-3";const b=et[l.providerId]??tt;let j;e[18]!==l.providerId||e[19]!==b?(j=s.jsx("img",{src:b,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=b,e[20]=j):j=e[20];const u=ot[l.providerId]??l.providerId;let M;e[21]!==u?(M=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=M):M=e[22],e[23]!==M||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,M]}),e[23]=M,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",p=g.map(A=>s.jsx(ss,{connectionId:l.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(as),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:x,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=x,e[9]=c,e[10]=n,e[11]=a,e[12]=p,e[13]=o,e[14]=m,e[15]=N}else a=e[11],p=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let _;e[26]!==a||e[27]!==p?(_=s.jsx("div",{className:a,children:p}),e[26]=a,e[27]=p,e[28]=_):_=e[28];let E;return e[29]!==o||e[30]!==m||e[31]!==_?(E=s.jsxs("div",{className:o,children:[m,_]}),e[29]=o,e[30]=m,e[31]=_,e[32]=E):E=e[32],E}function as(t){return t.id}function cs(t,e){return t.name.localeCompare(e.name)}function ds(t){const[e,l]=t;return{id:e,name:es(e),logo:l.logo,models:l.models}}function ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function us(t){const e=H.c(35),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,x=F.useDeferredValue(h),f=Mt();let a;e[0]!==n||e[1]!==r?(a=(g,O)=>{const b=n[g]??[],j={...n};if(b.includes(O)){const u=b.filter(M=>M!==O);u.length===0?delete j[g]:j[g]=u}else j[g]=[...b,O];r(j)},e[0]=n,e[1]=r,e[2]=a):a=e[2];const p=a;let o;e[3]!==n||e[4]!==i||e[5]!==r?(o=(g,O,b)=>{i(!1),r({...n,[g]:O.filter(j=>j!==b)})},e[3]=n,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,N=!c&&"hover:bg-muted/50 cursor-pointer";let _;e[7]!==N?(_=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=_):_=e[8];let E;e[9]!==l||e[10]!==i||e[11]!==r||e[12]!==c?(E=()=>{if(c)return;const g=!l;i(g),g&&r({})},e[9]=l,e[10]=i,e[11]=r,e[12]=c,e[13]=E):E=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=S):S=e[14];let C;e[15]!==l||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:hs,children:c?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(pe,{checked:l,disabled:!0,onCheckedChange:fs})})}),s.jsx(_e,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(pe,{checked:l,onCheckedChange:g=>{i(g),g&&r({})}})}),e[15]=l,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==_||e[21]!==E||e[22]!==C?(v=s.jsxs("div",{className:_,onClick:E,children:[S,C]}),e[20]=_,e[21]=E,e[22]=C,e[23]=v):v=e[23];let I;e[24]!==f||e[25]!==l||e[26]!==x||e[27]!==m||e[28]!==n||e[29]!==c||e[30]!==p?(I=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(g=>s.jsx(F.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(rs,{connection:g,selectedModels:n[g.id]??[],allowAllModels:l,onToggleModel:p,onExitAllowAll:m,allConnectionModelsSelected:(n[g.id]??[]).includes("*"),searchQuery:x,readOnly:c})},g.id)),e[24]=f,e[25]=l,e[26]=x,e[27]=m,e[28]=n,e[29]=c,e[30]=p,e[31]=I):I=e[31];let R;return e[32]!==I||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,I]}),e[32]=I,e[33]=v,e[34]=R):R=e[34],R}function fs(){}function hs(t){return t.stopPropagation()}function xs(t){const e=H.c(52),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=F.useState(""),c=F.useDeferredValue(d);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[f,a]=F.useState(x),{data:p}=st();let o,m,N,_,E,S,C,v,I,R,g;if(e[1]!==p?.data?.members||e[2]!==c||e[3]!==r||e[4]!==n||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==i){const U=p?.data?.members??[];let B;e[20]!==c?(B=y=>{const L=c.toLowerCase();return y.user?.name?.toLowerCase().includes(L)||y.user?.email?.toLowerCase().includes(L)},e[20]=c,e[21]=B):B=e[21];const w=U.filter(B);let z;e[22]!==r||e[23]!==n||e[24]!==f?(z=()=>{r(f),a([]),n(!1)},e[22]=r,e[23]=n,e[24]=f,e[25]=z):z=e[25],N=z,m=Ke,R=l,g=n,o=Qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(qe,{children:"Add Members to Role"}),s.jsx(Ze,{children:"Select members to add to this role."})]}),e[26]=I):I=e[26],S="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Oe,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],_="flex-1 overflow-auto",E=w.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:w.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),$=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!L||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ve,{checked:$||Y,onCheckedChange:()=>{!L||Y||a(J=>J.includes(y.id)?J.filter(X=>X!==y.id):[...J,y.id])},disabled:!L||Y}),s.jsx(nt,{url:y.user?.image??void 0,fallback:lt(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!L&&s.jsx(xe,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(xe,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=p?.data?.members,e[2]=c,e[3]=r,e[4]=n,e[5]=l,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=_,e[13]=E,e[14]=S,e[15]=C,e[16]=v,e[17]=I,e[18]=R,e[19]=g}else o=e[9],m=e[10],N=e[11],_=e[12],E=e[13],S=e[14],C=e[15],v=e[16],I=e[17],R=e[18],g=e[19];let O;e[29]!==_||e[30]!==E?(O=s.jsx("div",{className:_,children:E}),e[29]=_,e[30]=E,e[31]=O):O=e[31];let b;e[32]!==O||e[33]!==S||e[34]!==C?(b=s.jsxs("div",{className:S,children:[C,O]}),e[32]=O,e[33]=S,e[34]=C,e[35]=b):b=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Je,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,M=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==M?(A=s.jsxs(Xe,{className:"px-6 pb-6",children:[j,s.jsxs(We,{onClick:N,disabled:u,children:["Add ",M]})]}),e[37]=N,e[38]=u,e[39]=M,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==b||e[43]!==A||e[44]!==v||e[45]!==I?(k=s.jsxs(o,{className:v,children:[I,b,A]}),e[41]=o,e[42]=b,e[43]=A,e[44]=v,e[45]=I,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==g?(G=s.jsx(m,{open:R,onOpenChange:g,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=g,e[51]=G):G=e[51],G}function ps(t){const e=H.c(29),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,x=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=F.useDeferredValue(d),{data:p}=st();let o,m,N;if(e[0]!==p?.data?.members||e[1]!==a||e[2]!==l||e[3]!==n||e[4]!==x||e[5]!==f||e[6]!==d){const v=p?.data?.members??[];let I;e[10]!==l?(I=b=>l.includes(b.id),e[10]=l,e[11]=I):I=e[11];const R=v.filter(I);let g;e[12]!==a?(g=b=>{const j=a.toLowerCase();return b.user?.name?.toLowerCase().includes(j)||b.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=g):g=e[13];const O=R.filter(g);N="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(b=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(nt,{url:b.user?.image??void 0,fallback:lt(b.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:b.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.user?.email})]}),x?s.jsx(ge,{children:s.jsxs(Te,{children:[s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsx(le,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Be,{size:16})})})}),s.jsx(_e,{children:s.jsx("p",{children:f})})]})}):s.jsx(le,{variant:"ghost",size:"sm",onClick:()=>n(l.filter(j=>j!==b.id)),children:s.jsx(Be,{size:16})})]},b.id))}),e[0]=p?.data?.members,e[1]=a,e[2]=l,e[3]=n,e[4]=x,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=N}else o=e[7],m=e[8],N=e[9];let _;e[14]!==o||e[15]!==m?(_=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=_):_=e[16];let E;e[17]!==l||e[18]!==n?(E=v=>n([...l,...v]),e[17]=l,e[18]=n,e[19]=E):E=e[19];let S;e[20]!==h||e[21]!==l||e[22]!==c||e[23]!==E?(S=s.jsx(xs,{open:h,onOpenChange:c,selectedMemberIds:l,onAddMembers:E}),e[20]=h,e[21]=l,e[22]=c,e[23]=E,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==_||e[27]!==S?(C=s.jsxs("div",{className:N,children:[_,S]}),e[25]=N,e[26]=_,e[27]=S,e[28]=C):C=e[28],C}function gs(t){const e=H.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx(F.Suspense,{fallback:l,children:s.jsx(ps,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Ts={owner:[],admin:[],user:[]};function Es(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Ts[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function _s(t,e,l){const n=t.permission||{},i=n.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,p]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const o of l)h[o.id]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p;else{const o=l.find(m=>m.id===a);o&&(h[a]=p.includes("*")?o.tools?.map(m=>m.name)??[]:p)}const c=n.models||[],x=c.length===0||c.includes("*:*"),f={};if(!x)for(const a of c){const p=a.indexOf(":");if(p===-1)continue;const o=a.slice(0,p),m=a.slice(p+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:x,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Is(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===n)?.tools?.map(h=>h.name)??[];l[n]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)n.push(`${i}:${d}`);n.length>0&&(l.models=n)}return l}function bs(t,e,l){return t.kind==="builtin"?Es(t.role,e,void 0):t.kind==="custom"?_s(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ns(t){const e=H.c(6),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,r=n===void 0?"Owner membership cannot be changed":n;if(l){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ee,{asChild:!0,children:s.jsx("div",{children:s.jsxs(le,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Se,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let x;return e[1]!==r?(x=s.jsx(ge,{children:s.jsxs(Te,{children:[c,s.jsx(_e,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=x):x=e[2],x}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(le,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Ss(t){const e=H.c(14),{locator:l}=Ne(),n=Re(),i=yt();let r;e[0]!==l?(r=re.members(l),e[0]=l,e[1]=r):r=e[1];let d;e[2]!==n?(d=()=>n.organization.listMembers(),e[2]=n,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:x}=Ce(h);if(x||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let p;return e[10]!==i||e[11]!==a||e[12]!==t?(p=s.jsx(Cs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=p):p=e[13],p}function Cs({target:t,onBack:e,onSaved:l,members:n,connections:i}){const{locator:r}=Ne(),d=Re(),h=ze(),c=t.kind==="builtin",x=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,p]=F.useState(c?"org":"mcp"),o=dt({resolver:mt(Qt),defaultValues:bs(t,n,i)}),m=o.formState.isValid,N=o.formState.isDirty,_=Ye({mutationFn:async u=>{const M=Is(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const w=n.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!w.includes(L)),y=w.filter(L=>!u.memberIds.includes(L));for(const L of z){const Y=await d.organization.updateMemberRole({memberId:L,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const L of y){const Y=await d.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,w=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:M,...w?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(w?U:B,w?B:void 0),w?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:M});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const w=await d.organization.updateMemberRole({memberId:B,role:[A]});if(w?.error)throw new Error(w.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,M)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!M.role.id&&!M.role.slug,k=M.role.slug==="owner"&&!M.role.id;Ae(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:M.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),l(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),E=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}_.mutate(u)}),S=!x,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...x?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[I,R]=F.useState(""),[g,O]=F.useState(!1),b=u=>{p(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:S&&s.jsxs(s.Fragment,{children:[s.jsx(le,{variant:"outline",size:"sm",onClick:e,disabled:_.isPending,children:"Cancel"}),s.jsx(le,{size:"sm",onClick:E,disabled:_.isPending||!m||!N,children:_.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?$e(t.role,!0):gt(o.watch("role.label")))}),x&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>b(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Oe,{value:I,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(Ns,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!x&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:I}),a==="org"&&s.jsx(Ht,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="models"&&s.jsx(us,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:x,searchQuery:I}),a==="members"&&s.jsx(gs,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:I,addMemberDialogOpen:g,onAddMemberDialogOpenChange:O})]})})]})})}function As(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function Rs(t){const e=H.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==l||e[1]!==n||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:l,children:n}),e[0]=l,e[1]=n,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const Os=[{role:"owner",label:"Owner"},{role:"admin",label:"Admin"},{role:"user",label:"User"}];function js(){const t=H.c(77),[e,l]=F.useState(""),[n,i]=F.useState(null),r=ht();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Ne(),x=Re(),f=ze(),{customRoles:a,refetch:p}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let N;e:{if(!h){N=null;break e}if(h==="new"){N={kind:"new"};break e}if(h.startsWith("builtin-")){N={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);N=V?{kind:"custom",role:V}:null}const _=N;let E;t[5]!==c?(E=re.members(c),t[5]=c,t[6]=E):E=t[6];let S;t[7]!==x?(S=()=>x.organization.listMembers(),t[7]=x,t[8]=S):S=t[8];let C;t[9]!==E||t[10]!==S?(C={queryKey:E,queryFn:S},t[9]=E,t[10]=S,t[11]=C):C=t[11];const{data:v}=Ce(C);let I;t[12]!==v?.data?.members?(I=v?.data?.members??[],t[12]=v?.data?.members,t[13]=I):I=t[13];const R=I;let g;t[14]!==R?(g=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=g):g=t[15];const O=g;let b;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=Os.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const rt=a.map(ae);if(b=[...V,...rt],e){const ce=e.toLowerCase();b=b.filter(at=>at.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=b}else b=t[19];let j;t[24]!==x?(j=async P=>{const V=await x.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=x,t[25]=j):j=t[25];const u=Ye({mutationFn:j,onSuccess:(P,V)=>{Ae("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),p(),_?.kind==="custom"&&_.role.id===V&&m(void 0)},onError:Ds});let M,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Ps,cellClassName:"flex-1 min-w-0",sortable:!0},M={id:"type",header:"Type",render:Ls,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:ws,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Ms,cellClassName:"w-24 shrink-0"},t[26]=M,t[27]=A,t[28]=k,t[29]=G):(M=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,M,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ys,children:s.jsx(bt,{size:16})})}),s.jsx(_t,{align:"end",onClick:vs,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(Nt,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let w;t[31]!==m?(w=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=w):w=t[32];const z=w;if(_){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==p||t[36]!==m?(V=()=>{p(),m(void 0)},t[35]=p,t[36]=m,t[37]=V):V=t[37],s.jsx(Ss,{target:_,onBack:P,onSaved:V},As(_))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=P=>{P.key==="Escape"&&(l(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(Oe,{value:e,onChange:l,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let $;t[42]!==m?($=()=>m("new"),t[42]=m,t[43]=$):$=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Se,{size:16}),t[44]=J):J=t[44];let X;t[45]!==$?(X=s.jsxs(le,{onClick:$,children:[J,"Create Role"]}),t[45]=$,t[46]=X):X=t[46];let ne;t[47]!==Y||t[48]!==X?(ne=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,X]}),t[47]=Y,t[48]=X,t[49]=ne):ne=t[49];let oe;t[50]!==e?(oe=e?s.jsx(De,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(De,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==b||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(St,{columns:B,data:b,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=b,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let T;t[57]!==ne||t[58]!==ie?(T=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,ne,ie]})})}),t[57]=ne,t[58]=ie,t[59]=T):T=t[59];const D=n!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(qe,{children:"Delete Role"}),t[61]=q):q=t[61];const W=n?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[q,s.jsxs(Ze,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Je,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==n?(de=s.jsxs(Xe,{children:[ee,s.jsx(We,{onClick:()=>{n?.id&&u.mutate(n.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=n,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(Qe,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Ke,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let Ie;return t[74]!==T||t[75]!==ue?(Ie=s.jsxs(te,{children:[T,ue]}),t[74]=T,t[75]=ue,t[76]=Ie):Ie=t[76],Ie}function vs(t){return t.stopPropagation()}function ys(t){return t.stopPropagation()}function Ms(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function ws(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,l=[];return e.allowsAllStaticPermissions?l.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&l.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?l.push("All connections"):e.connectionCount&&e.connectionCount>0&&l.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:l.length>0?l.join(", "):"No permissions"})}function Ls(t){return t.kind==="builtin"?s.jsx(xe,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(xe,{variant:"outline",className:"text-xs",children:"Custom"})}function Ps(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",$e(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Fe,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ds(t,e){Ae("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function ks(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ft,{fallback:e,children:s.jsx(F.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(js,{})})}),t[1]=l):l=t[1],l}function _n(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Rs,{area:"roles",children:s.jsx(ks,{})}),t[0]=e):e=t[0],e}export{_n as default};
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,i as j}from"./index-BUWOf6-H.js";import{i as N}from"./SearchMd-DhGVvJ2r.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{c as b,l as w,j as a,i as j}from"./index-DGQdC8j6.js";import{i as N}from"./SearchMd-Di7fRkvt.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{c as p,j as t,E as P,r as j,w,B as S,t as y}from"./index-BUWOf6-H.js";import{i as k}from"./AlertCircle-BVlB73Gd.js";import{s as z}from"./Plus-OGxa0fdn.js";import{s as E}from"./User01-DY8EdPzH.js";import{t as F}from"./Users01-DnUyZ4sc.js";import{e as $,d as I,D as O,a as A,h as R,c as T}from"./dialog-C6_0qLBU.js";import{I as N}from"./input-C2XNQcRH.js";import{L as g}from"./label-CK1XiDPB.js";import{S as B,a as V,b as L,c as q,d as C}from"./select-BVg_AKhS.js";import{S as H}from"./skeleton-JjNP43lD.js";import{T as K}from"./textarea-C-upgcvq.js";import{P as b}from"./index-BdUl5bJN.js";import{c as W}from"./settings-section-Cd7MHbmE.js";import{u as Y,a as G}from"./use-secrets-DDzz0qxd.js";import{R as J}from"./require-capability-qkGmH7NG.js";import"./X-8dZUy9dd.js";import"./tooltip-cXMPTvhQ.js";import"./Check-ylcp47jh.js";import"./ChevronDown-DorDM-K-.js";import"./ChevronUp-C85SxyPM.js";import"./sidebar-Bg21lFNS.js";import"./LayoutLeft-DP-M8mno.js";import"./use-mobile-oSorlQMv.js";import"./card-DmJEBNvh.js";import"./ArrowUpRight-COlnzfbE.js";import"./studio-tools-JGMjsS9V.js";import"./use-capability-BI2Ao-_m.js";import"./access-gate-BjqlcKiO.js";import"./capability-load-error-u8-vFMPG.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};
1
+ import{c as p,j as t,E as P,r as j,w,B as S,t as y}from"./index-DGQdC8j6.js";import{i as k}from"./AlertCircle-DBEuJvXd.js";import{s as z}from"./Plus-D8fSfWhL.js";import{s as E}from"./User01-joygJQdk.js";import{t as F}from"./Users01-BVTwFHJb.js";import{e as $,d as I,D as O,a as A,h as R,c as T}from"./dialog-hBUfi5DB.js";import{I as N}from"./input-DwWe5Hqk.js";import{L as g}from"./label-DdsuSm6M.js";import{S as B,a as V,b as L,c as q,d as C}from"./select-vVirKMnE.js";import{S as H}from"./skeleton-CB7DUvyX.js";import{T as K}from"./textarea-BH3kgWLk.js";import{P as b}from"./index-qg-bT8JA.js";import{c as W}from"./settings-section-CvpT3RW4.js";import{u as Y,a as G}from"./use-secrets-j8nq_pg4.js";import{R as J}from"./require-capability--U_vi60H.js";import"./X-Bs0u_0yh.js";import"./tooltip-CO1zVhUs.js";import"./Check-Oxo5mPeL.js";import"./ChevronDown-DCZlSvzQ.js";import"./ChevronUp-BXrO8J56.js";import"./sidebar-C_llE2r0.js";import"./LayoutLeft-DPtsS7J4.js";import"./use-mobile-DVuyUrh-.js";import"./card-whir3-TU.js";import"./ArrowUpRight-3xkp-kWm.js";import"./studio-tools-DII0jqi8.js";import"./use-capability-CEIYeJxR.js";import"./access-gate-B4pZWmwl.js";import"./capability-load-error-CVQ-0IvS.js";function M(s){const e=p.c(3),{error:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(k,{size:16}),e[0]=c):c=e[0];let n;return e[1]!==r.message?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load secrets: ",r.message]})]}),e[1]=r.message,e[2]=n):n=e[2],n}function Q(s){const e=p.c(5),{scope:r}=s,c=r==="user"?E:F,n=r==="user"?"Private":"Organization";let i;e[0]!==c?(i=t.jsx(c,{size:12}),e[0]=c,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[i,n]}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function D(s){const e=p.c(20),{secret:r}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(w,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==r.name?(n=t.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=n):n=e[2];let i;e[3]!==r.scope?(i=t.jsx(Q,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let a;e[5]!==n||e[6]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2",children:[n,i]}),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]!==r.description?(d=r.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=d):d=e[9];let u;e[10]!==a||e[11]!==d?(u=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[c,t.jsxs("div",{className:"min-w-0",children:[a,d]})]}),e[10]=a,e[11]=d,e[12]=u):u=e[12];let l;e[13]!==r.createdAt?(l=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=l):l=e[14];let o;e[15]!==l?(o=t.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:l}),e[15]=l,e[16]=o):o=e[16];let x;return e[17]!==u||e[18]!==o?(x=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[u,o]}),e[17]=u,e[18]=o,e[19]=x):x=e[19],x}function U(s){const e=p.c(5),{onCreate:r}=s;let c,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(w,{size:20,className:"text-muted-foreground"})}),n=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No secrets yet"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Store API keys, tokens, and other sensitive values. Values are encrypted at rest and never returned over the API."})]}),e[0]=c,e[1]=n):(c=e[0],n=e[1]);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(z,{size:14}),e[2]=i):i=e[2];let a;return e[3]!==r?(a=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,t.jsxs(S,{onClick:r,size:"sm",className:"mt-2",children:[i,"New secret"]})]}),e[3]=r,e[4]=a):a=e[4],a}function _({open:s,onOpenChange:e}){const[r,c]=j.useState("organization"),[n,i]=j.useState(""),[a,d]=j.useState(""),[u,l]=j.useState(""),o=G();function x(){c("organization"),i(""),d(""),l("")}function f(){x(),e(!1)}async function h(m){if(m.preventDefault(),!(!n.trim()||!a))try{await o.mutateAsync({scope:r,name:n.trim(),value:a,description:u.trim()||void 0}),y.success(`Secret "${n.trim()}" created`),f()}catch(v){y.error(v instanceof Error?v.message:"Failed to create secret")}}return t.jsx($,{open:s,onOpenChange:m=>{m?e(m):f()},children:t.jsxs(I,{className:"sm:max-w-lg",children:[t.jsxs(O,{children:[t.jsx(A,{children:"New secret"}),t.jsx(R,{children:"Stored encrypted in the credential vault. Choose who can read it."})]}),t.jsxs("form",{onSubmit:h,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-scope",children:"Scope"}),t.jsxs(B,{value:r,onValueChange:m=>c(m),children:[t.jsx(V,{id:"secret-scope",children:t.jsx(L,{})}),t.jsxs(q,{children:[t.jsx(C,{value:"organization",children:"Organization — visible to all members"}),t.jsx(C,{value:"user",children:"Private — only visible to me"})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-name",children:"Name"}),t.jsx(N,{id:"secret-name",value:n,onChange:m=>i(m.target.value),placeholder:"STRIPE_API_KEY",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Case-insensitive within its scope."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-value",children:"Value"}),t.jsx(N,{id:"secret-value",type:"password",value:a,onChange:m=>d(m.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(g,{htmlFor:"secret-description",children:"Description (optional)"}),t.jsx(K,{id:"secret-description",value:u,onChange:m=>l(m.target.value),rows:2,placeholder:"What is this secret used for?"})]}),t.jsxs(T,{children:[t.jsx(S,{type:"button",variant:"outline",onClick:f,disabled:o.isPending,children:"Cancel"}),t.jsx(S,{type:"submit",disabled:o.isPending||!n.trim()||!a,children:o.isPending?"Creating…":"Create secret"})]})]})]})})}function X(){const s=p.c(21),e=Y(),[r,c]=j.useState(!1);if(e.length===0){let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(U,{onCreate:()=>c(!0)}),s[0]=l):l=s[0];let o;return s[1]!==r?(o=t.jsxs(t.Fragment,{children:[l,t.jsx(_,{open:r,onOpenChange:c})]}),s[1]=r,s[2]=o):o=s[2],o}let n,i,a;if(s[3]!==e){const l=e.filter(se),o=e.filter(te),x=e.length===1?"":"s";let f;s[7]!==e.length||s[8]!==x?(f=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," secret",x," stored"]}),s[7]=e.length,s[8]=x,s[9]=f):f=s[9];let h;s[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>c(!0),s[10]=h):h=s[10];let m;s[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs(S,{onClick:h,size:"sm",children:[t.jsx(z,{size:14}),"New secret"]}),s[11]=m):m=s[11],s[12]!==f?(n=t.jsxs("div",{className:"flex items-center justify-between",children:[f,m]}),s[12]=f,s[13]=n):n=s[13],i=l.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Organization"}),t.jsx("div",{children:l.map(ee)})]}):null,a=o.length>0?t.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[t.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Private to me"}),t.jsx("div",{children:o.map(Z)})]}):null,s[3]=e,s[4]=n,s[5]=i,s[6]=a}else n=s[4],i=s[5],a=s[6];let d;s[14]!==r?(d=t.jsx(_,{open:r,onOpenChange:c}),s[14]=r,s[15]=d):d=s[15];let u;return s[16]!==n||s[17]!==i||s[18]!==a||s[19]!==d?(u=t.jsxs(t.Fragment,{children:[n,i,a,d]}),s[16]=n,s[17]=i,s[18]=a,s[19]=d,s[20]=u):u=s[20],u}function Z(s){return t.jsx(D,{secret:s},s.id)}function ee(s){return t.jsx(D,{secret:s},s.id)}function te(s){return s.scope==="user"}function se(s){return s.scope==="organization"}function re(){const s=p.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(b.Title,{children:"Secrets"}),s[0]=e):e=s[0];let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(b,{children:t.jsx(b.Content,{children:t.jsx(b.Body,{children:t.jsxs(W,{children:[e,t.jsx(P,{fallback:ne,children:t.jsx(j.Suspense,{fallback:t.jsx(H,{className:"h-32 w-full"}),children:t.jsx(X,{})})})]})})})}),s[1]=r):r=s[1],r}function ne(s){const{error:e}=s;return t.jsx(M,{error:e??new Error("Failed to load secrets")})}function Ie(){const s=p.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(J,{capability:"secrets:manage",area:"secrets",children:t.jsx(re,{})}),s[0]=e):e=s[0],e}export{Ie as default};