decocms 3.89.1 → 3.89.3

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 (245) hide show
  1. package/dist/client/assets/{AlertCircle-ChcBH14n.js → AlertCircle-NC3dB7os.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BfxsIWO1.js → ArrowUpRight-D9dn8W9B.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-Cm1GnmVj.js → CheckCircle-4xU28_ze.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-aoqAeXtt.js → ChevronDown-4vfFBrpS.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-CoW1IpXE.js → ChevronLeft-CCAFk4Lh.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-CUGhm8E7.js → ChevronRight-BSaK-g_n.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BDbnz61t.js → ChevronUp-CIoJSXpm.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BcvtEj5g.js → DotsVertical-DXhOiROl.js} +1 -1
  9. package/dist/client/assets/{Eye-BhqO9K0O.js → Eye-BcF7vo02.js} +1 -1
  10. package/dist/client/assets/{FilterLines-DTI31VpW.js → FilterLines-CyP0eiMt.js} +1 -1
  11. package/dist/client/assets/{Form-gFXvv2WG.js → Form-DLIz5vwr.js} +1 -1
  12. package/dist/client/assets/{Globe01-CTIuSSD9.js → Globe01-cpwm3ZU4.js} +1 -1
  13. package/dist/client/assets/{Globe04-Dy3PA2Yl.js → Globe04-DdU789Mf.js} +1 -1
  14. package/dist/client/assets/{HardDrive-DYVC-Zaq.js → HardDrive-8lyy5Dp-.js} +1 -1
  15. package/dist/client/assets/{Key01-bDEyn58I.js → Key01-C3jXuyTV.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DjTexk5_.js → LayoutLeft-BA3GeXV2.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-COQYOgEI.js → LinkExternal01-Dc9R-z7y.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DV9tmVAF.js → Monitor01-4eRzNp1q.js} +1 -1
  19. package/dist/client/assets/{Palette-CD1fLCtB.js → Palette-DziwArEq.js} +1 -1
  20. package/dist/client/assets/{Play-Dl0pf4M6.js → Play-BTFQj3qh.js} +1 -1
  21. package/dist/client/assets/{Plus-BEdvqzrP.js → Plus-pFzKRSyH.js} +1 -1
  22. package/dist/client/assets/{SearchMd-DK3hZUVF.js → SearchMd-BiaNZC1b.js} +1 -1
  23. package/dist/client/assets/{Settings02-BIpY6Zhb.js → Settings02-Bvzlcm1U.js} +1 -1
  24. package/dist/client/assets/{Shield01-Dx8gqKG5.js → Shield01-CtXmxEJK.js} +1 -1
  25. package/dist/client/assets/{Star01-HcsxMzHs.js → Star01-B2kdQndt.js} +1 -1
  26. package/dist/client/assets/{Stars01-VD9js_iZ.js → Stars01-C_5LYi93.js} +1 -1
  27. package/dist/client/assets/{Stars02-C-addu2P.js → Stars02-i3gYlhXk.js} +1 -1
  28. package/dist/client/assets/{Sun-B11PPq5-.js → Sun-CoqE3qoL.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-EOva-Jpw.js → SwitchHorizontal01-CPEaTyhx.js} +1 -1
  30. package/dist/client/assets/{Tool01-DcPFccxt.js → Tool01-BmUpgiVH.js} +1 -1
  31. package/dist/client/assets/{Trash01-BfKdeD7S.js → Trash01-B2-9vQgJ.js} +1 -1
  32. package/dist/client/assets/{Upload01-T8pN8jBP.js → Upload01-FAxCvObz.js} +1 -1
  33. package/dist/client/assets/{User01-DxWsEbM9.js → User01-C1HCSK6y.js} +1 -1
  34. package/dist/client/assets/{Users01-C7ItyIdk.js → Users01-D0cghbTw.js} +1 -1
  35. package/dist/client/assets/{Users03-NRaUurHt.js → Users03-vYWz866I.js} +1 -1
  36. package/dist/client/assets/{X-Ciyf96Wa.js → X-DVenJxl2.js} +1 -1
  37. package/dist/client/assets/{XCircle-ovYWqZM6.js → XCircle-DkV5O0gt.js} +1 -1
  38. package/dist/client/assets/{XClose-m9X1QqKX.js → XClose-1aztqZN5.js} +1 -1
  39. package/dist/client/assets/{Zap-Bci_Afjv.js → Zap-CxBpS0TW.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-BlfnVn5C.js → ZapSquare-BupPfcYG.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-C-l0YUGT.js → ZoomOut-DXDDUqzg.js} +1 -1
  42. package/dist/client/assets/{access-gate-DelGJZFm.js → access-gate-DJ3w7Rqa.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-DK89xL9T.js → add-section-modal-B_FGzKHG.js} +1 -1
  44. package/dist/client/assets/{agent-icon-Bk1Ofbdo.js → agent-icon-B9Rg96af.js} +1 -1
  45. package/dist/client/assets/agents-list-BpBQ33-8.js +1 -0
  46. package/dist/client/assets/ai-providers-Cr1HJb4g.js +1 -0
  47. package/dist/client/assets/{alert-0234XVcw.js → alert-DBActzOw.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-CKnoCFTw.js → alert-dialog-TZS2F66y.js} +1 -1
  49. package/dist/client/assets/app-editor-Cu5Jn0bp.js +1 -0
  50. package/dist/client/assets/{auth-Ci2ZRRcb.js → auth-B2SyT5jq.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-pBRRm1M1.js → auth-catchall-jfA3V8jK.js} +1 -1
  52. package/dist/client/assets/{auth-entry-C10wiLq4.js → auth-entry-CzM_DcXD.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-DQUsM8Ag.js → auth-split-layout-D8jZEv56.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-CjSCavkQ.js → authenticate-and-persist-oauth-ugENWEdg.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-Cuo6QaWy.js → automation-list-row-RaQMgsZa.js} +1 -1
  56. package/dist/client/assets/{automation-runs-BNON3nJA.js → automation-runs-DEnZLNcv.js} +1 -1
  57. package/dist/client/assets/automations-LxVvDRSf.js +1 -0
  58. package/dist/client/assets/{avatar-BLEdyY7-.js → avatar-Cz89OzST.js} +1 -1
  59. package/dist/client/assets/{badge-C9MXVg0W.js → badge-DemqTgjN.js} +1 -1
  60. package/dist/client/assets/{block-document-BPNTiqTb.js → block-document-DnpmRre2.js} +1 -1
  61. package/dist/client/assets/brand-context-44FYoRF-.js +1 -0
  62. package/dist/client/assets/buckets-pliF9NOx.js +1 -0
  63. package/dist/client/assets/{capability-load-error-sRyEFexC.js → capability-load-error-CD0k_ZBV.js} +1 -1
  64. package/dist/client/assets/{card-mAs4nLtf.js → card-DWocPikY.js} +1 -1
  65. package/dist/client/assets/category-editor-BElGS0p5.js +1 -0
  66. package/dist/client/assets/{chat-context-BdyPsWKn.js → chat-context-bLbsqSUE.js} +1 -1
  67. package/dist/client/assets/{checkbox-B9vj-Cdf.js → checkbox-DmyBqpG7.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DUamUZxb.js → cli-auth-success-g1RYvQjB.js} +1 -1
  69. package/dist/client/assets/collection-detail-BfoXrAWD.js +1 -0
  70. package/dist/client/assets/{collection-display-button-j1yy59k2.js → collection-display-button-CmYy5ol1.js} +1 -1
  71. package/dist/client/assets/{collection-search-C1sxKyva.js → collection-search-JyQFyghK.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-Csv5ENUX.js → collection-tabs-LMEfLwWZ.js} +1 -1
  73. package/dist/client/assets/command-6Xv18lx6.js +1 -0
  74. package/dist/client/assets/commerce-onboarding-COle5u-q.js +1 -0
  75. package/dist/client/assets/connect-desktop-dialog-dXosml16.js +1 -0
  76. package/dist/client/assets/{connection-card-gZqWtnUr.js → connection-card-DoMs787B.js} +1 -1
  77. package/dist/client/assets/connection-detail-Cy4adAl6.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-4cMYvdoC.js → connection-form-helpers-Dm__G9wh.js} +1 -1
  79. package/dist/client/assets/connections-x7QDuFJK.js +1 -0
  80. package/dist/client/assets/{context-menu-BiiNCW4n.js → context-menu-B93bMgay.js} +1 -1
  81. package/dist/client/assets/{decopilot-CW6d29Nv.js → decopilot-4k7KQSVX.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DhvSomLP.js → decopilot-sse-pool-BEKDdVOU.js} +1 -1
  83. package/dist/client/assets/{dialog-DtA5oh9D.js → dialog-BbHIKIUS.js} +1 -1
  84. package/dist/client/assets/{domain-settings-m1b0eyH2.js → domain-settings-PpBMgUMH.js} +1 -1
  85. package/dist/client/assets/{drawer-zXrFQNCR.js → drawer-kr03m1vm.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-DBXGBAAP.js → dropdown-menu-vGHmo9fD.js} +1 -1
  87. package/dist/client/assets/{empty-state-YJ1DU6Lk.js → empty-state-B4c8fq4i.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-DlaPzbl9.js → extract-connection-data-D9jcQvie.js} +1 -1
  89. package/dist/client/assets/file-explorer-BujxJOsE.js +2 -0
  90. package/dist/client/assets/{file-type-icon-3wYgaJ1f.js → file-type-icon-DO4mmgEl.js} +1 -1
  91. package/dist/client/assets/{files-DaCiXODL.js → files-DSkQRfS7.js} +1 -1
  92. package/dist/client/assets/{form-BPgAGzjC.js → form-BtzyQGYU.js} +1 -1
  93. package/dist/client/assets/general-BjDrCY53.js +1 -0
  94. package/dist/client/assets/{github-repo-picker-hOzqpBMc.js → github-repo-picker-BR4lmXmU.js} +1 -1
  95. package/dist/client/assets/{hooks-BdXI0ZZ7.js → hooks-DlrZPw8A.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-Sr2m6cI7.js → import-from-deco-dialog-DCkFh2H5.js} +1 -1
  97. package/dist/client/assets/{index-20lo5teZ.js → index-B37Lpv5S.js} +3 -3
  98. package/dist/client/assets/{index-BaiqhWaL.js → index-B7G40tVP.js} +1 -1
  99. package/dist/client/assets/{index-wuE_wZDF.js → index-BHKcN4cC.js} +1 -1
  100. package/dist/client/assets/{index-DsiMEgqD.js → index-BbMa6I-9.js} +2 -2
  101. package/dist/client/assets/{index-DXt_QCNf.js → index-BqVMogvA.js} +2 -2
  102. package/dist/client/assets/{index-CK4mkEbA.js → index-CAIYCRJp.js} +1 -1
  103. package/dist/client/assets/index-CxLZ7FWT.js +1 -0
  104. package/dist/client/assets/index-DGekSTiC.js +1 -0
  105. package/dist/client/assets/{index-DHpZNTCL.js → index-DasNl4Yd.js} +1 -1
  106. package/dist/client/assets/{index-BN5oIbn0.js → index-DeXSnTz7.js} +2 -2
  107. package/dist/client/assets/{index-BBUDuLgB.js → index-JuJHr8Il.js} +1 -1
  108. package/dist/client/assets/{index-BoBbtnrJ.js → index-ZjRHn464.js} +1 -1
  109. package/dist/client/assets/index-hl6kLhIe.js +1 -0
  110. package/dist/client/assets/{index-redirect-CsfNxHhm.js → index-redirect-c7PIBlRk.js} +1 -1
  111. package/dist/client/assets/{index-CDpdJTKU.js → index-yU2r0Gdy.js} +12 -12
  112. package/dist/client/assets/{input-D2VJ6ahm.js → input-D3OR9wlV.js} +1 -1
  113. package/dist/client/assets/{integration-icon-62cL4F-8.js → integration-icon-DtONHt_d.js} +1 -1
  114. package/dist/client/assets/{label-Xkc4XdLq.js → label-C3oLcOn0.js} +1 -1
  115. package/dist/client/assets/{login-CLUghQw8.js → login-DjI0bYya.js} +1 -1
  116. package/dist/client/assets/{mcp-oauth-CsZ919dh.js → mcp-oauth-B7tRsqo-.js} +1 -1
  117. package/dist/client/assets/{members-CB0UM83l.js → members-DIxpLBtJ.js} +2 -2
  118. package/dist/client/assets/{monaco-editor-C0cKgOd8.js → monaco-editor-CI1Pa0QN.js} +1 -1
  119. package/dist/client/assets/{monitoring-stats-row-COpSRcY-.js → monitoring-stats-row-BcIi6QZu.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-Bq9PHCzO.js → oauth-callback-Dgp5DdjP.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-B4wHrtoi.js → oauth-callback-ai-provider-DPhQ8sI3.js} +1 -1
  122. package/dist/client/assets/{onboarding-ChNzFBz9.js → onboarding-DtsS5lUr.js} +1 -1
  123. package/dist/client/assets/{org-install-D3HGVhMw.js → org-install-7RmPSbO9.js} +1 -1
  124. package/dist/client/assets/{org-layout-CKL4gUDt.js → org-layout--gQCQGBA.js} +1 -1
  125. package/dist/client/assets/{organization-choice-CmMr-EN1.js → organization-choice-A8WzCg8t.js} +1 -1
  126. package/dist/client/assets/{page-seo-form-tt8IzB9t.js → page-seo-form-rxuP--YT.js} +1 -1
  127. package/dist/client/assets/page-seo-sheet-vEubWUB4.js +1 -0
  128. package/dist/client/assets/{popover-CHlLC07g.js → popover-voqJlCLR.js} +1 -1
  129. package/dist/client/assets/post-editor-CukRi04m.js +1 -0
  130. package/dist/client/assets/{preview-dialog-pnlDSJ8-.js → preview-dialog-DC1NsLKi.js} +1 -1
  131. package/dist/client/assets/{primitives-CDMj0aGG.js → primitives-DLRj8yUL.js} +1 -1
  132. package/dist/client/assets/profile-Cuy0XRiQ.js +1 -0
  133. package/dist/client/assets/project-app-view-DCl-CWYr.js +1 -0
  134. package/dist/client/assets/record-editor-DOI2gIfd.js +1 -0
  135. package/dist/client/assets/registry-EBdkezYg.js +2 -0
  136. package/dist/client/assets/{registry-layout-BdK58T7U.js → registry-layout-Bsm16ESy.js} +2 -2
  137. package/dist/client/assets/{require-capability-BMiu3VbE.js → require-capability-WHfqcRqc.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-hnMHneNT.js → required-auth-layout-CcH9lzeU.js} +1 -1
  139. package/dist/client/assets/{reset-password-DTJmY0M7.js → reset-password-o6QeBSLY.js} +1 -1
  140. package/dist/client/assets/roles-D_-_h1c8.js +1 -0
  141. package/dist/client/assets/{save-status-D-Y-u7Wx.js → save-status-D4ISIXoj.js} +1 -1
  142. package/dist/client/assets/{scroll-area-BlJNYaPT.js → scroll-area-CLfWXW0D.js} +1 -1
  143. package/dist/client/assets/{search-input-DucmHYf0.js → search-input-DPBtlWUD.js} +1 -1
  144. package/dist/client/assets/secrets-cvbnrgVx.js +1 -0
  145. package/dist/client/assets/{sections-editor-jzkZQ3Ec.js → sections-editor-DdPJUwmv.js} +2 -2
  146. package/dist/client/assets/{select-C0AEr1SL.js → select-Dm5gSFeK.js} +1 -1
  147. package/dist/client/assets/select-model-DdKq7y8l.js +1 -0
  148. package/dist/client/assets/seo-editor-D12GD7FT.js +1 -0
  149. package/dist/client/assets/settings-layout-Bf0CD3Ha.js +1 -0
  150. package/dist/client/assets/{settings-section-CP7jibDA.js → settings-section-BOPxWg6D.js} +1 -1
  151. package/dist/client/assets/{sheet-BBGbheOC.js → sheet-BCI6wljB.js} +1 -1
  152. package/dist/client/assets/{shell-controls-BPsjYlm1.js → shell-controls-CUcC0uoE.js} +1 -1
  153. package/dist/client/assets/{shell-layout-xhRX4rsB.js → shell-layout-BpdvdxRY.js} +1 -1
  154. package/dist/client/assets/{shell-route-loading-C4SUOonb.js → shell-route-loading-CrU5yzKP.js} +1 -1
  155. package/dist/client/assets/sidebar-DLjbCYfe.js +1 -0
  156. package/dist/client/assets/{skeleton-CVRpN7O3.js → skeleton-vuq3rnUi.js} +1 -1
  157. package/dist/client/assets/{sortable.esm-DMoaSsem.js → sortable.esm-aG8KzwUt.js} +2 -2
  158. package/dist/client/assets/sso-V1O3oG0I.js +1 -0
  159. package/dist/client/assets/store-ChzWT5-N.js +1 -0
  160. package/dist/client/assets/store-registry-DwmY0RAT.js +2 -0
  161. package/dist/client/assets/{studio-tools-DqPhjgPW.js → studio-tools-QGvUs6qu.js} +1 -1
  162. package/dist/client/assets/{switch-BOUA2FBT.js → switch-BwnzJhUB.js} +1 -1
  163. package/dist/client/assets/{table-hboPJhBa.js → table-DyiI6lY1.js} +1 -1
  164. package/dist/client/assets/{tabs-BqGLbeO9.js → tabs-2cKRgONn.js} +1 -1
  165. package/dist/client/assets/{task-status-DbMlzbTm.js → task-status-1cY6Pf8x.js} +1 -1
  166. package/dist/client/assets/{textarea-BqMqcZIm.js → textarea-DqRxFP0T.js} +1 -1
  167. package/dist/client/assets/{toggle-group-Db5bABta.js → toggle-group-CvE2Rn7y.js} +1 -1
  168. package/dist/client/assets/{toolbar-DDUCJSbz.js → toolbar-Dsvneu3f.js} +1 -1
  169. package/dist/client/assets/{tools-list-DkXVWS7e.js → tools-list-Dk1OdhLO.js} +1 -1
  170. package/dist/client/assets/tooltip-Bjh8CXdQ.js +1 -0
  171. package/dist/client/assets/{types-Cms0eXYe.js → types-CXT3eJPp.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-BFPg4Nao.js → use-ai-providers-Cm6bJu4O.js} +1 -1
  173. package/dist/client/assets/{use-automations-C_LX8Dvr.js → use-automations-hkjYbjXY.js} +1 -1
  174. package/dist/client/assets/{use-capability-C1-FHW22.js → use-capability-qIjsd8HD.js} +1 -1
  175. package/dist/client/assets/{use-clock-tick-DvWNr9a0.js → use-clock-tick-Doyl2hlk.js} +1 -1
  176. package/dist/client/assets/{use-collections-74mCujh3.js → use-collections-OMXnywUO.js} +1 -1
  177. package/dist/client/assets/{use-connection-D-7QpVUJ.js → use-connection-CQmB3ngS.js} +1 -1
  178. package/dist/client/assets/{use-copy-D6L-AQL_.js → use-copy-CjrJL2o4.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-kRix1VSu.js → use-create-virtual-mcp-BbhHiNda.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-B3nrE_1Y.js → use-debounced-autosave-BStxRiyA.js} +1 -1
  181. package/dist/client/assets/{use-delete-connection-VpHPQbnh.js → use-delete-connection-CcoavCzH.js} +1 -1
  182. package/dist/client/assets/{use-file-configs-DNAtFvn4.js → use-file-configs-DwaAJaA6.js} +1 -1
  183. package/dist/client/assets/{use-infinite-scroll-hOEUoZD8.js → use-infinite-scroll-BLyYnILN.js} +1 -1
  184. package/dist/client/assets/{use-join-requests-BvPzSuPP.js → use-join-requests-DzaX5jxt.js} +1 -1
  185. package/dist/client/assets/{use-mcp-client-CxXf5rsq.js → use-mcp-client-CX47WlCL.js} +1 -1
  186. package/dist/client/assets/{use-mcp-prompts-CqbI2uxQ.js → use-mcp-prompts-CbrvbR3P.js} +1 -1
  187. package/dist/client/assets/{use-mcp-tools-CLWDDSx5.js → use-mcp-tools-C37oT0bu.js} +1 -1
  188. package/dist/client/assets/{use-members-Cd4dRzb0.js → use-members-CtUanB1S.js} +1 -1
  189. package/dist/client/assets/use-mobile-BsQGJSz8.js +1 -0
  190. package/dist/client/assets/{use-navigate-to-agent-D8CoEyF3.js → use-navigate-to-agent-C_B7rQZ3.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-CSAS1fgX.js → use-org-auth-client-BWt-3T2p.js} +1 -1
  192. package/dist/client/assets/{use-org-sso-D9H6UI9E.js → use-org-sso-DKfKkOYy.js} +1 -1
  193. package/dist/client/assets/{use-organization-roles-rL51pKiY.js → use-organization-roles-LSjQh-hO.js} +1 -1
  194. package/dist/client/assets/{use-organization-settings-CTH2EptF.js → use-organization-settings-Cw-0oyZX.js} +1 -1
  195. package/dist/client/assets/{use-registry-connections-jcbA10JV.js → use-registry-connections-sALt7ACC.js} +1 -1
  196. package/dist/client/assets/{use-secrets-CfUCGkTu.js → use-secrets-DyPgSICV.js} +1 -1
  197. package/dist/client/assets/{use-status-sounds-CfsHQQ72.js → use-status-sounds-YKEkF-4T.js} +1 -1
  198. package/dist/client/assets/use-view-mode-BMTZD0uv.js +1 -0
  199. package/dist/client/assets/{use-virtual-mcp-CwSMwdwq.js → use-virtual-mcp-ByWPjIzd.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-V0rLmF2w.js +1 -0
  201. package/dist/client/assets/{useQueries-BdyCFKnV.js → useQueries-Do45fFi7.js} +1 -1
  202. package/dist/client/assets/useSuspenseInfiniteQuery-Zpghw-jA.js +1 -0
  203. package/dist/client/assets/variant-calendar-bDr2uwc7.js +1 -0
  204. package/dist/client/assets/{view-mode-toggle-BZ52Zalr.js → view-mode-toggle-yOXFqeV7.js} +1 -1
  205. package/dist/client/index.html +1 -1
  206. package/dist/server/cli.js +1 -1
  207. package/package.json +1 -1
  208. package/dist/client/assets/agents-list-DGJQ5tbU.js +0 -1
  209. package/dist/client/assets/ai-providers-1Fg66YS1.js +0 -1
  210. package/dist/client/assets/app-editor-Dee1jydx.js +0 -1
  211. package/dist/client/assets/automations-CFj3iBHN.js +0 -1
  212. package/dist/client/assets/brand-context-5jDalvDO.js +0 -1
  213. package/dist/client/assets/buckets-BzZ5RUjr.js +0 -1
  214. package/dist/client/assets/category-editor-wDaIJOJ7.js +0 -1
  215. package/dist/client/assets/collection-detail-ClxlZsnZ.js +0 -1
  216. package/dist/client/assets/command-vbsMaAT6.js +0 -1
  217. package/dist/client/assets/commerce-onboarding-DoN5YJbZ.js +0 -1
  218. package/dist/client/assets/connect-desktop-dialog-CkD3zyKJ.js +0 -1
  219. package/dist/client/assets/connection-detail-rDE247RN.js +0 -1
  220. package/dist/client/assets/connections-DnwHKMbX.js +0 -1
  221. package/dist/client/assets/file-explorer-W1D9pH49.js +0 -2
  222. package/dist/client/assets/general-23V2Ho1C.js +0 -1
  223. package/dist/client/assets/index-BWkPiGuC.js +0 -1
  224. package/dist/client/assets/index-DgqWlUUI.js +0 -1
  225. package/dist/client/assets/index-KwJaTLZk.js +0 -1
  226. package/dist/client/assets/page-seo-sheet-DuUcGG-6.js +0 -1
  227. package/dist/client/assets/post-editor-D55m7k1S.js +0 -1
  228. package/dist/client/assets/profile-wDwUx_Mw.js +0 -1
  229. package/dist/client/assets/project-app-view-3zlWIcJu.js +0 -1
  230. package/dist/client/assets/record-editor-BNDljN0d.js +0 -1
  231. package/dist/client/assets/registry-52H0YdSD.js +0 -2
  232. package/dist/client/assets/roles-CzG0s_Ib.js +0 -1
  233. package/dist/client/assets/secrets-Cr6YxiSX.js +0 -1
  234. package/dist/client/assets/select-model-C78uu1xA.js +0 -1
  235. package/dist/client/assets/seo-editor-CHrrRJBI.js +0 -1
  236. package/dist/client/assets/settings-layout-DzHXF3Dv.js +0 -1
  237. package/dist/client/assets/sidebar-Cx68CPJi.js +0 -1
  238. package/dist/client/assets/sso-vWr0RkSo.js +0 -1
  239. package/dist/client/assets/store-BXcc72mi.js +0 -1
  240. package/dist/client/assets/store-registry-CzJeBBUG.js +0 -2
  241. package/dist/client/assets/tooltip-B_mKOQvv.js +0 -1
  242. package/dist/client/assets/use-view-mode-DdtTz0AS.js +0 -1
  243. package/dist/client/assets/useInfiniteQuery-CWme5rGZ.js +0 -1
  244. package/dist/client/assets/useSuspenseInfiniteQuery-DVa_SnfJ.js +0 -1
  245. package/dist/client/assets/variant-calendar-D2hiqv-k.js +0 -1
@@ -1 +0,0 @@
1
- import{r as F,w as Ne,K as re,b7 as dt,k as Oe,j as s,l as K,i as fe,B as ne,c as q,z as Pe,aC as Ie,C as se,aE as De,aF as ke,m as Fe,G as mt,F as ut,d as $e,t as he,s as Re,af as Ke,a7 as ft,E as ht,b as gt,u as xt}from"./index-20lo5teZ.js";import{u as pt,C as bt}from"./use-organization-roles-rL51pKiY.js";import{u as je}from"./use-org-auth-client-CSAS1fgX.js";import{B as ge}from"./badge-C9MXVg0W.js";import{f as Qe,a as qe,b as He,c as Ze,d as Xe,A as Je,e as We,g as et}from"./alert-dialog-CKnoCFTw.js";import{D as Tt,a as Et,b as _t,c as It}from"./dropdown-menu-DBXGBAAP.js";import{a as Nt}from"./DotsVertical-BcvtEj5g.js";import{s as Ae}from"./Plus-BEdvqzrP.js";import{s as St}from"./Trash01-BfKdeD7S.js";import{P as te}from"./index-BoBbtnrJ.js";import{E as Ge}from"./empty-state-YJ1DU6Lk.js";import{S as ve}from"./search-input-DucmHYf0.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-62cL4F-8.js";import{u as Ct}from"./use-infinite-scroll-hOEUoZD8.js";import{C as we}from"./checkbox-B9vj-Cdf.js";import{i as At}from"./Settings02-BIpY6Zhb.js";import{u as Ot}from"./useSuspenseInfiniteQuery-DVa_SnfJ.js";import{u as Rt,S as jt}from"./use-mcp-client-CxXf5rsq.js";import{C as vt}from"./collection-search-C1sxKyva.js";import{u as nt}from"./use-members-Cd4dRzb0.js";import{u as yt}from"./use-connection-D-7QpVUJ.js";import{u as wt,d as Mt}from"./use-ai-providers-BFPg4Nao.js";import{A as lt}from"./avatar-BLEdyY7-.js";import{S as xe}from"./switch-BOUA2FBT.js";import{c as pe,b as be,T as Te,a as Ee}from"./tooltip-B_mKOQvv.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-CP7jibDA.js";import{t as Lt}from"./ChevronDown-aoqAeXtt.js";import{i as Pt}from"./ChevronRight-CUGhm8E7.js";import{i as ze}from"./X-Ciyf96Wa.js";import{a as Dt}from"./use-capability-C1-FHW22.js";import{A as kt}from"./access-gate-DelGJZFm.js";import"./table-hboPJhBa.js";import"./SwitchHorizontal01-EOva-Jpw.js";import"./ChevronUp-BDbnz61t.js";import"./sidebar-Cx68CPJi.js";import"./LayoutLeft-DjTexk5_.js";import"./sheet-BBGbheOC.js";import"./SearchMd-DK3hZUVF.js";import"./XCircle-ovYWqZM6.js";import"./agent-icon-Bk1Ofbdo.js";import"./AlertCircle-ChcBH14n.js";import"./Tool01-DcPFccxt.js";import"./ArrowUpRight-BfxsIWO1.js";import"./ZapSquare-BlfnVn5C.js";import"./Users03-NRaUurHt.js";import"./CheckCircle-Cm1GnmVj.js";import"./ChevronLeft-CoW1IpXE.js";import"./Stars02-C-addu2P.js";import"./Eye-BhqO9K0O.js";import"./ZoomOut-C-l0YUGT.js";import"./Globe01-CTIuSSD9.js";import"./FilterLines-DTI31VpW.js";import"./Star01-HcsxMzHs.js";import"./Globe04-Dy3PA2Yl.js";import"./HardDrive-DYVC-Zaq.js";import"./Key01-bDEyn58I.js";import"./LinkExternal01-COQYOgEI.js";import"./Monitor01-DV9tmVAF.js";import"./Sun-B11PPq5-.js";import"./Palette-CD1fLCtB.js";import"./Play-Dl0pf4M6.js";import"./Shield01-Dx8gqKG5.js";import"./Stars01-VD9js_iZ.js";import"./Upload01-T8pN8jBP.js";import"./User01-DxWsEbM9.js";import"./Users01-C7ItyIdk.js";import"./XClose-m9X1QqKX.js";import"./Zap-Bci_Afjv.js";import"./auth-Ci2ZRRcb.js";import"./use-collections-74mCujh3.js";import"./studio-tools-DqPhjgPW.js";import"./card-mAs4nLtf.js";import"./capability-load-error-sRyEFexC.js";const Me="basic-usage",Le=[{id:Me,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"]},{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"],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}];[...Le.find(t=>t.id===Me)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Le.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Le){if(e.id===Me)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=q.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(we,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.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=q.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.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 g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:x,checked:i,onCheckedChange:r,onClick:$t})}),e[10]=i,e[11]=r,e[12]=x,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:n,searchQuery:l}){const[i,r]=F.useState(""),d=l!==void 0?l:i,h=F.useDeferredValue(d),[c,g]=F.useState("all"),[f,a]=F.useState(!1),x=F.useRef(new Set(Object.keys(t))),{org:o}=Ne(),m=Rt({connectionId:jt,orgId:o.id,orgSlug:o.slug}),N=100,E=h.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,S=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:0,...S&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:O,hasNextPage:p,isFetchingNextPage:R}=Ot({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:N,offset:b,...S&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,H)=>Q+(H?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(O,p??!1,R),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,w=x.current,A=[...w.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!w.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[M,z]=F.useState(G[0]?.id??null),y=M?G.find(b=>b.id===M)??null:null,{data:L,isFetching:Y}=Oe({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",M??""),queryFn:async()=>M?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:M}})).structuredContent?.item??null:null,enabled:!!M,staleTime:3e4}),$=L?.tools??[],X=(b,D)=>t[b]?.includes(D)??!1,J=(b,D)=>{const Q=t[b]??[],H=Q.includes(D),W={...t};if(H){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===M?$:[];if(!D.length)return;const Q=t[b]??[],H=D.map(ee=>ee.name),W=Q.length>0&&H.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=H,z(b)),e(Z)},oe=b=>{z(b),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:[l===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:()=>g("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:()=>g("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:()=>g("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(b=>{const D=M===b.id,Q=D?$.length:0,H=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?$:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:H,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.id)}),s.jsx("div",{ref:j,className:"h-4"}),R&&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(ne,{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(ye,{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(b=>s.jsx(Ft,{connectionId:y.id,tool:b,isSelected:X(y.id,b.name),onToggle:()=>J(y.id,b.name)},b.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 Se=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function qt(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Se.length;return Se[n]??Se[0]}function Ht(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function ot(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Xt(t){const e=q.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=F.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const O=x.flatMap(es).flatMap(Wt);i(!1),r(O.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:O}=v;return{section:_,capabilities:O.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const N=x.map(m).filter(Jt);let E;e[12]!==n||e[13]!==i||e[14]!==r?(E=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==c||e[18]!==E?(T=Ye(n,c,E),e[16]=n,e[17]=c,e[18]=E,e[19]=T):T=e[19];let S;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(S=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=S):S=e[24];let C;e[25]!==T||e[26]!==S?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:S})})}),e[25]=T,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:_,capabilities:O}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:O.map(p=>{const R=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(R,c,()=>o(p,R)),onClick:c?void 0:()=>o(p,R)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Jt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={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 ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=q.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[N,E]=F.useState(m),T=m||N,S=E,[C,v]=F.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const O=_;let p;if(e[4]!==O||e[5]!==d){let j;e[7]!==O?(j=u=>O(u.id),e[7]=O,e[8]=j):j=e[8],p=d.filter(j),e[4]=O,e[5]=d,e[6]=p}else p=e[6];const R=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==R||e[13]!==T||e[14]!==r||e[15]!==O||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let w;e[24]===Symbol.for("react.memo_cache_sentinel")?(w=()=>S(cs),e[24]=w):w=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{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]!==R||e[34]!==d.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[R,"/",d.length," enabled"]}),e[33]=R,e[34]=d.length,e[35]=B):B=e[35];let M;e[36]!==T?(M=T?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=M):M=e[37];let z;e[38]!==M||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,M]}),e[38]=M,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:w,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=O(L.id),$=()=>{if(!o){if(g){x(n,h,L.id);return}a(n,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:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{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(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=R,e[13]=T,e[14]=r,e[15]=O,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=q.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=Mt(n.id);let a,x,o,m,N;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){N=Symbol.for("react.early_return_sentinel");e:{let S;e[16]!==n.label?(S=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=S):S=e[17];const C=f.filter(hs).map(S),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){N=null;break e}const O=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=O.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),O.set(k,G)}const p=Array.from(O.entries()).map(fs).sort(us),R=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let w;e[21]!==u?(w=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=w):w=e[22],e[23]!==w||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,w]}),e[23]=w,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:R},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=N}else a=e[11],x=e[12],o=e[13],m=e[14],N=e[15];if(N!==Symbol.for("react.early_return_sentinel"))return N;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==o||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:o,children:[m,E]}),e[29]=o,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=q.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=F.useDeferredValue(h),f=wt();let a;e[0]!==l||e[1]!==r?(a=(p,R)=>{const I=l[p]??[],j={...l};if(I.includes(R)){const u=I.filter(w=>w!==R);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,R];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,R,I)=>{i(!1),r({...l,[p]:R.filter(j=>j!==I)})},e[3]=l,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;e[7]!==N?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",N),e[7]=N,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(T=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=T):T=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]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[S,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=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(p=>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(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let O;return e[32]!==_||e[33]!==v?(O=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=O):O=e[34],O}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=q.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=F.useState(""),c=F.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=F.useState(g),{data:x}=nt();let o,m,N,E,T,S,C,v,_,O,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.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 M=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],N=z,m=Qe,O=n,p=l,o=qe,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(He,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Xe,{children:"Select members to add to this role."})]}),e[26]=_):_=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(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=M.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:M.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(we,{checked:$||Y,onCheckedChange:()=>{!L||Y||a(X=>X.includes(y.id)?X.filter(J=>J!==y.id):[...X,y.id])},disabled:!L||Y}),s.jsx(lt,{url:y.user?.image??void 0,fallback:ot(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(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=N,e[12]=E,e[13]=T,e[14]=S,e[15]=C,e[16]=v,e[17]=_,e[18]=O,e[19]=p}else o=e[9],m=e[10],N=e[11],E=e[12],T=e[13],S=e[14],C=e[15],v=e[16],_=e[17],O=e[18],p=e[19];let R;e[29]!==E||e[30]!==T?(R=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=R):R=e[31];let I;e[32]!==R||e[33]!==S||e[34]!==C?(I=s.jsxs("div",{className:S,children:[C,R]}),e[32]=R,e[33]=S,e[34]=C,e[35]=I):I=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,w=f.length>0&&`(${f.length})`;let A;e[37]!==N||e[38]!==u||e[39]!==w?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:N,disabled:u,children:["Add ",w]})]}),e[37]=N,e[38]=u,e[39]=w,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==O||e[50]!==p?(G=s.jsx(m,{open:O,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=O,e[50]=p,e[51]=G):G=e[51],G}function Ts(t){const e=q.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=F.useDeferredValue(d),{data:x}=nt();let o,m,N;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const O=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const R=O.filter(p);N="flex flex-col h-full",o="flex-1 overflow-auto",m=O.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."})]})}):R.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:R.map(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:I.user?.image??void 0,fallback:ot(I.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:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,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;e[14]!==o||e[15]!==m?(E=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let S;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==T?(S=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:T}),e[20]=h,e[21]=n,e[22]=c,e[23]=T,e[24]=S):S=e[24];let C;return e[25]!==N||e[26]!==E||e[27]!==S?(C=s.jsxs("div",{className:N,children:[E,S]}),e[25]=N,e[26]=E,e[27]=S,e[28]=C):C=e[28],C}function Es(t){const e=q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx(F.Suspense,{fallback:n,children:s.jsx(Ts,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ns(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+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:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ss(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ns(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=q.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Ee,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Os(t){const e=q.c(14),{locator:n}=Ne(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,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:g}=Oe(h);if(g||!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 x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Rs,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Rs({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Ne(),d=je(),h=Fe(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=F.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,N=o.formState.isDirty,E=$e({mutationFn:async u=>{const w=Ss(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 M=l.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!M.includes(L)),y=M.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,M=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:w,...M?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(M?U:B,M?B:void 0),M?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:w});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const M=await d.organization.updateMemberRole({memberId:B,role:[A]});if(M?.error)throw new Error(M.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,w)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!w.role.id&&!w.role.slug,k=w.role.slug==="owner"&&!w.role.id;Re(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:w.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}E.mutate(u)}),S=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,O]=F.useState(""),[p,R]=F.useState(!1),I=u=>{x(u),O("")},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(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!N,children:E.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"?Ht(t.role):qt(o.watch("role.label")))}),g&&s.jsx(Ke,{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:()=>I(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(ve,{value:_,onChange:O,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>R(!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"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Xt,{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:g,searchQuery:_}),a==="models"&&s.jsx(gs,{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:g,searchQuery:_}),a==="members"&&s.jsx(Es,{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:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:R})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=q.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function ws(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const Ms={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ls(t,e){return e?Ms[t]??"bg-neutral-400":ws(t)}function Ps(){const t=q.c(77),[e,n]=F.useState(""),[l,i]=F.useState(null),r=gt();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(),g=je(),f=Fe(),{customRoles:a,refetch:x}=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 E=N;let T;t[5]!==c?(T=re.members(c),t[5]=c,t[6]=T):T=t[6];let S;t[7]!==g?(S=()=>g.organization.listMembers(),t[7]=g,t[8]=S):S=t[8];let C;t[9]!==T||t[10]!==S?(C={queryKey:T,queryFn:S},t[9]=T,t[10]=S,t[11]=C):C=t[11];const{data:v}=Oe(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const O=_;let p;t[14]!==O?(p=P=>O.filter(V=>V.role===P).length,t[14]=O,t[15]=p):p=t[15];const R=p;let I;if(t[16]!==a||t[17]!==R||t[18]!==e){let P;t[20]!==R?(P=ce=>({kind:"builtin",role:{...ce,memberCount:R(ce.role)}}),t[20]=R,t[21]=P):P=t[21];const V=ys.map(P);let ae;t[22]!==R?(ae=ce=>({kind:"custom",role:{...ce,memberCount:R(ce.role)}}),t[22]=R,t[23]=ae):ae=t[23];const at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=R,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=$e({mutationFn:j,onSuccess:(P,V)=>{Re("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let w,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},w={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=w,t[27]=A,t[28]=k,t[29]=G):(w=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,w,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Tt,{children:[s.jsx(Et,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(Nt,{size:16})})}),s.jsx(_t,{align:"end",onClick:Ds,children:s.jsxs(It,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let M;t[31]!==m?(M=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=M):M=t[32];const z=M;if(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Os,{target:E,onBack:P,onSaved:V},js(E))}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"&&(n(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,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 X;t[44]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Ae,{size:16}),t[44]=X):X=t[44];let J;t[45]!==$?(J=s.jsxs(ne,{onClick:$,children:[X,"Create Role"]}),t[45]=$,t[46]=J):J=t[46];let le;t[47]!==Y||t[48]!==J?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,J]}),t[47]=Y,t[48]=J,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(bt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let H;t[61]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ze,{children:"Delete Role"}),t[61]=H):H=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(He,{children:[H,s.jsxs(Xe,{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]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,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(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(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,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ls(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(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Re("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 Ys(){const t=q.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 n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{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(Ps,{})})}),t[1]=n):n=t[1],n}function ml(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{ml as default};
@@ -1 +0,0 @@
1
- import{c as p,j as t,E as P,r as j,af as w,B as S,t as y}from"./index-20lo5teZ.js";import{i as k}from"./AlertCircle-ChcBH14n.js";import{s as z}from"./Plus-BEdvqzrP.js";import{s as E}from"./User01-DxWsEbM9.js";import{t as F}from"./Users01-C7ItyIdk.js";import{d as $,c as I,D as O,a as A,b as R,e as T}from"./dialog-DtA5oh9D.js";import{I as N}from"./input-D2VJ6ahm.js";import{L as g}from"./label-Xkc4XdLq.js";import{d as B,b as V,c as L,S as q,a as C}from"./select-C0AEr1SL.js";import{S as H}from"./skeleton-CVRpN7O3.js";import{T as K}from"./textarea-BqMqcZIm.js";import{P as b}from"./index-BoBbtnrJ.js";import{c as W}from"./settings-section-CP7jibDA.js";import{u as Y,a as G}from"./use-secrets-CfUCGkTu.js";import{R as J}from"./require-capability-BMiu3VbE.js";import"./X-Ciyf96Wa.js";import"./index-BdQq_4o_.js";import"./tooltip-B_mKOQvv.js";import"./ChevronUp-BDbnz61t.js";import"./ChevronDown-aoqAeXtt.js";import"./sidebar-Cx68CPJi.js";import"./LayoutLeft-DjTexk5_.js";import"./sheet-BBGbheOC.js";import"./card-mAs4nLtf.js";import"./ArrowUpRight-BfxsIWO1.js";import"./studio-tools-DqPhjgPW.js";import"./use-capability-C1-FHW22.js";import"./access-gate-DelGJZFm.js";import"./capability-load-error-sRyEFexC.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 +0,0 @@
1
- import{c as D,j as o,l as R,r as $,B as H}from"./index-20lo5teZ.js";import{i as Q,a as W,c as J,d as K}from"./dialog-DtA5oh9D.js";import{g as V,b as Y,a as Z,D as ee}from"./drawer-zXrFQNCR.js";import{u as oe}from"./tooltip-B_mKOQvv.js";import{b as A}from"./chat-context-BdyPsWKn.js";import{D as te,b as le,S as U,M as se}from"./decopilot-CW6d29Nv.js";import{a as G,b as z}from"./connect-desktop-dialog-CkD3zyKJ.js";const ie=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function X(r){const e=D.c(10),{modelSet:t,selectedModelId:s,onSelect:i}=r;let l,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==i||e[4]!==s){const a=Object.fromEntries(t.models.map(ne));l="flex flex-col p-2 w-[320px]",c=ie.map(d=>{const{tier:p,description:m}=d,u=t.tiers[p];if(!u.modelId)return null;const x=a[u.modelId];if(!x)return null;const f=s===u.modelId;return o.jsxs("button",{type:"button",onClick:()=>i(x),className:R("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",f&&"bg-accent/50"),children:[o.jsx("img",{src:t.logo,alt:u.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),o.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[o.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:u.label}),o.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},p)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=i,e[4]=s,e[5]=l,e[6]=c}else l=e[5],c=e[6];let n;return e[7]!==l||e[8]!==c?(n=o.jsx("div",{className:l,children:c}),e[7]=l,e[8]=c,e[9]=n):n=e[9],n}function ne(r){return[r.modelId,r]}const de=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],L="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ce=[{providerId:"codex",modelId:"codex:gpt-5.5",title:"GPT-5.5",description:"Frontier model for complex coding, research, and real-world work",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4",title:"GPT-5.4",description:"Strong model for everyday coding",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.4-mini",title:"GPT-5.4 Mini",description:"Small, fast, and cost-efficient model for simpler coding tasks",capabilities:["text","reasoning"],logo:L,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:L,limits:null,costs:null}],re="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",ae="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",me={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:o.jsx(G,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:o.jsx(G,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:o.jsx(G,{size:16})}},pe={fast:{modelId:"codex:gpt-5.4-mini",label:"GPT-5.4 Mini",description:"Quicker responses",iconNode:o.jsx(z,{size:16})},smart:{modelId:"codex:gpt-5.4",label:"GPT-5.4",description:"Balanced quality",iconNode:o.jsx(z,{size:16})},thinking:{modelId:"codex:gpt-5.5",label:"GPT-5.5",description:"Deeper reasoning",iconNode:o.jsx(z,{size:16})}};function q(r){return r==="claude-code"?{logo:re,tiers:me,models:de}:r==="codex"?{logo:ae,tiers:pe,models:ce}:null}function ue(r){const e=D.c(11),{onClose:t,agent:s}=r,i=A(),l=s??i.pendingHarnessId??"decopilot";let c;e[0]!==l?(c=q(l),e[0]=l,e[1]=c):c=e[1];const n=c;if(!n){let m;return e[2]!==t?(m=o.jsx(le,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const a=i.selectedModel?.modelId??n.tiers[i.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==i?(d=m=>{i.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=i,e[6]=d):d=e[6];let p;return e[7]!==n||e[8]!==a||e[9]!==d?(p=o.jsx(X,{modelSet:n,selectedModelId:a,onSelect:d}),e[7]=n,e[8]=a,e[9]=d,e[10]=p):p=e[10],p}function fe(r){const e=D.c(13);let t,s;e[0]!==r?({agent:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=t?q(t):null,e[3]=t,e[4]=i):i=e[4];const l=i;if(!l){let d;return e[5]!==s?(d=o.jsx(te,{...s}),e[5]=s,e[6]=d):d=e[6],d}const c=s.selectedModel?.modelId??l.tiers.smart.modelId;let n;e[7]!==s?(n=d=>{s.onModelChange(d),s.onClose()},e[7]=s,e[8]=n):n=e[8];let a;return e[9]!==l||e[10]!==c||e[11]!==n?(a=o.jsx(X,{modelSet:l,selectedModelId:c,onSelect:n}),e[9]=l,e[10]=c,e[11]=n,e[12]=a):a=e[12],a}function ve(r){const e=D.c(39),{variant:t,className:s,placeholder:i,model:l,isLoading:c,credentialId:n,onCredentialChange:a,onModelChange:d,filterModels:p,agent:m}=r,u=t===void 0?"borderless":t,x=i===void 0?"Select model":i,[f,k]=$.useState(!1),g=d!==void 0,F=oe(),B=u==="borderless"?"ghost":"outline",P=u==="borderless"&&"md:border-none";let h;e[0]!==s||e[1]!==P?(h=R("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",P,s),e[0]=s,e[1]=P,e[2]=h):h=e[2];let b;e[3]!==c||e[4]!==l||e[5]!==x||e[6]!==g?(b=g?o.jsx(U,{model:l??null,placeholder:x,isLoading:c}):o.jsx(ge,{placeholder:x}),e[3]=c,e[4]=l,e[5]=x,e[6]=g,e[7]=b):b=e[7];let O;e[8]!==B||e[9]!==h||e[10]!==b?(O=o.jsx(H,{variant:B,size:"sm",className:h,children:b}),e[8]=B,e[9]=h,e[10]=b,e[11]=O):O=e[11];const C=O;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(se,{}),e[12]=w):w=e[12];let y;e[13]!==m||e[14]!==n||e[15]!==p||e[16]!==l||e[17]!==a||e[18]!==d||e[19]!==g?(y=o.jsx($.Suspense,{fallback:w,children:g?o.jsx(fe,{onClose:()=>k(!1),agent:m,credentialId:n??null,onCredentialChange:a??xe,selectedModel:l??null,onModelChange:d,filterModels:p}):o.jsx(ue,{onClose:()=>k(!1),agent:m})}),e[13]=m,e[14]=n,e[15]=p,e[16]=l,e[17]=a,e[18]=d,e[19]=g,e[20]=y):y=e[20];const I=y;if(F){let M;e[21]!==C?(M=o.jsx(V,{asChild:!0,children:C}),e[21]=C,e[22]=M):M=e[22];let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(Y,{className:"sr-only",children:"Select model"}),e[23]=_):_=e[23];let v;e[24]!==I?(v=o.jsxs(Z,{className:"p-0 flex flex-col max-h-[95vh]",children:[_,o.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[24]=I,e[25]=v):v=e[25];let T;return e[26]!==f||e[27]!==M||e[28]!==v?(T=o.jsxs(ee,{open:f,onOpenChange:k,children:[M,v]}),e[26]=f,e[27]=M,e[28]=v,e[29]=T):T=e[29],T}let S;e[30]!==C?(S=o.jsx(Q,{asChild:!0,children:C}),e[30]=C,e[31]=S):S=e[31];let N;e[32]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(W,{className:"sr-only",children:"Select model"}),e[32]=N):N=e[32];let j;e[33]!==I?(j=o.jsxs(J,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[N,I]}),e[33]=I,e[34]=j):j=e[34];let E;return e[35]!==f||e[36]!==S||e[37]!==j?(E=o.jsxs(K,{open:f,onOpenChange:k,children:[S,j]}),e[35]=f,e[36]=S,e[37]=j,e[38]=E):E=e[38],E}function xe(){}function ge(r){const e=D.c(4),{placeholder:t}=r,{selectedModel:s,isModelsLoading:i}=A();let l;return e[0]!==i||e[1]!==s||e[2]!==t?(l=o.jsx(U,{model:s,placeholder:t,isLoading:i}),e[0]=i,e[1]=s,e[2]=t,e[3]=l):l=e[3],l}export{ve as M};
@@ -1 +0,0 @@
1
- import{c as T,j as t,r as Q,B as je,i as Se}from"./index-20lo5teZ.js";import{i as be}from"./ChevronRight-CUGhm8E7.js";import{L as fe}from"./agent-icon-Bk1Ofbdo.js";import{S as ue}from"./scroll-area-BlJNYaPT.js";import{r as Ne,c as ke,u as _e,a as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-tt8IzB9t.js";import{s as xe,p as ze}from"./index-CDpdJTKU.js";import{a as ge}from"./Tool01-DcPFccxt.js";import"./AlertCircle-ChcBH14n.js";import"./SwitchHorizontal01-EOva-Jpw.js";import"./Settings02-BIpY6Zhb.js";import"./XCircle-ovYWqZM6.js";import"./ArrowUpRight-BfxsIWO1.js";import"./ZapSquare-BlfnVn5C.js";import"./Users03-NRaUurHt.js";import"./CheckCircle-Cm1GnmVj.js";import"./ChevronUp-BDbnz61t.js";import"./ChevronDown-aoqAeXtt.js";import"./ChevronLeft-CoW1IpXE.js";import"./DotsVertical-BcvtEj5g.js";import"./Stars02-C-addu2P.js";import"./Eye-BhqO9K0O.js";import"./ZoomOut-C-l0YUGT.js";import"./Globe01-CTIuSSD9.js";import"./FilterLines-DTI31VpW.js";import"./Star01-HcsxMzHs.js";import"./Globe04-Dy3PA2Yl.js";import"./HardDrive-DYVC-Zaq.js";import"./Key01-bDEyn58I.js";import"./LayoutLeft-DjTexk5_.js";import"./LinkExternal01-COQYOgEI.js";import"./Monitor01-DV9tmVAF.js";import"./Sun-B11PPq5-.js";import"./Palette-CD1fLCtB.js";import"./Play-Dl0pf4M6.js";import"./Plus-BEdvqzrP.js";import"./SearchMd-DK3hZUVF.js";import"./Shield01-Dx8gqKG5.js";import"./Stars01-VD9js_iZ.js";import"./Trash01-BfKdeD7S.js";import"./Upload01-T8pN8jBP.js";import"./User01-DxWsEbM9.js";import"./Users01-C7ItyIdk.js";import"./XClose-m9X1QqKX.js";import"./X-Ciyf96Wa.js";import"./Zap-Bci_Afjv.js";import"./use-clock-tick-DvWNr9a0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D6L-AQL_.js";import"./tooltip-B_mKOQvv.js";import"./file-type-icon-3wYgaJ1f.js";import"./dialog-DtA5oh9D.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Cms0eXYe.js";import"./use-mcp-client-CxXf5rsq.js";import"./auth-Ci2ZRRcb.js";import"./chat-context-BdyPsWKn.js";import"./hooks-BdXI0ZZ7.js";import"./decopilot-sse-pool-DhvSomLP.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CwSMwdwq.js";import"./use-collections-74mCujh3.js";import"./use-ai-providers-BFPg4Nao.js";import"./studio-tools-DqPhjgPW.js";import"./use-organization-settings-CTH2EptF.js";import"./shell-layout-xhRX4rsB.js";import"./avatar-BLEdyY7-.js";import"./required-auth-layout-hnMHneNT.js";import"./use-org-sso-D9H6UI9E.js";import"./sheet-BBGbheOC.js";import"./integration-icon-62cL4F-8.js";import"./use-navigate-to-agent-D8CoEyF3.js";import"./use-connection-D-7QpVUJ.js";import"./use-mcp-prompts-CqbI2uxQ.js";import"./form-BPgAGzjC.js";import"./label-Xkc4XdLq.js";import"./input-D2VJ6ahm.js";import"./index-BdQq_4o_.js";import"./switch-BOUA2FBT.js";import"./select-C0AEr1SL.js";import"./index-DsiMEgqD.js";import"./drawer-zXrFQNCR.js";import"./collection-search-C1sxKyva.js";import"./tabs-BqGLbeO9.js";import"./toggle-group-Db5bABta.js";import"./sortable.esm-DMoaSsem.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-gZqWtnUr.js";import"./use-registry-connections-jcbA10JV.js";import"./useInfiniteQuery-CWme5rGZ.js";import"./use-infinite-scroll-hOEUoZD8.js";import"./extract-connection-data-DlaPzbl9.js";import"./card-mAs4nLtf.js";import"./collection-tabs-Csv5ENUX.js";import"./badge-C9MXVg0W.js";import"./textarea-BqMqcZIm.js";import"./connection-form-helpers-4cMYvdoC.js";import"./authenticate-and-persist-oauth-CjSCavkQ.js";import"./mcp-oauth-CsZ919dh.js";import"./useSuspenseInfiniteQuery-DVa_SnfJ.js";import"./connect-desktop-dialog-CkD3zyKJ.js";import"./decopilot-CW6d29Nv.js";import"./checkbox-B9vj-Cdf.js";import"./skeleton-CVRpN7O3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CP7jibDA.js";import"./popover-CHlLC07g.js";import"./command-vbsMaAT6.js";import"./index-wuE_wZDF.js";import"./dropdown-menu-DBXGBAAP.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CfsHQQ72.js";import"./empty-state-YJ1DU6Lk.js";import"./toolbar-DDUCJSbz.js";import"./preview-dialog-pnlDSJ8-.js";import"./index-BBUDuLgB.js";import"./use-mcp-tools-CLWDDSx5.js";import"./use-capability-C1-FHW22.js";import"./shell-route-loading-C4SUOonb.js";import"./tools-list-DkXVWS7e.js";import"./alert-dialog-CKnoCFTw.js";import"./use-debounced-autosave-B3nrE_1Y.js";import"./index-BoBbtnrJ.js";import"./sidebar-Cx68CPJi.js";import"./search-input-DucmHYf0.js";import"./github-repo-picker-hOzqpBMc.js";import"./use-secrets-CfUCGkTu.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-BZ52Zalr.js";import"./index-BaiqhWaL.js";import"./automation-runs-BNON3nJA.js";import"./table-hboPJhBa.js";import"./use-members-Cd4dRzb0.js";import"./use-org-auth-client-CSAS1fgX.js";import"./task-status-DbMlzbTm.js";import"./use-automations-C_LX8Dvr.js";import"./use-file-configs-DNAtFvn4.js";import"./monaco-editor-C0cKgOd8.js";import"./select-model-C78uu1xA.js";import"./automation-list-row-Cuo6QaWy.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Z="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Z;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let S;return e[23]!==u||e[24]!==y||e[25]!==g?(S=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=S):S=e[26],S}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Z;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Z;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Z;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const S=i.description??ee;let _;e[17]!==y||e[18]!==S?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:S}),e[17]=y,e[18]=S,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let b;e[24]!==i.image?(b=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=b):b=e[25];let k;e[26]!==N||e[27]!==b||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,b]}),e[26]=N,e[27]=b,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function wi(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=Q.useState(f),[j,v]=Q.useState(null),[y,S]=Q.useState(0),[_,N]=Q.useState(void 0);x!==f&&(u(f),v(null),N(void 0),S(Me));const{persistSeo:b,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==b||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),b(de)},e[8]=b,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==S?(H=()=>S(Ke),e[14]=S,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ge(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",q=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(be,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(Se,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==b||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==q||e[57]!==me||e[58]!==R?(A=!c||!q&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:q?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),b(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=b,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=q,e[57]=me,e[58]=R,e[59]=A):A=e[59];let J;return e[60]!==I||e[61]!==A?(J=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=J):J=e[62],J}function Ke(n){return n+1}function Me(n){return n+1}function Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{wi as SeoEditor};
@@ -1 +0,0 @@
1
- import{c as S,e as R,j as s,w as J,l as k,af as Q,y as L,s as B,M as I,a as G,i as D,r as F,O as K}from"./index-20lo5teZ.js";import{u as E,S as U,M as V}from"./shell-controls-BPsjYlm1.js";import{j as X,k as Y,l as Z,b as q,c as w,d as M,S as P,a as O,f as ee,g as se}from"./sidebar-Cx68CPJi.js";import{a as te}from"./index-BoBbtnrJ.js";import{n as le,b as re,a as ie,c as oe,d as ne,i as T}from"./ZapSquare-BlfnVn5C.js";import{t as ae,a as A}from"./Users03-NRaUurHt.js";import{i as ce}from"./HardDrive-DYVC-Zaq.js";import{i as me}from"./Key01-bDEyn58I.js";import{i as fe}from"./Shield01-Dx8gqKG5.js";import{s as de}from"./User01-DxWsEbM9.js";import{i as xe}from"./Zap-Bci_Afjv.js";import{a as be}from"./use-capability-C1-FHW22.js";import{a as ue}from"./use-join-requests-BvPzSuPP.js";import{u as W}from"./tooltip-B_mKOQvv.js";import{u as he}from"./use-status-sounds-CfsHQQ72.js";import{a as y}from"./toolbar-DDUCJSbz.js";import"./sheet-BBGbheOC.js";import"./X-Ciyf96Wa.js";import"./LayoutLeft-DjTexk5_.js";import"./studio-tools-DqPhjgPW.js";import"./question-004-sINsf4GQ.js";import"./decopilot-sse-pool-DhvSomLP.js";import"./backoff-CrEUbyZT.js";import"./ChevronLeft-CoW1IpXE.js";import"./ChevronRight-CUGhm8E7.js";function H(){const e=S.c(21),{capabilities:t,isPrivileged:f,loading:l,error:a}=be(),r=ue().length;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ae,{size:14}),e[0]=o):o=e[0];let n,i;if(e[1]!==t||e[2]!==a||e[3]!==f||e[4]!==r||e[5]!==l){i=Symbol.for("react.early_return_sentinel");e:{let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(le,{size:14}),e[8]=u):u=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(re,{size:14}),e[9]=c):c=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(me,{size:14}),e[10]=d):d=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ce,{size:14}),e[11]=x):x=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ie,{size:14}),e[12]=m):m=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(A,{size:14}),e[13]=b):b=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xe,{size:14}),e[14]=p):p=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(oe,{size:14}),e[15]=g):g=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ne,{size:14}),e[16]=h):h=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(A,{size:14}),e[17]=_):_=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(fe,{size:14}),e[18]=j):j=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Q,{size:14}),e[19]=v):v=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(de,{size:14}),e[20]=N):N=e[20];const z=[{label:"Organization",items:[{key:"general",label:"General",icon:o,to:"/$org/settings/general",requires:"org:manage"},{key:"brand-context",label:"Brand Context",icon:u,to:"/$org/settings/brand-context",requires:"org:manage"},{key:"ai-providers",label:"AI Providers",icon:c,to:"/$org/settings/ai-providers",requires:"ai-providers:manage"},{key:"secrets",label:"Secrets",icon:d,to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"buckets",label:"Buckets",icon:x,to:"/$org/settings/buckets",requires:"file-configs:manage"}]},{label:"Build",items:[{key:"connections",label:"Connections",icon:m,to:"/$org/settings/connections"},{key:"agents",label:"Agents",icon:b,to:"/$org/settings/agents"},{key:"automations",label:"Automations",icon:p,to:"/$org/settings/automations",requires:"automations:manage"},{key:"store",label:"Store",icon:g,to:"/$org/settings/store",requires:"registry:manage"}]},{label:"Manage",items:[{key:"monitor",label:"Monitor",icon:h,to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:"Members",icon:_,to:"/$org/settings/members",requires:"members:manage",badge:r},{key:"roles",label:"Roles",icon:j,to:"/$org/settings/roles",privilegedOnly:!0},{key:"sso",label:"Security",icon:v,to:"/$org/settings/sso",requires:"org:manage"}]},{label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:N,to:"/$org/settings/profile"}]}];if(l||a){i=z;break e}n=z.map(C=>({...C,items:C.items.filter($=>$.privilegedOnly?f:$.requires?f||t[$.requires]:!0)})).filter(pe)}e[1]=t,e[2]=a,e[3]=f,e[4]=r,e[5]=l,e[6]=n,e[7]=i}else n=e[6],i=e[7];return i!==Symbol.for("react.early_return_sentinel")?i:n}function pe(e){return e.items.length>0}function ge(){const e=S.c(19),t=H();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org"},e[0]=f):f=e[0];const{org:l}=R(f);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={select:_e},e[1]=a):a=e[1];const r=E(a);let o;e[2]!==l||e[3]!==r?(o=b=>{const p=b.replace("$org",l);return r.startsWith(p)},e[2]=l,e[3]=r,e[4]=o):o=e[4];const n=o;let i;if(e[5]!==t||e[6]!==n||e[7]!==l){let b;e[9]!==n||e[10]!==l?(b=(p,g)=>s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[p.label&&s.jsx("p",{className:k("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",g>0&&"mt-3"),children:p.label}),s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:p.items.map(h=>s.jsx(P,{children:s.jsx(O,{asChild:!0,isActive:n(h.to),children:s.jsxs(L,{to:h.to,params:{org:l},onClick:()=>B("settings_nav_clicked",{section_key:h.key,section_label:h.label,group_label:p.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsxs("span",{className:"relative shrink-0",children:[h.icon,h.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:h.label})]})})},h.key))})})]},`${p.label}-${g}`),e[9]=n,e[10]=l,e[11]=b):b=e[11],i=t.map(b),e[5]=t,e[6]=n,e[7]=l,e[8]=i}else i=e[8];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[12]=u):u=e[12];let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(q,{className:"pt-0 pr-0 pb-0 pl-0",children:[u,s.jsx(w,{children:s.jsx(M,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(O,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[13]=c):c=e[13];let d;e[14]!==i?(d=s.jsxs(ee,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0 overflow-y-auto",children:[i,c]}),e[14]=i,e[15]=d):d=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.89.1"]})}),e[16]=x):x=e[16];let m;return e[17]!==d?(m=s.jsxs(se,{variant:"sidebar",children:[d,x]}),e[17]=d,e[18]=m):m=e[18],m}function je(){B("signed_out",{source:"settings_sidebar"}),I(),G.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=S.c(21),{onClose:f}=e,l=H();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org"},t[0]=a):a=t[0];const{org:r}=R(a);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={select:ve},t[1]=o):o=t[1];const n=E(o);let i;t[2]!==r||t[3]!==n?(i=g=>{const h=g.replace("$org",r);return n.startsWith(h)},t[2]=r,t[3]=n,t[4]=i):i=t[4];const u=i;let c;if(t[5]!==l||t[6]!==u||t[7]!==f||t[8]!==r){let g;t[10]!==u||t[11]!==f||t[12]!==r?(g=(h,_)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[h.label&&s.jsx("p",{className:k("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",_>0&&"mt-3"),children:h.label}),h.items.map(j=>s.jsxs(L,{to:j.to,params:{org:r},onClick:f,className:k("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",u(j.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsxs("span",{className:"relative shrink-0",children:[j.icon,j.badge?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-red-500 pointer-events-none"}):null]}),s.jsx("span",{className:"truncate",children:j.label})]},j.key))]},`${h.label}-${_}`),t[10]=u,t[11]=f,t[12]=r,t[13]=g):g=t[13],c=l.map(g),t[5]=l,t[6]=u,t[7]=f,t[8]=r,t[9]=c}else c=t[9];let d;t[14]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[14]=d):d=t[14];let x;t[15]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[d,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(T,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[15]=x):x=t[15];let m;t[16]!==c?(m=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[c,x]}),t[16]=c,t[17]=m):m=t[17];let b;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","3.89.1"]})}),t[18]=b):b=t[18];let p;return t[19]!==m?(p=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[m,b]}),t[19]=m,t[20]=p):p=t[20],p}function Se(){I(),G.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=S.c(4),t=W(),{org:f}=J();he(f.slug);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(D,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(F.Suspense,{fallback:l,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(te,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(K,{})})})})}),e[1]=a):a=e[1];const r=a;if(t){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex flex-col flex-1 bg-background min-h-0 overflow-hidden",children:r}),e[2]=n):n=e[2],n}let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:k("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),children:r})}),e[3]=o):o=e[3],o}function Xe(){const e=S.c(22),t=W();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(y.LogoLink,{}),e[0]=f):f=e[0];let l;e[1]!==t?(l=t&&s.jsx(U,{}),e[1]=t,e[2]=l):l=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"hidden md:contents",children:s.jsx(y.Nav,{})}),e[3]=a):a=e[3];let r;e[4]!==l?(r=s.jsxs(y.LeftColumn,{children:[f,l,a]}),e[4]=l,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(y.CenterSlot,{}),e[6]=o):o=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(y.RightColumn,{children:s.jsx("span",{})}),e[7]=n):n=e[7];let i;e[8]!==r?(i=s.jsxs(y.Header,{children:[r,o,n]}),e[8]=r,e[9]=i):i=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u={"--sidebar-width-icon":"3.5rem"},e[10]=u):u=e[10];let c;e[11]!==t?(c=!t&&s.jsx(ge,{}),e[11]=t,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(X,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(Ne,{})}),e[13]=d):d=e[13];let x;e[14]!==c?(x=s.jsxs(Y,{className:"flex-1 bg-sidebar min-h-0",style:u,children:[c,d]}),e[14]=c,e[15]=x):x=e[15];let m;e[16]!==t?(m=t&&s.jsx(V,{renderSidebar:ke}),e[16]=t,e[17]=m):m=e[17];let b;return e[18]!==x||e[19]!==m||e[20]!==i?(b=s.jsx(y.Provider,{children:s.jsx(Z,{defaultOpen:!0,children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[i,x,m]})})}),e[18]=x,e[19]=m,e[20]=i,e[21]=b):b=e[21],b}function ke(e){const{onClose:t}=e;return s.jsx(ye,{onClose:t})}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,Xe as default};
@@ -1 +0,0 @@
1
- import{c as S,l as w,j as r,r as T,bf as A,bF as H,B as P}from"./index-20lo5teZ.js";import{i as R}from"./LayoutLeft-DjTexk5_.js";import{u as V,c as D,a as B,T as E,b as z}from"./tooltip-B_mKOQvv.js";import{d as W,b as F,S as G,a as L,c as q}from"./sheet-BBGbheOC.js";const J="15rem",K="18rem",Q="4.5rem",k=T.createContext(null);function O(){const l=T.useContext(k);if(!l)throw new Error("useSidebar must be used within a SidebarProvider.");return l}function se(l){const e=S.c(19),{children:t,defaultOpen:s,open:a,onOpenChange:i}=l,d=s===void 0?!1:s,n=V(),[o,h]=T.useState(d),[u,g]=T.useState(!1),c=a!==void 0,b=c?a:o;let N;e[0]!==c||e[1]!==i?(N=_=>{c||h(_),i?.(_)},e[0]=c,e[1]=i,e[2]=N):N=e[2];const f=N;let j;e[3]!==n||e[4]!==b||e[5]!==f?(j=()=>{n?g(U):f(!b)},e[3]=n,e[4]=b,e[5]=f,e[6]=j):j=e[6];const y=j,m=b?"expanded":"collapsed";let p;e[7]!==n||e[8]!==b||e[9]!==u||e[10]!==f||e[11]!==m||e[12]!==y?(p={state:m,open:b,setOpen:f,isMobile:n,openMobile:u,setOpenMobile:g,toggleSidebar:y},e[7]=n,e[8]=b,e[9]=u,e[10]=f,e[11]=m,e[12]=y,e[13]=p):p=e[13];const v=p;let x;e[14]!==t?(x=r.jsx(D,{delayDuration:0,children:t}),e[14]=t,e[15]=x):x=e[15];let C;return e[16]!==v||e[17]!==x?(C=r.jsx(k.Provider,{value:v,children:x}),e[16]=v,e[17]=x,e[18]=C):C=e[18],C}function U(l){return!l}function ie(l){const e=S.c(14);let t,s,a,i;e[0]!==l?({className:s,style:i,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i):(t=e[1],s=e[2],a=e[3],i=e[4]);let d;e[5]!==i?(d={"--sidebar-width":J,"--sidebar-width-icon":Q,...i},e[5]=i,e[6]=d):d=e[6];const n=d;let o;e[7]!==s?(o=w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=o):o=e[8];let h;return e[9]!==t||e[10]!==a||e[11]!==n||e[12]!==o?(h=r.jsx("div",{"data-slot":"sidebar-wrapper",style:n,className:o,...a,children:t}),e[9]=t,e[10]=a,e[11]=n,e[12]=o,e[13]=h):h=e[13],h}function le(l){const e=S.c(36);let t,s,a,i,d;e[0]!==l?({side:i,variant:d,className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=d):(t=e[1],s=e[2],a=e[3],i=e[4],d=e[5]);const n=i===void 0?"left":i,o=d===void 0?"sidebar":d,{isMobile:h,state:u,openMobile:g,setOpenMobile:c}=O();if(h){let C;e[6]===Symbol.for("react.memo_cache_sentinel")?(C={"--sidebar-width":K},e[6]=C):C=e[6];let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=r.jsxs(F,{className:"sr-only",children:[r.jsx(G,{children:"Sidebar"}),r.jsx(L,{children:"Displays the mobile sidebar."})]}),e[7]=_):_=e[7];let $;e[8]!==t?($=r.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let M;e[10]!==n||e[11]!==$?(M=r.jsxs(q,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:C,side:n,children:[_,$]}),e[10]=n,e[11]=$,e[12]=M):M=e[12];let I;return e[13]!==g||e[14]!==a||e[15]!==c||e[16]!==M?(I=r.jsx(W,{open:g,onOpenChange:c,...a,children:M}),e[13]=g,e[14]=a,e[15]=c,e[16]=M,e[17]=I):I=e[17],I}const b=u==="expanded",N=b?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let f;e[18]!==N?(f=w("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",N),e[18]=N,e[19]=f):f=e[19];const j=b?void 0:"icon",y=b?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let m;e[20]!==s||e[21]!==y?(m=w("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",y,s),e[20]=s,e[21]=y,e[22]=m):m=e[22];let p;e[23]!==t?(p=r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=p):p=e[24];let v;e[25]!==a||e[26]!==m||e[27]!==p?(v=r.jsx("div",{"data-slot":"sidebar-container",className:m,...a,children:p}),e[25]=a,e[26]=m,e[27]=p,e[28]=v):v=e[28];let x;return e[29]!==n||e[30]!==u||e[31]!==f||e[32]!==j||e[33]!==v||e[34]!==o?(x=r.jsx("div",{className:f,"data-state":u,"data-collapsible":j,"data-variant":o,"data-side":n,"data-slot":"sidebar",children:v}),e[29]=n,e[30]=u,e[31]=f,e[32]=j,e[33]=v,e[34]=o,e[35]=x):x=e[35],x}function re(l){const e=S.c(18);let t,s,a;e[0]!==l?({className:t,onClick:s,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const{toggleSidebar:i}=O();let d;e[4]!==t?(d=w("size-7",t),e[4]=t,e[5]=d):d=e[5];let n;e[6]!==s||e[7]!==i?(n=b=>{s?.(b),i()},e[6]=s,e[7]=i,e[8]=n):n=e[8];let o,h;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(R,{}),h=r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=o,e[10]=h):(o=e[9],h=e[10]);let u;e[11]!==a||e[12]!==d||e[13]!==n?(u=r.jsx(E,{asChild:!0,children:r.jsxs(P,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:d,onClick:n,...a,children:[o,h]})}),e[11]=a,e[12]=d,e[13]=n,e[14]=u):u=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsxs(B,{side:"bottom",className:"flex items-center gap-1.5",children:["Collapse sidebar",r.jsx("span",{className:"flex items-center gap-0.5",children:["⌘","B"].map(X)})]}),e[15]=g):g=e[15];let c;return e[16]!==u?(c=r.jsx(D,{delayDuration:300,children:r.jsxs(z,{children:[u,g]})}),e[16]=u,e[17]=c):c=e[17],c}function X(l){return r.jsx("kbd",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1 rounded-sm border border-white/20 bg-white/10 text-white/70 text-xs font-mono",children:l},l)}function ne(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function oe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function de(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ce(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("h-4 m-0! w-full",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-sidebar":"separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function fe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function ue(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function pe(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("w-full text-sm overflow-visible",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function be(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}function me(l){const e=S.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=w("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==s||e[6]!==a?(i=r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=i):i=e[7],i}const Y=H("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm outline-0 outline-sidebar-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none focus-visible:outline-2 focus-visible:-outline-offset-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:w-full! group-data-[state=collapsed]/sidebar:aspect-square! group-data-[state=collapsed]/sidebar:max-w-[calc(var(--sidebar-width-icon)-1rem)]! group-data-[state=collapsed]/sidebar:h-auto! group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function xe(l){const e=S.c(28);let t,s,a,i,d,n,o;e[0]!==l?({asChild:a,isActive:i,variant:d,size:n,tooltip:o,className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=i,e[5]=d,e[6]=n,e[7]=o):(t=e[1],s=e[2],a=e[3],i=e[4],d=e[5],n=e[6],o=e[7]);const h=a===void 0?!1:a,u=i===void 0?!1:i,g=d===void 0?"default":d,c=n===void 0?"default":n,b=h?A:"button",{isMobile:N}=O();let f;e[8]!==t||e[9]!==c||e[10]!==g?(f=w(Y({variant:g,size:c}),t),e[8]=t,e[9]=c,e[10]=g,e[11]=f):f=e[11];let j;e[12]!==b||e[13]!==u||e[14]!==s||e[15]!==c||e[16]!==f?(j=r.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":c,"data-active":u,className:f,...s}),e[12]=b,e[13]=u,e[14]=s,e[15]=c,e[16]=f,e[17]=j):j=e[17];const y=j;if(!o)return y;if(typeof o=="string"){let x;e[18]!==o?(x={children:o},e[18]=o,e[19]=x):x=e[19],o=x}let m;e[20]!==y?(m=r.jsx(E,{asChild:!0,children:y}),e[20]=y,e[21]=m):m=e[21];let p;e[22]!==N||e[23]!==o?(p=r.jsx(B,{side:"right",align:"center",hidden:N,...o}),e[22]=N,e[23]=o,e[24]=p):p=e[24];let v;return e[25]!==m||e[26]!==p?(v=r.jsxs(z,{children:[m,p]}),e[25]=m,e[26]=p,e[27]=v):v=e[27],v}export{me as S,xe as a,ue as b,pe as c,be as d,ce as e,fe as f,le as g,oe as h,de as i,ne as j,ie as k,se as l,re as m,O as u};
@@ -1 +0,0 @@
1
- import{w as D,r as v,j as e,B as p,s as S,t as c,c as N}from"./index-20lo5teZ.js";import{D as k}from"./domain-settings-m1b0eyH2.js";import{P as f}from"./index-BoBbtnrJ.js";import{I as l}from"./input-D2VJ6ahm.js";import{S as z}from"./switch-BOUA2FBT.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-D9H6UI9E.js";import{c as F,S as y,a as C,b as r,d as O}from"./settings-section-CP7jibDA.js";import{s as L}from"./Trash01-BfKdeD7S.js";import{R as q}from"./require-capability-BMiu3VbE.js";import"./studio-tools-DqPhjgPW.js";import"./badge-C9MXVg0W.js";import"./select-C0AEr1SL.js";import"./index-BdQq_4o_.js";import"./tooltip-B_mKOQvv.js";import"./ChevronUp-BDbnz61t.js";import"./ChevronDown-aoqAeXtt.js";import"./sidebar-Cx68CPJi.js";import"./LayoutLeft-DjTexk5_.js";import"./sheet-BBGbheOC.js";import"./X-Ciyf96Wa.js";import"./card-mAs4nLtf.js";import"./ArrowUpRight-BfxsIWO1.js";import"./use-capability-C1-FHW22.js";import"./access-gate-DelGJZFm.js";import"./capability-load-error-sRyEFexC.js";function B(){const{org:s}=D(),{data:a,isLoading:E}=P(s.id,s.slug),x=R(s.id,s.slug),h=A(s.id,s.slug),j=T(s.id,s.slug),[t,d]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[m,g]=v.useState(!1),u=a?.configured&&a.config,o=a?.config,I=()=>{o&&d({issuer:o.issuer,clientId:o.clientId,clientSecret:"",discoveryEndpoint:o.discoveryEndpoint??"",domain:o.domain,scopes:o.scopes.join(" ")}),g(!0)},w=async()=>{if(!t.issuer||!t.clientId||!t.domain){c.error("Issuer, Client ID, and Domain are required");return}if(!u&&!t.clientSecret){c.error("Client Secret is required for initial setup");return}try{await x.mutateAsync({issuer:t.issuer,clientId:t.clientId,clientSecret:t.clientSecret,discoveryEndpoint:t.discoveryEndpoint||void 0,scopes:t.scopes.split(/\s+/).filter(Boolean),domain:t.domain,enforced:o?.enforced??!1}),S(u?"sso_config_updated":"sso_configured",{organization_id:s.id,email_domain:t.domain}),c.success("SSO configuration saved"),g(!1)}catch(i){c.error(i instanceof Error?i.message:"Failed to save SSO config")}},b=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await h.mutateAsync(),S("sso_config_removed",{organization_id:s.id}),c.success("SSO configuration removed"),g(!1)}catch{c.error("Failed to remove SSO config")}},_=async i=>{try{await j.mutateAsync(i),S("sso_enforcement_toggled",{organization_id:s.id,enforced:i}),c.success(i?"SSO enforcement enabled":"SSO enforcement disabled")}catch{c.error("Failed to toggle SSO enforcement")}};return e.jsx(f,{children:e.jsx(f.Content,{children:e.jsx(f.Body,{children:e.jsxs(F,{children:[e.jsx(f.Title,{children:"Security"}),e.jsx(k,{}),E?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[u&&!m&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Provider",action:e.jsx("span",{className:"font-medium",children:o.issuer})}),e.jsx(r,{title:"Client ID",action:e.jsx("span",{className:"font-mono text-xs",children:o.clientId})}),e.jsx(r,{title:"Domain",action:e.jsx("span",{className:"font-medium",children:o.domain})}),e.jsx(r,{title:"Scopes",action:e.jsx("span",{className:"font-mono text-xs",children:o.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(r,{title:"Enforce SSO",description:"Require all members to authenticate via SSO",action:e.jsx(z,{checked:o.enforced,onCheckedChange:_,disabled:j.isPending})}),e.jsxs(O,{children:[e.jsxs(p,{variant:"ghost",size:"sm",onClick:b,disabled:h.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(L,{size:14}),"Remove"]}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${s.slug}/sso/authorize`,"_blank")},children:"Test SSO"}),e.jsx(p,{variant:"outline",size:"sm",onClick:I,children:"Edit configuration"})]})]})}),(!u||m)&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Issuer URL",description:"The OIDC issuer URL of your identity provider.",action:e.jsx(l,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:t.issuer,onChange:i=>d(n=>({...n,issuer:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client ID",action:e.jsx(l,{id:"sso-client-id",placeholder:"your-client-id",value:t.clientId,onChange:i=>d(n=>({...n,clientId:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client Secret",description:m&&u?"Leave empty to keep current":void 0,action:e.jsx(l,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:t.clientSecret,onChange:i=>d(n=>({...n,clientSecret:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Email Domain",description:"The email domain this SSO provider covers.",action:e.jsx(l,{id:"sso-domain",placeholder:"company.com",value:t.domain,onChange:i=>d(n=>({...n,domain:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Scopes",action:e.jsx(l,{id:"sso-scopes",placeholder:"openid email profile",value:t.scopes,onChange:i=>d(n=>({...n,scopes:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Discovery Endpoint",description:"Optional — auto-detected from issuer if omitted.",action:e.jsx(l,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:t.discoveryEndpoint,onChange:i=>d(n=>({...n,discoveryEndpoint:i.target.value})),className:"w-[280px]"})}),e.jsxs(O,{children:[m&&e.jsx(p,{variant:"outline",size:"sm",onClick:()=>g(!1),children:"Cancel"}),e.jsx(p,{onClick:w,disabled:x.isPending,size:"sm",children:x.isPending?"Saving...":m?"Update":"Configure SSO"})]})]})})]})]})})})})}function ue(){const s=N.c(1);let a;return s[0]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx(q,{capability:"org:manage",area:"security",children:e.jsx(B,{})}),s[0]=a):a=s[0],a}export{ue as default};
@@ -1 +0,0 @@
1
- import{c as D,j as s,E as le,r as K,w as ae,m as ce,b as de,e as me,B as Y,s as te,K as fe,d as ge,t as ie}from"./index-20lo5teZ.js";import{i as ue}from"./AlertCircle-ChcBH14n.js";import{i as pe}from"./ChevronRight-CUGhm8E7.js";import{s as xe}from"./Plus-BEdvqzrP.js";import{s as he}from"./Trash01-BfKdeD7S.js";import{I as X}from"./input-D2VJ6ahm.js";import{S as oe}from"./switch-BOUA2FBT.js";import{S as ye}from"./skeleton-CVRpN7O3.js";import{A as ne}from"./avatar-BLEdyY7-.js";import{P as je,a as Ce,b as Se}from"./popover-CHlLC07g.js";import{b as re}from"./use-connection-D-7QpVUJ.js";import{W as Z}from"./use-mcp-client-CxXf5rsq.js";import{P as G}from"./index-BoBbtnrJ.js";import{u as ve}from"./use-registry-connections-jcbA10JV.js";import{f as _e,g as be}from"./use-organization-settings-CTH2EptF.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-CP7jibDA.js";import{R as Re}from"./require-capability-BMiu3VbE.js";import"./User01-DxWsEbM9.js";import"./use-collections-74mCujh3.js";import"./auth-Ci2ZRRcb.js";import"./sidebar-Cx68CPJi.js";import"./LayoutLeft-DjTexk5_.js";import"./tooltip-B_mKOQvv.js";import"./sheet-BBGbheOC.js";import"./X-Ciyf96Wa.js";import"./studio-tools-DqPhjgPW.js";import"./card-mAs4nLtf.js";import"./ArrowUpRight-BfxsIWO1.js";import"./use-capability-C1-FHW22.js";import"./access-gate-DelGJZFm.js";import"./capability-load-error-sRyEFexC.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let U;t[20]!==n||t[21]!==r?(U=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=U):U=t[22];const H=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let q;t[37]!==W||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:$e,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function $e(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function gt(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{gt as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BdK58T7U.js","assets/index-20lo5teZ.js","assets/index-rS_HhTdz.css","assets/XCircle-ovYWqZM6.js","assets/CheckCircle-Cm1GnmVj.js","assets/Settings02-BIpY6Zhb.js","assets/use-mcp-client-CxXf5rsq.js","assets/auth-Ci2ZRRcb.js","assets/useInfiniteQuery-CWme5rGZ.js","assets/use-infinite-scroll-hOEUoZD8.js","assets/studio-tools-DqPhjgPW.js","assets/badge-C9MXVg0W.js","assets/input-D2VJ6ahm.js","assets/dropdown-menu-DBXGBAAP.js","assets/ChevronUp-BDbnz61t.js","assets/ChevronRight-CUGhm8E7.js","assets/DotsVertical-BcvtEj5g.js","assets/table-hboPJhBa.js","assets/toggle-group-Db5bABta.js","assets/use-view-mode-DdtTz0AS.js","assets/tooltip-B_mKOQvv.js","assets/FilterLines-DTI31VpW.js","assets/Globe01-CTIuSSD9.js","assets/SearchMd-DK3hZUVF.js","assets/dialog-DtA5oh9D.js","assets/X-Ciyf96Wa.js","assets/AlertCircle-ChcBH14n.js","assets/Upload01-T8pN8jBP.js","assets/alert-dialog-CKnoCFTw.js","assets/card-mAs4nLtf.js","assets/Trash01-BfKdeD7S.js","assets/label-Xkc4XdLq.js","assets/select-C0AEr1SL.js","assets/index-BdQq_4o_.js","assets/ChevronDown-aoqAeXtt.js","assets/switch-BOUA2FBT.js","assets/textarea-BqMqcZIm.js","assets/checkbox-B9vj-Cdf.js","assets/Eye-BhqO9K0O.js","assets/LinkExternal01-COQYOgEI.js","assets/use-copy-D6L-AQL_.js","assets/Key01-bDEyn58I.js","assets/Plus-BEdvqzrP.js","assets/mcp-oauth-CsZ919dh.js","assets/Play-Dl0pf4M6.js"])))=>i.map(i=>d[i]);
2
- import{c as m,b as n,e as c,j as t,i as p,r as l,al as f}from"./index-20lo5teZ.js";import{R as u}from"./require-capability-BMiu3VbE.js";import"./use-capability-C1-FHW22.js";import"./access-gate-DelGJZFm.js";import"./capability-load-error-sRyEFexC.js";const g=l.lazy(()=>f(()=>import("./registry-layout-BdK58T7U.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{r as a,j as c,U as H,aj as Q,a2 as ee,a3 as te,Z as $,T as oe,V as C,Y as G,a1 as re,W as V,_ as ne,$ as se,X as ae,dy as ie,a0 as le,c as _,l as ce}from"./index-20lo5teZ.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",z=a.forwardRef((o,e)=>c.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));z.displayName=de;var pe=z,[O]=ae("Tooltip",[V]),D=V(),B="TooltipProvider",fe=700,A="tooltip.open",[ve,k]=O(B),F=o=>{const{__scopeTooltip:e,delayDuration:t=fe,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,i=a.useRef(!0),d=a.useRef(!1),l=a.useRef(0);return a.useEffect(()=>{const p=l.current;return()=>window.clearTimeout(p)},[]),c.jsx(ve,{scope:e,isOpenDelayedRef:i,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=B;var R="Tooltip",[he,j]=O(R),Y=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:i,delayDuration:d}=o,l=k(R,o.__scopeTooltip),p=D(e),[u,v]=a.useState(null),h=Q(),f=a.useRef(0),x=i??l.disableHoverableContent,m=d??l.delayDuration,g=a.useRef(!1),[y,T]=ee({prop:r,defaultProp:n??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),s?.(S)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),N=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(te,{...p,children:c.jsx(he,{scope:e,contentId:h,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayedRef.current?N():E()},[l.isOpenDelayedRef,N,E]),onTriggerLeave:a.useCallback(()=>{x?P():(window.clearTimeout(f.current),f.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:t})})};Y.displayName=R;var M="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=j(M,t),s=k(M,t),i=D(t),d=a.useRef(null),l=$(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(oe,{asChild:!0,...i,children:c.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:l,onPointerMove:C(o.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=M;var I="TooltipPortal",[xe,ge]=O(I,{forceMount:void 0}),W=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=j(I,e);return c.jsx(xe,{scope:e,forceMount:t,children:c.jsx(G,{present:t||s.open,children:c.jsx(re,{asChild:!0,container:n,children:r})})})};W.displayName=I;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=ge(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,i=j(b,o.__scopeTooltip);return c.jsx(G,{present:r||i.open,children:i.disableHoverableContent?c.jsx(X,{side:n,...s,ref:e}):c.jsx(me,{side:n,...s,ref:e})})}),me=a.forwardRef((o,e)=>{const t=j(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=$(e,n),[i,d]=a.useState(null),{trigger:l,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},T=be(y,g.getBoundingClientRect()),w=we(y,T),E=Ee(m.getBoundingClientRect()),P=Re([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(l&&u){const x=g=>f(g,u),m=g=>f(g,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,f,h]),a.useEffect(()=>{if(i){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=l?.contains(g)||u?.contains(g),w=!Pe(y,i);T?h():w&&(h(),p())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,i,p,h]),c.jsx(X,{...o,ref:s})}),[Te,ye]=O(R,{isInside:!1}),Ce=ie("TooltipContent"),X=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:i,...d}=o,l=j(b,t),p=D(t),{onClose:u}=l;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(l.trigger){const v=h=>{h.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[l.trigger,u]),c.jsx(ne,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(se,{"data-state":l.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Ce,{children:r}),c.jsx(Te,{scope:t,isInside:!0,children:c.jsx(pe,{id:l.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var K="TooltipArrow",Z=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return ye(K,t).isInside?null:c.jsx(le,{...n,...r,ref:e})});Z.displayName=K;function be(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function we(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Ee(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function Pe(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const d=e[s],l=e[i],p=d.x,u=d.y,v=l.x,h=l.y;u>r!=h>r&&t<(v-p)*(r-u)/(h-u)+p&&(n=!n)}return n}function Re(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),_e(e)}function _e(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(n.y-i.y)>=(s.y-i.y)*(n.x-i.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(n.y-i.y)>=(s.y-i.y)*(n.x-i.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var je=F,Oe=Y,De=U,Le=W,Ae=q,Me=Z;const J=768,L=()=>globalThis.innerWidth<J;function Ne(){const o=_.c(2),[e,t]=a.useState(L);let r,n;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const s=()=>t(L),i=globalThis.matchMedia(`(max-width: ${J-1}px)`);return i.addEventListener("change",s),t(L),()=>i.removeEventListener("change",s)},n=[],o[0]=r,o[1]=n):(r=o[0],n=o[1]),a.useEffect(r,n),e}function ke(o){const e=_.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(je,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Se(o){const e=_.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(ke,{children:c.jsx(Oe,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function He(o){const e=_.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(De,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function $e(o){const e=_.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const i=s===void 0?0:s;let d;e[5]!==r?(d=ce("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(Me,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=l):l=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==i||e[11]!==d?(p=c.jsx(Le,{children:c.jsxs(Ae,{"data-slot":"tooltip-content",sideOffset:i,className:d,...n,children:[t,l]})}),e[8]=t,e[9]=n,e[10]=i,e[11]=d,e[12]=p):p=e[12],p}export{He as T,ue as V,$e as a,Se as b,ke as c,Ne as u};
@@ -1 +0,0 @@
1
- import{c as p,r as f}from"./index-20lo5teZ.js";import{u as w}from"./tooltip-B_mKOQvv.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-hOEUoZD8.js";import{cJ as i}from"./index-20lo5teZ.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-hOEUoZD8.js";import{cJ as u,am as n}from"./index-20lo5teZ.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +0,0 @@
1
- import{c as V,r as U,j as o,l as J,B as Y}from"./index-20lo5teZ.js";import{T as et,f as ct}from"./agent-icon-Bk1Ofbdo.js";import{n as mt}from"./ChevronLeft-CoW1IpXE.js";import{i as dt}from"./ChevronRight-CUGhm8E7.js";import{L as ft}from"./label-Xkc4XdLq.js";import{S as nt}from"./scroll-area-BlJNYaPT.js";import{S as pt}from"./switch-BOUA2FBT.js";import{T as ut,b as ht,a as gt}from"./tooltip-B_mKOQvv.js";import{V as xt}from"./view-mode-toggle-BZ52Zalr.js";import"./AlertCircle-ChcBH14n.js";import"./Tool01-DcPFccxt.js";import"./SwitchHorizontal01-EOva-Jpw.js";import"./Settings02-BIpY6Zhb.js";import"./XCircle-ovYWqZM6.js";import"./ArrowUpRight-BfxsIWO1.js";import"./ZapSquare-BlfnVn5C.js";import"./Users03-NRaUurHt.js";import"./CheckCircle-Cm1GnmVj.js";import"./ChevronUp-BDbnz61t.js";import"./ChevronDown-aoqAeXtt.js";import"./DotsVertical-BcvtEj5g.js";import"./Stars02-C-addu2P.js";import"./Eye-BhqO9K0O.js";import"./ZoomOut-C-l0YUGT.js";import"./Globe01-CTIuSSD9.js";import"./FilterLines-DTI31VpW.js";import"./Star01-HcsxMzHs.js";import"./Globe04-Dy3PA2Yl.js";import"./HardDrive-DYVC-Zaq.js";import"./Key01-bDEyn58I.js";import"./LayoutLeft-DjTexk5_.js";import"./LinkExternal01-COQYOgEI.js";import"./Monitor01-DV9tmVAF.js";import"./Sun-B11PPq5-.js";import"./Palette-CD1fLCtB.js";import"./Play-Dl0pf4M6.js";import"./Plus-BEdvqzrP.js";import"./SearchMd-DK3hZUVF.js";import"./Shield01-Dx8gqKG5.js";import"./Stars01-VD9js_iZ.js";import"./Trash01-BfKdeD7S.js";import"./Upload01-T8pN8jBP.js";import"./User01-DxWsEbM9.js";import"./Users01-C7ItyIdk.js";import"./XClose-m9X1QqKX.js";import"./X-Ciyf96Wa.js";import"./Zap-Bci_Afjv.js";import"./use-clock-tick-DvWNr9a0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D6L-AQL_.js";import"./file-type-icon-3wYgaJ1f.js";import"./dialog-DtA5oh9D.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Cms0eXYe.js";import"./use-mcp-client-CxXf5rsq.js";import"./auth-Ci2ZRRcb.js";import"./chat-context-BdyPsWKn.js";import"./hooks-BdXI0ZZ7.js";import"./decopilot-sse-pool-DhvSomLP.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CwSMwdwq.js";import"./use-collections-74mCujh3.js";import"./use-ai-providers-BFPg4Nao.js";import"./studio-tools-DqPhjgPW.js";import"./use-organization-settings-CTH2EptF.js";import"./shell-layout-xhRX4rsB.js";import"./avatar-BLEdyY7-.js";import"./required-auth-layout-hnMHneNT.js";import"./use-org-sso-D9H6UI9E.js";import"./sheet-BBGbheOC.js";import"./integration-icon-62cL4F-8.js";import"./use-navigate-to-agent-D8CoEyF3.js";import"./use-connection-D-7QpVUJ.js";import"./use-mcp-prompts-CqbI2uxQ.js";import"./form-BPgAGzjC.js";import"./input-D2VJ6ahm.js";import"./index-BdQq_4o_.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:n}=e,r=typeof t=="string",l=typeof n=="string";if(!r&&!l)return null;const s=r?new Date(t):Tt,m=l?new Date(n):vt;return Number.isNaN(s.getTime())||Number.isNaN(m.getTime())||r&&l&&m.getTime()<=s.getTime()?null:{start:s,end:m,openStart:!r,openEnd:!l}}function rt(e,t){if(!e||typeof e!="object")return;const n=e.__resolveType;if(typeof n=="string"){if(bt.has(n)){const r=kt(e);r&&t.push(r);return}if(yt.has(n)){const r=e.matchers;if(Array.isArray(r))for(const l of r)rt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const n=e.variants;return Array.isArray(n)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),d=i[i.length-1];if(d)return decodeURIComponent(d)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,n=t.config,l=t.desktop?.media,s=[t.title,t.name,t.label,t.alt,n?.title,n?.name,n?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of s)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function St(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];typeof r=="number"?t.length>0?t[t.length-1]+=`[${r}]`:t.push(`[${r}]`):t.push(r)}return t.join(" · ")}function W(e,t,n,r,l){if(_t(e)){const s=e.variants,m=e.__resolveType,a=Nt.test(m)?"":St(r);s.forEach((c,i)=>{if(!c||typeof c!="object")return;const d=c,f=[];if(rt(d.rule,f),f.length===0)return;const x=Mt(d.value)??(a||n);for(const h of f)l.push({blockKey:t,blockLabel:n,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<s.length;c++){const i=s[c];i&&typeof i=="object"&&W(i.value,t,n,[...r,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let s=0;s<e.length;s++)W(e[s],t,n,[...r,s],l);return}if(e&&typeof e=="object")for(const[s,m]of Object.entries(e))s!=="__resolveType"&&W(m,t,n,[...r,s],l)}function Et(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e))W(r,n,wt(n),[],t);return t.sort((n,r)=>n.start.getTime()-r.start.getTime())}function At(e){const t=[...new Set(e)].sort(),n=new Map;return t.forEach((r,l)=>{const s=l*137.508%360;n.set(r,{bg:`oklch(0.62 0.14 ${s})`,text:"white",border:`oklch(0.50 0.14 ${s})`})}),n}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function st(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ot=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),n=[];for(let r=0;r<6;r++){const l=[];for(let s=0;s<7;s++)l.push(z(t,r*7+s));n.push(l)}for(;n.length>0&&n[n.length-1].every(r=>r.getMonth()!==e.getMonth());)n.pop();return n}function Lt(e,t){const n=P(e[0]),r=z(n,7),l=n.getTime(),s=r.getTime(),m=[];for(const i of t){const d=P(i.start),f=P(i.end);if(f.getTime()<n.getTime()||d.getTime()>=r.getTime())continue;const u=d.getTime()<n.getTime()?n:d,x=f.getTime()>=r.getTime()?z(r,-1):f,h=K(u,n),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),s),T=q(new Date(b),n),p=Math.max(q(new Date(y),n)-T,0);p<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:p})}m.sort((i,d)=>i.startCol-d.startCol||d.span-i.span||i.variant.blockKey.localeCompare(d.variant.blockKey));const a=[],c=[];for(const i of m){let d=a.findIndex(f=>f<=i.startCol);d===-1&&(d=a.length,a.push(0)),a[d]=i.startCol+i.span,c.push({...i,lane:d})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),n=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${n}`}function Pt(e){const t=V.c(17),{variant:n}=e;let r;t[0]!==n.blockLabel?(r=o.jsx("div",{className:"font-semibold",children:n.blockLabel}),t[0]=n.blockLabel,t[1]=r):r=t[1];let l;t[2]!==n.innerPath?(l=n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.innerPath}),t[2]=n.innerPath,t[3]=l):l=t[3];let s;t[4]!==n.blockLabel||t[5]!==n.innerPath||t[6]!==n.label?(s=n.label!==n.blockLabel&&n.label!==n.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:n.label}),t[4]=n.blockLabel,t[5]=n.innerPath,t[6]=n.label,t[7]=s):s=t[7];let m;t[8]!==n?(m=Ot(n),t[8]=n,t[9]=m):m=t[9];let a;t[10]!==m?(a=o.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==r||t[13]!==l||t[14]!==s||t[15]!==a?(c=o.jsx(gt,{children:o.jsxs("div",{className:"text-xs",children:[r,l,s,a]})}),t[12]=r,t[13]=l,t[14]=s,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const n=e?"transparent":"#000 0",r=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${n}, #000 ${X}px, #000 calc(100% - ${X}px), ${r})`}function lt(e){const t=V.c(26),{variant:n,color:r,style:l,children:s,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let d;t[0]!==i||t[1]!==c?(d=It(c,i),t[0]=i,t[1]=c,t[2]=d):d=t[2];const f=d;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==f?(h=f&&{maskImage:f,WebkitMaskImage:f},t[7]=f,t[8]=h):h=t[8];let g;t[9]!==r.bg||t[10]!==r.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:r.bg,color:r.text,borderRadius:4,...u,...x,...h,...l},t[9]=r.bg,t[10]=r.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==s?(b=o.jsx("span",{className:"truncate",children:s}),t[16]=s,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==n?(T=o.jsx(Pt,{variant:n}),t[21]=n,t[22]=T):T=t[22];let p;return t[23]!==T||t[24]!==y?(p=o.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=p):p=t[25],p}function kn(e){const t=V.c(49),{decofile:n}=e,[r,l]=U.useState("calendar"),[s,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,d,f;if(t[0]!==n||t[1]!==a){const E=Et(n);i=E.filter(Ht).length,f=a?E:E.filter(Vt),d=At(f.map(Ft)),t[0]=n,t[1]=a,t[2]=i,t[3]=d,t[4]=f}else i=t[2],d=t[3],f=t[4];const u=d;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==r?(g=()=>m(E=>r==="calendar"?F(E,-1):F(E,-3)),t[6]=r,t[7]=g):g=t[7];const b=g;let y;t[8]!==r?(y=()=>m(E=>r==="calendar"?F(E,1):F(E,3)),t[8]=r,t[9]=y):y=t[9];const T=y;let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=p):p=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(dt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=o.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=ot[s.getMonth()];let S;t[17]!==s?(S=s.getFullYear(),t[17]=s,t[18]=S):S=t[18];let v;t[19]!==A||t[20]!==S?(v=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",S]}),t[19]=A,t[20]=S,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[p,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(pt,{id:"show-ongoing",checked:a,onCheckedChange:c}),o.jsxs(ft,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:o.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:o.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==r?(N=o.jsx(xt,{value:r,onValueChange:l,options:I}),t[31]=r,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=o.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=o.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==s||t[41]!==i||t[42]!==a||t[43]!==f||t[44]!==r?(C=f.length===0?o.jsx(Wt,{hiddenOngoing:a?0:i}):r==="calendar"?o.jsx(Ut,{monthStart:s,variants:f,colorMap:u}):o.jsx(Jt,{monthStart:s,variants:f,colorMap:u}),t[39]=u,t[40]=s,t[41]=i,t[42]=a,t[43]=f,t[44]=r,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:n}=e,r=n===void 0?0:n;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let s;return t[1]!==r?(s=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,r>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No dated variants in view."}),o.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[r," ongoing"," ",r===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:"No scheduled variants."}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=r,t[2]=s):s=t[2],s}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:n,variants:r,colorMap:l}=e;let s,m,a,c,i;if(t[0]!==l||t[1]!==n||t[2]!==r){const u=Rt(n),x=P(new Date);s=nt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,r),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((p,w)=>{const k=p.getMonth()===n.getMonth(),_=p.getTime()===x.getTime();return o.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:p.getDate()})},w)}),b.map((p,w)=>{const k=st(l,p.variant.blockKey),_=tt+p.lane*(G+Z),M=p.leftUnits/7*100,A=p.widthUnits/7*100,S=p.variant.openStart&&g===0,v=p.variant.openEnd&&g===u.length-1;return o.jsxs(lt,{variant:p.variant,color:k,fadeStart:S,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[p.variant.blockLabel,p.variant.label!==p.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",p.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=n,t[2]=r,t[3]=s,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else s=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let d;t[9]!==m||t[10]!==a||t[11]!==c?(d=o.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=d):d=t[12];let f;return t[13]!==s||t[14]!==i||t[15]!==d?(f=o.jsx(s,{className:i,children:d}),t[13]=s,t[14]=i,t[15]=d,t[16]=f):f=t[16],f}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:n,variants:r,colorMap:l}=e,s=n;let m,a,c,i,d,f;if(t[0]!==l||t[1]!==n||t[2]!==s||t[3]!==r){const h=F(n,B),g=new Date,b=new Map;for(const v of r){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-s.getTime(),p=v=>(Math.max(s.getTime(),Math.min(h.getTime(),v.getTime()))-s.getTime())/T*100;let w;t[10]!==s?(w=(v,j)=>F(s,j),t[10]=s,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=s.getTime()&&g.getTime()<=h.getTime()?p(g):null;m=nt,f="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const S=k.map(Qt);t[14]!==S?(c=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,o.jsx("div",{className:"flex-1 grid",style:A,children:S})]}),t[14]=S,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],d=y.map(v=>{const[j,D]=v,L=st(l,j),I=D[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),s.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=p(new Date($)),E=p(new Date(C))-O;return o.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${E}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=n,t[2]=s,t[3]=r,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=d,t[9]=f}else m=t[4],a=t[5],c=t[6],i=t[7],d=t[8],f=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==d?(u=o.jsxs("div",{className:a,children:[c,i,d]}),t[18]=a,t[19]=c,t[20]=i,t[21]=d,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==f||t[25]!==u?(x=o.jsx(m,{className:f,children:u}),t[23]=m,t[24]=f,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ot[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{kn as VariantCalendar};