decocms 4.50.1 → 4.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/dist/client/assets/{AlertCircle-DvQdKX2P.js → AlertCircle-Ct7weZuE.js} +1 -1
  2. package/dist/client/assets/ArrowUp-CLqVzt5Z.js +1 -0
  3. package/dist/client/assets/{ArrowUpRight-C4ZUgCv8.js → ArrowUpRight-gaoM5S0k.js} +1 -1
  4. package/dist/client/assets/{Check-DT0Ecfph.js → Check-C6rOtSdY.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-B3kM3-nx.js → CheckCircle-CREoH7p2.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-BL5D5Kww.js → ChevronDown-BfrTp1Ch.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Brlyqvfv.js → ChevronRight-CvPpz1Nq.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D4h43NMl.js → ChevronUp-MSW-WrWs.js} +1 -1
  9. package/dist/client/assets/{Circle-gozopXYF.js → Circle-ow_NDQHR.js} +1 -1
  10. package/dist/client/assets/{Copy01-DVjpmGSQ.js → Copy01-DDhuzJaA.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CuOtMg5m.js → DotsVertical-CB7QN8Ws.js} +1 -1
  12. package/dist/client/assets/{Eye-cte0MnVy.js → Eye-C1XDNiGB.js} +1 -1
  13. package/dist/client/assets/{FilterLines-B1MBg_Jt.js → FilterLines-eP80xxCy.js} +1 -1
  14. package/dist/client/assets/{Globe01-fOy2mEYg.js → Globe01-3_GHOe2E.js} +1 -1
  15. package/dist/client/assets/{Globe04-BhuakAIf.js → Globe04-BAF3P1k9.js} +1 -1
  16. package/dist/client/assets/{HardDrive-DKydDUbm.js → HardDrive-DW6eIDxP.js} +1 -1
  17. package/dist/client/assets/{Key01-BhnYqbq5.js → Key01-BVXgUn29.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-CIXRhIgm.js → LayoutLeft-DKGWBMNA.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-Br3p9c4J.js → LinkExternal01-BM0S_VFU.js} +1 -1
  20. package/dist/client/assets/{List-DZFJgfGO.js → List-vHTogdj7.js} +1 -1
  21. package/dist/client/assets/{Loading02-BYDO_yva.js → Loading02-Bt_dLUWn.js} +1 -1
  22. package/dist/client/assets/{Monitor01-8NNEYlGa.js → Monitor01-2j67L_aU.js} +1 -1
  23. package/dist/client/assets/{Palette-BEYm0oRU.js → Palette-D5rmfc3a.js} +1 -1
  24. package/dist/client/assets/{Play-BAkY7Fxv.js → Play-Bv09TV2w.js} +1 -1
  25. package/dist/client/assets/{Plus-BWS7YRCt.js → Plus-D9m58hN2.js} +1 -1
  26. package/dist/client/assets/{SearchLg-sYqeRxUE.js → SearchLg-6CR82X0W.js} +1 -1
  27. package/dist/client/assets/{SearchMd-D3a2hIUP.js → SearchMd-BfevlctH.js} +1 -1
  28. package/dist/client/assets/{Settings02-CJWk9pL-.js → Settings02-f8loRSef.js} +1 -1
  29. package/dist/client/assets/{Shield01-1T25s-tn.js → Shield01-DPzSiB-T.js} +1 -1
  30. package/dist/client/assets/{Star01-LBoyDaKY.js → Star01-DoabU7Hn.js} +1 -1
  31. package/dist/client/assets/{Stars01-5MzsUK6G.js → Stars01-Q9LxQc27.js} +1 -1
  32. package/dist/client/assets/{Stars02-H_ePh5tT.js → Stars02-DaEgHmQI.js} +1 -1
  33. package/dist/client/assets/{Sun-DvwmIRmO.js → Sun-CclxevtX.js} +1 -1
  34. package/dist/client/assets/SwitchHorizontal01-sGYV2dsM.js +1 -0
  35. package/dist/client/assets/{Tool01-BFRbBZqm.js → Tool01-Bfw6sadd.js} +1 -1
  36. package/dist/client/assets/{Trash01-CqJAv-4z.js → Trash01-TYv08n93.js} +1 -1
  37. package/dist/client/assets/{Upload01-BEmoOwcr.js → Upload01-bdtJr5BI.js} +1 -1
  38. package/dist/client/assets/{User01-Ckt1oKpR.js → User01-BZEdjS8N.js} +1 -1
  39. package/dist/client/assets/{Users01-C3ZswPLc.js → Users01-D0TsDHjS.js} +1 -1
  40. package/dist/client/assets/{Users03-BQZ9UhFk.js → Users03-B4feTEaY.js} +1 -1
  41. package/dist/client/assets/{X-CAX-FceB.js → X-CJDTMZdu.js} +1 -1
  42. package/dist/client/assets/{XCircle-D6yhOy3u.js → XCircle-F9-2oAiq.js} +1 -1
  43. package/dist/client/assets/{XClose-DuZ4u7Uu.js → XClose-BKoSgWfP.js} +1 -1
  44. package/dist/client/assets/{Zap-DWMv1jO1.js → Zap-GCvYK6cT.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-do_RxxO8.js → ZapSquare-BBu4b6r_.js} +1 -1
  46. package/dist/client/assets/{ZoomOut-DK6J-pHc.js → ZoomOut-ox9YzR1a.js} +1 -1
  47. package/dist/client/assets/access-gate-Yfi4ekhF.js +1 -0
  48. package/dist/client/assets/{add-section-modal-DzvsujkT.js → add-section-modal-d8gKomF9.js} +1 -1
  49. package/dist/client/assets/admin-fetch-CCSvjTk1.js +1 -0
  50. package/dist/client/assets/agent-capabilities-BrHWT2H6.js +1 -0
  51. package/dist/client/assets/agent-icon-C2ANw4X5.js +1 -0
  52. package/dist/client/assets/agents-list-DcAZyk1U.js +1 -0
  53. package/dist/client/assets/ai-providers-CLLgcR35.js +1 -0
  54. package/dist/client/assets/{alert-Dd7VLodG.js → alert-BLw4eidn.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-C4qC2FY4.js → alert-dialog-BglRhrg0.js} +3 -3
  56. package/dist/client/assets/app-editor-Be9j6Psz.js +1 -0
  57. package/dist/client/assets/{auth-DBkkYg-T.js → auth-DKsARQye.js} +1 -1
  58. package/dist/client/assets/{auth-catchall-DfxF4BPq.js → auth-catchall-DwgEjeTg.js} +1 -1
  59. package/dist/client/assets/{auth-entry-wfy-u0F0.js → auth-entry-CQlhwp6I.js} +1 -1
  60. package/dist/client/assets/{auth-split-layout-ktXvps3s.js → auth-split-layout-CZ_OCZxj.js} +1 -1
  61. package/dist/client/assets/{authenticate-and-persist-oauth-Bbf69cXY.js → authenticate-and-persist-oauth-DWDcBYz0.js} +1 -1
  62. package/dist/client/assets/{automation-list-row-DBzmw45u.js → automation-list-row-Bq-loDW7.js} +1 -1
  63. package/dist/client/assets/{automation-runs-DHRDLBLv.js → automation-runs-DoqJWooa.js} +1 -1
  64. package/dist/client/assets/automations-C-RHUi9C.js +1 -0
  65. package/dist/client/assets/{autosend-d6dIJs7M.js → autosend-CYyCczkd.js} +1 -1
  66. package/dist/client/assets/{avatar-DWC-yfzJ.js → avatar-BvMZq_TI.js} +1 -1
  67. package/dist/client/assets/{badge-DJdw3Rsl.js → badge-7J4kgEzC.js} +1 -1
  68. package/dist/client/assets/{block-document-BGR4oU7t.js → block-document-CEQDI6GW.js} +1 -1
  69. package/dist/client/assets/brand-context-B-G2N5Cc.js +1 -0
  70. package/dist/client/assets/{breadcrumb-CbTWSDKt.js → breadcrumb-DX6VmR2b.js} +1 -1
  71. package/dist/client/assets/{buckets-DXJgsymj.js → buckets-BnVc6A5T.js} +1 -1
  72. package/dist/client/assets/bulk-category-panel-dwWBDZdx.js +1 -0
  73. package/dist/client/assets/{calendar-DuEt6MhW.js → calendar-DlspiiCF.js} +1 -1
  74. package/dist/client/assets/capability-load-error-BM3-quVD.js +1 -0
  75. package/dist/client/assets/{card-fRwe0bJZ.js → card-DJEMjLyN.js} +1 -1
  76. package/dist/client/assets/category-editor-D49qQ_5A.js +1 -0
  77. package/dist/client/assets/{chat-context-B0O0Okxx.js → chat-context-DWWQ8fi_.js} +1 -1
  78. package/dist/client/assets/{checkbox-C1s1Cv92.js → checkbox-BW3fb6zN.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-Gjk2YP9E.js → cli-auth-success-CYZtnqJM.js} +1 -1
  80. package/dist/client/assets/collection-detail-CuUENpdt.js +1 -0
  81. package/dist/client/assets/collection-display-button-CwpKpIcC.js +1 -0
  82. package/dist/client/assets/{collection-search-DFZjjhrH.js → collection-search-C_SgZaX4.js} +1 -1
  83. package/dist/client/assets/collection-table-wrapper-CtK9vkZI.js +1 -0
  84. package/dist/client/assets/{collection-tabs-DKk8l5Nv.js → collection-tabs-DcJTaWg5.js} +1 -1
  85. package/dist/client/assets/{command-CslXjYaI.js → command-BK76iADW.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-CacbF47W.js +1 -0
  87. package/dist/client/assets/connect-desktop-dialog-BVhGL3hA.js +1 -0
  88. package/dist/client/assets/connection-card-BZCmFzT0.js +1 -0
  89. package/dist/client/assets/connection-detail-B8lH7kfR.js +1 -0
  90. package/dist/client/assets/{connection-form-helpers-2Hj68sfK.js → connection-form-helpers-DsmizTyk.js} +1 -1
  91. package/dist/client/assets/connections-DaqgHt93.js +1 -0
  92. package/dist/client/assets/{decopilot-sse-pool-B14erbbw.js → decopilot-sse-pool-CQt0Qt9t.js} +1 -1
  93. package/dist/client/assets/{dialog-B4FPUVJm.js → dialog-VQoq6ED0.js} +1 -1
  94. package/dist/client/assets/domain-settings-DQrCzdxW.js +1 -0
  95. package/dist/client/assets/{drawer-CsmWGB6A.js → drawer-BiUeA1xK.js} +1 -1
  96. package/dist/client/assets/{dropdown-menu-BXp0fOBv.js → dropdown-menu-Q9JsQJsN.js} +1 -1
  97. package/dist/client/assets/{empty-state-DUwhZpUT.js → empty-state-Bx2oDYyE.js} +1 -1
  98. package/dist/client/assets/{extract-connection-data-Du4c1lRI.js → extract-connection-data-CBaWfjW4.js} +1 -1
  99. package/dist/client/assets/file-explorer-NjBXraWZ.js +2 -0
  100. package/dist/client/assets/{file-type-icon-BsGfZ7Mt.js → file-type-icon-Byym_Yq8.js} +1 -1
  101. package/dist/client/assets/{files-BRsrXnK1.js → files-Bzx4vIyM.js} +1 -1
  102. package/dist/client/assets/{form-CIHkncRQ.js → form-Ck57FY_v.js} +1 -1
  103. package/dist/client/assets/format-time-BnbuEtat.js +1 -0
  104. package/dist/client/assets/general-DTNBl6eM.js +1 -0
  105. package/dist/client/assets/github-repo-picker-Cv4fHpMw.js +1 -0
  106. package/dist/client/assets/{hooks-Cln-uffe.js → hooks-BCy5e9GO.js} +5 -5
  107. package/dist/client/assets/{index-BtXBV2Et.js → index-2V8OIw2c.js} +1 -1
  108. package/dist/client/assets/{index-BrYQWjA0.js → index-BNkKptlK.js} +1 -1
  109. package/dist/client/assets/{index-Bt7VlfeQ.js → index-BkSsc9os.js} +1 -1
  110. package/dist/client/assets/index-BxDQDgZD.js +1 -0
  111. package/dist/client/assets/{index-BE0jgIkY.js → index-CA5Ck5O8.js} +3 -3
  112. package/dist/client/assets/{index-BPc0E2v5.js → index-CP0NJqZH.js} +6 -6
  113. package/dist/client/assets/{index-DOA46HRo.js → index-ChTrjmId.js} +4 -4
  114. package/dist/client/assets/index-Cz1AR3Zz.js +1 -0
  115. package/dist/client/assets/{index-C2Xrxv4z.js → index-D-yF_uFs.js} +1 -1
  116. package/dist/client/assets/index-D1Oy1H9B.js +1 -0
  117. package/dist/client/assets/{index-BCuWJvJV.js → index-D544QCka.js} +1 -1
  118. package/dist/client/assets/{index-loGM-Zqm.js → index-DAFO_OTU.js} +14 -14
  119. package/dist/client/assets/{index-Dgf9uMoE.js → index-RzCbz7G4.js} +28 -28
  120. package/dist/client/assets/index-ZbSNKPKh.css +1 -0
  121. package/dist/client/assets/{index-w7ppCtrf.js → index-iSSICeOA.js} +1 -1
  122. package/dist/client/assets/{index-redirect-9j6LkyoI.js → index-redirect-BTf9IrPi.js} +1 -1
  123. package/dist/client/assets/{input-oiex_Sqb.js → input-CmS4IhfL.js} +1 -1
  124. package/dist/client/assets/{integration-icon-aZSadBLO.js → integration-icon-B64oCP0F.js} +1 -1
  125. package/dist/client/assets/invite-member-dialog-BoCPYFUb.js +3 -0
  126. package/dist/client/assets/{label-CmLwbefD.js → label-BRuRKPr0.js} +1 -1
  127. package/dist/client/assets/layout-CT250kMb.js +1 -0
  128. package/dist/client/assets/{login-C0ZjtJpq.js → login-CldG7DZa.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-CdnuFysO.js → mcp-oauth-C23-dwpq.js} +1 -1
  130. package/dist/client/assets/members-CNrOGJa0.js +1 -0
  131. package/dist/client/assets/{monaco-editor-d15d-RZJ.js → monaco-editor-DR7220lx.js} +2 -2
  132. package/dist/client/assets/{monitoring-stats-row-zzC6T7XL.js → monitoring-stats-row-BZL3Rvz8.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-EgT8jFmC.js → oauth-callback-DcfZfqGm.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-ai-provider-CRV9LcjN.js → oauth-callback-ai-provider-Ce9G5qtJ.js} +1 -1
  135. package/dist/client/assets/{onboarding-N_yKxU4j.js → onboarding-B25kyk06.js} +1 -1
  136. package/dist/client/assets/org-install-Bji_kE_8.js +1 -0
  137. package/dist/client/assets/{org-layout-DNgYRXIB.js → org-layout-CKR3WJzm.js} +1 -1
  138. package/dist/client/assets/{organization-choice-pAAagV_i.js → organization-choice-DTClrrnJ.js} +1 -1
  139. package/dist/client/assets/orgs-BwjlPx55.js +1 -0
  140. package/dist/client/assets/page-seo-sheet-BgXbK0SD.js +1 -0
  141. package/dist/client/assets/{popover-BjB-5tFY.js → popover-DOYlXTug.js} +1 -1
  142. package/dist/client/assets/post-editor-C_RBUxWZ.js +1 -0
  143. package/dist/client/assets/{primitives-Ds0WLoLr.js → primitives-h6UMy2ac.js} +1 -1
  144. package/dist/client/assets/{profile-CzCmCXYA.js → profile-BeG5MWeA.js} +1 -1
  145. package/dist/client/assets/project-app-view-CJsN01Kq.js +1 -0
  146. package/dist/client/assets/record-editor-Cxnw_s7-.js +1 -0
  147. package/dist/client/assets/registry-CO3wS9en.js +2 -0
  148. package/dist/client/assets/{registry-layout-B80BPaTp.js → registry-layout-B3NcP7G9.js} +1 -1
  149. package/dist/client/assets/{require-capability-CC8Cb4eK.js → require-capability-BwJAyhw_.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-Bxaf6y0u.js → required-auth-layout-BnUL76ZK.js} +1 -1
  151. package/dist/client/assets/{reset-password-CaEUMCHV.js → reset-password-DXMG8bNT.js} +1 -1
  152. package/dist/client/assets/roles-Cr24Ru3H.js +1 -0
  153. package/dist/client/assets/{search-input-DUPgDj3Q.js → search-input-Cvhmar4S.js} +1 -1
  154. package/dist/client/assets/{secrets-hHXyxqcY.js → secrets-C_rz33jP.js} +1 -1
  155. package/dist/client/assets/{sections-editor-DLA_tn_Z.js → sections-editor-DB_WyCzE.js} +2 -2
  156. package/dist/client/assets/{select-Ct8ODrmD.js → select-cLkB0xx3.js} +1 -1
  157. package/dist/client/assets/{select-model-CXARzc0b.js → select-model-C6Zl96g0.js} +2 -2
  158. package/dist/client/assets/seo-editor-CKENU8Ce.js +1 -0
  159. package/dist/client/assets/{seo-save-CaN3ncbg.js → seo-save-CcM551vP.js} +1 -1
  160. package/dist/client/assets/settings-layout-PBMPJvHi.js +1 -0
  161. package/dist/client/assets/{settings-section-CIZ7OrhY.js → settings-section-B5s6i1AE.js} +1 -1
  162. package/dist/client/assets/{shell-controls-DcH8LcQe.js → shell-controls-DFx9R0D_.js} +1 -1
  163. package/dist/client/assets/shell-layout-P9zH_bFZ.js +1 -0
  164. package/dist/client/assets/{sidebar-DGCj3BzG.js → sidebar-Dg_hr7dR.js} +1 -1
  165. package/dist/client/assets/{skeleton-h_Rrfd9X.js → skeleton-CZJQcXjJ.js} +1 -1
  166. package/dist/client/assets/sso-Bn2_Oeeg.js +1 -0
  167. package/dist/client/assets/store-Cy3LEKoA.js +1 -0
  168. package/dist/client/assets/store-registry-CNggLKId.js +2 -0
  169. package/dist/client/assets/studio-tools-D1WvthcJ.js +1 -0
  170. package/dist/client/assets/{switch-5bdjLWcS.js → switch-DvI4Ivs6.js} +1 -1
  171. package/dist/client/assets/{table-m4VurkE4.js → table-Rcs576gh.js} +1 -1
  172. package/dist/client/assets/{tabs-7O9mSdEa.js → tabs-BYqpHacd.js} +1 -1
  173. package/dist/client/assets/{textarea-DTygx-PF.js → textarea-DfbK_YWl.js} +1 -1
  174. package/dist/client/assets/{toggle-group-CArvNNKC.js → toggle-group-DPk7hBEB.js} +1 -1
  175. package/dist/client/assets/{toolbar-icon-button-j_UeiHvv.js → toolbar-icon-button-BfscRxQb.js} +1 -1
  176. package/dist/client/assets/{toolbar-Cap3B0tq.js → toolbar-spKhA4Pi.js} +1 -1
  177. package/dist/client/assets/tools-list-GD_nS-CN.js +1 -0
  178. package/dist/client/assets/{tooltip-1foZ_k7s.js → tooltip-D9y133qH.js} +1 -1
  179. package/dist/client/assets/{types-DI-1sdV1.js → types-u5_F63vr.js} +3 -3
  180. package/dist/client/assets/use-ai-providers-Be4jiLlp.js +1 -0
  181. package/dist/client/assets/use-automations-Bj7ea45i.js +1 -0
  182. package/dist/client/assets/use-capability-BAJSmOR6.js +1 -0
  183. package/dist/client/assets/{use-clock-tick-BVVBiunA.js → use-clock-tick-DiAMyzbm.js} +1 -1
  184. package/dist/client/assets/{use-collections-zePUbAs4.js → use-collections-B0fmzWMT.js} +1 -1
  185. package/dist/client/assets/use-connection-CoNk61jl.js +1 -0
  186. package/dist/client/assets/{use-copy-DSFHRfjF.js → use-copy-CC8l0MM4.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-BiykOxhR.js → use-create-virtual-mcp-DHvF-qx5.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-DcfXuKw9.js → use-debounced-autosave-DVAOELdx.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-CrZFsUmt.js → use-debounced-value-BUPZwZxl.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-BPApfysb.js → use-decopilot-events-CwboOo9R.js} +1 -1
  191. package/dist/client/assets/use-delete-connection-BRROztaa.js +1 -0
  192. package/dist/client/assets/use-deployment-admin-DjDR8kPw.js +1 -0
  193. package/dist/client/assets/use-file-configs-CiH7freP.js +1 -0
  194. package/dist/client/assets/{use-infinite-scroll-BmH_7PeD.js → use-infinite-scroll-CLzTjnPW.js} +1 -1
  195. package/dist/client/assets/use-join-requests-wFFDbE5s.js +1 -0
  196. package/dist/client/assets/{use-mcp-client-DbUnPC2U.js → use-mcp-client-D3e9ceNa.js} +4 -4
  197. package/dist/client/assets/{use-mcp-prompts-D4BjUd_Q.js → use-mcp-prompts-D_i1iWd2.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-aSGZtgAI.js → use-mcp-tools-eYiXWlAi.js} +1 -1
  199. package/dist/client/assets/use-members-oJt5povW.js +1 -0
  200. package/dist/client/assets/{use-mobile-B-H7VJlh.js → use-mobile-BD37jY8Y.js} +1 -1
  201. package/dist/client/assets/use-navigate-to-agent-C_szOIys.js +1 -0
  202. package/dist/client/assets/use-org-auth-client-BbOBgx1F.js +1 -0
  203. package/dist/client/assets/{use-org-sso-BV4x4p-5.js → use-org-sso-C5MQ0Bj7.js} +1 -1
  204. package/dist/client/assets/use-organization-roles-PP5Ze7E4.js +1 -0
  205. package/dist/client/assets/use-organization-settings-BPsQDYqA.js +1 -0
  206. package/dist/client/assets/use-registry-connections-sVBXNIyN.js +1 -0
  207. package/dist/client/assets/use-secrets-C4J7nZmF.js +1 -0
  208. package/dist/client/assets/{use-status-sounds-CtrLXRrg.js → use-status-sounds-BEcDaP-9.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-CpRSxfa9.js → use-view-mode-B8ZvyTJu.js} +1 -1
  210. package/dist/client/assets/use-virtual-mcp-D1vadQaQ.js +1 -0
  211. package/dist/client/assets/useInfiniteQuery-FvBo89pe.js +1 -0
  212. package/dist/client/assets/useRouterState-CKoYWt4i.js +1 -0
  213. package/dist/client/assets/useSuspenseInfiniteQuery-CmezFxqW.js +1 -0
  214. package/dist/client/assets/users-C0Qc7Jal.js +1 -0
  215. package/dist/client/assets/variant-calendar-BTZUazZ2.js +1 -0
  216. package/dist/client/assets/{view-mode-toggle-IUxgH98b.js → view-mode-toggle-CcfquXZC.js} +1 -1
  217. package/dist/client/index.html +2 -2
  218. package/dist/server/cli.js +481 -481
  219. package/dist/server/migrate.js +1 -1
  220. package/dist/server/server.js +314 -314
  221. package/package.json +1 -1
  222. package/dist/client/assets/SwitchHorizontal01-CEx7u3Ha.js +0 -1
  223. package/dist/client/assets/access-gate-BoaBcBcQ.js +0 -1
  224. package/dist/client/assets/agent-capabilities-udLJw-cm.js +0 -1
  225. package/dist/client/assets/agent-icon-DryRwerX.js +0 -1
  226. package/dist/client/assets/agents-list-Ts1COBbM.js +0 -1
  227. package/dist/client/assets/ai-providers-Bkg5iXmH.js +0 -1
  228. package/dist/client/assets/app-editor-CgSwIbOw.js +0 -1
  229. package/dist/client/assets/automations-CBd2I4AI.js +0 -1
  230. package/dist/client/assets/brand-context-DTtKwfXh.js +0 -1
  231. package/dist/client/assets/bulk-category-panel-BLrzcvWT.js +0 -1
  232. package/dist/client/assets/capability-load-error-jhIJPxL6.js +0 -1
  233. package/dist/client/assets/category-editor-CcRWkoEb.js +0 -1
  234. package/dist/client/assets/collection-detail-CtM2kg0x.js +0 -1
  235. package/dist/client/assets/collection-display-button-C3a5JxQa.js +0 -1
  236. package/dist/client/assets/collection-table-wrapper-C6PjuHgw.js +0 -1
  237. package/dist/client/assets/commerce-onboarding-DHT_nBuJ.js +0 -1
  238. package/dist/client/assets/connect-desktop-dialog-D3fwzLbi.js +0 -1
  239. package/dist/client/assets/connection-card-Do3n6-0X.js +0 -1
  240. package/dist/client/assets/connection-detail-CzIcxrxO.js +0 -1
  241. package/dist/client/assets/connections-M8hPZ8h_.js +0 -1
  242. package/dist/client/assets/domain-settings-B7X2BGW_.js +0 -1
  243. package/dist/client/assets/file-explorer-dehRUbZq.js +0 -2
  244. package/dist/client/assets/format-time-Cy7tTmZp.js +0 -1
  245. package/dist/client/assets/general-C_FpLf3Q.js +0 -1
  246. package/dist/client/assets/github-repo-picker-CnKj3G6a.js +0 -1
  247. package/dist/client/assets/index-1lPjtuok.js +0 -1
  248. package/dist/client/assets/index-XnT9B5AX.js +0 -1
  249. package/dist/client/assets/index-b3V1CkLW.css +0 -1
  250. package/dist/client/assets/index-l7TANBTQ.js +0 -1
  251. package/dist/client/assets/invite-member-dialog-IU7TOmN2.js +0 -3
  252. package/dist/client/assets/members-BS0Y_-RA.js +0 -1
  253. package/dist/client/assets/org-install-D3e2RXf5.js +0 -1
  254. package/dist/client/assets/page-seo-sheet-oQ_VYV1S.js +0 -1
  255. package/dist/client/assets/post-editor-DSs8Lcxg.js +0 -1
  256. package/dist/client/assets/project-app-view-DkIw6469.js +0 -1
  257. package/dist/client/assets/record-editor-By2OLFPe.js +0 -1
  258. package/dist/client/assets/registry-wO6PtzH3.js +0 -2
  259. package/dist/client/assets/roles-CI4mrdaD.js +0 -1
  260. package/dist/client/assets/seo-editor-BpwYJzgf.js +0 -1
  261. package/dist/client/assets/settings-layout-CGatm5aT.js +0 -1
  262. package/dist/client/assets/shell-layout-B4WmiL97.js +0 -1
  263. package/dist/client/assets/sso-Xyp2hR06.js +0 -1
  264. package/dist/client/assets/store-Cmzf3YVA.js +0 -1
  265. package/dist/client/assets/store-registry-C9g9AZIb.js +0 -2
  266. package/dist/client/assets/studio-tools-BaimbcRe.js +0 -1
  267. package/dist/client/assets/tools-list-S4uoHI5a.js +0 -1
  268. package/dist/client/assets/use-ai-providers-CLhyvTsV.js +0 -1
  269. package/dist/client/assets/use-automations-DI4zmIKR.js +0 -1
  270. package/dist/client/assets/use-capability-BDb9Fsiz.js +0 -1
  271. package/dist/client/assets/use-connection-BibmCEFD.js +0 -1
  272. package/dist/client/assets/use-delete-connection-D87N3EAi.js +0 -1
  273. package/dist/client/assets/use-file-configs-uzLbxssm.js +0 -1
  274. package/dist/client/assets/use-join-requests-DEIhG119.js +0 -1
  275. package/dist/client/assets/use-members-Buz_D9kT.js +0 -1
  276. package/dist/client/assets/use-navigate-to-agent-_WYF41V-.js +0 -1
  277. package/dist/client/assets/use-org-auth-client-Dr5MvmUs.js +0 -1
  278. package/dist/client/assets/use-organization-roles-CqDIe-bv.js +0 -1
  279. package/dist/client/assets/use-organization-settings-CsH8Ep36.js +0 -1
  280. package/dist/client/assets/use-registry-connections-C948P_nl.js +0 -1
  281. package/dist/client/assets/use-secrets-B8xSCB_X.js +0 -1
  282. package/dist/client/assets/use-virtual-mcp-CjUwVbqH.js +0 -1
  283. package/dist/client/assets/useInfiniteQuery-DWB8a2J-.js +0 -1
  284. package/dist/client/assets/useSuspenseInfiniteQuery-Ip6E6dwx.js +0 -1
  285. package/dist/client/assets/variant-calendar-DYAW4a46.js +0 -1
@@ -1 +0,0 @@
1
- import{c as ie,j as s,B as Q,$ as de,p as fe,a as he,r as q,k as ge,K as te,d as xe,M as $,t as se,l as je}from"./index-Dgf9uMoE.js";import{d as W,c as me,a as oe,D as ne}from"./dropdown-menu-BXp0fOBv.js";import{a as be}from"./Users03-BQZ9UhFk.js";import{a as ue,b as Ce,p as ye,G as we}from"./github-repo-picker-CnKj3G6a.js";import{a as _e,b as Ne,c as Se}from"./use-virtual-mcp-CjUwVbqH.js";import{P as Z}from"./index-w7ppCtrf.js";import{i as ve}from"./DotsVertical-CuOtMg5m.js";import{a as Ie,b as De}from"./Settings02-CJWk9pL-.js";import{s as Ee}from"./Trash01-CqJAv-4z.js";import{A as Ae,aD as Te}from"./agent-icon-DryRwerX.js";import{c as pe}from"./use-navigate-to-agent-_WYF41V-.js";import{C as ke}from"./card-fRwe0bJZ.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Le}from"./use-capability-BDb9Fsiz.js";import{E as Ge}from"./empty-state-DUwhZpUT.js";import{u as Oe}from"./use-create-virtual-mcp-BiykOxhR.js";import{u as Pe}from"./use-connection-BibmCEFD.js";import{u as le}from"./use-mcp-client-DbUnPC2U.js";import{S as ze}from"./constants-B72Xmt_K.js";import{a as Me,f as $e,b as He}from"./github-installations-D2vHSx02.js";import{e as Re,d as Fe,c as Ue,a as Be,D as Ve}from"./dialog-B4FPUVJm.js";import{C as Ke}from"./collection-search-DFZjjhrH.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-C4qC2FY4.js";import{S as tt}from"./search-input-DUPgDj3Q.js";import{s as ae}from"./Plus-BWS7YRCt.js";import"./Check-DT0Ecfph.js";import"./ChevronRight-Brlyqvfv.js";import"./Circle-gozopXYF.js";import"./use-debounced-value-CrZFsUmt.js";import"./authenticate-and-persist-oauth-Bbf69cXY.js";import"./mcp-oauth-CdnuFysO.js";import"./auth-DBkkYg-T.js";import"./use-mcp-tools-aSGZtgAI.js";import"./extract-connection-data-Du4c1lRI.js";import"./use-collections-zePUbAs4.js";import"./sidebar-DGCj3BzG.js";import"./LayoutLeft-CIXRhIgm.js";import"./use-mobile-B-H7VJlh.js";import"./X-CAX-FceB.js";import"./tooltip-1foZ_k7s.js";import"./AlertCircle-DvQdKX2P.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./XCircle-D6yhOy3u.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./ZapSquare-do_RxxO8.js";import"./Loading02-BYDO_yva.js";import"./CheckCircle-B3kM3-nx.js";import"./ChevronDown-BL5D5Kww.js";import"./ChevronUp-D4h43NMl.js";import"./Stars02-H_ePh5tT.js";import"./Copy01-DVjpmGSQ.js";import"./ZoomOut-DK6J-pHc.js";import"./Globe01-fOy2mEYg.js";import"./Eye-cte0MnVy.js";import"./FilterLines-B1MBg_Jt.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./Key01-BhnYqbq5.js";import"./LinkExternal01-Br3p9c4J.js";import"./List-DZFJgfGO.js";import"./Monitor01-8NNEYlGa.js";import"./Sun-DvwmIRmO.js";import"./Palette-BEYm0oRU.js";import"./Play-BAkY7Fxv.js";import"./SearchLg-sYqeRxUE.js";import"./SearchMd-D3a2hIUP.js";import"./Shield01-1T25s-tn.js";import"./Stars01-5MzsUK6G.js";import"./Upload01-BEmoOwcr.js";import"./User01-Ckt1oKpR.js";import"./Users01-C3ZswPLc.js";import"./XClose-DuZ4u7Uu.js";import"./Zap-DWMv1jO1.js";import"./hooks-Cln-uffe.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";function ce(t){const e=ie.c(19),{onCreateFromScratch:n,onImportGitHub:i,onImportDeco:c,isCreating:C,align:y,side:d,showBetaBadge:g}=t,w=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==C||e[2]!==n?(m=s.jsxs(W,{disabled:C,onClick:n,children:[x,"Create from scratch"]}),e[1]=C,e[2]=n,e[3]=m):m=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{className:"size-3.5"}),e[4]=p):p=e[4];let l;e[5]!==g?(l=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=l):l=e[6];let f;e[7]!==i||e[8]!==l?(f=s.jsxs(W,{onClick:i,children:[p,"Import from GitHub",l]}),e[7]=i,e[8]=l,e[9]=f):f=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=a):a=e[10];let r;e[11]!==c?(r=s.jsxs(W,{onClick:c,children:[a,"Import from deco.cx"]}),e[11]=c,e[12]=r):r=e[12];let u;return e[13]!==w||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==r?(u=s.jsxs(me,{side:d,align:w,className:"w-48",children:[m,f,r]}),e[13]=w,e[14]=d,e[15]=m,e[16]=f,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:n,lastUsedAt:i,onDeleteClick:c}=t,C=pe();let y;e[0]!==C||e[1]!==n.id?(y=()=>C(n.id),e[0]=C,e[1]=n.id,e[2]=y):y=e[2];let d;e[3]!==n.title||e[4]!==y?(d=s.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":n.title}),e[3]=n.title,e[4]=y,e[5]=d):d=e[5];let g;e[6]!==n.icon||e[7]!==n.title?(g=s.jsx(Ae,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=n.icon,e[7]=n.title,e[8]=g):g=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(oe,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ve,{size:20})})}),e[9]=w):w=e[9];let x;e[10]!==C||e[11]!==n.id?(x=()=>C(n.id,{search:{main:"settings"}}),e[10]=C,e[11]=n.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ie,{size:16}),e[13]=m):m=e[13];let p;e[14]!==x?(p=s.jsxs(W,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=p):p=e[15];let l;e[16]!==c?(l=c&&s.jsxs(W,{variant:"destructive",onClick:G=>{G.stopPropagation(),c(G)},children:[s.jsx(Ee,{size:16}),"Delete"]}),e[16]=c,e[17]=l):l=e[17];let f;e[18]!==p||e[19]!==l?(f=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(ne,{children:[w,s.jsxs(me,{align:"end",children:[p,l]})]})}),e[18]=p,e[19]=l,e[20]=f):f=e[20];let a;e[21]!==g||e[22]!==f?(a=s.jsxs("div",{className:"flex items-start justify-between",children:[g,f]}),e[21]=g,e[22]=f,e[23]=a):a=e[23];let r;e[24]!==n.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[24]=n.title,e[25]=r):r=e[25];const u=n.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let _;e[31]!==a||e[32]!==D?(_=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[a,D]}),e[31]=a,e[32]=D,e[33]=_):_=e[33];let T;e[34]!==i||e[35]!==n.updated_at?(T=i?`Last used ${re(new Date(i),{addSuffix:!0})}`:`Updated ${re(new Date(n.updated_at),{addSuffix:!0})}`,e[34]=i,e[35]=n.updated_at,e[36]=T):T=e[36];let N;e[37]!==T?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[37]=T,e[38]=N):N=e[38];let k;e[39]!==_||e[40]!==N?(k=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[_,N]}),e[39]=_,e[40]=N,e[41]=k):k=e[41];let S;return e[42]!==k||e[43]!==d?(S=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,k]}),e[42]=k,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function nt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const n=e.owner,i=e.repo;return typeof n!="string"||typeof i!="string"||n.length===0||i.length===0?null:{owner:n,repo:i}}function it(t,e){const n=e?nt(e):null,i=n?.owner??ot,c=n?.repo??t;return{owner:i,name:c,url:`https://github.com/${i}/${c}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function lt(t){const e=await fetch(`/api/${t}/deco-sites`);if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Failed to load sites (${e.status})`)}return e.json()}function at({open:t,onOpenChange:e,onBack:n}){const{org:i}=de(),c=pe(),C=fe(),{data:y}=he.useSession(),[d,g]=q.useState(null),[w,x]=q.useState(null),[m,p]=q.useState(""),l=le({connectionId:ze,orgId:i.id,orgSlug:i.slug}),f=Pe({slug:"mcp-github"}),a=Me(f),r=Ce({enabled:t&&a.length===0}),u=a.length===1?a[0]??null:w,I=a.length>1&&!u,D=le({connectionId:u?.id??"",orgId:i.id,orgSlug:i.slug}),_=t&&a.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:T,isLoading:N,error:k}=ge({queryKey:te.decoSites(y?.user?.email),queryFn:()=>lt(i.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),S=T?.sites??[],G=o=>{o||(g(null),x(null),p("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),O=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:L,appSlug:v}=await $e(b=>l.callTool(b),u.id),E=S.find(b=>b.name===o);if(!E)throw new Error("Selected site is no longer available");const j=it(o,E.metadata),z=He(L,j.owner);if(!z){const b=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${b}`)}let V=null,F=null,U=null;const J=async()=>{U&&await l.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),F&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:F,force:!0}}).catch(()=>{}),V&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const b=await fetch(`/api/${i.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})}),B=await b.json().catch(()=>({}));if(!b.ok)throw new Error(B.error??`Failed to create connection (${b.status})`);const A=B.connId;if(!A)throw new Error("Server did not return a connection ID");V=A;const{childConnectionId:M}=await ye({orgSlug:i.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:ee=>D.callTool(ee),selfCallTool:ee=>l.callTool(ee)});F=M;const H=B.icon??null,K=rt(o),h=o.toLowerCase(),Y=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:h,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:K,pinnedViews:[{connectionId:A,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:A,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:A},{connection_id:M}]}}}),X=Y.structuredContent??Y;if(!X.item?.id)throw new Error("Failed to create the imported agent");return U=X.item.id,{slug:K,virtualMcpId:X.item.id,connId:A,item:X.item}}catch(b){throw await J(),b}},onSuccess:({slug:o,virtualMcpId:L,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:L,slug:o}),C.setQueryData(te.collectionItem(l,i.id,"","VIRTUAL_MCP",L),{item:v}),C.invalidateQueries({predicate:E=>{const j=E.queryKey;return j[1]===i.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),C.invalidateQueries({queryKey:te.projects(i.id)}),se.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(L)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),se.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Re,{open:t,onOpenChange:G,children:s.jsxs(Fe,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[n&&s.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(De,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:p,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&p("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(Q,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!_&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),a.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(ue,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!_&&!I&&r.status!=="error"&&!k&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!_&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const L=o.domains?.find(E=>E.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),L&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:L})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(Q,{variant:"outline",onClick:()=>G(!1),disabled:O.isPending,children:"Cancel"}),s.jsx(Q,{disabled:!d||!R||O.isPending||N||_||I||!u||r.status==="error",onClick:()=>d&&O.mutate(d),children:O.isPending?"Importing...":"Import"})]})]})})}function zs(){const t=ie.c(46),{org:e}=de(),n=_e(),i=Ne(),[c,C]=q.useState("");let y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},t[0]=y):y=t[0];const{createVirtualMCP:d,isCreating:g}=Oe(y),[w,x]=q.useState(null),[m,p]=q.useState(!1),[l,f]=q.useState(!1),{granted:a}=Le("agents:manage"),r=c.toLowerCase(),u=n.filter(h=>h.id!==e.id&&(h.title.toLowerCase().includes(r)||h.description?.toLowerCase().includes(r))),{data:I}=Se(u.map(ct));let D;t[1]!==i||t[2]!==w?(D=async()=>{if(!w)return;const{id:h,title:Y}=w;x(null);try{await i.delete.mutateAsync(h),$("agent_deleted",{agent_id:h,source:"agents_list"}),se.success(`Deleted "${Y}"`)}catch{}},t[1]=i,t[2]=w,t[3]=D):D=t[3];const _=D,T=Z,N=Z,k=Z;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Z.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=h=>{h.key==="Escape"&&(C(""),h.target.blur())},t[5]=G):G=t[5];let P;t[6]!==c?(P=s.jsx(tt,{value:c,onChange:C,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=c,t[7]=P):P=t[7];let R;t[8]!==a||t[9]!==d||t[10]!==g?(R=a&&s.jsxs(ne,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),p(!0)},isCreating:g,align:"end"})]}),t[8]=a,t[9]=d,t[10]=g,t[11]=R):R=t[11];let O;t[12]!==P||t[13]!==R?(O=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=O):O=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ge,{image:s.jsx(Te,{size:48,className:"text-muted-foreground"}),title:c?"No agents found":"No agents yet",description:c?`No agents match "${c}"`:a?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!c&&a&&s.jsxs(ne,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),p(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),L=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(h=>s.jsx(st,{project:h,lastUsedAt:I?.get(h.id)?.last_used_at,onDeleteClick:a?()=>x({id:h.id,title:h.title}):void 0},h.id))})]});let v;t[15]!==L||t[16]!==k.Body||t[17]!==O||t[18]!==o?(v=s.jsxs(k.Body,{children:[O,o,L]}),t[15]=L,t[16]=k.Body,t[17]=O,t[18]=o,t[19]=v):v=t[19];let E;t[20]!==v||t[21]!==N.Content?(E=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=E):E=t[22];let j;t[23]!==l?(j=s.jsx(we,{open:l,onOpenChange:f}),t[23]=l,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:p}),t[25]=m,t[26]=z):z=t[26];const V=!!w;let F;t[27]===Symbol.for("react.memo_cache_sentinel")?(F=h=>!h&&x(null),t[27]=F):F=t[27];let U;t[28]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(qe,{children:"Delete Agent?"}),t[28]=U):U=t[28];const J=w?.title;let b;t[29]!==J?(b=s.jsxs(Qe,{children:[U,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:J}),"."]})]}),t[29]=J,t[30]=b):b=t[30];let B;t[31]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(We,{children:"Cancel"}),t[31]=B):B=t[31];let A;t[32]!==_?(A=s.jsxs(Ye,{children:[B,s.jsx(Xe,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=_,t[33]=A):A=t[33];let M;t[34]!==b||t[35]!==A?(M=s.jsxs(Ze,{children:[b,A]}),t[34]=b,t[35]=A,t[36]=M):M=t[36];let H;t[37]!==V||t[38]!==M?(H=s.jsx(et,{open:V,onOpenChange:F,children:M}),t[37]=V,t[38]=M,t[39]=H):H=t[39];let K;return t[40]!==T||t[41]!==E||t[42]!==j||t[43]!==z||t[44]!==H?(K=s.jsxs(T,{children:[E,j,z,H]}),t[40]=T,t[41]=E,t[42]=j,t[43]=z,t[44]=H,t[45]=K):K=t[45],K}function ct(t){return t.id}export{zs as default};
@@ -1 +0,0 @@
1
- import{G as B,H as N,a8 as ae,aa as le,ab as he,a9 as xe,a$ as me,c as U,I as ge,J as be,r as M,j as s,ac as Ee,t as Q,aI as ye,$ as re,p as oe,d as J,K as G,k as ve,l as ue,B as V,M as je,P as $e}from"./index-Dgf9uMoE.js";import{i as Re}from"./AlertCircle-DvQdKX2P.js";import{P as te}from"./index-w7ppCtrf.js";import{S as ne}from"./skeleton-h_Rrfd9X.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-CIZ7OrhY.js";import{u as X,a as se,b as Se}from"./use-ai-providers-CLhyvTsV.js";import{i as Me}from"./CheckCircle-B3kM3-nx.js";import{m as Oe,n as Te,o as Ue,S as ze}from"./chat-context-B0O0Okxx.js";import{h as qe,i as Le}from"./use-organization-settings-CsH8Ep36.js";import{M as Ve,O as ke,P as Be,C as pe}from"./select-model-CXARzc0b.js";import{u as Ge}from"./use-debounced-autosave-DcfXuKw9.js";import{I as ie}from"./input-oiex_Sqb.js";import{T as fe,a as Qe}from"./toggle-group-CArvNNKC.js";import{b as Ie,c as Ce,d as Ne,A as Pe,a as we,e as De,g as Ae,f as Ke}from"./alert-dialog-C4qC2FY4.js";import{u as H}from"./studio-tools-BaimbcRe.js";import{s as Ye}from"./Plus-BWS7YRCt.js";import{c as We}from"./Tool01-BFRbBZqm.js";import{s as He}from"./Trash01-CqJAv-4z.js";import{A as Je}from"./avatar-DWC-yfzJ.js";import{i as Xe}from"./Settings02-CJWk9pL-.js";import{s as Ze}from"./Eye-cte0MnVy.js";import{D as et,c as tt,a as st,d as it,e as rt}from"./dialog-B4FPUVJm.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-CC8Cb4eK.js";import"./sidebar-DGCj3BzG.js";import"./LayoutLeft-CIXRhIgm.js";import"./use-mobile-B-H7VJlh.js";import"./X-CAX-FceB.js";import"./tooltip-1foZ_k7s.js";import"./card-fRwe0bJZ.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./autosend-d6dIJs7M.js";import"./hooks-Cln-uffe.js";import"./use-mcp-client-DbUnPC2U.js";import"./constants-B72Xmt_K.js";import"./auth-DBkkYg-T.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CjUwVbqH.js";import"./use-collections-zePUbAs4.js";import"./use-decopilot-events-BPApfysb.js";import"./tab-id-bb-jjgGv.js";import"./drawer-CsmWGB6A.js";import"./checkbox-C1s1Cv92.js";import"./Check-DT0Ecfph.js";import"./select-Ct8ODrmD.js";import"./ChevronDown-BL5D5Kww.js";import"./ChevronUp-D4h43NMl.js";import"./Key01-BhnYqbq5.js";import"./SearchMd-D3a2hIUP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-8NNEYlGa.js";import"./ChevronRight-Brlyqvfv.js";import"./connect-desktop-dialog-D3fwzLbi.js";import"./Copy01-DVjpmGSQ.js";import"./Stars01-5MzsUK6G.js";import"./User01-Ckt1oKpR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BDb9Fsiz.js";import"./access-gate-BoaBcBcQ.js";import"./capability-load-error-jhIJPxL6.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Oe(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=M.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],M.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const k=p;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const R=y.keyId??m??"";S(R),a({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=f):f=t[19],f}function pt(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Me,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function ft(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Ge(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:p}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),M.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==p?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=p);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,$);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,R=g?.id;let O;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==R?(O=[o,t,j,_,p,f,y,R],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=R,e[28]=O):O=e[28],M.useEffect(h,O);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const F=b&&!d;let D;e[30]!==S||e[31]!==F?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:F})]}),e[30]=S,e[31]=F,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=M.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},onSuccess:yt,onError:bt}),[o,x]=M.useState(""),[S,b]=M.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Qe,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=p):p=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==p||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=M.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const R=y;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=O):O=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let F;e[23]!==c?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=F):F=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ie,{children:[s.jsx(Ce,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ne,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Pe,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(we,{children:[D,s.jsxs(De,{children:[A,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ke,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==f||e[33]!==R||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",f!=null&&vt(f)),children:R}),e[32]=f,e[33]=R,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,E,Y,Z]})})}),e[54]=F,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=M.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=M.useState(!1),[b,d]=M.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Je,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(We,{size:14})}),t[18]=R):R=t[18];let O,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=()=>S(!0),T=s.jsx(He,{size:14}),t[19]=O,t[20]=T):(O=t[19],T=t[20]);let F;t[21]!==f?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:O,children:T})]}),t[21]=f,t[22]=F):F=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==F||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:F}),t[23]=_,t[24]=u,t[25]=F,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ce,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(Ie,{children:[K,s.jsxs(Ne,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Pe,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(De,{children:[v,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(we,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ke,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Rt).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function Ft(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Re,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Mt(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=M.useState(!1),[x,S]=M.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let p;e[5]!==n?(p=s.jsx(Be,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Ot(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Fe,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Mt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Ft,{error:t??new Error("Failed to load AI providers")})}function Ws(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Ws as default};
@@ -1 +0,0 @@
1
- import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-Dgf9uMoE.js";import{i as _t}from"./ChevronRight-Brlyqvfv.js";import{A as jt}from"./automation-runs-DHRDLBLv.js";import{A as kt}from"./add-section-modal-DzvsujkT.js";import{aC as Bt,aD as wt,aE as At,q as Nt,t as Ct,aF as Rt,a9 as Et,aG as Kt,ap as Ft}from"./index-loGM-Zqm.js";import"./select-Ct8ODrmD.js";import"./tooltip-1foZ_k7s.js";import"./Check-DT0Ecfph.js";import"./ChevronDown-BL5D5Kww.js";import"./ChevronUp-D4h43NMl.js";import"./useInfiniteQuery-DWB8a2J-.js";import"./use-infinite-scroll-BmH_7PeD.js";import"./use-connection-BibmCEFD.js";import"./use-collections-zePUbAs4.js";import"./use-mcp-client-DbUnPC2U.js";import"./constants-B72Xmt_K.js";import"./auth-DBkkYg-T.js";import"./use-virtual-mcp-CjUwVbqH.js";import"./card-fRwe0bJZ.js";import"./sidebar-DGCj3BzG.js";import"./LayoutLeft-CIXRhIgm.js";import"./use-mobile-B-H7VJlh.js";import"./X-CAX-FceB.js";import"./table-m4VurkE4.js";import"./empty-state-DUwhZpUT.js";import"./use-members-Buz_D9kT.js";import"./use-org-auth-client-Dr5MvmUs.js";import"./use-clock-tick-BVVBiunA.js";import"./AlertCircle-DvQdKX2P.js";import"./CheckCircle-B3kM3-nx.js";import"./Circle-gozopXYF.js";import"./agent-icon-DryRwerX.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./Settings02-CJWk9pL-.js";import"./XCircle-D6yhOy3u.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./ZapSquare-do_RxxO8.js";import"./Users03-BQZ9UhFk.js";import"./Loading02-BYDO_yva.js";import"./Stars02-H_ePh5tT.js";import"./Copy01-DVjpmGSQ.js";import"./ZoomOut-DK6J-pHc.js";import"./DotsVertical-CuOtMg5m.js";import"./Globe01-fOy2mEYg.js";import"./Eye-cte0MnVy.js";import"./FilterLines-B1MBg_Jt.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./Key01-BhnYqbq5.js";import"./LinkExternal01-Br3p9c4J.js";import"./List-DZFJgfGO.js";import"./Monitor01-8NNEYlGa.js";import"./Sun-DvwmIRmO.js";import"./Palette-BEYm0oRU.js";import"./Play-BAkY7Fxv.js";import"./Plus-BWS7YRCt.js";import"./SearchLg-sYqeRxUE.js";import"./SearchMd-D3a2hIUP.js";import"./Shield01-1T25s-tn.js";import"./Stars01-5MzsUK6G.js";import"./Trash01-CqJAv-4z.js";import"./Upload01-BEmoOwcr.js";import"./User01-Ckt1oKpR.js";import"./Users01-C3ZswPLc.js";import"./XClose-DuZ4u7Uu.js";import"./Zap-DWMv1jO1.js";import"./use-automations-DI4zmIKR.js";import"./studio-tools-BaimbcRe.js";import"./useSuspenseInfiniteQuery-Ip6E6dwx.js";import"./badge-DJdw3Rsl.js";import"./checkbox-C1s1Cv92.js";import"./command-CslXjYaI.js";import"./index-C2Xrxv4z.js";import"./dialog-B4FPUVJm.js";import"./popover-BjB-5tFY.js";import"./avatar-DWC-yfzJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DSFHRfjF.js";import"./file-type-icon-BsGfZ7Mt.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-d15d-RZJ.js";import"./index-BE0jgIkY.js";import"./chat-context-B0O0Okxx.js";import"./autosend-d6dIJs7M.js";import"./hooks-Cln-uffe.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CLhyvTsV.js";import"./use-decopilot-events-BPApfysb.js";import"./use-organization-settings-CsH8Ep36.js";import"./types-DI-1sdV1.js";import"./shell-layout-B4WmiL97.js";import"./alert-dialog-C4qC2FY4.js";import"./required-auth-layout-Bxaf6y0u.js";import"./use-org-sso-BV4x4p-5.js";import"./integration-icon-aZSadBLO.js";import"./use-navigate-to-agent-_WYF41V-.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-D4BjUd_Q.js";import"./form-CIHkncRQ.js";import"./label-CmLwbefD.js";import"./input-oiex_Sqb.js";import"./drawer-CsmWGB6A.js";import"./collection-search-DFZjjhrH.js";import"./tabs-7O9mSdEa.js";import"./toggle-group-CArvNNKC.js";import"./agent-capabilities-udLJw-cm.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Do3n6-0X.js";import"./use-registry-connections-C948P_nl.js";import"./extract-connection-data-Du4c1lRI.js";import"./collection-tabs-DKk8l5Nv.js";import"./textarea-DTygx-PF.js";import"./connection-form-helpers-2Hj68sfK.js";import"./authenticate-and-persist-oauth-Bbf69cXY.js";import"./mcp-oauth-CdnuFysO.js";import"./connect-desktop-dialog-D3fwzLbi.js";import"./select-model-CXARzc0b.js";import"./skeleton-h_Rrfd9X.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CIZ7OrhY.js";import"./dropdown-menu-BXp0fOBv.js";import"./index-BPc0E2v5.js";import"./toolbar-Cap3B0tq.js";import"./use-debounced-value-CrZFsUmt.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CtrLXRrg.js";import"./use-mcp-tools-aSGZtgAI.js";import"./use-capability-BDb9Fsiz.js";import"./tools-list-S4uoHI5a.js";import"./switch-5bdjLWcS.js";import"./use-debounced-autosave-DcfXuKw9.js";import"./index-w7ppCtrf.js";import"./search-input-DUPgDj3Q.js";import"./github-repo-picker-CnKj3G6a.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-B8xSCB_X.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-l7TANBTQ.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DuEt6MhW.js";import"./toolbar-icon-button-j_UeiHvv.js";import"./use-file-configs-uzLbxssm.js";import"./automation-list-row-DBzmw45u.js";function Tt(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",a=Bt(t,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function kr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:m,decofile:c,title:Z,excludeFields:G,schemaPending:at,previewBaseUrl:nt}=l,H=at===void 0?!1:at,u=nt===void 0?null:nt,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let C;t[0]!==G||t[1]!==m||t[2]!==x?(C=wt(x,m,G),t[0]=G,t[1]=m,t[2]=x,t[3]=C):C=t[3];const h=C;let R;t[4]!==h?(R=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=R):R=t[5];const J=R;let E;t[6]!==n||t[7]!==i||t[8]!==m||t[9]!==Z?(E=Z??(n?At(i,n,m):i),t[6]=n,t[7]=i,t[8]=m,t[9]=Z,t[10]=E):E=t[10];const v=E;let K;t[11]!==a||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:a},t[11]=a,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let F;t[15]!==a||t[16]!==s||t[17]!==f?(F={orgSlug:s,virtualMcpId:f,branch:a},t[15]=a,t[16]=s,t[17]=f,t[18]=F):F=t[18];const X=Ct(F);let T;t[19]!==b?(T=Et((e,r)=>b(e,r)),t[19]=b,t[20]=T):T=t[20];const Y=T,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=[],t[21]=$):$=t[21];const[p,ft]=w.useState($),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==n?(O=n??{},t[22]=n,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let q;t[26]!==it||t[27]!==g?(q={...it,...g},t[26]=it,t[27]=g,t[28]=q):q=t[28];const mt=q;let z;t[29]!==i||t[30]!==x||t[31]!==b?(z=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=z):z=t[32];const st=z;let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=e=>{ft(e)},t[33]=L):L=t[33];const pt=L;let V;t[34]!==c||t[35]!==Q||t[36]!==X?(V=async(e,r)=>{try{const{blockKey:d,data:N}=Tt(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=V):V=t[37];const y=V;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let D;t[41]!==p||t[42]!==v?(D=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=D):D=t[43];const A=D;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Rt(p,r)),dt($t)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let _;t[48]!==W?(_=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=_):_=t[49];let j;t[50]!==S||t[51]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,_]}),t[50]=S,t[51]=_,t[52]=j):j=t[52];let k;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==H?(k=o.jsx(jt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ft,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):H?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=H,t[66]=k):k=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(kt,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let M;return t[73]!==j||t[74]!==k||t[75]!==B?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,B]}),t[73]=j,t[74]=k,t[75]=B,t[76]=M):M=t[76],M}function $t(l){return l+1}function Pt(l){return l+1}export{kr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as B,j as o,$ as z,b as L,r as M,B as T,M as N}from"./index-Dgf9uMoE.js";import{s as q}from"./Plus-BWS7YRCt.js";import{i as S}from"./Zap-DWMv1jO1.js";import{S as D}from"./search-input-DUPgDj3Q.js";import{P as l}from"./index-w7ppCtrf.js";import{E as b}from"./empty-state-DUwhZpUT.js";import{c as O}from"./use-automations-DI4zmIKR.js";import{c as V}from"./use-navigate-to-agent-_WYF41V-.js";import{A as F}from"./automation-list-row-DBzmw45u.js";import{e as G}from"./constants-B72Xmt_K.js";import{a as H}from"./use-virtual-mcp-CjUwVbqH.js";import{R as J}from"./require-capability-CC8Cb4eK.js";import"./SearchMd-D3a2hIUP.js";import"./sidebar-DGCj3BzG.js";import"./LayoutLeft-CIXRhIgm.js";import"./use-mobile-B-H7VJlh.js";import"./X-CAX-FceB.js";import"./tooltip-1foZ_k7s.js";import"./use-mcp-client-DbUnPC2U.js";import"./auth-DBkkYg-T.js";import"./studio-tools-BaimbcRe.js";import"./hooks-Cln-uffe.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-C4qC2FY4.js";import"./dropdown-menu-BXp0fOBv.js";import"./Check-DT0Ecfph.js";import"./ChevronRight-Brlyqvfv.js";import"./Circle-gozopXYF.js";import"./Stars02-H_ePh5tT.js";import"./DotsVertical-CuOtMg5m.js";import"./Trash01-CqJAv-4z.js";import"./agent-icon-DryRwerX.js";import"./AlertCircle-DvQdKX2P.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./Settings02-CJWk9pL-.js";import"./XCircle-D6yhOy3u.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./ZapSquare-do_RxxO8.js";import"./Users03-BQZ9UhFk.js";import"./Loading02-BYDO_yva.js";import"./CheckCircle-B3kM3-nx.js";import"./ChevronDown-BL5D5Kww.js";import"./ChevronUp-D4h43NMl.js";import"./Copy01-DVjpmGSQ.js";import"./ZoomOut-DK6J-pHc.js";import"./Globe01-fOy2mEYg.js";import"./Eye-cte0MnVy.js";import"./FilterLines-B1MBg_Jt.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./Key01-BhnYqbq5.js";import"./LinkExternal01-Br3p9c4J.js";import"./List-DZFJgfGO.js";import"./Monitor01-8NNEYlGa.js";import"./Sun-DvwmIRmO.js";import"./Palette-BEYm0oRU.js";import"./Play-BAkY7Fxv.js";import"./SearchLg-sYqeRxUE.js";import"./Shield01-1T25s-tn.js";import"./Stars01-5MzsUK6G.js";import"./Upload01-BEmoOwcr.js";import"./User01-Ckt1oKpR.js";import"./Users01-C3ZswPLc.js";import"./XClose-DuZ4u7Uu.js";import"./use-collections-zePUbAs4.js";import"./use-capability-BDb9Fsiz.js";import"./access-gate-BoaBcBcQ.js";import"./capability-load-error-jhIJPxL6.js";function K(){const t=B.c(16),{org:i}=z(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=L(),[f,E]=M.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const $=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(T,{size:"sm",onClick:$,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function fo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{fo as default};
@@ -1 +0,0 @@
1
- import{c as K,Z as ze,$ as Ie,p as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,M as H,t as L,r as Te,J as Ue,l as _e,ac as fe}from"./index-Dgf9uMoE.js";import{t as Xe}from"./ChevronDown-BL5D5Kww.js";import{i as He}from"./ChevronRight-Brlyqvfv.js";import{s as qe,t as Me}from"./Star01-LBoyDaKY.js";import{n as Ve}from"./LinkExternal01-Br3p9c4J.js";import{s as Re}from"./Plus-BWS7YRCt.js";import{s as Qe}from"./Trash01-CqJAv-4z.js";import{i as Ge}from"./Zap-DWMv1jO1.js";import{c as Je,b as Ye,d as Ze,A as We,g as et,e as tt,a as st,f as nt}from"./alert-dialog-C4qC2FY4.js";import{I as ue}from"./input-oiex_Sqb.js";import{T as lt}from"./textarea-DTygx-PF.js";import{P as Ne}from"./index-w7ppCtrf.js";import{u as $e}from"./studio-tools-BaimbcRe.js";import{u as ot}from"./use-debounced-autosave-DcfXuKw9.js";import{R as rt}from"./require-capability-CC8Cb4eK.js";import"./sidebar-DGCj3BzG.js";import"./LayoutLeft-CIXRhIgm.js";import"./use-mobile-B-H7VJlh.js";import"./X-CAX-FceB.js";import"./tooltip-1foZ_k7s.js";import"./use-capability-BDb9Fsiz.js";import"./access-gate-BoaBcBcQ.js";import"./capability-load-error-jhIJPxL6.js";function we(t){const e=K.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let c;e[2]!==s?(c=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Ge,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:yt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[63]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=Q):Q=e[64];let G,J;e[65]!==X?(G=j=>{j.stopPropagation(),X()},J=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=G,e[67]=J):(G=e[66],J=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let Y;e[68]!==Be?(Y=_e(Be),e[68]=Be,e[69]=Y):Y=e[69];let Z;e[70]!==Y?(Z=n.jsx(Me,{size:13,className:Y}),e[70]=Y,e[71]=Z):Z=e[71];let W;e[72]!==Q||e[73]!==G||e[74]!==J||e[75]!==ke||e[76]!==Z?(W=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:J,title:ke,children:Z}),e[72]=Q,e[73]=G,e[74]=J,e[75]=ke,e[76]=Z,e[77]=W):W=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Qe,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==W?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,W,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=W,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Je,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Ye,{children:[je,n.jsx(Ze,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(We,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function Wt(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{Wt as default};
@@ -1 +0,0 @@
1
- import{c as Q,l as Y,j as t,r as W,B as J,i as le}from"./index-Dgf9uMoE.js";import{a9 as Z}from"./agent-icon-DryRwerX.js";import{i as ie}from"./X-CAX-FceB.js";import{L as O}from"./label-CmLwbefD.js";import{I as oe,R as re,a as ae}from"./index-BCuWJvJV.js";import{i as ce}from"./Circle-gozopXYF.js";import{a as ne,c as me,d as de,S as pe,b as xe}from"./select-Ct8ODrmD.js";import{a as fe,b as ue,T as he}from"./tooltip-1foZ_k7s.js";import"./AlertCircle-DvQdKX2P.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./Settings02-CJWk9pL-.js";import"./XCircle-D6yhOy3u.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./ZapSquare-do_RxxO8.js";import"./Users03-BQZ9UhFk.js";import"./Loading02-BYDO_yva.js";import"./CheckCircle-B3kM3-nx.js";import"./Check-DT0Ecfph.js";import"./ChevronDown-BL5D5Kww.js";import"./ChevronRight-Brlyqvfv.js";import"./ChevronUp-D4h43NMl.js";import"./Stars02-H_ePh5tT.js";import"./Copy01-DVjpmGSQ.js";import"./ZoomOut-DK6J-pHc.js";import"./DotsVertical-CuOtMg5m.js";import"./Globe01-fOy2mEYg.js";import"./Eye-cte0MnVy.js";import"./FilterLines-B1MBg_Jt.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./Key01-BhnYqbq5.js";import"./LayoutLeft-CIXRhIgm.js";import"./LinkExternal01-Br3p9c4J.js";import"./List-DZFJgfGO.js";import"./Monitor01-8NNEYlGa.js";import"./Sun-DvwmIRmO.js";import"./Palette-BEYm0oRU.js";import"./Play-BAkY7Fxv.js";import"./Plus-BWS7YRCt.js";import"./SearchLg-sYqeRxUE.js";import"./SearchMd-D3a2hIUP.js";import"./Shield01-1T25s-tn.js";import"./Stars01-5MzsUK6G.js";import"./Trash01-CqJAv-4z.js";import"./Upload01-BEmoOwcr.js";import"./User01-Ckt1oKpR.js";import"./Users01-C3ZswPLc.js";import"./XClose-DuZ4u7Uu.js";import"./Zap-DWMv1jO1.js";function ge(i){const e=Q.c(8);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=Y("grid gap-3",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=t.jsx(re,{"data-slot":"radio-group",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function X(i){const e=Q.c(9);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",o),e[3]=o,e[4]=r):r=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==r?(c=t.jsx(oe,{"data-slot":"radio-group-item",className:r,...s,children:l}),e[6]=s,e[7]=r,e[8]=c):c=e[8],c}function gt(i){const e=Q.c(69),{posts:o,categories:s,initialSlug:r,isPending:l,onApply:c,onClose:d}=i,[n,ee]=W.useState(r&&s.some(m=>m.slug===r)?r:s[0]?.slug??""),[p,te]=W.useState("add");let T;if(e[0]!==s||e[1]!==n){let m;e[3]!==n?(m=se=>se.slug===n,e[3]=n,e[4]=m):m=e[4],T=s.find(m),e[0]=s,e[1]=n,e[2]=T}else T=e[2];const x=T,a=o.length,K=a===1?"post":"posts";let f;e[5]!==a||e[6]!==K?(f=t.jsxs("span",{className:"truncate text-sm font-medium",children:[a," ",K," selected"]}),e[5]=a,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ie,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==d?(u=t.jsx(fe,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:d,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=t.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=a===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${a} ${a===1?"post":"posts"}.`;let j;e[19]!==M?(j=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==s||e[23]!==n?(b=t.jsxs("div",{className:"space-y-2",children:[B,s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):t.jsxs(ne,{value:n,onValueChange:ee,children:[t.jsx(me,{className:"w-full",children:t.jsx(de,{placeholder:"Select a category"})}),t.jsx(pe,{children:s.map(be)})]})]}),e[22]=s,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=m=>te(m),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==p?(y=t.jsxs(ge,{value:p,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=p,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==d?(N=t.jsx(J,{type:"button",variant:"outline",onClick:d,disabled:l,children:"Cancel"}),e[32]=l,e[33]=d,e[34]=N):N=e[34];const D=!x||l||a===0;let v;e[35]!==p||e[36]!==c||e[37]!==x?(v=()=>x&&c(p,{name:x.name,slug:x.slug}),e[35]=p,e[36]=c,e[37]=x,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?t.jsxs(t.Fragment,{children:[t.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=t.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=t.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=t.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=a===1?"post":"posts";let w;e[53]!==a||e[54]!==H?(w=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,t.jsxs("span",{className:"text-sm",children:[a," selected ",H]})]}),e[53]=a,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==a||e[57]!==o?(R=a===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):t.jsx("ul",{className:"divide-y border-t bg-background",children:o.map(je)}),e[56]=a,e[57]=o,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function be(i){return t.jsx(xe,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{gt as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{c as n,p as o,$ as c,j as t,ag as m,B as u,K as x}from"./index-Dgf9uMoE.js";function f(){const e=n.c(5),l=o(),{locator:a}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==a||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(a)}),children:"Try again"})]}),e[2]=a,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
@@ -1 +0,0 @@
1
- import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-Dgf9uMoE.js";import{i as X}from"./XCircle-D6yhOy3u.js";import{aI as Y,a9 as T}from"./agent-icon-DryRwerX.js";import{n as Z}from"./LinkExternal01-Br3p9c4J.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-C4qC2FY4.js";import{I as L}from"./input-oiex_Sqb.js";import{L as H}from"./label-CmLwbefD.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-loGM-Zqm.js";import{c as dt,B as ut,a as gt}from"./block-document-BGR4oU7t.js";import{u as xt,s as v,E as ft}from"./primitives-Ds0WLoLr.js";import{t as ht}from"./ChevronDown-BL5D5Kww.js";import{J as jt,K as yt,I as vt}from"./automation-runs-DHRDLBLv.js";import"./AlertCircle-DvQdKX2P.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./Settings02-CJWk9pL-.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./ZapSquare-do_RxxO8.js";import"./Users03-BQZ9UhFk.js";import"./Loading02-BYDO_yva.js";import"./CheckCircle-B3kM3-nx.js";import"./Check-DT0Ecfph.js";import"./ChevronRight-Brlyqvfv.js";import"./ChevronUp-D4h43NMl.js";import"./Circle-gozopXYF.js";import"./Stars02-H_ePh5tT.js";import"./Copy01-DVjpmGSQ.js";import"./ZoomOut-DK6J-pHc.js";import"./DotsVertical-CuOtMg5m.js";import"./Globe01-fOy2mEYg.js";import"./Eye-cte0MnVy.js";import"./FilterLines-B1MBg_Jt.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./Key01-BhnYqbq5.js";import"./LayoutLeft-CIXRhIgm.js";import"./List-DZFJgfGO.js";import"./Monitor01-8NNEYlGa.js";import"./Sun-DvwmIRmO.js";import"./Palette-BEYm0oRU.js";import"./Play-BAkY7Fxv.js";import"./Plus-BWS7YRCt.js";import"./SearchLg-sYqeRxUE.js";import"./SearchMd-D3a2hIUP.js";import"./Shield01-1T25s-tn.js";import"./Stars01-5MzsUK6G.js";import"./Trash01-CqJAv-4z.js";import"./Upload01-BEmoOwcr.js";import"./User01-Ckt1oKpR.js";import"./Users01-C3ZswPLc.js";import"./XClose-DuZ4u7Uu.js";import"./X-CAX-FceB.js";import"./Zap-DWMv1jO1.js";import"./chat-context-B0O0Okxx.js";import"./autosend-d6dIJs7M.js";import"./hooks-Cln-uffe.js";import"./use-mcp-client-DbUnPC2U.js";import"./constants-B72Xmt_K.js";import"./auth-DBkkYg-T.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CjUwVbqH.js";import"./use-collections-zePUbAs4.js";import"./use-ai-providers-CLhyvTsV.js";import"./studio-tools-BaimbcRe.js";import"./use-decopilot-events-BPApfysb.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-CsH8Ep36.js";import"./tooltip-1foZ_k7s.js";import"./dialog-B4FPUVJm.js";import"./drawer-CsmWGB6A.js";import"./collection-search-DFZjjhrH.js";import"./use-mobile-B-H7VJlh.js";import"./use-mcp-prompts-D4BjUd_Q.js";import"./shell-layout-B4WmiL97.js";import"./avatar-DWC-yfzJ.js";import"./required-auth-layout-Bxaf6y0u.js";import"./use-org-sso-BV4x4p-5.js";import"./form-CIHkncRQ.js";import"./select-Ct8ODrmD.js";import"./tabs-7O9mSdEa.js";import"./toggle-group-CArvNNKC.js";import"./agent-capabilities-udLJw-cm.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Do3n6-0X.js";import"./use-registry-connections-C948P_nl.js";import"./use-connection-BibmCEFD.js";import"./useInfiniteQuery-DWB8a2J-.js";import"./use-infinite-scroll-BmH_7PeD.js";import"./extract-connection-data-Du4c1lRI.js";import"./card-fRwe0bJZ.js";import"./integration-icon-aZSadBLO.js";import"./collection-tabs-DKk8l5Nv.js";import"./badge-DJdw3Rsl.js";import"./textarea-DTygx-PF.js";import"./connection-form-helpers-2Hj68sfK.js";import"./authenticate-and-persist-oauth-Bbf69cXY.js";import"./mcp-oauth-CdnuFysO.js";import"./useSuspenseInfiniteQuery-Ip6E6dwx.js";import"./connect-desktop-dialog-D3fwzLbi.js";import"./select-model-CXARzc0b.js";import"./checkbox-C1s1Cv92.js";import"./skeleton-h_Rrfd9X.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CIZ7OrhY.js";import"./command-CslXjYaI.js";import"./index-C2Xrxv4z.js";import"./popover-BjB-5tFY.js";import"./dropdown-menu-BXp0fOBv.js";import"./index-BPc0E2v5.js";import"./file-type-icon-BsGfZ7Mt.js";import"./toolbar-Cap3B0tq.js";import"./use-debounced-value-CrZFsUmt.js";import"./index-BE0jgIkY.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CtrLXRrg.js";import"./empty-state-DUwhZpUT.js";import"./use-mcp-tools-aSGZtgAI.js";import"./types-DI-1sdV1.js";import"./use-capability-BDb9Fsiz.js";import"./tools-list-S4uoHI5a.js";import"./switch-5bdjLWcS.js";import"./use-debounced-autosave-DcfXuKw9.js";import"./index-w7ppCtrf.js";import"./sidebar-DGCj3BzG.js";import"./search-input-DUPgDj3Q.js";import"./github-repo-picker-CnKj3G6a.js";import"./use-navigate-to-agent-_WYF41V-.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-B8xSCB_X.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-Buz_D9kT.js";import"./use-org-auth-client-Dr5MvmUs.js";import"./index-l7TANBTQ.js";import"./get-initials-D-f_fDFw.js";import"./format-time-Cy7tTmZp.js";import"./calendar-DuEt6MhW.js";import"./toolbar-icon-button-j_UeiHvv.js";import"./use-file-configs-uzLbxssm.js";import"./monaco-editor-d15d-RZJ.js";import"./use-automations-DI4zmIKR.js";import"./automation-list-row-DBzmw45u.js";import"./table-m4VurkE4.js";import"./use-clock-tick-BVVBiunA.js";import"./use-copy-DSFHRfjF.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function pr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,J=o=>s("slug",o),M=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},G=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){J(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:G,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&M(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{pr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as O,j as t,B as F,i as Y,G as Ge,H as te,P as Pe,r as $,$ as re,J as Qe,u as Ye,a6 as K,t as Xe,l as je,e as le,aW as ke}from"./index-Dgf9uMoE.js";import{E as Ae}from"./empty-state-DUwhZpUT.js";import{u as Ze,a as Ee}from"./use-collections-zePUbAs4.js";import{u as ae}from"./use-mcp-client-DbUnPC2U.js";import{F as se,a as et,b as ce,d as de}from"./form-CIHkncRQ.js";import{I as me}from"./input-oiex_Sqb.js";import{T as ie}from"./textarea-DTygx-PF.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-BrYQWjA0.js";import{as as it,L as rt,am as lt,an as at,ad as ct,at as dt,W as be}from"./agent-icon-DryRwerX.js";import{g as mt,M as ut,a as Ne}from"./types-DI-1sdV1.js";import{A as xt,a as pt,b as ft}from"./alert-Dd7VLodG.js";import{a as ve,c as Se,d as ye,S as we,b as ne}from"./select-Ct8ODrmD.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-1foZ_k7s.js";import{i as gt}from"./AlertCircle-DvQdKX2P.js";import{s as jt}from"./Stars02-H_ePh5tT.js";import{a as bt}from"./Copy01-DVjpmGSQ.js";import{i as Nt}from"./Play-BAkY7Fxv.js";import{a as Oe,b as Re,B as V,c as G,d as Q,e as _e}from"./breadcrumb-CbTWSDKt.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-S4uoHI5a.js";import{a as De,u as Me}from"./use-connection-BibmCEFD.js";import{a as wt}from"./use-mcp-tools-aSGZtgAI.js";import{M as Ct,c as It}from"./monaco-editor-d15d-RZJ.js";import{I as Te}from"./integration-icon-aZSadBLO.js";import{g as $t,l as Tt}from"./chat-context-B0O0Okxx.js";import{u as Pt}from"./shell-layout-B4WmiL97.js";import{n as kt}from"./XCircle-D6yhOy3u.js";import"./constants-B72Xmt_K.js";import"./auth-DBkkYg-T.js";import"./label-CmLwbefD.js";import"./index-w7ppCtrf.js";import"./sidebar-DGCj3BzG.js";import"./LayoutLeft-CIXRhIgm.js";import"./use-mobile-B-H7VJlh.js";import"./X-CAX-FceB.js";import"./ZoomOut-DK6J-pHc.js";import"./Key01-BhnYqbq5.js";import"./extract-connection-data-Du4c1lRI.js";import"./use-registry-connections-C948P_nl.js";import"./use-organization-settings-CsH8Ep36.js";import"./studio-tools-BaimbcRe.js";import"./Plus-BWS7YRCt.js";import"./index-Bt7VlfeQ.js";import"./index-BCuWJvJV.js";import"./index-C2Xrxv4z.js";import"./popover-BjB-5tFY.js";import"./use-virtual-mcp-CjUwVbqH.js";import"./Check-DT0Ecfph.js";import"./SearchMd-D3a2hIUP.js";import"./Users03-BQZ9UhFk.js";import"./use-create-virtual-mcp-BiykOxhR.js";import"./use-navigate-to-agent-_WYF41V-.js";import"./hooks-Cln-uffe.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./Settings02-CJWk9pL-.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./ZapSquare-do_RxxO8.js";import"./Loading02-BYDO_yva.js";import"./CheckCircle-B3kM3-nx.js";import"./ChevronDown-BL5D5Kww.js";import"./ChevronRight-Brlyqvfv.js";import"./ChevronUp-D4h43NMl.js";import"./Circle-gozopXYF.js";import"./DotsVertical-CuOtMg5m.js";import"./Globe01-fOy2mEYg.js";import"./Eye-cte0MnVy.js";import"./FilterLines-B1MBg_Jt.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./LinkExternal01-Br3p9c4J.js";import"./List-DZFJgfGO.js";import"./Monitor01-8NNEYlGa.js";import"./Sun-DvwmIRmO.js";import"./Palette-BEYm0oRU.js";import"./SearchLg-sYqeRxUE.js";import"./Shield01-1T25s-tn.js";import"./Stars01-5MzsUK6G.js";import"./Trash01-CqJAv-4z.js";import"./Upload01-BEmoOwcr.js";import"./User01-Ckt1oKpR.js";import"./Users01-C3ZswPLc.js";import"./XClose-DuZ4u7Uu.js";import"./Zap-DWMv1jO1.js";import"./mcp-oauth-CdnuFysO.js";import"./badge-DJdw3Rsl.js";import"./index-BE0jgIkY.js";import"./autosend-d6dIJs7M.js";import"./use-ai-providers-CLhyvTsV.js";import"./use-decopilot-events-BPApfysb.js";import"./tab-id-bb-jjgGv.js";import"./avatar-DWC-yfzJ.js";import"./dialog-B4FPUVJm.js";import"./alert-dialog-C4qC2FY4.js";import"./required-auth-layout-Bxaf6y0u.js";import"./use-org-sso-BV4x4p-5.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Ze(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=$t(),A=Tt(),{openSidePanel:U}=Pt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),J=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[D,X]=$.useState("json"),[ze,Le]=$.useState(!1);E&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const Z=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Je=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(V,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Ve=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:Z(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:a=>A?.setAppContext(z,a),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Je,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Ve}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Jt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Vt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Vt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(V,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Jt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let J;return s[38]!==L||s[39]!==E?(J=t.jsx(ue,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=J):J=s[40],J}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Vn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Vn as default};
@@ -1 +0,0 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-Dgf9uMoE.js";import{d as z,a as _,c as $,D as E}from"./dropdown-menu-BXp0fOBv.js";import{i as L,n as O,b as R,c as A}from"./SwitchHorizontal01-CEx7u3Ha.js";import{i as S}from"./Check-DT0Ecfph.js";import{i as F}from"./List-DZFJgfGO.js";import{a as I,b as K,c as P,T as W}from"./tooltip-1foZ_k7s.js";import{V as q}from"./view-mode-toggle-IUxgH98b.js";import{B as G}from"./badge-DJdw3Rsl.js";function re(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(F,{})},{value:"cards",icon:s.jsx(A,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{re as C};
@@ -1 +0,0 @@
1
- import{c as k,j as s,l as C}from"./index-Dgf9uMoE.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-m4VurkE4.js";import{i as D,n as E}from"./SwitchHorizontal01-CEx7u3Ha.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};