decocms 4.319.7 → 4.319.8

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 (246) hide show
  1. package/dist/client/assets/{AlertCircle-RmDfWWB1.js → AlertCircle-f4nnpTTg.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Bxq_kLgD.js → AreaChart-8HavjRhs.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BNGHL2is.js → ArrowLeft-DeVXQ_Zc.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CCCG4uD8.js → ArrowUp-HzO4dq_k.js} +1 -1
  5. package/dist/client/assets/{Check-CMcrSGq4.js → Check-DzHuFHoL.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BZ_VJF1Y.js → CheckCircle-tNccGo23.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-CjoGJTaF.js → ChevronDown-s4Re3J16.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DLfQb7o8.js → ChevronRight-DtOnXnjv.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-BmYKo6f0.js → ChevronSelectorVertical-CwgLFWq0.js} +1 -1
  10. package/dist/client/assets/{ChevronUp--L2cn8UF.js → ChevronUp-Xpnsttw1.js} +1 -1
  11. package/dist/client/assets/{Copy01-t2OLtrnB.js → Copy01-BRPiRRUQ.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BSCxoB6N.js → CreditCard01-D7nD4MoT.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DmeUsVvJ.js → DotsVertical-BVchZPc_.js} +1 -1
  14. package/dist/client/assets/{Download01-CYAg8W5B.js → Download01-C8Yiywz6.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-BLm7jjwY.js → ErrorBarContext-Bhb5Qpt4.js} +1 -1
  16. package/dist/client/assets/{Eye-Dy7Gk0Xt.js → Eye-WB67QJ1C.js} +1 -1
  17. package/dist/client/assets/{FilterLines-CsGLiybF.js → FilterLines-pNRXDJ_z.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-BTXEMA0k.js → GitBranch01-ByUdctAW.js} +1 -1
  19. package/dist/client/assets/{Globe01-D2SWA6aV.js → Globe01-DXAw5CTM.js} +1 -1
  20. package/dist/client/assets/{Globe04-CY5sEEdx.js → Globe04-Cjk5Mw2y.js} +1 -1
  21. package/dist/client/assets/{HardDrive-Cfo2QjQ1.js → HardDrive-BTi8s38H.js} +1 -1
  22. package/dist/client/assets/{Image01-Bk-NSMSs.js → Image01-fT4xR6P_.js} +1 -1
  23. package/dist/client/assets/{Key01--XvWEe9Q.js → Key01-CHTC8hwE.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-DXIJl-2q.js → LinkExternal01-kAtb5ILy.js} +1 -1
  25. package/dist/client/assets/{LockUnlocked01-Bey4SIAd.js → LockUnlocked01-C4X5qfRd.js} +1 -1
  26. package/dist/client/assets/{LogOut01-nae5zUB9.js → LogOut01-BkpjlgBP.js} +1 -1
  27. package/dist/client/assets/{Monitor01-D0uHbg8n.js → Monitor01-Dhk7PXVV.js} +1 -1
  28. package/dist/client/assets/{Package-CZZ4PusZ.js → Package-CHpW5VM0.js} +1 -1
  29. package/dist/client/assets/{Palette-Bm8uQz-a.js → Palette-BYFK4FA5.js} +1 -1
  30. package/dist/client/assets/{Play-BDHx6xUV.js → Play-CZP4IMzd.js} +1 -1
  31. package/dist/client/assets/{Plus-DsbRnoOt.js → Plus-CYNImaOJ.js} +1 -1
  32. package/dist/client/assets/{SearchLg-B7JpdJS1.js → SearchLg-8uAbG9P4.js} +1 -1
  33. package/dist/client/assets/{SearchMd-Vz_-9QqS.js → SearchMd-bD349BM3.js} +1 -1
  34. package/dist/client/assets/{Sector-BFUoUHo2.js → Sector-tGY4Py8B.js} +1 -1
  35. package/dist/client/assets/{Settings02-5XByl1dU.js → Settings02-CfL_uUCf.js} +1 -1
  36. package/dist/client/assets/{Share07-CY9TyDW3.js → Share07-CPaO5Jno.js} +1 -1
  37. package/dist/client/assets/{Shield01-JyKrsX11.js → Shield01-Y6gzbv7o.js} +1 -1
  38. package/dist/client/assets/{Stars01-BzZ30BuE.js → Stars01-_AATW4G8.js} +1 -1
  39. package/dist/client/assets/{Stars02-Du35s2ko.js → Stars02-CqIkzwRk.js} +1 -1
  40. package/dist/client/assets/{Sun-DTzMPtU4.js → Sun-CwIE4PFj.js} +1 -1
  41. package/dist/client/assets/{SwitchHorizontal01-CzXRCyWz.js → SwitchHorizontal01-BJLtWFX5.js} +1 -1
  42. package/dist/client/assets/{Tool01-DIVRpFEj.js → Tool01-hZtg6GbK.js} +1 -1
  43. package/dist/client/assets/{Tool02-36UedhX_.js → Tool02-DiIiNPwu.js} +1 -1
  44. package/dist/client/assets/{Trash01-BkZOPZ1F.js → Trash01-Bji2bWWh.js} +1 -1
  45. package/dist/client/assets/{TrendUp01-BPrRs2GV.js → TrendUp01-Y6CIxEGk.js} +1 -1
  46. package/dist/client/assets/{Upload01-lJGqMu88.js → Upload01-CYRB-7yG.js} +1 -1
  47. package/dist/client/assets/{User01-kVN08-rP.js → User01-xX8OC8Hl.js} +1 -1
  48. package/dist/client/assets/{UserSquare-B4nTC6Up.js → UserSquare-B8RaUikS.js} +1 -1
  49. package/dist/client/assets/{Users01-BKIaNyuX.js → Users01-x11CoUFz.js} +1 -1
  50. package/dist/client/assets/{Users03-DxMpuryd.js → Users03-Bg19q-V-.js} +1 -1
  51. package/dist/client/assets/{XCircle-BiAG3_o-.js → XCircle-YqRo5mD9.js} +1 -1
  52. package/dist/client/assets/{XClose-Dy9_68Fl.js → XClose-DyyJkORZ.js} +1 -1
  53. package/dist/client/assets/{YAxis-Bn1sD-jh.js → YAxis-DVHrIG29.js} +1 -1
  54. package/dist/client/assets/{Zap-bTmIcWrz.js → Zap-DBnrIpUC.js} +1 -1
  55. package/dist/client/assets/{ZapSquare-DQpxhOTW.js → ZapSquare-tVtrCpPj.js} +1 -1
  56. package/dist/client/assets/{ZoomOut-wNrKwTvt.js → ZoomOut-CVtN6QQg.js} +1 -1
  57. package/dist/client/assets/{access-gate-CSvwSPbV.js → access-gate-EoGcByM_.js} +1 -1
  58. package/dist/client/assets/{agent-icon-BVZRzxwR.js → agent-icon-DXnqgUdn.js} +1 -1
  59. package/dist/client/assets/{agents-list-BLMdeLal.js → agents-list-CjROH5af.js} +1 -1
  60. package/dist/client/assets/{ai-providers-wRTjY-9I.js → ai-providers-B9LmqS60.js} +1 -1
  61. package/dist/client/assets/{alert-H1NhcHHV.js → alert-B5gYqXvO.js} +1 -1
  62. package/dist/client/assets/{alert-dialog-L0qx6i6s.js → alert-dialog-C1vr7a0B.js} +1 -1
  63. package/dist/client/assets/{analytics-tab-DX_oRkmZ.js → analytics-tab-Dxb2aOcG.js} +1 -1
  64. package/dist/client/assets/{api-keys-D6oQ-S2x.js → api-keys-BVShXcJP.js} +1 -1
  65. package/dist/client/assets/{app-editor-NCpgz-kr.js → app-editor-DqQdEHcH.js} +1 -1
  66. package/dist/client/assets/{auth-DlWrMWjY.js → auth-DXJPvHb_.js} +1 -1
  67. package/dist/client/assets/{auth-catchall-D0xCfSsC.js → auth-catchall-By1cz0Yu.js} +1 -1
  68. package/dist/client/assets/{auth-entry-t33i1B3q.js → auth-entry-B88UFhdg.js} +1 -1
  69. package/dist/client/assets/{auth-split-layout-DlFk6Di3.js → auth-split-layout-Ub6OTBhx.js} +1 -1
  70. package/dist/client/assets/{authenticate-and-persist-oauth-woXc6jrT.js → authenticate-and-persist-oauth-B322JeMG.js} +1 -1
  71. package/dist/client/assets/{automation-list-row-DG5dUHEh.js → automation-list-row-l6-XvZu6.js} +1 -1
  72. package/dist/client/assets/{automation-runs-B1QvBcUO.js → automation-runs-BwFV9_XZ.js} +1 -1
  73. package/dist/client/assets/{automations-3xUqxF1a.js → automations-DBKn4Q8k.js} +1 -1
  74. package/dist/client/assets/{avatar-CrpmBG4U.js → avatar-CpPlf24-.js} +1 -1
  75. package/dist/client/assets/{badge-o9MTCHXi.js → badge-CFKeX0mn.js} +1 -1
  76. package/dist/client/assets/{block-document-DTaaYlQh.js → block-document-BL7oMI74.js} +1 -1
  77. package/dist/client/assets/{breadcrumb-DdX6SJH1.js → breadcrumb-QKUdhBOY.js} +1 -1
  78. package/dist/client/assets/{buckets-BbyLFsrZ.js → buckets-DMVRQiOf.js} +1 -1
  79. package/dist/client/assets/{bulk-category-panel-D1KbF1yy.js → bulk-category-panel-B1qs1Dmy.js} +1 -1
  80. package/dist/client/assets/{capability-load-error-D1mAZ573.js → capability-load-error-RVzxs7io.js} +1 -1
  81. package/dist/client/assets/{cards-Cgj3-S7j.js → cards-BKe88FKP.js} +1 -1
  82. package/dist/client/assets/{category-editor-BAAZA7qC.js → category-editor-CacTrWLl.js} +1 -1
  83. package/dist/client/assets/{cdn-tab-B3bXac4Z.js → cdn-tab-Cy5BeFj-.js} +1 -1
  84. package/dist/client/assets/{chart-6BEeqhn8.js → chart-aqo9QCpr.js} +1 -1
  85. package/dist/client/assets/{chat-context-D_yTO8Wi.js → chat-context-CgRJgEvq.js} +1 -1
  86. package/dist/client/assets/{checkbox-COXniVrf.js → checkbox-BoivotQ-.js} +1 -1
  87. package/dist/client/assets/{choose-editor-DJllq4xP.js → choose-editor-QTv7--m3.js} +1 -1
  88. package/dist/client/assets/{cli-auth-success-uegggAWH.js → cli-auth-success-DTyiOyJd.js} +1 -1
  89. package/dist/client/assets/{collection-detail-Br49iGvw.js → collection-detail-NjFsNfcb.js} +1 -1
  90. package/dist/client/assets/{collection-display-button-8NzhICbK.js → collection-display-button-IsQl2qfL.js} +1 -1
  91. package/dist/client/assets/{collection-search-CVaeQHld.js → collection-search-BLs0Fnfs.js} +1 -1
  92. package/dist/client/assets/{collection-table-wrapper-BdDifBik.js → collection-table-wrapper-fvU83bN6.js} +1 -1
  93. package/dist/client/assets/{collection-tabs-mVsENYKi.js → collection-tabs-Ir5Tsafl.js} +1 -1
  94. package/dist/client/assets/{command-CDjRpAST.js → command-B5mpvvDf.js} +1 -1
  95. package/dist/client/assets/{commerce-onboarding-t2DOflkA.js → commerce-onboarding-CTAvWzNK.js} +1 -1
  96. package/dist/client/assets/{config-DbZZ6yr6.js → config-lfQlN5yZ.js} +1 -1
  97. package/dist/client/assets/{connect-DkqLe0-y.js → connect-BlZW6L0a.js} +1 -1
  98. package/dist/client/assets/{connection-card-BTjW1qCi.js → connection-card-R6-YJNhI.js} +1 -1
  99. package/dist/client/assets/{connection-detail-bO4cqDJR.js → connection-detail-Bp_SrWC0.js} +1 -1
  100. package/dist/client/assets/{connection-form-helpers-DVafqfi_.js → connection-form-helpers-CObw_4nL.js} +1 -1
  101. package/dist/client/assets/{connection-CumhSPUp.js → connection-rpamShLy.js} +1 -1
  102. package/dist/client/assets/{connections-BHRXdtIS.js → connections-BS5_DsBn.js} +1 -1
  103. package/dist/client/assets/{decopilot-sse-pool-DZv9gsIL.js → decopilot-sse-pool-POUs7TGl.js} +1 -1
  104. package/dist/client/assets/{dialog-CLmeJCvy.js → dialog-pwZ4KzZ6.js} +1 -1
  105. package/dist/client/assets/{domain-settings-DjNxzmaZ.js → domain-settings-NdGxfDzI.js} +1 -1
  106. package/dist/client/assets/{drawer-SLxMT12H.js → drawer-C-xsc5eG.js} +1 -1
  107. package/dist/client/assets/{dropdown-menu-Y5klxs5R.js → dropdown-menu-C16L90Tz.js} +1 -1
  108. package/dist/client/assets/{e2e-tab-B1yBl1Xi.js → e2e-tab-C2uDcahp.js} +1 -1
  109. package/dist/client/assets/{editor-BWyYvDPl.js → editor-BHb3kJQ5.js} +1 -1
  110. package/dist/client/assets/{empty-state-BVQl3CM1.js → empty-state-C64gXBQU.js} +1 -1
  111. package/dist/client/assets/{empty-state-Bzhb7xfM.js → empty-state-DvA7VyTt.js} +1 -1
  112. package/dist/client/assets/{extract-connection-data-DBygL9Ff.js → extract-connection-data-CqOTDUuA.js} +1 -1
  113. package/dist/client/assets/{file-explorer-DKz0ctdn.js → file-explorer-CWrCpfsa.js} +1 -1
  114. package/dist/client/assets/{file-type-icon-DKwFQUrg.js → file-type-icon-xQ7VVCet.js} +1 -1
  115. package/dist/client/assets/{folder-icon-CvFZ67nf.js → folder-icon-DpeG2vsd.js} +1 -1
  116. package/dist/client/assets/{form-BhmieFHl.js → form-ENCNwobk.js} +1 -1
  117. package/dist/client/assets/{general-DqC7rf9Y.js → general-DOGR2kAx.js} +1 -1
  118. package/dist/client/assets/{github-repo-picker-CPP6CKCn.js → github-repo-picker-BO3njSCf.js} +1 -1
  119. package/dist/client/assets/{hooks-Bj6hNUFL.js → hooks-DamZm9Dl.js} +1 -1
  120. package/dist/client/assets/{hosting-tab-BDHy5Zp3.js → hosting-tab-DHOJ7E0g.js} +1 -1
  121. package/dist/client/assets/{index-XlZPQyL9.js → index-BHv8b4bS.js} +1 -1
  122. package/dist/client/assets/{index-DbRvG53L.js → index-BxeEwMkO.js} +1 -1
  123. package/dist/client/assets/{index-D459Ldmw.js → index-CVEDX-YS.js} +1 -1
  124. package/dist/client/assets/{index-DR-VR2Og.js → index-CwiVxNC1.js} +1 -1
  125. package/dist/client/assets/{index-ygoeB01B.js → index-DZLUP-bk.js} +3 -3
  126. package/dist/client/assets/{index-0hzf5p67.js → index-Dg38LHEr.js} +1 -1
  127. package/dist/client/assets/{index-YU_r-OSr.js → index-DqZsb0Td.js} +6 -6
  128. package/dist/client/assets/{index-Cg2dMEIi.js → index-Nfz_WfAJ.js} +1 -1
  129. package/dist/client/assets/{index-wc_UedlX.js → index-TjmjDCyo.js} +1 -1
  130. package/dist/client/assets/{index-redirect-B1ocOC72.js → index-redirect-CJJKpI9F.js} +1 -1
  131. package/dist/client/assets/{infra-billing-ChM1qbkW.js → infra-billing-DJPDSczQ.js} +1 -1
  132. package/dist/client/assets/{input-BbML9Nmm.js → input-Cvmwm8KN.js} +1 -1
  133. package/dist/client/assets/{integration-icon-CC4Y31FZ.js → integration-icon-DwhAeNBu.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-KxcqPjYn.js → invite-member-dialog-CgJgzzFp.js} +1 -1
  135. package/dist/client/assets/{label-BZuUXuoD.js → label-DZWNE7Y7.js} +1 -1
  136. package/dist/client/assets/{layout-DXtLEpjO.js → layout-SayPzP68.js} +1 -1
  137. package/dist/client/assets/{login-CyaM0ub6.js → login-C_A381mF.js} +1 -1
  138. package/dist/client/assets/{markdown-QHOZW3yA.js → markdown-C1ZA9C8N.js} +1 -1
  139. package/dist/client/assets/{mcp-oauth-DxDxYsmM.js → mcp-oauth-BfeN-QCK.js} +1 -1
  140. package/dist/client/assets/{members-DI-2x27i.js → members-Dgq0PRrT.js} +1 -1
  141. package/dist/client/assets/{monaco-editor-DoVJJbtY.js → monaco-editor-BJGC8gh7.js} +1 -1
  142. package/dist/client/assets/{monitoring-stats-row-xCIh2mjA.js → monitoring-stats-row-DZOfJtdy.js} +1 -1
  143. package/dist/client/assets/{multi-select-Dty3beLI.js → multi-select-KLejsge1.js} +1 -1
  144. package/dist/client/assets/{oauth-callback-CHvJCPHa.js → oauth-callback-Czlma0i-.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-ai-provider-Cpn6QcNh.js → oauth-callback-ai-provider-ZdrQnvUS.js} +1 -1
  146. package/dist/client/assets/{onboarding-X-86Jc55.js → onboarding-B5ZjDPzC.js} +1 -1
  147. package/dist/client/assets/{org-layout-DKn-hlKp.js → org-layout-CdHLlafN.js} +1 -1
  148. package/dist/client/assets/{organization-choice-CjxXFvze.js → organization-choice-DOTxufBd.js} +1 -1
  149. package/dist/client/assets/{orgs-CupGUIPm.js → orgs-Dge8GFI6.js} +1 -1
  150. package/dist/client/assets/{page-seo-form-CP2pbi7O.js → page-seo-form-AxX8GGlf.js} +1 -1
  151. package/dist/client/assets/{popover-Br4XvIdI.js → popover-CGQv5zzi.js} +1 -1
  152. package/dist/client/assets/{post-calendar-BJUWUGwv.js → post-calendar-BKq3211e.js} +1 -1
  153. package/dist/client/assets/{post-editor-B_DMKQ3f.js → post-editor-pVnpiqgd.js} +1 -1
  154. package/dist/client/assets/{primitives-BdMuLV4E.js → primitives-CiTG7vqX.js} +1 -1
  155. package/dist/client/assets/{profile-C__08fBx.js → profile-Beo16CzY.js} +1 -1
  156. package/dist/client/assets/{project-app-view-bhJvbl4o.js → project-app-view-CCRiXSdc.js} +1 -1
  157. package/dist/client/assets/{prompts-DFmVumWY.js → prompts-DkqB1QMP.js} +1 -1
  158. package/dist/client/assets/record-editor-B4GimSNa.js +1 -0
  159. package/dist/client/assets/{redirect-editor-BSNKGGdN.js → redirect-editor-DGmMBPF8.js} +1 -1
  160. package/dist/client/assets/registry-BsOqDmeP.js +2 -0
  161. package/dist/client/assets/{registry-layout-Cu0igRoV.js → registry-layout-CzKQ-sVC.js} +1 -1
  162. package/dist/client/assets/{reports-Bpt3ASUy.js → reports-CFFIWbjE.js} +1 -1
  163. package/dist/client/assets/{require-capability-DT5PyiAq.js → require-capability-CCEb5Sqs.js} +1 -1
  164. package/dist/client/assets/{required-auth-layout-RI0Rgpr1.js → required-auth-layout-BmpA_-kW.js} +1 -1
  165. package/dist/client/assets/{reset-password-D0d52oKe.js → reset-password-CnsdaXsq.js} +1 -1
  166. package/dist/client/assets/{review-settings-Bg2mt1WZ.js → review-settings-gifV-niU.js} +1 -1
  167. package/dist/client/assets/{roles-KfXy9nFt.js → roles-CcQAq0Yr.js} +1 -1
  168. package/dist/client/assets/{schema-D1PTLZoj.js → schema-B2Qlbge8.js} +1 -1
  169. package/dist/client/assets/{scroll-area-ChMFgJZQ.js → scroll-area-D1Ypr2e7.js} +1 -1
  170. package/dist/client/assets/{search-input-DhOjZQ9T.js → search-input-CXMFw9Ub.js} +1 -1
  171. package/dist/client/assets/{secrets-CccjUopH.js → secrets-BOs-6B5A.js} +1 -1
  172. package/dist/client/assets/{sections-editor-DPEAPUfu.js → sections-editor-D7y_-PRI.js} +1 -1
  173. package/dist/client/assets/{select-DB6__ViP.js → select-SMcDHH3S.js} +1 -1
  174. package/dist/client/assets/{select-model-B_OAB8dw.js → select-model-C4PjzdGN.js} +1 -1
  175. package/dist/client/assets/{self-tool-result-6JqgkdnQ.js → self-tool-result-DFm5BFLJ.js} +1 -1
  176. package/dist/client/assets/{seo-editor-jvVO1ljZ.js → seo-editor-SQz-vDBx.js} +1 -1
  177. package/dist/client/assets/{settings-layout-B5EijCfK.js → settings-layout-DT1hD9Qc.js} +1 -1
  178. package/dist/client/assets/{shell-controls-BlQ0AWMv.js → shell-controls-BtldDShr.js} +1 -1
  179. package/dist/client/assets/{shell-layout-B4DGPaJE.js → shell-layout-OPAbVfwZ.js} +1 -1
  180. package/dist/client/assets/{skill-preview-DG2p4vzB.js → skill-preview-CyY0OP_z.js} +1 -1
  181. package/dist/client/assets/{skills-mEZ4URyq.js → skills-DdosW6Bc.js} +1 -1
  182. package/dist/client/assets/{spinner-DBih_T6j.js → spinner-BJLy3OGx.js} +1 -1
  183. package/dist/client/assets/{sso-DwFXfkv9.js → sso-D53JjpHs.js} +1 -1
  184. package/dist/client/assets/{store-BXU91Mku.js → store-lWrTp8UV.js} +1 -1
  185. package/dist/client/assets/store-registry-CbRGhfLY.js +2 -0
  186. package/dist/client/assets/{super-agent-icon-tE09KgxD.js → super-agent-icon-Bnh5ToBT.js} +1 -1
  187. package/dist/client/assets/{switch-BeKb78iP.js → switch-C2vAz9hZ.js} +1 -1
  188. package/dist/client/assets/{synced-repos-CvSG6gCS.js → synced-repos-BhphaVQf.js} +1 -1
  189. package/dist/client/assets/{table-DJIeRc2m.js → table-C2U6VD6y.js} +1 -1
  190. package/dist/client/assets/{tabs-C0n0SKSR.js → tabs-B70ZS4po.js} +1 -1
  191. package/dist/client/assets/{task-board-ZkwmcnXT.js → task-board-DTv9gW69.js} +1 -1
  192. package/dist/client/assets/{tasks-DGUH4Bcj.js → tasks-DaUPg9Cd.js} +1 -1
  193. package/dist/client/assets/{textarea-BEF_54uu.js → textarea-DsyQQY8o.js} +1 -1
  194. package/dist/client/assets/{thread-route-z9ruvfsc.js → thread-route-C79eC_qQ.js} +1 -1
  195. package/dist/client/assets/{toggle-group-Nf1lDiVJ.js → toggle-group-CcQrFwsS.js} +1 -1
  196. package/dist/client/assets/{toolbar-BzHZwA1O.js → toolbar-DVLlKODz.js} +1 -1
  197. package/dist/client/assets/{track-CshboNx6.js → track-CmZ4JwHl.js} +1 -1
  198. package/dist/client/assets/{types-Boeh_rGH.js → types-GWf0mG7M.js} +1 -1
  199. package/dist/client/assets/{use-ai-providers-CgeALaZJ.js → use-ai-providers-Dj1Pomhd.js} +1 -1
  200. package/dist/client/assets/{use-api-keys-DWagnGEw.js → use-api-keys-v7JpdoOm.js} +1 -1
  201. package/dist/client/assets/{use-automations-CuNOck6d.js → use-automations-CxTksTg3.js} +1 -1
  202. package/dist/client/assets/{use-autosave-n62BKfNd.js → use-autosave-BafK4Rjr.js} +1 -1
  203. package/dist/client/assets/{use-connection-D85CDmBf.js → use-connection-BBRJTBMy.js} +1 -1
  204. package/dist/client/assets/{use-copy-Du_Yq_Wx.js → use-copy-QEjXenkb.js} +1 -1
  205. package/dist/client/assets/{use-create-virtual-mcp-BOcvBOg6.js → use-create-virtual-mcp-B0jM9fDO.js} +1 -1
  206. package/dist/client/assets/{use-debounced-autosave-DfyQADbT.js → use-debounced-autosave-CSzP1LMa.js} +1 -1
  207. package/dist/client/assets/{use-debounced-value-D-Z6eH8B.js → use-debounced-value-0YLkJ58n.js} +1 -1
  208. package/dist/client/assets/{use-decopilot-events-wvDyde03.js → use-decopilot-events-DVLYFd8Z.js} +1 -1
  209. package/dist/client/assets/{use-delete-connection-DGZu9hFG.js → use-delete-connection-D3A1ZRW7.js} +1 -1
  210. package/dist/client/assets/{use-deployment-admin-Bn2Y1twe.js → use-deployment-admin-DzmvX_1c.js} +1 -1
  211. package/dist/client/assets/{use-destination-route-CQh1Fm5z.js → use-destination-route-CgRHxPyq.js} +1 -1
  212. package/dist/client/assets/{use-file-configs-nRky1k66.js → use-file-configs-BtJ9owXL.js} +1 -1
  213. package/dist/client/assets/{use-infinite-scroll-Cda0QvZZ.js → use-infinite-scroll-D9F23MOw.js} +1 -1
  214. package/dist/client/assets/{use-join-requests-BrgVQ94G.js → use-join-requests-CNUbcIoH.js} +1 -1
  215. package/dist/client/assets/{use-mcp-auth-status-B6aQHTgp.js → use-mcp-auth-status-yMNjE6Uo.js} +1 -1
  216. package/dist/client/assets/{use-mcp-client-wCEu91RM.js → use-mcp-client-Qp-dz21o.js} +1 -1
  217. package/dist/client/assets/{use-mcp-tools-CVVHK2jc.js → use-mcp-tools-C7FgaBkX.js} +1 -1
  218. package/dist/client/assets/{use-members-BBrmjcaS.js → use-members-BcS-quMh.js} +1 -1
  219. package/dist/client/assets/{use-navigate-to-agent-B-SDjYaO.js → use-navigate-to-agent-B8yDMTez.js} +1 -1
  220. package/dist/client/assets/{use-org-auth-client-D1W0MG5J.js → use-org-auth-client-Dp0AX4Aj.js} +1 -1
  221. package/dist/client/assets/{use-org-repo-syncs-B0qMGZPW.js → use-org-repo-syncs-Brd5lrfI.js} +1 -1
  222. package/dist/client/assets/{use-org-sso-e9EjhNog.js → use-org-sso-wZB9SHX9.js} +1 -1
  223. package/dist/client/assets/{use-organization-roles-Cbwcb8_N.js → use-organization-roles-C0_74J_y.js} +1 -1
  224. package/dist/client/assets/{use-organization-settings-B43b0mJm.js → use-organization-settings-DoHw0Vrb.js} +1 -1
  225. package/dist/client/assets/{use-panel-navigate-DXF7icZm.js → use-panel-navigate-C7_AOzBX.js} +1 -1
  226. package/dist/client/assets/{use-registry-connections-DqnuK1Vj.js → use-registry-connections-CB_vMkV_.js} +1 -1
  227. package/dist/client/assets/{use-secrets-ZlJv-EZ7.js → use-secrets-DWR3VHSi.js} +1 -1
  228. package/dist/client/assets/{use-section-preview-base-Wg7ZnoM0.js → use-section-preview-base-CWBthmZQ.js} +1 -1
  229. package/dist/client/assets/{use-status-sounds-BDFav8gD.js → use-status-sounds-B4wpz7Bv.js} +1 -1
  230. package/dist/client/assets/{use-tags-BhNPXW5M.js → use-tags-TtpBUHZv.js} +1 -1
  231. package/dist/client/assets/{use-view-mode-EyM_CMVf.js → use-view-mode-CqPRLkgX.js} +1 -1
  232. package/dist/client/assets/{use-virtual-mcp-d_rTOrSq.js → use-virtual-mcp-BcsPJqk4.js} +1 -1
  233. package/dist/client/assets/useInfiniteQuery-Mj7WnppJ.js +1 -0
  234. package/dist/client/assets/useSuspenseInfiniteQuery-dJDa9vJh.js +1 -0
  235. package/dist/client/assets/{users-CsuaAql7.js → users-DR4kDqbe.js} +1 -1
  236. package/dist/client/assets/{variant-calendar-DbKVgad5.js → variant-calendar-Bie9J8Up.js} +1 -1
  237. package/dist/client/assets/{view-mode-toggle-bGr20uvR.js → view-mode-toggle-uQZ5XhwA.js} +1 -1
  238. package/dist/client/index.html +1 -1
  239. package/dist/server/cli.js +488 -488
  240. package/dist/server/server.js +355 -355
  241. package/package.json +1 -1
  242. package/dist/client/assets/record-editor-Dwkyd-SD.js +0 -1
  243. package/dist/client/assets/registry-69N5svO-.js +0 -2
  244. package/dist/client/assets/store-registry-CyB03OSx.js +0 -2
  245. package/dist/client/assets/useInfiniteQuery-JTsmNGfi.js +0 -1
  246. package/dist/client/assets/useSuspenseInfiniteQuery-C_xm246s.js +0 -1
