decocms 4.65.0 → 4.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/client/assets/{AlertCircle-BgDL5EhB.js → AlertCircle-SXoE8n-a.js} +1 -1
  2. package/dist/client/assets/{AreaChart-X1qU13E8.js → AreaChart-BGA3Q3ut.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-DWr3F57S.js → ArrowUp-w_yrWzIl.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BS2OY4HI.js → ArrowUpRight-B5fSryh2.js} +1 -1
  5. package/dist/client/assets/{Check-CaHIu_54.js → Check-BLOgKImX.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BjhPCunZ.js → CheckCircle-DZfqbe7a.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-wpJ7eSNW.js → ChevronDown-BLT5HbhK.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-T17vENdx.js → ChevronRight-DEa9SHrE.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-tqXddtDI.js → ChevronUp-Cb58zomx.js} +1 -1
  10. package/dist/client/assets/{Circle-BAA3CwTd.js → Circle-xS-XNWbi.js} +1 -1
  11. package/dist/client/assets/{Copy01-C9lon82Q.js → Copy01-B6iUzmfA.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DB_iGqrn.js → DotsVertical-COspjpCv.js} +1 -1
  13. package/dist/client/assets/{Eye-Ckz7kGzj.js → Eye-qasAaBiw.js} +1 -1
  14. package/dist/client/assets/{FilterLines-X0jum0_z.js → FilterLines-BAP0MMyO.js} +1 -1
  15. package/dist/client/assets/{Flag01-kWWxH4mT.js → Flag01-DBGHCdmB.js} +1 -1
  16. package/dist/client/assets/{Globe01-DMJD09Ge.js → Globe01-DGz_d2fj.js} +1 -1
  17. package/dist/client/assets/{Globe04-Bt452DpH.js → Globe04-BL47c47W.js} +1 -1
  18. package/dist/client/assets/{HardDrive-uQr5LAUZ.js → HardDrive-ChUv3ESw.js} +1 -1
  19. package/dist/client/assets/{Key01-CDUJ-GUN.js → Key01-EmsKaBBE.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-Bn_iVkhC.js → LayoutLeft-BTJCUon_.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BHrSTqHo.js → LinkExternal01-DqvcDL0A.js} +1 -1
  22. package/dist/client/assets/{List-B-eIsgzg.js → List-TrNC2jpp.js} +1 -1
  23. package/dist/client/assets/{Monitor01-BJyX6BiR.js → Monitor01-DYFfuzgX.js} +1 -1
  24. package/dist/client/assets/{Package-BLP83WwV.js → Package-CjF7Ia31.js} +1 -1
  25. package/dist/client/assets/{Palette-DeKgHlWo.js → Palette-JZRU3oXS.js} +1 -1
  26. package/dist/client/assets/{Play-BeYBNy6k.js → Play-C9Lmmw1O.js} +1 -1
  27. package/dist/client/assets/{Plus-M7Z31wrO.js → Plus-Dk-fAJV_.js} +1 -1
  28. package/dist/client/assets/{SearchLg-CCr6DQuW.js → SearchLg-CgY6Dwp_.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BrC2iZQ1.js → SearchMd-CL8C6iCG.js} +1 -1
  30. package/dist/client/assets/{Settings02-6XNEhu4R.js → Settings02-DOGMCiCj.js} +1 -1
  31. package/dist/client/assets/{Shield01-BRg-y06k.js → Shield01-B-4Xl6E4.js} +1 -1
  32. package/dist/client/assets/{Star01-B8h2h-Uj.js → Star01-Dxk41U9K.js} +1 -1
  33. package/dist/client/assets/{Stars01-vnwDUOxb.js → Stars01-C6xII_m0.js} +1 -1
  34. package/dist/client/assets/{Stars02-eYXfAFgH.js → Stars02-1PwE70zL.js} +1 -1
  35. package/dist/client/assets/{Sun-57G02HLE.js → Sun-Dzth8R6o.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-6zDad7Gz.js → SwitchHorizontal01-BPHDsuu3.js} +1 -1
  37. package/dist/client/assets/{Tool01-BsZCQETX.js → Tool01-zISQ4iTO.js} +1 -1
  38. package/dist/client/assets/{Tool02-aEAUKug0.js → Tool02-unFaslqY.js} +1 -1
  39. package/dist/client/assets/{Trash01-hvdx05ZV.js → Trash01-C-BZvEfh.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CkgBQqG5.js → TrendUp01-Ci9aFQYK.js} +1 -1
  41. package/dist/client/assets/{Upload01-BFj2T5hE.js → Upload01-DtHS2sYU.js} +1 -1
  42. package/dist/client/assets/{User01-BCTRYgWw.js → User01-bf0dyKkX.js} +1 -1
  43. package/dist/client/assets/{UserPlus01-gnDun0R2.js → UserPlus01-D3WaVhp_.js} +1 -1
  44. package/dist/client/assets/{Users01-0sZa7AsG.js → Users01-FEt2FDyK.js} +1 -1
  45. package/dist/client/assets/{Users03-VH8eefwa.js → Users03-kc-LsXQp.js} +1 -1
  46. package/dist/client/assets/{X-LqY3zO2y.js → X-DNyzg7g8.js} +1 -1
  47. package/dist/client/assets/{XCircle-DgZjfIuh.js → XCircle-BacveYlN.js} +1 -1
  48. package/dist/client/assets/{XClose-oKRTLLzc.js → XClose-DXkvSdei.js} +1 -1
  49. package/dist/client/assets/{Zap-VQGxqYXg.js → Zap-VsBSZpVz.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-DQ3NLTzQ.js → ZapSquare-BE9hDUmr.js} +1 -1
  51. package/dist/client/assets/{ZoomOut-Bu4oPwRF.js → ZoomOut-OJElVwKK.js} +1 -1
  52. package/dist/client/assets/{access-gate-BJOY4IeA.js → access-gate-C2BFH-iT.js} +1 -1
  53. package/dist/client/assets/{add-section-modal-DByNZ5bZ.js → add-section-modal-BTqY-Wax.js} +1 -1
  54. package/dist/client/assets/{agent-icon-CisP0Ou9.js → agent-icon-D3BNQt6X.js} +1 -1
  55. package/dist/client/assets/{agents-list-Bg_8wRqT.js → agents-list-B2Hb0wQ7.js} +1 -1
  56. package/dist/client/assets/{ai-providers-BRkq45lK.js → ai-providers-B-jk-UmT.js} +1 -1
  57. package/dist/client/assets/{alert-D1dAz2xm.js → alert-B61Hqac_.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-uXFRYx4f.js → alert-dialog-BLch-gEk.js} +1 -1
  59. package/dist/client/assets/app-editor-CVzo35yV.js +1 -0
  60. package/dist/client/assets/{auth-bmb-9_Tt.js → auth-CMYZJLr0.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-BpyMX_PQ.js → auth-catchall-FS2ua_IU.js} +1 -1
  62. package/dist/client/assets/{auth-entry-Dh4Rwjye.js → auth-entry-RW5Guz9l.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-D1tOvOpz.js → auth-split-layout-aq7YQlUW.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-D1vIJ8md.js → authenticate-and-persist-oauth-BW4oChXI.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-Dv7DbX11.js → automation-list-row-DeF1Q5UJ.js} +1 -1
  66. package/dist/client/assets/{automation-runs-D7aKtmwO.js → automation-runs-CHLxwox4.js} +1 -1
  67. package/dist/client/assets/automations-RAAWNXlu.js +1 -0
  68. package/dist/client/assets/{autosend-DGYySc7I.js → autosend-DxKasYkk.js} +1 -1
  69. package/dist/client/assets/{avatar-C29v0fIv.js → avatar-mRyNC44i.js} +1 -1
  70. package/dist/client/assets/{badge-WQxQHFmz.js → badge-Da03bbcH.js} +1 -1
  71. package/dist/client/assets/{block-document-D1Whi6tD.js → block-document-QKzcLw67.js} +1 -1
  72. package/dist/client/assets/{brand-context-qU-qVDwF.js → brand-context-CWdhiSUt.js} +1 -1
  73. package/dist/client/assets/{buckets-Dh_dxhyX.js → buckets-CBnb7zex.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-CWiFcHcj.js → bulk-category-panel-CfH1OntZ.js} +1 -1
  75. package/dist/client/assets/{calendar-zKyIjSj2.js → calendar-ufYgOcYh.js} +1 -1
  76. package/dist/client/assets/{capability-load-error-CInD3PW6.js → capability-load-error-5FA5_elC.js} +1 -1
  77. package/dist/client/assets/{card-DRx3sRgJ.js → card-CReek_oi.js} +1 -1
  78. package/dist/client/assets/category-editor-CxTt3xP0.js +1 -0
  79. package/dist/client/assets/{chat-context-o-fkiWtd.js → chat-context-BXa8kxo4.js} +1 -1
  80. package/dist/client/assets/{checkbox-BGhuCrXh.js → checkbox-Ci8LPgcQ.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-CidSTDE8.js → cli-auth-success-B0PSRM-Y.js} +1 -1
  82. package/dist/client/assets/{collection-detail-CgZgWWS9.js → collection-detail-CV1lSXJE.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-C-GNVcXj.js → collection-display-button-BTHNOx5v.js} +1 -1
  84. package/dist/client/assets/{collection-search-Dl1rSx6-.js → collection-search-DjBc4Ak7.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-CS23VWiU.js → collection-table-wrapper-DDWNubEI.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-BD_utxXw.js → collection-tabs-BrdROQop.js} +1 -1
  87. package/dist/client/assets/{command-C-bk8tFG.js → command-nUAO4huV.js} +1 -1
  88. package/dist/client/assets/commerce-onboarding-BqvAUS7K.js +1 -0
  89. package/dist/client/assets/companions-core-DZbeLgy-.js +1 -0
  90. package/dist/client/assets/{connect-desktop-dialog-CrMXkeVk.js → connect-desktop-dialog-Cx-f-C5z.js} +1 -1
  91. package/dist/client/assets/{connection-card-OYBnMPMS.js → connection-card-D_314XFe.js} +1 -1
  92. package/dist/client/assets/{connection-detail-B1UKPFK-.js → connection-detail--IQiXk1v.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-BVf39W69.js → connection-form-helpers-BH8kqsbW.js} +1 -1
  94. package/dist/client/assets/{connections-DrHUoJ_I.js → connections-D4aeSlwU.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-C2G1aaZc.js → decopilot-sse-pool-Cgyf9ioh.js} +1 -1
  96. package/dist/client/assets/{dialog-DRLzaEaI.js → dialog-CmjMRZdy.js} +1 -1
  97. package/dist/client/assets/{domain-settings-08xns5oE.js → domain-settings-B8Ou9skY.js} +1 -1
  98. package/dist/client/assets/{drawer-8H5NiaRB.js → drawer-C497yCqp.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-B3HFJi9W.js → dropdown-menu-BD3SEa2f.js} +1 -1
  100. package/dist/client/assets/{empty-state-CJNm_Wx3.js → empty-state-ltR3B9lZ.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-Dj2v22sN.js → extract-connection-data-C7SjjzRd.js} +1 -1
  102. package/dist/client/assets/file-explorer-D3fow199.js +2 -0
  103. package/dist/client/assets/{file-type-icon-D2Std2ip.js → file-type-icon-yE5wYAcd.js} +1 -1
  104. package/dist/client/assets/{files-BbwT8GBf.js → files-B6G9CQWo.js} +1 -1
  105. package/dist/client/assets/{form-bFOvfGH1.js → form-CWkHhTzY.js} +1 -1
  106. package/dist/client/assets/{general-Bm_j7Exr.js → general-CNwuGRAT.js} +1 -1
  107. package/dist/client/assets/{github-installations-D2vHSx02.js → github-installations-ChFezl8I.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-BO7er0hb.js → github-repo-picker-Ch_J9f66.js} +1 -1
  109. package/dist/client/assets/{hooks-DsF-eoVs.js → hooks-Bap4ZvBH.js} +1 -1
  110. package/dist/client/assets/{index-CkX8nQuh.js → index-5BfZbFkR.js} +1 -1
  111. package/dist/client/assets/{index--R4C_MgQ.js → index-BGKuYAzI.js} +28 -28
  112. package/dist/client/assets/index-BH91vBC9.js +1 -0
  113. package/dist/client/assets/{index-CwvQsRbd.js → index-BbqantUe.js} +1 -1
  114. package/dist/client/assets/{index-DMIHY7z9.js → index-BvE_DXHw.js} +1 -1
  115. package/dist/client/assets/{index-DOilxzn5.js → index-C7h-12Mf.js} +1 -1
  116. package/dist/client/assets/{index-BwxH3xVs.js → index-C9bD09Pg.js} +1 -1
  117. package/dist/client/assets/{index-CfD5IJ8P.js → index-Cnahe_2A.js} +1 -1
  118. package/dist/client/assets/{index-Co2JYTgB.js → index-Crbx--SU.js} +1 -1
  119. package/dist/client/assets/{index-BTRyPQVH.js → index-CwtLGNNP.js} +1 -1
  120. package/dist/client/assets/index-D8TzbwAS.css +1 -0
  121. package/dist/client/assets/{index-BaFYkry5.js → index-DRiXMUyR.js} +1 -1
  122. package/dist/client/assets/{index-BUz-OC8o.js → index-DS7H8pJT.js} +1 -1
  123. package/dist/client/assets/{index-ClTfvZWv.js → index-Dvzlmeil.js} +1 -1
  124. package/dist/client/assets/{index-redirect-CLan28iA.js → index-redirect-BIM9BDjV.js} +1 -1
  125. package/dist/client/assets/{index-OPKvaD5e.js → index-tSyqSpME.js} +4 -4
  126. package/dist/client/assets/{input-5hdR1OeR.js → input-BACGGISp.js} +1 -1
  127. package/dist/client/assets/{integration-icon-BTTrYwxL.js → integration-icon-CCoRcDhO.js} +1 -1
  128. package/dist/client/assets/{invite-member-dialog-D16Cbjug.js → invite-member-dialog-Djd1ZmeI.js} +1 -1
  129. package/dist/client/assets/{label-BjZWcoKQ.js → label-bOOhaDWd.js} +1 -1
  130. package/dist/client/assets/{layout-BMACxFWm.js → layout-1l3aGV2A.js} +1 -1
  131. package/dist/client/assets/{login-DVs54gbF.js → login-syARuOsu.js} +1 -1
  132. package/dist/client/assets/{mcp-oauth-BvkrTvef.js → mcp-oauth-ClDuPBjh.js} +1 -1
  133. package/dist/client/assets/{members-DFGfmpO_.js → members-CTVPg0Vl.js} +1 -1
  134. package/dist/client/assets/{monaco-editor-BzZSfd51.js → monaco-editor-D_WocML5.js} +1 -1
  135. package/dist/client/assets/{monitoring-stats-row-pKnXg6ns.js → monitoring-stats-row-sT7myaaW.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-eMStL6Eu.js → oauth-callback-DbqmYBhn.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-ai-provider-DkobY0aV.js → oauth-callback-ai-provider-M-CFp702.js} +1 -1
  138. package/dist/client/assets/{onboarding-CNDdTjIV.js → onboarding-CmgAYf7h.js} +1 -1
  139. package/dist/client/assets/{org-install-CPNdrzu4.js → org-install-1GxC2wxe.js} +1 -1
  140. package/dist/client/assets/{org-layout-DgwY0syl.js → org-layout-DxPsMinh.js} +1 -1
  141. package/dist/client/assets/{organization-choice-Dga8eabF.js → organization-choice-4pu3bvmW.js} +1 -1
  142. package/dist/client/assets/{orgs-BubVJire.js → orgs-DqxvN9TN.js} +1 -1
  143. package/dist/client/assets/{page-seo-form-Cn-cgY5H.js → page-seo-form-Cz5RZ907.js} +1 -1
  144. package/dist/client/assets/page-seo-sheet-DPyXKohw.js +1 -0
  145. package/dist/client/assets/{popover-kytVQ7GF.js → popover--R4ocfGr.js} +1 -1
  146. package/dist/client/assets/post-editor-D__Ka-FZ.js +1 -0
  147. package/dist/client/assets/{primitives-M4qnFwow.js → primitives-CT2sx38-.js} +1 -1
  148. package/dist/client/assets/{profile-Bhi82vew.js → profile-Cm3bT_ge.js} +1 -1
  149. package/dist/client/assets/project-app-view-EOAYW5qO.js +1 -0
  150. package/dist/client/assets/record-editor-DZjrp-lZ.js +1 -0
  151. package/dist/client/assets/registry-BUMqKkw4.js +2 -0
  152. package/dist/client/assets/{registry-layout-CpJC_V9z.js → registry-layout-CCfmVbrW.js} +1 -1
  153. package/dist/client/assets/{reports-BvQsFqV9.js → reports-C3tV63hj.js} +1 -1
  154. package/dist/client/assets/{require-capability-BkdOUUx1.js → require-capability-Ctopsl17.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-CW5t5wzZ.js → required-auth-layout-C_Ju1Rse.js} +1 -1
  156. package/dist/client/assets/{reset-password-Da3rjrSC.js → reset-password-C7dZX28S.js} +1 -1
  157. package/dist/client/assets/{roles-BK33rqNe.js → roles-D2-BodnG.js} +1 -1
  158. package/dist/client/assets/{search-input-BqGytPeT.js → search-input-B8Ge-iOu.js} +1 -1
  159. package/dist/client/assets/{secrets-DqKciHBV.js → secrets-DqwE0gFl.js} +1 -1
  160. package/dist/client/assets/{sections-editor-C9cLFAZA.js → sections-editor-DcvuRQY6.js} +2 -2
  161. package/dist/client/assets/{select-DIcEohwD.js → select-kK-EHtkr.js} +1 -1
  162. package/dist/client/assets/{select-model-BMoJg7Nz.js → select-model-BoXnLPUc.js} +1 -1
  163. package/dist/client/assets/self-tool-result-CmL24h9K.js +1 -0
  164. package/dist/client/assets/seo-editor-DArzE3Ov.js +1 -0
  165. package/dist/client/assets/{settings-layout-w18PvCnz.js → settings-layout-BsjxzpYH.js} +1 -1
  166. package/dist/client/assets/{settings-section-CtPiSWUG.js → settings-section-v1xlbTiq.js} +1 -1
  167. package/dist/client/assets/{shell-controls-CjtgfTkK.js → shell-controls-DlLKHrRi.js} +1 -1
  168. package/dist/client/assets/{shell-layout-fstofeax.js → shell-layout-NtqohtXP.js} +1 -1
  169. package/dist/client/assets/{sidebar-CZTQxJLs.js → sidebar-BqdxrsQI.js} +1 -1
  170. package/dist/client/assets/{skeleton-Bm6aPYKD.js → skeleton-CFjs0AnZ.js} +1 -1
  171. package/dist/client/assets/{sso-DtQztM8j.js → sso-C-tkQpTW.js} +1 -1
  172. package/dist/client/assets/{store-BJyRZSdq.js → store-CDetgkab.js} +1 -1
  173. package/dist/client/assets/store-registry-Bb5nv7_x.js +2 -0
  174. package/dist/client/assets/{studio-tools-D2Ki1UQb.js → studio-tools-DbqCj_lz.js} +1 -1
  175. package/dist/client/assets/{switch-D0AM0YLZ.js → switch-kgNVvmjY.js} +1 -1
  176. package/dist/client/assets/{table-BalbqL-R.js → table-CKnBdk42.js} +1 -1
  177. package/dist/client/assets/{tabs-CtdbDFi-.js → tabs-DIkha1un.js} +1 -1
  178. package/dist/client/assets/{textarea-DTJ172sF.js → textarea-CqapeuUz.js} +1 -1
  179. package/dist/client/assets/{toggle-group-9woF9vc-.js → toggle-group-DcjYm_kI.js} +1 -1
  180. package/dist/client/assets/{toolbar-BcDQIQIp.js → toolbar-ONP6kjeA.js} +1 -1
  181. package/dist/client/assets/{toolbar-icon-button-IutHuSQN.js → toolbar-icon-button-C8mL2rKr.js} +1 -1
  182. package/dist/client/assets/{tools-list-D-WxPGDx.js → tools-list-Cj7lyTl0.js} +1 -1
  183. package/dist/client/assets/{tooltip-CsAbPDMP.js → tooltip-ChlT6_lt.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-Dhl2T6Yf.js → use-ai-providers-CH2tRtMo.js} +1 -1
  185. package/dist/client/assets/{use-automations-CWZf2gkB.js → use-automations-CYbzDT4u.js} +1 -1
  186. package/dist/client/assets/{use-capability-D5RkHVsY.js → use-capability-106h__YN.js} +1 -1
  187. package/dist/client/assets/{use-clock-tick-C8uzDjqG.js → use-clock-tick-CcSc5sXm.js} +1 -1
  188. package/dist/client/assets/{use-collections-BS38fOAk.js → use-collections-DzwE9z2Q.js} +1 -1
  189. package/dist/client/assets/{use-connection-D_PAKQYK.js → use-connection-rvwQ0Fgb.js} +1 -1
  190. package/dist/client/assets/{use-copy-ChWDn7wN.js → use-copy-CHohmoCa.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-Dbww-NDJ.js → use-create-virtual-mcp-CK_OIQ5L.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-D5TTbCnW.js → use-debounced-autosave-jAhM8m8l.js} +1 -1
  193. package/dist/client/assets/{use-debounced-value-CP6l0YTo.js → use-debounced-value-OA2R9lhv.js} +1 -1
  194. package/dist/client/assets/{use-deco-credits-DxSlkZSo.js → use-deco-credits-Buq1vVC7.js} +1 -1
  195. package/dist/client/assets/{use-decopilot-events-CsKbUYpD.js → use-decopilot-events-Dqb_0ZxY.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-CI-KqoCN.js → use-delete-connection-DikeljPB.js} +1 -1
  197. package/dist/client/assets/{use-deployment-admin-DlYmABtI.js → use-deployment-admin-B-yaBvMr.js} +1 -1
  198. package/dist/client/assets/{use-file-configs-BgKiLCxP.js → use-file-configs-dFDr0mnb.js} +1 -1
  199. package/dist/client/assets/{use-infinite-scroll-Dju0gd7x.js → use-infinite-scroll-DUHR60xP.js} +1 -1
  200. package/dist/client/assets/{use-join-requests-CoZtVGZa.js → use-join-requests-COu9AVJo.js} +1 -1
  201. package/dist/client/assets/{use-mcp-client-5CLIwOFb.js → use-mcp-client-DoGJoc9f.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-BtDtv81c.js → use-mcp-tools-CWi18Q1k.js} +1 -1
  203. package/dist/client/assets/{use-members-CrRPQSia.js → use-members-DvlBPbZV.js} +1 -1
  204. package/dist/client/assets/{use-mobile-CrJT-KcJ.js → use-mobile-DySFUw6-.js} +1 -1
  205. package/dist/client/assets/{use-navigate-to-agent-B565FU9B.js → use-navigate-to-agent-pvbSK0XI.js} +1 -1
  206. package/dist/client/assets/{use-org-auth-client-DS3gGYHV.js → use-org-auth-client-Cea857-Z.js} +1 -1
  207. package/dist/client/assets/{use-org-sso-BQS4eui0.js → use-org-sso-Dy9vIHAG.js} +1 -1
  208. package/dist/client/assets/{use-organization-roles-BQtxz4xl.js → use-organization-roles-CWlF5Ahz.js} +1 -1
  209. package/dist/client/assets/{use-organization-settings-CYqHwODn.js → use-organization-settings-A5Ico7Ep.js} +1 -1
  210. package/dist/client/assets/{use-registry-connections-DVxExIph.js → use-registry-connections-Bcu4wAMN.js} +1 -1
  211. package/dist/client/assets/{use-secrets-D0VDb8qw.js → use-secrets-B-Ttl8C8.js} +1 -1
  212. package/dist/client/assets/{use-status-sounds-smDb1lOB.js → use-status-sounds-Cok8Zy3K.js} +1 -1
  213. package/dist/client/assets/{use-view-mode-ZnD6ck9i.js → use-view-mode-F64JKZer.js} +1 -1
  214. package/dist/client/assets/{use-virtual-mcp-DNGM7Vf0.js → use-virtual-mcp-DHgMLM9t.js} +1 -1
  215. package/dist/client/assets/useInfiniteQuery-DS7AUFoi.js +1 -0
  216. package/dist/client/assets/{useRouterState-wElu-9fR.js → useRouterState-D8DgcOpl.js} +1 -1
  217. package/dist/client/assets/useSuspenseInfiniteQuery-CAuCASvS.js +1 -0
  218. package/dist/client/assets/{users-CfZnkI5B.js → users-DhBmEN2O.js} +1 -1
  219. package/dist/client/assets/{variant-calendar-PhIoKzXk.js → variant-calendar-Bape-jUB.js} +1 -1
  220. package/dist/client/assets/{view-mode-toggle-C4clwL9D.js → view-mode-toggle-D2-y6Vyu.js} +1 -1
  221. package/dist/client/index.html +2 -2
  222. package/dist/server/cli.js +104 -104
  223. package/dist/server/server.js +60 -60
  224. package/package.json +1 -1
  225. package/dist/client/assets/app-editor-47iREJoJ.js +0 -1
  226. package/dist/client/assets/automations-BbuRp3IV.js +0 -1
  227. package/dist/client/assets/category-editor-ecYoZ4G4.js +0 -1
  228. package/dist/client/assets/commerce-onboarding-BvAupYJb.js +0 -1
  229. package/dist/client/assets/file-explorer-KKJ8k43u.js +0 -2
  230. package/dist/client/assets/index-DZ4REHZZ.js +0 -1
  231. package/dist/client/assets/index-usQYoTw3.css +0 -1
  232. package/dist/client/assets/page-seo-sheet-D5mWXFxQ.js +0 -1
  233. package/dist/client/assets/post-editor-B6STX4q4.js +0 -1
  234. package/dist/client/assets/project-app-view-DZx4mGKF.js +0 -1
  235. package/dist/client/assets/record-editor-DUrpb3N4.js +0 -1
  236. package/dist/client/assets/registry-CVK5EC4U.js +0 -2
  237. package/dist/client/assets/self-tool-result-yTWImnSz.js +0 -1
  238. package/dist/client/assets/seo-editor-Bn-68Hsu.js +0 -1
  239. package/dist/client/assets/store-registry-CZxP2LhF.js +0 -2
  240. package/dist/client/assets/useInfiniteQuery-D4bhAoJe.js +0 -1
  241. package/dist/client/assets/useSuspenseInfiniteQuery-CPz2t3Z-.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.65.0",
