decocms 4.29.0 → 4.30.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 (286) hide show
  1. package/dist/client/assets/{AlertCircle-CccbK4hX.js → AlertCircle-Npyn4_wF.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BgdgTW8q.js → ArrowUpRight-zXVQKR-G.js} +1 -1
  3. package/dist/client/assets/{Check-WJIsHzDQ.js → Check-BxViL4rK.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CM68yWPW.js → CheckCircle-Cz4tJUop.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CAuaRLDM.js → ChevronDown-UniVHOcZ.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-B7czck1y.js → ChevronRight-K3Ms28jw.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-D-qnR_uM.js → ChevronUp-C_JF1YJx.js} +1 -1
  8. package/dist/client/assets/{Circle-KYXNByEA.js → Circle-iQbOlvwS.js} +1 -1
  9. package/dist/client/assets/{Copy01-gjq995Op.js → Copy01-Ctt9FUbb.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BVo4MRpu.js → DotsVertical-Cnet9a8h.js} +1 -1
  11. package/dist/client/assets/{Eye-Bn25ApPz.js → Eye-Bf8ySHj2.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DaZCku74.js → FilterLines-DRa15Wby.js} +1 -1
  13. package/dist/client/assets/{Globe01-BwRmuR_8.js → Globe01-BCgVxayg.js} +1 -1
  14. package/dist/client/assets/{Globe04-9qIG4QhN.js → Globe04-BRhMXMEJ.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BJOyfL1s.js → HardDrive-BaaJKDpq.js} +1 -1
  16. package/dist/client/assets/{Key01-CDa-PA-y.js → Key01-BvoJKmt1.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-DNsGMIFw.js → LayoutLeft-Bsqu0rxT.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-B-q2TCWq.js → LinkExternal01-bFRmolQv.js} +1 -1
  19. package/dist/client/assets/{List-CDS_Rmur.js → List-FyDw_upy.js} +1 -1
  20. package/dist/client/assets/{Loading02-Cv_WFApk.js → Loading02-wU_DDeXK.js} +1 -1
  21. package/dist/client/assets/{Monitor01-ChrDLGXa.js → Monitor01-rM21B5VM.js} +1 -1
  22. package/dist/client/assets/{Palette-CqqDm4G9.js → Palette-Bq3VPed6.js} +1 -1
  23. package/dist/client/assets/{Play-BLXO22JW.js → Play-Dqv3vBUr.js} +1 -1
  24. package/dist/client/assets/{Plus-CoqGiEoW.js → Plus-CIMT0C1M.js} +1 -1
  25. package/dist/client/assets/{SearchLg-BJoMxiDy.js → SearchLg-BqF-kB3a.js} +1 -1
  26. package/dist/client/assets/{SearchMd-YxzpYnNt.js → SearchMd-OCIrtgl8.js} +1 -1
  27. package/dist/client/assets/{Settings02-Dy5hRJWC.js → Settings02-CTtq6YOs.js} +1 -1
  28. package/dist/client/assets/{Shield01-Dg-emZom.js → Shield01-CCAMun7k.js} +1 -1
  29. package/dist/client/assets/{Star01-Bbn22eVo.js → Star01-Cw7wbAha.js} +1 -1
  30. package/dist/client/assets/{Stars01-0N0PIoFw.js → Stars01-CXkCYhyc.js} +1 -1
  31. package/dist/client/assets/{Stars02-XLaFEqA9.js → Stars02-C6DKWb0j.js} +1 -1
  32. package/dist/client/assets/{Sun-Cf2_RQhM.js → Sun-Cfq43Fjh.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-8YfzWW4j.js → SwitchHorizontal01-BSEQu0PJ.js} +1 -1
  34. package/dist/client/assets/{Tool01-CExdAfac.js → Tool01-woqhmM89.js} +1 -1
  35. package/dist/client/assets/{Trash01-2bgd5rb5.js → Trash01-DSTcxy5m.js} +1 -1
  36. package/dist/client/assets/{Upload01-Da0GcY9n.js → Upload01-DI1Xs1Z6.js} +1 -1
  37. package/dist/client/assets/{User01-DWmqguL8.js → User01-D-uDYDK0.js} +1 -1
  38. package/dist/client/assets/{Users01-qo0Pfdbq.js → Users01-DVmsZOTe.js} +1 -1
  39. package/dist/client/assets/{Users03-m0mGCSLF.js → Users03-DGDUIZF4.js} +1 -1
  40. package/dist/client/assets/{X-dW9CI9iO.js → X-DWrz2LqH.js} +1 -1
  41. package/dist/client/assets/{XCircle-BLHWvvQb.js → XCircle-JQbz9WmR.js} +1 -1
  42. package/dist/client/assets/{XClose-BsCsQOzu.js → XClose-CBrgKiaB.js} +1 -1
  43. package/dist/client/assets/{Zap-NxwXfCyT.js → Zap-NoORqLvM.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-BllWW0jW.js → ZapSquare-RhqrJVTN.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-6KFj5qIF.js → ZoomOut-nih9dlzQ.js} +1 -1
  46. package/dist/client/assets/{access-gate-uhjaq2Ab.js → access-gate-DW0Ym0X9.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-WZYG5Z6d.js → add-section-modal-DgeyNgVY.js} +1 -1
  48. package/dist/client/assets/agent-capabilities-0FR5de0y.js +1 -0
  49. package/dist/client/assets/agent-icon-32aZu8f8.js +1 -0
  50. package/dist/client/assets/agents-list-C1UtH2E7.js +1 -0
  51. package/dist/client/assets/ai-providers-CNHaz-V2.js +1 -0
  52. package/dist/client/assets/{alert-ovMRS5yx.js → alert-D0cE0bpw.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DT6CiV3D.js → alert-dialog-DBrNjdaV.js} +3 -3
  54. package/dist/client/assets/app-editor-DVKTcnpY.js +1 -0
  55. package/dist/client/assets/{auth-D-3BenR-.js → auth-C9k5QFmE.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-1c9sE0Q2.js → auth-catchall-EFYsuYup.js} +1 -1
  57. package/dist/client/assets/{auth-entry-CiJUVGSj.js → auth-entry-B7dEi3i4.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-RqSEL3ko.js → auth-split-layout-DAa980Aa.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-cOkcseWI.js → authenticate-and-persist-oauth-Dji-Zkvk.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-DNZxP8s9.js → automation-list-row-DjnykZrH.js} +1 -1
  61. package/dist/client/assets/automation-runs-CyeVpPEA.js +188 -0
  62. package/dist/client/assets/automations-BRVTy0px.js +1 -0
  63. package/dist/client/assets/autosend-Lnw286aO.js +1 -0
  64. package/dist/client/assets/{avatar-D9dkHpvf.js → avatar-CVASN_n8.js} +1 -1
  65. package/dist/client/assets/{badge-C9YrQiOl.js → badge-DN1YW5R1.js} +1 -1
  66. package/dist/client/assets/{block-document-B3VgVdww.js → block-document-BMOnFuNo.js} +3 -3
  67. package/dist/client/assets/brand-context-BYp2uUo_.js +1 -0
  68. package/dist/client/assets/{breadcrumb-Bt63ruK5.js → breadcrumb-BylJDyxL.js} +1 -1
  69. package/dist/client/assets/buckets-ztIgzEwa.js +1 -0
  70. package/dist/client/assets/bulk-category-panel-D7ZYmK1J.js +1 -0
  71. package/dist/client/assets/{calendar-CVkRKG_3.js → calendar-ChXBpAOM.js} +1 -1
  72. package/dist/client/assets/capability-load-error-O4BtnIVr.js +1 -0
  73. package/dist/client/assets/{card-WdSE0wjZ.js → card-BYZEQBt8.js} +1 -1
  74. package/dist/client/assets/category-editor-C-eV-FDB.js +1 -0
  75. package/dist/client/assets/{chat-context-p7bQrjVO.js → chat-context-CCC-Byca.js} +5 -5
  76. package/dist/client/assets/{checkbox-Cf98ydrt.js → checkbox-C2WVbLnG.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-CDfqoEnc.js → cli-auth-success-D7EMTP4Y.js} +1 -1
  78. package/dist/client/assets/collection-detail-CKc7ZkK-.js +1 -0
  79. package/dist/client/assets/{collection-display-button-DhAisvln.js → collection-display-button-oZx_AhoK.js} +1 -1
  80. package/dist/client/assets/{collection-search-CwfTIp5v.js → collection-search-i90jdNni.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-1Z0s75jM.js → collection-table-wrapper-BkqcRITg.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-byFj2Ujd.js → collection-tabs-Bg1zR32u.js} +1 -1
  83. package/dist/client/assets/{command-Be3tajRL.js → command-D8e2ttGg.js} +1 -1
  84. package/dist/client/assets/commerce-onboarding-CUg63DGD.js +1 -0
  85. package/dist/client/assets/{connect-desktop-dialog-Af91UVe4.js → connect-desktop-dialog-CdtfQBg4.js} +1 -1
  86. package/dist/client/assets/{connection-card-CrmcBQ7w.js → connection-card-DGWh0T1M.js} +1 -1
  87. package/dist/client/assets/connection-detail-DG_Kwvgf.js +1 -0
  88. package/dist/client/assets/{connection-form-helpers-BEquM1Ke.js → connection-form-helpers-CvE1GCwU.js} +1 -1
  89. package/dist/client/assets/connections-CSSk2Lo7.js +1 -0
  90. package/dist/client/assets/constants-B72Xmt_K.js +1 -0
  91. package/dist/client/assets/{decopilot-sse-pool-wsz4kVX9.js → decopilot-sse-pool-CYJNLSex.js} +1 -1
  92. package/dist/client/assets/{dialog-DTR6Ld8R.js → dialog-wZUkxFBf.js} +1 -1
  93. package/dist/client/assets/{domain-settings-VmE96-t6.js → domain-settings-C-ClIsNf.js} +1 -1
  94. package/dist/client/assets/{drawer-tKmBK0sh.js → drawer-N4BBUwV9.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-D5GBwmj-.js → dropdown-menu-COQWVmxy.js} +1 -1
  96. package/dist/client/assets/{empty-state-Drp2V-gT.js → empty-state-BdREyKTx.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-hbWCHJzS.js → extract-connection-data-CguvuV8x.js} +1 -1
  98. package/dist/client/assets/file-explorer-DLrJ1FmW.js +2 -0
  99. package/dist/client/assets/{file-type-icon-ByfDUgJ1.js → file-type-icon-BEeYBjMh.js} +1 -1
  100. package/dist/client/assets/{files-CTG0VhhM.js → files-OSCRmAjy.js} +1 -1
  101. package/dist/client/assets/{form-Bdg2md6z.js → form-D4Sjj2S5.js} +1 -1
  102. package/dist/client/assets/general-EnRn7dAf.js +1 -0
  103. package/dist/client/assets/get-initials-D-f_fDFw.js +1 -0
  104. package/dist/client/assets/github-repo-picker-pjUsTLC6.js +1 -0
  105. package/dist/client/assets/{hooks-355Y2AQ-.js → hooks-RNhoO-Id.js} +6 -6
  106. package/dist/client/assets/{index-Fc19vagy.js → index-4ttWqKAk.js} +1 -1
  107. package/dist/client/assets/{index-Cg7efYOu.js → index-BGWTtZfz.js} +3 -3
  108. package/dist/client/assets/index-BYSbf1og.css +1 -0
  109. package/dist/client/assets/{index-D_fQ3aMM.js → index-BjUL_v0d.js} +1 -1
  110. package/dist/client/assets/index-C3s6kNZf.js +1 -0
  111. package/dist/client/assets/{index-C4qtLNrN.js → index-D6_eTKF9.js} +1 -1
  112. package/dist/client/assets/index-D8BXYXaV.js +1 -0
  113. package/dist/client/assets/index-DJ-AVzEz.js +519 -0
  114. package/dist/client/assets/{index-thaZU0eY.js → index-DcsErluY.js} +4 -4
  115. package/dist/client/assets/{index-ceQxuMuP.js → index-E0XzXtgq.js} +1 -1
  116. package/dist/client/assets/index-HmjC0l60.js +1 -0
  117. package/dist/client/assets/{index-Kblv4kfs.js → index-NrynAfgx.js} +3 -3
  118. package/dist/client/assets/{index-CbcN0I3P.js → index-Q0mE9w5a.js} +3 -3
  119. package/dist/client/assets/{index-BlDaAy7Z.js → index-etRGW8hR.js} +1 -1
  120. package/dist/client/assets/{index-redirect-BkSJGF9m.js → index-redirect-CtWijNin.js} +1 -1
  121. package/dist/client/assets/{index-Ci3919Ge.js → index-tYXe55yO.js} +1 -1
  122. package/dist/client/assets/{input-DEr8h15j.js → input-BLUXQaUJ.js} +1 -1
  123. package/dist/client/assets/{integration-icon-zZ56Ie6s.js → integration-icon-BJkk8MWl.js} +1 -1
  124. package/dist/client/assets/{invite-member-dialog-QdQZxiP_.js → invite-member-dialog-CzBp_hgb.js} +2 -2
  125. package/dist/client/assets/{label-D9vlZKHj.js → label-CW0QYigh.js} +1 -1
  126. package/dist/client/assets/{login-QcZ5VwBL.js → login-BzT7SutG.js} +1 -1
  127. package/dist/client/assets/{mcp-oauth-HycnBVan.js → mcp-oauth-DkjiGs3f.js} +1 -1
  128. package/dist/client/assets/members-B-nTZKqd.js +1 -0
  129. package/dist/client/assets/monaco-editor-CxptfxHs.js +9 -0
  130. package/dist/client/assets/{monitoring-stats-row-CLjCs61g.js → monitoring-stats-row-BCom1l-r.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-DmZkA-1Y.js → oauth-callback-BrnloLXP.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-qrMHndxu.js → oauth-callback-ai-provider-Gf3ErLGK.js} +1 -1
  133. package/dist/client/assets/{onboarding-D8Oj280h.js → onboarding-Bijoo7hh.js} +1 -1
  134. package/dist/client/assets/org-install-0y09LTw4.js +1 -0
  135. package/dist/client/assets/{org-layout-BdivmG72.js → org-layout-BnSZ4nrA.js} +1 -1
  136. package/dist/client/assets/{organization-choice-CNTMS9Qo.js → organization-choice-B0E5mbjx.js} +1 -1
  137. package/dist/client/assets/page-seo-form-Bgz7kJhB.js +1 -0
  138. package/dist/client/assets/page-seo-sheet-Ct29Vhus.js +1 -0
  139. package/dist/client/assets/{popover-BH74zFmN.js → popover-jVjMjIDj.js} +1 -1
  140. package/dist/client/assets/post-editor-BfRHhvGn.js +1 -0
  141. package/dist/client/assets/primitives-DaPu5vgv.js +1 -0
  142. package/dist/client/assets/profile-DclYxTny.js +1 -0
  143. package/dist/client/assets/project-app-view-BQBZobZ4.js +1 -0
  144. package/dist/client/assets/record-editor-BX1EoYMz.js +1 -0
  145. package/dist/client/assets/registry-BdbdSSDR.js +2 -0
  146. package/dist/client/assets/{registry-layout-BdxpZi19.js → registry-layout-BUFv94Wc.js} +1 -1
  147. package/dist/client/assets/{require-capability-bBFf7mtX.js → require-capability-gZyrOy_G.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DiYJUK17.js → required-auth-layout-CCig7BsQ.js} +1 -1
  149. package/dist/client/assets/{reset-password-Ws1sdfXL.js → reset-password-A6TbChyi.js} +1 -1
  150. package/dist/client/assets/reusable-new-chat-qqWu133U.js +1 -0
  151. package/dist/client/assets/roles-BW9vWvMW.js +1 -0
  152. package/dist/client/assets/{search-input-DLqCE5vh.js → search-input-5RFJsKB6.js} +1 -1
  153. package/dist/client/assets/secrets-T5w0qVnI.js +1 -0
  154. package/dist/client/assets/sections-editor-1RxueHws.js +2 -0
  155. package/dist/client/assets/{select-fd5CQiLd.js → select-GP-G7CYY.js} +1 -1
  156. package/dist/client/assets/select-model-Hh0vuEIf.js +4 -0
  157. package/dist/client/assets/seo-editor-BOaZSdYe.js +1 -0
  158. package/dist/client/assets/settings-layout-CQB5hLJw.js +1 -0
  159. package/dist/client/assets/{settings-section-C4B_agjR.js → settings-section-BN93dKeu.js} +1 -1
  160. package/dist/client/assets/shell-controls-Tu95tJS5.js +1 -0
  161. package/dist/client/assets/shell-layout-BktipYXq.js +1 -0
  162. package/dist/client/assets/sidebar-BjPm3XPY.js +1 -0
  163. package/dist/client/assets/{skeleton-Cz4bac5f.js → skeleton-CXWh_vT2.js} +1 -1
  164. package/dist/client/assets/sso-B36X_9Kv.js +1 -0
  165. package/dist/client/assets/store-Lh1RLabm.js +1 -0
  166. package/dist/client/assets/store-registry-CZQ9oZKe.js +2 -0
  167. package/dist/client/assets/{studio-tools-C88q8wAb.js → studio-tools-ajGrecV2.js} +1 -1
  168. package/dist/client/assets/{switch-Dg1aulpi.js → switch-C6ORwIf0.js} +1 -1
  169. package/dist/client/assets/tab-id-yjGvxWDL.js +1 -0
  170. package/dist/client/assets/{table-Z9PtYtMe.js → table-DyVNd3lx.js} +1 -1
  171. package/dist/client/assets/{tabs-BJWmaLw8.js → tabs-BbeJw3E0.js} +1 -1
  172. package/dist/client/assets/{textarea-DEWiELfd.js → textarea-CjjAiaC_.js} +1 -1
  173. package/dist/client/assets/{toggle-group-CvC6sjCU.js → toggle-group-CBKef6if.js} +1 -1
  174. package/dist/client/assets/toolbar-BS4jP5VP.js +1 -0
  175. package/dist/client/assets/{toolbar-icon-button-b0ekhhMY.js → toolbar-icon-button-aR9nKvjU.js} +1 -1
  176. package/dist/client/assets/tools-list-yY8qipR7.js +1 -0
  177. package/dist/client/assets/tooltip-CX8JDN5z.js +1 -0
  178. package/dist/client/assets/{types-BL5SG5y5.js → types-B4pxnIIx.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-C9ok3iTv.js → use-ai-providers-BFYpQ3Dm.js} +1 -1
  180. package/dist/client/assets/{use-automations-BGAQUfh0.js → use-automations-D2Y3aBGO.js} +1 -1
  181. package/dist/client/assets/{use-capability-DUO16Em8.js → use-capability-rVzvcxKr.js} +1 -1
  182. package/dist/client/assets/use-clock-tick-BZ0iPGQL.js +1 -0
  183. package/dist/client/assets/use-collections-Dkob9Q0i.js +1 -0
  184. package/dist/client/assets/{use-connection-DV6jfeKV.js → use-connection-BHlBIpYJ.js} +1 -1
  185. package/dist/client/assets/{use-copy--Yb2hvIV.js → use-copy-CQkPNAJi.js} +1 -1
  186. package/dist/client/assets/{use-create-virtual-mcp-BRs1YEXm.js → use-create-virtual-mcp-Cpq2-1Qg.js} +1 -1
  187. package/dist/client/assets/{use-debounced-autosave-B2imKI8J.js → use-debounced-autosave-C0n83t9Y.js} +1 -1
  188. package/dist/client/assets/{use-debounced-value-Dk3ZHqhr.js → use-debounced-value-HI4UvLEV.js} +1 -1
  189. package/dist/client/assets/{use-decopilot-events-CdGe1kZY.js → use-decopilot-events-qPFbeAuK.js} +1 -1
  190. package/dist/client/assets/{use-delete-connection-YECi64fi.js → use-delete-connection-Pr4HXWhs.js} +1 -1
  191. package/dist/client/assets/{use-file-configs-D99FvcSf.js → use-file-configs-Bwgj83CL.js} +1 -1
  192. package/dist/client/assets/use-infinite-scroll-gRuFiDfW.js +1 -0
  193. package/dist/client/assets/{use-join-requests-KOCEnQ4v.js → use-join-requests-qOUGOtoj.js} +1 -1
  194. package/dist/client/assets/{use-mcp-client-B7zSFiOA.js → use-mcp-client-x-H3hM3X.js} +2 -2
  195. package/dist/client/assets/{use-mcp-prompts-BMNQ61Xi.js → use-mcp-prompts-CB2--qfn.js} +1 -1
  196. package/dist/client/assets/use-mcp-tools-BAOkrTmg.js +1 -0
  197. package/dist/client/assets/{use-members-ItYzCRBH.js → use-members-BAUKU0t0.js} +1 -1
  198. package/dist/client/assets/{use-mobile-B23FisN_.js → use-mobile-BNK4ZQXQ.js} +1 -1
  199. package/dist/client/assets/use-navigate-to-agent-B2zjxakj.js +1 -0
  200. package/dist/client/assets/{use-org-auth-client-CW518BNQ.js → use-org-auth-client-CT6ie6N1.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-BCol3dQF.js → use-org-sso-DIb9lRy0.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-DCgs3HLS.js → use-organization-roles-bMxDWnEc.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-CtWuj0-0.js → use-organization-settings-QG8fys4M.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-BfySsVRx.js → use-registry-connections-BvC5yqnv.js} +1 -1
  205. package/dist/client/assets/{use-secrets-KLMNhfAU.js → use-secrets-BUi_Va3F.js} +1 -1
  206. package/dist/client/assets/use-status-sounds-DV61EqQ3.js +1 -0
  207. package/dist/client/assets/{use-view-mode-DMcqNC4z.js → use-view-mode-BaQ_SNlr.js} +1 -1
  208. package/dist/client/assets/use-virtual-mcp-zN_q3qUT.js +1 -0
  209. package/dist/client/assets/useInfiniteQuery-W1abYeKO.js +1 -0
  210. package/dist/client/assets/useSuspenseInfiniteQuery-DTvKBZgn.js +1 -0
  211. package/dist/client/assets/variant-calendar-N7_o0k3x.js +1 -0
  212. package/dist/client/assets/{view-mode-toggle-oOb_3dux.js → view-mode-toggle-RdEYDkk_.js} +1 -1
  213. package/dist/client/index.html +2 -2
  214. package/dist/server/cli.js +313 -299
  215. package/dist/server/server.js +3 -3
  216. package/package.json +1 -1
  217. package/dist/client/assets/agent-capabilities-CUZgw2cK.js +0 -1
  218. package/dist/client/assets/agent-icon-8-zG6zq2.js +0 -1
  219. package/dist/client/assets/agents-list-NUEvPqtn.js +0 -1
  220. package/dist/client/assets/ai-providers-BdzkA6Ng.js +0 -1
  221. package/dist/client/assets/app-editor-DejM0aC5.js +0 -1
  222. package/dist/client/assets/automation-runs-DHORxp2E.js +0 -1
  223. package/dist/client/assets/automations-iHJIY2kp.js +0 -1
  224. package/dist/client/assets/brand-context-IlEjmRnX.js +0 -1
  225. package/dist/client/assets/buckets-DMOBdFu1.js +0 -1
  226. package/dist/client/assets/bulk-category-panel-BZWcVa6f.js +0 -1
  227. package/dist/client/assets/capability-load-error-mGRKLuE9.js +0 -1
  228. package/dist/client/assets/category-editor-B3O-6esM.js +0 -1
  229. package/dist/client/assets/collection-detail-Bb_s_e4f.js +0 -1
  230. package/dist/client/assets/commerce-onboarding-CeoQUmzc.js +0 -1
  231. package/dist/client/assets/connection-detail-ox7hONrA.js +0 -1
  232. package/dist/client/assets/connections-51GGeElE.js +0 -1
  233. package/dist/client/assets/constants-nH3qQ_1f.js +0 -1
  234. package/dist/client/assets/content-blocks-o63cs2vh.js +0 -1
  235. package/dist/client/assets/decopilot-Dj817txh.js +0 -4
  236. package/dist/client/assets/file-explorer-C432wWS3.js +0 -2
  237. package/dist/client/assets/general-DivwX3J2.js +0 -1
  238. package/dist/client/assets/github-repo-picker-BxPl8GNJ.js +0 -1
  239. package/dist/client/assets/index-5uzKO7q6.css +0 -1
  240. package/dist/client/assets/index-CwBtGV9W.js +0 -1
  241. package/dist/client/assets/index-DEtQBmLd.js +0 -1
  242. package/dist/client/assets/index-J9x3nT2B.js +0 -1
  243. package/dist/client/assets/index-OMZJdpqB.js +0 -513
  244. package/dist/client/assets/library-tab-dvlvVDBE.js +0 -7
  245. package/dist/client/assets/members-CKTHo3ec.js +0 -1
  246. package/dist/client/assets/monaco-editor-BfF7h5UL.js +0 -9
  247. package/dist/client/assets/org-install-LOUQXIPf.js +0 -1
  248. package/dist/client/assets/page-seo-form-W66oNzJN.js +0 -1
  249. package/dist/client/assets/page-seo-sheet-DQCQahYb.js +0 -1
  250. package/dist/client/assets/post-editor-BBupRkar.js +0 -1
  251. package/dist/client/assets/primitives-DCgBLYjb.js +0 -1
  252. package/dist/client/assets/profile-BCEngRby.js +0 -1
  253. package/dist/client/assets/project-app-view-BcPFuDsb.js +0 -1
  254. package/dist/client/assets/record-editor-IbXR53df.js +0 -1
  255. package/dist/client/assets/registry-C4jGqOi2.js +0 -2
  256. package/dist/client/assets/roles-B2mvqEQY.js +0 -1
  257. package/dist/client/assets/scroll-area-urNhBz-2.js +0 -188
  258. package/dist/client/assets/secrets-CxNuqWmn.js +0 -1
  259. package/dist/client/assets/sections-editor-D1IVqSOH.js +0 -2
  260. package/dist/client/assets/select-model-lznBUFcI.js +0 -1
  261. package/dist/client/assets/seo-editor-CU14ORD4.js +0 -1
  262. package/dist/client/assets/settings-layout-CX96yOJ5.js +0 -1
  263. package/dist/client/assets/sheet-C-KllyIc.js +0 -1
  264. package/dist/client/assets/shell-controls-BQwbtCrf.js +0 -1
  265. package/dist/client/assets/shell-layout-BnoAEqpd.js +0 -1
  266. package/dist/client/assets/sidebar-DSPYyChk.js +0 -1
  267. package/dist/client/assets/sso-DPkIABsj.js +0 -1
  268. package/dist/client/assets/store-C2QekUWt.js +0 -1
  269. package/dist/client/assets/store-registry-Da4NJevx.js +0 -2
  270. package/dist/client/assets/tab-id-Bgchl1bv.js +0 -1
  271. package/dist/client/assets/task-row-BPMcTFbK.js +0 -1
  272. package/dist/client/assets/task-status-pzbr--Ml.js +0 -1
  273. package/dist/client/assets/toolbar-Cs8I9yhI.js +0 -1
  274. package/dist/client/assets/tools-list-D8G7Mcid.js +0 -1
  275. package/dist/client/assets/tooltip-D9_AyRKs.js +0 -1
  276. package/dist/client/assets/use-clock-tick-Cr8Z09wV.js +0 -1
  277. package/dist/client/assets/use-collections-BLTNEY6D.js +0 -1
  278. package/dist/client/assets/use-infinite-scroll-CCgHyhHc.js +0 -1
  279. package/dist/client/assets/use-mcp-tools-CXGlYiLZ.js +0 -1
  280. package/dist/client/assets/use-navigate-to-agent-ChQTAqDN.js +0 -1
  281. package/dist/client/assets/use-status-sounds-QZH24TPY.js +0 -1
  282. package/dist/client/assets/use-virtual-mcp-BplbsFwA.js +0 -1
  283. package/dist/client/assets/useInfiniteQuery-Deh6Q8fX.js +0 -1
  284. package/dist/client/assets/useSuspenseInfiniteQuery-Cx1a_TEJ.js +0 -1
  285. package/dist/client/assets/useSuspenseQueries-B5d682yj.js +0 -1
  286. package/dist/client/assets/variant-calendar-CqjIGqTb.js +0 -1
