decocms 4.308.0 → 4.309.1

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 (277) hide show
  1. package/dist/client/assets/{AlertCircle-BTlJp8pf.js → AlertCircle-6kr4ikYf.js} +1 -1
  2. package/dist/client/assets/{AreaChart-dJjxY072.js → AreaChart-DDKg3X50.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BwagOJkb.js → ArrowLeft-BYTdr7TC.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CVoISkQ4.js → ArrowUp-CKtNsAj6.js} +1 -1
  5. package/dist/client/assets/{Check-D5PKBQ5I.js → Check-BDN8Muvk.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-teyxVGFp.js → CheckCircle-DOsHeqoz.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Csfjhwpm.js → ChevronDown-BKzrpWz6.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DUmHQrD7.js → ChevronRight-CZUjBWvx.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CuAhXy3x.js → ChevronSelectorVertical-B9yl_jmL.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-Dlj_U0qV.js → ChevronUp-Cx4YaKpI.js} +1 -1
  11. package/dist/client/assets/{Copy01-CsNpp9jr.js → Copy01-B4QULclv.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-YCHpZ00A.js → CreditCard01-wmoTErQt.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-CpVcGDJ_.js → DotsVertical-BS1CnjKI.js} +1 -1
  14. package/dist/client/assets/{Download01-BN9BT9cL.js → Download01-Bp0cW6L4.js} +1 -1
  15. package/dist/client/assets/{Eye-DgiSa7UT.js → Eye-B_dguG6W.js} +1 -1
  16. package/dist/client/assets/{FilterLines-Db8-uWfr.js → FilterLines-ukqPgKKN.js} +1 -1
  17. package/dist/client/assets/GitBranch01-CseJth04.js +1 -0
  18. package/dist/client/assets/{Globe01-CV-16mwB.js → Globe01-xHaFaFqY.js} +1 -1
  19. package/dist/client/assets/{Globe04-D3O2XfOT.js → Globe04-SMW2xMPb.js} +1 -1
  20. package/dist/client/assets/{HardDrive-CWvDYc59.js → HardDrive-CGH6uKsY.js} +1 -1
  21. package/dist/client/assets/Image01-DI4UfHrT.js +1 -0
  22. package/dist/client/assets/{Key01-D4srNqPO.js → Key01-C2TuLSvm.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-CIL2SNWf.js → LinkExternal01-CWY5Wglm.js} +1 -1
  24. package/dist/client/assets/{LockUnlocked01-BpeKJGM4.js → LockUnlocked01-lprGTBDa.js} +1 -1
  25. package/dist/client/assets/{LogOut01-qWWgaWbQ.js → LogOut01-Dlhf6xnU.js} +1 -1
  26. package/dist/client/assets/{Monitor01-uq-dlf-u.js → Monitor01-RWlkxwpq.js} +1 -1
  27. package/dist/client/assets/Package-CbKjNbRP.js +1 -0
  28. package/dist/client/assets/{Palette-Cv68Zggp.js → Palette-DHncO8u1.js} +1 -1
  29. package/dist/client/assets/{Play-C9xK8clC.js → Play-C2DKi7Gj.js} +1 -1
  30. package/dist/client/assets/{Plus-CPkR-QLd.js → Plus-CThYB9e6.js} +1 -1
  31. package/dist/client/assets/{SearchLg-8daQliv2.js → SearchLg-BCpOjc95.js} +1 -1
  32. package/dist/client/assets/{SearchMd-ClTH3fiN.js → SearchMd-C0j7yoGj.js} +1 -1
  33. package/dist/client/assets/{Settings02-BMcJFHpd.js → Settings02-zD1WG3KJ.js} +1 -1
  34. package/dist/client/assets/{Share07-CPDrxQV8.js → Share07-DjrlWb0X.js} +1 -1
  35. package/dist/client/assets/{Shield01-C9M_jcOJ.js → Shield01-D6Z8uTMm.js} +1 -1
  36. package/dist/client/assets/{Stars01-BzEDQnsl.js → Stars01-DD4L9WZm.js} +1 -1
  37. package/dist/client/assets/{Stars02-DZNA1z2-.js → Stars02-DtPQwd-A.js} +1 -1
  38. package/dist/client/assets/{Sun-BBWjOwQE.js → Sun-DhJaKNHe.js} +1 -1
  39. package/dist/client/assets/{SwitchHorizontal01-CSyGO1HX.js → SwitchHorizontal01-_tALQVAI.js} +1 -1
  40. package/dist/client/assets/Tool01-DdJ9Op9D.js +1 -0
  41. package/dist/client/assets/{Tool02-jKKU1_dM.js → Tool02-Cci1ljWo.js} +1 -1
  42. package/dist/client/assets/{Trash01-Dp-QTpAR.js → Trash01-BDD06UjB.js} +1 -1
  43. package/dist/client/assets/{TrendUp01-DikSDrNg.js → TrendUp01-DjAqcXI6.js} +1 -1
  44. package/dist/client/assets/{Upload01-DxCHPffq.js → Upload01-Cp4C9dq6.js} +1 -1
  45. package/dist/client/assets/{User01-DJ_BO2EX.js → User01-Cteu9d2D.js} +1 -1
  46. package/dist/client/assets/UserSquare-DTquYbih.js +1 -0
  47. package/dist/client/assets/{Users01-B2wc_Wgl.js → Users01-BsM313st.js} +1 -1
  48. package/dist/client/assets/{Users03-BUoBV4mB.js → Users03--HC72Dnu.js} +1 -1
  49. package/dist/client/assets/{XCircle-CVbKXkpd.js → XCircle-Bt06fa-N.js} +1 -1
  50. package/dist/client/assets/{XClose-CTv0nnSb.js → XClose-DM3y4DhR.js} +1 -1
  51. package/dist/client/assets/{YAxis-DxhC7uB4.js → YAxis-DNvsuYs9.js} +1 -1
  52. package/dist/client/assets/{Zap-MbQ2aiA8.js → Zap-BIV9pRJO.js} +1 -1
  53. package/dist/client/assets/{ZapSquare-BZzRAQpm.js → ZapSquare-QIZwOk1q.js} +1 -1
  54. package/dist/client/assets/ZoomOut-CRoOiJyQ.js +1 -0
  55. package/dist/client/assets/{access-gate-BZ6Xc62y.js → access-gate-bBcsLTqZ.js} +1 -1
  56. package/dist/client/assets/agent-icon-BP-KwHaL.js +1 -0
  57. package/dist/client/assets/agents-list-CdYhPZzF.js +1 -0
  58. package/dist/client/assets/{ai-providers-PPaiM-vM.js → ai-providers-kyRwHzOP.js} +2 -2
  59. package/dist/client/assets/{alert-CIFaGTb_.js → alert-DbJERvKT.js} +1 -1
  60. package/dist/client/assets/{alert-dialog-Dh9zsaCy.js → alert-dialog-DBIqwB_a.js} +1 -1
  61. package/dist/client/assets/{api-keys-B5Q1NcTU.js → api-keys-sddYcqX2.js} +1 -1
  62. package/dist/client/assets/app-editor-BjcnCeTV.js +1 -0
  63. package/dist/client/assets/{auth-D8IdOmGw.js → auth-BOUgLxto.js} +1 -1
  64. package/dist/client/assets/{auth-catchall-PSQzhhPS.js → auth-catchall-sgn0jKBF.js} +1 -1
  65. package/dist/client/assets/{auth-entry-DZQ7ulSa.js → auth-entry-RdTo0a7D.js} +1 -1
  66. package/dist/client/assets/{auth-split-layout-D4SJJOXB.js → auth-split-layout-7ElArbEj.js} +1 -1
  67. package/dist/client/assets/{authenticate-and-persist-oauth-DY_hbkIG.js → authenticate-and-persist-oauth-CSyB4Ikq.js} +1 -1
  68. package/dist/client/assets/{automation-list-row-CLAw5ACh.js → automation-list-row-cIw0RidY.js} +1 -1
  69. package/dist/client/assets/automation-runs-CPjPp0l_.js +187 -0
  70. package/dist/client/assets/automations-1SGWSi41.js +1 -0
  71. package/dist/client/assets/{avatar-D-QkiqIH.js → avatar-D7Ryfmkc.js} +1 -1
  72. package/dist/client/assets/{badge-DX3_GQsO.js → badge-CsGum4AP.js} +1 -1
  73. package/dist/client/assets/{block-document-D0mVcltx.js → block-document-ByjA0CRJ.js} +2 -2
  74. package/dist/client/assets/{breadcrumb-Clut3vXk.js → breadcrumb-CiqxRnKX.js} +1 -1
  75. package/dist/client/assets/{buckets-CNyoBCui.js → buckets-BYW61MYG.js} +1 -1
  76. package/dist/client/assets/bulk-category-panel-zfJmlmNV.js +1 -0
  77. package/dist/client/assets/{capability-load-error-BtIV807c.js → capability-load-error-D11cq4uG.js} +1 -1
  78. package/dist/client/assets/cards-BRKQMkit.js +8 -0
  79. package/dist/client/assets/category-editor-B5ipi4cT.js +1 -0
  80. package/dist/client/assets/{chart-BS94Bf-2.js → chart-mM3m3BmD.js} +3 -3
  81. package/dist/client/assets/chat-context-CsfU9qgh.js +35 -0
  82. package/dist/client/assets/{checkbox-Gg7TSWGl.js → checkbox-BBeIXKls.js} +1 -1
  83. package/dist/client/assets/choose-editor--PLjxsb1.js +1 -0
  84. package/dist/client/assets/{cli-auth-success-DMKVkxdU.js → cli-auth-success-jaDX-5Q6.js} +1 -1
  85. package/dist/client/assets/collection-detail-D-bE8fG2.js +1 -0
  86. package/dist/client/assets/{collection-display-button-jLXxSVGC.js → collection-display-button-DESH5EcG.js} +1 -1
  87. package/dist/client/assets/{collection-search-0N-i_PHL.js → collection-search-C8enHCKD.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-CMhDJ32A.js → collection-table-wrapper-pBDEa-p-.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-PM6yowhG.js → collection-tabs-B3J2pC6N.js} +1 -1
  90. package/dist/client/assets/{command-JNsPUZwg.js → command-B7KZEeN_.js} +1 -1
  91. package/dist/client/assets/commerce-onboarding-CLKupNAF.js +1 -0
  92. package/dist/client/assets/{config-DFqhM__G.js → config-p1-EuejC.js} +1 -1
  93. package/dist/client/assets/{connect-CpvsClHG.js → connect-B8Ihml23.js} +1 -1
  94. package/dist/client/assets/{connection-CUtGFjSN.js → connection-B-9-J5nZ.js} +1 -1
  95. package/dist/client/assets/{connection-card-B1T5pd1c.js → connection-card-B8ZnCkrb.js} +1 -1
  96. package/dist/client/assets/connection-detail-d9M-DaxH.js +1 -0
  97. package/dist/client/assets/{connection-form-helpers-CYKg-GvJ.js → connection-form-helpers-LNr8FSPc.js} +1 -1
  98. package/dist/client/assets/connections-BUwlIKp2.js +1 -0
  99. package/dist/client/assets/{decopilot-sse-pool-BN-M5EUb.js → decopilot-sse-pool-DK-jWfRH.js} +1 -1
  100. package/dist/client/assets/{dialog-BI8UUwqv.js → dialog-Buvp0_k_.js} +1 -1
  101. package/dist/client/assets/{domain-settings-D4HjDgqu.js → domain-settings-BOmIEOBd.js} +1 -1
  102. package/dist/client/assets/{drawer-BR22I8_f.js → drawer-C-JEODnZ.js} +1 -1
  103. package/dist/client/assets/{dropdown-menu-wKA_-hY5.js → dropdown-menu-BVX76X1t.js} +1 -1
  104. package/dist/client/assets/editor-B9guvPGh.js +11 -0
  105. package/dist/client/assets/{empty-state-DAYLBxJ6.js → empty-state-BwGFcgil.js} +1 -1
  106. package/dist/client/assets/{extract-connection-data-6cVSTGuY.js → extract-connection-data-CFLT8Lmm.js} +1 -1
  107. package/dist/client/assets/file-explorer-CUB_T3Nt.js +2 -0
  108. package/dist/client/assets/{file-type-icon-QfVGs4d0.js → file-type-icon-CitxkbxC.js} +1 -1
  109. package/dist/client/assets/folder-icon-Bt1LxK-5.js +2 -0
  110. package/dist/client/assets/{form-DauSI86Q.js → form-BCSheD7J.js} +1 -1
  111. package/dist/client/assets/general-BLl23-1V.js +1 -0
  112. package/dist/client/assets/{github-repo-picker-sKX6qrmQ.js → github-repo-picker-CHA0-bBL.js} +1 -1
  113. package/dist/client/assets/{hooks-DQmp7LHz.js → hooks-DYDXfqwA.js} +6 -6
  114. package/dist/client/assets/{index-BYBf2qjQ.js → index-0Rjd7KPf.js} +1 -1
  115. package/dist/client/assets/{index-DKFNY2Yv.js → index-B1BNe5XL.js} +1 -1
  116. package/dist/client/assets/index-BFgc8ZC7.css +1 -0
  117. package/dist/client/assets/{index-B9iOsEIc.js → index-BuFIAUTC.js} +1 -1
  118. package/dist/client/assets/{index-Ci8azyOE.js → index-CLjikYNQ.js} +47 -47
  119. package/dist/client/assets/index-CWji8tuH.js +1 -0
  120. package/dist/client/assets/{index-BdFaTbMe.js → index-ClSDUMs2.js} +67 -70
  121. package/dist/client/assets/{index-De-kCEdQ.js → index-D14IhaK9.js} +1 -1
  122. package/dist/client/assets/{index-BMBPxk-z.js → index-DKEb9xSD.js} +2 -2
  123. package/dist/client/assets/{index-q2Rm7O_h.js → index-lT44vadh.js} +1 -1
  124. package/dist/client/assets/{index-redirect-DVfxG1gJ.js → index-redirect-eJAVqoLf.js} +1 -1
  125. package/dist/client/assets/{infra-billing-BEtRM-w8.js → infra-billing-DApRGD-J.js} +1 -1
  126. package/dist/client/assets/{input-Bwz-dTwg.js → input-CXueSbIK.js} +1 -1
  127. package/dist/client/assets/{integration-icon-CGnrGZxM.js → integration-icon-DkfgnaHN.js} +1 -1
  128. package/dist/client/assets/{invite-member-dialog-D8XHQ0du.js → invite-member-dialog-CuuzMf-g.js} +1 -1
  129. package/dist/client/assets/{label-C1OhLpvf.js → label-C9eYac1w.js} +1 -1
  130. package/dist/client/assets/{layout-DdQ7AbmJ.js → layout-cji8Pllb.js} +1 -1
  131. package/dist/client/assets/location-oTTXFrSF.js +1 -0
  132. package/dist/client/assets/{login-CaBX2Zyr.js → login-RNqT3oif.js} +1 -1
  133. package/dist/client/assets/markdown-DG_ePPJc.js +94 -0
  134. package/dist/client/assets/{mcp-oauth-GWhqBwu1.js → mcp-oauth-CUGdQwnE.js} +1 -1
  135. package/dist/client/assets/{members-CoSugncV.js → members-Ba_EjXOC.js} +1 -1
  136. package/dist/client/assets/monaco-editor-XKAgBzqM.js +9 -0
  137. package/dist/client/assets/{monitoring-stats-row-BKiTJqu0.js → monitoring-stats-row-pykjqEQ2.js} +1 -1
  138. package/dist/client/assets/{multi-select-CIx6xi2O.js → multi-select-C9OJwO9c.js} +1 -1
  139. package/dist/client/assets/{oauth-callback-D_4qsGLU.js → oauth-callback-DhH8Sg8S.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-N2nxuW4H.js → oauth-callback-ai-provider-DxppKg9k.js} +1 -1
  141. package/dist/client/assets/{onboarding-c1-zuWRK.js → onboarding-C9-BVl7g.js} +1 -1
  142. package/dist/client/assets/{org-layout-D7r6nyax.js → org-layout-B4RTdykw.js} +1 -1
  143. package/dist/client/assets/{organization-choice-DZuaojdz.js → organization-choice-CRwp5frt.js} +1 -1
  144. package/dist/client/assets/{orgs-_zNVp-L6.js → orgs-JCxGyVBQ.js} +1 -1
  145. package/dist/client/assets/page-seo-form-DOQWcpe7.js +1 -0
  146. package/dist/client/assets/{popover-ClwD_xra.js → popover-D4C_xunP.js} +1 -1
  147. package/dist/client/assets/post-calendar-DDf4Ceb2.js +1 -0
  148. package/dist/client/assets/post-editor-MCeUKvjM.js +1 -0
  149. package/dist/client/assets/{primitives-BKjHT0m_.js → primitives-CYxDzduK.js} +1 -1
  150. package/dist/client/assets/{profile-fPJ06K0g.js → profile-ESYoh_Pt.js} +1 -1
  151. package/dist/client/assets/project-app-view-UB06HfoK.js +1 -0
  152. package/dist/client/assets/{prompts-BiA_3uUl.js → prompts-DEmFxhe4.js} +1 -1
  153. package/dist/client/assets/record-editor-mQCoWyZ1.js +1 -0
  154. package/dist/client/assets/redirect-editor-B9JlbMNp.js +1 -0
  155. package/dist/client/assets/registry-UjixfO8V.js +2 -0
  156. package/dist/client/assets/{registry-layout-C3aeIwiX.js → registry-layout-4Bi7LgQ7.js} +1 -1
  157. package/dist/client/assets/{reports-ZfNOoqaN.js → reports-DQJz2Cmv.js} +2 -2
  158. package/dist/client/assets/{require-capability-cxyKBT59.js → require-capability-Dm1c7mRJ.js} +1 -1
  159. package/dist/client/assets/{required-auth-layout-CUQaC9Hr.js → required-auth-layout-DCDe2_xo.js} +1 -1
  160. package/dist/client/assets/{reset-password-ipLYYDOf.js → reset-password-B2nhNnea.js} +1 -1
  161. package/dist/client/assets/review-settings-tNoU0ubl.js +1 -0
  162. package/dist/client/assets/roles-C-0laFT-.js +1 -0
  163. package/dist/client/assets/{scroll-area-RteS0-Yk.js → scroll-area-iNmkNxQd.js} +1 -1
  164. package/dist/client/assets/{search-input-CevwWux3.js → search-input-C_hPwWlY.js} +1 -1
  165. package/dist/client/assets/{secrets-ojCsqN5b.js → secrets-DMBg4CtB.js} +1 -1
  166. package/dist/client/assets/sections-editor-DmGy1kfY.js +2 -0
  167. package/dist/client/assets/{select-C7Q2VGxk.js → select-CXWGcLoH.js} +1 -1
  168. package/dist/client/assets/{select-model-C03zAz7l.js → select-model-LFUkuM-R.js} +2 -2
  169. package/dist/client/assets/{self-tool-result-BSLlHbcp.js → self-tool-result-BQSdlPPl.js} +1 -1
  170. package/dist/client/assets/seo-editor-zsyKoChQ.js +1 -0
  171. package/dist/client/assets/settings-layout-0Mx4abSG.js +1 -0
  172. package/dist/client/assets/{shell-controls-BMTxwot2.js → shell-controls-CAqHiAbw.js} +1 -1
  173. package/dist/client/assets/shell-layout-CCJOKrlB.js +1 -0
  174. package/dist/client/assets/skill-preview-Bpjo0e0e.js +4 -0
  175. package/dist/client/assets/skills-D66l5Pe4.js +1 -0
  176. package/dist/client/assets/{spinner-B9x-ViPH.js → spinner-Kj9-kHS5.js} +1 -1
  177. package/dist/client/assets/{sso-9kD1uEp6.js → sso-BbnjdAVr.js} +1 -1
  178. package/dist/client/assets/{store-DVSsps0V.js → store-CDW3xgvS.js} +1 -1
  179. package/dist/client/assets/store-registry-Bw5brwRA.js +2 -0
  180. package/dist/client/assets/super-agent-icon-Cv5HTwbP.js +1 -0
  181. package/dist/client/assets/{switch-BuJnEOUw.js → switch-DKegBAiv.js} +1 -1
  182. package/dist/client/assets/synced-repos-BOkpnLeH.js +1 -0
  183. package/dist/client/assets/{table-oIbRw7Yk.js → table-Dvpenn5X.js} +1 -1
  184. package/dist/client/assets/{tabs-CFhQLpsD.js → tabs-0Nbaxawf.js} +1 -1
  185. package/dist/client/assets/{task-board-Cz-fiaKF.js → task-board-D-kil0OD.js} +1 -1
  186. package/dist/client/assets/tasks-D-Fe8Ppq.js +1 -0
  187. package/dist/client/assets/{textarea-CMpN0SgX.js → textarea-BJ4TussH.js} +1 -1
  188. package/dist/client/assets/thread-route-Cmmo50Fe.js +1 -0
  189. package/dist/client/assets/{toggle-group-ClOqwWDq.js → toggle-group-C0VATZeX.js} +1 -1
  190. package/dist/client/assets/{toolbar-KH-9Bre4.js → toolbar-Bmv5cu6y.js} +1 -1
  191. package/dist/client/assets/{track-DXtvDI_s.js → track-BsrCovp4.js} +1 -1
  192. package/dist/client/assets/{types-BGVeElFe.js → types-Bkfd8ghD.js} +1 -1
  193. package/dist/client/assets/{use-ai-providers-DlWIkMD-.js → use-ai-providers-CG6Y0TAQ.js} +1 -1
  194. package/dist/client/assets/{use-api-keys-D0NAsvsx.js → use-api-keys-oFV-6tmf.js} +1 -1
  195. package/dist/client/assets/{use-automations-CWqvHqj2.js → use-automations-BXcJPDIk.js} +1 -1
  196. package/dist/client/assets/{use-autosave-D1zPEM1D.js → use-autosave-DvxG9h7A.js} +1 -1
  197. package/dist/client/assets/{use-connection-gqhqm1hO.js → use-connection--DbsGpk_.js} +1 -1
  198. package/dist/client/assets/{use-copy-BY1mlr6R.js → use-copy-t26hWaR6.js} +1 -1
  199. package/dist/client/assets/{use-create-virtual-mcp-Dzmlrw8C.js → use-create-virtual-mcp-DfyGVwvi.js} +1 -1
  200. package/dist/client/assets/{use-debounced-autosave-j0VBccs2.js → use-debounced-autosave-DCqMSIfY.js} +1 -1
  201. package/dist/client/assets/{use-debounced-value-BENALn-i.js → use-debounced-value-0mjAJnh9.js} +1 -1
  202. package/dist/client/assets/{use-decopilot-events-CqU7DunK.js → use-decopilot-events-DXEJ77Cw.js} +1 -1
  203. package/dist/client/assets/{use-delete-connection-BwHeDNps.js → use-delete-connection-P1--1uTD.js} +1 -1
  204. package/dist/client/assets/{use-deployment-admin-CQiRFTsL.js → use-deployment-admin-PyTOxvE6.js} +1 -1
  205. package/dist/client/assets/{use-destination-route-d8wgPDBu.js → use-destination-route-LJ6L5J-Z.js} +1 -1
  206. package/dist/client/assets/{use-file-configs-BAUKJMmN.js → use-file-configs-CZ6Q9RHz.js} +1 -1
  207. package/dist/client/assets/{use-infinite-scroll-Cw7R-QWe.js → use-infinite-scroll-D-RuGEMN.js} +1 -1
  208. package/dist/client/assets/{use-join-requests-CBEK68HB.js → use-join-requests-u4NwwBfY.js} +1 -1
  209. package/dist/client/assets/{use-mcp-auth-status-7KFU7IPU.js → use-mcp-auth-status-CpemSejR.js} +1 -1
  210. package/dist/client/assets/{use-mcp-client-DP2onozC.js → use-mcp-client-CBP30lcT.js} +2 -2
  211. package/dist/client/assets/{use-mcp-tools-B7yHzu9T.js → use-mcp-tools-CZZL007X.js} +1 -1
  212. package/dist/client/assets/{use-members-IwrDPxqz.js → use-members-DLt1FY-q.js} +1 -1
  213. package/dist/client/assets/{use-navigate-to-agent-mrg2_DxJ.js → use-navigate-to-agent-DAh2yiE0.js} +1 -1
  214. package/dist/client/assets/{use-org-auth-client-HXTuHVWD.js → use-org-auth-client-Eaq6KsK_.js} +1 -1
  215. package/dist/client/assets/{use-org-repo-syncs-rlkQHsUF.js → use-org-repo-syncs-s-v1_DV-.js} +1 -1
  216. package/dist/client/assets/{use-org-sso-C-uWWD5m.js → use-org-sso-5zd-6Usk.js} +1 -1
  217. package/dist/client/assets/{use-organization-roles-CQ2UVvkm.js → use-organization-roles-D7AZGrVn.js} +1 -1
  218. package/dist/client/assets/{use-organization-settings-BAFLKQ3y.js → use-organization-settings-C3jHLzD-.js} +1 -1
  219. package/dist/client/assets/use-panel-navigate-DHlMMTZi.js +1 -0
  220. package/dist/client/assets/{use-registry-connections-DghvIzKh.js → use-registry-connections-DHIJ1ozU.js} +1 -1
  221. package/dist/client/assets/{use-secrets-CvibJ_Hx.js → use-secrets-DTjUUpxa.js} +1 -1
  222. package/dist/client/assets/{use-section-preview-base-DTnA68XU.js → use-section-preview-base-3f3eeApB.js} +1 -1
  223. package/dist/client/assets/{use-status-sounds-kx6TUHpf.js → use-status-sounds-C940bfEw.js} +1 -1
  224. package/dist/client/assets/{use-tags-CGJ43yMs.js → use-tags-XQU8F1xp.js} +1 -1
  225. package/dist/client/assets/{use-view-mode-Bn3--gRi.js → use-view-mode-B-FpXA1j.js} +1 -1
  226. package/dist/client/assets/{use-virtual-mcp-Dj0wXB98.js → use-virtual-mcp-Jrf_I5O6.js} +1 -1
  227. package/dist/client/assets/useInfiniteQuery-C3i2ddec.js +1 -0
  228. package/dist/client/assets/useSuspenseInfiniteQuery-CsRImOmD.js +1 -0
  229. package/dist/client/assets/{users-B_7Qs-RF.js → users-BI5lRiyl.js} +1 -1
  230. package/dist/client/assets/variant-calendar-90WnwndK.js +1 -0
  231. package/dist/client/assets/{view-mode-toggle-CcmqoSVC.js → view-mode-toggle-DdfOH72I.js} +1 -1
  232. package/dist/client/index.html +2 -2
  233. package/dist/server/cli.js +1 -1
  234. package/dist/server/server.js +1 -1
  235. package/package.json +1 -1
  236. package/dist/client/assets/Tool01-va49aYq9.js +0 -1
  237. package/dist/client/assets/UserSquare-CwU4sG2o.js +0 -1
  238. package/dist/client/assets/agent-icon-DCM1Bdl8.js +0 -1
  239. package/dist/client/assets/agents-list-BblEB_Yy.js +0 -1
  240. package/dist/client/assets/app-editor-I_aUhOen.js +0 -1
  241. package/dist/client/assets/automation-runs-GCI7uxIE.js +0 -280
  242. package/dist/client/assets/automations-BQ1HpMVH.js +0 -1
  243. package/dist/client/assets/bulk-category-panel-CsF_6FI0.js +0 -1
  244. package/dist/client/assets/cards-4fPEe6ST.js +0 -9
  245. package/dist/client/assets/category-editor-D5nV2a1F.js +0 -1
  246. package/dist/client/assets/chat-context-CmwZXAhQ.js +0 -35
  247. package/dist/client/assets/choose-editor-2zkSgPsA.js +0 -1
  248. package/dist/client/assets/collection-detail-DHWV_lB6.js +0 -1
  249. package/dist/client/assets/commerce-onboarding-BAlSxXoB.js +0 -1
  250. package/dist/client/assets/connection-detail-DZEeMz2b.js +0 -1
  251. package/dist/client/assets/connections-Cd3u8u7a.js +0 -1
  252. package/dist/client/assets/file-explorer-hutSgELN.js +0 -2
  253. package/dist/client/assets/general-BmUVO2yQ.js +0 -1
  254. package/dist/client/assets/index-D3IpXIE1.js +0 -1
  255. package/dist/client/assets/index-DJSuP9VA.css +0 -1
  256. package/dist/client/assets/monaco-editor-CQbDSum8.js +0 -19
  257. package/dist/client/assets/page-seo-form-kQ_gqmTd.js +0 -1
  258. package/dist/client/assets/post-calendar-DJZelBC2.js +0 -1
  259. package/dist/client/assets/post-editor-C5Ee-UkR.js +0 -1
  260. package/dist/client/assets/project-app-view-DZuDq3zQ.js +0 -1
  261. package/dist/client/assets/record-editor-DGXTnpF6.js +0 -1
  262. package/dist/client/assets/redirect-editor-V6SQ4gS6.js +0 -1
  263. package/dist/client/assets/registry-BYqWHQgR.js +0 -2
  264. package/dist/client/assets/review-settings-kV6Wbxhl.js +0 -1
  265. package/dist/client/assets/roles-Dcj4t-Mv.js +0 -1
  266. package/dist/client/assets/sections-editor-VI00Nblu.js +0 -2
  267. package/dist/client/assets/seo-editor-CObQJqAB.js +0 -1
  268. package/dist/client/assets/settings-layout-Bbbz4btQ.js +0 -1
  269. package/dist/client/assets/shell-layout-i3nUAnDL.js +0 -1
  270. package/dist/client/assets/store-registry-BiGqjfDg.js +0 -2
  271. package/dist/client/assets/super-agent-icon-DbGhAnlL.js +0 -1
  272. package/dist/client/assets/synced-repos-XSy5K1eb.js +0 -1
  273. package/dist/client/assets/tasks-D-zkYbxa.js +0 -1
  274. package/dist/client/assets/use-panel-navigate-BsVeEWlx.js +0 -1
  275. package/dist/client/assets/useInfiniteQuery-DjjzlWAZ.js +0 -1
  276. package/dist/client/assets/useSuspenseInfiniteQuery-Ci5SesMe.js +0 -1
  277. package/dist/client/assets/variant-calendar-BdYlnVxu.js +0 -1