3
+ "version": "4.66.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-OPKvaD5e.js";import{i as jt}from"./ChevronRight-T17vENdx.js";import{A as kt}from"./automation-runs-D7aKtmwO.js";import{A as _t}from"./add-section-modal-DByNZ5bZ.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index--R4C_MgQ.js";import"./select-DIcEohwD.js";import"./tooltip-CsAbPDMP.js";import"./Check-CaHIu_54.js";import"./ChevronDown-wpJ7eSNW.js";import"./ChevronUp-tqXddtDI.js";import"./useInfiniteQuery-D4bhAoJe.js";import"./use-infinite-scroll-Dju0gd7x.js";import"./use-connection-D_PAKQYK.js";import"./use-collections-BS38fOAk.js";import"./use-mcp-client-5CLIwOFb.js";import"./constants-D_FQAPnt.js";import"./auth-bmb-9_Tt.js";import"./use-virtual-mcp-DNGM7Vf0.js";import"./card-DRx3sRgJ.js";import"./sidebar-CZTQxJLs.js";import"./LayoutLeft-Bn_iVkhC.js";import"./use-mobile-CrJT-KcJ.js";import"./X-LqY3zO2y.js";import"./table-BalbqL-R.js";import"./empty-state-CJNm_Wx3.js";import"./use-members-CrRPQSia.js";import"./use-org-auth-client-DS3gGYHV.js";import"./use-clock-tick-C8uzDjqG.js";import"./AlertCircle-BgDL5EhB.js";import"./CheckCircle-BjhPCunZ.js";import"./Circle-BAA3CwTd.js";import"./agent-icon-CisP0Ou9.js";import"./UserPlus01-gnDun0R2.js";import"./Tool01-BsZCQETX.js";import"./ArrowUp-DWr3F57S.js";import"./Settings02-6XNEhu4R.js";import"./Tool02-aEAUKug0.js";import"./XCircle-DgZjfIuh.js";import"./ArrowUpRight-BS2OY4HI.js";import"./TrendUp01-CkgBQqG5.js";import"./ZapSquare-DQ3NLTzQ.js";import"./Users03-VH8eefwa.js";import"./Stars02-eYXfAFgH.js";import"./Copy01-C9lon82Q.js";import"./ZoomOut-Bu4oPwRF.js";import"./DotsVertical-DB_iGqrn.js";import"./Globe01-DMJD09Ge.js";import"./Eye-Ckz7kGzj.js";import"./FilterLines-X0jum0_z.js";import"./Flag01-kWWxH4mT.js";import"./Star01-B8h2h-Uj.js";import"./Globe04-Bt452DpH.js";import"./SwitchHorizontal01-6zDad7Gz.js";import"./HardDrive-uQr5LAUZ.js";import"./Key01-CDUJ-GUN.js";import"./LinkExternal01-BHrSTqHo.js";import"./List-B-eIsgzg.js";import"./Monitor01-BJyX6BiR.js";import"./Sun-57G02HLE.js";import"./Package-BLP83WwV.js";import"./Palette-DeKgHlWo.js";import"./Play-BeYBNy6k.js";import"./Plus-M7Z31wrO.js";import"./SearchLg-CCr6DQuW.js";import"./SearchMd-BrC2iZQ1.js";import"./Shield01-BRg-y06k.js";import"./Stars01-vnwDUOxb.js";import"./Trash01-hvdx05ZV.js";import"./Upload01-BFj2T5hE.js";import"./User01-BCTRYgWw.js";import"./Users01-0sZa7AsG.js";import"./XClose-oKRTLLzc.js";import"./Zap-VQGxqYXg.js";import"./use-automations-CWZf2gkB.js";import"./studio-tools-D2Ki1UQb.js";import"./useSuspenseInfiniteQuery-CPz2t3Z-.js";import"./badge-WQxQHFmz.js";import"./checkbox-BGhuCrXh.js";import"./command-C-bk8tFG.js";import"./index-DMIHY7z9.js";import"./dialog-DRLzaEaI.js";import"./popover-kytVQ7GF.js";import"./avatar-C29v0fIv.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChWDn7wN.js";import"./file-type-icon-D2Std2ip.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-BzZSfd51.js";import"./index-BwxH3xVs.js";import"./chat-context-o-fkiWtd.js";import"./autosend-DGYySc7I.js";import"./hooks-DsF-eoVs.js";import"./decopilot-sse-pool-C2G1aaZc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Dhl2T6Yf.js";import"./use-decopilot-events-CsKbUYpD.js";import"./use-organization-settings-CYqHwODn.js";import"./index-CfD5IJ8P.js";import"./shell-layout-fstofeax.js";import"./alert-dialog-uXFRYx4f.js";import"./required-auth-layout-CW5t5wzZ.js";import"./use-org-sso-BQS4eui0.js";import"./integration-icon-BTTrYwxL.js";import"./use-navigate-to-agent-B565FU9B.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-X1qU13E8.js";import"./form-bFOvfGH1.js";import"./label-BjZWcoKQ.js";import"./input-5hdR1OeR.js";import"./drawer-8H5NiaRB.js";import"./collection-search-Dl1rSx6-.js";import"./tabs-CtdbDFi-.js";import"./toggle-group-9woF9vc-.js";import"./use-deco-credits-DxSlkZSo.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-OYBnMPMS.js";import"./use-registry-connections-DVxExIph.js";import"./extract-connection-data-Dj2v22sN.js";import"./collection-tabs-BD_utxXw.js";import"./textarea-DTJ172sF.js";import"./connection-form-helpers-BVf39W69.js";import"./authenticate-and-persist-oauth-D1vIJ8md.js";import"./mcp-oauth-BvkrTvef.js";import"./connect-desktop-dialog-CrMXkeVk.js";import"./select-model-BMoJg7Nz.js";import"./skeleton-Bm6aPYKD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CtPiSWUG.js";import"./dropdown-menu-B3HFJi9W.js";import"./index-BUz-OC8o.js";import"./toolbar-BcDQIQIp.js";import"./use-debounced-value-CP6l0YTo.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-smDb1lOB.js";import"./use-mcp-tools-BtDtv81c.js";import"./use-capability-D5RkHVsY.js";import"./tools-list-D-WxPGDx.js";import"./switch-D0AM0YLZ.js";import"./use-debounced-autosave-D5TTbCnW.js";import"./index-CwvQsRbd.js";import"./search-input-BqGytPeT.js";import"./github-repo-picker-BO7er0hb.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-D0VDb8qw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-DOilxzn5.js";import"./get-initials-D-f_fDFw.js";import"./calendar-zKyIjSj2.js";import"./toolbar-icon-button-IutHuSQN.js";import"./use-file-configs-BgKiLCxP.js";import"./automation-list-row-Dv7DbX11.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Rr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Rr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-OPKvaD5e.js";import{s as q}from"./Plus-M7Z31wrO.js";import{i as S}from"./Zap-VQGxqYXg.js";import{S as D}from"./search-input-BqGytPeT.js";import{P as l}from"./index-CwvQsRbd.js";import{E as b}from"./empty-state-CJNm_Wx3.js";import{c as O}from"./use-automations-CWZf2gkB.js";import{c as V}from"./use-navigate-to-agent-B565FU9B.js";import{A as F}from"./automation-list-row-Dv7DbX11.js";import{f as G}from"./constants-D_FQAPnt.js";import{u as H}from"./use-virtual-mcp-DNGM7Vf0.js";import{R as J}from"./require-capability-BkdOUUx1.js";import"./SearchMd-BrC2iZQ1.js";import"./sidebar-CZTQxJLs.js";import"./LayoutLeft-Bn_iVkhC.js";import"./use-mobile-CrJT-KcJ.js";import"./X-LqY3zO2y.js";import"./tooltip-CsAbPDMP.js";import"./use-mcp-client-5CLIwOFb.js";import"./auth-bmb-9_Tt.js";import"./studio-tools-D2Ki1UQb.js";import"./hooks-DsF-eoVs.js";import"./decopilot-sse-pool-C2G1aaZc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-uXFRYx4f.js";import"./dropdown-menu-B3HFJi9W.js";import"./Check-CaHIu_54.js";import"./ChevronRight-T17vENdx.js";import"./Circle-BAA3CwTd.js";import"./Stars02-eYXfAFgH.js";import"./DotsVertical-DB_iGqrn.js";import"./Trash01-hvdx05ZV.js";import"./agent-icon-CisP0Ou9.js";import"./AlertCircle-BgDL5EhB.js";import"./UserPlus01-gnDun0R2.js";import"./Tool01-BsZCQETX.js";import"./ArrowUp-DWr3F57S.js";import"./Settings02-6XNEhu4R.js";import"./Tool02-aEAUKug0.js";import"./XCircle-DgZjfIuh.js";import"./ArrowUpRight-BS2OY4HI.js";import"./TrendUp01-CkgBQqG5.js";import"./ZapSquare-DQ3NLTzQ.js";import"./Users03-VH8eefwa.js";import"./CheckCircle-BjhPCunZ.js";import"./ChevronDown-wpJ7eSNW.js";import"./ChevronUp-tqXddtDI.js";import"./Copy01-C9lon82Q.js";import"./ZoomOut-Bu4oPwRF.js";import"./Globe01-DMJD09Ge.js";import"./Eye-Ckz7kGzj.js";import"./FilterLines-X0jum0_z.js";import"./Flag01-kWWxH4mT.js";import"./Star01-B8h2h-Uj.js";import"./Globe04-Bt452DpH.js";import"./SwitchHorizontal01-6zDad7Gz.js";import"./HardDrive-uQr5LAUZ.js";import"./Key01-CDUJ-GUN.js";import"./LinkExternal01-BHrSTqHo.js";import"./List-B-eIsgzg.js";import"./Monitor01-BJyX6BiR.js";import"./Sun-57G02HLE.js";import"./Package-BLP83WwV.js";import"./Palette-DeKgHlWo.js";import"./Play-BeYBNy6k.js";import"./SearchLg-CCr6DQuW.js";import"./Shield01-BRg-y06k.js";import"./Stars01-vnwDUOxb.js";import"./Upload01-BFj2T5hE.js";import"./User01-BCTRYgWw.js";import"./Users01-0sZa7AsG.js";import"./XClose-oKRTLLzc.js";import"./use-collections-BS38fOAk.js";import"./use-capability-D5RkHVsY.js";import"./access-gate-BJOY4IeA.js";import"./capability-load-error-CInD3PW6.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function _o(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{_o as default};
@@ -1 +0,0 @@
1
- import{c as q,r as S,l as G,j as t,B as I,i as Q,t as U}from"./index-OPKvaD5e.js";import{i as X}from"./XCircle-DgZjfIuh.js";import{aE as Y,a9 as T}from"./agent-icon-CisP0Ou9.js";import{n as Z}from"./LinkExternal01-BHrSTqHo.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-uXFRYx4f.js";import{I as M}from"./input-5hdR1OeR.js";import{L}from"./label-BjZWcoKQ.js";import{v as at,w as mt,V as nt,o as lt,x as R,A as pt,W as ct,y as dt}from"./index--R4C_MgQ.js";import{c as ut,B as gt,a as xt}from"./block-document-D1Whi6tD.js";import{u as ft,s as v,E as ht}from"./primitives-M4qnFwow.js";import{t as yt}from"./ChevronDown-wpJ7eSNW.js";import{J as jt,K as vt,I as bt}from"./automation-runs-D7aKtmwO.js";import"./AlertCircle-BgDL5EhB.js";import"./UserPlus01-gnDun0R2.js";import"./Tool01-BsZCQETX.js";import"./ArrowUp-DWr3F57S.js";import"./Settings02-6XNEhu4R.js";import"./Tool02-aEAUKug0.js";import"./ArrowUpRight-BS2OY4HI.js";import"./TrendUp01-CkgBQqG5.js";import"./ZapSquare-DQ3NLTzQ.js";import"./Users03-VH8eefwa.js";import"./CheckCircle-BjhPCunZ.js";import"./Check-CaHIu_54.js";import"./ChevronRight-T17vENdx.js";import"./ChevronUp-tqXddtDI.js";import"./Circle-BAA3CwTd.js";import"./Stars02-eYXfAFgH.js";import"./Copy01-C9lon82Q.js";import"./ZoomOut-Bu4oPwRF.js";import"./DotsVertical-DB_iGqrn.js";import"./Globe01-DMJD09Ge.js";import"./Eye-Ckz7kGzj.js";import"./FilterLines-X0jum0_z.js";import"./Flag01-kWWxH4mT.js";import"./Star01-B8h2h-Uj.js";import"./Globe04-Bt452DpH.js";import"./SwitchHorizontal01-6zDad7Gz.js";import"./HardDrive-uQr5LAUZ.js";import"./Key01-CDUJ-GUN.js";import"./LayoutLeft-Bn_iVkhC.js";import"./List-B-eIsgzg.js";import"./Monitor01-BJyX6BiR.js";import"./Sun-57G02HLE.js";import"./Package-BLP83WwV.js";import"./Palette-DeKgHlWo.js";import"./Play-BeYBNy6k.js";import"./Plus-M7Z31wrO.js";import"./SearchLg-CCr6DQuW.js";import"./SearchMd-BrC2iZQ1.js";import"./Shield01-BRg-y06k.js";import"./Stars01-vnwDUOxb.js";import"./Trash01-hvdx05ZV.js";import"./Upload01-BFj2T5hE.js";import"./User01-BCTRYgWw.js";import"./Users01-0sZa7AsG.js";import"./XClose-oKRTLLzc.js";import"./X-LqY3zO2y.js";import"./Zap-VQGxqYXg.js";import"./chat-context-o-fkiWtd.js";import"./autosend-DGYySc7I.js";import"./hooks-DsF-eoVs.js";import"./use-mcp-client-5CLIwOFb.js";import"./constants-D_FQAPnt.js";import"./auth-bmb-9_Tt.js";import"./decopilot-sse-pool-C2G1aaZc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D2Ki1UQb.js";import"./use-virtual-mcp-DNGM7Vf0.js";import"./use-collections-BS38fOAk.js";import"./use-ai-providers-Dhl2T6Yf.js";import"./use-decopilot-events-CsKbUYpD.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-CYqHwODn.js";import"./tooltip-CsAbPDMP.js";import"./dialog-DRLzaEaI.js";import"./drawer-8H5NiaRB.js";import"./collection-search-Dl1rSx6-.js";import"./use-mobile-CrJT-KcJ.js";import"./AreaChart-X1qU13E8.js";import"./index-CfD5IJ8P.js";import"./shell-layout-fstofeax.js";import"./avatar-C29v0fIv.js";import"./required-auth-layout-CW5t5wzZ.js";import"./use-org-sso-BQS4eui0.js";import"./form-bFOvfGH1.js";import"./select-DIcEohwD.js";import"./tabs-CtdbDFi-.js";import"./toggle-group-9woF9vc-.js";import"./use-deco-credits-DxSlkZSo.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-OYBnMPMS.js";import"./use-registry-connections-DVxExIph.js";import"./use-connection-D_PAKQYK.js";import"./useInfiniteQuery-D4bhAoJe.js";import"./use-infinite-scroll-Dju0gd7x.js";import"./extract-connection-data-Dj2v22sN.js";import"./card-DRx3sRgJ.js";import"./integration-icon-BTTrYwxL.js";import"./collection-tabs-BD_utxXw.js";import"./badge-WQxQHFmz.js";import"./textarea-DTJ172sF.js";import"./connection-form-helpers-BVf39W69.js";import"./authenticate-and-persist-oauth-D1vIJ8md.js";import"./mcp-oauth-BvkrTvef.js";import"./useSuspenseInfiniteQuery-CPz2t3Z-.js";import"./connect-desktop-dialog-CrMXkeVk.js";import"./select-model-BMoJg7Nz.js";import"./checkbox-BGhuCrXh.js";import"./skeleton-Bm6aPYKD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CtPiSWUG.js";import"./command-C-bk8tFG.js";import"./index-DMIHY7z9.js";import"./popover-kytVQ7GF.js";import"./dropdown-menu-B3HFJi9W.js";import"./index-BUz-OC8o.js";import"./file-type-icon-D2Std2ip.js";import"./toolbar-BcDQIQIp.js";import"./use-debounced-value-CP6l0YTo.js";import"./index-BwxH3xVs.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-smDb1lOB.js";import"./empty-state-CJNm_Wx3.js";import"./use-mcp-tools-BtDtv81c.js";import"./use-capability-D5RkHVsY.js";import"./tools-list-D-WxPGDx.js";import"./switch-D0AM0YLZ.js";import"./use-debounced-autosave-D5TTbCnW.js";import"./index-CwvQsRbd.js";import"./sidebar-CZTQxJLs.js";import"./search-input-BqGytPeT.js";import"./github-repo-picker-BO7er0hb.js";import"./use-navigate-to-agent-B565FU9B.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-D0VDb8qw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./format-time-BnbuEtat.js";import"./use-members-CrRPQSia.js";import"./use-org-auth-client-DS3gGYHV.js";import"./index-DOilxzn5.js";import"./get-initials-D-f_fDFw.js";import"./calendar-zKyIjSj2.js";import"./toolbar-icon-button-IutHuSQN.js";import"./use-file-configs-BgKiLCxP.js";import"./monaco-editor-BzZSfd51.js";import"./use-automations-CWZf2gkB.js";import"./automation-list-row-Dv7DbX11.js";import"./table-BalbqL-R.js";import"./use-clock-tick-C8uzDjqG.js";import"./use-copy-ChWDn7wN.js";function Ct(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,A=b===void 0?!1:b,[x,D]=S.useState(A);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=G("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(yt,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(vt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(bt,{open:x,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function fr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:A,onManagePosts:x,onOpenPost:D,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=ut({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,E]=S.useState(!1),P=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=P.length,W=o=>s("slug",o),H=async(o,w)=>{const V=v(r.name);E(!0);try{let g=0;for(const{key:z,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:V,slug:w});F!==O&&(await i.mutateAsync({blockKey:z,data:R(z,"posts",dt(F))}),g+=1)}const $={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",$)}),c($),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{E(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){W(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ht,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:A,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:P.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&H(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{fr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as E,j as n,u as Ie,o as De,p as se,r as M,a as Se,b as Fe,q as qe,d as Te,s as Le,Q as He,E as Ve,K as _e,v as Ue,B as je,N as Be}from"./index-OPKvaD5e.js";import{L as Ke,s as ve,S as Pe,a as Ne,b as Ce,c as be,i as Qe,n as pe,C as we,p as xe}from"./self-tool-result-yTWImnSz.js";import{A as We}from"./auth-entry-Dh4Rwjye.js";import{A as Ge}from"./auth-split-layout-D1tOvOpz.js";import{O as Re}from"./organization-choice-Dga8eabF.js";import{I as Ye}from"./input-5hdR1OeR.js";import{u as Je}from"./use-mcp-client-5CLIwOFb.js";import{S as Xe,W as Ze,g as et,a as tt}from"./constants-D_FQAPnt.js";import{i as it}from"./XCircle-DgZjfIuh.js";import"./integration-icon-BTTrYwxL.js";import"./Tool02-aEAUKug0.js";import"./agent-icon-CisP0Ou9.js";import"./AlertCircle-BgDL5EhB.js";import"./UserPlus01-gnDun0R2.js";import"./Tool01-BsZCQETX.js";import"./ArrowUp-DWr3F57S.js";import"./Settings02-6XNEhu4R.js";import"./ArrowUpRight-BS2OY4HI.js";import"./TrendUp01-CkgBQqG5.js";import"./ZapSquare-DQ3NLTzQ.js";import"./Users03-VH8eefwa.js";import"./CheckCircle-BjhPCunZ.js";import"./Check-CaHIu_54.js";import"./ChevronDown-wpJ7eSNW.js";import"./ChevronRight-T17vENdx.js";import"./ChevronUp-tqXddtDI.js";import"./Circle-BAA3CwTd.js";import"./Stars02-eYXfAFgH.js";import"./Copy01-C9lon82Q.js";import"./ZoomOut-Bu4oPwRF.js";import"./DotsVertical-DB_iGqrn.js";import"./Globe01-DMJD09Ge.js";import"./Eye-Ckz7kGzj.js";import"./FilterLines-X0jum0_z.js";import"./Flag01-kWWxH4mT.js";import"./Star01-B8h2h-Uj.js";import"./Globe04-Bt452DpH.js";import"./SwitchHorizontal01-6zDad7Gz.js";import"./HardDrive-uQr5LAUZ.js";import"./Key01-CDUJ-GUN.js";import"./LayoutLeft-Bn_iVkhC.js";import"./LinkExternal01-BHrSTqHo.js";import"./List-B-eIsgzg.js";import"./Monitor01-BJyX6BiR.js";import"./Sun-57G02HLE.js";import"./Package-BLP83WwV.js";import"./Palette-DeKgHlWo.js";import"./Play-BeYBNy6k.js";import"./Plus-M7Z31wrO.js";import"./SearchLg-CCr6DQuW.js";import"./SearchMd-BrC2iZQ1.js";import"./Shield01-BRg-y06k.js";import"./Stars01-vnwDUOxb.js";import"./Trash01-hvdx05ZV.js";import"./Upload01-BFj2T5hE.js";import"./User01-BCTRYgWw.js";import"./Users01-0sZa7AsG.js";import"./XClose-oKRTLLzc.js";import"./X-LqY3zO2y.js";import"./Zap-VQGxqYXg.js";import"./dialog-DRLzaEaI.js";import"./tooltip-CsAbPDMP.js";import"./extract-connection-data-Dj2v22sN.js";import"./github-installations-D2vHSx02.js";import"./form-bFOvfGH1.js";import"./label-BjZWcoKQ.js";import"./use-debounced-value-CP6l0YTo.js";import"./authenticate-and-persist-oauth-D1vIJ8md.js";import"./mcp-oauth-BvkrTvef.js";import"./auth-bmb-9_Tt.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-C29v0fIv.js";const nt={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ot(l){return nt[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=ot(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function Pi(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(st,{}),l[0]=e):e=l[0],e}const Me=M.createContext(null),$e=()=>M.useContext(Me);function R(l){const e=E.c(13);let i,t;e[0]!==l?({visual:t,...i}=l,e[0]=l,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/commerce-onboarding"},e[3]=s):s=e[3];const c=Ie(s),{data:a}=Se.useSession(),o=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==o?(m=Ce({siteUrl:c.siteUrl,email:o}),e[4]=c.siteUrl,e[5]=o,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??n.jsx(be,{href:d}),e[7]=d,e[8]=t,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=n.jsx(Ge,{...i,visual:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}const rt={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:l=>`Código enviado para ${l}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:l=>`Continuar com ${l}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function Oe(l){switch(l){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return l}}let ze=!1;function st(){const l=Ie({from:"/commerce-onboarding"}),{org:e,siteUrl:i}=l,t=ve(i);return!ze&&De()&&(ze=!0,se("commerce_onboarding_viewed",{site_url:i,domain:t??void 0,...t?{$set:{last_scanned_domain:t}}:{}})),n.jsx(Me.Provider,{value:t,children:n.jsx(at,{requestedOrgSlug:e,siteUrl:i})})}function at(l){const e=E.c(8),{requestedOrgSlug:i,siteUrl:t}=l,{data:s,isPending:c}=Se.useSession(),a=$e();if(c){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(R,{children:n.jsx(ye,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!s){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==a?(d=a?n.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=n.jsx(R,{children:n.jsx(We,{callbackUrl:m,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:d,copy:rt})}),e[3]=d,e[4]=u):u=e[4],u}let o;return e[5]!==i||e[6]!==t?(o=n.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=o):o=e[7],o}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,o]=M.useState(null),[m,d]=M.useState(null),u=c.data?.map(mt)??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:ct,retry:!1,onSuccess:r=>{d(r)}},e[0]=v):v=e[0];const p=Te(v);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(R,{children:n.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=n.jsx(ae,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const j=i?u.find(r=>r.slug===i):null;if(j){let r;return e[4]!==j||e[5]!==t?(r=n.jsx(re,{org:j,initialSiteUrl:t}),e[4]=j,e[5]=t,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=n.jsx(ae,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(a){let r;return e[9]!==a||e[10]!==t?(r=n.jsx(re,{org:a,initialSiteUrl:t}),e[9]=a,e[10]=t,e[11]=r):r=e[11],r}if(u.length===1&&u[0]){let r;return e[12]!==u[0]||e[13]!==t?(r=n.jsx(re,{org:u[0],initialSiteUrl:t}),e[12]=u[0],e[13]=t,e[14]=r):r=e[14],r}if(u.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=r):r=e[15];let h;e[16]!==s||e[17]!==t?(h=O=>s({to:"/commerce-onboarding",search:{org:O.slug,siteUrl:t}}),e[16]=s,e[17]=t,e[18]=h):h=e[18];let C;return e[19]!==u||e[20]!==h?(C=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:u,selectLabel:"Continuar",onSelected:h})})]})}),e[19]=u,e[20]=h,e[21]=C):C=e[21],C}if(!m){let r;e[22]!==p?(r=()=>{p.reset(),p.mutate()},e[22]=p,e[23]=r):r=e[23];let h;return e[24]!==p||e[25]!==r?(h=n.jsx(dt,{mutation:p,onRetry:r}),e[24]=p,e[25]=r,e[26]=h):h=e[26],h}const g=m;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let r;return e[27]!==g.organization||e[28]!==t?(r=n.jsx(re,{org:g.organization,initialSiteUrl:t}),e[27]=g.organization,e[28]=t,e[29]=r):r=e[29],r}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let r;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[30]=r):r=e[30];const h=g.domain??void 0;let C;e[31]!==s||e[32]!==t?(C=($,P)=>{Le(),o({...$,slug:P}),s({to:"/commerce-onboarding",search:{org:P,siteUrl:t}})},e[31]=s,e[32]=t,e[33]=C):C=e[33];let O;return e[34]!==g.organizations||e[35]!==h||e[36]!==C?(O=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:g.organizations,domain:h,onJoined:C})})]})}),e[34]=g.organizations,e[35]=h,e[36]=C,e[37]=O):O=e[37],O}const S=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let _;e[38]!==p?(_=()=>{d(null),p.reset()},e[38]=p,e[39]=_):_=e[39];let I;return e[40]!==S||e[41]!==_?(I=n.jsx(ae,{title:"O onboarding de commerce precisa de suporte",description:S,actionLabel:"Tentar novamente",onRetry:_}),e[40]=S,e[41]=_,e[42]=I):I=e[42],I}async function ct(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function mt(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function dt(l){const e=E.c(7),{mutation:i,onRetry:t}=l,s=M.useRef(!1);let c;e[0]!==i?(c=d=>{!d||s.current||(s.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const a=c;if(i.error){let d;return e[2]!==t?(d=n.jsx(ae,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:t}),e[2]=t,e[3]=d):d=e[3],d}let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ye,{variant:"generic"}),e[4]=o):o=e[4];let m;return e[5]!==a?(m=n.jsx(R,{children:n.jsx("div",{ref:a,children:o})}),e[5]=a,e[6]=m):m=e[6],m}function k(l){const e=E.c(8),{title:i,description:t}=l,s=$e();let c;e[0]!==s?(c=s?n.jsx(Pe,{host:s}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==i?(a=(i||t)&&n.jsxs("div",{className:"space-y-2",children:[i&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:t})]}),e[2]=t,e[3]=i,e[4]=a):a=e[4];let o;return e[5]!==c||e[6]!==a?(o=n.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=o):o=e[7],o}function ae(l){const e=E.c(9),{title:i,description:t,actionLabel:s,onRetry:c}=l;let a;e[0]!==t||e[1]!==i?(a=n.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let o;e[3]!==s||e[4]!==c?(o=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=o):o=e[5];let m;return e[6]!==a||e[7]!==o?(m=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[a,o]})}),e[6]=a,e[7]=o,e[8]=m):m=e[8],m}function re(l){const e=E.c(11),{org:i,initialSiteUrl:t}=l,{data:s}=Se.useSession(),c=s?.user?.email;let a;e[0]!==t||e[1]!==c?(a=Ce({siteUrl:t,email:c}),e[0]=t,e[1]=c,e[2]=a):a=e[2];const o=a;let m;e[3]!==o||e[4]!==i.id?(m=n.jsx(be,{href:o,orgId:i.id}),e[3]=o,e[4]=i.id,e[5]=m):m=e[5];const d=m;let u;return e[6]!==t||e[7]!==d||e[8]!==i||e[9]!==s?.user?.email?(u=n.jsx(He,{children:v=>{const{reset:p}=v;return n.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return n.jsx(R,{visual:d,children:n.jsx(ut,{orgName:i.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{p(),S()}})})},children:n.jsx(M.Suspense,{fallback:n.jsx(ke,{visual:d}),children:n.jsx(ft,{org:i,initialSiteUrl:t,sessionEmail:s?.user?.email},`${i.id}:${t??""}`)})})}}),e[6]=t,e[7]=d,e[8]=i,e[9]=s?.user?.email,e[10]=u):u=e[10],u}function ke(l){const e=E.c(3),{visual:i}=l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(k,{}),n.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=n.jsx(R,{align:"fill",visual:i,children:t}),e[1]=i,e[2]=s):s=e[2],s}function ut(l){const e=E.c(10),{orgName:i,message:t,onRetry:s}=l,c=`A configuração de commerce continuará em ${i}.`;let a;e[0]!==c?(a=n.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let o;e[2]!==t?(o=n.jsx(le,{message:t}),e[2]=t,e[3]=o):o=e[3];let m;e[4]!==s?(m=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:s,children:"Tentar novamente"}),e[4]=s,e[5]=m):m=e[5];let d;return e[6]!==a||e[7]!==o||e[8]!==m?(d=n.jsxs("div",{className:"grid gap-10",children:[a,o,m]}),e[6]=a,e[7]=o,e[8]=m,e[9]=d):d=e[9],d}function ft(l){const e=E.c(109),{org:i,initialSiteUrl:t,sessionEmail:s}=l;let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Xe,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const a=Je(c),[o,m]=M.useState(t??""),[d,u]=M.useState(null),v=M.useRef(!1),p=Ze.COMMERCE_DISCOVERY(i.id),j=et(i.id),g=_e.commerceDiscoveryConnection(i.id,p);let S;e[3]!==p||e[4]!==a?(S=async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(f)},e[3]=p,e[4]=a,e[5]=S):S=e[5];let _;e[6]!==g||e[7]!==S?(_={queryKey:g,queryFn:S,retry:!1},e[6]=g,e[7]=S,e[8]=_):_=e[8];const I=Ue(_),r=_e.commerceDiscoveryVirtualMcp(i.id,j);let h;e[9]!==a||e[10]!==j?(h=async()=>{const f=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return xe(f)},e[9]=a,e[10]=j,e[11]=h):h=e[11];let C;e[12]!==r||e[13]!==h?(C={queryKey:r,queryFn:h,retry:!1},e[12]=r,e[13]=h,e[14]=C):C=e[14];const O=Ue(C);let $;e[15]!==a?($=async f=>{const x=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}});return xe(x)},e[15]=a,e[16]=$):$=e[16];let P;e[17]!==I||e[18]!==i.id||e[19]!==O?(P=(f,x)=>{se("commerce_onboarding_setup_succeeded",{domain:ve(x)??void 0,organization_id:i.id}),u(null),I.refetch(),O.refetch()},e[17]=I,e[18]=i.id,e[19]=O,e[20]=P):P=e[20];let A;e[21]!==i.id?(A=(f,x)=>{se("commerce_onboarding_setup_failed",{domain:ve(x)??void 0,organization_id:i.id,error:f instanceof Error?f.message:String(f)}),u(f instanceof Error?f.message:"A configuração do Commerce Discovery falhou.")},e[21]=i.id,e[22]=A):A=e[22];let Q;e[23]!==A||e[24]!==$||e[25]!==P?(Q={mutationFn:$,retry:!1,onSuccess:P,onError:A},e[23]=A,e[24]=$,e[25]=P,e[26]=Q):Q=e[26];const b=Te(Q),Ae=!!I.data.item&&!!O.data.item,Ee=I.data.item,W=typeof Ee?.metadata?.siteUrl=="string"?Ee.metadata.siteUrl:void 0,ce=t||o||"";let G;e[27]!==W||e[28]!==ce?(G=Qe(ce,W),e[27]=W,e[28]=ce,e[29]=G):G=e[29];const Y=Ae&&G,J=t||o||W||"";let X;e[30]!==J||e[31]!==s?(X=Ce({siteUrl:J,email:s}),e[30]=J,e[31]=s,e[32]=X):X=e[32];const me=X;let Z;e[33]!==me||e[34]!==i.id?(Z=n.jsx(be,{href:me,orgId:i.id}),e[33]=me,e[34]=i.id,e[35]=Z):Z=e[35];const y=Z;let ee;e[36]!==b?(ee=f=>{const x=pe(f);if(!x.ok){u(Oe(x.error));return}u(null),b.mutate(x.value)},e[36]=b,e[37]=ee):ee=e[37];const D=ee;let te;e[38]!==t||e[39]!==D||e[40]!==Y?(te=f=>{!f||v.current||Y||!t||(v.current=!0,D(t))},e[38]=t,e[39]=D,e[40]=Y,e[41]=te):te=e[41];const de=te;let ie;e[42]!==i.id||e[43]!==D||e[44]!==o?(ie=f=>{f.preventDefault();const x=pe(o);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(o)},e[42]=i.id,e[43]=D,e[44]=o,e[45]=ie):ie=e[45];const z=ie;if(Y){const f=i.slug;let x;e[46]===Symbol.for("react.memo_cache_sentinel")?(x=crypto.randomUUID(),e[46]=x):x=e[46];let T;e[47]!==i.slug?(T={org:f,taskId:x},e[47]=i.slug,e[48]=T):T=e[48];let U;e[49]!==i.id?(U=tt(i.id),e[49]=i.id,e[50]=U):U=e[50];const L=J||void 0;let N;e[51]!==U.id||e[52]!==L?(N={virtualmcpid:U.id,connect:"1",siteUrl:L},e[51]=U.id,e[52]=L,e[53]=N):N=e[53];let w;return e[54]!==T||e[55]!==N?(w=n.jsx(Be,{to:"/$org/$taskId",params:T,search:N,replace:!0}),e[54]=T,e[55]=N,e[56]=w):w=e[56],w}if(b.isPending){let f;return e[57]!==y?(f=n.jsx(ke,{visual:y}),e[57]=y,e[58]=f):f=e[58],f}if(t){let f,x;if(e[59]!==y||e[60]!==z||e[61]!==t||e[62]!==d||e[63]!==i.name||e[64]!==b.isPending||e[65]!==o){x=Symbol.for("react.early_return_sentinel");e:if(f=pe(t),!f.ok){const fe=`A configuração de commerce continuará em ${i.name}.`;let V;e[68]!==fe?(V=n.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=n.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==o?(B=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=o,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=n.jsxs("div",{className:"grid gap-10",children:[V,ge,B]}),e[75]=V,e[76]=ge,e[77]=B,e[78]=K):K=e[78];let oe;e[79]!==y||e[80]!==K?(oe=n.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=oe):oe=e[81],x=oe;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=o,e[66]=f,e[67]=x}else f=e[66],x=e[67];if(x!==Symbol.for("react.early_return_sentinel"))return x;const T=`O Commerce Discovery está sendo preparado para ${f.value}.`;let U;e[82]!==T?(U=n.jsx(k,{title:"Diagnóstico de commerce",description:T}),e[82]=T,e[83]=U):U=e[83];let L;e[84]!==z||e[85]!==d||e[86]!==b.isPending||e[87]!==o?(L=d?n.jsxs(n.Fragment,{children:[n.jsx(le,{message:d}),n.jsx(he,{siteUrl:o,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):n.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=o,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=n.jsxs("div",{ref:de,className:"grid gap-10",children:[U,L]}),e[89]=U,e[90]=L,e[91]=de,e[92]=N):N=e[92];let w;return e[93]!==y||e[94]!==N?(w=n.jsx(R,{visual:y,children:N}),e[93]=y,e[94]=N,e[95]=w):w=e[95],w}const ue=`A configuração de commerce continuará em ${i.name}.`;let F;e[96]!==ue?(F=n.jsx(k,{title:"Diagnóstico de commerce",description:ue}),e[96]=ue,e[97]=F):F=e[97];let q;e[98]!==z||e[99]!==d||e[100]!==b.isPending||e[101]!==o?(q=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=o,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=n.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let ne;return e[106]!==y||e[107]!==H?(ne=n.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=ne):ne=e[108],ne}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=o):o=e[0];let m;e[1]!==c?(m=_=>c(_.target.value),e[1]=c,e[2]=m):m=e[2];const d=!!t;let u;e[3]!==s||e[4]!==i||e[5]!==m||e[6]!==d?(u=n.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":d,disabled:s}),e[3]=s,e[4]=i,e[5]=m,e[6]=d,e[7]=u):u=e[7];let v;e[8]!==t?(v=t?n.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=n.jsxs("div",{className:"grid gap-2",children:[o,u,v]}),e[10]=u,e[11]=v,e[12]=p):p=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=n.jsxs(je,{type:"submit",size:"xl",className:"w-full",disabled:s,children:["Continuar",j]}),e[14]=s,e[15]=g):g=e[15];let S;return e[16]!==a||e[17]!==p||e[18]!==g?(S=n.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[p,g]}),e[16]=a,e[17]=p,e[18]=g,e[19]=S):S=e[19],S}function le(l){const e=E.c(2),{message:i}=l;let t;return e[0]!==i?(t=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{Pi as default};
@@ -1,2 +0,0 @@
1
- import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bO as Ot,e4 as Tt,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-OPKvaD5e.js";import{F as Ut,l as Vt}from"./index-BwxH3xVs.js";import{d as qt,aA as Qt,aB as Ht,aC as ue,aD as Xt,a9 as _e}from"./agent-icon-CisP0Ou9.js";import{a as Jt}from"./Tool01-BsZCQETX.js";import{s as Yt}from"./XClose-oKRTLLzc.js";import{A as Zt}from"./automation-runs-D7aKtmwO.js";import{b as ze,T as We,a as Ge}from"./tooltip-CsAbPDMP.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-uXFRYx4f.js";import{b as cn}from"./chat-context-o-fkiWtd.js";import{u as dn}from"./shell-layout-fstofeax.js";import{s as fe,a as Ke,f as un}from"./index--R4C_MgQ.js";import{a as fn,h as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-DRLzaEaI.js";import{I as Be}from"./input-5hdR1OeR.js";import{t as vn}from"./ChevronDown-wpJ7eSNW.js";import{i as yn}from"./ChevronRight-T17vENdx.js";import{a as Cn}from"./ZoomOut-Bu4oPwRF.js";import{E as wn,v as Ue,w as Ce,x as bn,y as jn,z as Nn,A as U,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-BUz-OC8o.js";import"./AlertCircle-BgDL5EhB.js";import"./UserPlus01-gnDun0R2.js";import"./ArrowUp-DWr3F57S.js";import"./Settings02-6XNEhu4R.js";import"./Tool02-aEAUKug0.js";import"./XCircle-DgZjfIuh.js";import"./ArrowUpRight-BS2OY4HI.js";import"./TrendUp01-CkgBQqG5.js";import"./ZapSquare-DQ3NLTzQ.js";import"./Users03-VH8eefwa.js";import"./CheckCircle-BjhPCunZ.js";import"./Check-CaHIu_54.js";import"./ChevronUp-tqXddtDI.js";import"./Circle-BAA3CwTd.js";import"./Stars02-eYXfAFgH.js";import"./Copy01-C9lon82Q.js";import"./DotsVertical-DB_iGqrn.js";import"./Globe01-DMJD09Ge.js";import"./Eye-Ckz7kGzj.js";import"./FilterLines-X0jum0_z.js";import"./Flag01-kWWxH4mT.js";import"./Star01-B8h2h-Uj.js";import"./Globe04-Bt452DpH.js";import"./SwitchHorizontal01-6zDad7Gz.js";import"./HardDrive-uQr5LAUZ.js";import"./Key01-CDUJ-GUN.js";import"./LayoutLeft-Bn_iVkhC.js";import"./LinkExternal01-BHrSTqHo.js";import"./List-B-eIsgzg.js";import"./Monitor01-BJyX6BiR.js";import"./Sun-57G02HLE.js";import"./Package-BLP83WwV.js";import"./Palette-DeKgHlWo.js";import"./Play-BeYBNy6k.js";import"./Plus-M7Z31wrO.js";import"./SearchLg-CCr6DQuW.js";import"./SearchMd-BrC2iZQ1.js";import"./Shield01-BRg-y06k.js";import"./Stars01-vnwDUOxb.js";import"./Trash01-hvdx05ZV.js";import"./Upload01-BFj2T5hE.js";import"./User01-BCTRYgWw.js";import"./Users01-0sZa7AsG.js";import"./X-LqY3zO2y.js";import"./Zap-VQGxqYXg.js";import"./select-DIcEohwD.js";import"./useInfiniteQuery-D4bhAoJe.js";import"./use-infinite-scroll-Dju0gd7x.js";import"./use-connection-D_PAKQYK.js";import"./use-collections-BS38fOAk.js";import"./use-mcp-client-5CLIwOFb.js";import"./constants-D_FQAPnt.js";import"./auth-bmb-9_Tt.js";import"./use-virtual-mcp-DNGM7Vf0.js";import"./card-DRx3sRgJ.js";import"./sidebar-CZTQxJLs.js";import"./use-mobile-CrJT-KcJ.js";import"./table-BalbqL-R.js";import"./empty-state-CJNm_Wx3.js";import"./use-members-CrRPQSia.js";import"./use-org-auth-client-DS3gGYHV.js";import"./use-clock-tick-C8uzDjqG.js";import"./use-automations-CWZf2gkB.js";import"./studio-tools-D2Ki1UQb.js";import"./useSuspenseInfiniteQuery-CPz2t3Z-.js";import"./badge-WQxQHFmz.js";import"./checkbox-BGhuCrXh.js";import"./command-C-bk8tFG.js";import"./index-DMIHY7z9.js";import"./popover-kytVQ7GF.js";import"./avatar-C29v0fIv.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChWDn7wN.js";import"./file-type-icon-D2Std2ip.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-BzZSfd51.js";import"./delay-CnY5UFtP.js";import"./index-CfD5IJ8P.js";import"./hooks-DsF-eoVs.js";import"./decopilot-sse-pool-C2G1aaZc.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-BTTrYwxL.js";import"./use-navigate-to-agent-B565FU9B.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-X1qU13E8.js";import"./form-bFOvfGH1.js";import"./label-BjZWcoKQ.js";import"./autosend-DGYySc7I.js";import"./use-ai-providers-Dhl2T6Yf.js";import"./use-decopilot-events-CsKbUYpD.js";import"./use-organization-settings-CYqHwODn.js";import"./required-auth-layout-CW5t5wzZ.js";import"./use-org-sso-BQS4eui0.js";import"./drawer-8H5NiaRB.js";import"./collection-search-Dl1rSx6-.js";import"./tabs-CtdbDFi-.js";import"./toggle-group-9woF9vc-.js";import"./use-deco-credits-DxSlkZSo.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-OYBnMPMS.js";import"./use-registry-connections-DVxExIph.js";import"./extract-connection-data-Dj2v22sN.js";import"./collection-tabs-BD_utxXw.js";import"./textarea-DTJ172sF.js";import"./connection-form-helpers-BVf39W69.js";import"./authenticate-and-persist-oauth-D1vIJ8md.js";import"./mcp-oauth-BvkrTvef.js";import"./connect-desktop-dialog-CrMXkeVk.js";import"./select-model-BMoJg7Nz.js";import"./skeleton-Bm6aPYKD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CtPiSWUG.js";import"./dropdown-menu-B3HFJi9W.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-smDb1lOB.js";import"./toolbar-BcDQIQIp.js";import"./use-mcp-tools-BtDtv81c.js";import"./use-capability-D5RkHVsY.js";import"./tools-list-D-WxPGDx.js";import"./switch-D0AM0YLZ.js";import"./use-debounced-autosave-D5TTbCnW.js";import"./index-CwvQsRbd.js";import"./search-input-BqGytPeT.js";import"./github-repo-picker-BO7er0hb.js";import"./use-debounced-value-CP6l0YTo.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-D0VDb8qw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-DOilxzn5.js";import"./get-initials-D-f_fDFw.js";import"./calendar-zKyIjSj2.js";import"./toolbar-icon-button-IutHuSQN.js";import"./use-file-configs-BgKiLCxP.js";import"./automation-list-row-Dv7DbX11.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),C=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let O;e[9]!==C.description?(O=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=O):O=e[10];let G;e[11]!==$||e[12]!==O?(G=r.jsxs(pn,{children:[$,O]}),e[11]=$,e[12]=O,e[13]=G):G=e[13];let T;e[14]!==m?(T=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=T):T=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==T?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[T,P]}),e[22]=P,e[23]=T,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[On,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Ot(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(On,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Tt,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var Tn="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=Tn;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.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)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.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)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("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",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("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",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let O;e[0]!==$?(O=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=O):O=e[1];const G=`${a*14+8}px`;let T;e[2]!==G?(T={paddingLeft:G},e[2]=G,e[3]=T):T=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==O||e[16]!==T||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:O,style:T,onClick:A,children:[R,P]})}),e[15]=O,e[16]=T,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function is({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,O]=u.useState(!1),[,G]=u.useState(new Set),[T,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(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 st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Oe(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Oe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:wn});ke(n,!1,t),O(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Te(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||C(n=>[...n,t]),Te(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Oe(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
2
- `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(t.target.value),placeholder:"Search files...","aria-label":"Search files",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(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&T.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",U(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[V.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:V.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Te(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),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(Yt,{size:12})})]},t)})}),b&&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()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(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:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"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:d&&ee?.loaded?r.jsx(Ut,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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:"Select a file to edit"})}),d&&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:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":U(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{is as FileExplorer};
@@ -1 +0,0 @@
1
- import{c as A,b as de,C as Z,D as Hs,j as s,B as Ge,r as F,F as Bs,E as St,a as re,v as Gs,K as es,d as gt,p as ne,G as et,l as D,H as Ws,I as qs,J as Vs,M as Ks,P as Ys,q as Xs,t as ae,s as Qs,i as ts,e as _t,u as tt,L as Js,R as Zs,U as en,V as tn,W as sn,m as nn,X as ln,O as rn,Y as on}from"./index-OPKvaD5e.js";import{u as pe,S as Nt,a as Ct,b as ie,c as J,d as V,e as ss,f as an,g as ns,h as cn,i as Re,j as dn,k as mn,l as un}from"./sidebar-CZTQxJLs.js";import{u as wt}from"./use-mobile-CrJT-KcJ.js";import{C as fn,p as ut,s as hn,b as xn,S as pn,d as gn,e as bn,c as jn,n as vn}from"./self-tool-result-yTWImnSz.js";import{f as yn,a as is,e as ls,g as Sn,D as _n,h as Nn,d as Cn}from"./dialog-DRLzaEaI.js";import{f as wn}from"./tab-id-bb-jjgGv.js";import{u as rs}from"./use-mcp-client-5CLIwOFb.js";import{C as kn,W as os,g as In,S as as,a as Qe,i as An,b as zn}from"./constants-D_FQAPnt.js";import{i as cs}from"./XCircle-DgZjfIuh.js";import{S as ce}from"./skeleton-Bm6aPYKD.js";import{i as ds}from"./LayoutLeft-Bn_iVkhC.js";import{t as kt}from"./ChevronDown-wpJ7eSNW.js";import{T as fe,a as he,b as xe,c as bt}from"./tooltip-CsAbPDMP.js";import{u as ms,a as It}from"./use-virtual-mcp-DNGM7Vf0.js";import{A as je,a as Tt,i as Ot,t as $n,b as Tn,c as Mt,d as On,s as Mn,e as En}from"./agent-icon-CisP0Ou9.js";import{P as Fe,a as st,b as nt}from"./popover-kytVQ7GF.js";import{i as us}from"./Check-CaHIu_54.js";import{s as Le}from"./Plus-M7Z31wrO.js";import{i as fs}from"./SearchMd-BrC2iZQ1.js";import{s as Dn}from"./XClose-oKRTLLzc.js";import{A as Pn,a as Fn,b as Rn,c as Ln,d as Un,e as Hn,f as Bn}from"./alert-dialog-uXFRYx4f.js";import{F as Gn,a as Wn,b as qn,c as Vn,d as Kn,e as Yn,f as Xn}from"./form-bFOvfGH1.js";import{I as Qn}from"./input-5hdR1OeR.js";import{S as Jn,u as Zn,C as ei}from"./chat-context-o-fkiWtd.js";import{T as ve}from"./toolbar-icon-button-IutHuSQN.js";import{D as hs,a as xs,b as ps}from"./drawer-8H5NiaRB.js";import{G as ti,a as si}from"./github-repo-picker-BO7er0hb.js";import{u as gs,a as At,b as ni,T as ii}from"./hooks-DsF-eoVs.js";import{r as li,u as zt,f as ri}from"./shell-layout-fstofeax.js";import{u as oi,g as ai,a as ci,b as di,S as bs}from"./use-navigate-to-agent-B565FU9B.js";import{g as mi,a as js,u as ui,A as fi,b as hi}from"./use-deco-credits-DxSlkZSo.js";import{f as xi}from"./reusable-new-chat-CouMjkYR.js";import{A as Je}from"./avatar-C29v0fIv.js";import{a as Et}from"./Copy01-C9lon82Q.js";import{n as pi,i as gi}from"./Globe01-DMJD09Ge.js";import{i as bi}from"./ZoomOut-Bu4oPwRF.js";import{i as Dt,a as ji}from"./ZapSquare-DQ3NLTzQ.js";import{i as jt}from"./Monitor01-BJyX6BiR.js";import{n as vi,a as yi}from"./Sun-57G02HLE.js";import{a as it}from"./Settings02-6XNEhu4R.js";import{i as Si}from"./Shield01-BRg-y06k.js";import{a as _i}from"./Users03-VH8eefwa.js";import{u as Ni}from"./use-deployment-admin-DlYmABtI.js";import"./index-ClTfvZWv.js";import{t as vs}from"./UserPlus01-gnDun0R2.js";import{I as ys}from"./invite-member-dialog-D16Cbjug.js";import{v as Ci,C as Pt}from"./connect-desktop-dialog-CrMXkeVk.js";import{u as lt}from"./use-organization-settings-CYqHwODn.js";import{i as wi}from"./FilterLines-X0jum0_z.js";import{T as ki,a as Ii}from"./toggle-group-9woF9vc-.js";import{C as Ai,a as zi,b as $i,c as Ti,d as Oi}from"./command-C-bk8tFG.js";import{u as Ss}from"./studio-tools-D2Ki1UQb.js";import{i as _s}from"./Zap-VQGxqYXg.js";import{S as Ns,M as Mi}from"./shell-controls-CjtgfTkK.js";import{n as Ei}from"./Stars02-eYXfAFgH.js";import{g as Di,u as Pi,S as Fi}from"./use-clock-tick-C8uzDjqG.js";import{a as Ri}from"./format-time-BnbuEtat.js";import{i as Li}from"./ChevronRight-T17vENdx.js";import{T as se}from"./toolbar-BcDQIQIp.js";import"./X-LqY3zO2y.js";import"./integration-icon-BTTrYwxL.js";import"./Tool02-aEAUKug0.js";import"./CheckCircle-BjhPCunZ.js";import"./extract-connection-data-Dj2v22sN.js";import"./github-installations-D2vHSx02.js";import"./Eye-Ckz7kGzj.js";import"./use-debounced-value-CP6l0YTo.js";import"./authenticate-and-persist-oauth-D1vIJ8md.js";import"./mcp-oauth-BvkrTvef.js";import"./auth-bmb-9_Tt.js";import"./ArrowUpRight-BS2OY4HI.js";import"./use-collections-BS38fOAk.js";import"./AlertCircle-BgDL5EhB.js";import"./Tool01-BsZCQETX.js";import"./ArrowUp-DWr3F57S.js";import"./TrendUp01-CkgBQqG5.js";import"./ChevronUp-tqXddtDI.js";import"./Circle-BAA3CwTd.js";import"./DotsVertical-DB_iGqrn.js";import"./Flag01-kWWxH4mT.js";import"./Star01-B8h2h-Uj.js";import"./Globe04-Bt452DpH.js";import"./SwitchHorizontal01-6zDad7Gz.js";import"./HardDrive-uQr5LAUZ.js";import"./Key01-CDUJ-GUN.js";import"./LinkExternal01-BHrSTqHo.js";import"./List-B-eIsgzg.js";import"./Package-BLP83WwV.js";import"./Palette-DeKgHlWo.js";import"./Play-BeYBNy6k.js";import"./SearchLg-CCr6DQuW.js";import"./Stars01-vnwDUOxb.js";import"./Trash01-hvdx05ZV.js";import"./Upload01-BFj2T5hE.js";import"./User01-BCTRYgWw.js";import"./Users01-0sZa7AsG.js";import"./label-BjZWcoKQ.js";import"./autosend-DGYySc7I.js";import"./use-ai-providers-Dhl2T6Yf.js";import"./use-decopilot-events-CsKbUYpD.js";import"./decopilot-sse-pool-C2G1aaZc.js";import"./backoff-CrEUbyZT.js";import"./collection-search-Dl1rSx6-.js";import"./use-connection-D_PAKQYK.js";import"./use-mcp-tools-BtDtv81c.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-CW5t5wzZ.js";import"./use-org-sso-BQS4eui0.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-OYBnMPMS.js";import"./use-registry-connections-DVxExIph.js";import"./useInfiniteQuery-D4bhAoJe.js";import"./use-infinite-scroll-Dju0gd7x.js";import"./card-DRx3sRgJ.js";import"./collection-tabs-BD_utxXw.js";import"./badge-WQxQHFmz.js";import"./select-DIcEohwD.js";import"./textarea-DTJ172sF.js";import"./connection-form-helpers-BVf39W69.js";import"./useSuspenseInfiniteQuery-CPz2t3Z-.js";import"./use-org-auth-client-DS3gGYHV.js";import"./use-organization-roles-BQtxz4xl.js";import"./index-DMIHY7z9.js";import"./differenceInSeconds-NQ4PDo0z.js";function Ui(t){const e=A.c(15),{siteUrl:n}=t,l=de(),{org:i}=Z();let r;e[0]!==l||e[1]!==i.id||e[2]!==i.slug?(r=()=>{localStorage.setItem(Hs.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:i.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:In(i.id),main:wn(os.COMMERCE_DISCOVERY(i.id),kn),sidepanel:0}})},e[0]=l,e[1]=i.id,e[2]=i.slug,e[3]=r):r=e[3];const o=r;let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yn,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=a):a=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(is,{className:"sr-only",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),e[5]=m):m=e[5];let c;e[6]!==o?(c=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Não foi possível carregar as integrações. Você pode continuar e abrir o relatório mesmo assim."}),s.jsxs(Ge,{type:"button",size:"xl",className:"w-full",onClick:o,children:["Continuar",s.jsx(cs,{size:18})]})]}),e[6]=o,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(fn,{}),e[8]=d):d=e[8];let u;e[9]!==o||e[10]!==n?(u=s.jsx(F.Suspense,{fallback:d,children:s.jsx(Wi,{siteUrlFromUrl:n,onComplete:o})}),e[9]=o,e[10]=n,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=s.jsx(ls,{open:!0,children:s.jsxs(Sn,{children:[a,s.jsxs(Bs,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Gi,onPointerDownOutside:Bi,onInteractOutside:Hi,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:[m,s.jsx(St,{fallback:c,children:u})]})]})}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function Hi(t){return t.preventDefault()}function Bi(t){return t.preventDefault()}function Gi(t){return t.preventDefault()}function Wi({siteUrlFromUrl:t,onComplete:e}){const{org:n}=Z(),{data:l}=re.useSession(),i=os.COMMERCE_DISCOVERY(n.id),r=rs({connectionId:as,orgId:n.id,orgSlug:n.slug}),a=Gs({queryKey:es.commerceDiscoveryConnection(n.id,i),queryFn:async()=>{const y=await r.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ut(y)},retry:!1}).data.item,m=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||m,d=hn(c),[u,f]=F.useState(!0),[h,x]=F.useState(null),g=gt({mutationFn:async y=>ut(await r.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}})),retry:!1}),p=gt({mutationFn:async y=>ut(await r.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:y}})),retry:!1}),b=xn({siteUrl:c,email:l?.user?.email}),j=async()=>{x(null),ne("commerce_onboarding_open_report_clicked",{domain:d??void 0,organization_id:n.id});const y=c?vn(c):null;if(y?.ok)try{let v=await p.mutateAsync(y.value);if(v.triggered||(ne("commerce_onboarding_run_reclaim",{domain:d??void 0,organization_id:n.id,reason:v.reason??"not_upgraded"}),await g.mutateAsync(y.value),v=await p.mutateAsync(y.value)),!v.triggered){ne("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:v.reason??"not_triggered"}),x("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(v){ne("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:v instanceof Error?v.message:String(v)}),x("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[d?s.jsx(pn,{host:d}):null,s.jsx(gn,{org:n,cdConnectionId:i,siteUrl:c,onReadinessChange:f}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(bn,{href:b,orgId:n.id,className:"lg:hidden"}),h?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:h}):null,s.jsxs(Ge,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{j()},disabled:p.isPending||!u,children:[p.isPending?"Abrindo relatório...":u?"Ver relatório completo":"Conecte uma ferramenta para continuar",!p.isPending&&u?s.jsx(cs,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(jn,{href:b,orgId:n.id})})]})}function qi(t){const e=A.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={left:"var(--sidebar-width)"},a=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[0]=o,e[1]=a):(o=e[0],a=e[1]);let m;return e[2]!==l||e[3]!==n?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=m):m=e[4],m}const $t=240,Vi=400,Ki="sidebar.width";function Ue(t){return Math.max($t,Math.min(Vi,t))}function Yi(){const t=A.c(11),[e,n]=et(Ki,Xi),l=F.useRef(null);let i;t[0]!==n||t[1]!==e?(i=d=>{d.preventDefault();const u=d.clientX,f=Ue(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const g=b=>{const j=Ue(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},p=b=>{const j=Ue(f+(b.clientX-u));n(j);for(const y of x)y.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let o;t[3]!==n?(o=()=>{n($t)},t[3]=n,t[4]=o):o=t[4];const a=o;let m;t[5]!==e?(m=Ue(e),t[5]=e,t[6]=m):m=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==m?(c={width:m,wrapperRef:l,onStartResize:r,resetWidth:a},t[7]=r,t[8]=a,t[9]=m,t[10]=c):c=t[10],c}function Xi(t){return typeof t=="number"?Ue(t):$t}function Cs(){return[]}function ws(t){const e=A.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(Nt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(Ct,{children:s.jsx(ie,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function ks(t){const e=A.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{ne("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const o=r,a=n.key,m=n.isActive&&"z-10";let c;e[4]!==m?(c=D(m),e[4]=m,e[5]=c):c=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(u=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(V,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Qi(t){const e=A.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ss,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(Zi),e[2]=n.group.items,e[3]=r):r=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(o=s.jsx(ws,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map(Ji),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(Nt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ct,{children:s.jsx(ie,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function Ji(t){return s.jsx(ks,{item:t},t.key)}function Zi(t){return s.jsx(ks,{item:t},t.key)}function el(t){const e=A.c(17),{sections:n,footer:l,additionalContent:i,header:r,variant:o,contentClassName:a}=t,m=o===void 0?"sidebar":o;let c;e[0]!==r?(c=r&&s.jsx(an,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:r}),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=D("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n.map(tl),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==i?(f=i&&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:i}),e[6]=i,e[7]=f):f=e[7];let h;e[8]!==d||e[9]!==u||e[10]!==f?(h=s.jsxs(ns,{className:d,children:[u,f]}),e[8]=d,e[9]=u,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==m?(x=s.jsxs(cn,{variant:m,children:[c,h,l]}),e[12]=l,e[13]=c,e[14]=h,e[15]=m,e[16]=x):x=e[16],x}function tl(t,e){return s.jsx(Qi,{section:t},e)}function Is(t){const e=A.c(2);let n;return e[0]!==t?(n=s.jsx(el,{...t}),e[0]=t,e[1]=n):n=e[1],n}Is.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(ce,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function As(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const sl=Ws({name:qs().min(2,"Organization name is required")});function nl(t){const e=A.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Vs(sl),defaultValues:{name:""}},e[0]=i):i=e[0];const r=Ks(i);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:ll,onSuccess:il},e[1]=o):o=e[1];const a=gt(o),m=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Rn,{children:[s.jsx(Ln,{children:"Create a new organization"}),s.jsx(Un,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let d;if(e[3]!==a||e[4]!==r){let _;e[6]!==a?(_=S=>a.mutateAsync(S),e[6]=a,e[7]=_):_=e[7],d=r.handleSubmit(_),e[3]=a,e[4]=r,e[5]=d}else d=e[5];let u;e[8]!==r.formState.isSubmitting?(u=_=>{const{field:S}=_;return s.jsxs(qn,{children:[s.jsx(Vn,{children:"Organization Name"}),s.jsx(Kn,{children:s.jsx(Qn,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(Yn,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",As(S.value)]})]}),s.jsx(Xn,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(Gn,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==m?(h=m&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[13]=m,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==r?(x=()=>{a.reset(),r.reset()},e[15]=a,e[16]=r,e[17]=x):x=e[17];let g;e[18]!==r.formState.isSubmitting||e[19]!==x?(g=s.jsx(Pn,{disabled:r.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const p=!r.formState.isValid||r.formState.isSubmitting;let b;e[21]!==r.formState.isSubmitting?(b=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Jn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==p||e[24]!==b?(j=s.jsx(Ge,{type:"submit",variant:"default",disabled:p,children:b}),e[23]=p,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==g?(y=s.jsxs(Hn,{children:[g,j]}),e[26]=j,e[27]=g,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==d||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=d,e[31]=f,e[32]=h,e[33]=v):v=e[33];let C;e[34]!==r||e[35]!==v?(C=s.jsxs(Fn,{children:[c,s.jsx(Wn,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=C):C=e[36];let N;return e[37]!==l||e[38]!==n||e[39]!==C?(N=s.jsx(Bn,{open:n,onOpenChange:l,children:C}),e[37]=l,e[38]=n,e[39]=C,e[40]=N):N=e[40],N}function il(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ll(t){const e=As(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await re.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function zs(){const t=F.useContext(Ys),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function rl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function rt(t){const e=A.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",o=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==r?(a=D(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=a):a=e[1];let m;e[2]!==n.logo||e[3]!==n.name?(m=n.logo?void 0:rl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=m):m=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:D("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==m||e[11]!==c?(d=s.jsx("div",{className:a,style:m,children:c}),e[9]=a,e[10]=m,e[11]=c,e[12]=d):d=e[12],d}function ol({invitation:t,onChanged:e}){const[n,l]=F.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const m=await re.organization.acceptInvitation({invitationId:t.id});if(m.error){ae.error(m.error.message),l(!1);return}}catch{ae.error("Failed to accept invitation"),l(!1);return}ae.success(`Joined ${i}`),Qs();let a;try{a=(await re.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},o=async()=>{l(!0);try{const a=await re.organization.rejectInvitation({invitationId:t.id});if(a.error){ae.error(a.error.message),l(!1);return}ae.success("Invitation declined"),l(!1),e()}catch{ae.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(rt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Ge,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Ge,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:o,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(Dn,{size:14})})]})]})}function al(t){const e=A.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Xs(),{invitations:o,refetch:a}=zs();let m;e[0]!==n?(m=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=m):m=e[1];const c=[...r??[]].sort(m),[d,u]=F.useState(""),f=d.toLowerCase(),h=f?c.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fs,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=w=>u(w.target.value),e[3]=g):g=e[3];let p;e[4]!==d?(p=w=>w.key==="Escape"&&d&&u(""),e[4]=d,e[5]=p):p=e[5];let b;e[6]!==d||e[7]!==p?(b=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:g,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=b):b=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Le,{size:16}),e[9]=j):j=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==b||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,y]}),e[12]=b,e[13]=y,e[14]=v):v=e[14];const C="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let N;e[15]!==o||e[16]!==d||e[17]!==a?(N=!d&&o.map(w=>s.jsx(ol,{invitation:w,onChanged:a},w.id)),e[15]=o,e[16]=d,e[17]=a,e[18]=N):N=e[18];const _=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=w=>s.jsxs("button",{type:"button",onClick:()=>l(w.slug),className:D("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(rt,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const k=h.map(S);let I;e[22]!==N||e[23]!==_||e[24]!==k?(I=s.jsxs("div",{className:C,children:[N,_,k]}),e[22]=N,e[23]=_,e[24]=k,e[25]=I):I=e[25];let $;return e[26]!==I||e[27]!==v?($=s.jsxs(s.Fragment,{children:[v,I]}),e[26]=I,e[27]=v,e[28]=$):$=e[28],$}function $s(t){const e=A.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,o=i===void 0?"start":i,a=r===void 0?"bottom":r,m=de(),[c,d]=F.useState(!1),[u,f]=F.useState(!1);let h;e[0]!==n?(h=s.jsx(Fe,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const x=String(c);let g;e[2]!==m?(g=N=>{d(!1),m({to:"/$org",params:{org:N}})},e[2]=m,e[3]=g):g=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(!1),f(!0)},e[4]=p):p=e[4];let b;e[5]!==l||e[6]!==x||e[7]!==g?(b=s.jsx(al,{orgParam:l,onSelectOrg:g,onCreateOrg:p},x),e[5]=l,e[6]=x,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(st,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:dl,onCloseAutoFocus:cl,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==j?(y=s.jsxs(nt,{open:c,onOpenChange:d,children:[h,j]}),e[13]=c,e[14]=h,e[15]=j,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(nl,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let C;return e[19]!==v||e[20]!==y?(C=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=C):C=e[21],C}function cl(t){return t.preventDefault()}function dl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ml(t){const e=A.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:o,isSearching:a,disabled:m}=t,c=i===void 0?"Search...":i;let d;e[0]!==o?(d=D("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=d):d=e[1];const u=m?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=D("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(ts,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(fs,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let x;e[6]!==l?(x=j=>l(j.target.value),e[6]=l,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==c||e[11]!==x||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:r,placeholder:c,disabled:m,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=m,e[9]=r,e[10]=c,e[11]=x,e[12]=n,e[13]=g):g=e[13];let p;e[14]!==f||e[15]!==h||e[16]!==g?(p=s.jsxs("label",{className:f,children:[h,g]}),e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17];let b;return e[18]!==d||e[19]!==p?(b=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=b):b=e[20],b}const ul="Select an existing agent";function fl(t){const e=A.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{side:"right",sideOffset:8,children:ul}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(xe,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function hl(t){const e=de(),{create:n}=gs(),{locator:l}=Z(),i=_t({strict:!1}),r=tt({strict:!1});return async o=>{const a=crypto.randomUUID(),m=o===r.virtualmcpid?li(t,l,i.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...m?{branch:m}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function ft(t){const e=A.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==r?(o=D("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(je,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let m;e[5]!==n.title?(m=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=m):m=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==m||e[10]!==c?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=d):d=e[11];let u;e[12]!==l?(u=l&&s.jsx(us,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==o||e[16]!==a||e[17]!==d||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:o,children:[a,d,u]}),e[14]=i,e[15]=o,e[16]=a,e[17]=d,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=A.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function xl(t){const e=A.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[o,a]=F.useState(""),m=ms(),c=m??[],{org:d}=Z(),{data:u}=re.useSession(),f=u?.user?.id??"anon",h=ai(m),x=ci(),g=hl(d.slug),p=mi(m),b=o.toLowerCase(),j=c.filter(jl).filter(W=>!p.has(W.id)).filter(bl).filter(W=>!o||W.title.toLowerCase().includes(b)),y=j.filter(gl),v=j.filter(pl),C=Qe(d.id),N=!o||C.title.toLowerCase().includes(b),_=!!(l&&N);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),a("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const k=S,I=W=>{if(l){l(W.id),n(),a("");return}di({orgId:d.id,userId:f},W.id,h),x(),n(),a(""),g(W.id)},$="flex flex-col max-h-[min(640px,80dvh)]";let w;e[3]!==o?(w=s.jsx(ml,{value:o,onChange:a,placeholder:"Search agents..."}),e[3]=o,e[4]=w):w=e[4];const z="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&N&&C&&s.jsx(ft,{agent:C,selected:!i||i===C.id,onClick:k}),P=v.length>0&&s.jsx(Ft,{children:"Agents"}),U=v.map(W=>s.jsx(ft,{agent:W,selected:l?i===W.id:void 0,onClick:()=>I(W)},W.id)),R=(y.length>0||!o)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(si,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),E=y.map(W=>s.jsx(ft,{agent:W,selected:l?i===W.id:void 0,onClick:()=>I(W)},W.id));let O;e[5]!==_||e[6]!==o||e[7]!==j.length?(O=j.length===0&&!_&&o&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=_,e[6]=o,e[7]=j.length,e[8]=O):O=e[8];let H;e[9]!==O||e[10]!==M||e[11]!==P||e[12]!==U||e[13]!==R||e[14]!==E?(H=s.jsxs("div",{className:z,children:[M,P,U,R,E,O]}),e[9]=O,e[10]=M,e[11]=P,e[12]=U,e[13]=R,e[14]=E,e[15]=H):H=e[15];let G;e[16]!==d.slug?(G={org:d.slug},e[16]=d.slug,e[17]=G):G=e[17];let L;e[18]!==n?(L=()=>n(),e[18]=n,e[19]=L):L=e[19];let B;e[20]!==G||e[21]!==L?(B=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Js,{to:"/$org/settings/agents",params:G,onClick:L,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=G,e[21]=L,e[22]=B):B=e[22];let Y;return e[23]!==H||e[24]!==B||e[25]!==w?(Y=s.jsxs("div",{className:$,children:[w,H,B]}),e[23]=H,e[24]=B,e[25]=w,e[26]=Y):Y=e[26],Y}function pl(t){return!js(t.metadata)}function gl(t){return js(t.metadata)}function bl(t){return!zn(t.id)}function jl(t){return!An(t.id)}function vl(t){const e=A.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:o,side:a,align:m}=n,c=l===void 0?!1:l,d=a===void 0?"right":a,u=m===void 0?"start":m,[f,h]=F.useState(!1),[x,g]=F.useState(!1),p=wt(),{setOpenMobile:b}=pe(),j=oi(),y=j?"border border-border":void 0;let v;e[2]!==j?(v=P=>j?s.jsx(fl,{children:P}):P,e[2]=j,e[3]=v):v=e[3];const C=v;let N;e[4]!==p||e[5]!==b?(N=()=>{h(!1),p&&b(!1)},e[4]=p,e[5]=b,e[6]=N):N=e[6];const _=N;let S;e[7]!==_?(S=()=>{_(),g(!0)},e[7]=_,e[8]=S):S=e[8];const k=S;let I;e[9]!==_||e[10]!==k||e[11]!==r||e[12]!==f||e[13]!==o?(I=f&&s.jsx(F.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ce,{className:"h-4 w-24"})}),children:s.jsx(xl,{onClose:_,onSelectAgent:r,selectedAgentId:o,onImportFromGithub:k})}),e[9]=_,e[10]=k,e[11]=r,e[12]=f,e[13]=o,e[14]=I):I=e[14];const $=I;let w;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==j||e[19]!==p||e[20]!==f||e[21]!==$||e[22]!==d||e[23]!==i||e[24]!==C?(w=p?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?C(s.jsx(ve,{"aria-label":"Browse agents",className:D(y),onClick:()=>{ne("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(Le,{className:"size-4"})})):s.jsx(V,{children:C(s.jsxs(J,{tooltip:j?void 0:"Browse agents",className:D(y),onClick:()=>{ne("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(Le,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(hs,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(xs,{className:"max-h-[85dvh] p-0",children:[s.jsx(ps,{className:"sr-only",children:"Browse agents"}),$]})})]}):s.jsxs(nt,{open:f,onOpenChange:P=>{P&&!f&&ne("agent_browser_opened",{surface:"desktop_popover"}),h(P)},children:[i?s.jsx(Fe,{asChild:!0,children:i}):c?C(s.jsx(Fe,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:D(y),children:s.jsx(Le,{className:"size-4"})})})):s.jsx(V,{children:C(s.jsx(Fe,{asChild:!0,children:s.jsxs(J,{tooltip:j?void 0:"Browse agents",className:D(y),children:[s.jsx(Le,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(st,{className:"w-[380px] p-0 overflow-hidden",side:d,align:u,children:$})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=j,e[19]=p,e[20]=f,e[21]=$,e[22]=d,e[23]=i,e[24]=C,e[25]=w):w=e[25];let z;e[26]!==x?(z=s.jsx(ti,{open:x,onOpenChange:g,mode:"agent"}),e[26]=x,e[27]=z):z=e[27];let M;return e[28]!==z||e[29]!==w?(M=s.jsxs(s.Fragment,{children:[w,z]}),e[28]=z,e[29]=w,e[30]=M):M=e[30],M}const yl="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Sl(t){const e=A.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,o=It(n)??l??null,a=o?.title??"Super Agent",m=`Open ${a} home`,c=o?.icon??null;let d;e[0]!==c||e[1]!==a?(d=s.jsx(je,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==i||e[4]!==m||e[5]!==d?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":m,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=i,e[4]=m,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(kt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:yl,children:[f,h]}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==n||e[13]!==r||e[14]!==x?(g=s.jsx(vl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=g):g=e[15];let p;return e[16]!==u||e[17]!==g?(p=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=p):p=e[18],p}function vt(t){const e=A.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:l}=n,{org:i}=Z(),{state:r,isMobile:o}=pe(),a=zs().invitations.length>0,m=r==="collapsed"||o,c=a?`${i.name} — switch organization (pending invitation)`:`${i.name} — switch organization`;let d;e[2]!==i?(d=s.jsx(rt,{org:i,size:"sm"}),e[2]=i,e[3]=d):d=e[3];let u;e[4]!==a||e[5]!==m?(u=a&&s.jsx("span",{className:D("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==d||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[d,u]}),e[7]=d,e[8]=u,e[9]=f):f=e[9];let h;e[10]!==i.name||e[11]!==l?(h=l&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[10]=i.name,e[11]=l,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(kt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==h?(g=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[f,h,x]})}),e[14]=c,e[15]=f,e[16]=h,e[17]=g):g=e[17];let p;e[18]!==i.slug||e[19]!==g?(p=s.jsx($s,{orgParam:i.slug,trigger:g}),e[18]=i.slug,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==i.name?(b=s.jsx(he,{side:"bottom",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==p?(j=s.jsxs(xe,{children:[p,b]}),e[23]=b,e[24]=p,e[25]=j):j=e[25],j}function ot(t){const e=A.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:l}=n,{org:i}=Z(),r=de();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[2]=o):o=e[2];const a=_t(o);let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[3]=m):m=e[3];const c=tt(m),{threads:d}=At(),{data:u}=re.useSession(),{setTaskId:f,createNewTask:h}=zt();let x;e[4]!==i.id?(x=Qe(i.id),e[4]=i.id,e[5]=x):x=e[5];const g=x,p=g.id,b=a.taskId?c.virtualmcpid??p:p;let j;e[6]!==h||e[7]!==p||e[8]!==r||e[9]!==l||e[10]!==i.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==d?(j=S=>{if(!S||S===p){r({to:"/$org",params:{org:i.slug}}),l?.();return}const k=xi(d,S,u?.user?.id);k?f(k.id,S):h(S),l?.()},e[6]=h,e[7]=p,e[8]=r,e[9]=l,e[10]=i.slug,e[11]=u?.user?.id,e[12]=f,e[13]=d,e[14]=j):j=e[14];const y=j;let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=v):v=e[15];const C=b===p?g:void 0;let N;e[16]!==b||e[17]!==y?(N=()=>y(b),e[16]=b,e[17]=y,e[18]=N):N=e[18];let _;return e[19]!==b||e[20]!==y||e[21]!==C||e[22]!==N?(_=s.jsx(F.Suspense,{fallback:v,children:s.jsx(Sl,{agentId:b,fallback:C,onOpenHome:N,onPick:y})}),e[19]=b,e[20]=y,e[21]=C,e[22]=N,e[23]=_):_=e[23],_}function Rt(t){const e=A.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=D(i),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=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 m;e[7]!==n.label?(m=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=m):m=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==m?(c=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,m]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=m,e[14]=c):c=e[14];let d;return e[15]!==r||e[16]!==c?(d=s.jsx(V,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=d):d=e[17],d}function _l(t){const e=A.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ss,{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,r=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let m;e[5]!==l?(m=c=>s.jsx(Rt,{item:c,onClose:l},c.key),e[5]=l,e[6]=m):m=e[6],o=n.group.items.map(m),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(ws,{label:i,defaultExpanded:r,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(Rt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],i=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(Nt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ct,{children:s.jsx(ie,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function Nl(t){const e=A.c(24),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(ot,{onNavigate:l}),e[1]=l,e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1"}),e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ds,{size:16}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx(ve,{onClick:l,"aria-label":"Close sidebar",children:c}),e[5]=l,e[6]=d):d=e[6];let u;e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[o,a,m,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;if(e[10]!==l||e[11]!==n){let p;e[13]!==l?(p=(b,j)=>s.jsx(_l,{section:b,onClose:l},j),e[13]=l,e[14]=p):p=e[14],f=n.map(p),e[10]=l,e[11]=n,e[12]=f}else f=e[12];let h;e[15]!==r?(h=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs(ns,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let g;return e[20]!==i||e[21]!==u||e[22]!==x?(g=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,x,i]}),e[20]=i,e[21]=u,e[22]=x,e[23]=g):g=e[23],g}function Pe(t){const e=A.c(26),{item:n,onClose:l}=t;let i;e[0]!==n.className?(i=D("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]=i):i=e[1];const r=i;if(n.href){const d=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let h;e[4]!==n.label?(h=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=h):h=e[5];let x;return e[6]!==r||e[7]!==n.href||e[8]!==l||e[9]!==d||e[10]!==u||e[11]!==f||e[12]!==h?(x=s.jsxs("a",{href:n.href,target:d,rel:u,className:r,onClick:l,children:[f,h]}),e[6]=r,e[7]=n.href,e[8]=l,e[9]=d,e[10]=u,e[11]=f,e[12]=h,e[13]=x):x=e[13],x}let o;e[14]!==n||e[15]!==l?(o=()=>{n.onClick?.(),l()},e[14]=n,e[15]=l,e[16]=o):o=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 m;e[19]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=m):m=e[20];let c;return e[21]!==r||e[22]!==o||e[23]!==a||e[24]!==m?(c=s.jsxs("button",{type:"button",onClick:o,className:r,children:[a,m]}),e[21]=r,e[22]=o,e[23]=a,e[24]=m,e[25]=c):c=e[25],c}function Lt(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-amber-100 dark:bg-amber-500/20 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-400",children:"Impersonating"}),t[0]=e):e=t[0],e}function Ut(t){const e=A.c(144),{user:n,userImage:l,menuItems:i,signOutItem:r,stopImpersonatingItem:o,isImpersonating:a,themeOptions:m,preferences:c,setPreferences:d,close:u,isMobile:f}=t;if(f){const X=n?.name??"U";let ee;e[0]!==X||e[1]!==l?(ee=s.jsx(Je,{url:l,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=l,e[2]=ee):ee=e[2];const ge=n?.name??"User";let te;e[3]!==ge?(te=s.jsx("p",{className:"text-sm font-medium truncate",children:ge}),e[3]=ge,e[4]=te):te=e[4];let oe;e[5]!==a?(oe=a&&s.jsx(Lt,{}),e[5]=a,e[6]=oe):oe=e[6];let le;e[7]!==te||e[8]!==oe?(le=s.jsxs("div",{className:"flex items-center gap-2",children:[te,oe]}),e[7]=te,e[8]=oe,e[9]=le):le=e[9];const T=n?.email;let q;e[10]!==T?(q=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:T}),e[10]=T,e[11]=q):q=e[11];let Q;e[12]!==le||e[13]!==q?(Q=s.jsxs("div",{className:"flex-1 min-w-0",children:[le,q]}),e[12]=le,e[13]=q,e[14]=Q):Q=e[14];let K;e[15]!==n?(K=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Il)},e[15]=n,e[16]=K):K=e[16];let be;e[17]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(Et,{size:14}),e[17]=be):be=e[17];let Se;e[18]!==K?(Se=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:K,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:be})}),e[18]=K,e[19]=Se):Se=e[19];let We;e[20]===Symbol.for("react.memo_cache_sentinel")?(We=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[20]=We):We=e[20];let _e;e[21]!==Se?(_e=s.jsx(bt,{delayDuration:300,children:s.jsxs(xe,{children:[Se,We]})}),e[21]=Se,e[22]=_e):_e=e[22];let Ne;e[23]!==_e||e[24]!==ee||e[25]!==Q?(Ne=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[ee,Q,_e]}),e[23]=_e,e[24]=ee,e[25]=Q,e[26]=Ne):Ne=e[26];let Ce;if(e[27]!==u||e[28]!==i){let ue;e[30]!==u?(ue=Ke=>s.jsx(Pe,{item:Ke,onClose:u},Ke.key),e[30]=u,e[31]=ue):ue=e[31],Ce=i.map(ue),e[27]=u,e[28]=i,e[29]=Ce}else Ce=e[29];let we;e[32]!==u||e[33]!==o?(we=o&&s.jsx(Pe,{item:o,onClose:u}),e[32]=u,e[33]=o,e[34]=we):we=e[34];let ke;e[35]!==u||e[36]!==r?(ke=s.jsx(Pe,{item:r,onClose:u}),e[35]=u,e[36]=r,e[37]=ke):ke=e[37];let Ie;e[38]!==Ce||e[39]!==we||e[40]!==ke?(Ie=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:[Ce,we,ke]})}),e[38]=Ce,e[39]=we,e[40]=ke,e[41]=Ie):Ie=e[41];let Ae;if(e[42]!==c.theme||e[43]!==d||e[44]!==m){let ue;e[46]!==c.theme||e[47]!==d?(ue=Ke=>{const{value:mt,icon:Rs,label:Ls}=Ke;return s.jsx("button",{type:"button","aria-label":Ls,onClick:()=>d(Us=>({...Us,theme:mt})),className:D("size-8 rounded-md flex items-center justify-center transition-colors",c.theme===mt?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Rs},mt)},e[46]=c.theme,e[47]=d,e[48]=ue):ue=e[48],Ae=m.map(ue),e[42]=c.theme,e[43]=d,e[44]=m,e[45]=Ae}else Ae=e[45];let ze;e[49]!==Ae?(ze=s.jsx("div",{className:"flex items-center gap-0.5",children:Ae}),e[49]=Ae,e[50]=ze):ze=e[50];const ct=c.enableSounds?"Disable sounds":"Enable sounds";let $e;e[51]!==d?($e=()=>d(kl),e[51]=d,e[52]=$e):$e=e[52];const dt=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Te;e[53]!==dt?(Te=D("size-8 rounded-md flex items-center justify-center transition-colors",dt),e[53]=dt,e[54]=Te):Te=e[54];let Oe;e[55]!==c.enableSounds?(Oe=c.enableSounds?s.jsx(Tt,{size:14}):s.jsx(Ot,{size:14}),e[55]=c.enableSounds,e[56]=Oe):Oe=e[56];let Me;e[57]!==ct||e[58]!==$e||e[59]!==Te||e[60]!==Oe?(Me=s.jsx("button",{type:"button","aria-label":ct,onClick:$e,className:Te,children:Oe}),e[57]=ct,e[58]=$e,e[59]=Te,e[60]=Oe,e[61]=Me):Me=e[61];let qe;e[62]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.65.0"]}),e[62]=qe):qe=e[62];let Ee;e[63]!==Me?(Ee=s.jsxs("div",{className:"flex items-center gap-2",children:[Me,qe]}),e[63]=Me,e[64]=Ee):Ee=e[64];let De;e[65]!==ze||e[66]!==Ee?(De=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ze,Ee]}),e[65]=ze,e[66]=Ee,e[67]=De):De=e[67];let Ve;return e[68]!==Ne||e[69]!==Ie||e[70]!==De?(Ve=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Ne,Ie,De]}),e[68]=Ne,e[69]=Ie,e[70]=De,e[71]=Ve):Ve=e[71],Ve}const h=n?.name??"U";let x;e[72]!==h||e[73]!==l?(x=s.jsx(Je,{url:l,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[72]=h,e[73]=l,e[74]=x):x=e[74];const g=n?.name??"User";let p;e[75]!==g?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[75]=g,e[76]=p):p=e[76];let b;e[77]!==a?(b=a&&s.jsx(Lt,{}),e[77]=a,e[78]=b):b=e[78];let j;e[79]!==p||e[80]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[79]=p,e[80]=b,e[81]=j):j=e[81];const y=n?.email;let v;e[82]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[82]=y,e[83]=v):v=e[83];let C;e[84]!==j||e[85]!==v?(C=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[84]=j,e[85]=v,e[86]=C):C=e[86];let N;e[87]!==n?(N=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wl)},e[87]=n,e[88]=N):N=e[88];let _;e[89]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Et,{size:14}),e[89]=_):_=e[89];let S;e[90]!==N?(S=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:N,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[90]=N,e[91]=S):S=e[91];let k;e[92]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[92]=k):k=e[92];let I;e[93]!==S?(I=s.jsx(bt,{delayDuration:300,children:s.jsxs(xe,{children:[S,k]})}),e[93]=S,e[94]=I):I=e[94];let $;e[95]!==I||e[96]!==x||e[97]!==C?($=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[x,C,I]}),e[95]=I,e[96]=x,e[97]=C,e[98]=$):$=e[98];let w;if(e[99]!==u||e[100]!==i){let X;e[102]!==u?(X=ee=>s.jsx(Pe,{item:ee,onClose:u},ee.key),e[102]=u,e[103]=X):X=e[103],w=i.map(X),e[99]=u,e[100]=i,e[101]=w}else w=e[101];let z;e[104]!==u||e[105]!==o?(z=o&&s.jsx(Pe,{item:o,onClose:u}),e[104]=u,e[105]=o,e[106]=z):z=e[106];let M;e[107]!==u||e[108]!==r?(M=s.jsx(Pe,{item:r,onClose:u}),e[107]=u,e[108]=r,e[109]=M):M=e[109];let P;e[110]!==w||e[111]!==z||e[112]!==M?(P=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[w,z,M]}),e[110]=w,e[111]=z,e[112]=M,e[113]=P):P=e[113];let U;if(e[114]!==c.theme||e[115]!==d||e[116]!==m){let X;e[118]!==c.theme||e[119]!==d?(X=ee=>{const{value:ge,icon:te,label:oe}=ee;return s.jsx("button",{type:"button","aria-label":oe,onClick:()=>d(le=>({...le,theme:ge})),className:D("size-7 rounded-md flex items-center justify-center transition-colors",c.theme===ge?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:te},ge)},e[118]=c.theme,e[119]=d,e[120]=X):X=e[120],U=m.map(X),e[114]=c.theme,e[115]=d,e[116]=m,e[117]=U}else U=e[117];let R;e[121]!==U?(R=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[121]=U,e[122]=R):R=e[122];const E=c.enableSounds?"Disable sounds":"Enable sounds";let O;e[123]!==d?(O=()=>d(Cl),e[123]=d,e[124]=O):O=e[124];const H=c.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let G;e[125]!==H?(G=D("size-7 rounded-md flex items-center justify-center transition-colors",H),e[125]=H,e[126]=G):G=e[126];let L;e[127]!==c.enableSounds?(L=c.enableSounds?s.jsx(Tt,{size:14}):s.jsx(Ot,{size:14}),e[127]=c.enableSounds,e[128]=L):L=e[128];let B;e[129]!==E||e[130]!==O||e[131]!==G||e[132]!==L?(B=s.jsx("button",{type:"button","aria-label":E,onClick:O,className:G,children:L}),e[129]=E,e[130]=O,e[131]=G,e[132]=L,e[133]=B):B=e[133];let Y;e[134]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.65.0"]}),e[134]=Y):Y=e[134];let W;e[135]!==B?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[B,Y]}),e[135]=B,e[136]=W):W=e[136];let me;e[137]!==R||e[138]!==W?(me=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[R,W]}),e[137]=R,e[138]=W,e[139]=me):me=e[139];let ye;return e[140]!==$||e[141]!==P||e[142]!==me?(ye=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[$,P,me]})}),e[140]=$,e[141]=P,e[142]=me,e[143]=ye):ye=e[143],ye}function Cl(t){return{...t,enableSounds:!t.enableSounds}}function wl(){ae.success("User ID copied")}function kl(t){return{...t,enableSounds:!t.enableSounds}}function Il(){ae.success("User ID copied")}function He(){const t=A.c(43),{data:e}=re.useSession(),{org:n}=Z(),l=de();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const o=Zs(i)?.params.org,[a,m]=en(),c=wt(),{isAdmin:d}=Ni(),[u,f]=F.useState(!1),h=e?.user,x=h?.image,g=!!e?.session?.impersonatedBy;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>f(!1),t[1]=p):p=t[1];const b=p;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(it,{size:16}),t[2]=j):j=t[2];let y;t[3]!==l||t[4]!==o?(y={key:"preferences",label:"Preferences",icon:j,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=y):y=t[5];let v;t[6]!==n||t[7]!==l?(v=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(pi,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=v):v=t[8];let C;t[9]===Symbol.for("react.memo_cache_sentinel")?(C={key:"terms",label:"Terms of Use",icon:s.jsx(bi,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=C):C=t[9];let N;t[10]===Symbol.for("react.memo_cache_sentinel")?(N={key:"privacy",label:"Privacy Policy",icon:s.jsx(Si,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=N):N=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(tn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S={key:"community",label:"Community",icon:s.jsx(_i,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=S):S=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k={key:"homepage",label:"Homepage",icon:s.jsx(gi,{size:16}),href:"https://decocms.com",external:!0},t[13]=k):k=t[13];let I;t[14]!==d||t[15]!==l?(I=d?[{key:"admin-dashboard",label:"Admin Dashboard",icon:s.jsx($n,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-amber-700 dark:text-amber-400"}]:[],t[14]=d,t[15]=l,t[16]=I):I=t[16];let $;t[17]!==I||t[18]!==y||t[19]!==v?($=[y,...v,C,N,_,S,k,...I],t[17]=I,t[18]=y,t[19]=v,t[20]=$):$=t[20];const w=$;let z;t[21]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(Dt,{size:16}),onClick:$l},t[21]=z):z=t[21];const M=z;let P;t[22]!==g?(P=g?{key:"stop-impersonating",label:"Stop impersonation",icon:s.jsx(Dt,{size:16}),onClick:zl,className:"text-amber-700 dark:text-amber-400"}:null,t[22]=g,t[23]=P):P=t[23];const U=P;let R;t[24]===Symbol.for("react.memo_cache_sentinel")?(R={value:"light",icon:s.jsx(vi,{size:14}),label:"Light theme"},t[24]=R):R=t[24];let E;t[25]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(yi,{size:14}),label:"Dark theme"},t[25]=E):E=t[25];let O;t[26]===Symbol.for("react.memo_cache_sentinel")?(O=[R,E,{value:"system",icon:s.jsx(jt,{size:14}),label:"System theme"}],t[26]=O):O=t[26];const H=O;let G;t[27]!==g||t[28]!==c||t[29]!==w||t[30]!==a||t[31]!==m||t[32]!==U||t[33]!==h||t[34]!==x?(G={user:h,userImage:x,menuItems:w,signOutItem:M,stopImpersonatingItem:U,isImpersonating:g,themeOptions:H,preferences:a,setPreferences:m,close:b,isMobile:c},t[27]=g,t[28]=c,t[29]=w,t[30]=a,t[31]=m,t[32]=U,t[33]=h,t[34]=x,t[35]=G):G=t[35];const L=G;let B;return t[36]!==g||t[37]!==c||t[38]!==u||t[39]!==L||t[40]!==h?.name||t[41]!==x?(B=s.jsx(s.Fragment,{children:c?s.jsxs(hs,{open:u,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:D("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",g&&"border-2 border-dashed border-amber-500"),children:[s.jsx(Je,{url:x,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(xs,{className:"h-[80dvh] p-0",children:[s.jsx(ps,{className:"sr-only",children:"Account"}),s.jsx(Ut,{...L})]})]}):s.jsxs(nt,{open:u,onOpenChange:f,children:[s.jsx(Fe,{asChild:!0,children:s.jsxs(J,{tooltip:h?.name??"Account",className:D("rounded-md",g&&"border-2 border-dashed border-amber-500"),children:[s.jsx(Je,{url:x,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]})}),s.jsx(st,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Al,children:s.jsx(Ut,{...L})})]})}),t[36]=g,t[37]=c,t[38]=u,t[39]=L,t[40]=h?.name,t[41]=x,t[42]=B):B=t[42],B}function Al(t){return t.preventDefault()}async function zl(){const{error:t}=await re.admin.stopImpersonating();if(t){ae.error(t.message||"Failed to stop impersonation");return}window.location.href="/"}function $l(){ne("signed_out",{source:"account_popover"}),sn(),re.signOut()}function Be(t){const e=A.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=Zn(),[r,o]=F.useState(!1);let a,m;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=Ci(i.capabilities);a=i.online?"Desktop linked":"Connect desktop",m=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=a,e[5]=m}else a=e[4],m=e[5];const c=m;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>o(!0),v=s.jsx(jt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let C;e[8]!==a?(C=s.jsx("span",{children:a}),e[8]=a,e[9]=C):C=e[9];let N;e[10]!==i.online?(N=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=N):N=e[11];let _;e[12]!==a||e[13]!==C||e[14]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(J,{tooltip:a,onClick:y,children:[v,C,N]})}),e[12]=a,e[13]=C,e[14]=N,e[15]=_):_=e[15];let S;e[16]!==c?(S=s.jsx(he,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let k;e[18]!==_||e[19]!==S?(k=s.jsxs(xe,{children:[_,S]}),e[18]=_,e[19]=S,e[20]=k):k=e[20];let I;e[21]!==r?(I=s.jsx(Pt,{open:r,onOpenChange:o}),e[21]=r,e[22]=I):I=e[22];let $;return e[23]!==I||e[24]!==k?($=s.jsxs(s.Fragment,{children:[k,I]}),e[23]=I,e[24]=k,e[25]=$):$=e[25],$}let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),e[26]=d):d=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(jt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let x;e[30]!==u||e[31]!==h?(x=s.jsx(fe,{asChild:!0,children:s.jsxs(ve,{onClick:d,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=x):x=e[32];let g;e[33]!==c?(g=s.jsx(he,{side:"bottom",children:c}),e[33]=c,e[34]=g):g=e[34];let p;e[35]!==x||e[36]!==g?(p=s.jsxs(xe,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=p):p=e[37];let b;e[38]!==r?(b=s.jsx(Pt,{open:r,onOpenChange:o}),e[38]=r,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[40]=b,e[41]=p,e[42]=j):j=e[42],j}class Tl extends F.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 Ol(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ml(){const t=A.c(17),e=de(),{org:n}=Z(),{hasDecoKey:l,balanceDollars:i}=ui();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let o;t[2]!==i?(o=D(i!=null&&Ol(i)),t[2]=i,t[3]=o):o=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 m;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Tn,{}),t[7]=m):m=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let d;t[10]!==c?(d=s.jsx("span",{children:c}),t[10]=c,t[11]=d):d=t[11];let u;return t[12]!==r||t[13]!==o||t[14]!==a||t[15]!==d?(u=s.jsx(ie,{children:s.jsx(V,{children:s.jsxs(J,{tooltip:r,className:o,onClick:a,children:[m,d]})})}),t[12]=r,t[13]=o,t[14]=a,t[15]=d,t[16]=u):u=t[16],u}function Ht(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Tl,{children:s.jsx(F.Suspense,{fallback:null,children:s.jsx(Ml,{})})}),t[0]=e):e=t[0],e}function ht(){const t=A.c(7),e=de(),{org:n}=Z();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let o;return t[5]!==l?(o=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=o):o=t[6],o}function El(){const t=A.c(6),e=de(),{org:n}=Z();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{size:15}),t[3]=i):i=t[3];let r;return t[4]!==l?(r=s.jsx("button",{type:"button","aria-label":"Settings",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:i}),t[4]=l,t[5]=r):r=t[5],r}function Bt(){const t=A.c(4),[e,n]=F.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(V,{children:s.jsx(ys,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(vs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ie,{className:"gap-0.5",children:[l,s.jsx(V,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(ji,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(fi,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Gt(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ie,{className:"gap-0.5",children:s.jsx(V,{children:s.jsx(ys,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(vs,{}),s.jsx("span",{children:"Invite members"})]})})})}),t[0]=e):e=t[0],e}function Dl(){const t=A.c(17),{state:e}=pe(),n=e==="collapsed";if(lt()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{}),t[0]=f):f=t[0];let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Be,{})})}),t[1]=h):h=t[1];let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(V,{children:s.jsx(ht,{})}),t[2]=x):x=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(Re,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(ie,{children:[h,x,s.jsx(V,{children:s.jsx(He,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Gt,{}),t[4]=c):c=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(V,{children:s.jsx(Be,{variant:"full"})}),t[5]=d):d=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Re,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(ie,{className:"gap-0.5",children:[d,s.jsx(V,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(He,{})}),s.jsx(El,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Bt,{}),d=s.jsx(Ht,{}),t[7]=c,t[8]=d):(c=t[7],d=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(V,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Be,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(V,{children:s.jsx(ht,{})}),t[10]=f):f=t[10];let h;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(Re,{className:"px-2 pb-3 gap-1",children:[c,d,s.jsxs(ie,{children:[u,f,s.jsx(V,{children:s.jsx(He,{})})]})]}),t[11]=h):h=t[11],h}let i,r;t[12]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{}),r=s.jsx(Ht,{}),t[12]=i,t[13]=r):(i=t[12],r=t[13]);let o;t[14]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(V,{children:s.jsx(Be,{variant:"full"})}),t[14]=o):o=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(V,{children:s.jsx(ht,{})}),t[15]=a):a=t[15];let m;return t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(Re,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ie,{className:"gap-0.5",children:[o,a,s.jsx(V,{children:s.jsx(He,{})})]})]}),t[16]=m):m=t[16],m}function Pl(){const t=A.c(8),e=de(),{org:n}=Z(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ie,{children:s.jsx(V,{children:s.jsx(He,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(it,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==r?(a=s.jsx(Re,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:o})]})}),t[6]=r,t[7]=a):a=t[7],a}function Wt(t){const e=A.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,o]=F.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const m=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const d=c;let u;e[2]!==l?(u=D("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:m,onScroll:d,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let x;e[7]!==h?(x=D("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=x):x=e[8];let g;e[9]!==x?(g=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=g):g=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==g?(p=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=p):p=e[14],p}function Fl(t){const e=A.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let o;e[0]!==r||e[1]!==n?(o=n?s.jsx(Rl,{virtualMcpId:n,size:r}):s.jsx(je,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(_s,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==a?(m=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=m):m=e[7],m}function Rl(t){const e=A.c(6),{virtualMcpId:n,size:l}=t,i=It(n);if(!i){let a;return e[0]!==l?(a=s.jsx(je,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const r=i.icon??null;let o;return e[2]!==i.title||e[3]!==l||e[4]!==r?(o=s.jsx(je,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=o):o=e[5],o}function qt(t){const e=A.c(36),{open:n,onOpenChange:l}=t,[i,r]=F.useState(""),{org:o}=Z(),{setTaskId:a}=zt(),m=Ss();let c,d,u;e[0]!==o.id||e[1]!==i?(u=i.trim(),d=nn,c=es.globalSearch(o.id,u),e[0]=o.id,e[1]=i,e[2]=c,e[3]=d,e[4]=u):(c=e[2],d=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==m||e[6]!==u?(h=async()=>await m.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=m,e[6]=u,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==h?(x={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=x):x=e[11];const{data:g,isFetching:p}=d(x);let b;e[12]!==g?.items?(b=g?.items??[],e[12]=g?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==l?(y=z=>{z||r(""),l(z)},e[14]=l,e[15]=y):y=e[15];const v=y;let C;e[16]!==v||e[17]!==a?(C=z=>{v(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=C):C=e[18];const N=C;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(_n,{className:"sr-only",children:[s.jsx(is,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let S;e[20]!==i?(S=s.jsx($i,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let k;e[22]!==N||e[23]!==p||e[24]!==j||e[25]!==u?(k=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Ai,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(zi,{value:`thread:${z.id}:${z.title}`,onSelect:()=>N(z),className:"gap-2.5",children:[s.jsx(Fl,{virtualMcpId:z.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:z.title||"Untitled chat"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=N,e[23]=p,e[24]=j,e[25]=u,e[26]=k):k=e[26];let I;e[27]!==k?(I=s.jsx(Ti,{children:k}),e[27]=k,e[28]=I):I=e[28];let $;e[29]!==S||e[30]!==I?($=s.jsxs(Cn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Oi,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,I]})]}),e[29]=S,e[30]=I,e[31]=$):$=e[31];let w;return e[32]!==v||e[33]!==n||e[34]!==$?(w=s.jsx(ls,{open:n,onOpenChange:v,children:$}),e[32]=v,e[33]=n,e[34]=$,e[35]=w):w=e[35],w}function Ll(t){return t==="ephemeral"||t.startsWith("thread:")}function Ts(t){const e=A.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:o,showAgentIcon:a,hideStatusIdle:m,indented:c}=t,d=Di(n.status),u=d.icon,f=n.metadata?.kind==="tool_call_run",h=It(f?void 0:n.virtual_mcp_id);let x;e[0]!==h?(x=hi(h),e[0]=h,e[1]=x):x=e[1];const g=x;Pi(6e4);const p=o||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==i?(v=H=>{H.target===H.currentTarget&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const C=c?"-ml-4 pl-6":"pl-[7px]",N=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==C||e[5]!==N?(_=D("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=_):_=e[6];let S;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(S=a&&!f&&s.jsx(je,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let k;e[12]!==p?(k=p&&s.jsx(_s,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=k):k=e[13];const I=n.title||"Untitled task";let $;e[14]!==I?($=s.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[14]=I,e[15]=$):$=e[15];let w;e[16]!==k||e[17]!==$?(w=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[k,$]}),e[16]=k,e[17]=$,e[18]=w):w=e[18];let z;e[19]!==g||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:D("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ll(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):g?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Ri(new Date(n.updated_at))})]}),e[19]=g,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=z):z=e[23];let M;e[24]!==w||e[25]!==z?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[w,z]}),e[24]=w,e[25]=z,e[26]=M):M=e[26];const P="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!m&&s.jsx("span",{className:D("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d.label,children:s.jsx(u,{size:14,className:D(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let R;e[27]!==r?(R=r&&s.jsxs(xe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H=>{H.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ln,{size:14})})}),s.jsx(he,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=R):R=e[28];let E;e[29]!==U||e[30]!==R?(E=s.jsxs("div",{className:P,children:[U,R]}),e[29]=U,e[30]=R,e[31]=E):E=e[31];let O;return e[32]!==i||e[33]!==M||e[34]!==E||e[35]!==v||e[36]!==_||e[37]!==S||e[38]!==n.id?(O=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:i,onKeyDown:v,className:_,children:[S,M,E]}),e[32]=i,e[33]=M,e[34]=E,e[35]=v,e[36]=_,e[37]=S,e[38]=n.id,e[39]=O):O=e[39],O}const Vt=["requires_action","in_progress","failed","expired","completed"];function Ul(t){const e=new Map(Vt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return Vt.map(n=>({status:n,threads:e.get(n)}))}const Hl="sidebar.group.expanded.";function Bl(t,e){const n=A.c(3),[l,i]=et(`${Hl}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function Os(t){const e=A.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==r?(o=D("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(ts,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const m=l?"Loading…":"Show more";let c;e[4]!==m?(c=s.jsx("span",{children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Gl(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Wl(t){return t.member==="mine"&&!t.currentUserId}const Ms=4;let Xe=0;const yt=[];function ql(){for(;Xe<Ms&&yt.length>0;){const t=yt.shift();t&&t()}}function Es(t){return new Promise((e,n)=>{const l=()=>{Xe++,t().then(e,n).finally(()=>{Xe--,ql()})};Xe<Ms?l():yt.push(l)})}const at=10;function Kt(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const o={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Vl(t,e,n,l){let i=0;for(const r of t)Ds(r,e,n,l)&&i++;return i}function xt(t,e,n,l){return Vl(t,e,n,l)}function Kl(t,e){return!!(t>=at||t===0&&e)}function Yt(t,e){return t<e}function Yl(t,e){return e===!1?!1:e===!0?!0:t}function Ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Ze=new Map,Ye=new Map;function Xl(t,e){return e?t>=at?!0:null:!1}function Xt(t){return Ze.get(t)}function Ql(t,e){Ze.set(t,e)}function Jl(t,e,n){const l=Ze.get(t);if(l!==void 0){n(l);return}let i=Ye.get(t);i||(i=Es(e).then(r=>(Ze.set(t,r),Ye.delete(t),r)).catch(()=>(Ye.delete(t),Promise.reject(new Error("group probe failed")))),Ye.set(t,i)),i.then(n,()=>n(!1))}function Qt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===at,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Zl(t,e,n,l,i){let r=0;for(const o of t)e.has(o.id)||Ds(o,n,l,i)&&r++;return r}function er(t,e,n,l){const i=A.c(8),{org:r}=Z(),o=Gl(r.id,t,e,n);let a;i[0]!==n?(a=Wl(n),i[0]=n,i[1]=a):a=i[1];const m=a,[c,d]=F.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=ni(),{threads:f,hasMore:h}=At(),x=xt(f,t,e,n),g=Kl(x,h),p=Xl(x,h),b=Ss();if(c.identity===o&&c.serverHasMore===null){const _=p??Xt(o);_!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!m&&c.identity===o&&c.serverHasMore===null&&p===null&&Xt(o)===void 0&&c.probeSubscribedIdentity!==o&&(d(_=>_.identity===o?{..._,isProbing:!0,probeSubscribedIdentity:o}:_),Jl(o,async()=>{const _=Kt(t,e,0,n,1),S=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:k}=Qt(S),I=xt(u.threads.get(),t,e,n);return k===void 0?!1:Yt(I,k)},_=>{d(S=>S.identity!==o?S:{...S,isProbing:!1,serverHasMore:_})}));const y=async function(){if(c.isFetching||c.isProbing||m)return;const S=o;d(k=>k.identity===S?{...k,isFetching:!0}:k);try{const k=xt(f,t,e,n),I=Kt(t,e,k,n,at),$=await Es(()=>b.call("COLLECTION_THREADS_LIST",I)),{items:w,hasMore:z,totalCount:M}=Qt($),P=new Set(f.map(tr)),U=Zl(w,P,t,e,n),R=k;u.mergeThreads(w),d(E=>{if(E.identity!==S)return E;let O;return M!==void 0?O=Yt(R+U,M):O=w.length===0||U===0?!1:z,Ql(S,O),{...E,isFetching:!1,serverHasMore:O}})}catch(k){const I=k,$=I instanceof Error?I.message:String(I);ae.error(`Could not load more tasks: ${$}`),d(w=>w.identity===S?{...w,isFetching:!1}:w)}},v=c.isFetching||c.isProbing,C=!m&&!v&&Yl(g,c.serverHasMore);let N;return i[2]!==v||i[3]!==y||i[4]!==C||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(N={hasMore:C,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=C,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=N):N=i[7],N}function tr(t){return t.id}function sr(t){const e=A.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:f,serverHasMore:h}=er("status",n,m),[x,g]=F.useState(!1);!x&&l.length===0&&h===!0&&!c&&!d&&(g(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==i||e[1]!==a||e[2]!==m||e[3]!==o||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==a||e[9]!==m||e[10]!==o||e[11]!==r?(y=v=>s.jsx(Ts,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:a&&v.created_by===m.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=a,e[9]=m,e[10]=o,e[11]=r,e[12]=y):y=e[12],p=l.map(y),e[0]=i,e[1]=a,e[2]=m,e[3]=o,e[4]=r,e[5]=l,e[6]=p}else p=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(Os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[17]=p,e[18]=b,e[19]=j):j=e[19],j}function nr(t){const e=A.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m}=t,c=Fi[n],d=c.icon,[u,f]=Bl(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const x=h;let g;e[3]!==x?(g=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=g):g=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=p):p=e[7];let b;e[8]!==u?(b=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(kt,{size:14}):s.jsx(Li,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==p||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,b]}),e[10]=p,e[11]=b,e[12]=j):j=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let C;e[17]!==u||e[18]!==x||e[19]!==g||e[20]!==j||e[21]!==y||e[22]!==v?(C=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,y,v]}),e[17]=u,e[18]=x,e[19]=g,e[20]=j,e[21]=y,e[22]=v,e[23]=C):C=e[23];let N;e[24]!==i||e[25]!==a||e[26]!==u||e[27]!==m||e[28]!==o||e[29]!==r||e[30]!==n||e[31]!==l?(N=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(sr,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:a,filters:m})}),e[24]=i,e[25]=a,e[26]=u,e[27]=m,e[28]=o,e[29]=r,e[30]=n,e[31]=l,e[32]=N):N=e[32];let _;return e[33]!==C||e[34]!==N?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[C,N]}),e[33]=C,e[34]=N,e[35]=_):_=e[35],_}function Jt(t){const e=A.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:o,filters:a,hasMore:m,isFetchingMore:c,onLoadMore:d,filtersActive:u}=t;if(n.length===0&&!m&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ei,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||m;if(l==="status"){let p;if(e[3]!==i||e[4]!==f||e[5]!==a||e[6]!==o||e[7]!==r||e[8]!==n){let j;e[10]!==i||e[11]!==f||e[12]!==a||e[13]!==o||e[14]!==r?(j=y=>s.jsx(nr,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:o,canArchive:f,filters:a},y.status),e[10]=i,e[11]=f,e[12]=a,e[13]=o,e[14]=r,e[15]=j):j=e[15],p=Ul(n).map(j),e[3]=i,e[4]=f,e[5]=a,e[6]=o,e[7]=r,e[8]=n,e[9]=p}else p=e[9];let b;return e[16]!==p?(b=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=b):b=e[17],b}let h;if(e[18]!==i||e[19]!==f||e[20]!==a||e[21]!==o||e[22]!==r||e[23]!==n){let p;e[25]!==i||e[26]!==f||e[27]!==a||e[28]!==o||e[29]!==r?(p=b=>s.jsx(Ts,{task:b,isActive:i===b.id,onClick:()=>r(b),onArchive:f&&b.created_by===a.currentUserId?()=>o(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=i,e[26]=f,e[27]=a,e[28]=o,e[29]=r,e[30]=p):p=e[30],h=n.map(p),e[18]=i,e[19]=f,e[20]=a,e[21]=o,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let x;e[31]!==m||e[32]!==c||e[33]!==d?(x=(m||c)&&s.jsx(Os,{onClick:d,isFetching:c}),e[31]=m,e[32]=c,e[33]=d,e[34]=x):x=e[34];let g;return e[35]!==h||e[36]!==x?(g=s.jsxs(s.Fragment,{children:[h,x]}),e[35]=h,e[36]=x,e[37]=g):g=e[37],g}function ir(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Zt(t){const e=A.c(17),{label:n,onClick:l,active:i,children:r}=t,[o,a]=F.useState(!1);let m,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),c=()=>a(!1),d=()=>a(!0),u=()=>a(!1),e[0]=m,e[1]=c,e[2]=d,e[3]=u):(m=e[0],c=e[1],d=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=D("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=h):h=e[5];let x;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(x=s.jsx(fe,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:m,onPointerLeave:c,onFocus:d,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=x):x=e[10];let g;e[11]!==n?(g=s.jsx(he,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let p;return e[13]!==o||e[14]!==x||e[15]!==g?(p=s.jsxs(xe,{open:o,children:[x,g]}),e[13]=o,e[14]=x,e[15]=g,e[16]=p):p=e[16],p}function pt(t){const e=A.c(13),{label:n,value:l,onChange:i,options:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let a;e[2]!==i?(a=u=>u&&i(u),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==r?(m=r.map(lr),e[4]=r,e[5]=m):m=e[5];let c;e[6]!==a||e[7]!==m||e[8]!==l?(c=s.jsx(Ii,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:m}),e[6]=a,e[7]=m,e[8]=l,e[9]=c):c=e[9];let d;return e[10]!==o||e[11]!==c?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=d):d=e[12],d}function lr(t){return s.jsxs(ki,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function Ps({onNavigate:t}={}){const{data:e}=re.useSession(),n=e?.user?.id,{org:l}=Z(),i=rs({connectionId:as,orgId:l.id,orgSlug:l.slug}),r=Qe(l.id).id,o=ms(),{threads:a,hasMore:m,isFetchingMore:c,fetchNextPage:d}=At(),u=a.filter(T=>!T.hidden),{hide:f}=gs(),h=de(),{setTaskId:x,createNewTask:g}=zt(),p=_t({strict:!1}),b=tt({strict:!1}),j=p.taskId??null,y=b.virtualmcpid??a.find(T=>T.id===j)?.virtual_mcp_id??null,v=()=>{t?.()},C=[...u].sort((T,q)=>(q.updated_at??"").localeCompare(T.updated_at??"")),[N,_]=F.useState("all"),[S,k]=F.useState("flat"),[I,$]=et("sidebar-threads-scope-all",!1),[w,z]=F.useState(!1),[M,P]=F.useState(!1),U={type:N,member:"mine",currentUserId:n??null},R=T=>n?T.filter(q=>q.created_by===n):[],E=T=>N==="automation"?T.filter(q=>!!q.trigger_id):N==="manual"?T.filter(q=>!q.trigger_id):T,O=R(C),H=E(O),G=E(C),L=I?G:H,B=T=>{if(n&&T.created_by&&T.created_by!==n)return;const q=T.id===j;if(f(T.id),ri(T.id),!q)return;const Q=ir(L,T.id,n);v(),Q?x(Q.id,Q.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},Y=T=>{v(),x(T.id,T.virtual_mcp_id)},W=async T=>{try{const q=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((q.structuredContent??q).items?.length??0)===0}catch{return!1}},me=async()=>{const T=y??r;ne("sidebar_new_thread_clicked",{virtual_mcp_id:T});const q=O.find(Q=>Q.virtual_mcp_id===T&&Q.title==="New chat");if(q&&await W(q.id)){v(),x(q.id,T);return}v(),g(T)},{state:ye,isMobile:X,toggleSidebar:ee}=pe();if(ye==="collapsed"&&!X){const T=Qe(l.id),q=new Map((o??[]).map(K=>[K.id,K])),Q=K=>(K?q.get(K):void 0)??(K===r?T:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx($s,{orgParam:l.slug,side:"right",align:"start",trigger:s.jsx(J,{tooltip:l.name,children:s.jsx(rt,{org:l,size:"sm"})})})}),s.jsxs(ie,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(V,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ee,children:s.jsx(ds,{size:16})})}),s.jsx(V,{children:s.jsx(J,{tooltip:"New chat",onClick:()=>{me()},children:s.jsx(Mt,{size:16})})}),L.map(K=>{const be=Q(K.virtual_mcp_id);return s.jsx(V,{children:s.jsx(J,{tooltip:K.title||"New chat",isActive:K.id===j,onClick:()=>Y(K),children:s.jsx(je,{icon:be?.icon??null,name:be?.title??"Agent",size:"xs"})})},K.id)})]})]})}const te=S!=="flat"||N!=="all"||I===!0,oe=s.jsxs(nt,{children:[s.jsxs(xe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(Fe,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter chats",active:te,className:"md:size-[34px] rounded-lg",children:[s.jsx(wi,{size:16}),te&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(he,{side:"bottom",children:"Filter chats"})]}),s.jsxs(st,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(pt,{label:"View",value:S,onChange:T=>{ne("tasks_panel_group_by_changed",{to_value:T}),k(T)},options:[{value:"flat",label:"List",icon:s.jsx(Mn,{size:13})},{value:"status",label:"Status",icon:s.jsx(En,{size:13})}]}),s.jsx(pt,{label:"Type",value:N,onChange:T=>{ne("tasks_panel_filter_changed",{to_value:T}),_(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(pt,{label:"Scope",value:I?"team":"mine",onChange:T=>$(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),le=T=>s.jsx(bt,{delayDuration:300,children:s.jsxs("div",{className:D("shrink-0 flex items-center justify-between",T?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Ns,{className:"md:size-[34px] rounded-lg"}),oe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Zt,{label:"Search chats",onClick:()=>{ne("tasks_panel_search_opened"),P(!0),z(!0)},children:s.jsx(On,{size:16})}),s.jsx(Zt,{label:"New chat",onClick:()=>{me()},children:s.jsx(Mt,{size:16})})]})]})});return X?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[le(!0),s.jsx(Wt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Jt,{threads:L,groupBy:S,activeTaskId:j,onSelectTask:Y,onArchiveTask:B,filters:U,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:te})}),M&&s.jsx(qt,{open:w,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[le(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Wt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Jt,{threads:L,groupBy:S,activeTaskId:j,onSelectTask:Y,onArchiveTask:B,filters:U,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:te})})}),M&&s.jsx(qt,{open:w,onOpenChange:z})]})}const rr=5,or=[{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 Fs(){const t=A.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:rr}).map(dr)}),t[0]=i):i=t[0],i}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(ce,{className:"size-6 rounded-md"}),s.jsx(ce,{className:"size-6 rounded-md"}),s.jsx(ce,{className:"size-6 rounded-md"})]}),s.jsx(ce,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=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:or.map(ar)})]}),t[2]=l):l=t[2],l}function ar(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(ce,{className:"size-5 rounded-full shrink-0"}),s.jsx(ce,{className:D("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(cr)})]},e)}function cr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(ce,{className:"h-3 flex-1 rounded-sm"})},e)}function dr(t,e){return s.jsx(ce,{className:"size-10 rounded-lg mx-auto"},e)}function mr(){const t=A.c(2);if(lt()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(vt,{showName:!0}),t[0]=l):l=t[0],l}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(vt,{}),s.jsx(ot,{})]}),t[1]=n):n=t[1],n}function ur(){const t=A.c(5),e=Cs();let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Dl,{}),l=s.jsx(mr,{}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(St,{children:s.jsx(F.Suspense,{fallback:s.jsx(Fs,{}),children:s.jsx(Ps,{})})}),t[2]=i):i=t[2];let r;return t[3]!==e?(r=s.jsx(bs,{children:s.jsx(Is,{sections:e,footer:n,header:l,additionalContent:i})}),t[3]=e,t[4]=r):r=t[4],r}function fr(t){const e=A.c(8),{onClose:n}=t,l=Cs();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pl,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Fs,{}),e[1]=r):r=e[1];let o;e[2]!==n?(o=s.jsx(St,{children:s.jsx(F.Suspense,{fallback:r,children:s.jsx(Ps,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(bs,{children:s.jsx(Nl,{sections:l,onClose:n,footer:i,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}const hr="sidebar.open";function xr(){const t=A.c(1),{state:e}=pe(),n=lt();if(e!=="collapsed"||n)return null;let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ot,{}),t[0]=l):l=t[0],l}function pr(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(on,{}),t[0]=e):e=t[0],e}function Ea(){const t=A.c(43),e=wt(),n=lt();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{connect:i,siteUrl:r}=tt(l),o=i==="1",[a,m]=et(hr,!1),{width:c,wrapperRef:d,onStartResize:u,resetWidth:f}=Yi(),h=!e;let x,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(se.LeftColumn,{children:[s.jsx(xr,{}),s.jsx(se.TogglesSlot,{})]}),g=s.jsx(se.CenterSlot,{}),t[1]=x,t[2]=g):(x=t[1],g=t[2]);let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(se.Header,{children:[x,g,s.jsxs(se.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(se.TabsSlot,{})}),s.jsx(se.RightSlot,{})]})]}),t[3]=p):p=t[3];const b=p;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ns,{}),t[4]=j):j=t[4];let y;t[5]!==n?(y=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(ot,{})}),t[5]=n,t[6]=y):y=t[6];let v,C,N,_,S;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Be,{}),N=s.jsx(se.TogglesSlot,{}),_=s.jsx(se.TabsSlot,{className:"shrink-0"}),S=s.jsx(se.CenterSlot,{}),v=s.jsx(se.RightSlot,{}),t[7]=v,t[8]=C,t[9]=N,t[10]=_,t[11]=S):(v=t[7],C=t[8],N=t[9],_=t[10],S=t[11]);let k;t[12]!==y?(k=s.jsx(se.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,y,C,N,_,S,v]})}),t[12]=y,t[13]=k):k=t[13];const I=k;let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={background:"transparent",containerType:"inline-size"},t[14]=$):$=t[14];let w;t[15]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(dn,{className:"flex flex-col min-h-0",style:$,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(F.Suspense,{fallback:s.jsx(pr,{}),children:s.jsx(rn,{})})})})}),t[15]=w):w=t[15];const z=w,M=!h&&(e?I:b),P=`${c}px`;let U;t[16]!==P?(U={"--sidebar-width":P,"--sidebar-width-icon":"3.125rem"},t[16]=P,t[17]=U):U=t[17];const R=U;let E;t[18]!==e||t[19]!==u||t[20]!==f?(E=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ur,{}),s.jsx(qi,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=E):E=t[21];let O;t[22]!==h?(O=h?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,z]}):z,t[22]=h,t[23]=O):O=t[23];let H;t[24]!==R||t[25]!==E||t[26]!==O||t[27]!==d?(H=s.jsxs(mn,{ref:d,className:"flex-1 bg-sidebar relative min-h-0",style:R,children:[E,O]}),t[24]=R,t[25]=E,t[26]=O,t[27]=d,t[28]=H):H=t[28];let G;t[29]!==e?(G=e&&s.jsx(Mi,{renderSidebar:gr}),t[29]=e,t[30]=G):G=t[30];let L;t[31]!==r||t[32]!==o?(L=o&&s.jsx(Ui,{siteUrl:r}),t[31]=r,t[32]=o,t[33]=L):L=t[33];let B;t[34]!==M||t[35]!==H||t[36]!==G||t[37]!==L?(B=s.jsx(ei,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[M,H,G,L]})}),t[34]=M,t[35]=H,t[36]=G,t[37]=L,t[38]=B):B=t[38];let Y;return t[39]!==m||t[40]!==a||t[41]!==B?(Y=s.jsx(ii,{children:s.jsx(se.Provider,{children:s.jsx(un,{open:a,onOpenChange:m,children:B})})}),t[39]=m,t[40]=a,t[41]=B,t[42]=Y):Y=t[42],Y}function gr(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(fr,{onClose:e})})})}export{Ea as default};