@@ -1 +0,0 @@
1
- import{c as E,D as at,k as Nt,m as jt,d as He,K as nt,r as A,j as s,l as L,B as Ze,i as vt}from"./index-thaZU0eY.js";import{A as $e}from"./avatar-D9dkHpvf.js";import{B as yt}from"./badge-C9YrQiOl.js";import{i as Dt,b as et,s as Ct,n as St}from"./Loading02-Cv_WFApk.js";import{i as It}from"./List-CDS_Rmur.js";import{s as wt}from"./Plus-CoqGiEoW.js";import{s as ot}from"./User01-DWmqguL8.js";import{u as rt}from"./use-members-ItYzCRBH.js";import{u as it}from"./studio-tools-C88q8wAb.js";import{f as ct}from"./format-time-Cy7tTmZp.js";import{i as Tt}from"./AlertCircle-CccbK4hX.js";import{i as kt}from"./CheckCircle-CM68yWPW.js";import{i as _t}from"./Circle-KYXNByEA.js";import{s as zt}from"./Eye-Bn25ApPz.js";import{d as At,e as Et,a as Ot}from"./dialog-DTR6Ld8R.js";import{b as Je,D as Ve,c as Ee,a as We}from"./dropdown-menu-D5GBwmj-.js";import{a as $t,b as Bt,P as Mt}from"./popover-BH74zFmN.js";import{C as Lt}from"./calendar-CVkRKG_3.js";import{t as Oe}from"./ChevronDown-CAuaRLDM.js";import{s as Pt}from"./Trash01-2bgd5rb5.js";import{i as Rt}from"./X-dW9CI9iO.js";import"./use-org-auth-client-CW518BNQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Check-WJIsHzDQ.js";import"./ChevronRight-B7czck1y.js";function Ft(){const t=E.c(13),{locator:e}=at(),l=it();let n;t[0]!==e?(n=nt.taskBoardItems(e),t[0]=e,t[1]=n):n=t[1];let a;t[2]!==l?(a=async()=>(await l.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=l,t[3]=a):a=t[3];let r;t[4]!==n||t[5]!==a?(r={queryKey:n,queryFn:a},t[4]=n,t[5]=a,t[6]=r):r=t[6];const d=Nt(r);let o;t[7]!==d.data?(o=d.data??[],t[7]=d.data,t[8]=o):o=t[8];let i;return t[9]!==d.error||t[10]!==d.isLoading||t[11]!==o?(i={items:o,isLoading:d.isLoading,error:d.error},t[9]=d.error,t[10]=d.isLoading,t[11]=o,t[12]=i):i=t[12],i}function Ut(){const t=E.c(30),{locator:e}=at(),l=it(),n=jt();let a;t[0]!==e?(a=nt.taskBoardItems(e),t[0]=e,t[1]=a):a=t[1];const r=a;let d;t[2]!==n||t[3]!==r?(d=()=>n.invalidateQueries({queryKey:r}),t[2]=n,t[3]=r,t[4]=d):d=t[4];const o=d;let i;t[5]!==l?(i=D=>l.call("TASK_BOARD_ITEM_CREATE",D),t[5]=l,t[6]=i):i=t[6];let c;t[7]!==o||t[8]!==i?(c={mutationFn:i,onSuccess:o},t[7]=o,t[8]=i,t[9]=c):c=t[9];const m=He(c);let x;t[10]!==l?(x=D=>l.call("TASK_BOARD_ITEM_UPDATE",D),t[10]=l,t[11]=x):x=t[11];let g,p;t[12]!==n||t[13]!==r?(g=async D=>{await n.cancelQueries({queryKey:r});const I=n.getQueryData(r);return n.setQueryData(r,h=>h?.map(v=>v.id===D.id?{...v,...D}:v)),{previous:I}},p=(D,I,h)=>{h?.previous&&n.setQueryData(r,h.previous)},t[12]=n,t[13]=r,t[14]=g,t[15]=p):(g=t[14],p=t[15]);let u;t[16]!==o||t[17]!==x||t[18]!==g||t[19]!==p?(u={mutationFn:x,onMutate:g,onError:p,onSettled:o},t[16]=o,t[17]=x,t[18]=g,t[19]=p,t[20]=u):u=t[20];const N=He(u);let y;t[21]!==l?(y=D=>l.call("TASK_BOARD_ITEM_DELETE",{id:D}),t[21]=l,t[22]=y):y=t[22];let C;t[23]!==o||t[24]!==y?(C={mutationFn:y,onSuccess:o},t[23]=o,t[24]=y,t[25]=C):C=t[25];const b=He(C);let j;return t[26]!==m||t[27]!==b||t[28]!==N?(j={create:m,update:N,remove:b},t[26]=m,t[27]=b,t[28]=N,t[29]=j):j=t[29],j}const dt=["triage","todo","in_progress","in_review","done"],Q={triage:{label:"Triage",icon:Tt,iconClassName:"text-muted-foreground"},todo:{label:"To Do",icon:_t,iconClassName:"text-muted-foreground"},in_progress:{label:"In Progress",icon:Dt,iconClassName:"text-blue-500"},in_review:{label:"In Review",icon:zt,iconClassName:"text-amber-500"},done:{label:"Done",icon:kt,iconClassName:"text-green-600"}},Kt=["low","medium","high","urgent"],ye={low:{label:"Low",badgeClassName:"bg-muted text-muted-foreground",flagClassName:"text-muted-foreground"},medium:{label:"Medium",badgeClassName:"bg-blue-500/10 text-blue-600",flagClassName:"text-blue-500"},high:{label:"High",badgeClassName:"bg-orange-500/10 text-orange-600",flagClassName:"text-orange-500"},urgent:{label:"Urgent",badgeClassName:"bg-red-500/10 text-red-600",flagClassName:"text-red-500"}};function tt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Qt(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function st(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const qt=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function Yt(t){const e=E.c(133),{open:l,onClose:n,item:a,onSubmit:r,onDelete:d,isSaving:o}=t,{data:i}=rt(),c=i?.data?.members??[],[m,x]=A.useState(a?.title??""),[g,p]=A.useState(a?.description??""),[u,N]=A.useState(a?.status??"triage"),[y,C]=A.useState(a?.priority??"medium"),[b,j]=A.useState(a?.assigneeId??null),D=a?.dueDate;let I;e[0]!==D?(I=st(D),e[0]=D,e[1]=I):I=e[1];const[h,v]=A.useState(I),[k,w]=A.useState(!1);let _;e[2]!==a?.assigneeId||e[3]!==a?.description||e[4]!==a?.dueDate||e[5]!==a?.priority||e[6]!==a?.status||e[7]!==a?.title||e[8]!==j||e[9]!==p||e[10]!==v?(_=()=>{x(a?.title??""),p(a?.description??""),N(a?.status??"triage"),C(a?.priority??"medium"),j(a?.assigneeId??null),v(st(a?.dueDate))},e[2]=a?.assigneeId,e[3]=a?.description,e[4]=a?.dueDate,e[5]=a?.priority,e[6]=a?.status,e[7]=a?.title,e[8]=j,e[9]=p,e[10]=v,e[11]=_):_=e[11];const O=_;let z;e[12]!==n||e[13]!==O?(z=()=>{n(),O()},e[12]=n,e[13]=O,e[14]=z):z=e[14];const $=z;let P;e[15]!==b||e[16]!==g||e[17]!==h||e[18]!==r||e[19]!==y||e[20]!==u||e[21]!==m?(P=()=>{const f=m.trim();f&&r({title:f,description:g.trim()||null,status:u,priority:y,assigneeId:b,dueDate:h?Qt(h):null})},e[15]=b,e[16]=g,e[17]=h,e[18]=r,e[19]=y,e[20]=u,e[21]=m,e[22]=P):P=e[22];const R=P;let F;e[23]!==b?(F=f=>f.userId===b,e[23]=b,e[24]=F):F=e[24];const U=c.find(F),B=Et;let T;e[25]!==$?(T=f=>!f&&$(),e[25]=$,e[26]=T):T=e[26];const M=At,q="flex h-[85vh] max-h-[720px] flex-col gap-0 overflow-hidden p-0 sm:max-w-[820px]",S="hidden",De=a?"Edit task":"New task";let Y;e[27]!==De?(Y=s.jsx(Ot,{className:"sr-only",children:De}),e[27]=De,e[28]=Y):Y=e[28];const ft="flex min-h-0 flex-1 flex-col overflow-y-auto",xt="flex flex-col gap-4 border-b border-border px-6 pt-6 pb-5";let Ce;e[29]===Symbol.for("react.memo_cache_sentinel")?(Ce=f=>x(f.target.value),e[29]=Ce):Ce=e[29];let G;e[30]!==m?(G=s.jsx("input",{value:m,onChange:Ce,placeholder:"Task title",autoFocus:!0,className:"w-full border-0 bg-transparent text-xl font-semibold text-foreground outline-none placeholder:text-muted-foreground/70"}),e[30]=m,e[31]=G):G=e[31];const gt="flex flex-wrap items-center gap-2",Be=Q[u].icon,Me=Q[u];let Se;e[32]!==Be||e[33]!==Me.iconClassName?(Se=s.jsx(Be,{size:13,className:Me.iconClassName}),e[32]=Be,e[33]=Me.iconClassName,e[34]=Se):Se=e[34];const Le=Se,Pe=Q[u];let Ie;e[35]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(Oe,{size:12,className:"text-muted-foreground"}),e[35]=Ie):Ie=e[35];let H;e[36]!==Le||e[37]!==Pe.label?(H=s.jsx(Je,{asChild:!0,children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-muted",children:[Le,Pe.label,Ie]})}),e[36]=Le,e[37]=Pe.label,e[38]=H):H=e[38];let we;e[39]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Ve,{align:"start",className:"w-44",children:dt.map(f=>{const K=Q[f].icon;return s.jsxs(Ee,{onSelect:()=>N(f),className:"gap-2",children:[s.jsx(K,{size:13,className:Q[f].iconClassName}),Q[f].label]},f)})}),e[39]=we):we=e[39];let J;e[40]!==H?(J=s.jsxs(We,{children:[H,we]}),e[40]=H,e[41]=J):J=e[41];const Re=ye[y];let V;e[42]!==Re.badgeClassName?(V=L("size-2 rounded-full",Re.badgeClassName),e[42]=Re.badgeClassName,e[43]=V):V=e[43];let W;e[44]!==V?(W=s.jsx("span",{className:V}),e[44]=V,e[45]=W):W=e[45];const Fe=ye[y];let Te;e[46]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(Oe,{size:12,className:"text-muted-foreground"}),e[46]=Te):Te=e[46];let X;e[47]!==W||e[48]!==Fe.label?(X=s.jsx(Je,{asChild:!0,children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-muted",children:[W,Fe.label,Te]})}),e[47]=W,e[48]=Fe.label,e[49]=X):X=e[49];let ke;e[50]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Ve,{align:"start",className:"w-40",children:Kt.map(f=>s.jsx(Ee,{onSelect:()=>C(f),children:ye[f].label},f))}),e[50]=ke):ke=e[50];let Z;e[51]!==X?(Z=s.jsxs(We,{children:[X,ke]}),e[51]=X,e[52]=Z):Z=e[52];const Ue=We,Ke=Je,pt=!0,bt="button",ht="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-muted",Qe=U?s.jsx($e,{url:U.user?.image??void 0,fallback:tt(U.user?.name),shape:"circle",size:"2xs"}):s.jsx(ot,{size:13,className:"text-muted-foreground"}),qe=U?.user?.name??"Unassigned";let _e;e[53]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(Oe,{size:12,className:"text-muted-foreground"}),e[53]=_e):_e=e[53];let ee;e[54]!==Qe||e[55]!==qe?(ee=s.jsxs("button",{type:bt,className:ht,children:[Qe,qe,_e]}),e[54]=Qe,e[55]=qe,e[56]=ee):ee=e[56];let te;e[57]!==Ke||e[58]!==ee?(te=s.jsx(Ke,{asChild:pt,children:ee}),e[57]=Ke,e[58]=ee,e[59]=te):te=e[59];let se;e[60]!==j?(se=s.jsx(Ee,{onSelect:()=>j(null),children:"Unassigned"}),e[60]=j,e[61]=se):se=e[61];let le;if(e[62]!==c||e[63]!==j){let f;e[65]!==j?(f=K=>s.jsxs(Ee,{onSelect:()=>j(K.userId),className:"gap-2",children:[s.jsx($e,{url:K.user?.image??void 0,fallback:tt(K.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:K.user?.name??K.userId})]},K.userId),e[65]=j,e[66]=f):f=e[66],le=c.map(f),e[62]=c,e[63]=j,e[64]=le}else le=e[64];let ae;e[67]!==se||e[68]!==le?(ae=s.jsxs(Ve,{align:"start",className:"w-56",children:[se,le]}),e[67]=se,e[68]=le,e[69]=ae):ae=e[69];let ne;e[70]!==Ue||e[71]!==te||e[72]!==ae?(ne=s.jsxs(Ue,{children:[te,ae]}),e[70]=Ue,e[71]=te,e[72]=ae,e[73]=ne):ne=e[73];let ze;e[74]===Symbol.for("react.memo_cache_sentinel")?(ze=s.jsx(et,{size:13,className:"text-muted-foreground"}),e[74]=ze):ze=e[74];let oe;e[75]!==h?(oe=h?qt.format(h):"Due date",e[75]=h,e[76]=oe):oe=e[76];let re;e[77]!==h||e[78]!==v?(re=h?s.jsx("span",{role:"button",tabIndex:0,"aria-label":"Clear due date",className:"-mr-0.5 ml-0.5 flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onClick:f=>{f.stopPropagation(),v(null)},onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),f.stopPropagation(),v(null))},children:s.jsx(Rt,{size:12})}):s.jsx(Oe,{size:12,className:"text-muted-foreground"}),e[77]=h,e[78]=v,e[79]=re):re=e[79];let ie;e[80]!==oe||e[81]!==re?(ie=s.jsx($t,{asChild:!0,children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-muted",children:[ze,oe,re]})}),e[80]=oe,e[81]=re,e[82]=ie):ie=e[82];const Ye=h??void 0;let ce;e[83]!==v||e[84]!==w?(ce=f=>{v(f??null),f&&w(!1)},e[83]=v,e[84]=w,e[85]=ce):ce=e[85];let de;e[86]!==Ye||e[87]!==ce?(de=s.jsx(Bt,{className:"w-auto p-0",align:"start",children:s.jsx(Lt,{mode:"single",selected:Ye,onSelect:ce,initialFocus:!0})}),e[86]=Ye,e[87]=ce,e[88]=de):de=e[88];let me;e[89]!==k||e[90]!==w||e[91]!==ie||e[92]!==de?(me=s.jsxs(Mt,{open:k,onOpenChange:w,children:[ie,de]}),e[89]=k,e[90]=w,e[91]=ie,e[92]=de,e[93]=me):me=e[93];let ue;e[94]!==J||e[95]!==Z||e[96]!==ne||e[97]!==me?(ue=s.jsxs("div",{className:gt,children:[J,Z,ne,me]}),e[94]=J,e[95]=Z,e[96]=ne,e[97]=me,e[98]=ue):ue=e[98];let fe;e[99]!==G||e[100]!==ue?(fe=s.jsxs("div",{className:xt,children:[G,ue]}),e[99]=G,e[100]=ue,e[101]=fe):fe=e[101];let xe;e[102]!==p?(xe=f=>p(f.target.value),e[102]=p,e[103]=xe):xe=e[103];let ge;e[104]!==g||e[105]!==xe?(ge=s.jsx("div",{className:"flex flex-1 flex-col px-6 py-5",children:s.jsx("textarea",{value:g,onChange:xe,placeholder:"Add a description…",className:"min-h-[320px] w-full flex-1 resize-none border-0 bg-transparent text-sm leading-relaxed text-foreground outline-none placeholder:text-muted-foreground/70"})}),e[104]=g,e[105]=xe,e[106]=ge):ge=e[106];let pe;e[107]!==fe||e[108]!==ge?(pe=s.jsxs("div",{className:ft,children:[fe,ge]}),e[107]=fe,e[108]=ge,e[109]=pe):pe=e[109];let be;e[110]!==a||e[111]!==d?(be=a&&d&&s.jsx(Ze,{variant:"ghost",size:"icon","aria-label":"Delete task",className:"text-muted-foreground hover:text-destructive",onClick:d,children:s.jsx(Pt,{size:14})}),e[110]=a,e[111]=d,e[112]=be):be=e[112];let he;e[113]!==o||e[114]!==m?(he=!m.trim()||o,e[113]=o,e[114]=m,e[115]=he):he=e[115];const Ge=a?"Save":"Create task";let Ne;e[116]!==R||e[117]!==he||e[118]!==Ge?(Ne=s.jsx(Ze,{size:"sm",className:"ml-auto",disabled:he,onClick:R,children:Ge}),e[116]=R,e[117]=he,e[118]=Ge,e[119]=Ne):Ne=e[119];let je;e[120]!==be||e[121]!==Ne?(je=s.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-6 py-3",children:[be,Ne]}),e[120]=be,e[121]=Ne,e[122]=je):je=e[122];let ve;e[123]!==M||e[124]!==Y||e[125]!==pe||e[126]!==je?(ve=s.jsxs(M,{className:q,closeButtonClassName:S,children:[Y,pe,je]}),e[123]=M,e[124]=Y,e[125]=pe,e[126]=je,e[127]=ve):ve=e[127];let Ae;return e[128]!==B||e[129]!==l||e[130]!==ve||e[131]!==T?(Ae=s.jsx(B,{open:l,onOpenChange:T,children:ve}),e[128]=B,e[129]=l,e[130]=ve,e[131]=T,e[132]=Ae):Ae=e[132],Ae}function Ss(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:s.jsx("div",{className:"h-full p-0.5 pt-0.25",children:s.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:s.jsx(Jt,{})})})}),t[0]=e):e=t[0],e}function mt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}const Gt=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function ut(t){const e=new Date(t),l=e.getTime()<Date.now();return{label:Gt.format(e),overdue:l}}function Ht(t){const e=E.c(8),{iso:l}=t;let n;e[0]!==l?(n=ut(l),e[0]=l,e[1]=n):n=e[1];const{label:a,overdue:r}=n,d=r?"bg-red-500/10 text-red-600":"bg-muted text-muted-foreground";let o;e[2]!==d?(o=L("inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px]",d),e[2]=d,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(et,{size:10}),e[4]=i):i=e[4];let c;return e[5]!==a||e[6]!==o?(c=s.jsxs("span",{className:o,children:[i,a]}),e[5]=a,e[6]=o,e[7]=c):c=e[7],c}function Jt(){const t=E.c(45),{items:e,isLoading:l}=Ft(),n=Ut(),{data:a}=rt();let r;if(t[0]!==a?.data?.members){const S=a?.data?.members??[];r=new Map(S.map(Vt)),t[0]=a?.data?.members,t[1]=r}else r=t[1];const d=r,[o,i]=A.useState("board"),[c,m]=A.useState(!1),[x,g]=A.useState(null);let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{g(null),m(!0)},t[2]=p):p=t[2];const u=p;let N;t[3]===Symbol.for("react.memo_cache_sentinel")?(N=S=>{g(S),m(!0)},t[3]=N):N=t[3];const y=N;if(l&&e.length===0){let S;return t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(vt,{size:20,className:"animate-spin text-muted-foreground"})}),t[4]=S):S=t[4],S}const C=o==="board"?"max-w-[1400px]":"max-w-[900px]";let b;t[5]!==C?(b=L("mx-auto flex w-full flex-col gap-6 px-10 pt-10 pb-16",C),t[5]=C,t[6]=b):b=t[6];let j;t[7]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("h1",{className:"text-xl font-medium text-foreground",children:"Board"}),t[7]=j):j=t[7];let D;t[8]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ze,{size:"sm",onClick:u,children:[s.jsx(wt,{size:16}),"New task"]}),t[8]=D):D=t[8];const I=o==="list";let h;t[9]===Symbol.for("react.memo_cache_sentinel")?(h=()=>i("list"),t[9]=h):h=t[9];let v;t[10]!==I?(v=s.jsx(lt,{active:I,onClick:h,icon:It,label:"List"}),t[10]=I,t[11]=v):v=t[11];const k=o==="board";let w;t[12]===Symbol.for("react.memo_cache_sentinel")?(w=()=>i("board"),t[12]=w):w=t[12];let _;t[13]!==k?(_=s.jsx(lt,{active:k,onClick:w,icon:St,label:"Board"}),t[13]=k,t[14]=_):_=t[14];let O;t[15]!==_||t[16]!==v?(O=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[D,s.jsxs("div",{className:"ml-auto inline-flex rounded-lg bg-muted p-0.5",children:[v,_]})]}),t[15]=_,t[16]=v,t[17]=O):O=t[17];let z;t[18]!==n.update||t[19]!==e||t[20]!==o||t[21]!==d?(z=e.length===0?s.jsx("div",{className:"rounded-xl border border-border bg-card px-4 py-12 text-center text-sm text-muted-foreground",children:"No tasks yet. Start one with New task."}):o==="board"?s.jsx(Wt,{items:e,memberByUserId:d,onOpen:y,onMove:(S,De)=>n.update.mutate({id:S,status:De})}):s.jsx("div",{className:"flex flex-col gap-2",children:e.map(S=>s.jsx(Zt,{item:S,assignee:S.assigneeId?d.get(S.assigneeId):void 0,onOpen:()=>y(S)},S.id))}),t[18]=n.update,t[19]=e,t[20]=o,t[21]=d,t[22]=z):z=t[22];let $;t[23]!==O||t[24]!==z||t[25]!==b?($=s.jsxs("div",{className:b,children:[j,O,z]}),t[23]=O,t[24]=z,t[25]=b,t[26]=$):$=t[26];const P=c?x?.id??"new":"closed";let R;t[27]===Symbol.for("react.memo_cache_sentinel")?(R=()=>m(!1),t[27]=R):R=t[27];const F=x??void 0,U=n.create.isPending||n.update.isPending;let B;t[28]!==n.create||t[29]!==n.update||t[30]!==x?(B=S=>{x?n.update.mutate({id:x.id,...S}):n.create.mutate(S),m(!1)},t[28]=n.create,t[29]=n.update,t[30]=x,t[31]=B):B=t[31];let T;t[32]!==n.remove||t[33]!==x?(T=x?()=>{n.remove.mutate(x.id),m(!1)}:void 0,t[32]=n.remove,t[33]=x,t[34]=T):T=t[34];let M;t[35]!==c||t[36]!==P||t[37]!==F||t[38]!==U||t[39]!==B||t[40]!==T?(M=s.jsx(Yt,{open:c,onClose:R,item:F,isSaving:U,onSubmit:B,onDelete:T},P),t[35]=c,t[36]=P,t[37]=F,t[38]=U,t[39]=B,t[40]=T,t[41]=M):M=t[41];let q;return t[42]!==$||t[43]!==M?(q=s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[$,M]}),t[42]=$,t[43]=M,t[44]=q):q=t[44],q}function Vt(t){return[t.userId,t]}function lt(t){const e=E.c(11),{active:l,onClick:n,icon:a,label:r}=t,d=`${r} view`,o=l?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let i;e[0]!==o?(i=L("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",o),e[0]=o,e[1]=i):i=e[1];let c;e[2]!==a?(c=s.jsx(a,{size:14}),e[2]=a,e[3]=c):c=e[3];let m;return e[4]!==l||e[5]!==r||e[6]!==n||e[7]!==d||e[8]!==i||e[9]!==c?(m=s.jsxs("button",{type:"button",onClick:n,"aria-label":d,"aria-pressed":l,className:i,children:[c,r]}),e[4]=l,e[5]=r,e[6]=n,e[7]=d,e[8]=i,e[9]=c,e[10]=m):m=e[10],m}function Wt(t){const e=E.c(8),{items:l,memberByUserId:n,onOpen:a,onMove:r}=t,[d,o]=A.useState(null);let i;e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==a||e[4]!==d?(i=dt.map(m=>{const x=l.filter(u=>u.status===m),g=Q[m],p=g.icon;return s.jsxs("div",{onDragOver:u=>{u.preventDefault(),o(m)},onDragLeave:u=>{u.currentTarget.contains(u.relatedTarget)||o(null)},onDrop:u=>{u.preventDefault();const N=u.dataTransfer.getData("text/plain");N&&r(N,m),o(null)},className:L("flex flex-col rounded-xl p-1 transition-colors",d===m&&"bg-muted/50"),children:[s.jsxs("div",{className:"flex items-center gap-2 p-2",children:[s.jsx(p,{size:14,className:L("shrink-0",g.iconClassName)}),s.jsx("span",{className:"text-xs text-foreground",children:g.label}),s.jsx("span",{className:"text-[11px] text-muted-foreground",children:x.length})]}),s.jsx("div",{className:"flex min-h-12 flex-col gap-2",children:x.map(u=>s.jsx(Xt,{item:u,assignee:u.assigneeId?n.get(u.assigneeId):void 0,onOpen:()=>a(u)},u.id))})]},m)}),e[0]=l,e[1]=n,e[2]=r,e[3]=a,e[4]=d,e[5]=i):i=e[5];let c;return e[6]!==i?(c=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-5",children:i}),e[6]=i,e[7]=c):c=e[7],c}function Xt(t){const e=E.c(38),{item:l,assignee:n,onOpen:a}=t,r=ye[l.priority];let d;e[0]!==l.dueDate?(d=l.dueDate?ut(l.dueDate):null,e[0]=l.dueDate,e[1]=d):d=e[1];const o=d;let i;e[2]!==l.id?(i=w=>{w.dataTransfer.setData("text/plain",l.id),w.dataTransfer.effectAllowed="move"},e[2]=l.id,e[3]=i):i=e[3];let c;e[4]!==l.title?(c=s.jsx("span",{className:"min-w-0 truncate text-[13px] font-medium leading-snug text-foreground",children:l.title}),e[4]=l.title,e[5]=c):c=e[5];let m;e[6]!==n?(m=n?s.jsx($e,{url:n.user?.image??void 0,fallback:mt(n.user?.name),shape:"circle",size:"2xs"}):s.jsx(ot,{size:13,className:"text-muted-foreground/60"}),e[6]=n,e[7]=m):m=e[7];const x=n?.user?.name;let g;e[8]!==m||e[9]!==x?(g=s.jsx(Xe,{icon:m,value:x}),e[8]=m,e[9]=x,e[10]=g):g=e[10];const p=o?.overdue?"text-red-500":"text-muted-foreground/60";let u;e[11]!==p?(u=L(p),e[11]=p,e[12]=u):u=e[12];let N;e[13]!==u?(N=s.jsx(et,{size:13,className:u}),e[13]=u,e[14]=N):N=e[14];const y=o?.label,C=o?.overdue?"text-red-600":void 0;let b;e[15]!==y||e[16]!==C||e[17]!==N?(b=s.jsx(Xe,{icon:N,value:y,valueClassName:C}),e[15]=y,e[16]=C,e[17]=N,e[18]=b):b=e[18];let j;e[19]!==r.flagClassName?(j=s.jsx(Ct,{size:13,className:r.flagClassName}),e[19]=r.flagClassName,e[20]=j):j=e[20];let D;e[21]!==r.label||e[22]!==j?(D=s.jsx(Xe,{icon:j,value:r.label}),e[21]=r.label,e[22]=j,e[23]=D):D=e[23];let I;e[24]!==b||e[25]!==D||e[26]!==g?(I=s.jsxs("div",{className:"flex flex-col gap-1.5 text-[12px] text-muted-foreground",children:[g,b,D]}),e[24]=b,e[25]=D,e[26]=g,e[27]=I):I=e[27];let h;e[28]!==l.createdAt?(h=ct(new Date(l.createdAt)),e[28]=l.createdAt,e[29]=h):h=e[29];let v;e[30]!==h?(v=s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:h}),e[30]=h,e[31]=v):v=e[31];let k;return e[32]!==a||e[33]!==I||e[34]!==v||e[35]!==i||e[36]!==c?(k=s.jsxs("button",{type:"button",draggable:!0,onDragStart:i,onClick:a,className:"flex cursor-grab flex-col gap-2.5 rounded-[10px] border border-border bg-card px-3.5 py-3 text-left transition-colors hover:border-ring/40 active:cursor-grabbing",children:[c,I,v]}),e[32]=a,e[33]=I,e[34]=v,e[35]=i,e[36]=c,e[37]=k):k=e[37],k}function Xe(t){const e=E.c(10),{icon:l,value:n,valueClassName:a}=t;let r;e[0]!==l?(r=s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:l}),e[0]=l,e[1]=r):r=e[1];const d=n?a:"text-muted-foreground/50";let o;e[2]!==d?(o=L("min-w-0 truncate",d),e[2]=d,e[3]=o):o=e[3];const i=n??"—";let c;e[4]!==o||e[5]!==i?(c=s.jsx("span",{className:o,children:i}),e[4]=o,e[5]=i,e[6]=c):c=e[6];let m;return e[7]!==r||e[8]!==c?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9],m}function Zt(t){const e=E.c(28),{item:l,assignee:n,onOpen:a}=t,r=Q[l.status],d=r.icon;let o;e[0]!==r.iconClassName?(o=L("shrink-0",r.iconClassName),e[0]=r.iconClassName,e[1]=o):o=e[1];let i;e[2]!==d||e[3]!==o?(i=s.jsx(d,{size:15,className:o}),e[2]=d,e[3]=o,e[4]=i):i=e[4];let c;e[5]!==l.title?(c=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:l.title}),e[5]=l.title,e[6]=c):c=e[6];const m=ye[l.priority];let x;e[7]!==m.badgeClassName?(x=L("shrink-0 text-[10px]",m.badgeClassName),e[7]=m.badgeClassName,e[8]=x):x=e[8];const g=ye[l.priority];let p;e[9]!==x||e[10]!==g.label?(p=s.jsx(yt,{className:x,children:g.label}),e[9]=x,e[10]=g.label,e[11]=p):p=e[11];let u;e[12]!==l.dueDate?(u=l.dueDate&&s.jsx(Ht,{iso:l.dueDate}),e[12]=l.dueDate,e[13]=u):u=e[13];let N;e[14]!==n?(N=n&&s.jsx($e,{url:n.user?.image??void 0,fallback:mt(n.user?.name),shape:"circle",size:"2xs"}),e[14]=n,e[15]=N):N=e[15];let y;e[16]!==l.createdAt?(y=ct(new Date(l.createdAt)),e[16]=l.createdAt,e[17]=y):y=e[17];let C;e[18]!==y?(C=s.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground/70",children:y}),e[18]=y,e[19]=C):C=e[19];let b;return e[20]!==a||e[21]!==C||e[22]!==i||e[23]!==c||e[24]!==p||e[25]!==u||e[26]!==N?(b=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 text-left transition-colors hover:border-ring/40",children:[i,c,p,u,N,C]}),e[20]=a,e[21]=C,e[22]=i,e[23]=c,e[24]=p,e[25]=u,e[26]=N,e[27]=b):b=e[27],b}export{Ss as default};
@@ -1 +0,0 @@
1
- import{c as k,j as s,C as We,r as D,D as se,b as ae,l as H,v as ue,F as $s,G as zs,a as he,H as Ts,I as Ms,t as te,J as Os,M as Ds,m as qt,u as Ve,P as vt,B as ze,y as Ps,R as Es,K as Rs,k as Fs,i as Wt,e as at,E as Vt,o as Ls,s as Bs,n as Hs,p as Us,d as Gs,x as qs,T as Kt,O as Ws,U as Vs}from"./index-thaZU0eY.js";import{u as xe,S as ct,a as dt,b as ne,c as X,d as G,e as Xt,f as Qt,g as Ks,h as Xs,i as et,j as Qs,k as Ys,l as Js}from"./sidebar-DSPYyChk.js";import{u as mt}from"./use-mobile-B23FisN_.js";import{n as Zs}from"./Loading02-Cv_WFApk.js";import{u as en}from"./use-organization-settings-CtWuj0-0.js";import{S as oe}from"./skeleton-Cz4bac5f.js";import{i as Yt}from"./LayoutLeft-DNsGMIFw.js";import{T as be}from"./toolbar-icon-button-b0ekhhMY.js";import{P as De,a as ge,b as Pe}from"./popover-BH74zFmN.js";import{D as Jt,a as Zt,b as es}from"./drawer-tKmBK0sh.js";import{A as Oe}from"./avatar-D9dkHpvf.js";import{a as je,b as ve,c as tt,T as ye}from"./tooltip-D9_AyRKs.js";import{a as yt}from"./Copy01-gjq995Op.js";import{n as tn,i as sn}from"./Globe01-BwRmuR_8.js";import{i as nn}from"./ZoomOut-6KFj5qIF.js";import{i as ln,a as rn}from"./ZapSquare-BllWW0jW.js";import{i as st}from"./Monitor01-ChrDLGXa.js";import{n as on,a as an}from"./Sun-Cf2_RQhM.js";import{a as ut,b as cn}from"./Settings02-Dy5hRJWC.js";import{i as dn}from"./Shield01-Dg-emZom.js";import{a as mn}from"./Users03-m0mGCSLF.js";import{a as St,b as Nt,c as un,d as fn,A as Te,e as _t,i as hn,s as xn,f as pn}from"./agent-icon-8-zG6zq2.js";import"./index-D_fQ3aMM.js";import{n as ft}from"./Stars02-XLaFEqA9.js";import{D as gn,a as bn,b as jn,c as wt,d as vn}from"./dropdown-menu-D5GBwmj-.js";import{i as Ee}from"./Check-WJIsHzDQ.js";import{s as $e}from"./Plus-CoqGiEoW.js";import{u as yn}from"./use-connection-DV6jfeKV.js";import{u as ts}from"./use-mcp-client-B7zSFiOA.js";import{u as ht,a as xt}from"./use-virtual-mcp-BplbsFwA.js";import{i as ss,S as ns,a as Ge,b as Sn}from"./constants-nH3qQ_1f.js";import{G as Nn,g as nt,i as _n,a as lt}from"./github-repo-picker-BxPl8GNJ.js";import{u as wn,S as ls,a as Cn,g as kn,b as In,c as An}from"./use-navigate-to-agent-ChQTAqDN.js";import{I as $n}from"./invite-member-dialog-QdQZxiP_.js";import{u as zn,A as Tn,g as Mn}from"./agent-capabilities-CUZgw2cK.js";import{u as On,v as Dn,C as Ct}from"./connect-desktop-dialog-Af91UVe4.js";import{s as rs}from"./XClose-BsCsQOzu.js";import{u as Pn,a as En}from"./use-join-requests-KOCEnQ4v.js";import{i as is}from"./ChevronRight-B7czck1y.js";import{u as Rn,R as Fn,a as Ln,b as pt,r as Bn}from"./shell-layout-BnoAEqpd.js";import{i as Hn}from"./FilterLines-DaZCku74.js";import{T as Un,a as Gn}from"./toggle-group-CvC6sjCU.js";import{u as qn,a as gt,b as os,T as Wn}from"./hooks-355Y2AQ-.js";import{c as Vn,a as Kn,b as Xn,d as Qn,e as Yn}from"./dialog-DTR6Ld8R.js";import{C as Jn,a as Zn,b as el,c as tl,d as sl}from"./command-Be3tajRL.js";import{u as as}from"./studio-tools-C88q8wAb.js";import{i as nl}from"./Zap-NxwXfCyT.js";import{S as cs,M as ll}from"./shell-controls-BQwbtCrf.js";import{T as ds}from"./task-row-BPMcTFbK.js";import{t as bt}from"./ChevronDown-CAuaRLDM.js";import{S as rl}from"./task-status-pzbr--Ml.js";import{S as il,C as ol}from"./chat-context-p7bQrjVO.js";import{B as kt,a as al,b as cl}from"./breadcrumb-Bt63ruK5.js";import{T as Z}from"./toolbar-Cs8I9yhI.js";import{i as ms}from"./SearchMd-YxzpYnNt.js";import{A as dl,a as ml,b as ul,c as fl,d as hl,e as xl,f as pl}from"./alert-dialog-DT6CiV3D.js";import{F as gl,a as bl,b as jl,c as vl,d as yl,f as Sl,e as Nl}from"./form-Bdg2md6z.js";import{I as _l}from"./input-DEr8h15j.js";import"./sheet-C-KllyIc.js";import"./X-dW9CI9iO.js";import"./User01-DWmqguL8.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./XCircle-BLHWvvQb.js";import"./ArrowUpRight-BgdgTW8q.js";import"./CheckCircle-CM68yWPW.js";import"./ChevronUp-D-qnR_uM.js";import"./Circle-KYXNByEA.js";import"./DotsVertical-BVo4MRpu.js";import"./Eye-Bn25ApPz.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./SearchLg-BJoMxiDy.js";import"./Stars01-0N0PIoFw.js";import"./Trash01-2bgd5rb5.js";import"./Upload01-Da0GcY9n.js";import"./Users01-qo0Pfdbq.js";import"./use-collections-BLTNEY6D.js";import"./auth-D-3BenR-.js";import"./checkbox-Cf98ydrt.js";import"./collection-search-CwfTIp5v.js";import"./use-debounced-value-Dk3ZHqhr.js";import"./authenticate-and-persist-oauth-cOkcseWI.js";import"./mcp-oauth-HycnBVan.js";import"./use-mcp-tools-CXGlYiLZ.js";import"./extract-connection-data-hbWCHJzS.js";import"./github-installations-DzN1UQ4x.js";import"./select-fd5CQiLd.js";import"./textarea-DEWiELfd.js";import"./use-org-auth-client-CW518BNQ.js";import"./use-organization-roles-DCgs3HLS.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CrmcBQ7w.js";import"./use-registry-connections-BfySsVRx.js";import"./useInfiniteQuery-Deh6Q8fX.js";import"./use-infinite-scroll-CCgHyhHc.js";import"./card-WdSE0wjZ.js";import"./integration-icon-zZ56Ie6s.js";import"./collection-tabs-byFj2Ujd.js";import"./badge-C9YrQiOl.js";import"./connection-form-helpers-BEquM1Ke.js";import"./useSuspenseInfiniteQuery-Cx1a_TEJ.js";import"./use-ai-providers-C9ok3iTv.js";import"./use-capability-DUO16Em8.js";import"./required-auth-layout-DiYJUK17.js";import"./tab-id-Bgchl1bv.js";import"./use-org-sso-BCol3dQF.js";import"./decopilot-sse-pool-wsz4kVX9.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-Ci3919Ge.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-clock-tick-Cr8Z09wV.js";import"./use-decopilot-events-CdGe1kZY.js";import"./label-D9vlZKHj.js";function wl(t){const e=k.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:r,isMobile:i}=xe();if(i||r==="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 d;return e[2]!==l||e[3]!==n?(d=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]=d):d=e[4],d}const jt=240,Cl=400,kl="sidebar.width";function Me(t){return Math.max(jt,Math.min(Cl,t))}function Il(){const t=k.c(11),[e,n]=We(kl,Al),l=D.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Me(e),x=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const h=b=>{const j=Me(f+(b.clientX-u));x?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Me(f+(b.clientX-u));n(j);for(const v of p)v.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const i=r;let o;t[3]!==n?(o=()=>{n(jt)},t[3]=n,t[4]=o):o=t[4];const a=o;let d;t[5]!==e?(d=Me(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function Al(t){return typeof t=="number"?Me(t):jt}function us(){const t=k.c(8),{org:e}=se(),n=ae(),l=en();let r;if(t[0]!==n||t[1]!==e||t[2]!==l){if(r=[],l){let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Zs,{className:"size-4!"}),t[4]=i):i=t[4];let o;t[5]!==n||t[6]!==e?(o={type:"items",items:[{key:"board",label:"Board",icon:i,onClick:()=>n({to:"/$org/board",params:{org:e.slug}})}]},t[5]=n,t[6]=e,t[7]=o):o=t[7],r.push(o)}t[0]=n,t[1]=e,t[2]=l,t[3]=r}else r=t[3];return r}function fs(t){const e=k.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 r;return e[1]!==n?(r=s.jsxs(ct,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(dt,{children:s.jsx(ne,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function hs(t){const e=k.c(18),{item:n}=t,{isMobile:l,setOpenMobile:r}=xe();let i;e[0]!==l||e[1]!==n||e[2]!==r?(i=()=>{ue("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&r(!1)},e[0]=l,e[1]=n,e[2]=r,e[3]=i):i=e[3];const o=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=H(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(X,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(G,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function $l(t){const e=k.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Xt,{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,r=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Tl),e[2]=n.group.items,e[3]=i):i=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(o=s.jsx(fs,{label:l,defaultExpanded:r,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map(zl),e[8]=n.items,e[9]=l):l=e[9];let r;return e[10]!==l?(r=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ne,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=r):r=e[11],r}case"custom":return n.content}}function zl(t){return s.jsx(hs,{item:t},t.key)}function Tl(t){return s.jsx(hs,{item:t},t.key)}function Ml(t){const e=k.c(14),{sections:n,footer:l,additionalContent:r,variant:i,contentClassName:o}=t,a=i===void 0?"sidebar":i;let d;e[0]!==o?(d=H("flex flex-col flex-1 px-2 py-2 gap-0.5",o),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(Ol),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&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:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Qt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==a?(f=s.jsxs(Ks,{variant:a,children:[u,l]}),e[10]=l,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Ol(t,e){return s.jsx($l,{section:t},e)}function xs(t){const e=k.c(2);let n;return e[0]!==t?(n=s.jsx(Ml,{...t}),e[0]=t,e[1]=n):n=e[1],n}xs.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(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Dl(t){const e=k.c(16),{onToggle:n,className:l}=t,i=$s().logo??zs,o=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let d;e[0]!==l?(d=H("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==o?(c=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=o,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Yt,{size:16}),e[9]=f):f=e[9];let x;e[10]!==n?(x=s.jsx(be,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=x):x=e[11];let p;return e[12]!==d||e[13]!==u||e[14]!==x?(p=s.jsxs(Xs,{className:d,children:[u,x]}),e[12]=d,e[13]=u,e[14]=x,e[15]=p):p=e[15],p}function It(t){const e=k.c(18),{item:n,onClose:l}=t,r=n.isActive&&"z-10";let i;e[0]!==r?(i=H(r),e[0]=r,e[1]=i):i=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 d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==d?(c=s.jsxs(X,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(G,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function Pl(t){const e=k.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Xt,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,i=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(It,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],o=n.group.items.map(d),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(fs,{label:r,defaultExpanded:i,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 r;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(It,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],r=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ne,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}case"custom":return n.content}}function El(t){const e=k.c(17),{sections:n,onClose:l,footer:r,additionalContent:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(D.Suspense,{fallback:o,children:s.jsx(Dl,{onToggle:l})}),e[1]=l,e[2]=a):a=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(x,p)=>s.jsx(Pl,{section:x,onClose:l},p),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Qt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=k.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"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",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==l?(r=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=r):r=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let o;e[16]!==n.label?(o=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=o):o=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==o?(a=s.jsxs("button",{type:"button",onClick:r,className:"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",children:[i,o]}),e[18]=r,e[19]=i,e[20]=o,e[21]=a):a=e[21],a}function At(t){const e=k.c(126),{user:n,userImage:l,menuItems:r,signOutItem:i,themeOptions:o,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const M=n?.name??"U";let O;e[0]!==M||e[1]!==l?(O=s.jsx(Oe,{url:l,fallback:M,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=M,e[1]=l,e[2]=O):O=e[2];const J=n?.name??"User";let W;e[3]!==J?(W=s.jsx("p",{className:"text-sm font-medium truncate",children:J}),e[3]=J,e[4]=W):W=e[4];const le=n?.email;let V;e[5]!==le?(V=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:le}),e[5]=le,e[6]=V):V=e[6];let re;e[7]!==W||e[8]!==V?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[W,V]}),e[7]=W,e[8]=V,e[9]=re):re=e[9];let ie;e[10]!==n?(ie=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Bl)},e[10]=n,e[11]=ie):ie=e[11];let ce;e[12]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(yt,{size:14}),e[12]=ce):ce=e[12];let fe;e[13]!==ie?(fe=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ie,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ce})}),e[13]=ie,e[14]=fe):fe=e[14];let pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=pe):pe=e[15];let A;e[16]!==fe?(A=s.jsx(tt,{delayDuration:300,children:s.jsxs(ye,{children:[fe,pe]})}),e[16]=fe,e[17]=A):A=e[17];let B;e[18]!==A||e[19]!==O||e[20]!==re?(B=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[O,re,A]}),e[18]=A,e[19]=O,e[20]=re,e[21]=B):B=e[21];let K;if(e[22]!==c||e[23]!==r){let me;e[25]!==c?(me=Le=>s.jsx(Be,{item:Le,onClose:c},Le.key),e[25]=c,e[26]=me):me=e[26],K=r.map(me),e[22]=c,e[23]=r,e[24]=K}else K=e[24];let U;e[27]!==c||e[28]!==i?(U=s.jsx(Be,{item:i,onClose:c}),e[27]=c,e[28]=i,e[29]=U):U=e[29];let de;e[30]!==K||e[31]!==U?(de=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:[K,U]})}),e[30]=K,e[31]=U,e[32]=de):de=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==o){let me;e[37]!==a.theme||e[38]!==d?(me=Le=>{const{value:Ye,icon:ks,label:Is}=Le;return s.jsx("button",{type:"button","aria-label":Is,onClick:()=>d(As=>({...As,theme:Ye})),className:H("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ks},Ye)},e[37]=a.theme,e[38]=d,e[39]=me):me=e[39],Se=o.map(me),e[33]=a.theme,e[34]=d,e[35]=o,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const Xe=a.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(Ll),e[42]=d,e[43]=_e):_e=e[43];const Qe=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Qe?(we=H("size-8 rounded-md flex items-center justify-center transition-colors",Qe),e[44]=Qe,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Xe||e[49]!==_e||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Xe,onClick:_e,className:we,children:Ce}),e[48]=Xe,e[49]=_e,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Re;e[53]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.29.0"]}),e[53]=Re):Re=e[53];let Ie;e[54]!==ke?(Ie=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Re]}),e[54]=ke,e[55]=Ie):Ie=e[55];let Ae;e[56]!==Ne||e[57]!==Ie?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ie]}),e[56]=Ne,e[57]=Ie,e[58]=Ae):Ae=e[58];let Fe;return e[59]!==B||e[60]!==de||e[61]!==Ae?(Fe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[B,de,Ae]}),e[59]=B,e[60]=de,e[61]=Ae,e[62]=Fe):Fe=e[62],Fe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Oe,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const x=n?.name??"User";let p;e[66]!==x?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:x}),e[66]=x,e[67]=p):p=e[67];const h=n?.email;let g;e[68]!==h?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[68]=h,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Fl)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(yt,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let _;e[78]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=_):_=e[78];let C;e[79]!==y?(C=s.jsx(tt,{delayDuration:300,children:s.jsxs(ye,{children:[y,_]})}),e[79]=y,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==b?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,C]}),e[81]=C,e[82]=f,e[83]=b,e[84]=N):N=e[84];let w;if(e[85]!==c||e[86]!==r){let M;e[88]!==c?(M=O=>s.jsx(Be,{item:O,onClose:c},O.key),e[88]=c,e[89]=M):M=e[89],w=r.map(M),e[85]=c,e[86]=r,e[87]=w}else w=e[87];let S;e[90]!==c||e[91]!==i?(S=s.jsx(Be,{item:i,onClose:c}),e[90]=c,e[91]=i,e[92]=S):S=e[92];let I;e[93]!==w||e[94]!==S?(I=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[w,S]}),e[93]=w,e[94]=S,e[95]=I):I=e[95];let z;if(e[96]!==a.theme||e[97]!==d||e[98]!==o){let M;e[100]!==a.theme||e[101]!==d?(M=O=>{const{value:J,icon:W,label:le}=O;return s.jsx("button",{type:"button","aria-label":le,onClick:()=>d(V=>({...V,theme:J})),className:H("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===J?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:W},J)},e[100]=a.theme,e[101]=d,e[102]=M):M=e[102],z=o.map(M),e[96]=a.theme,e[97]=d,e[98]=o,e[99]=z}else z=e[99];let $;e[103]!==z?($=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=$):$=e[104];const T=a.enableSounds?"Disable sounds":"Enable sounds";let F;e[105]!==d?(F=()=>d(Rl),e[105]=d,e[106]=F):F=e[106];const q=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let E;e[107]!==q?(E=H("size-7 rounded-md flex items-center justify-center transition-colors",q),e[107]=q,e[108]=E):E=e[108];let L;e[109]!==a.enableSounds?(L=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[109]=a.enableSounds,e[110]=L):L=e[110];let R;e[111]!==T||e[112]!==F||e[113]!==E||e[114]!==L?(R=s.jsx("button",{type:"button","aria-label":T,onClick:F,className:E,children:L}),e[111]=T,e[112]=F,e[113]=E,e[114]=L,e[115]=R):R=e[115];let P;e[116]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.29.0"]}),e[116]=P):P=e[116];let Q;e[117]!==R?(Q=s.jsxs("div",{className:"flex items-center gap-2",children:[R,P]}),e[117]=R,e[118]=Q):Q=e[118];let Y;e[119]!==$||e[120]!==Q?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[$,Q]}),e[119]=$,e[120]=Q,e[121]=Y):Y=e[121];let ee;return e[122]!==N||e[123]!==I||e[124]!==Y?(ee=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,I,Y]})}),e[122]=N,e[123]=I,e[124]=Y,e[125]=ee):ee=e[125],ee}function Rl(t){return{...t,enableSounds:!t.enableSounds}}function Fl(){te.success("User ID copied")}function Ll(t){return{...t,enableSounds:!t.enableSounds}}function Bl(){te.success("User ID copied")}function rt(){const t=k.c(34),{data:e}=he.useSession(),{org:n}=se(),l=ae();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const o=Ts(r)?.params.org,[a,d]=Ms(),c=mt(),[m,u]=D.useState(!1),f=e?.user,x=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const h=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ut,{size:16}),t[2]=g):g=t[2];let b;t[3]!==l||t[4]!==o?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==l?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(tn,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(nn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(dn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(Os,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(mn,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(sn,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let w;t[14]!==b||t[15]!==j?(w=[b,...j,v,y,_,C,N],t[14]=b,t[15]=j,t[16]=w):w=t[16];const S=w;let I;t[17]===Symbol.for("react.memo_cache_sentinel")?(I={key:"logout",label:"Sign out",icon:s.jsx(ln,{size:16}),onClick:Ul},t[17]=I):I=t[17];const z=I;let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($={value:"light",icon:s.jsx(on,{size:14}),label:"Light theme"},t[18]=$):$=t[18];let T;t[19]===Symbol.for("react.memo_cache_sentinel")?(T={value:"dark",icon:s.jsx(an,{size:14}),label:"Dark theme"},t[19]=T):T=t[19];let F;t[20]===Symbol.for("react.memo_cache_sentinel")?(F=[$,T,{value:"system",icon:s.jsx(st,{size:14}),label:"System theme"}],t[20]=F):F=t[20];const q=F;let E;t[21]!==c||t[22]!==S||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==x?(E={user:f,userImage:x,menuItems:S,signOutItem:z,themeOptions:q,preferences:a,setPreferences:d,close:h,isMobile:c},t[21]=c,t[22]=S,t[23]=a,t[24]=d,t[25]=f,t[26]=x,t[27]=E):E=t[27];const L=E;let R;return t[28]!==c||t[29]!==m||t[30]!==L||t[31]!==f?.name||t[32]!==x?(R=s.jsx(s.Fragment,{children:c?s.jsxs(Jt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Zt,{className:"h-[80dvh] p-0",children:[s.jsx(es,{className:"sr-only",children:"Account"}),s.jsx(At,{...L})]})]}):s.jsxs(De,{open:m,onOpenChange:u,children:[s.jsx(ge,{asChild:!0,children:s.jsxs(X,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Pe,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Hl,children:s.jsx(At,{...L})})]})}),t[28]=c,t[29]=m,t[30]=L,t[31]=f?.name,t[32]=x,t[33]=R):R=t[33],R}function Hl(t){return t.preventDefault()}function Ul(){ue("signed_out",{source:"account_popover"}),Ds(),he.signOut()}const $t=["requires_action","in_progress","failed","expired","completed"];function Gl(t){const e=new Map($t.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return $t.map(n=>({status:n,threads:e.get(n)}))}function ps(t){const e=k.c(4),{onClick:n}=t;let l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(lt,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=l,e[1]=r):(l=e[0],r=e[1]);let i;return e[2]!==n?(i=s.jsxs(X,{tooltip:"Add repo",onClick:n,children:[l,r]}),e[2]=n,e[3]=i):i=e[3],i}function ql(t){const e=k.c(41),{onAddNew:n}=t,{org:l}=se(),r=qt(),i=ae(),o=wn();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ve(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!ss(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const p=yn(f).filter(Vl),h=ht(),b=xt(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==l.id||e[5]!==l.slug?(j={connectionId:ns,orgId:l.id,orgSlug:l.slug},e[4]=l.id,e[5]=l.slug,e[6]=j):j=e[6];const v=ts(j);if(p.length===0){let M;return e[7]!==n?(M=s.jsx(ps,{onClick:n}),e[7]=n,e[8]=M):M=e[8],M}let y;e[9]!==c||e[10]!==i||e[11]!==l.id||e[12]!==r||e[13]!==v?(y=async(M,O)=>{await v.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:M}}}}),vt(r,l.id),te.success(`Previewing ${O}`),i({to:".",search:Wl,replace:!0})},e[9]=c,e[10]=i,e[11]=l.id,e[12]=r,e[13]=v,e[14]=y):y=e[14];const _=y;let C;e[15]!==h||e[16]!==o||e[17]!==l.id||e[18]!==r||e[19]!==v?(C=async(M,O,J)=>{const W=h.find(re=>{const ie=re.metadata?.githubRepo;return ie?.owner?.toLowerCase()===M.owner.toLowerCase()&&ie?.name?.toLowerCase()===M.name.toLowerCase()});if(W){o(W.id,{search:{main:"preview"}});return}const V=(await v.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:M.name,description:`Imported from ${J}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:O}],metadata:{githubRepo:M,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,l.id),!V)throw new Error("Failed to create the repo agent");te.success(`Created ${J}`),o(V,{search:{main:"preview"}})},e[15]=h,e[16]=o,e[17]=l.id,e[18]=r,e[19]=v,e[20]=C):C=e[20];const N=C;let w;e[21]!==_||e[22]!==u||e[23]!==N?(w=async M=>{const O=nt(M);if(!O)return;const J=`${O.owner}/${O.repo}`,W={owner:O.owner,name:O.repo,url:`https://github.com/${O.owner}/${O.repo}`,installationId:O.installationId,connectionId:M.id};try{u?await _(W,J):await N(W,M.id,J)}catch(le){const V=le;te.error("Failed to set preview repo: "+(V instanceof Error?V.message:"Unknown error"))}},e[21]=_,e[22]=u,e[23]=N,e[24]=w):w=e[24];const S=w,I=bn;let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(jn,{asChild:!0,children:s.jsxs(X,{tooltip:"Add repo",children:[s.jsx(lt,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=z):z=e[25];const $=gn,T="start",F="right",q="w-56";let E;e[26]!==b||e[27]!==S?(E=M=>{const O=nt(M);return O?s.jsxs(wt,{onSelect:()=>S(M),children:[s.jsx(lt,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[O.owner,"/",O.repo]}),M.id===b&&s.jsx(Ee,{className:"size-4"})]},M.id):null},e[26]=b,e[27]=S,e[28]=E):E=e[28];const L=p.map(E);let R;e[29]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(vn,{}),e[29]=R):R=e[29];let P;e[30]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx($e,{className:"size-4"}),e[30]=P):P=e[30];let Q;e[31]!==n?(Q=s.jsxs(wt,{onSelect:n,children:[P,"Add new repo…"]}),e[31]=n,e[32]=Q):Q=e[32];let Y;e[33]!==$||e[34]!==L||e[35]!==Q?(Y=s.jsxs($,{align:T,side:F,className:q,children:[L,R,Q]}),e[33]=$,e[34]=L,e[35]=Q,e[36]=Y):Y=e[36];let ee;return e[37]!==I||e[38]!==Y||e[39]!==z?(ee=s.jsxs(I,{children:[z,Y]}),e[37]=I,e[38]=Y,e[39]=z,e[40]=ee):ee=e[40],ee}function Wl(t){return{...t,main:"preview"}}function Vl(t){return nt(t)!==null&&_n(t)}function Kl(){const t=k.c(4),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ps,{onClick:()=>n(!0)}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(D.Suspense,{fallback:l,children:s.jsx(ql,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let i;return t[2]!==e?(i=s.jsxs(s.Fragment,{children:[r,s.jsx(Nn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=i):i=t[3],i}function it(t){const e=k.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,r=On(),[i,o]=D.useState(!1);let a,d;if(e[0]!==r.capabilities||e[1]!==r.hostname||e[2]!==r.machineId||e[3]!==r.online){const v=Dn(r.capabilities);a=r.online?"Desktop linked":"Connect desktop",d=r.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:r.hostname??r.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:v.length>0?`Available: ${v.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=r.capabilities,e[1]=r.hostname,e[2]=r.machineId,e[3]=r.online,e[4]=a,e[5]=d}else a=e[4],d=e[5];const c=d;if(l==="full"){let v,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=()=>o(!0),y=s.jsx(st,{}),e[6]=v,e[7]=y):(v=e[6],y=e[7]);let _;e[8]!==a?(_=s.jsx("span",{children:a}),e[8]=a,e[9]=_):_=e[9];let C;e[10]!==r.online?(C=r.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=r.online,e[11]=C):C=e[11];let N;e[12]!==a||e[13]!==_||e[14]!==C?(N=s.jsx(je,{asChild:!0,children:s.jsxs(X,{tooltip:a,onClick:v,children:[y,_,C]})}),e[12]=a,e[13]=_,e[14]=C,e[15]=N):N=e[15];let w;e[16]!==c?(w=s.jsx(ve,{side:"right",children:c}),e[16]=c,e[17]=w):w=e[17];let S;e[18]!==N||e[19]!==w?(S=s.jsxs(ye,{children:[N,w]}),e[18]=N,e[19]=w,e[20]=S):S=e[20];let I;e[21]!==i?(I=s.jsx(Ct,{open:i,onOpenChange:o}),e[21]=i,e[22]=I):I=e[22];let z;return e[23]!==I||e[24]!==S?(z=s.jsxs(s.Fragment,{children:[S,I]}),e[23]=I,e[24]=S,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>o(!0),e[26]=m):m=e[26];const u=r.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(st,{size:16}),e[27]=f):f=e[27];let x;e[28]!==r.online?(x=r.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=r.online,e[29]=x):x=e[29];let p;e[30]!==u||e[31]!==x?(p=s.jsx(je,{asChild:!0,children:s.jsxs(be,{onClick:m,"aria-label":u,children:[f,x]})}),e[30]=u,e[31]=x,e[32]=p):p=e[32];let h;e[33]!==c?(h=s.jsx(ve,{side:"bottom",children:c}),e[33]=c,e[34]=h):h=e[34];let g;e[35]!==p||e[36]!==h?(g=s.jsxs(ye,{children:[p,h]}),e[35]=p,e[36]=h,e[37]=g):g=e[37];let b;e[38]!==i?(b=s.jsx(Ct,{open:i,onOpenChange:o}),e[38]=i,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==g?(j=s.jsxs(s.Fragment,{children:[g,b]}),e[40]=b,e[41]=g,e[42]=j):j=e[42],j}function Xl({invitation:t}){const[e,n]=D.useState(!1),[l,r]=D.useState(!1),i=qt(),o=async()=>{n(!0);try{const c=await he.organization.acceptInvitation({invitationId:t.id});if(c.error){te.error(c.error.message),n(!1);return}}catch{te.error("Failed to accept invitation"),n(!1);return}te.success("Invitation accepted!"),Ps();let d;try{d=(await he.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},a=async()=>{r(!0);try{const d=await he.organization.rejectInvitation({invitationId:t.id});d.error?(te.error(d.error.message),r(!1)):(te.success("Invitation declined"),i.invalidateQueries())}catch{te.error("Failed to decline invitation"),r(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:o,disabled:e||l,"aria-label":"Accept invitation",children:s.jsx(Ee,{size:14})}),s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||l,"aria-label":"Decline invitation",children:s.jsx(rs,{size:14})})]})]})}function Ql(t){const e=k.c(29),{request:n}=t,{approve:l,deny:r}=Pn(),i=l.isPending||r.isPending,o=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let d;e[0]!==o?(d=o.charAt(0).toUpperCase(),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==a||e[3]!==d?(c=s.jsx(Oe,{url:a,fallback:d,shape:"circle",size:"sm"}),e[2]=a,e[3]=d,e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==o?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:o})]}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==n.id?(f=()=>l.mutate(n.id),e[8]=l,e[9]=n.id,e[10]=f):f=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ee,{size:14}),e[11]=x):x=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:x}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let h;e[15]!==r||e[16]!==n.id?(h=()=>r.mutate(n.id),e[15]=r,e[16]=n.id,e[17]=h):h=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(rs,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==h?(b=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:h,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=h,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let v;return e[25]!==j||e[26]!==c||e[27]!==u?(v=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[c,u,j]}),e[25]=j,e[26]=c,e[27]=u,e[28]=v):v=e[28],v}function Yl(t){const e=k.c(14),{release:n,isSeen:l,onSelect:r}=t;let i;e[0]!==l?(i=!l&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=l,e[1]=i):i=e[1];let o;e[2]!==n.eyebrow?(o=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=o):o=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==a?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[o,a]}),e[6]=o,e[7]=a,e[8]=d):d=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(is,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==i||e[12]!==d?(m=s.jsxs("button",{type:"button",onClick:r,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,d,c]}),e[10]=r,e[11]=i,e[12]=d,e[13]=m):m=e[13],m}function Jl(){const t=D.useContext(Es),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(l=>l.status==="pending"&&new Date(l.expiresAt)>new Date)}function gs(){const t=k.c(11),{isSeen:e,markSeen:n,unseenCount:l}=Rn(),r=Jl(),i=En();let o;if(t[0]!==e||t[1]!==r||t[2]!==i){const c=[...i].sort(nr).map(sr),m=[...r].sort(tr).map(er);let u;t[4]!==e?(u=x=>({type:"release",release:x,isSeen:e(x.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...Fn].sort(Zl).map(u);o=[...c,...m,...f],t[0]=e,t[1]=r,t[2]=i,t[3]=o}else o=t[3];const a=l+r.length+i.length;let d;return t[6]!==n||t[7]!==r||t[8]!==o||t[9]!==a?(d={items:o,pendingInvitations:r,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=r,t[8]=o,t[9]=a,t[10]=d):d=t[10],d}function Zl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function er(t){return{type:"invitation",invitation:t}}function tr(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function sr(t){return{type:"join-request",request:t}}function nr(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class lr extends D.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 rr(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function ir(){const t=k.c(17),e=ae(),{org:n}=se(),{hasDecoKey:l,balanceDollars:r}=zn();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];let o;t[2]!==r?(o=H(r!=null&&rr(r)),t[2]=r,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 d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(un,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==i||t[13]!==o||t[14]!==a||t[15]!==m?(u=s.jsx(ne,{children:s.jsx(G,{children:s.jsxs(X,{tooltip:i,className:o,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=o,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function zt(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(lr,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(ir,{})})}),t[0]=e):e=t[0],e}function or(t){const e=k.c(15),{children:n}=t,{items:l,markReleaseSeen:r}=gs(),[i,o]=D.useState(null);let a;if(e[0]!==l||e[1]!==i){let h;e[3]!==i?(h=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=h):h=e[4],a=l.find(h),e[0]=l,e[1]=i,e[2]=a}else a=e[2];const d=a,c=d?.type==="release"?d.release:null;let m;e[5]!==r?(m=h=>{o(h),r(h)},e[5]=r,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=h=>{h||o(null)},e[7]=f):f=e[7];let x;e[8]!==u||e[9]!==l||e[10]!==c?(x=s.jsx(Pe,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>o(null),children:s.jsx(cn,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:c.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Ln,{release:c})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),l.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(ft,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:l.map(h=>h.type==="join-request"?s.jsx(Ql,{request:h.request},`req-${h.request.id}`):h.type==="invitation"?s.jsx(Xl,{invitation:h.invitation},`inv-${h.invitation.id}`):s.jsx(Yl,{release:h.release,isSeen:h.isSeen,onSelect:()=>u(h.release.id)},`rel-${h.release.id}`))})]})}),e[8]=u,e[9]=l,e[10]=c,e[11]=x):x=e[11];let p;return e[12]!==n||e[13]!==x?(p=s.jsxs(De,{onOpenChange:f,children:[n,x]}),e[12]=n,e[13]=x,e[14]=p):p=e[14],p}function ar(){const{redDotCount:t}=gs();return t>0}function Tt(){const t=k.c(6),e=ar();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ft,{}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{children:"Inbox"}),t[3]=r):r=t[3];let i;return t[4]!==l?(i=s.jsx(or,{children:s.jsx(ge,{asChild:!0,children:s.jsxs(X,{tooltip:"Inbox",className:"relative",children:[n,l,r]})})}),t[4]=l,t[5]=i):i=t[5],i}function Mt(){const t=k.c(7),e=ae(),{org:n}=se();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 r,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{}),i=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=i):(r=t[3],i=t[4]);let o;return t[5]!==l?(o=s.jsxs(X,{tooltip:"Settings",onClick:l,children:[r,i]}),t[5]=l,t[6]=o):o=t[6],o}function Ot(){const t=k.c(5),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(G,{children:s.jsx($n,{trigger:s.jsxs(X,{tooltip:"Invite members",children:[s.jsx(fn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(G,{children:s.jsx(Kl,{})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ne,{className:"gap-0.5",children:[l,r,s.jsx(G,{children:s.jsxs(X,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(rn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=i):i=t[2];let o;return t[3]!==e?(o=s.jsxs(s.Fragment,{children:[i,s.jsx(Tn,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=o):o=t[4],o}function cr(){const t=k.c(12),{state:e}=xe();if(e==="collapsed"){let c,m,u;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ne,{children:s.jsx(G,{children:s.jsx(Tt,{})})}),m=s.jsx(Ot,{}),u=s.jsx(zt,{}),t[0]=c,t[1]=m,t[2]=u):(c=t[0],m=t[1],u=t[2]);let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(G,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(it,{})})}),t[3]=f):f=t[3];let x;t[4]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(G,{children:s.jsx(Mt,{})}),t[4]=x):x=t[4];let p;return t[5]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(et,{className:"px-2 pb-3 gap-1",children:[c,m,u,s.jsxs(ne,{children:[f,x,s.jsx(G,{children:s.jsx(rt,{})})]})]}),t[5]=p):p=t[5],p}let l,r,i;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ne,{className:"gap-0.5",children:s.jsx(G,{children:s.jsx(Tt,{})})}),r=s.jsx(Ot,{}),i=s.jsx(zt,{}),t[6]=l,t[7]=r,t[8]=i):(l=t[6],r=t[7],i=t[8]);let o;t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(G,{children:s.jsx(it,{variant:"full"})}),t[9]=o):o=t[9];let a;t[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(G,{children:s.jsx(Mt,{})}),t[10]=a):a=t[10];let d;return t[11]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(et,{className:"px-2 pb-3 gap-0.5",children:[l,r,i,s.jsxs(ne,{className:"gap-0.5",children:[o,a,s.jsx(G,{children:s.jsx(rt,{})})]})]}),t[11]=d):d=t[11],d}function dr(){const t=k.c(8),e=ae(),{org:n}=se(),{setOpenMobile:l}=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ne,{children:s.jsx(G,{children:s.jsx(rt,{})})})}),t[0]=r):r=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==l?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=i):i=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ut,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==i?(a=s.jsx(et,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(be,{"aria-label":"Settings",onClick:i,children:o})]})}),t[6]=i,t[7]=a):a=t[7],a}function Dt(t){const e=k.c(15),{className:n,wrapperClassName:l,children:r}=t,[i,o]=D.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 d=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 m=c;let u;e[2]!==l?(u=H("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const x=i?"opacity-100":"opacity-0";let p;e[7]!==x?(p=H("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",x),e[7]=x,e[8]=p):p=e[8];let h;e[9]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=h):h=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==h?(g=s.jsxs("div",{className:u,children:[f,h]}),e[11]=u,e[12]=f,e[13]=h,e[14]=g):g=e[14],g}function mr(t){const e=k.c(8),{virtualMcpId:n,size:l,showAutomationBadge:r}=t,i=l===void 0?"sm":l;let o;e[0]!==i||e[1]!==n?(o=n?s.jsx(ur,{virtualMcpId:n,size:i}):s.jsx(Te,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&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(nl,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==o||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=d):d=e[7],d}function ur(t){const e=k.c(6),{virtualMcpId:n,size:l}=t,r=xt(n);if(!r){let a;return e[0]!==l?(a=s.jsx(Te,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const i=r.icon??null;let o;return e[2]!==r.title||e[3]!==l||e[4]!==i?(o=s.jsx(Te,{icon:i,name:r.title,size:l}),e[2]=r.title,e[3]=l,e[4]=i,e[5]=o):o=e[5],o}function Pt(t){const e=k.c(36),{open:n,onOpenChange:l}=t,[r,i]=D.useState(""),{org:o}=se(),{setTaskId:a}=pt(),d=as();let c,m,u;e[0]!==o.id||e[1]!==r?(u=r.trim(),m=Fs,c=Rs.globalSearch(o.id,u),e[0]=o.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let x;e[5]!==d||e[6]!==u?(x=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=x):x=e[7];let p;e[8]!==c||e[9]!==f||e[10]!==x?(p={queryKey:c,enabled:f,queryFn:x,staleTime:1e4},e[8]=c,e[9]=f,e[10]=x,e[11]=p):p=e[11];const{data:h,isFetching:g}=m(p);let b;e[12]!==h?.items?(b=h?.items??[],e[12]=h?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==l?(v=T=>{T||i(""),l(T)},e[14]=l,e[15]=v):v=e[15];const y=v;let _;e[16]!==y||e[17]!==a?(_=T=>{y(!1),a(T.id,T.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=_):_=e[18];const C=_;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(Vn,{className:"sr-only",children:[s.jsx(Kn,{children:"Search"}),s.jsx(Xn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let w;e[20]!==r?(w=s.jsx(el,{value:r,onValueChange:i,placeholder:"Search..."}),e[20]=r,e[21]=w):w=e[21];let S;e[22]!==C||e[23]!==g||e[24]!==j||e[25]!==u?(S=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Jn,{children:"No results."}):j.map(T=>T.type==="thread"?s.jsxs(Zn,{value:`thread:${T.id}:${T.title}`,onSelect:()=>C(T),className:"gap-2.5",children:[s.jsx(mr,{virtualMcpId:T.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:T.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(T.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${T.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=g,e[24]=j,e[25]=u,e[26]=S):S=e[26];let I;e[27]!==S?(I=s.jsx(tl,{children:S}),e[27]=S,e[28]=I):I=e[28];let z;e[29]!==w||e[30]!==I?(z=s.jsxs(Qn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(sl,{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:[w,I]})]}),e[29]=w,e[30]=I,e[31]=z):z=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==z?($=s.jsx(Yn,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=$):$=e[35],$}const fr="sidebar.group.expanded.";function hr(t,e){const n=k.c(3),[l,r]=We(`${fr}${t}`,e);let i;return n[0]!==l||n[1]!==r?(i=[l,r],n[0]=l,n[1]=r,n[2]=i):i=n[2],i}function bs(t){const e=k.c(12),{onClick:n,isFetching:l,indented:r}=t,i=r?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==i?(o=H("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"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]=i,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(m=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]=m):m=e[11],m}function xr(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function pr(t){return t.member==="mine"&&!t.currentUserId}const js=4;let Ue=0;const ot=[];function gr(){for(;Ue<js&&ot.length>0;){const t=ot.shift();t&&t()}}function vs(t){return new Promise((e,n)=>{const l=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,gr()})};Ue<js?l():ot.push(l)})}const Ke=10;function Et(t,e,n,l,r){const i={hidden:!1};l.member==="mine"&&l.currentUserId&&(i.created_by=l.currentUserId),l.type==="automation"&&(i.has_trigger=!0),l.type==="manual"&&(i.has_trigger=!1);const o={where:i,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function br(t,e,n,l){let r=0;for(const i of t)ys(i,e,n,l)&&r++;return r}function Je(t,e,n,l){return br(t,e,n,l)}function jr(t,e){return!!(t>=Ke||t===0&&e)}function Rt(t,e){return t<e}function vr(t,e){return e===!1?!1:e===!0?!0:t}function ys(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 qe=new Map,He=new Map;function yr(t,e){return e?t>=Ke?!0:null:!1}function Ft(t){return qe.get(t)}function Sr(t,e){qe.set(t,e)}function Nr(t,e,n){const l=qe.get(t);if(l!==void 0){n(l);return}let r=He.get(t);r||(r=vs(e).then(i=>(qe.set(t,i),He.delete(t),i)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,r)),r.then(n,()=>n(!1))}function Lt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ke,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function _r(t,e,n,l,r){let i=0;for(const o of t)e.has(o.id)||ys(o,n,l,r)&&i++;return i}function wr(t,e,n,l){const r=k.c(8),{org:i}=se(),o=xr(i.id,t,e,n);let a;r[0]!==n?(a=pr(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=D.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=qn(),{threads:f,hasMore:x}=gt(),p=Je(f,t,e,n),h=jr(p,x),g=yr(p,x),b=as();if(c.identity===o&&c.serverHasMore===null){const N=g??Ft(o);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===o&&c.serverHasMore===null&&g===null&&Ft(o)===void 0&&c.probeSubscribedIdentity!==o&&(m(N=>N.identity===o?{...N,isProbing:!0,probeSubscribedIdentity:o}:N),Nr(o,async()=>{const N=Et(t,e,0,n,1),w=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:S}=Lt(w),I=Je(u.threads.get(),t,e,n);return S===void 0?!1:Rt(I,S)},N=>{m(w=>w.identity!==o?w:{...w,isProbing:!1,serverHasMore:N})}));const v=async function(){if(c.isFetching||c.isProbing||d)return;const w=o;m(S=>S.identity===w?{...S,isFetching:!0}:S);try{const S=Je(f,t,e,n),I=Et(t,e,S,n,Ke),z=await vs(()=>b.call("COLLECTION_THREADS_LIST",I)),{items:$,hasMore:T,totalCount:F}=Lt(z),q=new Set(f.map(Cr)),E=_r($,q,t,e,n),L=S;u.mergeThreads($),m(R=>{if(R.identity!==w)return R;let P;return F!==void 0?P=Rt(L+E,F):P=$.length===0||E===0?!1:T,Sr(w,P),{...R,isFetching:!1,serverHasMore:P}})}catch(S){const I=S,z=I instanceof Error?I.message:String(I);te.error(`Could not load more tasks: ${z}`),m($=>$.identity===w?{...$,isFetching:!1}:$)}},y=c.isFetching||c.isProbing,_=!d&&!y&&vr(h,c.serverHasMore);let C;return r[2]!==y||r[3]!==v||r[4]!==_||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(C={hasMore:_,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},r[2]=y,r[3]=v,r[4]=_,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=C):C=r[7],C}function Cr(t){return t.id}function kr(t){const e=k.c(18),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,{isFetching:d,isProbing:c,loadMore:m,hasMore:u,serverHasMore:f}=wr("status",n,a),[x,p]=D.useState(!1);!x&&l.length===0&&f===!0&&!d&&!c&&(p(!0),queueMicrotask(()=>{m()}));let h;if(e[0]!==r||e[1]!==a||e[2]!==o||e[3]!==i||e[4]!==l){let j;e[6]!==r||e[7]!==a||e[8]!==o||e[9]!==i?(j=v=>s.jsx(ds,{task:v,isActive:r===v.id,onClick:()=>i(v),onArchive:v.created_by===a.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=r,e[7]=a,e[8]=o,e[9]=i,e[10]=j):j=e[10],h=l.map(j),e[0]=r,e[1]=a,e[2]=o,e[3]=i,e[4]=l,e[5]=h}else h=e[5];let g;e[11]!==u||e[12]!==d||e[13]!==m?(g=(u||d)&&s.jsx(bs,{onClick:()=>{m()},isFetching:d,indented:!0}),e[11]=u,e[12]=d,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==h||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),e[15]=h,e[16]=g,e[17]=b):b=e[17],b}function Ir(t){const e=k.c(35),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,d=rl[n],c=d.icon,[m,u]=hr(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const x=f;let p;e[3]!==x?(p=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),x())},e[3]=x,e[4]=p):p=e[4];let h;e[5]!==c||e[6]!==d.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(c,{size:12,className:d.iconClassName})}),e[5]=c,e[6]=d.iconClassName,e[7]=h):h=e[7];let g;e[8]!==m?(g=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:m?s.jsx(bt,{size:14}):s.jsx(is,{size:14})}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==h||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,g]}),e[10]=h,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==d.label?(j=s.jsx("span",{className:"flex-1 truncate",children:d.label}),e[13]=d.label,e[14]=j):j=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 y;e[17]!==m||e[18]!==x||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:x,onKeyDown:p,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:[b,j,v]}),e[17]=m,e[18]=x,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let _;e[24]!==r||e[25]!==m||e[26]!==a||e[27]!==o||e[28]!==i||e[29]!==n||e[30]!==l?(_=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(kr,{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a})}),e[24]=r,e[25]=m,e[26]=a,e[27]=o,e[28]=i,e[29]=n,e[30]=l,e[31]=_):_=e[31];let C;return e[32]!==y||e[33]!==_?(C=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,_]}),e[32]=y,e[33]=_,e[34]=C):C=e[34],C}function Bt(t){const e=k.c(34),{threads:n,groupBy:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ft,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[h,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(l==="status"){let h;if(e[3]!==r||e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==n){let b;e[9]!==r||e[10]!==a||e[11]!==o||e[12]!==i?(b=j=>s.jsx(Ir,{status:j.status,threads:j.threads,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a},j.status),e[9]=r,e[10]=a,e[11]=o,e[12]=i,e[13]=b):b=e[13],h=Gl(n).map(b),e[3]=r,e[4]=a,e[5]=o,e[6]=i,e[7]=n,e[8]=h}else h=e[8];let g;return e[14]!==h?(g=s.jsx(s.Fragment,{children:h}),e[14]=h,e[15]=g):g=e[15],g}let f;if(e[16]!==r||e[17]!==a||e[18]!==o||e[19]!==i||e[20]!==n){let h;e[22]!==r||e[23]!==a||e[24]!==o||e[25]!==i?(h=g=>s.jsx(ds,{task:g,isActive:r===g.id,onClick:()=>i(g),onArchive:g.created_by===a.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=r,e[23]=a,e[24]=o,e[25]=i,e[26]=h):h=e[26],f=n.map(h),e[16]=r,e[17]=a,e[18]=o,e[19]=i,e[20]=n,e[21]=f}else f=e[21];let x;e[27]!==d||e[28]!==c||e[29]!==m?(x=(d||c)&&s.jsx(bs,{onClick:m,isFetching:c}),e[27]=d,e[28]=c,e[29]=m,e[30]=x):x=e[30];let p;return e[31]!==f||e[32]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),e[31]=f,e[32]=x,e[33]=p):p=e[33],p}function Ht(t){const e=k.c(17),{label:n,onClick:l,active:r,children:i}=t,[o,a]=D.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=r&&"bg-sidebar-accent text-foreground";let x;e[4]!==f?(x=H(f),e[4]=f,e[5]=x):x=e[5];let p;e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==x?(p=s.jsx(je,{asChild:!0,children:s.jsx(be,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:i})}),e[6]=i,e[7]=n,e[8]=l,e[9]=x,e[10]=p):p=e[10];let h;e[11]!==n?(h=s.jsx(ve,{side:"bottom",children:n}),e[11]=n,e[12]=h):h=e[12];let g;return e[13]!==o||e[14]!==p||e[15]!==h?(g=s.jsxs(ye,{open:o,children:[p,h]}),e[13]=o,e[14]=p,e[15]=h,e[16]=g):g=e[16],g}function Ze(t){const e=k.c(13),{label:n,value:l,onChange:r,options:i}=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]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(Ar),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==l?(c=s.jsx(Gn,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==o||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=m):m=e[12],m}function Ar(t){return s.jsxs(Un,{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 Ss({onNavigate:t}={}){const{data:e}=he.useSession(),n=e?.user?.id,{org:l}=se(),r=ts({connectionId:ns,orgId:l.id,orgSlug:l.slug}),i=Ge(l.id).id,o=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=gt(),u=a.filter(A=>!A.hidden),{hide:f}=os(),x=ae(),{setTaskId:p,createNewTask:h}=pt(),g=at({strict:!1}),b=Ve({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(A=>A.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},_=[...u].sort((A,B)=>(B.updated_at??"").localeCompare(A.updated_at??"")),[C,N]=D.useState("all"),[w,S]=D.useState("flat"),[I,z]=We("sidebar-threads-scope-all",!1),[$,T]=D.useState(!1),[F,q]=D.useState(!1),E={type:C,member:"mine",currentUserId:n??null},L=A=>n?A.filter(B=>B.created_by===n):[],R=A=>C==="automation"?A.filter(B=>!!B.trigger_id):C==="manual"?A.filter(B=>!B.trigger_id):A,P=L(_),Q=R(P),Y=R(_),ee=I?Y:Q,M=A=>{if(n&&A.created_by&&A.created_by!==n)return;const B=A.id===j;if(f(A.id),!B)return;const K=P.find(U=>U.id!==A.id&&U.virtual_mcp_id===A.virtual_mcp_id);y(),K?p(K.id,K.virtual_mcp_id):x({to:"/$org",params:{org:l.slug}})},O=A=>{y(),p(A.id,A.virtual_mcp_id)},J=async A=>{try{const B=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:A,limit:1,offset:0}});return((B.structuredContent??B).items?.length??0)===0}catch{return!1}},W=async()=>{const A=v??i;ue("sidebar_new_thread_clicked",{virtual_mcp_id:A});const B=P.find(K=>K.virtual_mcp_id===A&&K.title==="New chat");if(B&&await J(B.id)){y(),p(B.id,A);return}y(),h(A)},{state:le,isMobile:V,toggleSidebar:re}=xe();if(le==="collapsed"&&!V){const A=Ge(l.id),B=new Map((o??[]).map(U=>[U.id,U])),K=U=>(U?B.get(U):void 0)??(U===i?A:void 0);return s.jsxs(ne,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(G,{children:s.jsx(X,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:re,children:s.jsx(Yt,{size:16})})}),s.jsx(G,{children:s.jsx(X,{tooltip:"New thread",onClick:()=>{W()},children:s.jsx(_t,{size:16})})}),ee.map(U=>{const de=K(U.virtual_mcp_id);return s.jsx(G,{children:s.jsx(X,{tooltip:U.title||"New chat",isActive:U.id===j,onClick:()=>O(U),children:s.jsx(Te,{icon:de?.icon??null,name:de?.title??"Agent",size:"2xs"})})},U.id)})]})}const ce=w!=="flat"||C!=="all"||I===!0,fe=s.jsxs(De,{children:[s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx(ge,{asChild:!0,children:s.jsxs(be,{"aria-label":"Filter threads",active:ce,children:[s.jsx(Hn,{size:16}),ce&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(ve,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Pe,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ze,{label:"View",value:w,onChange:A=>{ue("tasks_panel_group_by_changed",{to_value:A}),S(A)},options:[{value:"flat",label:"List",icon:s.jsx(xn,{size:13})},{value:"status",label:"Status",icon:s.jsx(pn,{size:13})}]}),s.jsx(Ze,{label:"Type",value:C,onChange:A=>{ue("tasks_panel_filter_changed",{to_value:A}),N(A)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ze,{label:"Scope",value:I?"team":"mine",onChange:A=>z(A==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),pe=A=>s.jsx(tt,{delayDuration:300,children:s.jsxs("div",{className:H("shrink-0 px-1 flex items-center justify-between",A?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!A&&s.jsx(cs,{}),fe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Ht,{label:"Search threads",onClick:()=>{ue("tasks_panel_search_opened"),q(!0),T(!0)},children:s.jsx(hn,{size:16})}),s.jsx(Ht,{label:"New thread",onClick:()=>{W()},children:s.jsx(_t,{size:16})})]})]})});return V?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[pe(!0),s.jsx(Dt,{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(Bt,{threads:ee,groupBy:w,activeTaskId:j,onSelectTask:O,onArchiveTask:M,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})}),F&&s.jsx(Pt,{open:$,onOpenChange:T})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[pe(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Dt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Bt,{threads:ee,groupBy:w,activeTaskId:j,onSelectTask:O,onArchiveTask:M,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})})}),F&&s.jsx(Pt,{open:$,onOpenChange:T})]})}const $r=5,zr=[{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 Ns(){const t=k.c(3),{state:e}=xe();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:$r}).map(Or)}),t[0]=r):r=t[0],r}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(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{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:zr.map(Tr)})]}),t[2]=l):l=t[2],l}function Tr(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(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:H("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(Mr)})]},e)}function Mr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Or(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function Dr(){const t=k.c(4),e=us();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(cr,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Vt,{children:s.jsx(D.Suspense,{fallback:s.jsx(Ns,{}),children:s.jsx(Ss,{})})}),t[1]=l):l=t[1];let r;return t[2]!==e?(r=s.jsx(ls,{children:s.jsx(xs,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=r):r=t[3],r}function Pr(t){const e=k.c(8),{onClose:n}=t,l=us();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(dr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ns,{}),e[1]=i):i=e[1];let o;e[2]!==n?(o=s.jsx(Vt,{children:s.jsx(D.Suspense,{fallback:i,children:s.jsx(Ss,{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(ls,{children:s.jsx(El,{sections:l,onClose:n,footer:r,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function _s(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Er=Ls({name:Bs().min(2,"Organization name is required")});function Rr(t){const e=k.c(41),{open:n,onOpenChange:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Hs(Er),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Us(r);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:Lr,onSuccess:Fr},e[1]=o):o=e[1];const a=Gs(o),d=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(ul,{children:[s.jsx(fl,{children:"Create a new organization"}),s.jsx(hl,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==i){let N;e[6]!==a?(N=w=>a.mutateAsync(w),e[6]=a,e[7]=N):N=e[7],m=i.handleSubmit(N),e[3]=a,e[4]=i,e[5]=m}else m=e[5];let u;e[8]!==i.formState.isSubmitting?(u=N=>{const{field:w}=N;return s.jsxs(jl,{children:[s.jsx(vl,{children:"Organization Name"}),s.jsx(yl,{children:s.jsx(_l,{...w,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Sl,{children:"The name of your company or organization"}),w.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:"","/",_s(w.value)]})]}),s.jsx(Nl,{})]})},e[8]=i.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==i.control||e[11]!==u?(f=s.jsx(gl,{control:i.control,name:"name",render:u}),e[10]=i.control,e[11]=u,e[12]=f):f=e[12];let x;e[13]!==d?(x=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=x):x=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let h;e[18]!==i.formState.isSubmitting||e[19]!==p?(h=s.jsx(dl,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=h):h=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(il,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(ze,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==h?(v=s.jsxs(xl,{children:[h,j]}),e[26]=j,e[27]=h,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==x?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,x,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=x,e[33]=y):y=e[33];let _;e[34]!==i||e[35]!==y?(_=s.jsxs(ml,{children:[c,s.jsx(bl,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=_):_=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==_?(C=s.jsx(pl,{open:n,onOpenChange:l,children:_}),e[37]=l,e[38]=n,e[39]=_,e[40]=C):C=e[40],C}function Fr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Lr(t){const e=_s(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await he.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 Br(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 ws(t){const e=k.c(13),{org:n,size:l}=t,r=l===void 0?"sm":l,i=r==="xs"?"size-5":"size-6",o=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=H(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Br(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=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:H("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 m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function Hr(t){const e=k.c(24),{orgParam:n,onSelectOrg:l,onCreateOrg:r}=t,{data:i}=qs();let o;e[0]!==n?(o=(S,I)=>S.slug===n?-1:I.slug===n?1:S.name.localeCompare(I.name),e[0]=n,e[1]=o):o=e[1];const a=[...i??[]].sort(o),[d,c]=D.useState(""),m=d.toLowerCase(),u=m?a.filter(S=>S.name.toLowerCase().includes(m)||S.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ms,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=S=>c(S.target.value),e[3]=x):x=e[3];let p;e[4]!==d?(p=S=>S.key==="Escape"&&d&&c(""),e[4]=d,e[5]=p):p=e[5];let h;e[6]!==d||e[7]!==p?(h=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:x,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]=h):h=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($e,{size:16}),e[9]=g):g=e[9];let b;e[10]!==r?(b=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=r,e[11]=b):b=e[11];let j;e[12]!==h||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,h,b]}),e[12]=h,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.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 _;e[15]!==l||e[16]!==n?(_=S=>s.jsxs("button",{type:"button",onClick:()=>l(S.slug),className:H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",S.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(ws,{org:S,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:S.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.slug})]}),S.slug===n&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},S.id),e[15]=l,e[16]=n,e[17]=_):_=e[17];const C=u.map(_);let N;e[18]!==y||e[19]!==C?(N=s.jsxs("div",{className:v,children:[y,C]}),e[18]=y,e[19]=C,e[20]=N):N=e[20];let w;return e[21]!==N||e[22]!==j?(w=s.jsxs(s.Fragment,{children:[j,N]}),e[21]=N,e[22]=j,e[23]=w):w=e[23],w}function Ur(t){const e=k.c(22),{trigger:n,orgParam:l,align:r,side:i}=t,o=r===void 0?"start":r,a=i===void 0?"bottom":i,d=ae(),[c,m]=D.useState(!1),[u,f]=D.useState(!1);let x;e[0]!==n?(x=s.jsx(ge,{asChild:!0,children:n}),e[0]=n,e[1]=x):x=e[1];const p=String(c);let h;e[2]!==d?(h=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=h):h=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==l||e[6]!==p||e[7]!==h?(b=s.jsx(Hr,{orgParam:l,onSelectOrg:h,onCreateOrg:g},p),e[5]=l,e[6]=p,e[7]=h,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(Pe,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:qr,onCloseAutoFocus:Gr,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==x||e[15]!==j?(v=s.jsxs(De,{open:c,onOpenChange:m,children:[x,j]}),e[13]=c,e[14]=x,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Rr,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let _;return e[19]!==y||e[20]!==v?(_=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=_):_=e[21],_}function Gr(t){return t.preventDefault()}function qr(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Wr(t){const e=k.c(21),{value:n,onChange:l,placeholder:r,onKeyDown:i,className:o,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==o?(m=H("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=H("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let x;e[4]!==a?(x=a?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ms,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let p;e[6]!==l?(p=j=>l(j.target.value),e[6]=l,e[7]=p):p=e[7];let h;e[8]!==d||e[9]!==i||e[10]!==c||e[11]!==p||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=i,e[10]=c,e[11]=p,e[12]=n,e[13]=h):h=e[13];let g;e[14]!==f||e[15]!==x||e[16]!==h?(g=s.jsxs("label",{className:f,children:[x,h]}),e[14]=f,e[15]=x,e[16]=h,e[17]=g):g=e[17];let b;return e[18]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Vr="Select an existing agent";function Kr(t){const e=k.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ve,{side:"right",sideOffset:8,children:Vr}),e[2]=r):r=e[2];let i;return e[3]!==l?(i=s.jsxs(ye,{defaultOpen:!0,delayDuration:0,children:[l,r]}),e[3]=l,e[4]=i):i=e[4],i}function Xr(t){const e=ae(),{create:n}=os(),{locator:l}=se(),r=at({strict:!1}),i=Ve({strict:!1});return async o=>{const a=crypto.randomUUID(),d=o===i.virtualmcpid?Bn(t,l,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function Ut(t){const e=k.c(20),{agent:n,selected:l,onClick:r}=t,i=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==i?(o=H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(Te,{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 d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=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 m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==o||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,m,u]}),e[14]=r,e[15]=o,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Qr(t){const e=k.c(24),{onClose:n,onSelectAgent:l,selectedAgentId:r}=t,[i,o]=D.useState(""),a=ht(),d=a??[],{org:c}=se(),{data:m}=he.useSession(),u=m?.user?.id??"anon",f=kn(a),x=In(),p=Xr(c.slug),h=Mn(a),g=i.toLowerCase(),b=d.filter(Jr).filter(P=>!h.has(P.id)).filter(Yr).filter(P=>!i||P.title.toLowerCase().includes(g)),j=Ge(c.id),v=!i||j.title.toLowerCase().includes(g),y=!!(l&&v);let _;e[0]!==n||e[1]!==l?(_=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=_):_=e[2];const C=_,N=P=>{if(l){l(P.id),n(),o("");return}An({orgId:c.id,userId:u},P.id,f),x(),n(),o(""),p(P.id)},w="flex flex-col max-h-[min(640px,80dvh)]";let S;e[3]!==i?(S=s.jsx(Wr,{value:i,onChange:o,placeholder:"Search agents..."}),e[3]=i,e[4]=S):S=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",z=l&&v&&j&&s.jsx(Ut,{agent:j,selected:!r||r===j.id,onClick:C}),$=b.map(P=>s.jsx(Ut,{agent:P,selected:l?r===P.id:void 0,onClick:()=>N(P)},P.id));let T;e[5]!==y||e[6]!==i||e[7]!==b.length?(T=b.length===0&&!y&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[5]=y,e[6]=i,e[7]=b.length,e[8]=T):T=e[8];let F;e[9]!==z||e[10]!==$||e[11]!==T?(F=s.jsxs("div",{className:I,children:[z,$,T]}),e[9]=z,e[10]=$,e[11]=T,e[12]=F):F=e[12];let q;e[13]!==c.slug?(q={org:c.slug},e[13]=c.slug,e[14]=q):q=e[14];let E;e[15]!==n?(E=()=>n(),e[15]=n,e[16]=E):E=e[16];let L;e[17]!==E||e[18]!==q?(L=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Kt,{to:"/$org/settings/agents",params:q,onClick:E,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[17]=E,e[18]=q,e[19]=L):L=e[19];let R;return e[20]!==L||e[21]!==S||e[22]!==F?(R=s.jsxs("div",{className:w,children:[S,F,L]}),e[20]=L,e[21]=S,e[22]=F,e[23]=R):R=e[23],R}function Yr(t){return!Sn(t.id)}function Jr(t){return!ss(t.id)}function Zr(t){const e=k.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:r,onSelectAgent:i,selectedAgentId:o,side:a,align:d}=n,c=l===void 0?!1:l,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,x]=D.useState(!1),p=mt(),{setOpenMobile:h}=xe(),g=Cn(),b=g?"border border-border":void 0;let j;e[2]!==g?(j=S=>g?s.jsx(Kr,{children:S}):S,e[2]=g,e[3]=j):j=e[3];const v=j;let y;e[4]!==p||e[5]!==h?(y=()=>{x(!1),p&&h(!1)},e[4]=p,e[5]=h,e[6]=y):y=e[6];const _=y;let C;e[7]!==_||e[8]!==i||e[9]!==f||e[10]!==o?(C=f&&s.jsx(D.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Qr,{onClose:_,onSelectAgent:i,selectedAgentId:o})}),e[7]=_,e[8]=i,e[9]=f,e[10]=o,e[11]=C):C=e[11];const N=C;let w;return e[12]!==u||e[13]!==c||e[14]!==b||e[15]!==g||e[16]!==p||e[17]!==f||e[18]!==N||e[19]!==m||e[20]!==r||e[21]!==v?(w=s.jsx(s.Fragment,{children:p?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:r}):c?v(s.jsx(be,{"aria-label":"Browse agents",className:H(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(G,{children:v(s.jsxs(X,{tooltip:g?void 0:"Browse agents",className:H(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Jt,{open:f,onOpenChange:x,direction:"bottom",children:s.jsxs(Zt,{className:"max-h-[85dvh] p-0",children:[s.jsx(es,{className:"sr-only",children:"Browse agents"}),N]})})]}):s.jsxs(De,{open:f,onOpenChange:S=>{S&&!f&&ue("agent_browser_opened",{surface:"desktop_popover"}),x(S)},children:[r?s.jsx(ge,{asChild:!0,children:r}):c?v(s.jsx(ge,{asChild:!0,children:s.jsx(be,{"aria-label":"Browse agents",className:H(b),children:s.jsx($e,{className:"size-4"})})})):s.jsx(G,{children:v(s.jsx(ge,{asChild:!0,children:s.jsxs(X,{tooltip:g?void 0:"Browse agents",className:H(b),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Pe,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:N})]})}),e[12]=u,e[13]=c,e[14]=b,e[15]=g,e[16]=p,e[17]=f,e[18]=N,e[19]=m,e[20]=r,e[21]=v,e[22]=w):w=e[22],w}const Cs="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function ei(t){const e=k.c(19),{agentId:n,onOpenHome:l,onPick:r}=t,i=xt(n),o=i?.title??"Decopilot",a=`Open ${o} home`,d=i?.icon??null;let c;e[0]!==d||e[1]!==o?(c=s.jsx(Te,{icon:d,name:o,size:"2xs"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let m;e[3]!==l||e[4]!==a||e[5]!==c?(m=s.jsx("button",{type:"button",onClick:l,"aria-label":a,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:c}),e[3]=l,e[4]=a,e[5]=c,e[6]=m):m=e[6];let u;e[7]!==o?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let x;e[10]!==u?(x=s.jsxs("button",{type:"button",className:Cs,children:[u,f]}),e[10]=u,e[11]=x):x=e[11];let p;e[12]!==n||e[13]!==r||e[14]!==x?(p=s.jsx(Zr,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=p):p=e[15];let h;return e[16]!==m||e[17]!==p?(h=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=h):h=e[18],h}function Gt(){const t=k.c(33),{org:e}=se(),{state:n}=xe(),l=n==="collapsed",r=ae();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[0]=i):i=t[0];const o=at(i);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const d=Ve(a),{threads:c}=gt(),{setTaskId:m,createNewTask:u}=pt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const x=f.id,p=o.taskId?d.virtualmcpid??x:x;let h;t[4]!==u||t[5]!==x||t[6]!==r||t[7]!==e.slug||t[8]!==m||t[9]!==c?(h=I=>{if(!I||I===x){r({to:"/$org",params:{org:e.slug}});return}const z=c.find($=>!$.hidden&&$.virtual_mcp_id===I&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));z?m(z.id,I):u(I)},t[4]=u,t[5]=x,t[6]=r,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=h):h=t[10];const g=h;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Z.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Kt,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==l?(y=!l&&s.jsx(Ur,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:Cs,children:[s.jsx(ws,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=l,t[18]=y):y=t[18];let _;t[19]!==v||t[20]!==y?(_=s.jsxs(kt,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=_):_=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[22]=C):C=t[22];let N;t[23]!==p||t[24]!==g?(N=()=>g(p),t[23]=p,t[24]=g,t[25]=N):N=t[25];let w;t[26]!==p||t[27]!==g||t[28]!==N?(w=s.jsx(kt,{children:s.jsx(D.Suspense,{fallback:C,children:s.jsx(ei,{agentId:p,onOpenHome:N,onPick:g})})}),t[26]=p,t[27]=g,t[28]=N,t[29]=w):w=t[29];let S;return t[30]!==w||t[31]!==_?(S=s.jsx(al,{className:"wco-no-drag",children:s.jsxs(cl,{className:"flex-nowrap",children:[_,w]})}),t[30]=w,t[31]=_,t[32]=S):S=t[32],S}const ti="sidebar.open";function si(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Vs,{}),t[0]=e):e=t[0],e}function va(){const t=k.c(24),e=mt(),[n,l]=We(ti,!1),{width:r,wrapperRef:i,onStartResize:o,resetWidth:a}=Il();let d;t[0]!==e?(d=e?s.jsxs(Z.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(cs,{}),s.jsx(Gt,{}),s.jsx(it,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(Z.CenterSlot,{}),s.jsx(Z.RightSlot,{})]}):s.jsxs(Z.Header,{children:[s.jsx(Z.LeftColumn,{children:s.jsx(Gt,{})}),s.jsx(Z.CenterSlot,{}),s.jsxs(Z.RightColumn,{children:[s.jsxs("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:[s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{})]}),s.jsx(Z.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==o||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Dr,{}),s.jsx(wl,{onPointerDown:o,onDoubleClick:a})]}),t[4]=e,t[5]=o,t[6]=a,t[7]=f):f=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},t[8]=x):x=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qs,{className:"flex flex-col",style:x,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(D.Suspense,{fallback:s.jsx(si,{}),children:s.jsx(Ws,{})})})})}),t[9]=p):p=t[9];let h;t[10]!==u||t[11]!==f||t[12]!==i?(h=s.jsxs(Ys,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=i,t[13]=h):h=t[13];let g;t[14]!==e?(g=e&&s.jsx(ll,{renderSidebar:ni}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==d||t[17]!==h||t[18]!==g?(b=s.jsx(ol,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,h,g]})}),t[16]=d,t[17]=h,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==l||t[21]!==n||t[22]!==b?(j=s.jsx(Wn,{children:s.jsx(Z.Provider,{children:s.jsx(Js,{open:n,onOpenChange:l,children:b})})}),t[20]=l,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ni(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(Pr,{onClose:e})})})}export{va as default};
@@ -1 +0,0 @@
1
- import{c as k,j as n,r as A,D as J,m as xe,l as Q,i as le,ag as Z,t as K,K as te,k as se,B as Y,d as nt,W as it,E as ot,a as rt,b as lt,u as at}from"./index-thaZU0eY.js";import{u as ge}from"./use-mobile-B23FisN_.js";import{u as ct}from"./useSuspenseQueries-B5d682yj.js";import{u as ae,m as dt}from"./use-mcp-client-B7zSFiOA.js";import{i as mt,a as ut,S as ft}from"./constants-nH3qQ_1f.js";import{u as pt,b as ht,v as xt,a as gt}from"./use-virtual-mcp-BplbsFwA.js";import{i as bt}from"./Check-WJIsHzDQ.js";import{b as Pe,a as Se}from"./ZoomOut-6KFj5qIF.js";import{i as yt,A as ce,t as vt,af as jt,G as Nt,k as wt}from"./agent-icon-8-zG6zq2.js";import{s as be}from"./Plus-CoqGiEoW.js";import{i as ye}from"./X-dW9CI9iO.js";import{p as St}from"./index-CbcN0I3P.js";import{b as Me,c as oe,K as Ee,P as ze,D as Le,d as _t,S as Ct,v as It,g as Tt,h as kt,i as $t,f as At,e as Pt,n as Mt,C as re,L as Et,k as zt}from"./library-tab-dvlvVDBE.js";import{f as Lt,d as Ot}from"./tab-id-Bgchl1bv.js";import{b as Dt}from"./chat-context-p7bQrjVO.js";import{N as Ht}from"./decopilot-Dj817txh.js";import{g as Rt,u as Ft,c as Ut,h as Bt}from"./agent-capabilities-CUZgw2cK.js";import{a as Oe,b as De,o as Vt}from"./use-organization-settings-CtWuj0-0.js";import{c as ve,b as Kt,h as Wt}from"./shell-layout-BnoAEqpd.js";import{I as He}from"./input-DEr8h15j.js";import{S as qt,t as je,P as Gt,k as Qt,s as Jt,g as Xt}from"./scroll-area-urNhBz-2.js";import{S as Zt,a as Yt,b as es,c as ts,d as ss}from"./sheet-C-KllyIc.js";import{S as V}from"./skeleton-Cz4bac5f.js";import{t as Re}from"./ChevronDown-CAuaRLDM.js";import{g as Fe,M as ns}from"./types-BL5SG5y5.js";import{I as Ue}from"./integration-icon-zZ56Ie6s.js";import{S as is,a as os,b as rs,c as _e,d as ls}from"./select-fd5CQiLd.js";import{T as as}from"./textarea-DEWiELfd.js";import{u as Be}from"./studio-tools-C88q8wAb.js";import{a as cs}from"./use-mcp-tools-CXGlYiLZ.js";import{i as ds}from"./XCircle-BLHWvvQb.js";import{g as ms}from"./use-mcp-prompts-BMNQ61Xi.js";import{b as us,w as fs}from"./hooks-355Y2AQ-.js";import{b as ps,d as hs,c as xs,D as gs,a as bs}from"./dropdown-menu-D5GBwmj-.js";import{s as ys}from"./Trash01-2bgd5rb5.js";import{a as vs,u as js}from"./use-ai-providers-C9ok3iTv.js";import{u as Ns}from"./connect-desktop-dialog-Af91UVe4.js";import{T as ws}from"./toolbar-Cs8I9yhI.js";import"./auth-D-3BenR-.js";import"./use-collections-BLTNEY6D.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./Settings02-Dy5hRJWC.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Users03-m0mGCSLF.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./ChevronRight-B7czck1y.js";import"./ChevronUp-D-qnR_uM.js";import"./Circle-KYXNByEA.js";import"./Stars02-XLaFEqA9.js";import"./Copy01-gjq995Op.js";import"./DotsVertical-BVo4MRpu.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LayoutLeft-DNsGMIFw.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./SearchLg-BJoMxiDy.js";import"./SearchMd-YxzpYnNt.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./Zap-NxwXfCyT.js";import"./alert-dialog-DT6CiV3D.js";import"./dialog-DTR6Ld8R.js";import"./file-type-icon-ByfDUgJ1.js";import"./use-debounced-value-Dk3ZHqhr.js";import"./popover-BH74zFmN.js";import"./tooltip-D9_AyRKs.js";import"./index-Cg7efYOu.js";import"./drawer-tKmBK0sh.js";import"./collection-search-CwfTIp5v.js";import"./form-Bdg2md6z.js";import"./label-D9vlZKHj.js";import"./tabs-BJWmaLw8.js";import"./toggle-group-CvC6sjCU.js";import"./command-Be3tajRL.js";import"./index-Ci3919Ge.js";import"./useInfiniteQuery-Deh6Q8fX.js";import"./use-infinite-scroll-CCgHyhHc.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-CdGe1kZY.js";import"./decopilot-sse-pool-wsz4kVX9.js";import"./backoff-CrEUbyZT.js";import"./checkbox-Cf98ydrt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-D9dkHpvf.js";import"./settings-section-C4B_agjR.js";import"./card-WdSE0wjZ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CrmcBQ7w.js";import"./use-registry-connections-BfySsVRx.js";import"./use-connection-DV6jfeKV.js";import"./extract-connection-data-hbWCHJzS.js";import"./collection-tabs-byFj2Ujd.js";import"./badge-C9YrQiOl.js";import"./connection-form-helpers-BEquM1Ke.js";import"./authenticate-and-persist-oauth-cOkcseWI.js";import"./mcp-oauth-HycnBVan.js";import"./useSuspenseInfiniteQuery-Cx1a_TEJ.js";import"./required-auth-layout-DiYJUK17.js";import"./use-org-sso-BCol3dQF.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy--Yb2hvIV.js";import"./content-blocks-o63cs2vh.js";import"./use-clock-tick-Cr8Z09wV.js";import"./use-navigate-to-agent-ChQTAqDN.js";import"./delay-CnY5UFtP.js";function Ve(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(Ss,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function Ss(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(as,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=g=>r(g==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(is,{className:"h-7 text-xs",children:n.jsx(os,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(rs,{children:[n.jsx(_e,{value:"true",children:"true"}),n.jsx(_e,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(ls,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(He,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function _s(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=A.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Zt,{children:"Manage home"}),d=n.jsx(Yt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>r(g.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(es,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(He,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx(A.Suspense,{fallback:u,children:n.jsx(Is,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(ts,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(ss,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function Cs(t){const e=k.c(32),{org:s}=J(),o=Oe();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=De(),d=ht(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const g=p>=ne;let b;e[10]!==g||e[11]!==f||e[12]!==a?(b=_=>f(_)||g?Promise.resolve():a.apply(C=>C.includes(_)?null:[...C,_]),e[10]=g,e[11]=f,e[12]=a,e[13]=b):b=e[13];const y=b;let N;e[14]!==a?(N=_=>a.apply(C=>C.filter(I=>I!==_)),e[14]=a,e[15]=N):N=e[15];const j=N;let v;e[16]!==a?(v=_=>a.apply(()=>_),e[16]=a,e[17]=v):v=e[17];const x=v;let w;e[18]!==d||e[19]!==g||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,C)=>{await d.update.mutateAsync({id:_.id,data:{metadata:C}}),!f(_.id)&&!g&&await a.apply(I=>I.includes(_.id)?null:[...I,_.id]),await c()},e[18]=d,e[19]=g,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let T;return e[24]!==y||e[25]!==g||e[26]!==r||e[27]!==f||e[28]!==j||e[29]!==x||e[30]!==S?(T={homeIds:r,isOnHome:f,atLimit:g,addAgent:y,removeAgent:j,reorder:x,saveAgentMetadata:S},e[24]=y,e[25]=g,e[26]=r,e[27]=f,e[28]=j,e[29]=x,e[30]=S,e[31]=T):T=e[31],T}function Is(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=pt(o);let r;e[1]!==i?(r=new Set(i.map(Ps)),e[1]=i,e[2]=r):r=e[2];const a=Cs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const g=new Map(i.map(As));d=s.trim().toLowerCase();const b=j=>!d||j.title?.toLowerCase().includes(d);l=a.homeIds.map(j=>g.get(j)).filter($s).filter(b);const y=Rt(i);let N;e[9]!==a?(N=j=>!a.isOnHome(j.id),e[9]=a,e[10]=N):N=e[10],m=i.filter(ks).filter(j=>!y.has(j.id)).filter(N).filter(b).sort(Ts),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Ms,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(Ls,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function Ts(t,e){return(t.title??"").localeCompare(e.title??"")}function ks(t){return t.id&&!mt(t.id)}function $s(t){return!!t}function As(t){return[t.id,t]}function Ps(t){return t.id}function Ke(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Ms(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:$t},e[1]=r):r=e[1];const a=Me(oe(ze,i),oe(Ee,r));let d;e[2]!==s?(d=p=>{const{active:h,over:g}=p;if(!g||h.id===g.id)return;const b=s.homeIds,y=b.indexOf(h.id),N=b.indexOf(g.id);y===-1||N===-1||s.reorder(At([...b],y,N)).catch(zs)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ke,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(Es),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Ds,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Es(t){return t.id}function zs(){return K.error("Couldn't reorder home — please try again.")}function Ls(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=A.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ke,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Fs,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function We(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function Ds(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=A.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=Tt(a),p=We(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const g=f?.5:void 0,b=f?100:void 0;let y;e[4]!==h||e[5]!==g||e[6]!==b||e[7]!==u?(y={transform:h,transition:u,opacity:g,zIndex:b},e[4]=h,e[5]=g,e[6]=b,e[7]=u,e[8]=y):y=e[8];const N=y,j=f&&"shadow-lg";let v;e[9]!==j?(v=Q("rounded-lg border border-border bg-card",j),e[9]=j,e[10]=v):v=e[10];const x=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Pe,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==x?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":x,children:w}),e[12]=d,e[13]=l,e[14]=x,e[15]=S):S=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>r(Rs),e[16]=T):T=e[16];const _=s.title??s.id;let C;e[17]!==s.icon||e[18]!==_?(C=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=C):C=e[19];const I=s.title??s.id;let P;e[20]!==I?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:I}),e[20]=I,e[21]=P):P=e[21];let E;e[22]!==p?(E=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=E):E=e[23];let z;e[24]!==P||e[25]!==E?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,E]}),e[24]=P,e[25]=E,e[26]=z):z=e[26];const H=i&&"rotate-180";let L;e[27]!==H?(L=Q("shrink-0 text-muted-foreground transition-transform",H),e[27]=H,e[28]=L):L=e[28];let D;e[29]!==L?(D=n.jsx(Re,{size:16,className:L}),e[29]=L,e[30]=D):D=e[30];let U;e[31]!==i||e[32]!==C||e[33]!==z||e[34]!==D?(U=n.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[C,z,D]}),e[31]=i,e[32]=C,e[33]=z,e[34]=D,e[35]=U):U=e[35];let $;e[36]!==s.id||e[37]!==o?($=()=>o.removeAgent(s.id).catch(Hs),e[36]=s.id,e[37]=o,e[38]=$):$=e[38];const R=`Remove ${s.title??s.id} from home`;let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ye,{size:14}),e[39]=O):O=e[39];let M;e[40]!==$||e[41]!==R?(M=n.jsx("button",{type:"button",onClick:$,"aria-label":R,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:O}),e[40]=$,e[41]=R,e[42]=M):M=e[42];let F;e[43]!==S||e[44]!==U||e[45]!==M?(F=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,U,M]}),e[43]=S,e[44]=U,e[45]=M,e[46]=F):F=e[46];let B;e[47]!==s||e[48]!==i||e[49]!==o?(B=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=B):B=e[50];let W;return e[51]!==m||e[52]!==N||e[53]!==F||e[54]!==B||e[55]!==v?(W=n.jsxs("div",{ref:m,style:N,className:v,children:[F,B]}),e[51]=m,e[52]=N,e[53]=F,e[54]=B,e[55]=v,e[56]=W):W=e[56],W}function Hs(){return K.error("Couldn't remove from home — please try again.")}function Rs(t){return!t}function Fs({agent:t,home:e}){const[s,o]=A.useState(!1),[i,r]=A.useState(!1),a=We(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{K.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(Re,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(be,{size:14})})]}),s&&n.jsx(qe,{agent:t,home:e})]})}function qe(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(Us).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Vs,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Bs,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx(A.Suspense,{fallback:u,children:n.jsx(Qs,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function Us(t){return t.connection_id}function Bs(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(V,{className:"h-8 w-full"}),n.jsx(V,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Vs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Be(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const g=Fe(h._meta);return g?[{name:h.name,description:h.description,resourceUri:g,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(qs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Gs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Ge(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ks(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Ws(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function qs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=A.useState(!1),[d,l]=A.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=A.useState(()=>Ks(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const g=Z(t.metadata?.ui),b=i.tileId?g.filter(N=>N.tileId!==i.tileId):g.filter(N=>N!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,y),l(!1)}catch(g){console.error("[home-tiles] failed to remove tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let g;if(m&&o.inputSchema?.properties){const j=Ge(c,o.inputSchema.properties);if(!j){K.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(j).length>0&&(g=j)}const y=Z(t.metadata?.ui).map(j=>(i.tileId?j.tileId===i.tileId:j===i)?{...j,toolInput:g}:j),N={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,N),l(!1)}catch(g){console.error("[home-tiles] failed to save tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Ws(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Ue,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(g=>!g),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(vt,{size:14})}),n.jsx(Ne,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(g,b)=>u(y=>({...y,[g]:b}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Gs({agent:t,home:e,connection:s,tool:o}){const[i,r]=A.useState(!1),[a,d]=A.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=A.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const y=Ge(m,o.inputSchema.properties);if(!y){K.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(y).length>0&&(p=y)}const g=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,b),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),K.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Ue,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(Ne,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(g=>({...g,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function Ne(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(jt,{size:14}):n.jsx(be,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Qs(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:x}=await d.listPrompts();return x.map(Ys)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=ve(r.slug);let g,b;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let x;e[17]!==s.id?(x=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=x):x=e[18],g=h.prompts.filter(x).map(Zs);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],b=[...w];for(const S of g)b.some(T=>T.name===S.name)||b.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=g,e[16]=b}else g=e[15],b=e[16];if(f&&g.length===0){let x;return e[21]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]}),e[21]=x):x=e[21],x}if(p&&g.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(b.length===0)return null;let y;e[22]!==i||e[23]!==b?(y=i??b.map(Xs),e[22]=i,e[23]=b,e[24]=y):y=e[24];let N;e[25]!==y?(N=new Set(y),e[25]=y,e[26]=N):N=e[26];const j=N;let v;return e[27]!==s||e[28]!==o||e[29]!==b||e[30]!==j?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:b.map(x=>n.jsx(en,{agent:s,home:o,prompt:x,allPromptNames:b.map(Js),isPinned:j.has(x.name)},x.name))}),e[27]=s,e[28]=o,e[29]=b,e[30]=j,e[31]=v):v=e[31],v}function Js(t){return t.name}function Xs(t){return t.name}function Zs(t){return{name:t.promptName,title:t.title,description:t.description}}function Ys(t){return{name:t.name,title:t.title,description:t.description}}function en({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=A.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),K.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(Ne,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},sn)}),t[0]=e):e=t[0],e}function sn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(V,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Qe=`home-board.layout.v${ee}`;function Je(t){return`home-board.layout.v${ee}.${t}`}const Xe={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Xe:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function nn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function on(t){try{const e=localStorage.getItem(Je(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Ce(t,e){try{localStorage.setItem(Je(t),JSON.stringify(e))}catch{}}async function Ie(t,e){if(!(await fetch(`/api/${t}/kv/${Qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function rn(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=on(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Qe}`);if(y.status===404)return a&&nn(a)?(await Ie(t,a),a):Xe;if(!y.ok)throw new Error("Failed to load board layout");const N=await y.json(),j=fe(N.value);return Ce(t,j),j},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:y=>Ie(t,y)},e[11]=t,e[12]=u):u=e[12];const f=nt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=y=>{Ce(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let g;e[18]!==m?(g=fe(m),e[18]=m,e[19]=g):g=e[19];let b;return e[20]!==c||e[21]!==h||e[22]!==g?(b={layout:g,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=g,e[23]=b):b=e[23],b}const Ze=A.createContext(null);function ln(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=rn(o.slug),[r,a]=A.useState(!1),[d,l]=A.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,g=r&&d!==null,b=g?d:i.layout;let y;e[6]!==d||e[7]!==g||e[8]!==i.layout?(y=g?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=g,e[8]=i.layout,e[9]=y):y=e[9];const N=y;let j;e[10]!==r||e[11]!==i?(j=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=j):j=e[12];const v=j;let x;e[13]!==v||e[14]!==c||e[15]!==N||e[16]!==r||e[17]!==b||e[18]!==h||e[19]!==i.isLoading?(x={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:N,layout:b,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=N,e[16]=r,e[17]=b,e[18]=h,e[19]=i.isLoading,e[20]=x):x=e[20];let w;return e[21]!==s||e[22]!==x?(w=n.jsx(Ze.Provider,{value:x,children:s}),e[21]=s,e[22]=x,e[23]=w):w=e[23],w}function Ye(){const t=A.useContext(Ze);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function an({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=us(),{setTaskId:r}=Kt(),[a,d]=A.useState(null),[l,m]=A.useState(!1),c=A.useRef(!1),u=async(b,y)=>{if(!o){K.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const N=await ms(o,b.name,y),j={type:"doc",content:[{type:"paragraph",content:[Qt({id:b.name,name:Jt(b.name,Xt(b._meta)),metadata:N.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();fs(sessionStorage,s,v,{tiptapDoc:j}),await i({id:v,virtual_mcp_id:t}),r(v,t,{autosend:!0})}catch(N){console.error("[start-thread-from-prompt] failed",N),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async b=>{if(!c.current){if(b.arguments&&b.arguments.length>0){d(b);return}await u(b)}},p=async b=>{if(!a)return;const y=a;d(null),await u(y,b)};return{start:f,startBlank:async b=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),r(y,t,b?.main?{main:b.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Gt,{prompt:a,setPrompt:b=>d(b),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Te=12,cn=5,dn={w:2,h:2};class pe extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(it,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function mn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=A.useRef(null),[c,u]=A.useState(null),[f,p]=A.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const g=Me(oe(ze,h),oe(Ee)),b=s.reduce(un,0),y=o?Math.max(b+2,4):Math.max(b,1);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{const $=m.current?.getBoundingClientRect();return $?{cellWidth:$.width/q,cellHeight:G}:null},e[1]=N):N=e[1];const j=N;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=$=>{u(String($.active.id)),p(j())},e[2]=v):v=e[2];const x=v;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=$=>{const R=String($.active.id),O=f??j();if(u(null),p(null),!O||O.cellWidth<=0)return;const M=s.find(W=>W.id===R);if(!M)return;const F=Math.round($.delta.x/O.cellWidth),B=Math.round($.delta.y/O.cellHeight);F===0&&B===0||r(R,{x:M.x+F,y:M.y+B})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let $;if(e[7]!==i||e[8]!==s){let O;e[10]!==i?(O=M=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(M)})},M.id),e[10]=i,e[11]=O):O=e[11],$=s.map(O),e[7]=i,e[8]=s,e[9]=$}else $=e[9];let R;return e[12]!==$?(R=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:$}),e[12]=$,e[13]=R):R=e[13],R}let T,_,C,I,P,E,z,H,L;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==g||e[22]!==s||e[23]!==y){const $=c?s.find(X=>X.id===c):null;_=Le,H=g,L=x,C=S;const R=y*G,O=o?G*4:G;let M;e[33]!==R||e[34]!==O?(M={height:R,minHeight:O},e[33]=R,e[34]=O,e[35]=M):M=e[35];let F;e[36]!==o||e[37]!==s||e[38]!==y?(F=o&&n.jsx(fn,{rows:y,tiles:s}),e[36]=o,e[37]=s,e[38]=y,e[39]=F):F=e[39];let B;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(hn,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],B=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=B}else B=e[46];e[53]!==M||e[54]!==F||e[55]!==B?(I=n.jsxs("div",{ref:m,className:"relative w-full",style:M,children:[F,B]}),e[53]=M,e[54]=F,e[55]=B,e[56]=I):I=e[56],T=Pt,P=null;const W=$&&f?$.w*f.cellWidth-Te:void 0,de=$&&f?$.h*f.cellHeight-Te:void 0;e[57]!==W||e[58]!==de?(E={width:W,height:de},e[57]=W,e[58]=de,e[59]=E):E=e[59],z=$&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i($)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=g,e[22]=s,e[23]=y,e[24]=T,e[25]=_,e[26]=C,e[27]=I,e[28]=P,e[29]=E,e[30]=z,e[31]=H,e[32]=L}else T=e[24],_=e[25],C=e[26],I=e[27],P=e[28],E=e[29],z=e[30],H=e[31],L=e[32];let D;e[60]!==T||e[61]!==P||e[62]!==E||e[63]!==z?(D=n.jsx(T,{dropAnimation:P,style:E,children:z}),e[60]=T,e[61]=P,e[62]=E,e[63]=z,e[64]=D):D=e[64];let U;return e[65]!==_||e[66]!==C||e[67]!==I||e[68]!==D||e[69]!==H||e[70]!==L?(U=n.jsxs(_,{sensors:H,onDragStart:L,onDragEnd:C,children:[I,D]}),e[65]=_,e[66]=C,e[67]=I,e[68]=D,e[69]=H,e[70]=L,e[71]=U):U=e[71],U}function un(t,e){return Math.max(t,e.y+e.h)}function fn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<q;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(pn)}),e[5]=a,e[6]=d):d=e[6],d}function pn(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/q*100}%`,top:t.y*G,width:`${1/q*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function hn(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Mt(m),h=`${s.x/q*100}%`,g=`${s.w/q*100}%`,b=s.y*G,y=s.h*G,N=p||i,j=!N&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=N&&"opacity-30";let x;e[3]!==j||e[4]!==v?(x=Q("absolute p-1 will-change-[left,top,width,height,opacity]",j,v),e[3]=j,e[4]=v,e[5]=x):x=e[5];let w;e[6]!==y||e[7]!==h||e[8]!==b||e[9]!==g?(w={left:h,top:b,width:g,height:y},e[6]=y,e[7]=h,e[8]=b,e[9]=g,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==S?(T=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=T):T=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Pe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(xn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let C;e[20]!==d?(C=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=C):C=e[21];let I;e[22]!==C||e[23]!==T||e[24]!==_?(I=n.jsxs("div",{className:T,children:[_,C]}),e[22]=C,e[23]=T,e[24]=_,e[25]=I):I=e[25];let P;return e[26]!==c||e[27]!==I||e[28]!==x||e[29]!==w?(P=n.jsx("div",{ref:c,className:x,style:w,children:I}),e[26]=c,e[27]=I,e[28]=x,e[29]=w,e[30]=P):P=e[30],P}function xn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ps,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Nt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=b=>{o(s.id,b),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(gn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(hs,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ys,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(xs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(gs,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let g;return e[17]!==r||e[18]!==h?(g=n.jsxs(bs,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=g):g=e[19],g}function gn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=A.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${q}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:cn},(b,y)=>Array.from({length:q},(N,j)=>{const v=j+1,x=y+1,w=v<i||x<r,S=v<=m.w&&x<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${v} by ${x}`,onPointerEnter:()=>d({w:v,h:x}),onClick:()=>o({w:v,h:x}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${v}x${x}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let g;return e[16]!==u||e[17]!==h?(g=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=g):g=e[18],g}function bn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=q-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)bn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(q,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(q-s,t)),i=Math.max(0,e);return{x:o,y:i}}function yn(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function vn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ye();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let N;e[7]!==a?(N=v=>v.pinned||!a.has(v.id),e[7]=a,e[8]=N):N=e[8];const j=t.filter(N);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of j){const x=s.tiles[v.id];if(!x)continue;const w=d.get(v.id),{w:S,h:T}=me(x.w,x.h,w),{x:_,y:C}=ue(x.x,x.y,S);l.push({id:v.id,x:_,y:C,w:S,h:T,minW:w?.w,minH:w?.h})}for(const v of j){if(l.some(C=>C.id===v.id))continue;const x=v.defaultSize??dn,w=d.get(v.id),{w:S,h:T}=me(x.w,x.h,w),_=he(l,S,T);l.push({id:v.id,x:_.x,y:_.y,w:S,h:T,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(jn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(N,j)=>{const v={};for(const x of N)v[x.id]={x:x.x,y:x.y,w:x.w,h:x.h};i({version:ee,tiles:v,hidden:j.filter(x=>c.has(x))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(N,j)=>{const v=l.find(S=>S.id===N);if(!v)return;const x=ue(j.x,j.y,v.w);if(x.x===v.x&&x.y===v.y)return;const w=yn(l,N,x);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let g;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(g=(N,j)=>{const v=l.find(I=>I.id===N);if(!v)return;const x=d.get(N),{w,h:S}=me(j.w,j.h,x);if(w===v.w&&S===v.h)return;const T={...v,w,h:S,x:ue(v.x,v.y,w).x},_=l.filter(I=>I.id!==N),C=[T];for(const I of _){const P=he(C,I.w,I.h);C.push({...I,x:P.x,y:P.y})}f(C,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=g):g=e[24];let b;e[25]!==f||e[26]!==s||e[27]!==l?(b=N=>{const j=l.filter(v=>v.id!==N);f(j,Array.from(new Set([...s.hidden,N])))},e[25]=f,e[26]=s,e[27]=l,e[28]=b):b=e[28];let y;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==g||e[33]!==b?(y={snapshot:p,isLoading:o,moveTile:h,resizeTile:g,hideTile:b},e[29]=o,e[30]=p,e[31]=h,e[32]=g,e[33]=b,e[34]=y):y=e[34],y}function jn(t){return t.id}const Nn={w:2,h:4},wn={w:1,h:2},Sn={w:1,h:1};function _n(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Cn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function In(t){return t.promptName?t.agentName:t.description}function Tn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function et(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=dt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=cs(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Fe(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?Lt(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function we(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=an(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(Tn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function kn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=we(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let g;e[12]!==s?(g=In(s),e[12]=s,e[13]=g):g=e[13];let b;e[14]!==g?(b=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:g}),e[14]=g,e[15]=b):b=e[15];let y;e[16]!==b||e[17]!==h?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,b]}),e[16]=b,e[17]=h,e[18]=y):y=e[18];let N;e[19]!==o?(N=!o&&n.jsx(ds,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=N):N=e[20];let j;e[21]!==a||e[22]!==d||e[23]!==y||e[24]!==N||e[25]!==l||e[26]!==f||e[27]!==p?(j=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,y,N]}),e[21]=a,e[22]=d,e[23]=y,e[24]=N,e[25]=l,e[26]=f,e[27]=p,e[28]=j):j=e[28];let v;return e[29]!==r||e[30]!==j?(v=n.jsxs(n.Fragment,{children:[j,r]}),e[29]=r,e[30]=j,e[31]=v):v=e[31],v}function $n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},An)}),t[0]=e):e=t[0],e}function An(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(V,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Pn(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=we(s.agentId),u=o.filter(Mn),f=et(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const g="flex min-h-0 flex-1 gap-3 overflow-hidden";let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(zn,{}),e[5]=b):b=e[5];let y;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx(A.Suspense,{fallback:b,children:n.jsx(En,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=y):y=e[9];const N=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(x=>n.jsx("button",{type:"button",onClick:()=>d(x),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:x.title})},x.promptName))});let j;e[10]!==y||e[11]!==N?(j=n.jsxs("div",{className:g,children:[y,N]}),e[10]=y,e[11]=N,e[12]=j):j=e[12];let v;return e[13]!==m||e[14]!==h||e[15]!==j?(v=n.jsxs("div",{className:p,children:[h,j,m]}),e[13]=m,e[14]=h,e[15]=j,e[16]=v):v=e[16],v}function Mn(t){return!!t.promptName}function En(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ns,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function zn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ln(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(V,{className:"h-3 w-3/4"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function On(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=we(s.agentId),m=o.filter(Dn),c=et(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const g=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&r(y),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let b;return e[6]!==d||e[7]!==h||e[8]!==g?(b=n.jsxs("div",{className:u,children:[h,g,d]}),e[6]=d,e[7]=h,e[8]=g,e[9]=b):b=e[9],b}function Dn(t){return!!t.promptName}function tt({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=ve(e.slug),r=Oe()?.ids??[],a=new Set(r),d=De(),l=Be(),m=xe(),c=new Set(i.map(x=>x.agentId)),u=new Map;for(const x of o){const w=u.get(x.agentId);w?w.push(x):u.set(x.agentId,[x])}const f=o.filter(x=>!c.has(x.agentId)),p=[...i.map(x=>({kind:"tile",id:Cn(x),data:x})),...f.map(x=>({kind:"prompt",id:_n(x),data:x}))],h=new Map(p.map(x=>[x.id,x])),g=vn(p.map(x=>({id:x.id,defaultSize:x.kind==="tile"?Nn:Sn,minSize:x.kind==="tile"?wn:void 0,pinned:a.has(x.data.agentId)}))),b=x=>{d.apply(w=>w.filter(S=>S!==x)).catch(()=>K.error("Couldn't remove from home — please try again."))},y=async x=>{if(i.filter(S=>S.agentId===x.agentId).length<=1){b(x.agentId);return}try{const T=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:x.agentId})).item;if(!T)throw new Error("Agent not found");const _=Z(T.metadata?.ui),C=x.tileId?_.filter(I=>I.tileId!==x.tileId):_.filter(I=>I.connectionId!==x.connectionId||I.resourceUri!==x.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:x.agentId,data:{metadata:{...T.metadata??{},ui:{...T.metadata?.ui??{},homeTile:null,homeTiles:C}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{K.error("Couldn't remove tile — please try again.")}},N=x=>{const w=h.get(x);if(w){if(!a.has(w.data.agentId)){g.hideTile(x);return}w.kind==="tile"?y(w.data):b(w.data.agentId)}},j=x=>{const w=h.get(x.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(On,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx(A.Suspense,{fallback:n.jsx(Ln,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t,tileWidth:x.w})})})}return n.jsx(kn,{entry:w.data,isEditMode:t})};return s||g.isLoading?n.jsx($n,{}):g.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(mn,{tiles:g.snapshot.visible,isEditMode:t,renderTile:j,onMove:g.moveTile,onResize:g.resizeTile,onRemove:N})})}function Hn(t){const e=k.c(2),{prompts:s,tiles:o}=ve(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const ke=420,$e=305;function st(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}})]}),t[3]=i):i=t[3],i}function Ae(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=Ns(),{selectedVirtualMcp:r}=Dt();let a;t[0]!==s.id?(a=ut(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Wt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:ft,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=vs(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Vt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=xt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let g;t[17]!==f||t[18]!==p||t[19]!==h?(g={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=g):g=t[20],ct(g);const b=js(),y=gt(l.id),{hasDecoKey:N,isZeroBalance:j,isInitialFreeCredit:v,balanceDollars:x,hasOnlyDecoProvider:w}=Ft(),{hasVisibleTiles:S}=Hn(s.slug),T=Ut(y?.metadata);if(b.length===0&&!(T&&Bt(i))){let D;return t[21]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Ht,{})})}),t[21]=D):D=t[21],D}let C;t[22]!==e?.user?.name?(C=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=C):C=t[23];const I=C,P=N&&v&&x!=null,E=N&&j&&w;let z;t[24]!==x||t[25]!==P||t[26]!==E?(z=P?n.jsx(re.CreditsEyebrow,{balanceDollars:x}):E?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=x,t[25]=P,t[26]=E,t[27]=z):z=t[27];const H=z;let L;return t[28]!==H||t[29]!==S||t[30]!==o||t[31]!==I?(L=n.jsx(ln,{children:o?n.jsx(Rn,{eyebrow:H,userName:I}):n.jsx(Fn,{eyebrow:H,userName:I,hasVisibleTiles:S})}),t[28]=H,t[29]=S,t[30]=o,t[31]=I,t[32]=L):L=t[32],L}function Rn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(st,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(tt,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Fn(t){const e=k.c(54),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ye(),[c,u]=A.useState(!1),f=lt();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={strict:!1},e[0]=p):p=e[0];const{main:h}=at(p);let g;e[1]!==h?(g=h?Ot(h):null,e[1]=h,e[2]=g):g=e[2];const b=g,y=h==="files"||!!b;let N;e[3]!==f?(N=B=>f({to:".",search:W=>({...W,main:B}),replace:!0}),e[3]=f,e[4]=N):N=e[4];const j=N;let v;e[5]===Symbol.for("react.memo_cache_sentinel")?(v={kind:"component",Component:Se},e[5]=v):v=e[5];let x;e[6]!==y||e[7]!==j?(x=()=>j(y?void 0:"files"),e[6]=y,e[7]=j,e[8]=x):x=e[8];let w;e[9]!==y||e[10]!==x?(w=n.jsx(St,{title:"Library",icon:v,active:y,onClick:x}),e[9]=y,e[10]=x,e[11]=w):w=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=()=>u(!0),e[12]=S):S=e[12];let T;e[13]!==l||e[14]!==a||e[15]!==m||e[16]!==r||e[17]!==d?(T=n.jsx(Un,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:S}),e[13]=l,e[14]=a,e[15]=m,e[16]=r,e[17]=d,e[18]=T):T=e[18];let _;e[19]!==w||e[20]!==T?(_=n.jsxs(ws.Right,{children:[w,T]}),e[19]=w,e[20]=T,e[21]=_):_=e[21];let C;e[22]!==c?(C=n.jsx(_s,{open:c,onOpenChange:u}),e[22]=c,e[23]=C):C=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(st,{}),e[24]=I):I=e[24];const P=i||r?"pt-32":"flex-1 justify-center";let E;e[25]!==P?(E=Q("relative flex flex-col items-center px-10 pb-4",P),e[25]=P,e[26]=E):E=e[26];let z;e[27]!==s?(z=s&&n.jsx("div",{className:"mb-4",children:s}),e[27]=s,e[28]=z):z=e[28];let H;e[29]!==o?(H=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[29]=o,e[30]=H):H=e[30];let L;e[31]!==z||e[32]!==H?(L=n.jsxs("div",{className:"text-center mb-10",children:[z,H]}),e[31]=z,e[32]=H,e[33]=L):L=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Bn,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[34]=D):D=e[34];let U;e[35]!==L?(U=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[L,D]}),e[35]=L,e[36]=U):U=e[36];let $;e[37]!==r?($=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(tt,{isEditMode:r})}),e[37]=r,e[38]=$):$=e[38];let R;e[39]!==E||e[40]!==U||e[41]!==$?(R=n.jsxs("div",{className:"flex-1 min-w-0 relative flex flex-col",children:[I,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:E,children:[U,$]})})]}),e[39]=E,e[40]=U,e[41]=$,e[42]=R):R=e[42];let O;e[43]!==b||e[44]!==y||e[45]!==j?(O=y&&n.jsxs("div",{className:"w-[45%] max-w-[680px] min-w-[380px] shrink-0 flex flex-col min-h-0 border-l border-border bg-background",children:[n.jsxs("div",{className:"h-10 shrink-0 flex items-center justify-between px-3 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[n.jsx(Se,{size:16}),"Library"]}),n.jsx("button",{type:"button",onClick:()=>j(void 0),"aria-label":"Close Library panel",className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:n.jsx(ye,{size:16})})]}),n.jsx("div",{className:"flex-1 min-h-0",children:b?n.jsx(Et,{path:b.path}):n.jsx(zt,{})})]}),e[43]=b,e[44]=y,e[45]=j,e[46]=O):O=e[46];let M;e[47]!==R||e[48]!==O?(M=n.jsxs("div",{className:"flex-1 relative flex flex-row min-h-0",children:[R,O]}),e[47]=R,e[48]=O,e[49]=M):M=e[49];let F;return e[50]!==C||e[51]!==M||e[52]!==_?(F=n.jsxs(n.Fragment,{children:[_,C,M]}),e[50]=C,e[51]=M,e[52]=_,e[53]=F):F=e[53],F}function Un(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(be,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ye,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(bt,{size:14}),e[6]=g):g=e[6];let b;e[7]!==r||e[8]!==h?(b=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[g,"Save"]}),e[7]=r,e[8]=h,e[9]=b):b=e[9];let y;return e[10]!==u||e[11]!==p||e[12]!==b?(y=n.jsxs(n.Fragment,{children:[u,p,b]}),e[10]=u,e[11]=p,e[12]=b,e[13]=y):y=e[13],y}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(wt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function Bn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function lr(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ae,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ae,{})})})}),t[1]=s):s=t[1],s}export{lr as default};