@@ -1 +0,0 @@
1
- import{ak as be,ap as $e,au as De,an as me,al as Oe,c as R,b as H,j as t,k as ve,B,r as Z,n as Ne,H as te,ac as ze,z as Me,K as ae,d as se,b7 as Ee,b9 as ue,G as Ue,E as Re,f as Ve,c8 as Fe,p as Le,aw as Be,ax as He,bh as Ge,bg as qe,bf as Ke,bd as Qe,be as Xe,t as Y}from"./index-Ci8azyOE.js";import{g as We}from"./extract-connection-data-6cVSTGuY.js";import{E as Se}from"./empty-state-DAYLBxJ6.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-CYKg-GvJ.js";import{c as st,S as nt,V as it}from"./index-q2Rm7O_h.js";import{u as ye,T as ot}from"./use-mcp-auth-status-7KFU7IPU.js";import{a as at}from"./use-members-IwrDPxqz.js";import{A as lt}from"./avatar-D-QkiqIH.js";import{a as Ce,b as _e,u as rt}from"./use-connection-gqhqm1hO.js";import{u as we}from"./use-mcp-client-DP2onozC.js";import{a as ct}from"./use-mcp-tools-B7yHzu9T.js";import{b as dt,C as mt,a as ut,c as xt}from"./chart-BS94Bf-2.js";import{i as pt,a as ft}from"./mcp-oauth-GWhqBwu1.js";import{I as le}from"./integration-icon-CGnrGZxM.js";import{s as ht}from"./Plus-CPkR-QLd.js";import{O as gt,P as jt,l as bt,aL as vt,s as ne}from"./agent-icon-DCM1Bdl8.js";import{a as ke,s as Nt}from"./Settings02-BMcJFHpd.js";import{s as ce}from"./Trash01-Dp-QTpAR.js";import{d as K,a as Q,e as X,b as L,c as W,f as St,F as yt}from"./form-DauSI86Q.js";import{I as J}from"./input-Bwz-dTwg.js";import{u as Ct,D as _t}from"./use-delete-connection-BwHeDNps.js";import{c as wt,B as kt,a as It,C as Tt}from"./monitoring-stats-row-BKiTJqu0.js";import{u as At}from"./use-virtual-mcp-Dj0wXB98.js";import{i as Ie}from"./ChevronRight-DUmHQrD7.js";import{a as Te}from"./Users03-BUoBV4mB.js";import{b as ie,c as Pt,T as oe,a as $t}from"./tabs-CFhQLpsD.js";import{g as Ae}from"./connection-slug-CITJ0kGN.js";import{c as Dt}from"./Tool01-va49aYq9.js";import{g as de,M as Ot}from"./types-BGVeElFe.js";import{C as zt}from"./collection-search-0N-i_PHL.js";import{B as Mt}from"./badge-DX3_GQsO.js";import{c as Et,D as Ut,b as Rt,a as xe}from"./dropdown-menu-wKA_-hY5.js";import{S as pe,a as fe,b as he,c as ge,d as q}from"./select-C7Q2VGxk.js";import{i as Vt}from"./CheckCircle-teyxVGFp.js";import{t as Ft}from"./ChevronDown-Csfjhwpm.js";import{n as Lt}from"./Tool02-jKKU1_dM.js";import{f as Bt}from"./UserSquare-CwU4sG2o.js";import{s as Ht}from"./XClose-CTv0nnSb.js";import{p as Gt,i as qt}from"./connection-CUtGFjSN.js";import"./metadata-dUsYcpuu.js";import"./constants-dLUUoWH7.js";import"./Key01-D4srNqPO.js";import"./auth-D8IdOmGw.js";import"./use-registry-connections-DghvIzKh.js";import"./use-organization-settings-BAFLKQ3y.js";import"./task-board-Cz-fiaKF.js";import"./index-De-kCEdQ.js";import"./index-B9iOsEIc.js";import"./index-BYBf2qjQ.js";import"./popover-ClwD_xra.js";import"./Check-D5PKBQ5I.js";import"./SearchMd-ClTH3fiN.js";import"./use-create-virtual-mcp-Dzmlrw8C.js";import"./use-navigate-to-agent-mrg2_DxJ.js";import"./use-destination-route-d8wgPDBu.js";import"./hooks-DQmp7LHz.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BN-M5EUb.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./Eye-DgiSa7UT.js";import"./use-org-auth-client-HXTuHVWD.js";import"./User01-DJ_BO2EX.js";import"./AlertCircle-BTlJp8pf.js";import"./ArrowUp-CVoISkQ4.js";import"./ArrowLeft-BwagOJkb.js";import"./XCircle-CVbKXkpd.js";import"./TrendUp01-DikSDrNg.js";import"./ZapSquare-BZzRAQpm.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./ChevronUp-Dlj_U0qV.js";import"./DotsVertical-CpVcGDJ_.js";import"./Stars02-DZNA1z2-.js";import"./Copy01-CsNpp9jr.js";import"./CreditCard01-YCHpZ00A.js";import"./Download01-BN9BT9cL.js";import"./FilterLines-Db8-uWfr.js";import"./Share07-CPDrxQV8.js";import"./Globe01-CV-16mwB.js";import"./Globe04-D3O2XfOT.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./HardDrive-CWvDYc59.js";import"./LinkExternal01-CIL2SNWf.js";import"./LockUnlocked01-BpeKJGM4.js";import"./LogOut01-qWWgaWbQ.js";import"./Monitor01-uq-dlf-u.js";import"./Sun-BBWjOwQE.js";import"./Palette-Cv68Zggp.js";import"./Play-C9xK8clC.js";import"./SearchLg-8daQliv2.js";import"./Shield01-C9M_jcOJ.js";import"./Stars01-BzEDQnsl.js";import"./Upload01-DxCHPffq.js";import"./Users01-B2wc_Wgl.js";import"./Zap-MbQ2aiA8.js";import"./label-C1OhLpvf.js";import"./alert-dialog-Dh9zsaCy.js";import"./YAxis-DxhC7uB4.js";import"./AreaChart-dJjxY072.js";const Kt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Qt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Kt}];function Xt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(gt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(jt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let z;e[32]!==o?(z=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=z):z=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==z?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":z,children:T}),e[35]=$,e[36]=_,e[37]=z,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let M;e[47]!==I||e[48]!==v||e[49]!==j?(M=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=M):M=e[50];let k;e[51]!==D||e[52]!==M||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,M]}),e[51]=D,e[52]=M,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ht,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Xt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Yt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=ze(),o=es(a),{data:r}=Me({queryKey:ae.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=wt(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(dt,{config:ts,className:"h-16 w-full",children:t.jsxs(kt,{data:p,barCategoryGap:"4%",children:[t.jsx(mt,{content:t.jsx(ut,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(It,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(Tt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=R.c(19),{connectionId:n}=s,c=H(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=R.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(rs,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function ds(s){const e=R.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=At(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),z=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(zt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=z.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:z.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function re(s){const e=R.c(5),{label:n}=s,c=H();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let G;e[20]!==d?(G=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=G):G=e[21];let F;e[22]!==G?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:G}),e[22]=G,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let z;e[32]!==y||e[33]!==d?(z=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=z):z=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==z||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Pt,{variant:"underline",className:"gap-1",children:[_,z,D,v]})}),e[43]=z,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let M;e[51]!==E?(M=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=M):M=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==M||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs($t,{defaultValue:"tools",variant:"underline",children:[j,M,k,U,w]})}),e[66]=j,e[67]=M,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(bt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?Gt(e.connection_url):null;return d?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(Q,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Ut,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Ft,{size:12})]})})}),t.jsxs(Rt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(St,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&qt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Le(),d=_e(),{org:f}=te(),u=Ct({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=st(D,Qt),v=Be({resolver:He(Ye),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},M=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ft({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const G=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(G.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(_t,{...u}),t.jsx(Ge,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(qe,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ke,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Qe,{className:"text-base",children:h?.title??s.title}),t.jsx(Xe,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(yt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(K,{control:v.control,name:"title",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...x})}),t.jsx(W,{})]})}),t.jsx(K,{control:v.control,name:"description",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(B,{variant:"outline",onClick:M,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,V=We("conn");await d.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const G=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await pt({url:G.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=H();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ve(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=rt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=ct(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=xt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:z}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==z?.resources?(v=z?.resources??[],s[23]=z?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let M;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(M=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=M):M=s[51],M}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function _i(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{_i as default};
@@ -1 +0,0 @@
1
- import{r as B,c as ae,b as de,j as t,B as G,k as pe,q as re,n as je,E as Ye,H as Ne,d as ke,u as Ze,a as Te,G as et,a5 as tt,c6 as Ce,R as nt,I as st,aw as ot,ax as it,P as fe,p as ct,ac as lt,t as Y,K as rt}from"./index-Ci8azyOE.js";import{a as Ae,b as at,g as dt,e as ut}from"./extract-connection-data-6cVSTGuY.js";import{C as mt}from"./collection-display-button-jLXxSVGC.js";import{S as gt}from"./search-input-CevwWux3.js";import{C as pt}from"./collection-tabs-PM6yowhG.js";import{C as ve,u as ft,a as we,g as ht}from"./connection-card-B1T5pd1c.js";import{E as xt}from"./empty-state-DAYLBxJ6.js";import{u as jt,D as yt}from"./use-delete-connection-BwHeDNps.js";import{u as St}from"./use-infinite-scroll-Cw7R-QWe.js";import{u as Ct}from"./use-view-mode-Bn3--gRi.js";import{g as xe}from"./connection-slug-CITJ0kGN.js";import{c as Ie,d as Pe,b as Oe,f as Le,g as Me,e as Fe,a as $e,A as Ue}from"./alert-dialog-Dh9zsaCy.js";import{n as ye}from"./Tool02-jKKU1_dM.js";import{g as vt}from"./metadata-dUsYcpuu.js";import{b as Ve,h as ze,a as Ee,c as Be,d as Ke,e as He}from"./dialog-BI8UUwqv.js";import{D as bt,a as _t,c as Dt,b as Nt,g as kt,e as Tt,f as At}from"./drawer-BR22I8_f.js";import{d as se,a as oe,e as ie,b as ce,c as le,F as _e}from"./form-DauSI86Q.js";import{I as ue}from"./input-Bwz-dTwg.js";import{S as wt,a as It,b as Pt,c as Ot,d as ge}from"./select-C7Q2VGxk.js";import{T as Lt}from"./textarea-CMpN0SgX.js";import{b as Re,u as Mt}from"./use-connection-gqhqm1hO.js";import{u as Ft}from"./use-virtual-mcp-Dj0wXB98.js";import{aK as $t,P as Ut,O as Vt,s as Se}from"./agent-icon-DCM1Bdl8.js";import{s as We}from"./Plus-CPkR-QLd.js";import{f as zt}from"./UserSquare-CwU4sG2o.js";import{s as Xe}from"./XClose-CTv0nnSb.js";import{i as he,a as De,E as Et,c as Bt,p as Kt,b as Ht,d as Rt}from"./connection-form-helpers-CYKg-GvJ.js";import{a as Wt}from"./authenticate-and-persist-oauth-DY_hbkIG.js";import{I as Xt}from"./integration-icon-CGnrGZxM.js";import{C as Ge}from"./checkbox-Gg7TSWGl.js";import{a as me,D as Gt,c as qt,b as Qt}from"./dropdown-menu-wKA_-hY5.js";import{i as Jt}from"./DotsVertical-CpVcGDJ_.js";import{s as qe}from"./Eye-DgiSa7UT.js";import{s as Qe}from"./Trash01-Dp-QTpAR.js";import"./use-mcp-client-DP2onozC.js";import"./constants-dLUUoWH7.js";import"./auth-D8IdOmGw.js";import"./ArrowUp-CVoISkQ4.js";import"./Check-D5PKBQ5I.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./view-mode-toggle-CcmqoSVC.js";import"./badge-DX3_GQsO.js";import"./SearchMd-ClTH3fiN.js";import"./use-registry-connections-DghvIzKh.js";import"./use-organization-settings-BAFLKQ3y.js";import"./task-board-Cz-fiaKF.js";import"./useInfiniteQuery-DjjzlWAZ.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./slugify-CEUa2lfQ.js";import"./label-C1OhLpvf.js";import"./ChevronDown-Csfjhwpm.js";import"./ChevronUp-Dlj_U0qV.js";import"./AlertCircle-BTlJp8pf.js";import"./Tool01-va49aYq9.js";import"./ArrowLeft-BwagOJkb.js";import"./XCircle-CVbKXkpd.js";import"./TrendUp01-DikSDrNg.js";import"./ZapSquare-BZzRAQpm.js";import"./Users03-BUoBV4mB.js";import"./CheckCircle-teyxVGFp.js";import"./ChevronRight-DUmHQrD7.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./Stars02-DZNA1z2-.js";import"./Copy01-CsNpp9jr.js";import"./CreditCard01-YCHpZ00A.js";import"./Download01-BN9BT9cL.js";import"./Settings02-BMcJFHpd.js";import"./FilterLines-Db8-uWfr.js";import"./Share07-CPDrxQV8.js";import"./Globe01-CV-16mwB.js";import"./Globe04-D3O2XfOT.js";import"./HardDrive-CWvDYc59.js";import"./Key01-D4srNqPO.js";import"./LinkExternal01-CIL2SNWf.js";import"./LockUnlocked01-BpeKJGM4.js";import"./LogOut01-qWWgaWbQ.js";import"./Monitor01-uq-dlf-u.js";import"./Sun-BBWjOwQE.js";import"./Palette-Cv68Zggp.js";import"./Play-C9xK8clC.js";import"./SearchLg-8daQliv2.js";import"./Shield01-C9M_jcOJ.js";import"./Stars01-BzEDQnsl.js";import"./Upload01-DxCHPffq.js";import"./User01-DJ_BO2EX.js";import"./Users01-B2wc_Wgl.js";import"./Zap-MbQ2aiA8.js";import"./mcp-oauth-GWhqBwu1.js";function Yt(s){const e=`deco-filters-${s}`,[n,p]=B.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{p(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Zt(s){const e=ae.c(7),[n,p]=B.useState(s),[r,c]=B.useState(s?"desc":null);let o;e[0]!==r||e[1]!==n?(o=a=>{n!==a?(p(a),c("asc")):r==="asc"?c("desc"):r==="desc"&&(p(void 0),c(null))},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o;let d;return e[3]!==l||e[4]!==r||e[5]!==n?(d={sortKey:n,sortDirection:r,handleSort:l},e[3]=l,e[4]=r,e[5]=n,e[6]=d):d=e[6],d}function en(s){const e=ae.c(20),{namespace:n,resource:p,defaultSortKey:r,defaultViewMode:c}=s,o=r===void 0?"title":r,l=c===void 0?"table":c,[d,a]=B.useState(""),N=B.useDeferredValue(d),f=`${n}-${p}`,[g,v]=Yt(f),x=`studio-${p}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[u,y]=B.useState(_);let j;e[2]!==x?(j=L=>{y(L),globalThis.localStorage?.setItem(x,String(L))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==u||e[5]!==D?(b=()=>{D(!u)},e[4]=u,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=Ct(`studio-${p}-${n}`,l),{sortKey:O,sortDirection:M,handleSort:A}=Zt(o),K=O;let U;return e[7]!==u||e[8]!==g||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==M||e[16]!==K||e[17]!==k||e[18]!==i?(U={search:d,searchTerm:N,setSearch:a,filters:g,setFilters:v,filterBarVisible:u,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:K,sortDirection:M,handleSort:A},e[7]=u,e[8]=g,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=M,e[16]=K,e[17]=k,e[18]=i,e[19]=U):U=e[19],U}function tn(s){const e=ae.c(35),{open:n,onOpenChange:p,count:r,onConfirm:c}=s,o=de(),l=r===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==r||e[1]!==o||e[2]!==l?(d=o(l,{count:r}),e[0]=r,e[1]=o,e[2]=l,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(Ie,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=r===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let f;e[6]!==o||e[7]!==N?(f=o(N),e[6]=o,e[7]=N,e[8]=f):f=e[8];let g;e[9]!==f?(g=t.jsx(Pe,{children:f}),e[9]=f,e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==g?(v=t.jsxs(Oe,{children:[a,g]}),e[11]=a,e[12]=g,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Le,{children:x}),e[16]=x,e[17]=_):_=e[17];const u=r===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let y;e[18]!==r||e[19]!==o||e[20]!==u?(y=o(u,{count:r}),e[18]=r,e[19]=o,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=t.jsx(Me,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Fe,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs($e,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==p||e[32]!==n||e[33]!==b?(k=t.jsx(Ue,{open:n,onOpenChange:p,children:b}),e[31]=p,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function nn(s){return s._registryId?.includes("community-registry")===!0}function sn(s){const e=ae.c(82),{item:n,canManage:p,allConnections:r,connectedAppNames:c,connectingItemId:o,onNavigateConnected:l,onConnect:d}=s,a=de(),[N,f]=B.useState(!1),[g,v]=B.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Ae(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const u=_;let y;e[4]!==n._meta?(y=vt(n._meta),e[4]=n._meta,e[5]=y):y=e[5];const j=y,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==r||e[10]!==x){let J;e[12]!==x?(J=be=>be.connection_type!=="VIRTUAL"&&be.app_name===x,e[12]=x,e[13]=J):J=e[13],T=r.filter(J),e[9]=r,e[10]=x,e[11]=T}else T=e[11];const O=T;let M;e[14]!==n?(M=nn(n),e[14]=n,e[15]=M):M=e[15];const A=M,K=u||p;let U,L;e[16]!==O||e[17]!==A||e[18]!==u||e[19]!==n||e[20]!==d||e[21]!==l?(U=()=>{if(u){const J=O[0];J&&l(J);return}L()},L=()=>{A?(v("connect"),f(!0)):d(n)},e[16]=O,e[17]=A,e[18]=u,e[19]=n,e[20]=d,e[21]=l,e[22]=U,e[23]=L):(U=e[22],L=e[23]);let V;e[24]!==n||e[25]!==d||e[26]!==g?(V=()=>{re("connections_community_warning_confirmed",{registry_item_id:n.id}),f(!1),g==="connect"&&d(n),v(null)},e[24]=n,e[25]=d,e[26]=g,e[27]=V):V=e[27];const q=V;let I;e[28]!==b||e[29]!==i||e[30]!==D?(I={title:D,description:b,icon:i},e[28]=b,e[29]=i,e[30]=D,e[31]=I):I=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ye,{}),e[32]=Q):Q=e[32];const S=K?U:void 0;let w;e[33]!==A||e[34]!==n._sourceIcon?(w=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[33]=A,e[34]=n._sourceIcon,e[35]=w):w=e[35];let z;e[36]!==p||e[37]!==o||e[38]!==L||e[39]!==u||e[40]!==n.id||e[41]!==a?(z=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):p&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:J=>{J.stopPropagation(),L()},children:o===n.id?t.jsx(pe,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[36]=p,e[37]=o,e[38]=L,e[39]=u,e[40]=n.id,e[41]=a,e[42]=z):z=e[42];let R;e[43]!==w||e[44]!==z?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[w,z]}),e[43]=w,e[44]=z,e[45]=R):R=e[45];let H;e[46]!==R||e[47]!==I||e[48]!==S?(H=t.jsx(ve,{connection:I,fallbackIcon:Q,onClick:S,headerActionsAlwaysVisible:!0,headerActions:R}),e[46]=R,e[47]=I,e[48]=S,e[49]=H):H=e[49];let C;e[50]!==a?(C=a("orgs.catalogItemCard.communityMcpServerTitle"),e[50]=a,e[51]=C):C=e[51];let F;e[52]!==C?(F=t.jsx(Ie,{children:C}),e[52]=C,e[53]=F):F=e[53];let P;e[54]!==a?(P=a("orgs.catalogItemCard.communityMcpServerDescription"),e[54]=a,e[55]=P):P=e[55];let Z;e[56]!==P?(Z=t.jsx(Pe,{children:P}),e[56]=P,e[57]=Z):Z=e[57];let te;e[58]!==F||e[59]!==Z?(te=t.jsxs(Oe,{children:[F,Z]}),e[58]=F,e[59]=Z,e[60]=te):te=e[60];let ee;e[61]!==a?(ee=a("orgs.catalogItemCard.cancel"),e[61]=a,e[62]=ee):ee=e[62];let m;e[63]!==ee?(m=t.jsx(Le,{children:ee}),e[63]=ee,e[64]=m):m=e[64];let h;e[65]!==a?(h=a("orgs.catalogItemCard.continue"),e[65]=a,e[66]=h):h=e[66];let $;e[67]!==q||e[68]!==h?($=t.jsx(Me,{onClick:q,children:h}),e[67]=q,e[68]=h,e[69]=$):$=e[69];let W;e[70]!==m||e[71]!==$?(W=t.jsxs(Fe,{children:[m,$]}),e[70]=m,e[71]=$,e[72]=W):W=e[72];let E;e[73]!==te||e[74]!==W?(E=t.jsxs($e,{children:[te,W]}),e[73]=te,e[74]=W,e[75]=E):E=e[75];let X;e[76]!==N||e[77]!==E?(X=t.jsx(Ue,{open:N,onOpenChange:f,children:E}),e[76]=N,e[77]=E,e[78]=X):X=e[78];let ne;return e[79]!==H||e[80]!==X?(ne=t.jsxs(t.Fragment,{children:[H,X]}),e[79]=H,e[80]=X,e[81]=ne):ne=e[81],ne}function Je(s){const e=ae.c(8),{selectionMode:n,children:p}=s,r=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==r?(c=je("overflow-hidden transition-all duration-150 ease-out",r),e[0]=r,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Gt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cn,children:t.jsx(Jt,{size:20})})}),e[2]=o):o=e[2];let l;e[3]!==p?(l=t.jsxs(qt,{children:[o,t.jsx(Qt,{align:"end",onClick:on,children:p})]}),e[3]=p,e[4]=l):l=e[4];let d;return e[5]!==c||e[6]!==l?(d=t.jsx("div",{className:c,children:l}),e[5]=c,e[6]=l,e[7]=d):d=e[7],d}function on(s){return s.stopPropagation()}function cn(s){return s.stopPropagation()}function ln(s){const e=ae.c(57),{group:n,onOpen:p,selectionMode:r,selectedIds:c,onToggleSelect:o}=s,l=de();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=Q=>c.has(Q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=Q=>c.has(Q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const f=N;let g;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(g=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=g):g=e[14];const v=g,x=n.title,_=n.icon;let u;e[15]!==n.connections.length||e[16]!==l?(u=l("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=l,e[17]=u):u=e[17];let y;e[18]!==n.icon||e[19]!==n.title||e[20]!==u?(y={title:x,icon:_,description:u},e[18]=n.icon,e[19]=n.title,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==r||e[24]!==v?(j=()=>r?v():p(),e[22]=p,e[23]=r,e[24]=v,e[25]=j):j=e[25];const D=r&&a&&"ring-2 ring-primary",b=r&&f&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=je(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];const i=r?a?!0:f&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ye,{}),e[29]=T):T=e[29];let O;e[30]!==a||e[31]!==n.connections.length||e[32]!==r||e[33]!==f||e[34]!==l||e[35]!==v?(O=r?t.jsx(Ge,{checked:a?!0:f?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:l("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=r,e[33]=f,e[34]=l,e[35]=v,e[36]=O):O=e[36];let M;e[37]!==p?(M=I=>{I.stopPropagation(),p()},e[37]=p,e[38]=M):M=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(qe,{size:16}),e[39]=A):A=e[39];let K;e[40]!==l?(K=l("orgs.connectionSelectionUi.open"),e[40]=l,e[41]=K):K=e[41];let U;e[42]!==M||e[43]!==K?(U=t.jsxs(me,{onClick:M,children:[A,K]}),e[42]=M,e[43]=K,e[44]=U):U=e[44];let L;e[45]!==r||e[46]!==U?(L=t.jsx(Je,{selectionMode:r,children:U}),e[45]=r,e[46]=U,e[47]=L):L=e[47];let V;e[48]!==O||e[49]!==L?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[O,L]}),e[48]=O,e[49]=L,e[50]=V):V=e[50];let q;return e[51]!==k||e[52]!==i||e[53]!==V||e[54]!==y||e[55]!==j?(q=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:y,onClick:j,className:k,selected:i,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=k,e[52]=i,e[53]=V,e[54]=y,e[55]=j,e[56]=q):q=e[56],q}function rn(s){const e=ae.c(36),{connection:n,isSelected:p,selectionMode:r,canManage:c,canManageAgents:o,onToggleSelect:l,onOpen:d,onToggleStatus:a,onDelete:N}=s,f=de();let g;e[0]!==p||e[1]!==l||e[2]!==r||e[3]!==f?(g=r?t.jsx(Ge,{checked:p,onCheckedChange:l,onClick:an}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.connectionSelectionUi.connected")}),e[0]=p,e[1]=l,e[2]=r,e[3]=f,e[4]=g):g=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:16}),e[7]=x):x=e[7];let _;e[8]!==f?(_=f("orgs.connectionSelectionUi.open"),e[8]=f,e[9]=_):_=e[9];let u;e[10]!==v||e[11]!==_?(u=t.jsxs(me,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=u):u=e[12];let y;e[13]!==c||e[14]!==o||e[15]!==l||e[16]!==f?(y=(c||o)&&t.jsxs(me,{onClick:i=>{i.stopPropagation(),l()},children:[t.jsx($t,{size:16}),f("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=l,e[16]=f,e[17]=y):y=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==f?(j=c&&(n.status==="active"?t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx(Ut,{size:16}),f("orgs.connectionSelectionUi.disable")]}):t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Vt,{size:16}),f("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=f,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==f?(D=c&&t.jsxs(me,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(Qe,{size:16}),f("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=f,e[26]=D):D=e[26];let b;e[27]!==r||e[28]!==u||e[29]!==y||e[30]!==j||e[31]!==D?(b=t.jsxs(Je,{selectionMode:r,children:[u,y,j,D]}),e[27]=r,e[28]=u,e[29]=y,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==g||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[g,b]}),e[33]=g,e[34]=b,e[35]=k):k=e[35],k}function an(s){return s.stopPropagation()}function dn(s){const e=ae.c(29),{count:n,total:p,canManage:r,canManageAgents:c,onSelectAll:o,onDeselectAll:l,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:f}=s,g=de();if(n===0)return null;let v;e[0]!==n||e[1]!==g?(v=g("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=g,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==g||e[9]!==p?(_=n<p?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:g("orgs.connectionSelectionUi.selectAll",{total:p})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:g("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=l,e[7]=o,e[8]=g,e[9]=p,e[10]=_):_=e[10];let u;e[11]!==c||e[12]!==a||e[13]!==g?(u=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(We,{size:13}),g("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=g,e[14]=u):u=e[14];let y;e[15]!==r||e[16]!==d||e[17]!==N||e[18]!==g?(y=r&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:g("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:g("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Qe,{size:13}),g("orgs.connectionSelectionUi.delete")]})]}),e[15]=r,e[16]=d,e[17]=N,e[18]=g,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Xe,{size:13}),e[20]=j):j=e[20];let D;e[21]!==f?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:j}),e[21]=f,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==u||e[26]!==y||e[27]!==D?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[x,_,u,y,D]})}),e[23]=x,e[24]=_,e[25]=u,e[26]=y,e[27]=D,e[28]=b):b=e[28],b}function un(s){const e=ae.c(45),{open:n,onOpenChange:p,agents:r,onConfirm:c}=s,o=de(),[l,d]=B.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ve,{children:a}),e[2]=a,e[3]=N):N=e[3];let f;e[4]!==o?(f=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=f):f=e[5];let g;e[6]!==f?(g=t.jsx(ze,{children:f}),e[6]=f,e[7]=g):g=e[7];let v;e[8]!==N||e[9]!==g?(v=t.jsxs(Ee,{children:[N,g]}),e[8]=N,e[9]=g,e[10]=v):v=e[10];let x;e[11]!==r||e[12]!==l||e[13]!==o?(x=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):r.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:je("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Xt,{icon:A.icon,name:A.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=r,e[12]=l,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let u;e[17]!==p?(u=()=>p(!1),e[17]=p,e[18]=u):u=e[18];let y;e[19]!==o?(y=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=y):y=e[20];let j;e[21]!==u||e[22]!==y?(j=t.jsx(G,{variant:"outline",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=j):j=e[23];const D=!l;let b;e[24]!==c||e[25]!==p||e[26]!==l?(b=()=>{l&&(c(l),p(!1),d(null))},e[24]=c,e[25]=p,e[26]=l,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Be,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let O;e[37]!==T||e[38]!==v||e[39]!==_?(O=t.jsxs(Ke,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=O):O=e[40];let M;return e[41]!==p||e[42]!==n||e[43]!==O?(M=t.jsx(He,{open:n,onOpenChange:p,children:O}),e[41]=p,e[42]=n,e[43]=O,e[44]=M):M=e[44],M}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:r,enabledRegistries:c}){const o=de(),{org:l}=Ne(),d=ct(),a=ke(),{data:N}=Te.useSession(),f=Re(),g=Mt(s),v=jt(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[u,y]=B.useState(new Set),j=u.size>0,[D,b]=B.useState(!1),[k,i]=B.useState(!1),[T,O]=B.useState(null),M=Ft(),A=g.filter(m=>!(n!=="ALL"&&m.connection_type!==n||p!=="ALL"&&m.status!==p)),K=ht(A),U=m=>{y(h=>{const $=new Set(h);return $.has(m)?$.delete(m):$.add(m),$})},L=()=>{y(new Set)},V=we(c,s.searchTerm),q=V.items,I=St(V.loadMore,V.hasMore,V.isLoadingMore),Q=new Set(g.filter(m=>m.app_name).map(m=>m.app_name)),S=r==="ALL"||c.some(m=>m.id===r)?r:"ALL",w=s.search.length>0,z=e==="all"||w?q.filter(m=>{if(S!=="ALL"&&m._registryId!==S)return!1;if(w){const h=Ae(m);if(h&&Q.has(h))return!1}return!0}):[],R=e==="connected"||w?K:[],H=async m=>{if(!(!l||!N?.user?.id)){re("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),O(m.id);try{const h=ut(m,l.id,N.user.id,{remoteIndex:0}),$=h.connection_type==="STDIO",W=!!h.connection_url,E=$&&h.connection_headers&&typeof h.connection_headers=="object"&&"command"in h.connection_headers;if(!W&&!E){Y.error(o("orgs.connections.cannotConnectNoMethod")),O(null);return}const{id:X}=await f.create.mutateAsync(h),ne=await Wt({connectionId:X,orgId:l.id,orgSlug:l.slug,persistFallback:J=>f.update.mutateAsync({id:X,data:{connection_token:J}}).then(()=>{})});if(ne.ran&&!ne.ok){re("connection_oauth_failed",{connection_id:X,flow:"connections_page_connect",error:ne.error??"no_token"}),Y.error(o("orgs.connections.authenticationFailed",{error:ne.error??"no token received"}));return}if(ne.ran){re("connection_oauth_succeeded",{connection_id:X,flow:"connections_page_connect"});const J=new URL(`/api/${l.slug}/mcp/${X}`,window.location.origin);await d.invalidateQueries({queryKey:rt.isMCPAuthenticated(J.href,null)}),F(),Y.success(o("orgs.connections.authenticationSuccessful"))}Y.success(o("orgs.connections.connectedSuccessfully"))}catch(h){Y.error(o("orgs.connections.failedToConnect",{error:h instanceof Error?h.message:String(h)}))}finally{O(null)}}},C=lt(),F=()=>{d.invalidateQueries({predicate:m=>{const h=m.queryKey;return h[1]===l.id&&h[3]==="collection"&&h[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const m=[...u];re("connections_bulk_delete",{count:m.length});let h=0;for(const $ of m)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:$,force:!0}),h++}catch{}F(),Y.success(o("orgs.connections.deletedConnections",{count:h})),L()},Z=async(m,h)=>{try{await f.update.mutateAsync({id:m,data:{status:h}}),F(),Y.success(o(h==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Y.error(o("orgs.connections.failedToUpdateConnection"))}},te=async m=>{const h=[...u];re("connections_bulk_status_toggled",{count:h.length,to_status:m});let $=0;for(const W of h)try{await f.update.mutateAsync({id:W,data:{status:m}}),$++}catch{}F(),Y.success(m==="active"?o("orgs.connections.enabledConnections",{count:$}):o("orgs.connections.disabledConnections",{count:$})),L()},ee=async m=>{const h=M.find(E=>E.id===m);if(!h)return;re("connections_bulk_add_to_agent",{agent_id:m,count:u.size});const $=new Set(h.connections.map(E=>E.connection_id)),W=[...u].filter(E=>!$.has(E)).map(E=>({connection_id:E,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Y.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...h.connections,...W]}}),d.invalidateQueries({predicate:E=>{const X=E.queryKey;return X[1]===l.id&&X[3]==="collection"&&X[4]==="VIRTUAL_MCP"}}),Y.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:h.title})),L()}catch{Y.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...v}),t.jsx(tn,{open:D,onOpenChange:b,count:u.size,onConfirm:P}),t.jsx(un,{open:k,onOpenChange:i,agents:M,onConfirm:ee}),V.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(xt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(m=>{if(m.type==="group")return t.jsx(ln,{group:m,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:m.key}})},selectionMode:j,selectedIds:u,onToggleSelect:U},m.key);const h=m.connection,$=u.has(h.id);return t.jsx(ve,{connection:h,fallbackIcon:t.jsx(ye,{}),onClick:()=>j?U(h.id):a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),className:je($&&"ring-2 ring-primary bg-primary/5"),selected:j?$:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:h,isSelected:$,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>U(h.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onToggleStatus:W=>Z(h.id,W),onDelete:()=>v.requestDelete(h)})},h.id)}),z.map(m=>t.jsx(sn,{item:m,canManage:x,allConnections:g,connectedAppNames:Q,connectingItemId:T,onNavigateConnected:h=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onConnect:H},`catalog-${m._registryId}:${m.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:I,className:"col-span-full h-4"}),(e==="all"||w)&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(pe,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(dn,{count:u.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{y(new Set(A.map(m=>m.id)))},onDeselectAll:()=>y(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:te,onCancel:L})]})}function gn(){const s=de(),{org:e}=Ne(),n=ke(),p=Ze({strict:!1}),{data:r}=Te.useSession(),{stdioEnabled:c}=et(),o=tt(),{granted:l}=Ce("connections:manage"),d=en({namespace:e.slug,resource:"connections"}),a=Re(),[N,f]=nt(st.connectionsTab(e.slug),S=>p.tab==="all"||p.tab==="connected"?p.tab:S??"all"),[g,v]=B.useState("ALL"),[x,_]=B.useState("ALL"),[u,y]=B.useState("ALL"),j=ft(),b=we(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=ot({resolver:it(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),O=i.watch("connection_url"),M=i.watch("npx_package"),A=he({uiType:T,connectionUrl:O??"",npxPackage:M??""})??De({uiType:T,connectionUrl:O??"",registryItems:b}),K=l&&p.action==="create",U=()=>{re("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},L=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},V=async S=>{let w,z=null,R=null,H=null;S.ui_type==="NPX"?(w="STDIO",z="",H=Ht(S.npx_package||"",S.env_vars||[])):S.ui_type==="STDIO"?(w="STDIO",z="",H=Rt(S.stdio_command||"",S.stdio_args||"",S.stdio_cwd,S.env_vars||[])):(w=S.ui_type,z=S.connection_url||"",R=S.connection_token||null);const C=dt("conn");re("connection_custom_created",{connection_type:w,ui_type:S.ui_type}),await a.create.mutateAsync({id:C,title:S.title,description:S.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:e.id,icon:S.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),L(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:xe({app_name:null,connection_url:z,title:S.title,id:C})}})},q=S=>{S||(K&&L(),i.reset())},I=S=>{const w=S.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Z=i.getValues("env_vars")??[],te=new Set(Z.map(m=>m.key)),ee=P.envVarKeys.filter(m=>!te.has(m));ee.length>0&&i.setValue("env_vars",[...Z,...ee.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},F=Kt(w);if(F&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",F.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(he({uiType:"NPX",npxPackage:F.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(he({uiType:P,connectionUrl:w})??De({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(he({uiType:"NPX",npxPackage:w}))},Q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:U,children:[t.jsx(We,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const S=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(se,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.type")}),t.jsxs(wt,{value:C.value,onValueChange:C.onChange,children:[t.jsx(ce,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Ot,{children:[t.jsx(ge,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ge,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ge,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(ge,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(le,{})]})}),T==="NPX"&&t.jsx(se,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.npmPackage")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(se,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.command")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.arguments")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.workingDirectory")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(le,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(se,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.environmentVariables")}),t.jsx(ce,{children:t.jsx(Et,{value:C.value??[],onChange:C.onChange})}),t.jsx(le,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(se,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.url")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(ce,{children:t.jsx(ue,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"title",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.name")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"description",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.description")}),t.jsx(ce,{children:t.jsx(Lt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(le,{})]})})]}),H=K;return o?t.jsx(bt,{open:H,onOpenChange:q,children:t.jsxs(_t,{className:"max-h-[90vh]",children:[t.jsx(Dt,{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(Nt,{children:S}),t.jsx(kt,{className:"mt-1",children:w})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Xe,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(At,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(He,{open:H,onOpenChange:q,children:t.jsxs(Ke,{className:"sm:max-w-[525px]",children:[t.jsxs(Ee,{children:[t.jsx(Ve,{children:S}),t.jsx(ze,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>q(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:S=>{S.key==="Escape"&&(d.setSearch(""),S.target.blur())}}),t.jsx(mt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:g,onChange:S=>v(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:x,onChange:S=>_(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:u,onChange:S=>y(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(S=>({id:S.id,label:S.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):S.title}))]}]:[]]})]}),Q]}),t.jsx(pt,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:S=>{const w=S;w!==N&&re("connections_page_tab_changed",{to_tab:w}),f(w)}}),t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:N,typeFilter:g,statusFilter:x,registryFilter:u,enabledRegistries:j})})})]})})})]})})}function Qs(){const s=ae.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gn,{})})}),s[0]=e):e=s[0],e}export{Qs as default};
@@ -1,2 +0,0 @@
1
- import{c as se,b as Te,r as d,j as r,k as pe,B as Re,fn as en,br as tn,bx as ge,fo as nn,fp as rn,fq as on,fr as sn,cQ as an,fs as ln,ft as dt,bt as cn,fu as dn,fv as un,fw as fn,fx as pn,fy as mn,fz as xn,fA as hn,fB as gn,fC as bn,n as le,p as yn,t as te,ab as tt,a8 as nt,a9 as rt,K as ot}from"./index-Ci8azyOE.js";import{V as vn,b0 as Cn,b1 as wn}from"./agent-icon-DCM1Bdl8.js";import{s as Nn}from"./XClose-CTv0nnSb.js";import{S as jn}from"./scroll-area-RteS0-Yk.js";import{a as En}from"./chat-context-CmwZXAhQ.js";import{F as Sn}from"./monaco-editor-CQbDSum8.js";import{u as Dn}from"./shell-layout-i3nUAnDL.js";import{i as Mn,E as Rn,a as Oe,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as je,e as Ie,h as Ee,j as Ke,k as ze,l as An,s as Ln,v as On,m as $e,n as Se,o as st,p as In,q as De,r as _e,w as Kn,x as zn,y as $n,z as _n,A as Gn}from"./index-BdFaTbMe.js";import{b as Bn,h as Vn,a as Un,c as qn,d as Hn,e as Wn}from"./dialog-BI8UUwqv.js";import{I as at}from"./input-Bwz-dTwg.js";import{c as Qn,d as Xn,b as Yn,f as Jn,g as Zn,e as er,a as tr,A as nr}from"./alert-dialog-Dh9zsaCy.js";import{t as rr}from"./ChevronDown-Csfjhwpm.js";import{i as or}from"./ChevronRight-DUmHQrD7.js";import{i as sr}from"./Share07-CPDrxQV8.js";import"./AlertCircle-BTlJp8pf.js";import"./UserSquare-CwU4sG2o.js";import"./Tool01-va49aYq9.js";import"./ArrowUp-CVoISkQ4.js";import"./ArrowLeft-BwagOJkb.js";import"./Tool02-jKKU1_dM.js";import"./XCircle-CVbKXkpd.js";import"./TrendUp01-DikSDrNg.js";import"./ZapSquare-BZzRAQpm.js";import"./Users03-BUoBV4mB.js";import"./CheckCircle-teyxVGFp.js";import"./Check-D5PKBQ5I.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./ChevronUp-Dlj_U0qV.js";import"./DotsVertical-CpVcGDJ_.js";import"./Stars02-DZNA1z2-.js";import"./Copy01-CsNpp9jr.js";import"./CreditCard01-YCHpZ00A.js";import"./Download01-BN9BT9cL.js";import"./Settings02-BMcJFHpd.js";import"./Eye-DgiSa7UT.js";import"./FilterLines-Db8-uWfr.js";import"./Globe01-CV-16mwB.js";import"./Globe04-D3O2XfOT.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./HardDrive-CWvDYc59.js";import"./Key01-D4srNqPO.js";import"./LinkExternal01-CIL2SNWf.js";import"./LockUnlocked01-BpeKJGM4.js";import"./LogOut01-qWWgaWbQ.js";import"./Monitor01-uq-dlf-u.js";import"./Sun-BBWjOwQE.js";import"./Palette-Cv68Zggp.js";import"./Play-C9xK8clC.js";import"./Plus-CPkR-QLd.js";import"./SearchLg-8daQliv2.js";import"./SearchMd-ClTH3fiN.js";import"./Shield01-C9M_jcOJ.js";import"./Stars01-BzEDQnsl.js";import"./Trash01-Dp-QTpAR.js";import"./Upload01-DxCHPffq.js";import"./User01-DJ_BO2EX.js";import"./Users01-B2wc_Wgl.js";import"./Zap-MbQ2aiA8.js";import"./select-C7Q2VGxk.js";import"./use-panel-navigate-BsVeEWlx.js";import"./use-destination-route-d8wgPDBu.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DQmp7LHz.js";import"./use-mcp-client-DP2onozC.js";import"./auth-D8IdOmGw.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BN-M5EUb.js";import"./task-board-Cz-fiaKF.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Dj0wXB98.js";import"./use-ai-providers-DlWIkMD-.js";import"./use-decopilot-events-CqU7DunK.js";import"./use-organization-settings-BAFLKQ3y.js";import"./spinner-B9x-ViPH.js";import"./avatar-D-QkiqIH.js";import"./required-auth-layout-CUQaC9Hr.js";import"./use-org-sso-C-uWWD5m.js";import"./automation-runs-GCI7uxIE.js";import"./useInfiniteQuery-DjjzlWAZ.js";import"./use-infinite-scroll-Cw7R-QWe.js";import"./use-connection-gqhqm1hO.js";import"./table-oIbRw7Yk.js";import"./empty-state-DAYLBxJ6.js";import"./use-members-IwrDPxqz.js";import"./use-org-auth-client-HXTuHVWD.js";import"./use-automations-CWqvHqj2.js";import"./useSuspenseInfiniteQuery-Ci5SesMe.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BY1mlr6R.js";import"./types-BGVeElFe.js";import"./integration-icon-CGnrGZxM.js";import"./use-navigate-to-agent-mrg2_DxJ.js";import"./chart-BS94Bf-2.js";import"./index-De-kCEdQ.js";import"./form-DauSI86Q.js";import"./label-C1OhLpvf.js";import"./file-type-icon-QfVGs4d0.js";import"./drawer-BR22I8_f.js";import"./collection-search-0N-i_PHL.js";import"./tabs-CFhQLpsD.js";import"./toggle-group-ClOqwWDq.js";import"./super-agent-icon-DbGhAnlL.js";import"./self-tool-result-BSLlHbcp.js";import"./extract-connection-data-6cVSTGuY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BENALn-i.js";import"./authenticate-and-persist-oauth-DY_hbkIG.js";import"./mcp-oauth-GWhqBwu1.js";import"./track-DXtvDI_s.js";import"./popover-ClwD_xra.js";import"./toolbar-KH-9Bre4.js";import"./github-repo-picker-sKX6qrmQ.js";import"./use-mcp-tools-B7yHzu9T.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-B1T5pd1c.js";import"./use-registry-connections-DghvIzKh.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CMpN0SgX.js";import"./connection-form-helpers-CYKg-GvJ.js";import"./collection-tabs-PM6yowhG.js";import"./badge-DX3_GQsO.js";import"./select-model-C03zAz7l.js";import"./checkbox-Gg7TSWGl.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-4fPEe6ST.js";import"./dropdown-menu-wKA_-hY5.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-kx6TUHpf.js";import"./use-file-configs-BAUKJMmN.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-j0VBccs2.js";import"./search-input-CevwWux3.js";import"./use-mcp-auth-status-7KFU7IPU.js";import"./switch-BuJnEOUw.js";import"./use-secrets-CvibJ_Hx.js";import"./AreaChart-dJjxY072.js";import"./config-DFqhM__G.js";import"./command-JNsPUZwg.js";import"./index-BYBf2qjQ.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-Clut3vXk.js";import"./use-tags-CGJ43yMs.js";import"./automation-list-row-CLAw5ACh.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-rlkQHsUF.js";const ar={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function ir(a){const e=se.c(71),{open:s,mode:i,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=a,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ar[i];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let z;e[3]!==h||e[4]!==f||e[5]!==u?(z=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=z):z=e[6];const L=z;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Bn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Vn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(Un,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(at,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let F;e[25]!==j?(F=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=F):F=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let $;e[28]!==C.placeholderKey||e[29]!==x?($=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=$):$=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==$?(Y=r.jsx(at,{id:"file-explorer-name",value:f,onChange:q,placeholder:$,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=$,e[34]=Y):Y=e[34];let J;e[35]!==F||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[F,Y]}),e[35]=F,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let k;e[59]!==H||e[60]!==G?(k=r.jsxs(qn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=k):k=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==k||e[65]!==N?(B=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,k]})}),e[62]=L,e[63]=ee,e[64]=k,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Wn,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(a){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:i,fsActionPending:l,onOpenChange:m,onConfirm:y}=a,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(Qn,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==i.length||e[13]!==u?(g=i.length>0&&r.jsxs(r.Fragment,{children:[" ",i.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:i.length})]}),e[12]=i.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(Xn,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let z;e[20]!==R||e[21]!==f?(z=r.jsxs(Yn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=z):z=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(Jn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx(Zn,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(er,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==z||e[41]!==M?(j=r.jsxs(tr,{children:[z,M]}),e[40]=z,e[41]=M,e[42]=j):j=e[42];let F;return e[43]!==m||e[44]!==E||e[45]!==j?(F=r.jsx(nr,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=F):F=e[46],F}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=a=>{const{__scopeContextMenu:e,children:s,onOpenChange:i,dir:l,modal:m=!0}=a,[y,u]=d.useState(!1),b=Z(e),E=an(i),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,disabled:i=!1,...l}=a,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{i&&h()},[i,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":i?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:i?a.onContextMenu:ge(a.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:i?a.onPointerDown:ge(a.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:i?a.onPointerMove:ge(a.onPointerMove,Me(h)),onPointerCancel:i?a.onPointerCancel:ge(a.onPointerCancel,Me(h)),onPointerUp:i?a.onPointerUp:ge(a.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=a=>{const{__scopeContextMenu:e,...s}=a,i=Z(e);return r.jsx(on,{...i,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...i,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{a.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{a.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(dn,{...l,...i,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(un,{...l,...i,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(nn,{...l,...i,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(fn,{...l,...i,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(pn,{...l,...i,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(mn,{...l,...i,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(xn,{...l,...i,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(rn,{...l,...i,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(hn,{...l,...i,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(gn,{...l,...i,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(bn,{...l,...i,ref:e,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pr.displayName=Tr;function Me(a){return e=>e.pointerType!=="mouse"?a(e):void 0}var kr=ft,Fr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(kr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=i):i=e[3],i}function zr(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(Fr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=i):i=e[3],i}function $r(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...i})}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}function fe(a){const e=se.c(12);let s,i,l,m;e[0]!==a?({className:s,inset:i,variant:m,...l}=a,e[0]=a,e[1]=s,e[2]=i,e[3]=l,e[4]=m):(s=e[1],i=e[2],l=e[3],m=e[4]);const y=m===void 0?"default":m;let u;e[5]!==s?(u=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=u):u=e[6];let b;return e[7]!==i||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":i,"data-variant":y,className:u,...l}),e[7]=i,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function it(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Ir,{"data-slot":"context-menu-separator",className:l,...i}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(a){const e=se.c(63),{node:s,depth:i,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=a,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:z,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${i*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==z||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(or,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(sr,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(z,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=z,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let F;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(F=r.jsx(zr,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=F):F=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let $;e[23]!==h||e[24]!==q?($=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=$):$=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(it,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(it,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let k;e[45]!==X||e[46]!==G?(k=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=k):k=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==$||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==k||e[58]!==V?(Q=r.jsxs($r,{className:"w-52",children:[$,J,ee,A,K,W,k,V]}),e[53]=$,e[54]=J,e[55]=A,e[56]=K,e[57]=k,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==F?(ne=r.jsxs(Kr,{children:[F,Q]}),e[60]=Q,e[61]=F,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(a,e){return Kn(a,e)}function qr(a){const e=se.c(9),{text:s,query:i}=a;let l,m,y;if(e[0]!==i||e[1]!==s){const{leadingEllipsis:b,segments:E}=An(s,i);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=i,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(a,e){return a.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:a.text},e):r.jsx("span",{children:a.text},e)}function Ka({orgSlug:a,virtualMcpId:e,branch:s,threadId:i,openPath:l}){const m={orgSlug:a,virtualMcpId:e,branch:s,threadId:i},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,z]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[F,q]=d.useState(!1),[$,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),k=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ae,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[ke,Fe]=d.useState(null),[ve,Ce]=d.useState(!1);async function ie(t,n){const o=await fetch(Ur(m,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=_n(t);if(!n)return;const o=`${a}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(a,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>je(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=je(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Et(t){const n=je(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of ze(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Ee(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),Fe(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=On(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,kt]=d.useState(null),w=Te();if(l&&l!==Pt){kt(l);const t=l;queueMicrotask(()=>{Mn(t)&&he(t)})}async function Ae(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?Gn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Ft(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!$e(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await Ft(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of ze(n)){if(!$e(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Rn});qe(n,!1,t),Y(!0)}catch{$&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){k.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==k.current)return;T(zn(o,t,ct))}catch{if(n!==k.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==k.current)return;D($n(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==k.current)return;D([]),j(!1)}finally{n===k.current&&N(!1)}}function zt(t){const n=t.trim(),o=++k.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function $t(t){if(z(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{zt(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ie("write",{path:re(t),content:n}),Se("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await In(m);Se("git status after save",o)}catch(o){Se("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){Se("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if($e(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=ze(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Ee(X.path):f?Ee(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Tn(b,E),Je=Pn(Qt,h),Le=L?.length??0,Ze=kn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=ke?jt(ke.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Ke(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),Ct(),vt({parts:[{type:"text",text:n.join(`
2
- `)}]}),be(null)}return F&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:R,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Ye("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Ye("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!R&&Je.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=h.has(n.path),v=X?.path===n.path,ce=Fn(n.path,n.kind),Ne=c&&ee.has(n.path);return r.jsx(Gr,{node:n,depth:o,isExpanded:p,isSelected:v,isLoading:Ne,fileVisual:Ie(n.name),onSelect:()=>I(n),onOpen:()=>{c?qt(n.path,p):he(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>Be(w,"Path",je(n.path)),onCopyRelativePath:()=>Be(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Fe(n)},n.path)}),!R&&$&&Je.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),R&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Le>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Le,Le>=ct?"+":""]})]}),L!==null&&L.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),L?.map(t=>{const n=t.split("/").pop()??t,o=Ee(t),{Icon:c,color:p}=Ie(n),v=f===t;return r.jsxs("button",{type:"button",onClick:()=>he(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",v&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),R&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),et>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[et,M?"+":""]}),S&&r.jsx(pe,{size:10,className:"animate-spin"})]}),!S&&P!==null&&Ze.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ze.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Ie(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>_t(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(qr,{text:p.text,query:R})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[C.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:C.map(t=>{const n=me.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=f===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{O(t),We(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),Vt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Zt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&be(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:f&&ue?.loaded?r.jsx(Sn,{language:Ke(f),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ue.editorValue,path:f,onChange:t=>{const n=f;n&&de(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Jt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},f):f&&!ue?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),f&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:f}),r.jsxs("span",{children:[w(Xt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Ke(f)]})]})]}),r.jsx(ir,{open:U!==null,mode:U?.mode??"new-file",initialName:U?.mode==="rename"?U.node.name:"",parentLabel:U&&U.mode!=="rename"?U.parentDir==="/"?"/":re(U.parentDir):void 0,isPending:ve,onSubmit:t=>Tt(w,t),onOpenChange:t=>{!t&&!ve&&oe(null)}}),r.jsx(lr,{deleteTarget:ke,deleteDirtyPaths:Yt,fsActionPending:ve,onOpenChange:t=>{!t&&!ve&&Fe(null)},onConfirm:t=>{Rt(w,t)}})]})}export{Ka as FileExplorer};
@@ -1 +0,0 @@
1
- import{c as P,H as Z,r as Y,j as i,B as ee,L as ge,ak as ue,an as ne,b as G,p as fe,aw as pe,ax as xe,e as re,q as te,t as F,K as oe,du as ie,dv as se,dw as Q,ay as he,Y as je,ac as Se,I as ae,cU as ze,cV as Ae,y as ve,P as W,dx as be}from"./index-Ci8azyOE.js";import{A as ye,b as _e}from"./alert-CIFaGTb_.js";import{i as Ce}from"./XCircle-CVbKXkpd.js";import{n as Oe}from"./LinkExternal01-CIL2SNWf.js";import{s as De}from"./XClose-CTv0nnSb.js";import{u as Ne}from"./use-org-auth-client-HXTuHVWD.js";import{u as we}from"./use-debounced-autosave-j0VBccs2.js";import{A as Te}from"./avatar-D-QkiqIH.js";import{I as le}from"./input-Bwz-dTwg.js";import{d as ce,S as Fe,a as ke,b as Pe,c as Ee}from"./select-C7Q2VGxk.js";import{A as me}from"./agent-icon-DCM1Bdl8.js";import{a as Ie,i as Le,d as Me}from"./constants-dLUUoWH7.js";import{u as Re}from"./use-virtual-mcp-Dj0wXB98.js";import{g as Ve}from"./agent-capabilities-B52k7xCe.js";import{f as $e,i as Ue}from"./use-organization-settings-BAFLKQ3y.js";import{C as qe}from"./review-settings-kV6Wbxhl.js";import{D as Be}from"./domain-settings-D4HjDgqu.js";import{c as Ke,d as Ge,b as Qe,f as Ye,g as He,e as We,a as Ze,A as Je}from"./alert-dialog-Dh9zsaCy.js";import{R as Xe}from"./require-capability-cxyKBT59.js";import"./User01-DJ_BO2EX.js";import"./Check-D5PKBQ5I.js";import"./ChevronDown-Csfjhwpm.js";import"./ChevronUp-Dlj_U0qV.js";import"./AlertCircle-BTlJp8pf.js";import"./UserSquare-CwU4sG2o.js";import"./Tool01-va49aYq9.js";import"./ArrowUp-CVoISkQ4.js";import"./ArrowLeft-BwagOJkb.js";import"./Tool02-jKKU1_dM.js";import"./TrendUp01-DikSDrNg.js";import"./ZapSquare-BZzRAQpm.js";import"./Users03-BUoBV4mB.js";import"./CheckCircle-teyxVGFp.js";import"./ChevronRight-DUmHQrD7.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./DotsVertical-CpVcGDJ_.js";import"./Stars02-DZNA1z2-.js";import"./Copy01-CsNpp9jr.js";import"./CreditCard01-YCHpZ00A.js";import"./Download01-BN9BT9cL.js";import"./Settings02-BMcJFHpd.js";import"./Eye-DgiSa7UT.js";import"./FilterLines-Db8-uWfr.js";import"./Share07-CPDrxQV8.js";import"./Globe01-CV-16mwB.js";import"./Globe04-D3O2XfOT.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./HardDrive-CWvDYc59.js";import"./Key01-D4srNqPO.js";import"./LockUnlocked01-BpeKJGM4.js";import"./LogOut01-qWWgaWbQ.js";import"./Monitor01-uq-dlf-u.js";import"./Sun-BBWjOwQE.js";import"./Palette-Cv68Zggp.js";import"./Play-C9xK8clC.js";import"./Plus-CPkR-QLd.js";import"./SearchLg-8daQliv2.js";import"./SearchMd-ClTH3fiN.js";import"./Shield01-C9M_jcOJ.js";import"./Stars01-BzEDQnsl.js";import"./Trash01-Dp-QTpAR.js";import"./Upload01-DxCHPffq.js";import"./Users01-B2wc_Wgl.js";import"./Zap-MbQ2aiA8.js";import"./use-mcp-client-DP2onozC.js";import"./auth-D8IdOmGw.js";import"./task-board-Cz-fiaKF.js";import"./switch-BuJnEOUw.js";import"./badge-DX3_GQsO.js";import"./access-gate-BZ6Xc62y.js";import"./capability-load-error-BtIV807c.js";function de(e){return`connect-banner-dismissed:${e}`}function et(e){if(typeof window>"u")return!0;try{return localStorage.getItem(de(e))==="1"}catch{return!1}}function tt(){const e=P.c(17),{org:t}=Z();let s;e[0]!==t.id?(s=()=>et(t.id),e[0]=t.id,e[1]=s):s=e[1];const[l,c]=Y.useState(s);if(l)return null;let a;e[2]!==t.id?(a=()=>{c(!0);try{localStorage.setItem(de(t.id),"1")}catch{}},e[2]=t.id,e[3]=a):a=e[3];const d=a;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Oe,{}),e[4]=m):m=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=o):o=e[5];let f;e[6]!==t.slug?(f={org:t.slug},e[6]=t.slug,e[7]=f):f=e[7];let n;e[8]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Ce,{size:12}),e[8]=n):n=e[8];let g;e[9]!==f?(g=i.jsx(ee,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ge,{to:"/$org/settings/connect",params:f,children:["Connect to clients ",n]})}),e[9]=f,e[10]=g):g=e[10];let r;e[11]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(De,{size:14}),e[11]=r):r=e[11];let u;e[12]!==d?(u=i.jsx(ee,{variant:"ghost",size:"icon",className:"size-7",onClick:d,"aria-label":"Dismiss",children:r}),e[12]=d,e[13]=u):u=e[13];let p;return e[14]!==g||e[15]!==u?(p=i.jsxs(ye,{variant:"info",className:"items-center",children:[m,i.jsxs(_e,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[o,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[g,u]})]})]}),e[14]=g,e[15]=u,e[16]=p):p=e[16],p}const it=ue({name:ne().min(1,"Name is required").max(255,"Name is too long"),logo:ne().optional()});function st(e){const t=P.c(17),{value:s,onChange:l,name:c,disabled:a}=e,d=G(),m=Y.useRef(null);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>m.current?.click(),t[0]=o):o=t[0];const f=o;let n;t[1]!==l||t[2]!==d?(n=O=>{const x=O.target.files?.[0];if(!x)return;if(x.size>2097152){F.error(d("settings.organizationForm.imageTooLarge"));return}const h=new FileReader;h.onerror=()=>F.error(d("settings.organizationForm.failedToReadImage")),h.onloadend=()=>{h.result&&l(h.result),m.current&&(m.current.value="")},h.readAsDataURL(x)},t[1]=l,t[2]=d,t[3]=n):n=t[3];const g=n;let r;t[4]!==d?(r=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=r):r=t[5];let u;t[6]!==a||t[7]!==g?(u=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:g,className:"hidden",disabled:a}),t[6]=a,t[7]=g,t[8]=u):u=t[8];const p=s||void 0,j=c??"?";let S;t[9]!==p||t[10]!==j?(S=i.jsx(Te,{url:p,fallback:j,shape:"square",size:"base"}),t[9]=p,t[10]=j,t[11]=S):S=t[11];let A;return t[12]!==a||t[13]!==r||t[14]!==u||t[15]!==S?(A=i.jsxs("button",{type:"button",onClick:f,disabled:a,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":r,children:[u,S]}),t[12]=a,t[13]=r,t[14]=u,t[15]=S,t[16]=A):A=t[16],A}function nt(){const e=G(),{org:t}=Z(),s=Ne(),l=fe(),c=pe({resolver:xe(it),values:{name:t.name??"",logo:t.logo??""}}),a=re({mutationFn:async n=>{const g={name:n.name};n.logo&&(g.logo=n.logo);const r=await s.organization.update({data:g});if(r?.error)throw new Error(r.error.message||e("settings.organizationForm.failedToUpdateOrg"));return r},onSuccess:(n,g)=>{te("organization_settings_updated",{organization_id:t.id,fields:Object.keys(g)}),l.invalidateQueries({queryKey:oe.organizations()}),l.invalidateQueries({queryKey:oe.activeOrganization(t.slug)}),F.success(e("settings.organizationForm.updateSuccess"))},onError:(n,g)=>{te("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(g),error:n instanceof Error?n.message:String(n)}),F.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:m}=we({save:async()=>{const n=c.control._formState.dirtyFields;if(Object.keys(n).length===0||!await c.trigger())return;const r=c.getValues(),u=c.control._defaultValues;c.reset(r,{keepValues:!0});try{await a.mutateAsync(r)}catch{c.reset(u,{keepValues:!0})}}}),o=c.formState.errors,f=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(ie,{children:i.jsxs(se,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(st,{value:c.watch("logo"),onChange:n=>{c.setValue("logo",n??"",{shouldDirty:!0}),m()},name:c.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(he,{control:c.control,name:"name",render:({field:n})=>i.jsx(le,{id:"org-name",...n,onChange:g=>{n.onChange(g),d()},onBlur:()=>{n.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[f&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:f}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(o.name||o.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[o.name&&i.jsx("p",{className:"text-xs text-destructive",children:o.name.message}),o.logo&&i.jsx("p",{className:"text-xs text-destructive",children:o.logo.message})]})]})})}const X="__super_agent__";function ot(){const e=P.c(42),t=G(),{org:s}=Z(),l=Re(),{mainAgentId:c}=$e(),a=Ue();let d,m,o,f,n,g,r,u;if(e[0]!==l||e[1]!==c||e[2]!==s.id||e[3]!==a||e[4]!==t){const S=Ve(l),A=(l??[]).filter(lt).filter(z=>!S.has(z.id)).filter(rt);let O;e[13]!==s.id?(O=Ie(s.id),e[13]=s.id,e[14]=O):O=e[14];const x=O,h=c!=null?(l??[]).find(z=>z.id===c):void 0,D=h?h.id:X,N=h&&!A.some(z=>z.id===h.id)?[h,...A]:A;let C;e[15]!==l||e[16]!==a||e[17]!==x.title||e[18]!==t?(C=z=>{const _=z===X?null:z,E=_===null?x.title:(l??[]).find(T=>T.id===_)?.title??"";a.mutate(_,{onSuccess:()=>F.success(_===null?t("settings.mainAgent.resetToast"):t("settings.mainAgent.setToast",{title:E})),onError:()=>F.error(t("settings.mainAgent.errorToast"))})},e[15]=l,e[16]=a,e[17]=x.title,e[18]=t,e[19]=C):C=e[19];const w=C;m=Fe,n=D,g=w,r=a.isPending,e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ke,{className:"w-full sm:w-[280px]",children:i.jsx(Pe,{})}),e[20]=u):u=e[20],d=Ee;let v;e[21]!==x.icon||e[22]!==x.title?(v=i.jsx(me,{icon:x.icon,name:x.title,size:"xs",className:"shrink-0"}),e[21]=x.icon,e[22]=x.title,e[23]=v):v=e[23];let b;e[24]!==t?(b=t("settings.mainAgent.superAgentOption"),e[24]=t,e[25]=b):b=e[25];let y;e[26]!==b?(y=i.jsx("span",{className:"truncate",children:b}),e[26]=b,e[27]=y):y=e[27],e[28]!==y||e[29]!==v?(o=i.jsx(ce,{value:X,children:i.jsxs("span",{className:"flex items-center gap-2",children:[v,y]})}),e[28]=y,e[29]=v,e[30]=o):o=e[30],f=N.map(at),e[0]=l,e[1]=c,e[2]=s.id,e[3]=a,e[4]=t,e[5]=d,e[6]=m,e[7]=o,e[8]=f,e[9]=n,e[10]=g,e[11]=r,e[12]=u}else d=e[5],m=e[6],o=e[7],f=e[8],n=e[9],g=e[10],r=e[11],u=e[12];let p;e[31]!==d||e[32]!==o||e[33]!==f?(p=i.jsxs(d,{children:[o,f]}),e[31]=d,e[32]=o,e[33]=f,e[34]=p):p=e[34];let j;return e[35]!==m||e[36]!==n||e[37]!==g||e[38]!==r||e[39]!==u||e[40]!==p?(j=i.jsxs(m,{value:n,onValueChange:g,disabled:r,children:[u,p]}),e[35]=m,e[36]=n,e[37]=g,e[38]=r,e[39]=u,e[40]=p,e[41]=j):j=e[41],j}function at(e){return i.jsx(ce,{value:e.id,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(me,{icon:e.icon,name:e.title,size:"xs",className:"shrink-0"}),i.jsx("span",{className:"truncate",children:e.title})]})},e.id)}function rt(e){return!Me(e.id)}function lt(e){return!Le(e.id)}function ct(){const e=P.c(16),t=G();let s;e[0]!==t?(s=t("settings.mainAgent.title"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==t?(l=t("settings.mainAgent.description"),e[2]=t,e[3]=l):l=e[3];let c;e[4]!==t?(c=t("settings.mainAgent.itemTitle"),e[4]=t,e[5]=c):c=e[5];let a;e[6]!==t?(a=t("settings.mainAgent.itemDescription"),e[6]=t,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Y.Suspense,{fallback:i.jsx(je,{className:"h-9 w-[280px]"}),children:i.jsx(ot,{})}),e[8]=d):d=e[8];let m;e[9]!==c||e[10]!==a?(m=i.jsx(se,{children:i.jsx(Q,{title:c,description:a,action:d})}),e[9]=c,e[10]=a,e[11]=m):m=e[11];let o;return e[12]!==s||e[13]!==l||e[14]!==m?(o=i.jsx(ie,{title:s,description:l,children:m}),e[12]=s,e[13]=l,e[14]=m,e[15]=o):o=e[15],o}function mt(){const e=P.c(86),t=G(),{org:s}=Z(),[l,c]=Y.useState(!1),[a,d]=Y.useState(""),m=Se();let o;e[0]!==s.id||e[1]!==m?(o=async()=>{await m.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=m,e[2]=o):o=e[2];let f;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(f=()=>{te("organization_deleted",{organization_id:s.id}),localStorage.getItem(ae.lastOrgSlug())===s.slug&&localStorage.removeItem(ae.lastOrgSlug()),ze()?.org===s.slug&&Ae(),ve(),F.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=f):f=e[6];let n;e[7]!==t?(n=k=>{F.error(k instanceof Error?k.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=n):n=e[8];let g;e[9]!==o||e[10]!==f||e[11]!==n?(g={mutationFn:o,onSuccess:f,onError:n},e[9]=o,e[10]=f,e[11]=n,e[12]=g):g=e[12];const r=re(g);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let p;e[15]!==t?(p=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=p):p=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let S;e[19]!==t?(S=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=S):S=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=()=>c(!0),e[21]=A):A=e[21];const O=r.isPending;let x;e[22]!==t?(x=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=x):x=e[23];let h;e[24]!==r.isPending||e[25]!==x?(h=i.jsx(ee,{variant:"destructive",size:"sm",onClick:A,disabled:O,children:x}),e[24]=r.isPending,e[25]=x,e[26]=h):h=e[26];let D;e[27]!==h||e[28]!==j||e[29]!==S?(D=i.jsx(se,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:S,action:h})}),e[27]=h,e[28]=j,e[29]=S,e[30]=D):D=e[30];let N;e[31]!==D||e[32]!==u||e[33]!==p?(N=i.jsx(ie,{title:u,description:p,children:D}),e[31]=D,e[32]=u,e[33]=p,e[34]=N):N=e[34];let C;e[35]===Symbol.for("react.memo_cache_sentinel")?(C=k=>{c(k),k||d("")},e[35]=C):C=e[35];let w;e[36]!==t?(w=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=w):w=e[37];let v;e[38]!==w?(v=i.jsx(Ke,{children:w}),e[38]=w,e[39]=v):v=e[39];let b;e[40]!==s.name||e[41]!==t?(b=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[40]=s.name,e[41]=t,e[42]=b):b=e[42];let y;e[43]!==b?(y=i.jsx("p",{children:b}),e[43]=b,e[44]=y):y=e[44];let z;e[45]!==s.name||e[46]!==t?(z=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[45]=s.name,e[46]=t,e[47]=z):z=e[47];let _;e[48]!==z?(_=i.jsx("p",{className:"mt-3 mb-1.5",children:z}),e[48]=z,e[49]=_):_=e[49];let E;e[50]===Symbol.for("react.memo_cache_sentinel")?(E=k=>d(k.target.value),e[50]=E):E=e[50];let T;e[51]!==a||e[52]!==s.name?(T=i.jsx(le,{value:a,onChange:E,placeholder:s.name,autoFocus:!0}),e[51]=a,e[52]=s.name,e[53]=T):T=e[53];let I;e[54]!==y||e[55]!==_||e[56]!==T?(I=i.jsx(Ge,{asChild:!0,children:i.jsxs("div",{children:[y,_,T]})}),e[54]=y,e[55]=_,e[56]=T,e[57]=I):I=e[57];let L;e[58]!==v||e[59]!==I?(L=i.jsxs(Qe,{children:[v,I]}),e[58]=v,e[59]=I,e[60]=L):L=e[60];let M;e[61]!==t?(M=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=M):M=e[62];let R;e[63]!==M?(R=i.jsx(Ye,{children:M}),e[63]=M,e[64]=R):R=e[64];let V;e[65]!==r?(V=()=>r.mutate(),e[65]=r,e[66]=V):V=e[66];const J=a!==s.name||r.isPending;let $;e[67]!==r.isPending||e[68]!==t?($=r.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=r.isPending,e[68]=t,e[69]=$):$=e[69];let U;e[70]!==V||e[71]!==J||e[72]!==$?(U=i.jsx(He,{onClick:V,disabled:J,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:$}),e[70]=V,e[71]=J,e[72]=$,e[73]=U):U=e[73];let q;e[74]!==R||e[75]!==U?(q=i.jsxs(We,{children:[R,U]}),e[74]=R,e[75]=U,e[76]=q):q=e[76];let B;e[77]!==L||e[78]!==q?(B=i.jsxs(Ze,{children:[L,q]}),e[77]=L,e[78]=q,e[79]=B):B=e[79];let K;e[80]!==l||e[81]!==B?(K=i.jsx(Je,{open:l,onOpenChange:C,children:B}),e[80]=l,e[81]=B,e[82]=K):K=e[82];let H;return e[83]!==N||e[84]!==K?(H=i.jsxs(i.Fragment,{children:[N,K]}),e[83]=N,e[84]=K,e[85]=H):H=e[85],H}function dt(){const e=P.c(12),t=G();let s;e[0]!==t?(s=t("settings.orgGeneral.organization"),e[0]=t,e[1]=s):s=e[1];let l;e[2]!==s?(l=i.jsx(W.Title,{children:s}),e[2]=s,e[3]=l):l=e[3];let c,a,d,m,o,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(tt,{}),a=i.jsx(nt,{}),d=i.jsx(ct,{}),m=i.jsx(qe,{}),o=i.jsx(Be,{}),f=i.jsx(mt,{}),e[4]=c,e[5]=a,e[6]=d,e[7]=m,e[8]=o,e[9]=f):(c=e[4],a=e[5],d=e[6],m=e[7],o=e[8],f=e[9]);let n;return e[10]!==l?(n=i.jsx(W,{children:i.jsx(W.Content,{children:i.jsx(W.Body,{children:i.jsxs(be,{children:[l,c,a,d,m,o,f]})})})}),e[10]=l,e[11]=n):n=e[11],n}function Ni(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Xe,{capability:"org:manage",area:"general settings",children:i.jsx(dt,{})}),e[0]=t):t=e[0],t}export{Ni as default};
@@ -1 +0,0 @@
1
- import{c as _,d as B,H as E,b as $,I as Pt,j as s,B as Ae,r as O,E as nt,J as Rt,z as zt,K as ot,e as Ee,q as L,M as U,R as it,U as Le,W as Ue,X as T,Y as F,n as M,Z as z,_ as P,$ as lt,a0 as Et,a1 as rt,a2 as Tt,a3 as at,a as me,a4 as Dt,x as ct,a5 as dt,t as mt,a6 as Ft,a7 as Lt,a8 as Ut,a9 as Bt,aa as Kt,ab as qt,ac as Wt,p as Ht,ad as Te,L as He,u as Gt,ae as Yt,O as Qt,af as Vt,ag as Xt,ah as Jt}from"./index-Ci8azyOE.js";import{a as Zt,p as ze,s as es,b as ts,n as ss}from"./self-tool-result-BSLlHbcp.js";import{f as ns,b as os,e as is,g as ls}from"./dialog-BI8UUwqv.js";import{c as rs,C as as,a as cs,O as ft,A as ds,u as ms,t as ut,S as fs,b as us,d as ps,e as xs}from"./super-agent-icon-DbGhAnlL.js";import{u as hs}from"./use-mcp-client-DP2onozC.js";import{C as bs,W as De,S as gs}from"./constants-dLUUoWH7.js";import{i as pt}from"./XCircle-CVbKXkpd.js";import{u as js,a as vs}from"./use-organization-settings-BAFLKQ3y.js";import{T as xt,a as ae}from"./toolbar-KH-9Bre4.js";import{P as ht,a as Be,b as bt}from"./popover-ClwD_xra.js";import{D as ys,a as Ss,b as _s}from"./drawer-BR22I8_f.js";import{A as $e}from"./avatar-D-QkiqIH.js";import{a as Ns}from"./Copy01-CsNpp9jr.js";import{n as Cs}from"./Download01-BN9BT9cL.js";import{i as ks,a as ws,b as Is,c as $s,t as gt,d as As,e as Ms,A as Os}from"./agent-icon-DCM1Bdl8.js";import{i as Ps}from"./Globe01-CV-16mwB.js";import{n as Rs}from"./LinkExternal01-CIL2SNWf.js";import{i as Ge}from"./LogOut01-qWWgaWbQ.js";import{i as zs}from"./Monitor01-uq-dlf-u.js";import{n as Es,a as Ts}from"./Sun-BBWjOwQE.js";import{a as fe}from"./Settings02-BMcJFHpd.js";import{i as Ds}from"./Shield01-C9M_jcOJ.js";import{t as Fs}from"./UserSquare-CwU4sG2o.js";import{a as Ls}from"./Users03-BUoBV4mB.js";import{u as Us}from"./use-deployment-admin-CQiRFTsL.js";import{u as Bs}from"./use-is-desktop-app-BNujXJc_.js";import{i as Ks,a as Ye,D as qs,u as Ws,b as Hs}from"./use-panel-navigate-BsVeEWlx.js";import{a as Gs,n as Ys}from"./ZapSquare-BZzRAQpm.js";import{I as jt}from"./invite-member-dialog-D8XHQ0du.js";import{n as Ke}from"./Stars02-DZNA1z2-.js";import{S as Qs}from"./scroll-area-RteS0-Yk.js";import{u as Vs}from"./useInfiniteQuery-DjjzlWAZ.js";import{n as Xs}from"./decopilot-sse-pool-BN-M5EUb.js";import{i as Js}from"./ChevronRight-DUmHQrD7.js";import{g as Zs}from"./get-initials-D-f_fDFw.js";import{a as en}from"./format-time-BnbuEtat.js";import{i as tn}from"./Share07-CPDrxQV8.js";import{u as sn}from"./use-virtual-mcp-Dj0wXB98.js";import{u as nn,T as on}from"./hooks-DQmp7LHz.js";import{g as ln,a as rn,b as an,c as cn}from"./agent-capabilities-B52k7xCe.js";import{u as vt,D as R}from"./use-destination-route-d8wgPDBu.js";import{S as yt}from"./use-navigate-to-agent-mrg2_DxJ.js";import{S as St,M as dn}from"./shell-controls-BMTxwot2.js";import{C as mn}from"./chat-context-CmwZXAhQ.js";import"./alert-dialog-Dh9zsaCy.js";import"./form-DauSI86Q.js";import"./label-C1OhLpvf.js";import"./input-Bwz-dTwg.js";import"./spinner-B9x-ViPH.js";import"./integration-icon-CGnrGZxM.js";import"./Tool02-jKKU1_dM.js";import"./extract-connection-data-6cVSTGuY.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./CheckCircle-teyxVGFp.js";import"./Check-D5PKBQ5I.js";import"./Eye-DgiSa7UT.js";import"./use-debounced-value-BENALn-i.js";import"./authenticate-and-persist-oauth-DY_hbkIG.js";import"./mcp-oauth-GWhqBwu1.js";import"./auth-D8IdOmGw.js";import"./track-DXtvDI_s.js";import"./ChevronDown-Csfjhwpm.js";import"./Plus-CPkR-QLd.js";import"./SearchMd-ClTH3fiN.js";import"./XClose-CTv0nnSb.js";import"./github-repo-picker-sKX6qrmQ.js";import"./collection-search-0N-i_PHL.js";import"./use-connection-gqhqm1hO.js";import"./ArrowLeft-BwagOJkb.js";import"./LockUnlocked01-BpeKJGM4.js";import"./use-mcp-tools-B7yHzu9T.js";import"./shell-layout-i3nUAnDL.js";import"./SearchLg-8daQliv2.js";import"./FilterLines-Db8-uWfr.js";import"./Zap-MbQ2aiA8.js";import"./required-auth-layout-CUQaC9Hr.js";import"./use-org-sso-C-uWWD5m.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./connection-card-B1T5pd1c.js";import"./use-registry-connections-DghvIzKh.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./connection-slug-CITJ0kGN.js";import"./select-C7Q2VGxk.js";import"./ChevronUp-Dlj_U0qV.js";import"./textarea-CMpN0SgX.js";import"./connection-form-helpers-CYKg-GvJ.js";import"./Trash01-Dp-QTpAR.js";import"./collection-tabs-PM6yowhG.js";import"./badge-DX3_GQsO.js";import"./use-infinite-scroll-Cw7R-QWe.js";import"./useSuspenseInfiniteQuery-Ci5SesMe.js";import"./use-ai-providers-DlWIkMD-.js";import"./task-board-Cz-fiaKF.js";import"./User01-DJ_BO2EX.js";import"./AlertCircle-BTlJp8pf.js";import"./Tool01-va49aYq9.js";import"./ArrowUp-CVoISkQ4.js";import"./TrendUp01-DikSDrNg.js";import"./ChevronSelectorVertical-CuAhXy3x.js";import"./DotsVertical-CpVcGDJ_.js";import"./CreditCard01-YCHpZ00A.js";import"./Globe04-D3O2XfOT.js";import"./SwitchHorizontal01-CSyGO1HX.js";import"./HardDrive-CWvDYc59.js";import"./Key01-D4srNqPO.js";import"./Palette-Cv68Zggp.js";import"./Play-C9xK8clC.js";import"./Stars01-BzEDQnsl.js";import"./Upload01-DxCHPffq.js";import"./Users01-B2wc_Wgl.js";import"./use-org-auth-client-HXTuHVWD.js";import"./use-organization-roles-CQ2UVvkm.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-CqU7DunK.js";function fn(t){const e=_.c(21),{siteUrl:n}=t,i=B(),{org:o}=E(),l=$();let r;e[0]!==i||e[1]!==o?(r=()=>{localStorage.setItem(Pt.sidebarOpen(),JSON.stringify(!1)),i({...rs(o,De.COMMERCE_DISCOVERY(o.id)),search:{connection:De.COMMERCE_DISCOVERY(o.id),tool:bs,sidepanel:!1}})},e[0]=i,e[1]=o,e[2]=r):r=e[2];const a=r;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ns,{className:"bg-black/15 backdrop-blur-sm"}),e[3]=d):d=e[3];let c;e[4]!==l?(c=l("routes.commerceOnboarding.connectModal.dialogTitle"),e[4]=l,e[5]=c):c=e[5];let f;e[6]!==c?(f=s.jsx(os,{className:"sr-only",children:c}),e[6]=c,e[7]=f):f=e[7];let m;e[8]!==a||e[9]!==l?(m=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:l("routes.commerceOnboarding.connectModal.loadError")}),s.jsxs(Ae,{type:"button",size:"xl",className:"w-full",onClick:a,children:[l("routes.commerceOnboarding.connectModal.continueButton"),s.jsx(pt,{size:18})]})]}),e[8]=a,e[9]=l,e[10]=m):m=e[10];let p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Zt,{}),e[11]=p):p=e[11];let u;e[12]!==a||e[13]!==n?(u=s.jsx(O.Suspense,{fallback:p,children:s.jsx(hn,{siteUrlFromUrl:n,onComplete:a})}),e[12]=a,e[13]=n,e[14]=u):u=e[14];let x;e[15]!==m||e[16]!==u?(x=s.jsx(nt,{fallback:m,children:u}),e[15]=m,e[16]=u,e[17]=x):x=e[17];let h;return e[18]!==f||e[19]!==x?(h=s.jsx(is,{open:!0,children:s.jsxs(ls,{children:[d,s.jsxs(Rt,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:xn,onPointerDownOutside:pn,onInteractOutside:un,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[f,x]})]})}),e[18]=f,e[19]=x,e[20]=h):h=e[20],h}function un(t){return t.preventDefault()}function pn(t){return t.preventDefault()}function xn(t){return t.preventDefault()}function hn({siteUrlFromUrl:t,onComplete:e}){const n=$(),{org:i}=E(),o=De.COMMERCE_DISCOVERY(i.id),l=hs({connectionId:gs,orgId:i.id,orgSlug:i.slug}),a=zt({queryKey:ot.commerceDiscoveryConnection(i.id,o),queryFn:async()=>{const v=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return ze(v)},retry:!1}).data.item,d=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||d,f=es(c),[m,p]=O.useState(!0),[u,x]=O.useState(null),h=Ee({mutationFn:async v=>ze(await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:v}})),retry:!1}),g=Ee({mutationFn:async v=>ze(await l.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:v}})),retry:!1}),b=async()=>{x(null),L("commerce_onboarding_open_report_clicked",{domain:f??void 0,organization_id:i.id});const v=c?ss(c):null;if(v?.ok)try{let y=await g.mutateAsync(v.value);if(y.triggered||(L("commerce_onboarding_run_reclaim",{domain:f??void 0,organization_id:i.id,reason:y.reason??"not_upgraded"}),await h.mutateAsync(v.value),y=await g.mutateAsync(v.value)),!y.triggered){L("commerce_onboarding_run_failed",{domain:f??void 0,organization_id:i.id,error:y.reason??"not_triggered"}),x(n("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(y){L("commerce_onboarding_run_failed",{domain:f??void 0,organization_id:i.id,error:y instanceof Error?y.message:String(y)}),x(n("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}e()},j=js("demo_mode"),S=m||j;return s.jsx(as,{siteHost:f,footer:s.jsxs(s.Fragment,{children:[u?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:u}):null,s.jsxs("div",{className:"flex gap-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(cs,{ready:S,pending:g.isPending,label:g.isPending?n("routes.commerceOnboarding.connectModal.openingReport"):n("routes.commerceOnboarding.connectModal.viewDiagnostic"),onClick:()=>{b()},children:s.jsx(pt,{size:18})})}),S?null:s.jsx(Ae,{type:"button",variant:"secondary",size:"lg",className:"h-auto min-h-12 shrink-0 rounded-lg py-3 text-base font-medium leading-tight",disabled:g.isPending,onClick:()=>{b()},children:n("routes.commerceOnboarding.connectModal.skip")})]})]}),children:s.jsx(ts,{org:i,cdConnectionId:o,siteUrl:c,onReadinessChange:p})})}function bn(t){const e=_.c(11),{onPointerDown:n,onDoubleClick:i}=t,o=$(),{state:l,isMobile:r}=U();if(r||l==="collapsed")return null;let a;e[0]!==o?(a=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==o?(d=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=d):d=e[3];let c,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={left:"var(--sidebar-width)"},f=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[4]=c,e[5]=f):(c=e[4],f=e[5]);let m;return e[6]!==i||e[7]!==n||e[8]!==a||e[9]!==d?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a,title:d,onPointerDown:n,onDoubleClick:i,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:c,children:f}),e[6]=i,e[7]=n,e[8]=a,e[9]=d,e[10]=m):m=e[10],m}const qe=240,gn=400,jn="sidebar.width";function de(t){return Math.max(qe,Math.min(gn,t))}function vn(){const t=_.c(11),[e,n]=it(jn,yn),i=O.useRef(null);let o;t[0]!==n||t[1]!==e?(o=f=>{f.preventDefault();const m=f.clientX,p=de(e),u=i.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=u?Array.from(u.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const h=b=>{const j=de(p+(b.clientX-m));u?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=de(p+(b.clientX-m));n(j);for(const S of x)S.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const l=o;let r;t[3]!==n?(r=()=>{n(qe)},t[3]=n,t[4]=r):r=t[4];const a=r;let d;t[5]!==e?(d=de(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==l||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:i,onStartResize:l,resetWidth:a},t[7]=l,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function yn(t){return typeof t=="number"?de(t):qe}function _t(){return[]}function Nt(t){const e=_.c(3),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=s.jsxs(Le,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[i,s.jsx(Ue,{children:s.jsx(T,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Ct(t){const e=_.c(18),{item:n}=t,{isMobile:i,setOpenMobile:o}=U();let l;e[0]!==i||e[1]!==n||e[2]!==o?(l=()=>{L("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:i}),n.onClick?.(),i&&o(!1)},e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3];const r=l,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=M(d),e[4]=d,e[5]=c):c=e[5];let f;e[6]!==n.label?(f=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=f):f=e[7];let m;e[8]!==r||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==f?(m=s.jsxs(z,{onClick:r,isActive:n.isActive,tooltip:n.label,children:[n.icon,f]}),e[8]=r,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=f,e[13]=m):m=e[13];let p;return e[14]!==n.key||e[15]!==c||e[16]!==m?(p=s.jsx(P,{className:c,children:m},a),e[14]=n.key,e[15]=c,e[16]=m,e[17]=p):p=e[17],p}function Sn(t){const e=_.c(12),{section:n}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(lt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,o=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(Nn),e[2]=n.group.items,e[3]=l):l=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(r=s.jsx(Nt,{label:i,defaultExpanded:o,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=r):r=e[7],r}case"items":{let i;e[8]!==n.items?(i=n.items.map(_n),e[8]=n.items,e[9]=i):i=e[9];let o;return e[10]!==i?(o=s.jsx(Le,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ue,{children:s.jsx(T,{className:"gap-1.5",children:i})})}),e[10]=i,e[11]=o):o=e[11],o}case"custom":return n.content}}function _n(t){return s.jsx(Ct,{item:t},t.key)}function Nn(t){return s.jsx(Ct,{item:t},t.key)}function Cn(t){const e=_.c(17),{sections:n,footer:i,additionalContent:o,header:l,variant:r,contentClassName:a}=t,d=r===void 0?"sidebar":r;let c;e[0]!==l?(c=l&&s.jsx(Et,{className:"shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:l}),e[0]=l,e[1]=c):c=e[1];let f;e[2]!==a?(f=M("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=f):f=e[3];let m;e[4]!==n?(m=n.map(kn),e[4]=n,e[5]=m):m=e[5];let p;e[6]!==o?(p=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[6]=o,e[7]=p):p=e[7];let u;e[8]!==f||e[9]!==m||e[10]!==p?(u=s.jsxs(rt,{className:f,children:[m,p]}),e[8]=f,e[9]=m,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==i||e[13]!==c||e[14]!==u||e[15]!==d?(x=s.jsxs(Tt,{variant:d,children:[c,u,i]}),e[12]=i,e[13]=c,e[14]=u,e[15]=d,e[16]=x):x=e[16],x}function kn(t,e){return s.jsx(Sn,{section:t},e)}function kt(t){const e=_.c(2);let n;return e[0]!==t?(n=s.jsx(Cn,{...t}),e[0]=t,e[1]=n):n=e[1],n}kt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(F,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Qe(t){const e=_.c(18),{item:n,onClose:i}=t,o=n.isActive&&"z-10";let l;e[0]!==o?(l=M(o),e[0]=o,e[1]=l):l=e[1];let r;e[2]!==n||e[3]!==i?(r=()=>{n.onClick?.(),i()},e[2]=n,e[3]=i,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==r||e[12]!==a||e[13]!==d?(c=s.jsxs(z,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=r,e[12]=a,e[13]=d,e[14]=c):c=e[14];let f;return e[15]!==l||e[16]!==c?(f=s.jsx(P,{className:l,children:c}),e[15]=l,e[16]=c,e[17]=f):f=e[17],f}function wn(t){const e=_.c(18),{section:n,onClose:i}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(lt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,l=n.group.defaultExpanded;let r;if(e[2]!==i||e[3]!==n.group.items){let d;e[5]!==i?(d=c=>s.jsx(Qe,{item:c,onClose:i},c.key),e[5]=i,e[6]=d):d=e[6],r=n.group.items.map(d),e[2]=i,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(Nt,{label:o,defaultExpanded:l,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==i||e[12]!==n.items){let r;e[14]!==i?(r=a=>s.jsx(Qe,{item:a,onClose:i},a.key),e[14]=i,e[15]=r):r=e[15],o=n.items.map(r),e[11]=i,e[12]=n.items,e[13]=o}else o=e[13];let l;return e[16]!==o?(l=s.jsx(Le,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ue,{children:s.jsx(T,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=l):l=e[17],l}case"custom":return n.content}}function In(t){const e=_.c(27),{sections:n,onClose:i,footer:o,additionalContent:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ft,{}),e[0]=r):r=e[0];let a;e[1]!==i?(a=s.jsx(ds,{onNavigate:i}),e[1]=i,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1"}),e[3]=d):d=e[3];const c=$();let f;e[4]!==c?(f=c("sidebar.navigationMobile.closeSidebar"),e[4]=c,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(at,{size:16}),e[6]=m):m=e[6];let p;e[7]!==i||e[8]!==f?(p=s.jsx(xt,{onClick:i,"aria-label":f,children:m}),e[7]=i,e[8]=f,e[9]=p):p=e[9];let u;e[10]!==a||e[11]!==p?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[r,a,d,p]}),e[10]=a,e[11]=p,e[12]=u):u=e[12];let x;if(e[13]!==i||e[14]!==n){let j;e[16]!==i?(j=(S,v)=>s.jsx(wn,{section:S,onClose:i},v),e[16]=i,e[17]=j):j=e[17],x=n.map(j),e[13]=i,e[14]=n,e[15]=x}else x=e[15];let h;e[18]!==l?(h=l&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:l}),e[18]=l,e[19]=h):h=e[19];let g;e[20]!==h||e[21]!==x?(g=s.jsxs(rt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[x,h]}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let b;return e[23]!==o||e[24]!==g||e[25]!==u?(b=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,g,o]}),e[23]=o,e[24]=g,e[25]=u,e[26]=b):b=e[26],b}function ce(t){const e=_.c(26),{item:n,onClose:i}=t;let o;e[0]!==n.className?(o=M("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=o):o=e[1];const l=o;if(n.href){const f=n.external?"_blank":void 0,m=n.external?"noopener noreferrer":void 0;let p;e[2]!==n.icon?(p=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=p):p=e[3];let u;e[4]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=u):u=e[5];let x;return e[6]!==l||e[7]!==n.href||e[8]!==i||e[9]!==f||e[10]!==m||e[11]!==p||e[12]!==u?(x=s.jsxs("a",{href:n.href,target:f,rel:m,className:l,onClick:i,children:[p,u]}),e[6]=l,e[7]=n.href,e[8]=i,e[9]=f,e[10]=m,e[11]=p,e[12]=u,e[13]=x):x=e[13],x}let r;e[14]!==n||e[15]!==i?(r=()=>{n.onClick?.(),i()},e[14]=n,e[15]=i,e[16]=r):r=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let d;e[19]!==n.label?(d=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=d):d=e[20];let c;return e[21]!==l||e[22]!==r||e[23]!==a||e[24]!==d?(c=s.jsxs("button",{type:"button",onClick:r,className:l,children:[a,d]}),e[21]=l,e[22]=r,e[23]=a,e[24]=d,e[25]=c):c=e[25],c}function $n(){const t=_.c(4),e=$();let n;t[0]!==e?(n=e("common.accountPopover.impersonating"),t[0]=e,t[1]=n):n=t[1];let i;return t[2]!==n?(i=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:n}),t[2]=n,t[3]=i):i=t[3],i}function Ve(t){const e=_.c(38),{user:n,userImage:i,isImpersonating:o,isMobile:l}=t,r=$(),a=l?"py-4 border-b border-border":"py-3 mx-1 mt-1";let d;e[0]!==a?(d=M("flex items-center gap-3 px-4",a),e[0]=a,e[1]=d):d=e[1];const c=n?.name??"U";let f;e[2]!==c||e[3]!==i?(f=s.jsx($e,{url:i,fallback:c,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=c,e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==n?.name?(m=n?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=n?.name,e[7]=m):m=e[7];let p;e[8]!==m?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:m}),e[8]=m,e[9]=p):p=e[9];let u;e[10]!==o?(u=o&&s.jsx($n,{}),e[10]=o,e[11]=u):u=e[11];let x;e[12]!==p||e[13]!==u?(x=s.jsxs("div",{className:"flex items-center gap-2",children:[p,u]}),e[12]=p,e[13]=u,e[14]=x):x=e[14];const h=n?.email;let g;e[15]!==h?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[15]=h,e[16]=g):g=e[16];let b;e[17]!==g||e[18]!==x?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,g]}),e[17]=g,e[18]=x,e[19]=b):b=e[19];let j;e[20]!==r||e[21]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{mt.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=n,e[22]=j):j=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ns,{size:14}),e[23]=S):S=e[23];let v;e[24]!==j?(v=s.jsx(Ut,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[24]=j,e[25]=v):v=e[25];let y;e[26]!==r?(y=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=y):y=e[27];let N;e[28]!==y?(N=s.jsx(Bt,{side:"right",children:s.jsx("p",{className:"text-xs",children:y})}),e[28]=y,e[29]=N):N=e[29];let k;e[30]!==v||e[31]!==N?(k=s.jsx(Kt,{delayDuration:300,children:s.jsxs(qt,{children:[v,N]})}),e[30]=v,e[31]=N,e[32]=k):k=e[32];let C;return e[33]!==b||e[34]!==k||e[35]!==d||e[36]!==f?(C=s.jsxs("div",{className:d,children:[f,b,k]}),e[33]=b,e[34]=k,e[35]=d,e[36]=f,e[37]=C):C=e[37],C}function Xe(t){const e=_.c(35),{themeOptions:n,preferences:i,setPreferences:o,isMobile:l}=t,r=$(),a=l?"size-8":"size-7",d=l?"px-3 py-3":"px-2 py-1.5";let c;e[0]!==d?(c=M("flex items-center justify-between border-t border-border/50",d),e[0]=d,e[1]=c):c=e[1];let f;if(e[2]!==a||e[3]!==i.theme||e[4]!==o||e[5]!==n){let y;e[7]!==a||e[8]!==i.theme||e[9]!==o?(y=N=>{const{value:k,icon:C,label:w}=N;return s.jsx("button",{type:"button","aria-label":w,onClick:()=>o(I=>({...I,theme:k})),className:M(a,"rounded-md flex items-center justify-center transition-colors",i.theme===k?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:C},k)},e[7]=a,e[8]=i.theme,e[9]=o,e[10]=y):y=e[10],f=n.map(y),e[2]=a,e[3]=i.theme,e[4]=o,e[5]=n,e[6]=f}else f=e[6];let m;e[11]!==f?(m=s.jsx("div",{className:"flex items-center gap-0.5",children:f}),e[11]=f,e[12]=m):m=e[12];let p;e[13]!==i.enableSounds||e[14]!==r?(p=i.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=i.enableSounds,e[14]=r,e[15]=p):p=e[15];let u;e[16]!==o?(u=()=>o(An),e[16]=o,e[17]=u):u=e[17];const x=i.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let h;e[18]!==a||e[19]!==x?(h=M(a,"rounded-md flex items-center justify-center transition-colors",x),e[18]=a,e[19]=x,e[20]=h):h=e[20];let g;e[21]!==i.enableSounds?(g=i.enableSounds?s.jsx(ws,{size:14}):s.jsx(Is,{size:14}),e[21]=i.enableSounds,e[22]=g):g=e[22];let b;e[23]!==p||e[24]!==u||e[25]!==h||e[26]!==g?(b=s.jsx("button",{type:"button","aria-label":p,onClick:u,className:h,children:g}),e[23]=p,e[24]=u,e[25]=h,e[26]=g,e[27]=b):b=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.308.0"]}),e[28]=j):j=e[28];let S;e[29]!==b?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[b,j]}),e[29]=b,e[30]=S):S=e[30];let v;return e[31]!==S||e[32]!==c||e[33]!==m?(v=s.jsxs("div",{className:c,children:[m,S]}),e[31]=S,e[32]=c,e[33]=m,e[34]=v):v=e[34],v}function An(t){return{...t,enableSounds:!t.enableSounds}}function Je(t){const e=_.c(54),{user:n,userImage:i,menuItems:o,signOutItem:l,stopImpersonatingItem:r,isImpersonating:a,themeOptions:d,preferences:c,setPreferences:f,close:m,isMobile:p}=t;if(p){let v;e[0]!==a||e[1]!==n||e[2]!==i?(v=s.jsx(Ve,{user:n,userImage:i,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=i,e[3]=v):v=e[3];let y;if(e[4]!==m||e[5]!==o){let A;e[7]!==m?(A=D=>s.jsx(ce,{item:D,onClose:m},D.key),e[7]=m,e[8]=A):A=e[8],y=o.map(A),e[4]=m,e[5]=o,e[6]=y}else y=e[6];let N;e[9]!==m||e[10]!==r?(N=r&&s.jsx(ce,{item:r,onClose:m}),e[9]=m,e[10]=r,e[11]=N):N=e[11];let k;e[12]!==m||e[13]!==l?(k=s.jsx(ce,{item:l,onClose:m}),e[12]=m,e[13]=l,e[14]=k):k=e[14];let C;e[15]!==y||e[16]!==N||e[17]!==k?(C=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[y,N,k]})}),e[15]=y,e[16]=N,e[17]=k,e[18]=C):C=e[18];let w;e[19]!==c||e[20]!==f||e[21]!==d?(w=s.jsx(Xe,{themeOptions:d,preferences:c,setPreferences:f,isMobile:!0}),e[19]=c,e[20]=f,e[21]=d,e[22]=w):w=e[22];let I;return e[23]!==v||e[24]!==C||e[25]!==w?(I=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v,C,w]}),e[23]=v,e[24]=C,e[25]=w,e[26]=I):I=e[26],I}let u;e[27]!==a||e[28]!==n||e[29]!==i?(u=s.jsx(Ve,{user:n,userImage:i,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=i,e[30]=u):u=e[30];let x;if(e[31]!==m||e[32]!==o){let v;e[34]!==m?(v=y=>s.jsx(ce,{item:y,onClose:m},y.key),e[34]=m,e[35]=v):v=e[35],x=o.map(v),e[31]=m,e[32]=o,e[33]=x}else x=e[33];let h;e[36]!==m||e[37]!==r?(h=r&&s.jsx(ce,{item:r,onClose:m}),e[36]=m,e[37]=r,e[38]=h):h=e[38];let g;e[39]!==m||e[40]!==l?(g=s.jsx(ce,{item:l,onClose:m}),e[39]=m,e[40]=l,e[41]=g):g=e[41];let b;e[42]!==x||e[43]!==h||e[44]!==g?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[x,h,g]}),e[42]=x,e[43]=h,e[44]=g,e[45]=b):b=e[45];let j;e[46]!==c||e[47]!==f||e[48]!==d?(j=s.jsx(Xe,{themeOptions:d,preferences:c,setPreferences:f,isMobile:!1}),e[46]=c,e[47]=f,e[48]=d,e[49]=j):j=e[49];let S;return e[50]!==u||e[51]!==b||e[52]!==j?(S=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[u,b,j]})}),e[50]=u,e[51]=b,e[52]=j,e[53]=S):S=e[53],S}function Fe(){const t=_.c(107),e=$(),{data:n}=me.useSession(),{org:i}=E(),o=B();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org",shouldThrow:!1},t[0]=l):l=t[0];const a=Dt(l)?.params.org,[d,c]=ct(),f=dt(),{isAdmin:m}=Us(),p=Bs(),[u,x]=O.useState(!1),[h,g]=O.useState(!1),b=n?.user,j=b?.image,S=!!n?.session?.impersonatedBy;let v;t[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>x(!1),t[1]=v):v=t[1];const y=v;let N;t[2]!==e?(N=e("common.accountPopover.preferences"),t[2]=e,t[3]=N):N=t[3];let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(fe,{size:16}),t[4]=k):k=t[4];let C;t[5]!==o||t[6]!==a?(C=()=>{o({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=o,t[6]=a,t[7]=C):C=t[7];let w;t[8]!==N||t[9]!==C?(w={key:"preferences",label:N,icon:k,onClick:C},t[8]=N,t[9]=C,t[10]=w):w=t[10];let I;t[11]!==i||t[12]!==o?(I=i?[{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(Rs,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:i.slug}})}}]:[],t[11]=i,t[12]=o,t[13]=I):I=t[13];let A;t[14]!==p||t[15]!==e?(A=(Ks()||Ye())&&!p?[{key:"install-desktop-app",label:Ye()?e("downloadApp.installOnLinux"):e("downloadApp.installOnMac"),icon:s.jsx(Cs,{size:16}),onClick:()=>g(!0)}]:[],t[14]=p,t[15]=e,t[16]=A):A=t[16];let D;t[17]!==e?(D=e("common.accountPopover.termsOfUse"),t[17]=e,t[18]=D):D=t[18];let ue;t[19]===Symbol.for("react.memo_cache_sentinel")?(ue=s.jsx(ks,{size:16}),t[19]=ue):ue=t[19];let K;t[20]!==D?(K={key:"terms",label:D,icon:ue,href:"https://www.decocms.com/terms-of-use",external:!0},t[20]=D,t[21]=K):K=t[21];let q;t[22]!==e?(q=e("common.accountPopover.privacyPolicy"),t[22]=e,t[23]=q):q=t[23];let pe;t[24]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Ds,{size:16}),t[24]=pe):pe=t[24];let W;t[25]!==q?(W={key:"privacy",label:q,icon:pe,href:"https://www.decocms.com/privacy-policy",external:!0},t[25]=q,t[26]=W):W=t[26];let H;t[27]!==e?(H=e("common.accountPopover.githubRepo"),t[27]=e,t[28]=H):H=t[28];let xe;t[29]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(Ft,{className:"w-4 h-4"}),t[29]=xe):xe=t[29];let G;t[30]!==H?(G={key:"github",label:H,icon:xe,href:"https://github.com/decocms/studio",external:!0},t[30]=H,t[31]=G):G=t[31];let Y;t[32]!==e?(Y=e("common.accountPopover.community"),t[32]=e,t[33]=Y):Y=t[33];let he;t[34]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(Ls,{size:16}),t[34]=he):he=t[34];let Q;t[35]!==Y?(Q={key:"community",label:Y,icon:he,href:"https://decocms.com/discord",external:!0},t[35]=Y,t[36]=Q):Q=t[36];let V;t[37]!==e?(V=e("common.accountPopover.homepage"),t[37]=e,t[38]=V):V=t[38];let be;t[39]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(Ps,{size:16}),t[39]=be):be=t[39];let X;t[40]!==V?(X={key:"homepage",label:V,icon:be,href:"https://decocms.com",external:!0},t[40]=V,t[41]=X):X=t[41];let J;t[42]!==m||t[43]!==o||t[44]!==e?(J=m?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(Fs,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[42]=m,t[43]=o,t[44]=e,t[45]=J):J=t[45];let ge;t[46]!==K||t[47]!==W||t[48]!==G||t[49]!==Q||t[50]!==X||t[51]!==J||t[52]!==w||t[53]!==I||t[54]!==A?(ge=[w,...I,...A,K,W,G,Q,X,...J],t[46]=K,t[47]=W,t[48]=G,t[49]=Q,t[50]=X,t[51]=J,t[52]=w,t[53]=I,t[54]=A,t[55]=ge):ge=t[55];const Me=ge;let Z;t[56]!==e?(Z=e("common.accountPopover.signOut"),t[56]=e,t[57]=Z):Z=t[57];let je;t[58]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(Ge,{size:16}),t[58]=je):je=t[58];let ve;t[59]!==Z?(ve={key:"logout",label:Z,icon:je,onClick:On},t[59]=Z,t[60]=ve):ve=t[60];const Oe=ve;let ye;t[61]!==S||t[62]!==e?(ye=S?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(Ge,{size:16}),onClick:async()=>{const{error:We}=await me.admin.stopImpersonating();if(We){mt.error(We.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[61]=S,t[62]=e,t[63]=ye):ye=t[63];const Pe=ye;let Se;t[64]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Es,{size:14}),t[64]=Se):Se=t[64];let ee;t[65]!==e?(ee=e("common.accountPopover.lightTheme"),t[65]=e,t[66]=ee):ee=t[66];let te;t[67]!==ee?(te={value:"light",icon:Se,label:ee},t[67]=ee,t[68]=te):te=t[68];let _e;t[69]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(Ts,{size:14}),t[69]=_e):_e=t[69];let se;t[70]!==e?(se=e("common.accountPopover.darkTheme"),t[70]=e,t[71]=se):se=t[71];let ne;t[72]!==se?(ne={value:"dark",icon:_e,label:se},t[72]=se,t[73]=ne):ne=t[73];let Ne;t[74]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(zs,{size:14}),t[74]=Ne):Ne=t[74];let oe;t[75]!==e?(oe=e("common.accountPopover.systemTheme"),t[75]=e,t[76]=oe):oe=t[76];let ie;t[77]!==oe?(ie={value:"system",icon:Ne,label:oe},t[77]=oe,t[78]=ie):ie=t[78];let Ce;t[79]!==te||t[80]!==ne||t[81]!==ie?(Ce=[te,ne,ie],t[79]=te,t[80]=ne,t[81]=ie,t[82]=Ce):Ce=t[82];const Re=Ce;let ke;t[83]!==S||t[84]!==f||t[85]!==Me||t[86]!==d||t[87]!==c||t[88]!==Oe||t[89]!==Pe||t[90]!==Re||t[91]!==b||t[92]!==j?(ke={user:b,userImage:j,menuItems:Me,signOutItem:Oe,stopImpersonatingItem:Pe,isImpersonating:S,themeOptions:Re,preferences:d,setPreferences:c,close:y,isMobile:f},t[83]=S,t[84]=f,t[85]=Me,t[86]=d,t[87]=c,t[88]=Oe,t[89]=Pe,t[90]=Re,t[91]=b,t[92]=j,t[93]=ke):ke=t[93];const we=ke;let le;t[94]!==S||t[95]!==f||t[96]!==u||t[97]!==we||t[98]!==e||t[99]!==b?.name||t[100]!==j?(le=f?s.jsxs(ys,{open:u,onOpenChange:x,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>x(!0),className:M("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",S&&"border-2 border-dashed border-warning"),children:[s.jsx($e,{url:j,fallback:b?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:b?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(Ss,{className:"h-[80dvh] p-0",children:[s.jsx(_s,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx(Je,{...we})]})]}):s.jsxs(ht,{open:u,onOpenChange:x,children:[s.jsx(Be,{asChild:!0,children:s.jsxs(z,{tooltip:b?.name??e("common.accountPopover.defaultAccountLabel"),className:M("rounded-md",S&&"border-2 border-dashed border-warning"),children:[s.jsx($e,{url:j,fallback:b?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:b?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(bt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Mn,children:s.jsx(Je,{...we})})]}),t[94]=S,t[95]=f,t[96]=u,t[97]=we,t[98]=e,t[99]=b?.name,t[100]=j,t[101]=le):le=t[101];let re;t[102]!==h?(re=s.jsx(qs,{open:h,onOpenChange:g}),t[102]=h,t[103]=re):re=t[103];let Ie;return t[104]!==le||t[105]!==re?(Ie=s.jsxs(s.Fragment,{children:[le,re]}),t[104]=le,t[105]=re,t[106]=Ie):Ie=t[106],Ie}function Mn(t){return t.preventDefault()}function On(){L("signed_out",{source:"account_popover"}),Lt(),me.signOut()}class Pn extends O.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Rn(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function zn(){const t=_.c(17),e=B(),{org:n}=E(),{hasDecoKey:i,balanceDollars:o}=ms();if(!i)return null;let l;t[0]!==o?(l=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=l):l=t[1];let r;t[2]!==o?(r=M(o!=null&&Rn(o)),t[2]=o,t[3]=r):r=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx($s,{}),t[7]=d):d=t[7];let c;t[8]!==o?(c=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=c):c=t[9];let f;t[10]!==c?(f=s.jsx("span",{children:c}),t[10]=c,t[11]=f):f=t[11];let m;return t[12]!==l||t[13]!==r||t[14]!==a||t[15]!==f?(m=s.jsx(T,{children:s.jsx(P,{children:s.jsxs(z,{tooltip:l,className:r,onClick:a,children:[d,f]})})}),t[12]=l,t[13]=r,t[14]=a,t[15]=f,t[16]=m):m=t[16],m}function Ze(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Pn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(zn,{})})}),t[0]=e):e=t[0],e}const En=6e4;function Tn(t,e){return t.call("NOTIFICATION_LIST",e?{cursor:e}:{})}function Dn(t,e){if(!t)return t;const n=e?new Set(e):null;let i=0;const o=t.pages.map(r=>{const a=r.notifications.filter(d=>n&&!n.has(d.id)?!0:(i++,!1));return{...r,notifications:a}}),l=n?Math.max(0,(t.pages[0]?.unreadCount??0)-i):0;return{...t,pages:o.map(r=>({...r,unreadCount:l}))}}function Fn(t,e){const n=_.c(4),{data:i}=me.useSession(),o=i?.user?.id;let l;n[0]!==e||n[1]!==t||n[2]!==o?(l=r=>!t||!o?Bn:Xs.subscribe(t,d=>{try{if(JSON.parse(d.data).subject!==o)return}catch{return}e(),r()},e),n[0]=e,n[1]=t,n[2]=o,n[3]=l):l=n[3],O.useSyncExternalStore(l,Un,Ln)}function Ln(){return 0}function Un(){return 0}function Bn(){}function wt(){const t=_.c(37),{locator:e,org:n}=E(),i=Wt(),o=Ht();let l;t[0]!==e?(l=ot.notifications(e),t[0]=e,t[1]=l):l=t[1];const r=l;let a;t[2]!==i?(a=C=>{const{pageParam:w}=C;return Tn(i,w)},t[2]=i,t[3]=a):a=t[3];let d;t[4]!==r||t[5]!==a?(d={queryKey:r,queryFn:a,initialPageParam:void 0,getNextPageParam:Wn,refetchInterval:En},t[4]=r,t[5]=a,t[6]=d):d=t[6];const c=Vs(d);let f;t[7]!==o||t[8]!==r?(f=()=>o.invalidateQueries({queryKey:r,refetchType:"active"}),t[7]=o,t[8]=r,t[9]=f):f=t[9],Fn(n.slug,f);let m;t[10]!==i?(m=C=>i.call("NOTIFICATION_MARK_READ",C?{ids:C}:{}),t[10]=i,t[11]=m):m=t[11];let p,u;t[12]!==o||t[13]!==r?(p=async C=>{await o.cancelQueries({queryKey:r}),o.setQueryData(r,w=>Dn(w,C))},u=()=>o.invalidateQueries({queryKey:r}),t[12]=o,t[13]=r,t[14]=p,t[15]=u):(p=t[14],u=t[15]);let x;t[16]!==m||t[17]!==p||t[18]!==u?(x={mutationFn:m,onMutate:p,onSettled:u},t[16]=m,t[17]=p,t[18]=u,t[19]=x):x=t[19];const h=Ee(x);let g;t[20]!==c.data?.pages?(g=c.data?.pages??[],t[20]=c.data?.pages,t[21]=g):g=t[21];const b=g;let j;t[22]!==b?(j=b.flatMap(Kn),t[22]=b,t[23]=j):j=t[23];const S=b[0]?.unreadCount??0;let v;t[24]!==c?(v=()=>{c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},t[24]=c,t[25]=v):v=t[25];let y,N;t[26]!==h?(y=()=>h.mutate(null),N=C=>h.mutate([C]),t[26]=h,t[27]=y,t[28]=N):(y=t[27],N=t[28]);let k;return t[29]!==c.hasNextPage||t[30]!==c.isFetchingNextPage||t[31]!==S||t[32]!==v||t[33]!==y||t[34]!==N||t[35]!==j?(k={updates:j,redDotCount:S,hasMore:c.hasNextPage,isFetchingMore:c.isFetchingNextPage,fetchMore:v,markAllRead:y,markRead:N},t[29]=c.hasNextPage,t[30]=c.isFetchingNextPage,t[31]=S,t[32]=v,t[33]=y,t[34]=N,t[35]=j,t[36]=k):k=t[36],k}function Kn(t){return t.notifications.map(qn)}function qn(t){return{id:t.id,taskBoardItemId:t.taskBoardItemId,taskTitle:t.taskTitle,taskKeySeq:t.taskKeySeq,action:t.type,actorName:t.actorName,actorImage:t.actorImage,occurredAt:t.createdAt}}function Wn(t){return t.nextCursor??void 0}function Hn(t,e){switch(t.action){case"commented":return e("sidebar.inbox.actionCommented");case"mentioned":return e("sidebar.inbox.actionMentioned");case"created":return e("sidebar.inbox.actionCreated");case"status_changed":return e("sidebar.inbox.actionStatusChanged");case"assignee_changed":return e("sidebar.inbox.actionAssigneeChanged");case"review_requested":return e("sidebar.inbox.actionReviewRequested");case"review_approved":return e("sidebar.inbox.actionReviewApproved");case"review_changes_requested":return e("sidebar.inbox.actionReviewChangesRequested");case"merge_failed":return e("sidebar.inbox.actionMergeFailed");default:{const n=t.action;return String(n)}}}function Gn(t){const e=_.c(28),{update:n,orgSlug:i,onSelect:o}=t,l=$();let r;e[0]!==i||e[1]!==n.taskKeySeq?(r=ut(i,n.taskKeySeq),e[0]=i,e[1]=n.taskKeySeq,e[2]=r):r=e[2];const a=r,d=!n.actorName;let c;e[3]!==d||e[4]!==n.actorImage||e[5]!==n.actorName?(c=d?s.jsx(fs,{size:24,className:"shrink-0"}):s.jsx($e,{url:n.actorImage??void 0,fallback:Zs(n.actorName??void 0),shape:"circle",size:"xs",className:"shrink-0"}),e[3]=d,e[4]=n.actorImage,e[5]=n.actorName,e[6]=c):c=e[6];const f=a?`${a} · `:"";let m;e[7]!==f||e[8]!==n.taskTitle?(m=s.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[f,n.taskTitle]}),e[7]=f,e[8]=n.taskTitle,e[9]=m):m=e[9];let p;e[10]!==l||e[11]!==n?(p=Hn(n,l),e[10]=l,e[11]=n,e[12]=p):p=e[12];let u;e[13]!==p?(u=s.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:p}),e[13]=p,e[14]=u):u=e[14];let x;e[15]!==m||e[16]!==u?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[m,u]}),e[15]=m,e[16]=u,e[17]=x):x=e[17];let h;e[18]!==n.occurredAt?(h=en(new Date(n.occurredAt)),e[18]=n.occurredAt,e[19]=h):h=e[19];let g;e[20]!==h?(g=s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=g):g=e[21];let b;e[22]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Js,{size:16,className:"shrink-0 text-muted-foreground"}),e[22]=b):b=e[22];let j;return e[23]!==o||e[24]!==c||e[25]!==x||e[26]!==g?(j=s.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-center gap-3 border-b border-border px-4 py-3 text-left transition-colors last:border-0 hover:bg-muted/25",children:[c,x,g,b]}),e[23]=o,e[24]=c,e[25]=x,e[26]=g,e[27]=j):j=e[27],j}function Yn(t){const e=_.c(2),{onReach:n}=t;let i;return e[0]!==n?(i=s.jsx("div",{className:"h-8 shrink-0",ref:o=>{if(!o)return;const l=new IntersectionObserver(r=>{r.some(Qn)&&n()});return l.observe(o),()=>l.disconnect()}}),e[0]=n,e[1]=i):i=e[1],i}function Qn(t){return t.isIntersecting}function Vn(t){const e=_.c(23),{onClose:n}=t,i=$(),o=B(),{org:l}=E(),{updates:r,markAllRead:a,markRead:d,hasMore:c,fetchMore:f}=wt();let m;e[0]!==i?(m=i("sidebar.inbox.title"),e[0]=i,e[1]=m):m=e[1];let p;e[2]!==m?(p=s.jsx("h3",{className:"text-sm font-medium",children:m}),e[2]=m,e[3]=p):p=e[3];let u;e[4]!==a||e[5]!==i||e[6]!==r.length?(u=r.length>0&&s.jsx(Ae,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:a,children:i("sidebar.inbox.markAllRead")}),e[4]=a,e[5]=i,e[6]=r.length,e[7]=u):u=e[7];let x;e[8]!==p||e[9]!==u?(x=s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[p,u]}),e[8]=p,e[9]=u,e[10]=x):x=e[10];let h;e[11]!==f||e[12]!==c||e[13]!==d||e[14]!==o||e[15]!==n||e[16]!==l||e[17]!==i||e[18]!==r?(h=r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[s.jsx(Ke,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:i("sidebar.inbox.emptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground",children:i("sidebar.inbox.emptyBody")})]}):s.jsxs(Qs,{className:"min-h-0 flex-1",children:[r.map(b=>{const j=ut(l.slug,b.taskKeySeq);return s.jsx(Gn,{update:b,orgSlug:l.slug,onSelect:()=>{d(b.id),n(),j&&o({to:"/$org/tasks/{-$taskKey}",params:{org:l.slug,taskKey:j}})}},b.id)}),c&&s.jsx(Yn,{onReach:f})]}),e[11]=f,e[12]=c,e[13]=d,e[14]=o,e[15]=n,e[16]=l,e[17]=i,e[18]=r,e[19]=h):h=e[19];let g;return e[20]!==x||e[21]!==h?(g=s.jsxs(s.Fragment,{children:[x,h]}),e[20]=x,e[21]=h,e[22]=g):g=e[22],g}function It(){const t=_.c(1),{redDotCount:e}=wt();if(e===0)return null;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=n):n=t[0],n}function $t(t){const e=_.c(11),{open:n,onOpenChange:i,side:o,children:l}=t;let r;e[0]!==i||e[1]!==n?(r=n&&s.jsx(Vn,{onClose:()=>i(!1)}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==o||e[4]!==r?(a=s.jsx(bt,{side:o,align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(400px,calc(100vw-2rem))] flex-col p-0",children:r}),e[3]=o,e[4]=r,e[5]=a):a=e[5];let d;return e[6]!==l||e[7]!==i||e[8]!==n||e[9]!==a?(d=s.jsxs(ht,{open:n,onOpenChange:i,children:[l,a]}),e[6]=l,e[7]=i,e[8]=n,e[9]=a,e[10]=d):d=e[10],d}function At(){const t=_.c(9),e=$(),[n,i]=O.useState(!1);let o;t[0]!==e?(o=e("sidebar.inbox.title"),t[0]=e,t[1]=o):o=t[1];let l,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{size:15}),r=s.jsx(It,{}),t[2]=l,t[3]=r):(l=t[2],r=t[3]);let a;t[4]!==o?(a=s.jsx(Be,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[l,r]})}),t[4]=o,t[5]=a):a=t[5];let d;return t[6]!==n||t[7]!==a?(d=s.jsx($t,{open:n,onOpenChange:i,side:"top",children:a}),t[6]=n,t[7]=a,t[8]=d):d=t[8],d}function Xn(){const t=_.c(15),e=$(),[n,i]=O.useState(!1),{state:o}=U();let l;t[0]!==o||t[1]!==e?(l=o==="collapsed"?e("sidebar.inbox.title"):void 0,t[0]=o,t[1]=e,t[2]=l):l=t[2];let r,a;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ke,{}),a=s.jsx(It,{}),t[3]=r,t[4]=a):(r=t[3],a=t[4]);let d;t[5]!==e?(d=e("sidebar.inbox.title"),t[5]=e,t[6]=d):d=t[6];let c;t[7]!==d?(c=s.jsx("span",{className:"truncate",children:d}),t[7]=d,t[8]=c):c=t[8];let f;t[9]!==l||t[10]!==c?(f=s.jsx(Be,{asChild:!0,children:s.jsxs(z,{tooltip:l,className:"relative",children:[r,a,c]})}),t[9]=l,t[10]=c,t[11]=f):f=t[11];let m;return t[12]!==n||t[13]!==f?(m=s.jsx($t,{open:n,onOpenChange:i,side:"right",children:f}),t[12]=n,t[13]=f,t[14]=m):m=t[14],m}function Jn(){const t=_.c(14),e=$(),n=B(),{org:i}=E();let o;t[0]!==e?(o=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=o):o=t[1];let l;t[2]!==n||t[3]!==i.slug?(l=()=>n({to:"/$org/settings",params:{org:i.slug}}),t[2]=n,t[3]=i.slug,t[4]=l):l=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(fe,{}),t[5]=r):r=t[5];let a;t[6]!==e?(a=e("sidebar.sidebarFooter.settings"),t[6]=e,t[7]=a):a=t[7];let d;t[8]!==a?(d=s.jsx("span",{children:a}),t[8]=a,t[9]=d):d=t[9];let c;return t[10]!==o||t[11]!==l||t[12]!==d?(c=s.jsxs(z,{tooltip:o,onClick:l,children:[r,d]}),t[10]=o,t[11]=l,t[12]=d,t[13]=c):c=t[13],c}function Zn(){const t=_.c(9),e=$(),n=B(),{org:i}=E();let o;t[0]!==e?(o=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=o):o=t[1];let l;t[2]!==n||t[3]!==i.slug?(l=()=>n({to:"/$org/settings",params:{org:i.slug}}),t[2]=n,t[3]=i.slug,t[4]=l):l=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(fe,{size:15}),t[5]=r):r=t[5];let a;return t[6]!==o||t[7]!==l?(a=s.jsx("button",{type:"button","aria-label":o,onClick:l,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:r}),t[6]=o,t[7]=l,t[8]=a):a=t[8],a}function et(){const t=_.c(29),e=$(),[n,i]=O.useState(!1);let o;t[0]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=o):o=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(gt,{}),t[2]=l):l=t[2];let r;t[3]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=r):r=t[4];let a;t[5]!==r?(a=s.jsx("span",{children:r}),t[5]=r,t[6]=a):a=t[6];let d;t[7]!==o||t[8]!==a?(d=s.jsx(P,{children:s.jsx(jt,{trigger:s.jsxs(z,{tooltip:o,children:[l,a]})})}),t[7]=o,t[8]=a,t[9]=d):d=t[9];let c;t[10]!==e?(c=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=c):c=t[11];let f,m;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=()=>i(!0),m=s.jsx(Gs,{}),t[12]=f,t[13]=m):(f=t[12],m=t[13]);let p;t[14]!==e?(p=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=p):p=t[15];let u;t[16]!==p?(u=s.jsx("span",{children:p}),t[16]=p,t[17]=u):u=t[17];let x;t[18]!==c||t[19]!==u?(x=s.jsx(P,{children:s.jsxs(z,{tooltip:c,onClick:f,children:[m,u]})}),t[18]=c,t[19]=u,t[20]=x):x=t[20];let h;t[21]!==x||t[22]!==d?(h=s.jsxs(T,{className:"gap-0.5",children:[d,x]}),t[21]=x,t[22]=d,t[23]=h):h=t[23];let g;t[24]!==n?(g=s.jsx(us,{open:n,onOpenChange:i,mode:"browse"}),t[24]=n,t[25]=g):g=t[25];let b;return t[26]!==h||t[27]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),t[26]=h,t[27]=g,t[28]=b):b=t[28],b}function tt(){const t=_.c(10),e=$();let n;t[0]!==e?(n=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(gt,{}),t[2]=i):i=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let l;t[5]!==o?(l=s.jsx("span",{children:o}),t[5]=o,t[6]=l):l=t[6];let r;return t[7]!==n||t[8]!==l?(r=s.jsx(T,{className:"gap-0.5",children:s.jsx(P,{children:s.jsx(jt,{trigger:s.jsxs(z,{tooltip:n,children:[i,l]})})})}),t[7]=n,t[8]=l,t[9]=r):r=t[9],r}function eo(){const t=_.c(18),{state:e}=U(),n=e==="collapsed",i=vs(),o=!i;if(n){let c;t[0]!==o?(c=o&&s.jsx(Ze,{}),t[0]=o,t[1]=c):c=t[1];let f;t[2]!==i?(f=i?s.jsx(tt,{}):s.jsx(et,{}),t[2]=i,t[3]=f):f=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(P,{children:s.jsx(Xn,{})}),t[4]=m):m=t[4];let p;t[5]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(P,{children:s.jsx(Jn,{})}),t[5]=p):p=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(T,{children:[m,p,s.jsx(P,{children:s.jsx(Fe,{})})]}),t[6]=u):u=t[6];let x;return t[7]!==c||t[8]!==f?(x=s.jsxs(Te,{className:"px-2 pb-3 gap-1",children:[c,f,u]}),t[7]=c,t[8]=f,t[9]=x):x=t[9],x}let l;t[10]!==o?(l=o&&s.jsx(Ze,{}),t[10]=o,t[11]=l):l=t[11];let r;t[12]!==i?(r=i?s.jsx(tt,{}):s.jsx(et,{}),t[12]=i,t[13]=r):r=t[13];let a;t[14]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(T,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Fe,{})}),s.jsx(At,{}),s.jsx(Zn,{})]})})}),t[14]=a):a=t[14];let d;return t[15]!==l||t[16]!==r?(d=s.jsxs(Te,{className:"px-2 pb-3 gap-0.5",children:[l,r,a]}),t[15]=l,t[16]=r,t[17]=d):d=t[17],d}function to(){const t=_.c(12),e=$(),n=B(),{org:i}=E(),{setOpenMobile:o}=U();let l,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(T,{children:s.jsx(P,{children:s.jsx(Fe,{})})})}),r=s.jsx(At,{}),t[0]=l,t[1]=r):(l=t[0],r=t[1]);let a;t[2]!==e?(a=e("sidebar.sidebarFooterMobile.settings"),t[2]=e,t[3]=a):a=t[3];let d;t[4]!==n||t[5]!==i.slug||t[6]!==o?(d=()=>{n({to:"/$org/settings",params:{org:i.slug}}),o(!1)},t[4]=n,t[5]=i.slug,t[6]=o,t[7]=d):d=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(fe,{className:"size-4"}),t[8]=c):c=t[8];let f;return t[9]!==a||t[10]!==d?(f=s.jsx(Te,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[l,r,s.jsx(xt,{"aria-label":a,onClick:d,children:c})]})}),t[9]=a,t[10]=d,t[11]=f):f=t[11],f}const so=5,no=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function oo(){const t=_.c(3),{state:e}=U();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:so}).map(ro)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(F,{className:"size-6 rounded-md"}),s.jsx(F,{className:"size-6 rounded-md"}),s.jsx(F,{className:"size-6 rounded-md"})]}),s.jsx(F,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:no.map(io)})]}),t[2]=i):i=t[2],i}function io(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(F,{className:"size-5 rounded-full shrink-0"}),s.jsx(F,{className:M("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(lo)})]},e)}function lo(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(F,{className:"h-3 flex-1 rounded-sm"})},e)}function ro(t,e){return s.jsx(F,{className:"size-10 rounded-lg mx-auto"},e)}function ao(t,e,n){let i=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||(!i||o.updated_at>i.updated_at)&&(i=o));return i}const Mt=[],co=()=>()=>{};function mo(){const t=_.c(8),e=$(),{org:n}=E(),i=vt(),o=fo;let l;if(t[0]!==i||t[1]!==n.slug||t[2]!==e){let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(As,{size:16}),t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Ms,{size:16}),t[5]=a):a=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ys,{size:16}),t[6]=d):d=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(tn,{size:16}),t[7]=c):c=t[7],l=[o("overview",e("sidebar.navDestinations.home"),r,i===R.home||i===R.orgIndex,{to:R.home,params:{org:n.slug}}),o("reports",e("sidebar.navDestinations.reports"),a,i===R.reports,{to:R.reports,params:{org:n.slug}}),o("board",e("sidebar.navDestinations.tasks"),d,i===R.tasks,{to:R.tasks,params:{org:n.slug,taskKey:void 0}}),o("files",e("sidebar.navDestinations.library"),c,i===R.library,{to:R.library,params:{org:n.slug}})],t[0]=i,t[1]=n.slug,t[2]=e,t[3]=l}else l=t[3];return l}function fo(t,e,n,i,o){return{key:t,label:e,icon:n,isActive:i,trackAs:t,link:o}}function st(t){const e=_.c(11),{org:n}=E(),i=sn()??[],o=ln(i),l=vt(),r=Ws(),a=Hs(),{data:d}=me.useSession(),c=d?.user?.id,f=nn();let m;e[0]!==f?.threads.get?(m=f?.threads.get??po,e[0]=f?.threads.get,e[1]=m):m=e[1];let p;e[2]!==f?.threads.get?(p=f?.threads.get??uo,e[2]=f?.threads.get,e[3]=p):p=e[3];const u=O.useSyncExternalStore(f?.threads.subscribe??co,m,p);let x;return e[4]!==r||e[5]!==l||e[6]!==n||e[7]!==a||e[8]!==u||e[9]!==c?(x=h=>{const g=cn(h),b=l===R.agents&&r===h.id,j=b?a??void 0:ao(u,h.id,c)?.id??void 0,S={org:n.slug,project:h.id,panel:void 0};return{key:h.id,label:h.title||g?.name||"",icon:s.jsx(Os,{icon:h.icon,name:h.title,size:"2xs",className:"shrink-0"}),isActive:b,trackAs:"coding_agent",link:{to:R.agents,params:S,search:j?{thread:j}:{}},settingsLink:{to:R.agents,params:{...S,panel:"settings"},search:j?{thread:j}:{}}}},e[4]=r,e[5]=l,e[6]=n,e[7]=a,e[8]=u,e[9]=c,e[10]=x):x=e[10],i.filter(h=>t(h,o)).map(x)}function uo(){return Mt}function po(){return Mt}function xo(t){const e=_.c(14),{onNavigate:n}=t,i=$(),o=mo(),l=st(bo),r=st(ho),a=[...l,...r],[d]=ct(),{showProjectSettingsGear:c}=d,{state:f,isMobile:m}=U(),p=f==="collapsed"&&!m;let u;e[0]!==p||e[1]!==m||e[2]!==n||e[3]!==c||e[4]!==i?(u=y=>{const N=y.settingsLink&&c&&!p;return s.jsxs(P,{children:[s.jsx(z,{asChild:!0,isActive:y.isActive,tooltip:p?y.label:void 0,className:M(N&&"group-hover/menu-item:bg-sidebar-accent group-hover/menu-item:text-sidebar-accent-foreground"),children:s.jsxs(He,{...y.link,"aria-current":y.isActive?"page":void 0,onClick:()=>{L("nav_destination_clicked",{destination:y.trackAs}),n?.()},children:[y.icon,s.jsx("span",{className:M("truncate",N&&"pr-7"),children:y.label})]})}),N&&y.settingsLink&&s.jsx(Ae,{asChild:!0,variant:"ghost",size:"icon-sm",className:M("absolute right-1 top-1/2 -translate-y-1/2 text-sidebar-foreground/60 hover:text-sidebar-foreground/60",m?"opacity-100":"opacity-0 group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100"),children:s.jsx(He,{...y.settingsLink,"aria-label":i("sidebar.navDestinations.projectSettings",{name:y.label}),onClick:()=>{L("nav_destination_clicked",{destination:"coding_agent_settings"}),n?.()},children:s.jsx(fe,{})})})]},y.key)},e[0]=p,e[1]=m,e[2]=n,e[3]=c,e[4]=i,e[5]=u):u=e[5];const x=u,h=T,g="gap-1";let b;e[6]!==o||e[7]!==x?(b=o.map(x),e[6]=o,e[7]=x,e[8]=b):b=e[8];const j=a.length>0&&s.jsx("li",{"aria-hidden":!0,className:"h-2"}),S=a.map(x);let v;return e[9]!==h||e[10]!==b||e[11]!==j||e[12]!==S?(v=s.jsxs(h,{className:g,children:[b,j,S]}),e[9]=h,e[10]=b,e[11]=j,e[12]=S,e[13]=v):v=e[13],v}function ho(t,e){return an(t)&&!e.has(t.id)}function bo(t){return rn(t.metadata)}function go(t){const e=_.c(29);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:i}=n,o=$(),{org:l}=E(),{state:r,isMobile:a,toggleSidebar:d}=U(),c=r==="collapsed"&&!a;let f;e[2]!==i?(f=s.jsx(xo,{onNavigate:i}),e[2]=i,e[3]=f):f=e[3];const m=f;if(c){let u;e[4]!==l?(u=s.jsx(xs,{org:l,size:"sm"}),e[4]=l,e[5]=u):u=e[5];let x;e[6]!==l.name||e[7]!==u?(x=s.jsx(z,{tooltip:l.name,children:u}),e[6]=l.name,e[7]=u,e[8]=x):x=e[8];let h;e[9]!==l.slug||e[10]!==x?(h=s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(ps,{orgParam:l.slug,side:"right",align:"start",trigger:x})}),e[9]=l.slug,e[10]=x,e[11]=h):h=e[11];let g;e[12]!==o?(g=o("sidebar.taskGroupsList.toggleSidebar"),e[12]=o,e[13]=g):g=e[13];let b;e[14]!==o?(b=o("sidebar.taskGroupsList.toggleSidebar"),e[14]=o,e[15]=b):b=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(at,{size:16}),e[16]=j):j=e[16];let S;e[17]!==g||e[18]!==b||e[19]!==d?(S=s.jsx(T,{className:"mt-2 gap-1.5",children:s.jsx(P,{children:s.jsx(z,{"aria-label":g,tooltip:b,onClick:d,children:j})})}),e[17]=g,e[18]=b,e[19]=d,e[20]=S):S=e[20];let v;e[21]!==m?(v=s.jsx("div",{className:"mt-1.5 min-h-0 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:m}),e[21]=m,e[22]=v):v=e[22];let y;return e[23]!==v||e[24]!==h||e[25]!==S?(y=s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[h,S,v]}),e[23]=v,e[24]=h,e[25]=S,e[26]=y):y=e[26],y}let p;return e[27]!==m?(p=s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:m})}),e[27]=m,e[28]=p):p=e[28],p}function jo(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs(s.Fragment,{children:[s.jsx(ft,{showName:!0}),s.jsx(St,{className:"ml-auto md:size-[34px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Ot(t){const e=_.c(3),{onNavigate:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(oo,{}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=s.jsx(nt,{children:s.jsx(O.Suspense,{fallback:i,children:s.jsx(go,{onNavigate:n})})}),e[1]=n,e[2]=o):o=e[2],o}function vo(){const t=_.c(5),e=_t();let n,i,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(eo,{}),i=s.jsx(jo,{}),o=s.jsx(Ot,{}),t[0]=n,t[1]=i,t[2]=o):(n=t[0],i=t[1],o=t[2]);let l;return t[3]!==e?(l=s.jsx(yt,{children:s.jsx(kt,{sections:e,footer:n,header:i,additionalContent:o})}),t[3]=e,t[4]=l):l=t[4],l}function yo(t){const e=_.c(7),{onClose:n}=t,i=_t();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(to,{}),e[0]=o):o=e[0];let l;e[1]!==n?(l=s.jsx(Ot,{onNavigate:n}),e[1]=n,e[2]=l):l=e[2];let r;return e[3]!==n||e[4]!==i||e[5]!==l?(r=s.jsx(yt,{children:s.jsx(In,{sections:i,onClose:n,footer:o,additionalContent:l})}),e[3]=n,e[4]=i,e[5]=l,e[6]=r):r=e[6],r}const So="sidebar.open";function _o(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Jt,{}),t[0]=e):e=t[0],e}function zl(){const t=_.c(28),e=dt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{connect:i,siteUrl:o}=Gt(n),l=i==="1",[r,a]=it(So,!1),{width:d,wrapperRef:c,onStartResize:f,resetWidth:m}=vn(),p=e;let u;t[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ae.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[s.jsx(St,{}),s.jsx(ae.TogglesSlot,{}),s.jsx(ae.TabsSlot,{className:"shrink-0"}),s.jsx(ae.CenterSlot,{}),s.jsx(ae.RightSlot,{})]})}),t[1]=u):u=t[1];const x=u;let h;t[2]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[2]=h):h=t[2];let g;t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Yt,{className:"flex flex-col min-h-0",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(O.Suspense,{fallback:s.jsx(_o,{}),children:s.jsx(Qt,{})})})})}),t[3]=g):g=t[3];const b=g,j=p&&x,S=`${d}px`;let v;t[4]!==S?(v={"--sidebar-width":S,"--sidebar-width-icon":"3.125rem"},t[4]=S,t[5]=v):v=t[5];const y=v;let N;t[6]!==e||t[7]!==f||t[8]!==m?(N=!e&&s.jsxs(s.Fragment,{children:[s.jsx(vo,{}),s.jsx(bn,{onPointerDown:f,onDoubleClick:m})]}),t[6]=e,t[7]=f,t[8]=m,t[9]=N):N=t[9];let k;t[10]!==y||t[11]!==N||t[12]!==c?(k=s.jsxs(Vt,{ref:c,className:"flex-1 bg-sidebar relative min-h-0",style:y,children:[N,b]}),t[10]=y,t[11]=N,t[12]=c,t[13]=k):k=t[13];let C;t[14]!==e?(C=e&&s.jsx(dn,{renderSidebar:No}),t[14]=e,t[15]=C):C=t[15];let w;t[16]!==o||t[17]!==l?(w=l&&s.jsx(fn,{siteUrl:o}),t[16]=o,t[17]=l,t[18]=w):w=t[18];let I;t[19]!==C||t[20]!==w||t[21]!==j||t[22]!==k?(I=s.jsx(mn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[j,k,C,w]})}),t[19]=C,t[20]=w,t[21]=j,t[22]=k,t[23]=I):I=t[23];let A;return t[24]!==a||t[25]!==r||t[26]!==I?(A=s.jsx(on,{children:s.jsx(ae.Provider,{children:s.jsx(Xt,{open:r,onOpenChange:a,children:I})})}),t[24]=a,t[25]=r,t[26]=I,t[27]=A):A=t[27],A}function No(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(yo,{onClose:e})})})}export{zl as default};