@@ -1 +1 @@
1
- import{c as O,H as oe,o as ke,K as Ae,b as L,j as t,C as Gt,av as Xt,B as te,r as R,bO as Qt,d as ot,w as Wt,n as H,a as ce,t as K,y as Yt,k as Ie,a5 as ht,M as pt,q as B,_ as xt,Z as jt,Y as Zt,a8 as Ce,a9 as ye,ab as Ne,L as Jt,G as en,ax as tn,ay as nn,R as sn,I as on,p as an,ac as ln}from"./index-ygoeB01B.js";import{m as ct,u as rn}from"./use-mcp-client-wCEu91RM.js";import{C as vt,g as cn,W as dn,S as bt,a as Ct,i as un,d as mn,f as fn}from"./constants-dLUUoWH7.js";import{D as gn}from"./use-destination-route-CQh1Fm5z.js";import{d as dt,C as hn}from"./self-tool-result-6JqgkdnQ.js";import{i as pn}from"./ChevronRight-DLfQb7o8.js";import{aH as xn,N as jn,A as yt,I as vn,s as Je}from"./agent-icon-BVZRzxwR.js";import{b as Nt,d as bn,e as wt}from"./thread-route-z9ruvfsc.js";import{t as _t}from"./ChevronDown-CjoGJTaF.js";import{u as it,a as Cn}from"./use-virtual-mcp-d_rTOrSq.js";import{g as yn}from"./github-repo-BpKUwJal.js";import{a as Re,b as St,P as Dt}from"./popover-Br4XvIdI.js";import{i as Ve}from"./Check-CMcrSGq4.js";import{s as we}from"./Plus-DsbRnoOt.js";import{i as kt}from"./SearchMd-Vz_-9QqS.js";import{s as It}from"./XClose-Dy9_68Fl.js";import{T as At}from"./toolbar-BzHZwA1O.js";import{D as Tt,a as Pt,b as Ot,c as Nn,g as wn,e as _n,f as Sn}from"./drawer-SLxMT12H.js";import{a as Dn,G as kn}from"./github-repo-picker-CPP6CKCn.js";import{g as In,a as An,b as zt}from"./hooks-Bj6hNUFL.js";import{u as Tn,g as Pn,c as On,d as zn,b as Mn}from"./use-navigate-to-agent-B-SDjYaO.js";import{g as $n,a as Mt}from"./agent-capabilities-BxGDQyCw.js";import{u as $t}from"./shell-layout-B4DGPaJE.js";import{d as Fn}from"./session-runtime-C-KTDVeQ.js";import{C as Ln}from"./collection-search-CVaeQHld.js";import{g as En,a as Bn,b as Rn,e as Vn}from"./extract-connection-data-DBygL9Ff.js";import{u as Ft,a as Lt,g as Kn,C as et}from"./connection-card-BTjW1qCi.js";import{D as Et,b as Bt,c as Rt,d as Vt,h as Hn,e as Un}from"./dialog-CLmeJCvy.js";import{d as W,a as Y,e as Z,b as J,c as ee,F as ut}from"./form-BhmieFHl.js";import{I as re}from"./input-BbML9Nmm.js";import{S as qn,a as Gn,b as Xn,c as Qn,d as De}from"./select-DB6__ViP.js";import{T as Wn}from"./textarea-BEF_54uu.js";import{b as Kt}from"./use-connection-D85CDmBf.js";import{n as Be,i as tt}from"./Tool02-36UedhX_.js";import{e as Yn}from"./UserSquare-B4nTC6Up.js";import{c as Zn,i as Le,a as mt,E as Jn,p as es,b as ts,d as ns}from"./connection-form-helpers-DVafqfi_.js";import{a as nt}from"./authenticate-and-persist-oauth-woXc6jrT.js";import{g as ss}from"./connection-slug-CITJ0kGN.js";import{C as os}from"./collection-tabs-mVsENYKi.js";import{u as ft}from"./use-infinite-scroll-Cda0QvZZ.js";import{B as Ee}from"./badge-o9MTCHXi.js";import{u as is}from"./useSuspenseInfiniteQuery-C_xm246s.js";import{g as Ke}from"./metadata-dUsYcpuu.js";import{u as as}from"./use-ai-providers-CgeALaZJ.js";function ls(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const rs=2e4;function cs(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Qo(){const n=O.c(19),{org:e}=oe(),s=dn.COMMERCE_DISCOVERY(e.id);let o;n[0]!==e.id||n[1]!==e.slug?(o=ct({connectionId:bt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=o):o=n[2];const{data:a}=ke(o),i=ke({queryKey:Ae.commerceDiscoveryConnection(e.id,s),enabled:!!a,retry:!1,staleTime:6e4,queryFn:async()=>{if(!a)throw new Error("selfClient not ready");const k=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return dt(k)}}),l=i.data?.item??null,{data:r}=ke({...ct({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!l}),c=Ae.commerceDiscoveryDiagnostic(e.id,s),u=!!r;let m;n[3]!==r?(m=async()=>{if(!r)throw new Error("cdClient not ready");const k=await r.callTool({name:vt,arguments:{}});return dt(k).diagnostic??null},n[3]=r,n[4]=m):m=n[4];let f;n[5]!==c||n[6]!==u||n[7]!==m?(f={queryKey:c,enabled:u,retry:1,refetchInterval:ds,queryFn:m},n[5]=c,n[6]=u,n[7]=m,n[8]=f):f=n[8];const d=ke(f),g=l?.metadata?.siteUrl,v=d.data??null,p=d.isSuccess,h=i.isPending||!!l&&d.isPending,j=typeof g=="string"&&g?g:null;let b;n[9]!==g?(b=cs(g),n[9]=g,n[10]=b):b=n[10];const C=r??null;let _;return n[11]!==s||n[12]!==d.isSuccess||n[13]!==C||n[14]!==v||n[15]!==h||n[16]!==j||n[17]!==b?(_={diagnostic:v,isSuccess:p,isLoading:h,siteUrl:j,host:b,connectionId:s,cdClient:C},n[11]=s,n[12]=d.isSuccess,n[13]=C,n[14]=v,n[15]=h,n[16]=j,n[17]=b,n[18]=_):_=n[18],_}function ds(n){return n.state.status!=="error"&&ls(n.state.data)==="generating"?rs:!1}function Wo(n,e){return{to:gn.agents,params:{org:n.slug,project:cn(n.id),panel:"app"},search:{connection:e,tool:vt}}}const us="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function ms(){const n=O.c(13),e=L();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let a;n[3]!==o?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=a):a=n[4];let i;n[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:us,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=i):i=n[5];let l;n[6]!==e?(l=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=l):l=n[7];let r;n[8]!==l?(r=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,t.jsx("span",{className:"text-base font-medium",children:l})]}),n[8]=l,n[9]=r):r=n[9];let c;return n[10]!==a||n[11]!==r?(c=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,r]}),n[10]=a,n[11]=r,n[12]=c):c=n[12],c}function fs(){const n=O.c(19),e=L();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:xn,label:s},n[2]=s,n[3]=o):o=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let i;n[6]!==a?(i={Icon:Gt,label:a},n[6]=a,n[7]=i):i=n[7];let l;n[8]!==e?(l=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=l):l=n[9];let r;n[10]!==l?(r={Icon:jn,label:l},n[10]=l,n[11]=r):r=n[11];let c;n[12]!==o||n[13]!==i||n[14]!==r?(c=[o,i,r],n[12]=o,n[13]=i,n[14]=r,n[15]=c):c=n[15];const u=c;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(gs)})]}),n[17]=u,n[18]=f):f=n[18],f}function gs(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function Yo(n){const e=O.c(22),{siteHost:s,footer:o,onClose:a,children:i}=n,l=L(),r=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let c;e[0]!==a||e[1]!==l?(c=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":l("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(Xt,{size:18})}),e[0]=a,e[1]=l,e[2]=c):c=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==r||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(pn,{size:16,className:"shrink-0 text-foreground/25"}),r&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:r,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=r,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let g;e[10]!==o?(g=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=g):g=e[11];let v;e[12]!==i||e[13]!==d||e[14]!==g?(v=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,i,g]}),e[12]=i,e[13]=d,e[14]=g,e[15]=v):v=e[15];let p,h;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),h=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=p,e[17]=h):(p=e[16],h=e[17]);let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[p,h,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(ms,{}),t.jsx("div",{className:"flex-1"}),t.jsx(fs,{})]})]}),e[18]=j):j=e[18];let b;return e[19]!==c||e[20]!==v?(b=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[c,v,j]}),e[19]=c,e[20]=v,e[21]=b):b=e[21],b}function Zo(n){const e=O.c(5),{ready:s,pending:o,label:a,onClick:i,children:l}=n,r=o||!s,c=s&&!o?l:null;let u;return e[0]!==a||e[1]!==i||e[2]!==r||e[3]!==c?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:r,children:[a,c]}),e[0]=a,e[1]=i,e[2]=r,e[3]=c,e[4]=u):u=e[4],u}function Ht(){const n=R.useContext(Qt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function hs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=O.c(13),{org:s,size:o}=n,a=o===void 0?"sm":o,i=a==="xs"?"size-5":"size-6",l=a==="xs"?"text-[9px]":"text-xs";let r;e[0]!==i?(r=H(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=r):r=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:hs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:H("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let m;return e[9]!==r||e[10]!==c||e[11]!==u?(m=t.jsx("div",{className:r,style:c,children:u}),e[9]=r,e[10]=c,e[11]=u,e[12]=m):m=e[12],m}function ps({invitation:n,onChanged:e}){const s=L(),[o,a]=R.useState(!1),i=n.organizationName??s("header.orgSwitcher.unknownOrganization"),l=async()=>{a(!0);try{const u=await ce.organization.acceptInvitation({invitationId:n.id});if(u.error){K.error(u.error.message),a(!1);return}}catch{K.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}K.success(s("header.orgSwitcher.joined",{name:i})),Yt();let c;try{c=(await ce.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},r=async()=>{a(!0);try{const c=await ce.organization.rejectInvitation({invitationId:n.id});if(c.error){K.error(c.error.message),a(!1);return}K.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{K.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:i},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:i}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:l,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:r,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:t.jsx(It,{size:14})})]})]})}function xs(n){const e=O.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:a}=n,i=L(),{data:l}=Wt(),{invitations:r,refetch:c}=Ht();let u;e[0]!==s?(u=(I,A)=>I.slug===s?-1:A.slug===s?1:I.name.localeCompare(A.name),e[0]=s,e[1]=u):u=e[1];const m=[...l??[]].sort(u),[f,d]=R.useState(""),g=f.toLowerCase(),v=g?m.filter(I=>I.name.toLowerCase().includes(g)||I.slug.toLowerCase().includes(g)):m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(kt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=p):p=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=I=>d(I.target.value),e[3]=h):h=e[3];let j;e[4]!==f?(j=I=>I.key==="Escape"&&f&&d(""),e[4]=f,e[5]=j):j=e[5];let b;e[6]!==i?(b=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=b):b=e[7];let C;e[8]!==f||e[9]!==j||e[10]!==b?(C=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:h,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=j,e[10]=b,e[11]=C):C=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(we,{size:16}),e[12]=_):_=e[12];let k;e[13]!==a?(k=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:_}),e[13]=a,e[14]=k):k=e[14];let D;e[15]!==C||e[16]!==k?(D=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[p,C,k]}),e[15]=C,e[16]=k,e[17]=D):D=e[17];const z="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let x;e[18]!==r||e[19]!==f||e[20]!==c?(x=!f&&r.map(I=>t.jsx(ps,{invitation:I,onChanged:c},I.id)),e[18]=r,e[19]=f,e[20]=c,e[21]=x):x=e[21];const S=v.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?i("header.orgSwitcher.noOrganizationsMatch",{query:f}):i("header.orgSwitcher.noOrganizationsAvailable")});let P;e[22]!==o||e[23]!==s?(P=I=>t.jsxs("button",{type:"button",onClick:()=>o(I.slug),className:H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",I.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:I,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.slug})]}),I.slug===s&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id),e[22]=o,e[23]=s,e[24]=P):P=e[24];const N=v.map(P);let y;e[25]!==x||e[26]!==S||e[27]!==N?(y=t.jsxs("div",{className:z,children:[x,S,N]}),e[25]=x,e[26]=S,e[27]=N,e[28]=y):y=e[28];let T;return e[29]!==y||e[30]!==D?(T=t.jsxs(t.Fragment,{children:[D,y]}),e[29]=y,e[30]=D,e[31]=T):T=e[31],T}function js(n){const e=O.c(22),{trigger:s,orgParam:o,align:a,side:i}=n,l=a===void 0?"start":a,r=i===void 0?"bottom":i,c=ot(),[u,m]=R.useState(!1),[f,d]=R.useState(!1);let g;e[0]!==s?(g=t.jsx(Re,{asChild:!0,children:s}),e[0]=s,e[1]=g):g=e[1];const v=String(u);let p;e[2]!==c?(p=D=>{m(!1),c({to:"/$org",params:{org:D}})},e[2]=c,e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{m(!1),d(!0)},e[4]=h):h=e[4];let j;e[5]!==o||e[6]!==v||e[7]!==p?(j=t.jsx(xs,{orgParam:o,onSelectOrg:p,onCreateOrg:h},v),e[5]=o,e[6]=v,e[7]=p,e[8]=j):j=e[8];let b;e[9]!==l||e[10]!==r||e[11]!==j?(b=t.jsx(St,{side:r,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:bs,onCloseAutoFocus:vs,children:j}),e[9]=l,e[10]=r,e[11]=j,e[12]=b):b=e[12];let C;e[13]!==u||e[14]!==g||e[15]!==b?(C=t.jsxs(Dt,{open:u,onOpenChange:m,children:[g,b]}),e[13]=u,e[14]=g,e[15]=b,e[16]=C):C=e[16];let _;e[17]!==f?(_=t.jsx(hn,{open:f,onOpenChange:d}),e[17]=f,e[18]=_):_=e[18];let k;return e[19]!==_||e[20]!==C?(k=t.jsxs(t.Fragment,{children:[C,_]}),e[19]=_,e[20]=C,e[21]=k):k=e[21],k}function vs(n){return n.preventDefault()}function bs(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Cs(n){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:r,disabled:c}=n,u=a===void 0?"Search...":a;let m;e[0]!==l?(m=H("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const f=c?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=H("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let g;e[4]!==r?(g=r?t.jsx(Ie,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=r,e[5]=g):g=e[5];let v;e[6]!==o?(v=b=>o(b.target.value),e[6]=o,e[7]=v):v=e[7];let p;e[8]!==c||e[9]!==i||e[10]!==u||e[11]!==v||e[12]!==s?(p=t.jsx("input",{type:"text",value:s,onChange:v,onKeyDown:i,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=u,e[11]=v,e[12]=s,e[13]=p):p=e[13];let h;e[14]!==d||e[15]!==g||e[16]!==p?(h=t.jsxs("label",{className:d,children:[g,p]}),e[14]=d,e[15]=g,e[16]=p,e[17]=h):h=e[17];let j;return e[18]!==m||e[19]!==h?(j=t.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=j):j=e[20],j}function ys(n,e,s){if(!s)return null;const o=In(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function Ns(n){const e=O.c(6),{value:s,onChange:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(Cs,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function ws(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function _s(n){const e=O.c(10),{org:s,onClose:o}=n,a=L();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let r;e[4]!==a?(r=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==l||e[8]!==r?(c=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Jt,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:r})}),e[6]=i,e[7]=l,e[8]=r,e[9]=c):c=e[9],c}function Ss(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ut,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ds(n){const e=O.c(11),{onImportFromGithub:s}=n,o=L();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(kn,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==o?(r=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=r):r=e[7];let c;return e[8]!==l||e[9]!==r?(c=t.jsx(Ut,{action:l,children:r}),e[8]=l,e[9]=r,e[10]=c):c=e[10],c}function ks(n){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H(o),e[2]=o,e[3]=l):l=e[3];let r;e[4]!==s?(r=()=>{B("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=r):r=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{className:"size-4"}),e[6]=c):c=e[6];let u;return e[7]!==i||e[8]!==l||e[9]!==r?(u=t.jsx(At,{"aria-label":i,className:l,onClick:r,children:c}),e[7]=i,e[8]=l,e[9]=r,e[10]=u):u=e[10],u}function Is(n){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;e[3]!==a?(r=H(a),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==s?(c=()=>{B("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(we,{}),e[7]=u):u=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==l||e[13]!==r||e[14]!==c||e[15]!==f?(d=t.jsx(xt,{children:t.jsxs(jt,{tooltip:l,className:r,onClick:c,children:[u,f]})}),e[12]=l,e[13]=r,e[14]=c,e[15]=f,e[16]=d):d=e[16],d}function As(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ot,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ts(n){const e=O.c(8),{emptyCtaClass:s}=n,o=L();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=H(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{className:"size-4"}),e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==i?(r=t.jsx(At,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=r):r=e[7],r}function Ps(n){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;e[3]!==a?(r=H(a),e[3]=a,e[4]=r):r=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{}),e[5]=c):c=e[5];let u;e[6]!==i?(u=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==l||e[11]!==r||e[12]!==m?(f=t.jsx(Re,{asChild:!0,children:t.jsxs(jt,{tooltip:l,className:r,children:[c,m]})}),e[10]=l,e[11]=r,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let g;return e[17]!==d?(g=t.jsx(xt,{children:d}),e[17]=d,e[18]=g):g=e[18],g}function Os(n){const e=O.c(9),{children:s}=n,o=L();let a;e[0]!==s?(a=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(ye,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let r;return e[6]!==a||e[7]!==l?(r=t.jsxs(Ne,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=r):r=e[8],r}function zs(n){const e=ot(),{create:s}=An(),{locator:o}=oe(),a=Nt(),i=bn();return async l=>{const r=crypto.randomUUID(),c=l===i?ys(n,o,a??""):null;try{await s({id:r,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:r},search:{virtualmcpid:l}})}}function st(n){const e=O.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==s.icon||e[3]!==s.title?(r=t.jsx(yt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=r):r=e[4];let c;e[5]!==s.title?(c=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=c):c=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==c||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[9]=c,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==a||e[15]!==l||e[16]!==r||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:a,className:l,children:[r,m,f]}),e[14]=a,e[15]=l,e[16]=r,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Ut(n){const e=O.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Ms(n){const e=O.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,r]=R.useState(""),c=it(),u=c??[],{org:m}=oe(),{data:f}=ce.useSession(),d=f?.user?.id??"anon",g=Pn(c),v=On(),p=zs(m.slug),h=$n(c),j=l.toLowerCase(),b=u.filter(Es).filter(F=>!h.has(F.id)).filter(Ls).filter(F=>!l||F.title.toLowerCase().includes(j)),C=b.filter(Fs),_=b.filter($s),k=Ct(m.id),D=!l||k.title.toLowerCase().includes(j),z=!!(o&&D);let x;e[0]!==s||e[1]!==o?(x=()=>{o?.(null),s(),r("")},e[0]=s,e[1]=o,e[2]=x):x=e[2];const S=x,P=F=>{if(o){o(F.id),s(),r("");return}zn({orgId:m.id,userId:d},F.id,g),v(),s(),r(""),p(F.id)},N="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==l?(y=t.jsx(Ns,{value:l,onChange:r}),e[3]=l,e[4]=y):y=e[4];const T="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",I=o&&D&&k&&t.jsx(st,{agent:k,selected:!a||a===k.id,onClick:S}),A=(C.length>0||!l)&&t.jsx(Ds,{onImportFromGithub:i}),M=C.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>P(F)},F.id)),V=_.length>0&&t.jsx(Ss,{}),X=_.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>P(F)},F.id));let E;e[5]!==z||e[6]!==l||e[7]!==b.length?(E=b.length===0&&!z&&l&&t.jsx(ws,{}),e[5]=z,e[6]=l,e[7]=b.length,e[8]=E):E=e[8];let ne;e[9]!==E||e[10]!==I||e[11]!==A||e[12]!==M||e[13]!==V||e[14]!==X?(ne=t.jsxs("div",{className:T,children:[I,A,M,V,X,E]}),e[9]=E,e[10]=I,e[11]=A,e[12]=M,e[13]=V,e[14]=X,e[15]=ne):ne=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(_s,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==ne||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:N,children:[y,ne,q]}),e[19]=ne,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function $s(n){return!Mt(n.metadata)}function Fs(n){return Mt(n.metadata)}function Ls(n){return!mn(n.id)}function Es(n){return!un(n.id)}function Bs(n){const e=O.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:a,onSelectAgent:i,selectedAgentId:l,side:r,align:c}=s,u=o===void 0?!1:o,m=r===void 0?"right":r,f=c===void 0?"start":c,[d,g]=R.useState(!1),[v,p]=R.useState(!1),h=ht(),{setOpenMobile:j}=pt(),b=Tn(),C=b?"border border-border":void 0;let _;e[2]!==b?(_=A=>b?t.jsx(Os,{children:A}):A,e[2]=b,e[3]=_):_=e[3];const k=_;let D;e[4]!==h||e[5]!==j?(D=()=>{g(!1),h&&j(!1)},e[4]=h,e[5]=j,e[6]=D):D=e[6];const z=D;let x;e[7]!==z?(x=()=>{z(),p(!0)},e[7]=z,e[8]=x):x=e[8];const S=x;let P;e[9]!==z||e[10]!==S||e[11]!==i||e[12]!==d||e[13]!==l?(P=d&&t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Zt,{className:"h-4 w-24"})}),children:t.jsx(Ms,{onClose:z,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:S})}),e[9]=z,e[10]=S,e[11]=i,e[12]=d,e[13]=l,e[14]=P):P=e[14];const N=P;let y;e[15]!==f||e[16]!==u||e[17]!==C||e[18]!==b||e[19]!==h||e[20]!==d||e[21]!==N||e[22]!==m||e[23]!==a||e[24]!==k?(y=h?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:a}):u?k(t.jsx(ks,{setOpen:g,emptyCtaClass:C})):t.jsx(Is,{setOpen:g,highlightEmpty:b,emptyCtaClass:C}),t.jsx(Tt,{open:d,onOpenChange:g,direction:"bottom",children:t.jsxs(Pt,{className:"max-h-[85dvh] p-0",children:[t.jsx(As,{}),N]})})]}):t.jsxs(Dt,{open:d,onOpenChange:A=>{A&&!d&&B("agent_browser_opened",{surface:"desktop_popover"}),g(A)},children:[a?t.jsx(Re,{asChild:!0,children:a}):u?k(t.jsx(Re,{asChild:!0,children:t.jsx(Ts,{emptyCtaClass:C})})):t.jsx(Ps,{wrapEmptyHint:k,highlightEmpty:b,emptyCtaClass:C}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:N})]}),e[15]=f,e[16]=u,e[17]=C,e[18]=b,e[19]=h,e[20]=d,e[21]=N,e[22]=m,e[23]=a,e[24]=k,e[25]=y):y=e[25];let T;e[26]!==v?(T=t.jsx(Dn,{open:v,onOpenChange:p,mode:"agent"}),e[26]=v,e[27]=T):T=e[27];let I;return e[28]!==T||e[29]!==y?(I=t.jsxs(t.Fragment,{children:[y,T]}),e[28]=T,e[29]=y,e[30]=I):I=e[30],I}function Rs(){const n=O.c(2),e=it()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?Fn(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const Vs="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Ks(n){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=L(),r=Cn(s)??o??null;let c,u,m,f,d;e[0]!==r?.title||e[1]!==a||e[2]!==l?(d=r?.title??l("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",c="button",u=a,m=l("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=r?.title,e[1]=a,e[2]=l,e[3]=c,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(c=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const g=r?.icon??null;let v;e[8]!==g||e[9]!==d?(v=t.jsx(yt,{icon:g,name:d,size:"xs"}),e[8]=g,e[9]=d,e[10]=v):v=e[10];let p;e[11]!==c||e[12]!==u||e[13]!==m||e[14]!==v?(p=t.jsx("button",{type:c,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:v}),e[11]=c,e[12]=u,e[13]=m,e[14]=v,e[15]=p):p=e[15];let h;e[16]!==d?(h=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=h):h=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let b;e[19]!==h?(b=t.jsxs("button",{type:"button",className:Vs,children:[h,j]}),e[19]=h,e[20]=b):b=e[20];let C;e[21]!==s||e[22]!==i||e[23]!==b?(C=t.jsx(Bs,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:b}),e[21]=s,e[22]=i,e[23]=b,e[24]=C):C=e[24];let _;return e[25]!==C||e[26]!==f||e[27]!==p?(_=t.jsxs("div",{className:f,children:[p,C]}),e[25]=C,e[26]=f,e[27]=p,e[28]=_):_=e[28],_}function Jo(n){const e=O.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,a=L(),{org:i}=oe(),{state:l,isMobile:r}=pt(),c=Ht().invitations.length>0,u=l==="collapsed"||r;let m;e[2]!==c||e[3]!==i.name||e[4]!==a?(m=c?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:i.name}):a("header.shellBreadcrumb.switchOrganization",{name:i.name}),e[2]=c,e[3]=i.name,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i?(f=t.jsx(at,{org:i,size:"sm"}),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==c||e[9]!==u?(d=c&&t.jsx("span",{className:H("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=c,e[9]=u,e[10]=d):d=e[10];let g;e[11]!==f||e[12]!==d?(g=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=g):g=e[13];let v;e[14]!==i.name||e[15]!==o?(v=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[14]=i.name,e[15]=o,e[16]=v):v=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=p):p=e[17];let h;e[18]!==m||e[19]!==g||e[20]!==v?(h=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[g,v,p]})}),e[18]=m,e[19]=g,e[20]=v,e[21]=h):h=e[21];let j;e[22]!==i.slug||e[23]!==h?(j=t.jsx(js,{orgParam:i.slug,trigger:h}),e[22]=i.slug,e[23]=h,e[24]=j):j=e[24];let b;e[25]!==i.name?(b=t.jsx(ye,{side:"bottom",children:i.name}),e[25]=i.name,e[26]=b):b=e[26];let C;return e[27]!==b||e[28]!==j?(C=t.jsxs(Ne,{children:[j,b]}),e[27]=b,e[28]=j,e[29]=C):C=e[29],C}function ei(n){const e=O.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=oe(),{threads:i}=zt(),l=it(),{data:r}=ce.useSession(),{setTaskId:c,createNewTask:u}=$t(),m=Rs();let f;e[2]!==a.id?(f=Ct(a.id),e[2]=a.id,e[3]=f):f=e[3];const d=f,g=d.id,v=wt();let p;e[4]!==l||e[5]!==u||e[6]!==g||e[7]!==o||e[8]!==m||e[9]!==r?.user?.id||e[10]!==c||e[11]!==i?(p=k=>{const D=k??g,z=(l??[]).find(S=>S.id===D),x=Mn(i,D,r?.user?.id,m(D),!!(z&&yn(z)));x?c(x.id,D):u(D),o?.()},e[4]=l,e[5]=u,e[6]=g,e[7]=o,e[8]=m,e[9]=r?.user?.id,e[10]=c,e[11]=i,e[12]=p):p=e[12];const h=p;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=j):j=e[13];const b=v===g?d:void 0;let C;e[14]!==v||e[15]!==h?(C=()=>h(v),e[14]=v,e[15]=h,e[16]=C):C=e[16];let _;return e[17]!==v||e[18]!==h||e[19]!==b||e[20]!==C?(_=t.jsx(R.Suspense,{fallback:j,children:t.jsx(Ks,{agentId:v,fallback:b,onOpenHome:C,onPick:h})}),e[17]=v,e[18]=h,e[19]=b,e[20]=C,e[21]=_):_=e[21],_}function ti(){const n=O.c(20),e=L(),{threads:s}=zt(),{createNewTask:o}=$t(),a=wt(),i=Nt();let l;n[0]!==i||n[1]!==s?(l=s.find(h=>h.id===i)?.branch??null,n[0]=i,n[1]=s,n[2]=l):l=n[2];const r=l;let c;n[3]!==a||n[4]!==o||n[5]!==r?(c=()=>{o(a,r)},n[3]=a,n[4]=o,n[5]=r,n[6]=c):c=n[6];const u=c;let m;n[7]!==e?(m=e("sidebar.taskGroupsList.newChat"),n[7]=e,n[8]=m):m=n[8];let f;n[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(vn,{size:16}),n[9]=f):f=n[9];let d;n[10]!==u||n[11]!==m?(d=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:u,"aria-label":m,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:f})}),n[10]=u,n[11]=m,n[12]=d):d=n[12];let g;n[13]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[13]=e,n[14]=g):g=n[14];let v;n[15]!==g?(v=t.jsx(ye,{side:"bottom",children:g}),n[15]=g,n[16]=v):v=n[16];let p;return n[17]!==d||n[18]!==v?(p=t.jsxs(Ne,{children:[d,v]}),n[17]=d,n[18]=v,n[19]=p):p=n[19],p}function Hs({open:n,onOpenChange:e,onCreated:s}){const o=L(),{org:a}=oe(),{data:i}=ce.useSession(),{stdioEnabled:l}=en(),r=ht(),c=Kt(),u=Ft(),f=Lt(u,"").items,d=tn({resolver:nn(Zn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),v=d.watch("connection_url"),p=d.watch("npx_package"),h=Le({uiType:g,connectionUrl:v??"",npxPackage:p??""})??mt({uiType:g,connectionUrl:v??"",registryItems:f}),j=x=>{const S=x.trim();if(!S)return;const P=!!d.formState.dirtyFields.title,N=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,T=A=>{if(A&&(!P&&!d.getValues("title").trim()&&A.title&&d.setValue("title",A.title,{shouldDirty:!1}),!N&&!(d.getValues("description")??"").trim()&&A.description&&d.setValue("description",A.description,{shouldDirty:!1}),!y&&A.envVarKeys?.length)){const M=d.getValues("env_vars")??[],V=new Set(M.map(E=>E.key)),X=A.envVarKeys.filter(E=>!V.has(E));X.length>0&&d.setValue("env_vars",[...M,...X.map(E=>({key:E,value:""}))],{shouldDirty:!0})}},I=es(S);if(I&&l){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",I.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),T(Le({uiType:"NPX",npxPackage:I.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const A=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",A,{shouldDirty:!0}),d.setValue("connection_url",S,{shouldDirty:!0}),T(Le({uiType:A,connectionUrl:S})??mt({uiType:A,connectionUrl:S,registryItems:f}));return}g==="NPX"&&T(Le({uiType:"NPX",npxPackage:S}))},b=x=>{x||d.reset(),e(x)},C=async x=>{let S,P=null,N=null,y=null;x.ui_type==="NPX"?(S="STDIO",P="",y=ts(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(S="STDIO",P="",y=ns(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(S=x.ui_type,P=x.connection_url||"",N=x.connection_token||null);const T=En("conn");try{await c.create.mutateAsync({id:T,title:x.title,description:x.description||null,connection_type:S,connection_url:P,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(T)}catch{K.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},_=o("connections.createConnectionDialog.title"),k=o("connections.createConnectionDialog.description"),D=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(W,{control:d.control,name:"ui_type",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(qn,{value:x.value,onValueChange:x.onChange,children:[t.jsx(J,{children:t.jsx(Gn,{children:t.jsx(Xn,{})})}),t.jsxs(Qn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Je,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Je,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Je,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Yn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),g==="NPX"&&t.jsx(W,{control:d.control,name:"npx_package",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...x,value:x.value??"",onPaste:S=>{const P=S.clipboardData.getData("text");P&&(S.preventDefault(),d.setValue("npx_package",P.trim(),{shouldDirty:!0}),j(P))},onBlur:S=>{j(S.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),g==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(W,{control:d.control,name:"stdio_command",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"stdio_args",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...x,value:x.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(g==="NPX"||g==="STDIO")&&t.jsx(W,{control:d.control,name:"env_vars",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(J,{children:t.jsx(Jn,{value:x.value??[],onChange:x.onChange})}),t.jsx(ee,{})]})}),g!=="NPX"&&g!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(W,{control:d.control,name:"connection_url",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...x,value:x.value??"",onPaste:S=>{const P=S.clipboardData.getData("text");P&&(S.preventDefault(),d.setValue("connection_url",P.trim(),{shouldDirty:!0}),j(P))},onBlur:S=>{j(S.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"connection_token",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:h?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(J,{children:t.jsx(re,{type:"password",placeholder:h?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...x,value:x.value??""})}),h?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.token.helperText,h.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"title",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...x})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"description",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(J,{children:t.jsx(Wn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...x,value:x.value??""})}),t.jsx(ee,{})]})})]});return r?t.jsx(Tt,{open:n,onOpenChange:b,children:t.jsxs(Pt,{className:"max-h-[90vh]",children:[t.jsx(Nn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Ot,{children:_}),t.jsx(wn,{className:"mt-1",children:k})]}),t.jsx(_n,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(It,{size:16})})})]})}),t.jsx(ut,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(C),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:z}),t.jsx(Sn,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:D})})]})})]})}):t.jsx(Et,{open:n,onOpenChange:b,children:t.jsxs(Bt,{className:"sm:max-w-[525px]",children:[t.jsxs(Rt,{children:[t.jsx(Vt,{children:_}),t.jsx(Hn,{children:k})]}),t.jsx(ut,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(C),children:[t.jsx("div",{className:"py-4",children:z}),t.jsxs(Un,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>b(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:D})]})]})})]})})}function Us(n){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:r,connectingItemId:c,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,g=s===void 0?"add":s,v=d===void 0?"connected":d,p=L(),{org:h}=oe(),j=R.useDeferredValue(u),b=u!==j;let C;e[0]!==j?(C=j.trim().toLowerCase(),e[0]=j,e[1]=C):C=e[1];const _=C;let k;e[2]!==v?(k=w=>w??v,e[2]=v,e[3]=k):k=e[3];const[D,z]=sn(on.connectionsTab(h.slug)+(v==="all"?":home-modal":":agent-modal"),k);let x;e[4]!==D||e[5]!==z?(x=w=>{w!==D&&B("connections_dialog_tab_changed",{to_tab:w}),z(w)},e[4]=D,e[5]=z,e[6]=x):x=e[6];const S=x;let P;e[7]!==h.id||e[8]!==h.slug?(P={connectionId:bt,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=P):P=e[9];const N=rn(P),y=j?.trim().split(/\s+/).filter(Boolean)??[],T=y.length>0?{operator:"or",conditions:y.flatMap(Js)}:void 0,I={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(I),{data:M,fetchNextPage:V,hasNextPage:X,isFetchingNextPage:E}=is({queryKey:Ae.collectionListInfinite(N,h.id,"","CONNECTIONS",A),queryFn:async w=>{const{pageParam:$}=w,se=$===void 0?0:$;return(await N.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Ys,staleTime:3e4}),ne=M?.pages.flatMap(Ws)??[],q=Kn(ne),de=new Set(ne.filter(Qs).map(Xs)),F=Ft(),ie=Lt(F,j),He=ft(ie.loadMore,ie.hasMore,ie.isLoadingMore),Ue=ft(V,X??!1,E),G=D==="all"||!!_,lt=G?ie.items.filter(w=>{const $=Bn(w);if($&&de.has($))return!1;if(!_)return!0;const se=Ke(w._meta),ae=[w.title,w.description,w.name,w.server?.title,w.server?.description,w.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(Q=>ae.includes(Q.toLowerCase()))}):[],_e=lt.filter(Gs),Se=lt.filter(qs);let Te;e[10]!==a?(Te=w=>w.some($=>a.has($.id)),e[10]=a,e[11]=Te):Te=e[11];const qe=Te;let Pe;e[12]!==a||e[13]!==o||e[14]!==c||e[15]!==qe||e[16]!==g||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==p?(Pe=(w,$,se,ae,Q)=>{const Fe=qe(Q),be=Q.find(le=>!a.has(le.id)),U=Q[0];if(g==="browse"){const le=ss(U);return t.jsx(et,{connection:{title:$,icon:se,description:Q.length>1?`${Q.length} instances`:ae??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Ee,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",p("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{B("connection_browse_clicked",{app_name:U.app_name??null,connection_id:U.id,instances_count:Q.length}),f?.(le)}},w)}return t.jsx(et,{connection:{title:$,icon:se,description:ae},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Fe&&t.jsxs(Ee,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",p("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:le=>{le.stopPropagation(),be?(B("connection_add_clicked",{action:"use_existing",app_name:U.app_name??null,connection_id:be.id}),o&&B("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:U.app_name??null,mode:"existing"}),i(be.id)):(B("connection_add_clicked",{action:"clone",app_name:U.app_name??null,base_connection_id:U.id}),l(U))},children:p("virtualMcp.connectionDialogContent.add")})]})},w)},e[12]=a,e[13]=o,e[14]=c,e[15]=qe,e[16]=g,e[17]=i,e[18]=f,e[19]=l,e[20]=p,e[21]=Pe):Pe=e[21];const Oe=Pe;let ze;e[22]!==c||e[23]!==g||e[24]!==r||e[25]!==p?(ze=w=>{const $=Ke(w._meta),se=$?.friendlyName||$?.friendly_name||w.server?.title||w.title||w.server?.name||w.name||w.id||"",ae=w.server?.description||w.description||null,Q=w.server?.icons?.[0]?.src||Rn(w.server?.repository)||null,Fe=$?.official===!0,be=$?.verified===!0,U=$?.owner==="deco";return t.jsx(et,{connection:{title:se,description:ae,icon:Q},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[U&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:p("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByDeco")})]}),!U&&Fe&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Ee,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!U&&!Fe&&be&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Ee,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:le=>{le.stopPropagation(),B("connection_add_clicked",{action:"connect_new",registry_item_id:w.id,app_name:$?.friendlyName||w.server?.name||w.name||null}),r(w)},children:c===w.id?t.jsx(Ie,{size:14,className:"animate-spin"}):p(g==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${w.id}`)},e[22]=c,e[23]=g,e[24]=r,e[25]=p,e[26]=ze):ze=e[26];const rt=ze;let ue;e[27]!==D||e[28]!==S||e[29]!==m||e[30]!==_||e[31]!==p?(ue=!_&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(os,{tabs:[{id:"all",label:p("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:p("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:D,onTabChange:w=>S(w)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{B("connections_dialog_custom_clicked"),m()},children:[t.jsx(we,{size:12}),p("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=D,e[28]=S,e[29]=m,e[30]=_,e[31]=p,e[32]=ue):ue=e[32];const Ge=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ge?(me=H("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[33]=Ge,e[34]=me):me=e[34];const qt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Me;e[35]!==Oe?(Me=w=>{if(w.type==="group")return Oe(w.key,w.title,w.icon,null,w.connections);const $=w.connection;return Oe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Oe,e[36]=Me):Me=e[36];const Xe=q.map(Me);let fe;e[37]!==Ue?(fe=t.jsx("div",{ref:Ue,className:"col-span-full h-1"}),e[37]=Ue,e[38]=fe):fe=e[38];let ge;e[39]!==E?(ge=E&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=E,e[40]=ge):ge=e[40];const Qe=G&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(tt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=G&&_e.map(rt),Ye=G&&Se.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ze=G&&Se.map(rt);let he;e[41]!==He||e[42]!==F||e[43]!==G?(he=G&&F.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=F,e[43]=G,e[44]=he):he=e[44];let pe;e[45]!==ie.isLoadingMore||e[46]!==G?(pe=G&&ie.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=ie.isLoadingMore,e[46]=G,e[47]=pe):pe=e[47];let xe;e[48]!==Xe||e[49]!==fe||e[50]!==ge||e[51]!==Qe||e[52]!==We||e[53]!==Ye||e[54]!==Ze||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:qt,children:[Xe,fe,ge,Qe,We,Ye,Ze,he,pe]}),e[48]=Xe,e[49]=fe,e[50]=ge,e[51]=Qe,e[52]=We,e[53]=Ye,e[54]=Ze,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==D||e[59]!==q.length||e[60]!==Se||e[61]!==u||e[62]!==p||e[63]!==_e?(je=q.length===0&&_e.length===0&&Se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?p("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):p(D==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=D,e[59]=q.length,e[60]=Se,e[61]=u,e[62]=p,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let $e;return e[69]!==ue||e[70]!==ve?($e=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=$e):$e=e[71],$e}function qs(n){return!n.verified&&!Ke(n._meta)?.verified&&!n.meta?.verified}function Gs(n){return n.verified||Ke(n._meta)?.verified||n.meta?.verified}function Xs(n){return n.app_name}function Qs(n){return n.app_name}function Ws(n){return n?.items??[]}function Ys(n,e){if(n?.hasMore)return e.reduce(Zs,0)}function Zs(n,e){return n+(e?.items?.length??0)}function Js(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function ni({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=L(),l=a.mode??"add",r="agentId"in a?a.agentId:void 0,c="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,u="onAdd"in a&&a.onAdd?a.onAdd:N=>{},m=(N,y,T)=>{r&&B("agent_connection_attached",{agent_id:r,connection_id:N,app_name:y,mode:T})},[f,d]=R.useState(null),[g,v]=R.useState(o),[p,h]=R.useState(!1),{org:j}=oe(),{data:b}=ce.useSession(),C=Kt(),_=an(),k=ot(),D=N=>{e(!1),k({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:N}})},z=()=>{_.invalidateQueries({predicate:N=>{const y=N.queryKey;return y[1]===j.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},x=async(N,y)=>{B("connection_oauth_succeeded",{connection_id:N,flow:y});const T=new URL(`/api/${j.slug}/mcp/${N}`,window.location.origin);await _.invalidateQueries({queryKey:Ae.isMCPAuthenticated(T.href,null)}),z()},S=async N=>{d(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await C.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,M=await nt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:V=>C.update.mutateAsync({id:A,data:{connection_token:V}}).then(()=>{})});if(M.ran&&!M.ok){B("connection_oauth_failed",{connection_id:A,flow:"clone",error:M.error??"no_token"}),K.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:M.error??"no token received"})),await C.delete.mutateAsync(A);return}M.ran&&await x(A,"clone"),m(A,N.app_name??null,"clone"),u(A)}catch(y){console.error("Failed to add connection:",y),K.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},P=async N=>{if(!(!j||!b?.user?.id)){d(N.id);try{const y=Vn(N,j.id,b.user.id,{remoteIndex:0}),T=y.connection_type==="STDIO",I=!!y.connection_url,A=T&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!I&&!A){K.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:M}=await C.create.mutateAsync(y),V=await nt({connectionId:M,orgId:j.id,orgSlug:j.slug,persistFallback:X=>C.update.mutateAsync({id:M,data:{connection_token:X}}).then(()=>{})});if(V.ran&&!V.ok){B("connection_oauth_failed",{connection_id:M,flow:"connect_new",error:V.error??"no_token"}),K.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:V.error??"no token received"})}),m(M,y.app_name??null,"new"),u(M);return}V.ran?(await x(M,"connect_new"),K.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):K.success(i("virtualMcp.addConnectionDialog.connected")),m(M,y.app_name??null,"new"),u(M)}catch(y){console.error("Failed to connect:",y),K.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs(Et,{open:n,onOpenChange:e,children:[t.jsxs(Bt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Rt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Vt,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(Ln,{value:g,onChange:v,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Us,{mode:l,agentId:r,addedConnectionIds:c,onAdd:u,onCloneAndAdd:S,onConnectAndAdd:P,connectingItemId:f,search:g,onCreateConnection:()=>h(!0),onBrowseNavigate:D,defaultTab:s})})]}),t.jsx(Hs,{open:p,onOpenChange:h,onCreated:async N=>{h(!1);const y=await nt({connectionId:N,orgId:j.id,orgSlug:j.slug,persistFallback:T=>C.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(y.ran&&!y.ok){B("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:y.error??"no_token"}),K.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(N,null,"custom"),u(N),e(!1);return}y.ran&&await x(N,"custom_create"),m(N,null,"custom"),u(N),e(!1)}})]})}const gt=new Map;function si(){const{org:n}=oe(),e=ln(),s=as(),o=s.find(h=>h.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:r}=ke({queryKey:Ae.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=a?.balanceCents??null,u=c!=null?c/100:null,m=R.useRef(new Map);if(c!=null){const h=gt.get(n.id);m.current.get(n.id)&&h!=null&&c>h&&B("credits_topped_up_detected",{organization_id:n.id,delta_cents:c-h,previous_balance_cents:h,new_balance_cents:c}),gt.set(n.id,c),m.current.set(n.id,!0)}const f=!!o,d=c!=null&&c>0,g=c!=null&&c===0,v=c!=null&&c===200,p=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:u,hasCredits:d,isZeroBalance:g,isInitialFreeCredit:v,hasOnlyDecoProvider:p,isLoading:i,isFetching:r,refetch:l}}const eo=4,to="TASK";function no(n){return n.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,eo)||to}function oi(n,e,s){const o=s?.trim();return o||(e==null?null:`${no(n)}-${String(e).padStart(2,"0")}`)}const so=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ii(n){const e=so.exec(n.trim())?.[1];return e===void 0?null:Number(e)}function ai(n){const e=O.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let r;return e[4]!==a||e[5]!==i||e[6]!==l?(r=t.jsx("img",{src:fn,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=r):r=e[7],r}export{ei as A,Yo as C,ti as N,Jo as O,ai as S,Zo as a,ni as b,Wo as c,js as d,at as e,Qo as f,ls as g,Rs as h,ii as p,oi as t,si as u};
1
+ import{c as O,H as oe,o as ke,K as Ae,b as L,j as t,C as Gt,av as Xt,B as te,r as R,bO as Qt,d as ot,w as Wt,n as H,a as ce,t as K,y as Yt,k as Ie,a5 as ht,M as pt,q as B,_ as xt,Z as jt,Y as Zt,a8 as Ce,a9 as ye,ab as Ne,L as Jt,G as en,ax as tn,ay as nn,R as sn,I as on,p as an,ac as ln}from"./index-DZLUP-bk.js";import{m as ct,u as rn}from"./use-mcp-client-Qp-dz21o.js";import{C as vt,g as cn,W as dn,S as bt,a as Ct,i as un,d as mn,f as fn}from"./constants-dLUUoWH7.js";import{D as gn}from"./use-destination-route-CgRHxPyq.js";import{d as dt,C as hn}from"./self-tool-result-DFm5BFLJ.js";import{i as pn}from"./ChevronRight-DtOnXnjv.js";import{aH as xn,N as jn,A as yt,I as vn,s as Je}from"./agent-icon-DXnqgUdn.js";import{b as Nt,d as bn,e as wt}from"./thread-route-C79eC_qQ.js";import{t as _t}from"./ChevronDown-s4Re3J16.js";import{u as it,a as Cn}from"./use-virtual-mcp-BcsPJqk4.js";import{g as yn}from"./github-repo-BpKUwJal.js";import{a as Re,b as St,P as Dt}from"./popover-CGQv5zzi.js";import{i as Ve}from"./Check-DzHuFHoL.js";import{s as we}from"./Plus-CYNImaOJ.js";import{i as kt}from"./SearchMd-bD349BM3.js";import{s as It}from"./XClose-DyyJkORZ.js";import{T as At}from"./toolbar-DVLlKODz.js";import{D as Tt,a as Pt,b as Ot,c as Nn,g as wn,e as _n,f as Sn}from"./drawer-C-xsc5eG.js";import{a as Dn,G as kn}from"./github-repo-picker-BO3njSCf.js";import{g as In,a as An,b as zt}from"./hooks-DamZm9Dl.js";import{u as Tn,g as Pn,c as On,d as zn,b as Mn}from"./use-navigate-to-agent-B8yDMTez.js";import{g as $n,a as Mt}from"./agent-capabilities-BxGDQyCw.js";import{u as $t}from"./shell-layout-OPAbVfwZ.js";import{d as Fn}from"./session-runtime-C-KTDVeQ.js";import{C as Ln}from"./collection-search-BLs0Fnfs.js";import{g as En,a as Bn,b as Rn,e as Vn}from"./extract-connection-data-CqOTDUuA.js";import{u as Ft,a as Lt,g as Kn,C as et}from"./connection-card-R6-YJNhI.js";import{D as Et,b as Bt,c as Rt,d as Vt,h as Hn,e as Un}from"./dialog-pwZ4KzZ6.js";import{d as W,a as Y,e as Z,b as J,c as ee,F as ut}from"./form-ENCNwobk.js";import{I as re}from"./input-Cvmwm8KN.js";import{S as qn,a as Gn,b as Xn,c as Qn,d as De}from"./select-SMcDHH3S.js";import{T as Wn}from"./textarea-DsyQQY8o.js";import{b as Kt}from"./use-connection-BBRJTBMy.js";import{n as Be,i as tt}from"./Tool02-DiIiNPwu.js";import{e as Yn}from"./UserSquare-B8RaUikS.js";import{c as Zn,i as Le,a as mt,E as Jn,p as es,b as ts,d as ns}from"./connection-form-helpers-CObw_4nL.js";import{a as nt}from"./authenticate-and-persist-oauth-B322JeMG.js";import{g as ss}from"./connection-slug-CITJ0kGN.js";import{C as os}from"./collection-tabs-Ir5Tsafl.js";import{u as ft}from"./use-infinite-scroll-D9F23MOw.js";import{B as Ee}from"./badge-CFKeX0mn.js";import{u as is}from"./useSuspenseInfiniteQuery-dJDa9vJh.js";import{g as Ke}from"./metadata-dUsYcpuu.js";import{u as as}from"./use-ai-providers-Dj1Pomhd.js";function ls(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const rs=2e4;function cs(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Qo(){const n=O.c(19),{org:e}=oe(),s=dn.COMMERCE_DISCOVERY(e.id);let o;n[0]!==e.id||n[1]!==e.slug?(o=ct({connectionId:bt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=o):o=n[2];const{data:a}=ke(o),i=ke({queryKey:Ae.commerceDiscoveryConnection(e.id,s),enabled:!!a,retry:!1,staleTime:6e4,queryFn:async()=>{if(!a)throw new Error("selfClient not ready");const k=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return dt(k)}}),l=i.data?.item??null,{data:r}=ke({...ct({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!l}),c=Ae.commerceDiscoveryDiagnostic(e.id,s),u=!!r;let m;n[3]!==r?(m=async()=>{if(!r)throw new Error("cdClient not ready");const k=await r.callTool({name:vt,arguments:{}});return dt(k).diagnostic??null},n[3]=r,n[4]=m):m=n[4];let f;n[5]!==c||n[6]!==u||n[7]!==m?(f={queryKey:c,enabled:u,retry:1,refetchInterval:ds,queryFn:m},n[5]=c,n[6]=u,n[7]=m,n[8]=f):f=n[8];const d=ke(f),g=l?.metadata?.siteUrl,v=d.data??null,p=d.isSuccess,h=i.isPending||!!l&&d.isPending,j=typeof g=="string"&&g?g:null;let b;n[9]!==g?(b=cs(g),n[9]=g,n[10]=b):b=n[10];const C=r??null;let _;return n[11]!==s||n[12]!==d.isSuccess||n[13]!==C||n[14]!==v||n[15]!==h||n[16]!==j||n[17]!==b?(_={diagnostic:v,isSuccess:p,isLoading:h,siteUrl:j,host:b,connectionId:s,cdClient:C},n[11]=s,n[12]=d.isSuccess,n[13]=C,n[14]=v,n[15]=h,n[16]=j,n[17]=b,n[18]=_):_=n[18],_}function ds(n){return n.state.status!=="error"&&ls(n.state.data)==="generating"?rs:!1}function Wo(n,e){return{to:gn.agents,params:{org:n.slug,project:cn(n.id),panel:"app"},search:{connection:e,tool:vt}}}const us="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function ms(){const n=O.c(13),e=L();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let a;n[3]!==o?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=a):a=n[4];let i;n[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:us,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=i):i=n[5];let l;n[6]!==e?(l=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=l):l=n[7];let r;n[8]!==l?(r=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,t.jsx("span",{className:"text-base font-medium",children:l})]}),n[8]=l,n[9]=r):r=n[9];let c;return n[10]!==a||n[11]!==r?(c=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,r]}),n[10]=a,n[11]=r,n[12]=c):c=n[12],c}function fs(){const n=O.c(19),e=L();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:xn,label:s},n[2]=s,n[3]=o):o=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let i;n[6]!==a?(i={Icon:Gt,label:a},n[6]=a,n[7]=i):i=n[7];let l;n[8]!==e?(l=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=l):l=n[9];let r;n[10]!==l?(r={Icon:jn,label:l},n[10]=l,n[11]=r):r=n[11];let c;n[12]!==o||n[13]!==i||n[14]!==r?(c=[o,i,r],n[12]=o,n[13]=i,n[14]=r,n[15]=c):c=n[15];const u=c;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(gs)})]}),n[17]=u,n[18]=f):f=n[18],f}function gs(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function Yo(n){const e=O.c(22),{siteHost:s,footer:o,onClose:a,children:i}=n,l=L(),r=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let c;e[0]!==a||e[1]!==l?(c=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":l("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(Xt,{size:18})}),e[0]=a,e[1]=l,e[2]=c):c=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==r||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(pn,{size:16,className:"shrink-0 text-foreground/25"}),r&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:r,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=r,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let g;e[10]!==o?(g=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=g):g=e[11];let v;e[12]!==i||e[13]!==d||e[14]!==g?(v=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,i,g]}),e[12]=i,e[13]=d,e[14]=g,e[15]=v):v=e[15];let p,h;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),h=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=p,e[17]=h):(p=e[16],h=e[17]);let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[p,h,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(ms,{}),t.jsx("div",{className:"flex-1"}),t.jsx(fs,{})]})]}),e[18]=j):j=e[18];let b;return e[19]!==c||e[20]!==v?(b=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[c,v,j]}),e[19]=c,e[20]=v,e[21]=b):b=e[21],b}function Zo(n){const e=O.c(5),{ready:s,pending:o,label:a,onClick:i,children:l}=n,r=o||!s,c=s&&!o?l:null;let u;return e[0]!==a||e[1]!==i||e[2]!==r||e[3]!==c?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:r,children:[a,c]}),e[0]=a,e[1]=i,e[2]=r,e[3]=c,e[4]=u):u=e[4],u}function Ht(){const n=R.useContext(Qt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function hs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=O.c(13),{org:s,size:o}=n,a=o===void 0?"sm":o,i=a==="xs"?"size-5":"size-6",l=a==="xs"?"text-[9px]":"text-xs";let r;e[0]!==i?(r=H(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=r):r=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:hs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:H("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let m;return e[9]!==r||e[10]!==c||e[11]!==u?(m=t.jsx("div",{className:r,style:c,children:u}),e[9]=r,e[10]=c,e[11]=u,e[12]=m):m=e[12],m}function ps({invitation:n,onChanged:e}){const s=L(),[o,a]=R.useState(!1),i=n.organizationName??s("header.orgSwitcher.unknownOrganization"),l=async()=>{a(!0);try{const u=await ce.organization.acceptInvitation({invitationId:n.id});if(u.error){K.error(u.error.message),a(!1);return}}catch{K.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}K.success(s("header.orgSwitcher.joined",{name:i})),Yt();let c;try{c=(await ce.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},r=async()=>{a(!0);try{const c=await ce.organization.rejectInvitation({invitationId:n.id});if(c.error){K.error(c.error.message),a(!1);return}K.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{K.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:i},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:i}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:l,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:r,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:t.jsx(It,{size:14})})]})]})}function xs(n){const e=O.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:a}=n,i=L(),{data:l}=Wt(),{invitations:r,refetch:c}=Ht();let u;e[0]!==s?(u=(I,A)=>I.slug===s?-1:A.slug===s?1:I.name.localeCompare(A.name),e[0]=s,e[1]=u):u=e[1];const m=[...l??[]].sort(u),[f,d]=R.useState(""),g=f.toLowerCase(),v=g?m.filter(I=>I.name.toLowerCase().includes(g)||I.slug.toLowerCase().includes(g)):m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(kt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=p):p=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=I=>d(I.target.value),e[3]=h):h=e[3];let j;e[4]!==f?(j=I=>I.key==="Escape"&&f&&d(""),e[4]=f,e[5]=j):j=e[5];let b;e[6]!==i?(b=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=b):b=e[7];let C;e[8]!==f||e[9]!==j||e[10]!==b?(C=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:h,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=j,e[10]=b,e[11]=C):C=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(we,{size:16}),e[12]=_):_=e[12];let k;e[13]!==a?(k=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:_}),e[13]=a,e[14]=k):k=e[14];let D;e[15]!==C||e[16]!==k?(D=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[p,C,k]}),e[15]=C,e[16]=k,e[17]=D):D=e[17];const z="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let x;e[18]!==r||e[19]!==f||e[20]!==c?(x=!f&&r.map(I=>t.jsx(ps,{invitation:I,onChanged:c},I.id)),e[18]=r,e[19]=f,e[20]=c,e[21]=x):x=e[21];const S=v.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?i("header.orgSwitcher.noOrganizationsMatch",{query:f}):i("header.orgSwitcher.noOrganizationsAvailable")});let P;e[22]!==o||e[23]!==s?(P=I=>t.jsxs("button",{type:"button",onClick:()=>o(I.slug),className:H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",I.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:I,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.slug})]}),I.slug===s&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id),e[22]=o,e[23]=s,e[24]=P):P=e[24];const N=v.map(P);let y;e[25]!==x||e[26]!==S||e[27]!==N?(y=t.jsxs("div",{className:z,children:[x,S,N]}),e[25]=x,e[26]=S,e[27]=N,e[28]=y):y=e[28];let T;return e[29]!==y||e[30]!==D?(T=t.jsxs(t.Fragment,{children:[D,y]}),e[29]=y,e[30]=D,e[31]=T):T=e[31],T}function js(n){const e=O.c(22),{trigger:s,orgParam:o,align:a,side:i}=n,l=a===void 0?"start":a,r=i===void 0?"bottom":i,c=ot(),[u,m]=R.useState(!1),[f,d]=R.useState(!1);let g;e[0]!==s?(g=t.jsx(Re,{asChild:!0,children:s}),e[0]=s,e[1]=g):g=e[1];const v=String(u);let p;e[2]!==c?(p=D=>{m(!1),c({to:"/$org",params:{org:D}})},e[2]=c,e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{m(!1),d(!0)},e[4]=h):h=e[4];let j;e[5]!==o||e[6]!==v||e[7]!==p?(j=t.jsx(xs,{orgParam:o,onSelectOrg:p,onCreateOrg:h},v),e[5]=o,e[6]=v,e[7]=p,e[8]=j):j=e[8];let b;e[9]!==l||e[10]!==r||e[11]!==j?(b=t.jsx(St,{side:r,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:bs,onCloseAutoFocus:vs,children:j}),e[9]=l,e[10]=r,e[11]=j,e[12]=b):b=e[12];let C;e[13]!==u||e[14]!==g||e[15]!==b?(C=t.jsxs(Dt,{open:u,onOpenChange:m,children:[g,b]}),e[13]=u,e[14]=g,e[15]=b,e[16]=C):C=e[16];let _;e[17]!==f?(_=t.jsx(hn,{open:f,onOpenChange:d}),e[17]=f,e[18]=_):_=e[18];let k;return e[19]!==_||e[20]!==C?(k=t.jsxs(t.Fragment,{children:[C,_]}),e[19]=_,e[20]=C,e[21]=k):k=e[21],k}function vs(n){return n.preventDefault()}function bs(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Cs(n){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:r,disabled:c}=n,u=a===void 0?"Search...":a;let m;e[0]!==l?(m=H("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const f=c?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=H("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let g;e[4]!==r?(g=r?t.jsx(Ie,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=r,e[5]=g):g=e[5];let v;e[6]!==o?(v=b=>o(b.target.value),e[6]=o,e[7]=v):v=e[7];let p;e[8]!==c||e[9]!==i||e[10]!==u||e[11]!==v||e[12]!==s?(p=t.jsx("input",{type:"text",value:s,onChange:v,onKeyDown:i,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=u,e[11]=v,e[12]=s,e[13]=p):p=e[13];let h;e[14]!==d||e[15]!==g||e[16]!==p?(h=t.jsxs("label",{className:d,children:[g,p]}),e[14]=d,e[15]=g,e[16]=p,e[17]=h):h=e[17];let j;return e[18]!==m||e[19]!==h?(j=t.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=j):j=e[20],j}function ys(n,e,s){if(!s)return null;const o=In(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function Ns(n){const e=O.c(6),{value:s,onChange:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(Cs,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function ws(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function _s(n){const e=O.c(10),{org:s,onClose:o}=n,a=L();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let r;e[4]!==a?(r=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==l||e[8]!==r?(c=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Jt,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:r})}),e[6]=i,e[7]=l,e[8]=r,e[9]=c):c=e[9],c}function Ss(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ut,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ds(n){const e=O.c(11),{onImportFromGithub:s}=n,o=L();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(kn,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==o?(r=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=r):r=e[7];let c;return e[8]!==l||e[9]!==r?(c=t.jsx(Ut,{action:l,children:r}),e[8]=l,e[9]=r,e[10]=c):c=e[10],c}function ks(n){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H(o),e[2]=o,e[3]=l):l=e[3];let r;e[4]!==s?(r=()=>{B("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=r):r=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{className:"size-4"}),e[6]=c):c=e[6];let u;return e[7]!==i||e[8]!==l||e[9]!==r?(u=t.jsx(At,{"aria-label":i,className:l,onClick:r,children:c}),e[7]=i,e[8]=l,e[9]=r,e[10]=u):u=e[10],u}function Is(n){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;e[3]!==a?(r=H(a),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==s?(c=()=>{B("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(we,{}),e[7]=u):u=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==l||e[13]!==r||e[14]!==c||e[15]!==f?(d=t.jsx(xt,{children:t.jsxs(jt,{tooltip:l,className:r,onClick:c,children:[u,f]})}),e[12]=l,e[13]=r,e[14]=c,e[15]=f,e[16]=d):d=e[16],d}function As(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ot,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ts(n){const e=O.c(8),{emptyCtaClass:s}=n,o=L();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=H(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{className:"size-4"}),e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==i?(r=t.jsx(At,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=r):r=e[7],r}function Ps(n){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;e[3]!==a?(r=H(a),e[3]=a,e[4]=r):r=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{}),e[5]=c):c=e[5];let u;e[6]!==i?(u=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==l||e[11]!==r||e[12]!==m?(f=t.jsx(Re,{asChild:!0,children:t.jsxs(jt,{tooltip:l,className:r,children:[c,m]})}),e[10]=l,e[11]=r,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let g;return e[17]!==d?(g=t.jsx(xt,{children:d}),e[17]=d,e[18]=g):g=e[18],g}function Os(n){const e=O.c(9),{children:s}=n,o=L();let a;e[0]!==s?(a=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(ye,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let r;return e[6]!==a||e[7]!==l?(r=t.jsxs(Ne,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=r):r=e[8],r}function zs(n){const e=ot(),{create:s}=An(),{locator:o}=oe(),a=Nt(),i=bn();return async l=>{const r=crypto.randomUUID(),c=l===i?ys(n,o,a??""):null;try{await s({id:r,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:r},search:{virtualmcpid:l}})}}function st(n){const e=O.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==s.icon||e[3]!==s.title?(r=t.jsx(yt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=r):r=e[4];let c;e[5]!==s.title?(c=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=c):c=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==c||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[9]=c,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==a||e[15]!==l||e[16]!==r||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:a,className:l,children:[r,m,f]}),e[14]=a,e[15]=l,e[16]=r,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Ut(n){const e=O.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Ms(n){const e=O.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,r]=R.useState(""),c=it(),u=c??[],{org:m}=oe(),{data:f}=ce.useSession(),d=f?.user?.id??"anon",g=Pn(c),v=On(),p=zs(m.slug),h=$n(c),j=l.toLowerCase(),b=u.filter(Es).filter(F=>!h.has(F.id)).filter(Ls).filter(F=>!l||F.title.toLowerCase().includes(j)),C=b.filter(Fs),_=b.filter($s),k=Ct(m.id),D=!l||k.title.toLowerCase().includes(j),z=!!(o&&D);let x;e[0]!==s||e[1]!==o?(x=()=>{o?.(null),s(),r("")},e[0]=s,e[1]=o,e[2]=x):x=e[2];const S=x,P=F=>{if(o){o(F.id),s(),r("");return}zn({orgId:m.id,userId:d},F.id,g),v(),s(),r(""),p(F.id)},N="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==l?(y=t.jsx(Ns,{value:l,onChange:r}),e[3]=l,e[4]=y):y=e[4];const T="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",I=o&&D&&k&&t.jsx(st,{agent:k,selected:!a||a===k.id,onClick:S}),A=(C.length>0||!l)&&t.jsx(Ds,{onImportFromGithub:i}),M=C.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>P(F)},F.id)),V=_.length>0&&t.jsx(Ss,{}),X=_.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>P(F)},F.id));let E;e[5]!==z||e[6]!==l||e[7]!==b.length?(E=b.length===0&&!z&&l&&t.jsx(ws,{}),e[5]=z,e[6]=l,e[7]=b.length,e[8]=E):E=e[8];let ne;e[9]!==E||e[10]!==I||e[11]!==A||e[12]!==M||e[13]!==V||e[14]!==X?(ne=t.jsxs("div",{className:T,children:[I,A,M,V,X,E]}),e[9]=E,e[10]=I,e[11]=A,e[12]=M,e[13]=V,e[14]=X,e[15]=ne):ne=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(_s,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==ne||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:N,children:[y,ne,q]}),e[19]=ne,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function $s(n){return!Mt(n.metadata)}function Fs(n){return Mt(n.metadata)}function Ls(n){return!mn(n.id)}function Es(n){return!un(n.id)}function Bs(n){const e=O.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:a,onSelectAgent:i,selectedAgentId:l,side:r,align:c}=s,u=o===void 0?!1:o,m=r===void 0?"right":r,f=c===void 0?"start":c,[d,g]=R.useState(!1),[v,p]=R.useState(!1),h=ht(),{setOpenMobile:j}=pt(),b=Tn(),C=b?"border border-border":void 0;let _;e[2]!==b?(_=A=>b?t.jsx(Os,{children:A}):A,e[2]=b,e[3]=_):_=e[3];const k=_;let D;e[4]!==h||e[5]!==j?(D=()=>{g(!1),h&&j(!1)},e[4]=h,e[5]=j,e[6]=D):D=e[6];const z=D;let x;e[7]!==z?(x=()=>{z(),p(!0)},e[7]=z,e[8]=x):x=e[8];const S=x;let P;e[9]!==z||e[10]!==S||e[11]!==i||e[12]!==d||e[13]!==l?(P=d&&t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Zt,{className:"h-4 w-24"})}),children:t.jsx(Ms,{onClose:z,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:S})}),e[9]=z,e[10]=S,e[11]=i,e[12]=d,e[13]=l,e[14]=P):P=e[14];const N=P;let y;e[15]!==f||e[16]!==u||e[17]!==C||e[18]!==b||e[19]!==h||e[20]!==d||e[21]!==N||e[22]!==m||e[23]!==a||e[24]!==k?(y=h?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:a}):u?k(t.jsx(ks,{setOpen:g,emptyCtaClass:C})):t.jsx(Is,{setOpen:g,highlightEmpty:b,emptyCtaClass:C}),t.jsx(Tt,{open:d,onOpenChange:g,direction:"bottom",children:t.jsxs(Pt,{className:"max-h-[85dvh] p-0",children:[t.jsx(As,{}),N]})})]}):t.jsxs(Dt,{open:d,onOpenChange:A=>{A&&!d&&B("agent_browser_opened",{surface:"desktop_popover"}),g(A)},children:[a?t.jsx(Re,{asChild:!0,children:a}):u?k(t.jsx(Re,{asChild:!0,children:t.jsx(Ts,{emptyCtaClass:C})})):t.jsx(Ps,{wrapEmptyHint:k,highlightEmpty:b,emptyCtaClass:C}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:N})]}),e[15]=f,e[16]=u,e[17]=C,e[18]=b,e[19]=h,e[20]=d,e[21]=N,e[22]=m,e[23]=a,e[24]=k,e[25]=y):y=e[25];let T;e[26]!==v?(T=t.jsx(Dn,{open:v,onOpenChange:p,mode:"agent"}),e[26]=v,e[27]=T):T=e[27];let I;return e[28]!==T||e[29]!==y?(I=t.jsxs(t.Fragment,{children:[y,T]}),e[28]=T,e[29]=y,e[30]=I):I=e[30],I}function Rs(){const n=O.c(2),e=it()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?Fn(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const Vs="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Ks(n){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=L(),r=Cn(s)??o??null;let c,u,m,f,d;e[0]!==r?.title||e[1]!==a||e[2]!==l?(d=r?.title??l("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",c="button",u=a,m=l("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=r?.title,e[1]=a,e[2]=l,e[3]=c,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(c=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const g=r?.icon??null;let v;e[8]!==g||e[9]!==d?(v=t.jsx(yt,{icon:g,name:d,size:"xs"}),e[8]=g,e[9]=d,e[10]=v):v=e[10];let p;e[11]!==c||e[12]!==u||e[13]!==m||e[14]!==v?(p=t.jsx("button",{type:c,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:v}),e[11]=c,e[12]=u,e[13]=m,e[14]=v,e[15]=p):p=e[15];let h;e[16]!==d?(h=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=h):h=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let b;e[19]!==h?(b=t.jsxs("button",{type:"button",className:Vs,children:[h,j]}),e[19]=h,e[20]=b):b=e[20];let C;e[21]!==s||e[22]!==i||e[23]!==b?(C=t.jsx(Bs,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:b}),e[21]=s,e[22]=i,e[23]=b,e[24]=C):C=e[24];let _;return e[25]!==C||e[26]!==f||e[27]!==p?(_=t.jsxs("div",{className:f,children:[p,C]}),e[25]=C,e[26]=f,e[27]=p,e[28]=_):_=e[28],_}function Jo(n){const e=O.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,a=L(),{org:i}=oe(),{state:l,isMobile:r}=pt(),c=Ht().invitations.length>0,u=l==="collapsed"||r;let m;e[2]!==c||e[3]!==i.name||e[4]!==a?(m=c?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:i.name}):a("header.shellBreadcrumb.switchOrganization",{name:i.name}),e[2]=c,e[3]=i.name,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i?(f=t.jsx(at,{org:i,size:"sm"}),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==c||e[9]!==u?(d=c&&t.jsx("span",{className:H("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=c,e[9]=u,e[10]=d):d=e[10];let g;e[11]!==f||e[12]!==d?(g=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=g):g=e[13];let v;e[14]!==i.name||e[15]!==o?(v=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[14]=i.name,e[15]=o,e[16]=v):v=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_t,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=p):p=e[17];let h;e[18]!==m||e[19]!==g||e[20]!==v?(h=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[g,v,p]})}),e[18]=m,e[19]=g,e[20]=v,e[21]=h):h=e[21];let j;e[22]!==i.slug||e[23]!==h?(j=t.jsx(js,{orgParam:i.slug,trigger:h}),e[22]=i.slug,e[23]=h,e[24]=j):j=e[24];let b;e[25]!==i.name?(b=t.jsx(ye,{side:"bottom",children:i.name}),e[25]=i.name,e[26]=b):b=e[26];let C;return e[27]!==b||e[28]!==j?(C=t.jsxs(Ne,{children:[j,b]}),e[27]=b,e[28]=j,e[29]=C):C=e[29],C}function ei(n){const e=O.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=oe(),{threads:i}=zt(),l=it(),{data:r}=ce.useSession(),{setTaskId:c,createNewTask:u}=$t(),m=Rs();let f;e[2]!==a.id?(f=Ct(a.id),e[2]=a.id,e[3]=f):f=e[3];const d=f,g=d.id,v=wt();let p;e[4]!==l||e[5]!==u||e[6]!==g||e[7]!==o||e[8]!==m||e[9]!==r?.user?.id||e[10]!==c||e[11]!==i?(p=k=>{const D=k??g,z=(l??[]).find(S=>S.id===D),x=Mn(i,D,r?.user?.id,m(D),!!(z&&yn(z)));x?c(x.id,D):u(D),o?.()},e[4]=l,e[5]=u,e[6]=g,e[7]=o,e[8]=m,e[9]=r?.user?.id,e[10]=c,e[11]=i,e[12]=p):p=e[12];const h=p;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=j):j=e[13];const b=v===g?d:void 0;let C;e[14]!==v||e[15]!==h?(C=()=>h(v),e[14]=v,e[15]=h,e[16]=C):C=e[16];let _;return e[17]!==v||e[18]!==h||e[19]!==b||e[20]!==C?(_=t.jsx(R.Suspense,{fallback:j,children:t.jsx(Ks,{agentId:v,fallback:b,onOpenHome:C,onPick:h})}),e[17]=v,e[18]=h,e[19]=b,e[20]=C,e[21]=_):_=e[21],_}function ti(){const n=O.c(20),e=L(),{threads:s}=zt(),{createNewTask:o}=$t(),a=wt(),i=Nt();let l;n[0]!==i||n[1]!==s?(l=s.find(h=>h.id===i)?.branch??null,n[0]=i,n[1]=s,n[2]=l):l=n[2];const r=l;let c;n[3]!==a||n[4]!==o||n[5]!==r?(c=()=>{o(a,r)},n[3]=a,n[4]=o,n[5]=r,n[6]=c):c=n[6];const u=c;let m;n[7]!==e?(m=e("sidebar.taskGroupsList.newChat"),n[7]=e,n[8]=m):m=n[8];let f;n[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(vn,{size:16}),n[9]=f):f=n[9];let d;n[10]!==u||n[11]!==m?(d=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:u,"aria-label":m,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:f})}),n[10]=u,n[11]=m,n[12]=d):d=n[12];let g;n[13]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[13]=e,n[14]=g):g=n[14];let v;n[15]!==g?(v=t.jsx(ye,{side:"bottom",children:g}),n[15]=g,n[16]=v):v=n[16];let p;return n[17]!==d||n[18]!==v?(p=t.jsxs(Ne,{children:[d,v]}),n[17]=d,n[18]=v,n[19]=p):p=n[19],p}function Hs({open:n,onOpenChange:e,onCreated:s}){const o=L(),{org:a}=oe(),{data:i}=ce.useSession(),{stdioEnabled:l}=en(),r=ht(),c=Kt(),u=Ft(),f=Lt(u,"").items,d=tn({resolver:nn(Zn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),v=d.watch("connection_url"),p=d.watch("npx_package"),h=Le({uiType:g,connectionUrl:v??"",npxPackage:p??""})??mt({uiType:g,connectionUrl:v??"",registryItems:f}),j=x=>{const S=x.trim();if(!S)return;const P=!!d.formState.dirtyFields.title,N=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,T=A=>{if(A&&(!P&&!d.getValues("title").trim()&&A.title&&d.setValue("title",A.title,{shouldDirty:!1}),!N&&!(d.getValues("description")??"").trim()&&A.description&&d.setValue("description",A.description,{shouldDirty:!1}),!y&&A.envVarKeys?.length)){const M=d.getValues("env_vars")??[],V=new Set(M.map(E=>E.key)),X=A.envVarKeys.filter(E=>!V.has(E));X.length>0&&d.setValue("env_vars",[...M,...X.map(E=>({key:E,value:""}))],{shouldDirty:!0})}},I=es(S);if(I&&l){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",I.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),T(Le({uiType:"NPX",npxPackage:I.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const A=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",A,{shouldDirty:!0}),d.setValue("connection_url",S,{shouldDirty:!0}),T(Le({uiType:A,connectionUrl:S})??mt({uiType:A,connectionUrl:S,registryItems:f}));return}g==="NPX"&&T(Le({uiType:"NPX",npxPackage:S}))},b=x=>{x||d.reset(),e(x)},C=async x=>{let S,P=null,N=null,y=null;x.ui_type==="NPX"?(S="STDIO",P="",y=ts(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(S="STDIO",P="",y=ns(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(S=x.ui_type,P=x.connection_url||"",N=x.connection_token||null);const T=En("conn");try{await c.create.mutateAsync({id:T,title:x.title,description:x.description||null,connection_type:S,connection_url:P,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(T)}catch{K.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},_=o("connections.createConnectionDialog.title"),k=o("connections.createConnectionDialog.description"),D=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(W,{control:d.control,name:"ui_type",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(qn,{value:x.value,onValueChange:x.onChange,children:[t.jsx(J,{children:t.jsx(Gn,{children:t.jsx(Xn,{})})}),t.jsxs(Qn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Je,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Je,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Je,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Yn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),g==="NPX"&&t.jsx(W,{control:d.control,name:"npx_package",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...x,value:x.value??"",onPaste:S=>{const P=S.clipboardData.getData("text");P&&(S.preventDefault(),d.setValue("npx_package",P.trim(),{shouldDirty:!0}),j(P))},onBlur:S=>{j(S.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),g==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(W,{control:d.control,name:"stdio_command",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"stdio_args",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...x,value:x.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(g==="NPX"||g==="STDIO")&&t.jsx(W,{control:d.control,name:"env_vars",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(J,{children:t.jsx(Jn,{value:x.value??[],onChange:x.onChange})}),t.jsx(ee,{})]})}),g!=="NPX"&&g!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(W,{control:d.control,name:"connection_url",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...x,value:x.value??"",onPaste:S=>{const P=S.clipboardData.getData("text");P&&(S.preventDefault(),d.setValue("connection_url",P.trim(),{shouldDirty:!0}),j(P))},onBlur:S=>{j(S.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"connection_token",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:h?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(J,{children:t.jsx(re,{type:"password",placeholder:h?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...x,value:x.value??""})}),h?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.token.helperText,h.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"title",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(J,{children:t.jsx(re,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...x})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"description",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(Z,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(J,{children:t.jsx(Wn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...x,value:x.value??""})}),t.jsx(ee,{})]})})]});return r?t.jsx(Tt,{open:n,onOpenChange:b,children:t.jsxs(Pt,{className:"max-h-[90vh]",children:[t.jsx(Nn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Ot,{children:_}),t.jsx(wn,{className:"mt-1",children:k})]}),t.jsx(_n,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(It,{size:16})})})]})}),t.jsx(ut,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(C),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:z}),t.jsx(Sn,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:D})})]})})]})}):t.jsx(Et,{open:n,onOpenChange:b,children:t.jsxs(Bt,{className:"sm:max-w-[525px]",children:[t.jsxs(Rt,{children:[t.jsx(Vt,{children:_}),t.jsx(Hn,{children:k})]}),t.jsx(ut,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(C),children:[t.jsx("div",{className:"py-4",children:z}),t.jsxs(Un,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>b(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:D})]})]})})]})})}function Us(n){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:r,connectingItemId:c,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,g=s===void 0?"add":s,v=d===void 0?"connected":d,p=L(),{org:h}=oe(),j=R.useDeferredValue(u),b=u!==j;let C;e[0]!==j?(C=j.trim().toLowerCase(),e[0]=j,e[1]=C):C=e[1];const _=C;let k;e[2]!==v?(k=w=>w??v,e[2]=v,e[3]=k):k=e[3];const[D,z]=sn(on.connectionsTab(h.slug)+(v==="all"?":home-modal":":agent-modal"),k);let x;e[4]!==D||e[5]!==z?(x=w=>{w!==D&&B("connections_dialog_tab_changed",{to_tab:w}),z(w)},e[4]=D,e[5]=z,e[6]=x):x=e[6];const S=x;let P;e[7]!==h.id||e[8]!==h.slug?(P={connectionId:bt,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=P):P=e[9];const N=rn(P),y=j?.trim().split(/\s+/).filter(Boolean)??[],T=y.length>0?{operator:"or",conditions:y.flatMap(Js)}:void 0,I={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(I),{data:M,fetchNextPage:V,hasNextPage:X,isFetchingNextPage:E}=is({queryKey:Ae.collectionListInfinite(N,h.id,"","CONNECTIONS",A),queryFn:async w=>{const{pageParam:$}=w,se=$===void 0?0:$;return(await N.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Ys,staleTime:3e4}),ne=M?.pages.flatMap(Ws)??[],q=Kn(ne),de=new Set(ne.filter(Qs).map(Xs)),F=Ft(),ie=Lt(F,j),He=ft(ie.loadMore,ie.hasMore,ie.isLoadingMore),Ue=ft(V,X??!1,E),G=D==="all"||!!_,lt=G?ie.items.filter(w=>{const $=Bn(w);if($&&de.has($))return!1;if(!_)return!0;const se=Ke(w._meta),ae=[w.title,w.description,w.name,w.server?.title,w.server?.description,w.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(Q=>ae.includes(Q.toLowerCase()))}):[],_e=lt.filter(Gs),Se=lt.filter(qs);let Te;e[10]!==a?(Te=w=>w.some($=>a.has($.id)),e[10]=a,e[11]=Te):Te=e[11];const qe=Te;let Pe;e[12]!==a||e[13]!==o||e[14]!==c||e[15]!==qe||e[16]!==g||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==p?(Pe=(w,$,se,ae,Q)=>{const Fe=qe(Q),be=Q.find(le=>!a.has(le.id)),U=Q[0];if(g==="browse"){const le=ss(U);return t.jsx(et,{connection:{title:$,icon:se,description:Q.length>1?`${Q.length} instances`:ae??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Ee,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",p("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{B("connection_browse_clicked",{app_name:U.app_name??null,connection_id:U.id,instances_count:Q.length}),f?.(le)}},w)}return t.jsx(et,{connection:{title:$,icon:se,description:ae},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Fe&&t.jsxs(Ee,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",p("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:le=>{le.stopPropagation(),be?(B("connection_add_clicked",{action:"use_existing",app_name:U.app_name??null,connection_id:be.id}),o&&B("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:U.app_name??null,mode:"existing"}),i(be.id)):(B("connection_add_clicked",{action:"clone",app_name:U.app_name??null,base_connection_id:U.id}),l(U))},children:p("virtualMcp.connectionDialogContent.add")})]})},w)},e[12]=a,e[13]=o,e[14]=c,e[15]=qe,e[16]=g,e[17]=i,e[18]=f,e[19]=l,e[20]=p,e[21]=Pe):Pe=e[21];const Oe=Pe;let ze;e[22]!==c||e[23]!==g||e[24]!==r||e[25]!==p?(ze=w=>{const $=Ke(w._meta),se=$?.friendlyName||$?.friendly_name||w.server?.title||w.title||w.server?.name||w.name||w.id||"",ae=w.server?.description||w.description||null,Q=w.server?.icons?.[0]?.src||Rn(w.server?.repository)||null,Fe=$?.official===!0,be=$?.verified===!0,U=$?.owner==="deco";return t.jsx(et,{connection:{title:se,description:ae,icon:Q},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[U&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:p("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByDeco")})]}),!U&&Fe&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Ee,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!U&&!Fe&&be&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Ee,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:le=>{le.stopPropagation(),B("connection_add_clicked",{action:"connect_new",registry_item_id:w.id,app_name:$?.friendlyName||w.server?.name||w.name||null}),r(w)},children:c===w.id?t.jsx(Ie,{size:14,className:"animate-spin"}):p(g==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${w.id}`)},e[22]=c,e[23]=g,e[24]=r,e[25]=p,e[26]=ze):ze=e[26];const rt=ze;let ue;e[27]!==D||e[28]!==S||e[29]!==m||e[30]!==_||e[31]!==p?(ue=!_&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(os,{tabs:[{id:"all",label:p("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:p("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:D,onTabChange:w=>S(w)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{B("connections_dialog_custom_clicked"),m()},children:[t.jsx(we,{size:12}),p("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=D,e[28]=S,e[29]=m,e[30]=_,e[31]=p,e[32]=ue):ue=e[32];const Ge=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ge?(me=H("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[33]=Ge,e[34]=me):me=e[34];const qt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Me;e[35]!==Oe?(Me=w=>{if(w.type==="group")return Oe(w.key,w.title,w.icon,null,w.connections);const $=w.connection;return Oe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Oe,e[36]=Me):Me=e[36];const Xe=q.map(Me);let fe;e[37]!==Ue?(fe=t.jsx("div",{ref:Ue,className:"col-span-full h-1"}),e[37]=Ue,e[38]=fe):fe=e[38];let ge;e[39]!==E?(ge=E&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=E,e[40]=ge):ge=e[40];const Qe=G&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(tt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=G&&_e.map(rt),Ye=G&&Se.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ze=G&&Se.map(rt);let he;e[41]!==He||e[42]!==F||e[43]!==G?(he=G&&F.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=F,e[43]=G,e[44]=he):he=e[44];let pe;e[45]!==ie.isLoadingMore||e[46]!==G?(pe=G&&ie.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=ie.isLoadingMore,e[46]=G,e[47]=pe):pe=e[47];let xe;e[48]!==Xe||e[49]!==fe||e[50]!==ge||e[51]!==Qe||e[52]!==We||e[53]!==Ye||e[54]!==Ze||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:qt,children:[Xe,fe,ge,Qe,We,Ye,Ze,he,pe]}),e[48]=Xe,e[49]=fe,e[50]=ge,e[51]=Qe,e[52]=We,e[53]=Ye,e[54]=Ze,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==D||e[59]!==q.length||e[60]!==Se||e[61]!==u||e[62]!==p||e[63]!==_e?(je=q.length===0&&_e.length===0&&Se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?p("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):p(D==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=D,e[59]=q.length,e[60]=Se,e[61]=u,e[62]=p,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let $e;return e[69]!==ue||e[70]!==ve?($e=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=$e):$e=e[71],$e}function qs(n){return!n.verified&&!Ke(n._meta)?.verified&&!n.meta?.verified}function Gs(n){return n.verified||Ke(n._meta)?.verified||n.meta?.verified}function Xs(n){return n.app_name}function Qs(n){return n.app_name}function Ws(n){return n?.items??[]}function Ys(n,e){if(n?.hasMore)return e.reduce(Zs,0)}function Zs(n,e){return n+(e?.items?.length??0)}function Js(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function ni({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=L(),l=a.mode??"add",r="agentId"in a?a.agentId:void 0,c="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,u="onAdd"in a&&a.onAdd?a.onAdd:N=>{},m=(N,y,T)=>{r&&B("agent_connection_attached",{agent_id:r,connection_id:N,app_name:y,mode:T})},[f,d]=R.useState(null),[g,v]=R.useState(o),[p,h]=R.useState(!1),{org:j}=oe(),{data:b}=ce.useSession(),C=Kt(),_=an(),k=ot(),D=N=>{e(!1),k({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:N}})},z=()=>{_.invalidateQueries({predicate:N=>{const y=N.queryKey;return y[1]===j.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},x=async(N,y)=>{B("connection_oauth_succeeded",{connection_id:N,flow:y});const T=new URL(`/api/${j.slug}/mcp/${N}`,window.location.origin);await _.invalidateQueries({queryKey:Ae.isMCPAuthenticated(T.href,null)}),z()},S=async N=>{d(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await C.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,M=await nt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:V=>C.update.mutateAsync({id:A,data:{connection_token:V}}).then(()=>{})});if(M.ran&&!M.ok){B("connection_oauth_failed",{connection_id:A,flow:"clone",error:M.error??"no_token"}),K.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:M.error??"no token received"})),await C.delete.mutateAsync(A);return}M.ran&&await x(A,"clone"),m(A,N.app_name??null,"clone"),u(A)}catch(y){console.error("Failed to add connection:",y),K.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},P=async N=>{if(!(!j||!b?.user?.id)){d(N.id);try{const y=Vn(N,j.id,b.user.id,{remoteIndex:0}),T=y.connection_type==="STDIO",I=!!y.connection_url,A=T&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!I&&!A){K.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:M}=await C.create.mutateAsync(y),V=await nt({connectionId:M,orgId:j.id,orgSlug:j.slug,persistFallback:X=>C.update.mutateAsync({id:M,data:{connection_token:X}}).then(()=>{})});if(V.ran&&!V.ok){B("connection_oauth_failed",{connection_id:M,flow:"connect_new",error:V.error??"no_token"}),K.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:V.error??"no token received"})}),m(M,y.app_name??null,"new"),u(M);return}V.ran?(await x(M,"connect_new"),K.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):K.success(i("virtualMcp.addConnectionDialog.connected")),m(M,y.app_name??null,"new"),u(M)}catch(y){console.error("Failed to connect:",y),K.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs(Et,{open:n,onOpenChange:e,children:[t.jsxs(Bt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Rt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Vt,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(Ln,{value:g,onChange:v,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Us,{mode:l,agentId:r,addedConnectionIds:c,onAdd:u,onCloneAndAdd:S,onConnectAndAdd:P,connectingItemId:f,search:g,onCreateConnection:()=>h(!0),onBrowseNavigate:D,defaultTab:s})})]}),t.jsx(Hs,{open:p,onOpenChange:h,onCreated:async N=>{h(!1);const y=await nt({connectionId:N,orgId:j.id,orgSlug:j.slug,persistFallback:T=>C.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(y.ran&&!y.ok){B("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:y.error??"no_token"}),K.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(N,null,"custom"),u(N),e(!1);return}y.ran&&await x(N,"custom_create"),m(N,null,"custom"),u(N),e(!1)}})]})}const gt=new Map;function si(){const{org:n}=oe(),e=ln(),s=as(),o=s.find(h=>h.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:r}=ke({queryKey:Ae.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=a?.balanceCents??null,u=c!=null?c/100:null,m=R.useRef(new Map);if(c!=null){const h=gt.get(n.id);m.current.get(n.id)&&h!=null&&c>h&&B("credits_topped_up_detected",{organization_id:n.id,delta_cents:c-h,previous_balance_cents:h,new_balance_cents:c}),gt.set(n.id,c),m.current.set(n.id,!0)}const f=!!o,d=c!=null&&c>0,g=c!=null&&c===0,v=c!=null&&c===200,p=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:u,hasCredits:d,isZeroBalance:g,isInitialFreeCredit:v,hasOnlyDecoProvider:p,isLoading:i,isFetching:r,refetch:l}}const eo=4,to="TASK";function no(n){return n.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,eo)||to}function oi(n,e,s){const o=s?.trim();return o||(e==null?null:`${no(n)}-${String(e).padStart(2,"0")}`)}const so=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ii(n){const e=so.exec(n.trim())?.[1];return e===void 0?null:Number(e)}function ai(n){const e=O.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let r;return e[4]!==a||e[5]!==i||e[6]!==l?(r=t.jsx("img",{src:fn,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=r):r=e[7],r}export{ei as A,Yo as C,ti as N,Jo as O,ai as S,Zo as a,ni as b,Wo as c,js as d,at as e,Qo as f,ls as g,Rs as h,ii as p,oi as t,si as u};
@@ -1 +1 @@
1
- import{r as c,j as i,bs as C,bw as y,bv as T,by as I,cG as M,cF as H,bu as z,c as A,n as g}from"./index-ygoeB01B.js";var m="Switch",[U]=z(m),[q,F]=U(m),E=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:r,checked:s,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=a,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=T({prop:s,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(a.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...r}=a,s=F(P,t);return i.jsx(C.span,{"data-state":j(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});R.displayName=P;var L="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:r=!0,...s},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:d,style:{...s.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=L;function j(a){return a?"checked":"unchecked"}var O=E,$=R;function G(a){const e=A.c(9);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==s?(o=i.jsx(O,{"data-slot":"switch",className:s,...r,children:n}),e[6]=r,e[7]=s,e[8]=o):o=e[8],o}export{G as S};
1
+ import{r as c,j as i,bs as C,bw as y,bv as T,by as I,cG as M,cF as H,bu as z,c as A,n as g}from"./index-DZLUP-bk.js";var m="Switch",[U]=z(m),[q,F]=U(m),E=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:r,checked:s,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=a,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=T({prop:s,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(a.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...r}=a,s=F(P,t);return i.jsx(C.span,{"data-state":j(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});R.displayName=P;var L="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:r=!0,...s},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:d,style:{...s.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=L;function j(a){return a?"checked":"unchecked"}var O=E,$=R;function G(a){const e=A.c(9);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==s?(o=i.jsx(O,{"data-slot":"switch",className:s,...r,children:n}),e[6]=r,e[7]=s,e[8]=o):o=e[8],o}export{G as S};
@@ -1 +1 @@
1
- import{c as te,j as s,dy as ye,b as ue,r as ce,B as ee,n as je,t as ae,Y as be}from"./index-ygoeB01B.js";import{s as ge}from"./Plus-DsbRnoOt.js";import{c as Re,d as ve,b as Se,f as De,g as Ne,e as _e,a as Ce,A as Pe}from"./alert-dialog-L0qx6i6s.js";import{d as Ae,h as ke,c as we,e as Oe,b as ze,D as Ee}from"./dialog-CLmeJCvy.js";import{I as Ie}from"./input-BbML9Nmm.js";import{G as xe,a as $e}from"./github-repo-picker-CPP6CKCn.js";import{u as Fe,b as Te,c as Ge}from"./use-org-repo-syncs-B0qMGZPW.js";import{t as He}from"./cards-Cgj3-S7j.js";import{R as Be}from"./require-capability-DT5PyiAq.js";import"./collection-search-CVaeQHld.js";import"./SearchMd-Vz_-9QqS.js";import"./use-debounced-value-D-Z6eH8B.js";import"./use-connection-D85CDmBf.js";import"./use-mcp-client-wCEu91RM.js";import"./constants-dLUUoWH7.js";import"./auth-DlWrMWjY.js";import"./authenticate-and-persist-oauth-woXc6jrT.js";import"./mcp-oauth-DxDxYsmM.js";import"./ArrowLeft-BNGHL2is.js";import"./LinkExternal01-DXIJl-2q.js";import"./LockUnlocked01-Bey4SIAd.js";import"./use-mcp-tools-CVVHK2jc.js";import"./extract-connection-data-DBygL9Ff.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-B-SDjYaO.js";import"./use-destination-route-CQh1Fm5z.js";import"./use-virtual-mcp-d_rTOrSq.js";import"./hooks-Bj6hNUFL.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DZv9gsIL.js";import"./task-board-ZkwmcnXT.js";import"./schema-D1PTLZoj.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BpKUwJal.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./folder-icon-CvFZ67nf.js";import"./Eye-Dy7Gk0Xt.js";import"./DotsVertical-DmeUsVvJ.js";import"./Download01-CYAg8W5B.js";import"./Share07-CY9TyDW3.js";import"./Globe01-D2SWA6aV.js";import"./Key01--XvWEe9Q.js";import"./Palette-Bm8uQz-a.js";import"./Trash01-BkZOPZ1F.js";import"./Zap-bTmIcWrz.js";import"./dropdown-menu-Y5klxs5R.js";import"./Check-CMcrSGq4.js";import"./ChevronRight-DLfQb7o8.js";import"./file-type-icon-DKwFQUrg.js";import"./access-gate-CSvwSPbV.js";import"./capability-load-error-D1mAZ573.js";function qe(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Le(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:He(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=te.c(32),{config:l,onRemove:i}=e,c=ue();let u;t[0]!==l||t[1]!==c?(u=Le(l,c),t[0]=l,t[1]=c,t[2]=u):u=t[2];const p=u;let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(xe,{size:16,className:"text-muted-foreground"})}),t[3]=o):o=t[3];let a;t[4]!==l.repoName||t[5]!==l.repoOwner?(a=s.jsxs("span",{className:"font-medium text-sm truncate",children:[l.repoOwner,"/",l.repoName]}),t[4]=l.repoName,t[5]=l.repoOwner,t[6]=a):a=t[6];let n;t[7]!==l.ref?(n=s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["@",l.ref]}),t[7]=l.ref,t[8]=n):n=t[8];let g;t[9]!==a||t[10]!==n?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[a,n]}),t[9]=a,t[10]=n,t[11]=g):g=t[11];const m=p.error?"text-destructive":"text-muted-foreground";let d;t[12]!==m?(d=je("text-xs mt-0.5 truncate",m),t[12]=m,t[13]=d):d=t[13];let f;t[14]!==l.volume||t[15]!==c?(f=c("settings.syncedRepos.rowSubtitle",{volume:l.volume}),t[14]=l.volume,t[15]=c,t[16]=f):f=t[16];let y;t[17]!==p.label||t[18]!==d||t[19]!==f?(y=s.jsxs("p",{className:d,children:[f," ·"," ",p.label]}),t[17]=p.label,t[18]=d,t[19]=f,t[20]=y):y=t[20];let x;t[21]!==g||t[22]!==y?(x=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,s.jsxs("div",{className:"min-w-0",children:[g,y]})]}),t[21]=g,t[22]=y,t[23]=x):x=t[23];let j;t[24]!==c?(j=c("settings.syncedRepos.remove"),t[24]=c,t[25]=j):j=t[25];let h;t[26]!==i||t[27]!==j?(h=s.jsx(ee,{variant:"outline",size:"sm",onClick:i,children:j}),t[26]=i,t[27]=j,t[28]=h):h=t[28];let b;return t[29]!==x||t[30]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[x,h]}),t[29]=x,t[30]=h,t[31]=b):b=t[31],b}function Ye(e){const t=te.c(21),{onAdd:l}=e,i=ue();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(xe,{size:20,className:"text-muted-foreground"})}),t[0]=c):c=t[0];let u;t[1]!==i?(u=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=u):u=t[2];let p;t[3]!==u?(p=s.jsx("p",{className:"font-medium text-sm",children:u}),t[3]=u,t[4]=p):p=t[4];let o;t[5]!==i?(o=i("settings.syncedRepos.emptyDescription"),t[5]=i,t[6]=o):o=t[6];let a;t[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),t[7]=o,t[8]=a):a=t[8];let n;t[9]!==p||t[10]!==a?(n=s.jsxs("div",{children:[p,a]}),t[9]=p,t[10]=a,t[11]=n):n=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ge,{size:14}),t[12]=g):g=t[12];let m;t[13]!==i?(m=i("settings.syncedRepos.addRepo"),t[13]=i,t[14]=m):m=t[14];let d;t[15]!==l||t[16]!==m?(d=s.jsxs(ee,{onClick:l,size:"sm",className:"mt-2",children:[g,m]}),t[15]=l,t[16]=m,t[17]=d):d=t[17];let f;return t[18]!==n||t[19]!==d?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,d]}),t[18]=n,t[19]=d,t[20]=f):f=t[20],f}function Je(){const e=te.c(107),t=ue(),l=Fe(),i=Te(),c=Ge(),[u,p]=ce.useState(!1),[o,a]=ce.useState(null),[n,g]=ce.useState(""),[m,d]=ce.useState(null);let f;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==n?(f=function(){!o||!n.trim()||i.mutate({connectionId:o.connectionId,volume:n.trim()},{onSuccess:R=>{a(null),ae.success(t("settings.syncedRepos.created",{volume:R.volume}))},onError:R=>{ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=o,e[2]=t,e[3]=n,e[4]=f):f=e[4];const y=f;let x;e[5]!==m||e[6]!==c||e[7]!==t?(x=function(){m&&c.mutate(m.id,{onSuccess:()=>ae.success(t("settings.syncedRepos.removed")),onError:R=>ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed")),onSettled:()=>d(null)})},e[5]=m,e[6]=c,e[7]=t,e[8]=x):x=e[8];const j=x;if(l.isPending){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(be,{className:"h-32 w-full"}),e[9]=r):r=e[9],r}let h;e[10]!==l.data?(h=l.data??[],e[10]=l.data,e[11]=h):h=e[11];const b=h;let v;e[12]!==t?(v=t("settings.syncedRepos.pageDescription"),e[12]=t,e[13]=v):v=e[13];let S;e[14]!==v?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[14]=v,e[15]=S):S=e[15];let D;e[16]!==b||e[17]!==t?(D=b.length===0?s.jsx(Ye,{onAdd:()=>p(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(ee,{onClick:()=>p(!0),size:"sm",children:[s.jsx(ge,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx("section",{className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:b.map(r=>s.jsx(Ve,{config:r,onRemove:()=>d(r)},r.id))})]}),e[16]=b,e[17]=t,e[18]=D):D=e[18];let N;e[19]!==t?(N=t("settings.syncedRepos.pickerTitle"),e[19]=t,e[20]=N):N=e[20];let se;e[21]===Symbol.for("react.memo_cache_sentinel")?(se=r=>{p(!1),a(r),g(qe(r.repo.name))},e[21]=se):se=e[21];let _;e[22]!==u||e[23]!==N?(_=s.jsx($e,{mode:"connection",open:u,onOpenChange:p,title:N,onImportComplete:se}),e[22]=u,e[23]=N,e[24]=_):_=e[24];const me=o!==null;let ie;e[25]===Symbol.for("react.memo_cache_sentinel")?(ie=r=>{r||a(null)},e[25]=ie):ie=e[25];let C;e[26]!==t?(C=t("settings.syncedRepos.nameDialogTitle"),e[26]=t,e[27]=C):C=e[27];let P;e[28]!==C?(P=s.jsx(Ae,{children:C}),e[28]=C,e[29]=P):P=e[29];const de=o?`${o.repo.owner}/${o.repo.name}`:"";let A;e[30]!==t||e[31]!==de?(A=t("settings.syncedRepos.nameDialogDescription",{repo:de}),e[30]=t,e[31]=de,e[32]=A):A=e[32];let k;e[33]!==A?(k=s.jsx(ke,{children:A}),e[33]=A,e[34]=k):k=e[34];let w;e[35]!==P||e[36]!==k?(w=s.jsxs(we,{children:[P,k]}),e[35]=P,e[36]=k,e[37]=w):w=e[37];let le;e[38]===Symbol.for("react.memo_cache_sentinel")?(le=r=>g(r.target.value),e[38]=le):le=e[38];let O;e[39]!==t?(O=t("settings.syncedRepos.namePlaceholder"),e[39]=t,e[40]=O):O=e[40];let z;e[41]!==O||e[42]!==n?(z=s.jsx(Ie,{value:n,onChange:le,placeholder:O,autoFocus:!0}),e[41]=O,e[42]=n,e[43]=z):z=e[43];let ne;e[44]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>a(null),e[44]=ne):ne=e[44];const he=i.isPending;let E;e[45]!==t?(E=t("settings.syncedRepos.cancel"),e[45]=t,e[46]=E):E=e[46];let I;e[47]!==i.isPending||e[48]!==E?(I=s.jsx(ee,{variant:"outline",onClick:ne,disabled:he,children:E}),e[47]=i.isPending,e[48]=E,e[49]=I):I=e[49];let $;e[50]!==i.isPending||e[51]!==n?($=!n.trim()||i.isPending,e[50]=i.isPending,e[51]=n,e[52]=$):$=e[52];let F;e[53]!==i.isPending||e[54]!==t?(F=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[53]=i.isPending,e[54]=t,e[55]=F):F=e[55];let T;e[56]!==y||e[57]!==$||e[58]!==F?(T=s.jsx(ee,{disabled:$,onClick:y,children:F}),e[56]=y,e[57]=$,e[58]=F,e[59]=T):T=e[59];let G;e[60]!==I||e[61]!==T?(G=s.jsxs(Oe,{children:[I,T]}),e[60]=I,e[61]=T,e[62]=G):G=e[62];let H;e[63]!==w||e[64]!==z||e[65]!==G?(H=s.jsxs(ze,{className:"sm:max-w-sm",children:[w,z,G]}),e[63]=w,e[64]=z,e[65]=G,e[66]=H):H=e[66];let B;e[67]!==H||e[68]!==me?(B=s.jsx(Ee,{open:me,onOpenChange:ie,children:H}),e[67]=H,e[68]=me,e[69]=B):B=e[69];const pe=m!==null;let oe;e[70]===Symbol.for("react.memo_cache_sentinel")?(oe=r=>{r||d(null)},e[70]=oe):oe=e[70];const fe=m?.volume??"";let q;e[71]!==t||e[72]!==fe?(q=t("settings.syncedRepos.removeTitle",{volume:fe}),e[71]=t,e[72]=fe,e[73]=q):q=e[73];let L;e[74]!==q?(L=s.jsx(Re,{children:q}),e[74]=q,e[75]=L):L=e[75];let V;e[76]!==t?(V=t("settings.syncedRepos.removeDescription"),e[76]=t,e[77]=V):V=e[77];let Y;e[78]!==V?(Y=s.jsx(ve,{children:V}),e[78]=V,e[79]=Y):Y=e[79];let J;e[80]!==L||e[81]!==Y?(J=s.jsxs(Se,{children:[L,Y]}),e[80]=L,e[81]=Y,e[82]=J):J=e[82];let K;e[83]!==t?(K=t("settings.syncedRepos.cancel"),e[83]=t,e[84]=K):K=e[84];let M;e[85]!==K?(M=s.jsx(De,{children:K}),e[85]=K,e[86]=M):M=e[86];let Q;e[87]!==t?(Q=t("settings.syncedRepos.remove"),e[87]=t,e[88]=Q):Q=e[88];let U;e[89]!==j||e[90]!==Q?(U=s.jsx(Ne,{onClick:j,children:Q}),e[89]=j,e[90]=Q,e[91]=U):U=e[91];let W;e[92]!==M||e[93]!==U?(W=s.jsxs(_e,{children:[M,U]}),e[92]=M,e[93]=U,e[94]=W):W=e[94];let X;e[95]!==J||e[96]!==W?(X=s.jsxs(Ce,{children:[J,W]}),e[95]=J,e[96]=W,e[97]=X):X=e[97];let Z;e[98]!==pe||e[99]!==X?(Z=s.jsx(Pe,{open:pe,onOpenChange:oe,children:X}),e[98]=pe,e[99]=X,e[100]=Z):Z=e[100];let re;return e[101]!==B||e[102]!==S||e[103]!==Z||e[104]!==D||e[105]!==_?(re=s.jsxs(s.Fragment,{children:[S,D,_,B,Z]}),e[101]=B,e[102]=S,e[103]=Z,e[104]=D,e[105]=_,e[106]=re):re=e[106],re}function Ke(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ye,{group:"storage",children:s.jsx(Je,{})}),e[0]=t):t=e[0],t}function Kt(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Be,{capability:"file-configs:manage",area:"files",children:s.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{Kt as default};
1
+ import{c as te,j as s,dy as ye,b as ue,r as ce,B as ee,n as je,t as ae,Y as be}from"./index-DZLUP-bk.js";import{s as ge}from"./Plus-CYNImaOJ.js";import{c as Re,d as ve,b as Se,f as De,g as Ne,e as _e,a as Ce,A as Pe}from"./alert-dialog-C1vr7a0B.js";import{d as Ae,h as ke,c as we,e as Oe,b as ze,D as Ee}from"./dialog-pwZ4KzZ6.js";import{I as Ie}from"./input-Cvmwm8KN.js";import{G as xe,a as $e}from"./github-repo-picker-BO3njSCf.js";import{u as Fe,b as Te,c as Ge}from"./use-org-repo-syncs-Brd5lrfI.js";import{t as He}from"./cards-BKe88FKP.js";import{R as Be}from"./require-capability-CCEb5Sqs.js";import"./collection-search-BLs0Fnfs.js";import"./SearchMd-bD349BM3.js";import"./use-debounced-value-0YLkJ58n.js";import"./use-connection-BBRJTBMy.js";import"./use-mcp-client-Qp-dz21o.js";import"./constants-dLUUoWH7.js";import"./auth-DXJPvHb_.js";import"./authenticate-and-persist-oauth-B322JeMG.js";import"./mcp-oauth-BfeN-QCK.js";import"./ArrowLeft-DeVXQ_Zc.js";import"./LinkExternal01-kAtb5ILy.js";import"./LockUnlocked01-C4X5qfRd.js";import"./use-mcp-tools-C7FgaBkX.js";import"./extract-connection-data-CqOTDUuA.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-B8yDMTez.js";import"./use-destination-route-CgRHxPyq.js";import"./use-virtual-mcp-BcsPJqk4.js";import"./hooks-DamZm9Dl.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-POUs7TGl.js";import"./task-board-DTv9gW69.js";import"./schema-B2Qlbge8.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BpKUwJal.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./folder-icon-DpeG2vsd.js";import"./Eye-WB67QJ1C.js";import"./DotsVertical-BVchZPc_.js";import"./Download01-C8Yiywz6.js";import"./Share07-CPaO5Jno.js";import"./Globe01-DXAw5CTM.js";import"./Key01-CHTC8hwE.js";import"./Palette-BYFK4FA5.js";import"./Trash01-Bji2bWWh.js";import"./Zap-DBnrIpUC.js";import"./dropdown-menu-C16L90Tz.js";import"./Check-DzHuFHoL.js";import"./ChevronRight-DtOnXnjv.js";import"./file-type-icon-xQ7VVCet.js";import"./access-gate-EoGcByM_.js";import"./capability-load-error-RVzxs7io.js";function qe(e){return e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"-").replace(/^[.-]+|[.-]+$/g,"").slice(0,128)}function Le(e,t){return e.lastSyncError?{label:e.lastSyncError,error:!0}:e.lastSyncedAt?{label:t("library.syncedRepos.syncedAgo",{ago:He(e.lastSyncedAt)}),error:!1}:{label:t("library.syncedRepos.waitingFirstSync"),error:!1}}function Ve(e){const t=te.c(32),{config:l,onRemove:i}=e,c=ue();let u;t[0]!==l||t[1]!==c?(u=Le(l,c),t[0]=l,t[1]=c,t[2]=u):u=t[2];const p=u;let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(xe,{size:16,className:"text-muted-foreground"})}),t[3]=o):o=t[3];let a;t[4]!==l.repoName||t[5]!==l.repoOwner?(a=s.jsxs("span",{className:"font-medium text-sm truncate",children:[l.repoOwner,"/",l.repoName]}),t[4]=l.repoName,t[5]=l.repoOwner,t[6]=a):a=t[6];let n;t[7]!==l.ref?(n=s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["@",l.ref]}),t[7]=l.ref,t[8]=n):n=t[8];let g;t[9]!==a||t[10]!==n?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[a,n]}),t[9]=a,t[10]=n,t[11]=g):g=t[11];const m=p.error?"text-destructive":"text-muted-foreground";let d;t[12]!==m?(d=je("text-xs mt-0.5 truncate",m),t[12]=m,t[13]=d):d=t[13];let f;t[14]!==l.volume||t[15]!==c?(f=c("settings.syncedRepos.rowSubtitle",{volume:l.volume}),t[14]=l.volume,t[15]=c,t[16]=f):f=t[16];let y;t[17]!==p.label||t[18]!==d||t[19]!==f?(y=s.jsxs("p",{className:d,children:[f," ·"," ",p.label]}),t[17]=p.label,t[18]=d,t[19]=f,t[20]=y):y=t[20];let x;t[21]!==g||t[22]!==y?(x=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o,s.jsxs("div",{className:"min-w-0",children:[g,y]})]}),t[21]=g,t[22]=y,t[23]=x):x=t[23];let j;t[24]!==c?(j=c("settings.syncedRepos.remove"),t[24]=c,t[25]=j):j=t[25];let h;t[26]!==i||t[27]!==j?(h=s.jsx(ee,{variant:"outline",size:"sm",onClick:i,children:j}),t[26]=i,t[27]=j,t[28]=h):h=t[28];let b;return t[29]!==x||t[30]!==h?(b=s.jsxs("div",{className:"flex items-center justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[x,h]}),t[29]=x,t[30]=h,t[31]=b):b=t[31],b}function Ye(e){const t=te.c(21),{onAdd:l}=e,i=ue();let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(xe,{size:20,className:"text-muted-foreground"})}),t[0]=c):c=t[0];let u;t[1]!==i?(u=i("settings.syncedRepos.emptyTitle"),t[1]=i,t[2]=u):u=t[2];let p;t[3]!==u?(p=s.jsx("p",{className:"font-medium text-sm",children:u}),t[3]=u,t[4]=p):p=t[4];let o;t[5]!==i?(o=i("settings.syncedRepos.emptyDescription"),t[5]=i,t[6]=o):o=t[6];let a;t[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),t[7]=o,t[8]=a):a=t[8];let n;t[9]!==p||t[10]!==a?(n=s.jsxs("div",{children:[p,a]}),t[9]=p,t[10]=a,t[11]=n):n=t[11];let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ge,{size:14}),t[12]=g):g=t[12];let m;t[13]!==i?(m=i("settings.syncedRepos.addRepo"),t[13]=i,t[14]=m):m=t[14];let d;t[15]!==l||t[16]!==m?(d=s.jsxs(ee,{onClick:l,size:"sm",className:"mt-2",children:[g,m]}),t[15]=l,t[16]=m,t[17]=d):d=t[17];let f;return t[18]!==n||t[19]!==d?(f=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,n,d]}),t[18]=n,t[19]=d,t[20]=f):f=t[20],f}function Je(){const e=te.c(107),t=ue(),l=Fe(),i=Te(),c=Ge(),[u,p]=ce.useState(!1),[o,a]=ce.useState(null),[n,g]=ce.useState(""),[m,d]=ce.useState(null);let f;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==n?(f=function(){!o||!n.trim()||i.mutate({connectionId:o.connectionId,volume:n.trim()},{onSuccess:R=>{a(null),ae.success(t("settings.syncedRepos.created",{volume:R.volume}))},onError:R=>{ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed"))}})},e[0]=i,e[1]=o,e[2]=t,e[3]=n,e[4]=f):f=e[4];const y=f;let x;e[5]!==m||e[6]!==c||e[7]!==t?(x=function(){m&&c.mutate(m.id,{onSuccess:()=>ae.success(t("settings.syncedRepos.removed")),onError:R=>ae.error(R instanceof Error?R.message:t("settings.syncedRepos.failed")),onSettled:()=>d(null)})},e[5]=m,e[6]=c,e[7]=t,e[8]=x):x=e[8];const j=x;if(l.isPending){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(be,{className:"h-32 w-full"}),e[9]=r):r=e[9],r}let h;e[10]!==l.data?(h=l.data??[],e[10]=l.data,e[11]=h):h=e[11];const b=h;let v;e[12]!==t?(v=t("settings.syncedRepos.pageDescription"),e[12]=t,e[13]=v):v=e[13];let S;e[14]!==v?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:v}),e[14]=v,e[15]=S):S=e[15];let D;e[16]!==b||e[17]!==t?(D=b.length===0?s.jsx(Ye,{onAdd:()=>p(!0)}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(ee,{onClick:()=>p(!0),size:"sm",children:[s.jsx(ge,{size:14}),t("settings.syncedRepos.addRepo")]})}),s.jsx("section",{className:"rounded-2xl border border-border/60 bg-background px-5 py-2",children:b.map(r=>s.jsx(Ve,{config:r,onRemove:()=>d(r)},r.id))})]}),e[16]=b,e[17]=t,e[18]=D):D=e[18];let N;e[19]!==t?(N=t("settings.syncedRepos.pickerTitle"),e[19]=t,e[20]=N):N=e[20];let se;e[21]===Symbol.for("react.memo_cache_sentinel")?(se=r=>{p(!1),a(r),g(qe(r.repo.name))},e[21]=se):se=e[21];let _;e[22]!==u||e[23]!==N?(_=s.jsx($e,{mode:"connection",open:u,onOpenChange:p,title:N,onImportComplete:se}),e[22]=u,e[23]=N,e[24]=_):_=e[24];const me=o!==null;let ie;e[25]===Symbol.for("react.memo_cache_sentinel")?(ie=r=>{r||a(null)},e[25]=ie):ie=e[25];let C;e[26]!==t?(C=t("settings.syncedRepos.nameDialogTitle"),e[26]=t,e[27]=C):C=e[27];let P;e[28]!==C?(P=s.jsx(Ae,{children:C}),e[28]=C,e[29]=P):P=e[29];const de=o?`${o.repo.owner}/${o.repo.name}`:"";let A;e[30]!==t||e[31]!==de?(A=t("settings.syncedRepos.nameDialogDescription",{repo:de}),e[30]=t,e[31]=de,e[32]=A):A=e[32];let k;e[33]!==A?(k=s.jsx(ke,{children:A}),e[33]=A,e[34]=k):k=e[34];let w;e[35]!==P||e[36]!==k?(w=s.jsxs(we,{children:[P,k]}),e[35]=P,e[36]=k,e[37]=w):w=e[37];let le;e[38]===Symbol.for("react.memo_cache_sentinel")?(le=r=>g(r.target.value),e[38]=le):le=e[38];let O;e[39]!==t?(O=t("settings.syncedRepos.namePlaceholder"),e[39]=t,e[40]=O):O=e[40];let z;e[41]!==O||e[42]!==n?(z=s.jsx(Ie,{value:n,onChange:le,placeholder:O,autoFocus:!0}),e[41]=O,e[42]=n,e[43]=z):z=e[43];let ne;e[44]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>a(null),e[44]=ne):ne=e[44];const he=i.isPending;let E;e[45]!==t?(E=t("settings.syncedRepos.cancel"),e[45]=t,e[46]=E):E=e[46];let I;e[47]!==i.isPending||e[48]!==E?(I=s.jsx(ee,{variant:"outline",onClick:ne,disabled:he,children:E}),e[47]=i.isPending,e[48]=E,e[49]=I):I=e[49];let $;e[50]!==i.isPending||e[51]!==n?($=!n.trim()||i.isPending,e[50]=i.isPending,e[51]=n,e[52]=$):$=e[52];let F;e[53]!==i.isPending||e[54]!==t?(F=i.isPending?t("settings.syncedRepos.creating"):t("settings.syncedRepos.create"),e[53]=i.isPending,e[54]=t,e[55]=F):F=e[55];let T;e[56]!==y||e[57]!==$||e[58]!==F?(T=s.jsx(ee,{disabled:$,onClick:y,children:F}),e[56]=y,e[57]=$,e[58]=F,e[59]=T):T=e[59];let G;e[60]!==I||e[61]!==T?(G=s.jsxs(Oe,{children:[I,T]}),e[60]=I,e[61]=T,e[62]=G):G=e[62];let H;e[63]!==w||e[64]!==z||e[65]!==G?(H=s.jsxs(ze,{className:"sm:max-w-sm",children:[w,z,G]}),e[63]=w,e[64]=z,e[65]=G,e[66]=H):H=e[66];let B;e[67]!==H||e[68]!==me?(B=s.jsx(Ee,{open:me,onOpenChange:ie,children:H}),e[67]=H,e[68]=me,e[69]=B):B=e[69];const pe=m!==null;let oe;e[70]===Symbol.for("react.memo_cache_sentinel")?(oe=r=>{r||d(null)},e[70]=oe):oe=e[70];const fe=m?.volume??"";let q;e[71]!==t||e[72]!==fe?(q=t("settings.syncedRepos.removeTitle",{volume:fe}),e[71]=t,e[72]=fe,e[73]=q):q=e[73];let L;e[74]!==q?(L=s.jsx(Re,{children:q}),e[74]=q,e[75]=L):L=e[75];let V;e[76]!==t?(V=t("settings.syncedRepos.removeDescription"),e[76]=t,e[77]=V):V=e[77];let Y;e[78]!==V?(Y=s.jsx(ve,{children:V}),e[78]=V,e[79]=Y):Y=e[79];let J;e[80]!==L||e[81]!==Y?(J=s.jsxs(Se,{children:[L,Y]}),e[80]=L,e[81]=Y,e[82]=J):J=e[82];let K;e[83]!==t?(K=t("settings.syncedRepos.cancel"),e[83]=t,e[84]=K):K=e[84];let M;e[85]!==K?(M=s.jsx(De,{children:K}),e[85]=K,e[86]=M):M=e[86];let Q;e[87]!==t?(Q=t("settings.syncedRepos.remove"),e[87]=t,e[88]=Q):Q=e[88];let U;e[89]!==j||e[90]!==Q?(U=s.jsx(Ne,{onClick:j,children:Q}),e[89]=j,e[90]=Q,e[91]=U):U=e[91];let W;e[92]!==M||e[93]!==U?(W=s.jsxs(_e,{children:[M,U]}),e[92]=M,e[93]=U,e[94]=W):W=e[94];let X;e[95]!==J||e[96]!==W?(X=s.jsxs(Ce,{children:[J,W]}),e[95]=J,e[96]=W,e[97]=X):X=e[97];let Z;e[98]!==pe||e[99]!==X?(Z=s.jsx(Pe,{open:pe,onOpenChange:oe,children:X}),e[98]=pe,e[99]=X,e[100]=Z):Z=e[100];let re;return e[101]!==B||e[102]!==S||e[103]!==Z||e[104]!==D||e[105]!==_?(re=s.jsxs(s.Fragment,{children:[S,D,_,B,Z]}),e[101]=B,e[102]=S,e[103]=Z,e[104]=D,e[105]=_,e[106]=re):re=e[106],re}function Ke(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ye,{group:"storage",children:s.jsx(Je,{})}),e[0]=t):t=e[0],t}function Kt(){const e=te.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Be,{capability:"file-configs:manage",area:"files",children:s.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{Kt as default};
@@ -1 +1 @@
1
- import{c,n as i,j as r}from"./index-ygoeB01B.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-card rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function x(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{x as T,p as a,b,d as c,m as d,f as e};
1
+ import{c,n as i,j as r}from"./index-DZLUP-bk.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-card rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function x(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{x as T,p as a,b,d as c,m as d,f as e};
@@ -1 +1 @@
1
- import{r as v,j as d,dz as k,bs as p,by as T,dA as y,bu as M,bx as P,bv as S,bz as F,dB as V,cK as D,c as x,n as g}from"./index-ygoeB01B.js";var m="Tabs",[G]=M(m,[y]),w=y(),[z,h]=G(m),C=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:i,activationMode:l="automatic",...f}=n,u=P(i),[c,b]=S({prop:t,onChange:r,defaultProp:s??"",caller:m});return d.jsx(z,{scope:a,baseId:F(),value:c,onValueChange:b,orientation:o,dir:u,activationMode:l,children:d.jsx(p.div,{dir:u,"data-orientation":o,...f,ref:e})})});C.displayName=m;var N="TabsList",j=v.forwardRef((n,e)=>{const{__scopeTabs:a,loop:t=!0,...r}=n,s=h(N,a),o=w(a);return d.jsx(V,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:t,children:d.jsx(p.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});j.displayName=N;var I="TabsTrigger",_=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,disabled:r=!1,...s}=n,o=h(I,a),i=w(a),l=E(o.baseId,t),f=$(o.baseId,t),u=t===o.value;return d.jsx(k,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":f,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:T(n.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?o.onValueChange(t):c.preventDefault()}),onKeyDown:T(n.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&o.onValueChange(t)}),onFocus:T(n.onFocus,()=>{const c=o.activationMode!=="manual";!u&&!r&&c&&o.onValueChange(t)})})})});_.displayName=I;var R="TabsContent",A=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,forceMount:r,children:s,...o}=n,i=h(R,a),l=E(i.baseId,t),f=$(i.baseId,t),u=t===i.value,c=v.useRef(u);return v.useEffect(()=>{const b=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(D,{present:r||u,children:({present:b})=>d.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:f,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:c.current?"0s":void 0},children:b&&s})})});A.displayName=R;function E(n,e){return`${n}-trigger-${e}`}function $(n,e){return`${n}-content-${e}`}var L=C,K=j,B=_,q=A;function O(n){const e=x.c(10);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r===void 0?"pill":r;let o;e[4]!==a?(o=g("flex flex-col gap-2",a),e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==o||e[8]!==s?(i=d.jsx(L,{"data-slot":"tabs","data-variant":s,className:o,...t}),e[6]=t,e[7]=o,e[8]=s,e[9]=i):i=e[9],i}function J(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(K,{"data-slot":"tabs-list","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function Q(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":s==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(B,{"data-slot":"tabs-trigger","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function U(n){const e=x.c(8);let a,t;e[0]!==n?({className:a,...t}=n,e[0]=n,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let r;e[3]!==a?(r=g("flex-1 outline-none h-full",a),e[3]=a,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=d.jsx(q,{"data-slot":"tabs-content",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{U as T,O as a,Q as b,J as c};
1
+ import{r as v,j as d,dz as k,bs as p,by as T,dA as y,bu as M,bx as P,bv as S,bz as F,dB as V,cK as D,c as x,n as g}from"./index-DZLUP-bk.js";var m="Tabs",[G]=M(m,[y]),w=y(),[z,h]=G(m),C=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:i,activationMode:l="automatic",...f}=n,u=P(i),[c,b]=S({prop:t,onChange:r,defaultProp:s??"",caller:m});return d.jsx(z,{scope:a,baseId:F(),value:c,onValueChange:b,orientation:o,dir:u,activationMode:l,children:d.jsx(p.div,{dir:u,"data-orientation":o,...f,ref:e})})});C.displayName=m;var N="TabsList",j=v.forwardRef((n,e)=>{const{__scopeTabs:a,loop:t=!0,...r}=n,s=h(N,a),o=w(a);return d.jsx(V,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:t,children:d.jsx(p.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});j.displayName=N;var I="TabsTrigger",_=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,disabled:r=!1,...s}=n,o=h(I,a),i=w(a),l=E(o.baseId,t),f=$(o.baseId,t),u=t===o.value;return d.jsx(k,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":f,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:T(n.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?o.onValueChange(t):c.preventDefault()}),onKeyDown:T(n.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&o.onValueChange(t)}),onFocus:T(n.onFocus,()=>{const c=o.activationMode!=="manual";!u&&!r&&c&&o.onValueChange(t)})})})});_.displayName=I;var R="TabsContent",A=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,forceMount:r,children:s,...o}=n,i=h(R,a),l=E(i.baseId,t),f=$(i.baseId,t),u=t===i.value,c=v.useRef(u);return v.useEffect(()=>{const b=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(D,{present:r||u,children:({present:b})=>d.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:f,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:c.current?"0s":void 0},children:b&&s})})});A.displayName=R;function E(n,e){return`${n}-trigger-${e}`}function $(n,e){return`${n}-content-${e}`}var L=C,K=j,B=_,q=A;function O(n){const e=x.c(10);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r===void 0?"pill":r;let o;e[4]!==a?(o=g("flex flex-col gap-2",a),e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==o||e[8]!==s?(i=d.jsx(L,{"data-slot":"tabs","data-variant":s,className:o,...t}),e[6]=t,e[7]=o,e[8]=s,e[9]=i):i=e[9],i}function J(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(K,{"data-slot":"tabs-list","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function Q(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":s==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(B,{"data-slot":"tabs-trigger","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function U(n){const e=x.c(8);let a,t;e[0]!==n?({className:a,...t}=n,e[0]=n,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let r;e[3]!==a?(r=g("flex-1 outline-none h-full",a),e[3]=a,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=d.jsx(q,{"data-slot":"tabs-content",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{U as T,O as a,Q as b,J as c};
@@ -1 +1 @@
1
- import{o as s}from"./schema-D1PTLZoj.js";const v="super-agent",i=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],c=i[0];function T(e){return i[e%i.length]??c}function w(e){return e.createdBy==="system"}const l="chore",A=["reviewer"],_={reviewer:"Reviewer"},d=["QA Agent","Code Reviewer"];function p(e){return e?.reviewer_enabled===void 0&&e?.qa_agent_enabled===!1&&e?.code_reviewer_enabled===!1?!1:s(e,"reviewer_enabled")}const R=["approved","merged","post_deploy_validation"];function D(e,t){return e?[_[t],...d].some(r=>e.startsWith(`${r}:`)):!1}function E(e,t){if(t)return new Date(t).getTime();let r=0;for(const n of e)n.action==="status_changed"&&n.data?.to==="in_review"&&(r=Math.max(r,new Date(n.occurredAt).getTime()));return r}function f(e,t){const r=E(e,t.cycleStartedAt),n=new Map;for(const a of e){if(a.action!=="review_approved"&&a.action!=="review_changes_requested"||new Date(a.occurredAt).getTime()<r)continue;const o=a.data??{};if(o.reviewer==="reviewer")if(a.action==="review_approved"){if(t?.verifiedOnly&&o.verified!==!0)continue;n.set("reviewer","approved")}else n.set("reviewer","changes_requested")}return n}function S(e,t,r){if(t.length===0)return!1;const n=f(e,r);return t.every(a=>n.get(a)==="approved")}const g="task-board.item.updated",L="task-board.item.deleted",m=4e3;export{l as D,A as R,v as S,g as T,S as a,D as b,L as c,c as d,R as e,m as f,w as i,T as n,p as r};
1
+ import{o as s}from"./schema-B2Qlbge8.js";const v="super-agent",i=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],c=i[0];function T(e){return i[e%i.length]??c}function w(e){return e.createdBy==="system"}const l="chore",A=["reviewer"],_={reviewer:"Reviewer"},d=["QA Agent","Code Reviewer"];function p(e){return e?.reviewer_enabled===void 0&&e?.qa_agent_enabled===!1&&e?.code_reviewer_enabled===!1?!1:s(e,"reviewer_enabled")}const R=["approved","merged","post_deploy_validation"];function D(e,t){return e?[_[t],...d].some(r=>e.startsWith(`${r}:`)):!1}function E(e,t){if(t)return new Date(t).getTime();let r=0;for(const n of e)n.action==="status_changed"&&n.data?.to==="in_review"&&(r=Math.max(r,new Date(n.occurredAt).getTime()));return r}function f(e,t){const r=E(e,t.cycleStartedAt),n=new Map;for(const a of e){if(a.action!=="review_approved"&&a.action!=="review_changes_requested"||new Date(a.occurredAt).getTime()<r)continue;const o=a.data??{};if(o.reviewer==="reviewer")if(a.action==="review_approved"){if(t?.verifiedOnly&&o.verified!==!0)continue;n.set("reviewer","approved")}else n.set("reviewer","changes_requested")}return n}function S(e,t,r){if(t.length===0)return!1;const n=f(e,r);return t.every(a=>n.get(a)==="approved")}const g="task-board.item.updated",L="task-board.item.deleted",m=4e3;export{l as D,A as R,v as S,g as T,S as a,D as b,L as c,c as d,R as e,m as f,w as i,T as n,p as r};