decocms 4.126.1 → 4.126.2

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 (225) hide show
  1. package/dist/client/assets/{AlertCircle-Cpl_iMHY.js → AlertCircle-wZFBWpo0.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BqFUuFcm.js → AreaChart-BWG_A2yL.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-NqG0gPh-.js → ArrowRight-DDYoySSU.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DMJUikwr.js → ArrowUp-BfmJVXpe.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CtURRnV0.js → ArrowUpRight-CX0JFgau.js} +1 -1
  6. package/dist/client/assets/{Check-dpauEaNI.js → Check-C-gVe66h.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-zW46MQTo.js → CheckCircle-DwQTzzLo.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BQLnN9E6.js → ChevronDown-CHUXS0bx.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-CyiD6-MW.js → ChevronRight-BewiR8jv.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DQvrAigY.js → ChevronUp-DbJPy-my.js} +1 -1
  11. package/dist/client/assets/{Copy01-DDeCwAgK.js → Copy01-CXOBuKeI.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Bj4PS0aF.js → DotsVertical-DSuOWFkK.js} +1 -1
  13. package/dist/client/assets/{Eye-Dfg-461O.js → Eye-BzQwpriV.js} +1 -1
  14. package/dist/client/assets/{FilterLines-CxHovx4d.js → FilterLines-Cmyrpv9O.js} +1 -1
  15. package/dist/client/assets/{HardDrive-C67jRlzv.js → HardDrive-MuN_hYGO.js} +1 -1
  16. package/dist/client/assets/{Key01-D7-mKS4d.js → Key01-DsAMFomV.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-Dnk9I__a.js → LayoutLeft-BKoIFwRN.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DtG8qR-V.js → LinkExternal01-B0YPc_S1.js} +1 -1
  19. package/dist/client/assets/{LogOut01-Bv49wu0L.js → LogOut01-Cr7guD_C.js} +1 -1
  20. package/dist/client/assets/{Monitor01-DEsYEg9j.js → Monitor01-BDL-jnJs.js} +1 -1
  21. package/dist/client/assets/{Palette-3AyXb_ds.js → Palette-BAqGRxp5.js} +1 -1
  22. package/dist/client/assets/{Play-C5qDNLgC.js → Play-DgsbjMDE.js} +1 -1
  23. package/dist/client/assets/{Plus-C7p4TBsq.js → Plus--3XFCNRh.js} +1 -1
  24. package/dist/client/assets/{SearchLg-BP6dxoOu.js → SearchLg-fj8vBgbf.js} +1 -1
  25. package/dist/client/assets/{SearchMd-CFZ8th88.js → SearchMd-Db6xGpMm.js} +1 -1
  26. package/dist/client/assets/{Settings02-BRYke4o3.js → Settings02-BCqIMlR1.js} +1 -1
  27. package/dist/client/assets/{Shield01-DObW8vGC.js → Shield01-DmJb3xyD.js} +1 -1
  28. package/dist/client/assets/{Star01-b06OrJx9.js → Star01-6fXqBYGO.js} +1 -1
  29. package/dist/client/assets/{Stars01-CwezkrCj.js → Stars01-6mAfYED3.js} +1 -1
  30. package/dist/client/assets/{Stars02-CV1WX5s1.js → Stars02-DXc-e3hC.js} +1 -1
  31. package/dist/client/assets/{Sun-BYgqmEv8.js → Sun-BUqEkjZt.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-D9GLmxcG.js → SwitchHorizontal01-CGOv_Rrr.js} +1 -1
  33. package/dist/client/assets/{Tool01-CbNqThfz.js → Tool01-pmII3WpR.js} +1 -1
  34. package/dist/client/assets/{Tool02-BK6vOVj2.js → Tool02-CBXM0F92.js} +1 -1
  35. package/dist/client/assets/{Trash01-CZfSiRn_.js → Trash01-CJ9K1v0c.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-CbzGmSk7.js → TrendUp01-BjARk23u.js} +1 -1
  37. package/dist/client/assets/{Upload01-OvmEXaXy.js → Upload01-dYbrTK96.js} +1 -1
  38. package/dist/client/assets/{User01-mA16LPDW.js → User01-BWh29jlX.js} +1 -1
  39. package/dist/client/assets/{Users01-D3kMDHBl.js → Users01-CVpagA8a.js} +1 -1
  40. package/dist/client/assets/{Users03-CMTgzssO.js → Users03-X_nEGPVF.js} +1 -1
  41. package/dist/client/assets/{X-Ds6dL0ec.js → X-BB9BsBG9.js} +1 -1
  42. package/dist/client/assets/{XCircle-Bw2f1-oB.js → XCircle-Cnd7dAXs.js} +1 -1
  43. package/dist/client/assets/{XClose-CggKQboo.js → XClose-DYcmy7Dm.js} +1 -1
  44. package/dist/client/assets/{Zap-cm7wIsil.js → Zap-CjDEO_x2.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-CULLx7Oa.js → ZapSquare-l2Bo-FFh.js} +1 -1
  46. package/dist/client/assets/{access-gate-B5Uu6KI_.js → access-gate-wIXn4O0u.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-C0j8sHqV.js → add-section-modal-LPPys9Wr.js} +1 -1
  48. package/dist/client/assets/{agent-icon-ZuDh9-Hb.js → agent-icon-zWW3t6VG.js} +1 -1
  49. package/dist/client/assets/{agents-list-BwHTZnDL.js → agents-list-BfMyyq9F.js} +1 -1
  50. package/dist/client/assets/{ai-providers-CUGZxUFM.js → ai-providers-CrFNNWxE.js} +1 -1
  51. package/dist/client/assets/{alert-DktlcBN9.js → alert-CG7QTVbj.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-iJ0nuAo2.js → alert-dialog-DboT2S2L.js} +1 -1
  53. package/dist/client/assets/{app-editor-DKXC32M1.js → app-editor-BuHoAPSu.js} +1 -1
  54. package/dist/client/assets/{auth--O1w_iKV.js → auth-_9lv2gUI.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-C66NRByx.js → auth-catchall-zPdg3Kfr.js} +1 -1
  56. package/dist/client/assets/{auth-entry-DKS3G1uz.js → auth-entry-DvIBJ_b3.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-DcrydIAL.js → auth-split-layout-DcqR7Bmx.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BimYrVCh.js → authenticate-and-persist-oauth-B1ortyYw.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-CB0Na4Io.js → automation-list-row-CwLU5mFl.js} +1 -1
  60. package/dist/client/assets/{automation-runs-CjoeGDB3.js → automation-runs-DIhCKhoX.js} +1 -1
  61. package/dist/client/assets/{automations-5W4kO3k8.js → automations-CxAr-Q1U.js} +1 -1
  62. package/dist/client/assets/{avatar-BaVe5mnj.js → avatar-BLfSxUga.js} +1 -1
  63. package/dist/client/assets/{badge-rSCRRNZZ.js → badge-Caz53JSJ.js} +1 -1
  64. package/dist/client/assets/{block-document-BDVs9E35.js → block-document-DCUWew_G.js} +1 -1
  65. package/dist/client/assets/{brand-context-DXRoGovW.js → brand-context-CNCL9GzV.js} +1 -1
  66. package/dist/client/assets/{buckets-iue9Ud7d.js → buckets-DzyUqHLV.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-DlUIZJ14.js → bulk-category-panel-BS7tQG_z.js} +1 -1
  68. package/dist/client/assets/{calendar-B4BM6mn9.js → calendar-DDRNxoxt.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-C19nQZEJ.js → capability-load-error-CQIupxYq.js} +1 -1
  70. package/dist/client/assets/{card-CCT9DM3i.js → card-MKJv9EQN.js} +1 -1
  71. package/dist/client/assets/{category-editor-B0T-VrR6.js → category-editor-oiFHZZss.js} +1 -1
  72. package/dist/client/assets/{chat-context-BBbr98oD.js → chat-context-CS8lxm9_.js} +1 -1
  73. package/dist/client/assets/{checkbox-Bq4_WPl3.js → checkbox-PaZ4NcMV.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-CNtuqj7e.js → cli-auth-success-CDUUNd9g.js} +1 -1
  75. package/dist/client/assets/{collection-detail-DQNU4HiQ.js → collection-detail-0xKJQ9H2.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-BXR6o3H2.js → collection-display-button-BshEeKVa.js} +1 -1
  77. package/dist/client/assets/{collection-search-BtCuCV16.js → collection-search-B27cYP5F.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-C_cazobp.js → collection-table-wrapper-BC54lFoV.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-0Qyek4_u.js → collection-tabs-CkE9QnXQ.js} +1 -1
  80. package/dist/client/assets/{command-2wvo7x41.js → command-BtKeqRh4.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-CL4fDsdf.js → commerce-onboarding-DrIMQf60.js} +1 -1
  82. package/dist/client/assets/{companions-core-D1MZ9B1U.js → companions-core-CSljQMf_.js} +1 -1
  83. package/dist/client/assets/{connect-gUMrTotC.js → connect-CvYZoBOv.js} +1 -1
  84. package/dist/client/assets/{connect-desktop-dialog-BuM5aUqF.js → connect-desktop-dialog-DPG0q8Du.js} +1 -1
  85. package/dist/client/assets/{connection-card-CD-x-wIk.js → connection-card-CR8Tezk_.js} +1 -1
  86. package/dist/client/assets/{connection-detail-BuJnU9wM.js → connection-detail-BMvUAx0H.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-bxVBlV5J.js → connection-form-helpers-BHvHPEt2.js} +1 -1
  88. package/dist/client/assets/{connection-B0_6E7Mv.js → connection-vOOMEOVb.js} +1 -1
  89. package/dist/client/assets/{connections-HgZRNGX4.js → connections-CANGKksk.js} +1 -1
  90. package/dist/client/assets/{decopilot-sse-pool-zU_w0iZh.js → decopilot-sse-pool-Cs4Wzcc3.js} +1 -1
  91. package/dist/client/assets/{dialog-C1Qgh1pV.js → dialog-Bx0tkWaQ.js} +1 -1
  92. package/dist/client/assets/{domain-settings-Dr8-E0BO.js → domain-settings-D3GvEyoX.js} +1 -1
  93. package/dist/client/assets/{drawer-C-awTSYf.js → drawer-D1lsCtV4.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-DnVtnirM.js → dropdown-menu-DuOVs_Vf.js} +1 -1
  95. package/dist/client/assets/{empty-state-t-xxj99b.js → empty-state-CJ5pANud.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-D2Q5eAdA.js → extract-connection-data-DN3g7eFu.js} +1 -1
  97. package/dist/client/assets/{file-explorer-YJoVbzpR.js → file-explorer-CwtsUPq9.js} +1 -1
  98. package/dist/client/assets/{form-Bcx3Dx5v.js → form-Du5MP186.js} +1 -1
  99. package/dist/client/assets/{general-CTIKCAQW.js → general-Nt3tjjZW.js} +1 -1
  100. package/dist/client/assets/{github-repo-picker-CfFhjmhR.js → github-repo-picker-CevuiACk.js} +1 -1
  101. package/dist/client/assets/{hooks-BRAlfwVg.js → hooks--vfnlMbG.js} +1 -1
  102. package/dist/client/assets/{index-5tHCzznE.js → index-3f_ZHyYf.js} +1 -1
  103. package/dist/client/assets/{index-poTj2wxK.js → index-99C6r-0O.js} +1 -1
  104. package/dist/client/assets/{index-25tDLcHQ.js → index-BGBjg2-p.js} +1 -1
  105. package/dist/client/assets/{index-CRfJJjBr.js → index-CGW3LfG6.js} +1 -1
  106. package/dist/client/assets/{index-BFHC2rlf.js → index-CNkhfL0R.js} +1 -1
  107. package/dist/client/assets/{index-75oUoREO.js → index-CQJLbbtF.js} +5 -5
  108. package/dist/client/assets/{index-CTwgLDWF.js → index-CoQgMoag.js} +3 -3
  109. package/dist/client/assets/{index-C_mT0QTy.js → index-D7Rza1Tk.js} +1 -1
  110. package/dist/client/assets/{index-D0GbPI_R.js → index-D7ecmoEk.js} +3 -3
  111. package/dist/client/assets/{index-DMXNbwjD.js → index-DdOGLJvQ.js} +1 -1
  112. package/dist/client/assets/{index-pNi6sXYH.js → index-do14p2vi.js} +1 -1
  113. package/dist/client/assets/{index-redirect-D_UJBrMZ.js → index-redirect-mbRRtjqd.js} +1 -1
  114. package/dist/client/assets/{input-Bb4p9_ik.js → input-Dc_Ksu2B.js} +1 -1
  115. package/dist/client/assets/{integration-icon-bG23TCVO.js → integration-icon-Bep1O6vd.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-BSPugAve.js → invite-member-dialog-Cgl5-4U8.js} +1 -1
  117. package/dist/client/assets/{label-5xpx6MdG.js → label-C7DWPW8F.js} +1 -1
  118. package/dist/client/assets/{layout-q_JOMITt.js → layout-DBTeM9nZ.js} +1 -1
  119. package/dist/client/assets/{login-DWFYfzVD.js → login-DpMXYVre.js} +1 -1
  120. package/dist/client/assets/{mcp-oauth-I-PLDGs0.js → mcp-oauth-BaAftNVP.js} +1 -1
  121. package/dist/client/assets/{members-DAGQnraC.js → members-Bmt50hSJ.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-3ZmYAdL5.js → monaco-editor-BgAWurBW.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-D-FdpFBv.js → monitoring-stats-row-Bm74hEZ0.js} +1 -1
  124. package/dist/client/assets/{multi-select-CCg5PDqH.js → multi-select-CfZlB5Qw.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-D3gHvTLm.js → oauth-callback-CYLUgfp4.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-D0DSENaB.js → oauth-callback-ai-provider-K0a_OY_-.js} +1 -1
  127. package/dist/client/assets/{onboarding-Bor5OprO.js → onboarding-BGO_NBG2.js} +1 -1
  128. package/dist/client/assets/{org-install-B0gCH-Nk.js → org-install-DR5oM3KD.js} +1 -1
  129. package/dist/client/assets/{org-layout-BWKTyxWj.js → org-layout-703CuN-Z.js} +1 -1
  130. package/dist/client/assets/{organization-choice-DWfbtdFz.js → organization-choice-CFpQM--U.js} +1 -1
  131. package/dist/client/assets/{orgs-BtRV84O-.js → orgs-EWbhKMdE.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-BFCjEKMU.js → page-seo-form-D8vHQJoo.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-DyzBHLgd.js +1 -0
  134. package/dist/client/assets/{popover-BqPUB_i2.js → popover-uYC-XEIg.js} +1 -1
  135. package/dist/client/assets/{post-editor-MaKq00sv.js → post-editor-BqIreh8a.js} +1 -1
  136. package/dist/client/assets/{primitives-DtK7id8m.js → primitives-BPDffT-K.js} +1 -1
  137. package/dist/client/assets/{profile-CN9LLarl.js → profile-Da2FFTD6.js} +1 -1
  138. package/dist/client/assets/project-app-view-C3gRZgWO.js +1 -0
  139. package/dist/client/assets/record-editor-nWW4hsfT.js +1 -0
  140. package/dist/client/assets/{redirect-editor-D5Na_rRm.js → redirect-editor-Bh1TaWO_.js} +1 -1
  141. package/dist/client/assets/registry-CCileC0o.js +2 -0
  142. package/dist/client/assets/{registry-layout-XctP0_TB.js → registry-layout-D4_J8FmQ.js} +1 -1
  143. package/dist/client/assets/{reports-BBeGN80e.js → reports-BjYgGXCV.js} +1 -1
  144. package/dist/client/assets/{require-capability-2rozIXBv.js → require-capability-BiIETUd1.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-pINrUhAT.js → required-auth-layout-CWsSFaCw.js} +1 -1
  146. package/dist/client/assets/{reset-password-sGF0Deja.js → reset-password-DLH3cD85.js} +1 -1
  147. package/dist/client/assets/{roles-CtVuRlNg.js → roles-BrK-3S4P.js} +1 -1
  148. package/dist/client/assets/{search-input-DHMmvRu9.js → search-input-yjiuaHAG.js} +1 -1
  149. package/dist/client/assets/{secrets-Cek9nNDM.js → secrets-PZ05_PBq.js} +1 -1
  150. package/dist/client/assets/{sections-editor-KKjVHQIb.js → sections-editor-BksufGla.js} +1 -1
  151. package/dist/client/assets/{select-model-DeVAqDr8.js → select-model-ZFqJATQj.js} +1 -1
  152. package/dist/client/assets/{select-JTf4HMkB.js → select-o--wOfO_.js} +1 -1
  153. package/dist/client/assets/{self-tool-result-JVOqtq7F.js → self-tool-result-CGMZAwKq.js} +1 -1
  154. package/dist/client/assets/{seo-editor-BKn-yjw0.js → seo-editor-Bxl54AMl.js} +1 -1
  155. package/dist/client/assets/{settings-layout-0HfTLbLa.js → settings-layout-DPWbQ34b.js} +1 -1
  156. package/dist/client/assets/{settings-section-Duse8CF5.js → settings-section-ClU7ej3n.js} +1 -1
  157. package/dist/client/assets/{shell-controls-CjdX-cXs.js → shell-controls-CH6DRW8q.js} +1 -1
  158. package/dist/client/assets/{shell-layout-BX_6t6Y4.js → shell-layout-Bp9VqH1i.js} +1 -1
  159. package/dist/client/assets/{sidebar-JCplCzUs.js → sidebar-BVI_V0Ou.js} +1 -1
  160. package/dist/client/assets/{skeleton-rG0lAer-.js → skeleton-DzEF007-.js} +1 -1
  161. package/dist/client/assets/{sso-DZif8bEF.js → sso-DVZelKBV.js} +1 -1
  162. package/dist/client/assets/{store-DSniQ8uA.js → store-BMsGxZX_.js} +1 -1
  163. package/dist/client/assets/store-registry-xshyt2Qy.js +2 -0
  164. package/dist/client/assets/{studio-tools-CVP_bYI3.js → studio-tools-BnkAV7Qh.js} +1 -1
  165. package/dist/client/assets/{switch-RfqMPlNx.js → switch-JdJblN-W.js} +1 -1
  166. package/dist/client/assets/{tab-id-6SxTM-85.js → tab-id-BUyXQAAI.js} +1 -1
  167. package/dist/client/assets/{table-CkAONPU-.js → table-BsxxkDds.js} +1 -1
  168. package/dist/client/assets/{tabs-C6CALd7M.js → tabs-SMaulwar.js} +1 -1
  169. package/dist/client/assets/{textarea-BDUOK9v4.js → textarea-BJyqw4SL.js} +1 -1
  170. package/dist/client/assets/{toggle-group-BJ3nTIOw.js → toggle-group-D32XTjzk.js} +1 -1
  171. package/dist/client/assets/{toolbar-BbjlhC11.js → toolbar-CdMnBYXx.js} +1 -1
  172. package/dist/client/assets/{tooltip-CZxZ-Bns.js → tooltip-DV8_wP4H.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-RLFjMIPM.js → use-ai-providers-CGmpPHf_.js} +1 -1
  174. package/dist/client/assets/{use-api-keys-Yfc55xX1.js → use-api-keys-BfTMjXnb.js} +1 -1
  175. package/dist/client/assets/{use-automations-DMIHt0qx.js → use-automations-DKxhc36V.js} +1 -1
  176. package/dist/client/assets/{use-autosave-CTaJVuYe.js → use-autosave-B7d7j-io.js} +1 -1
  177. package/dist/client/assets/{use-capability-C9LPdJIR.js → use-capability-ev2jDwzE.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-CF0pPFJP.js → use-clock-tick-CdvZtpVB.js} +1 -1
  179. package/dist/client/assets/{use-connection-D67Pe6aW.js → use-connection-BVFqG9Id.js} +1 -1
  180. package/dist/client/assets/{use-copy-3pbdZZcV.js → use-copy-ChgQcxSu.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-DOgSWB_T.js → use-create-virtual-mcp-Cz4bgQ9e.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-B7CCzcf-.js → use-debounced-autosave-D35X8JvW.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-DSrcUzF-.js → use-debounced-value-BC1HcYvB.js} +1 -1
  184. package/dist/client/assets/{use-deco-credits-BEDSGMQk.js → use-deco-credits-BuBKE8oE.js} +1 -1
  185. package/dist/client/assets/{use-decopilot-events-DqMtcih3.js → use-decopilot-events-hTj_0wvh.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-CeKf58YN.js → use-delete-connection-qfgJCzx4.js} +1 -1
  187. package/dist/client/assets/{use-deployment-admin-BAJ25R18.js → use-deployment-admin-BmhPiQqU.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-eEXpH4IT.js → use-file-configs-h0BKPSC_.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-CUTwghko.js → use-infinite-scroll-DaBbmjUW.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-DSCKcWR6.js → use-join-requests-RAdw_UW-.js} +1 -1
  191. package/dist/client/assets/{use-mcp-auth-status-GN_90IVc.js → use-mcp-auth-status-D78D4ly6.js} +1 -1
  192. package/dist/client/assets/{use-mcp-client-2qqsLKMv.js → use-mcp-client-CnyXhKwV.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-DYZgnU0f.js → use-mcp-tools-Y11uuW0V.js} +1 -1
  194. package/dist/client/assets/{use-members-BBMl3rpc.js → use-members-SNaM7f-x.js} +1 -1
  195. package/dist/client/assets/{use-mobile-orl9RI6e.js → use-mobile-BvPCUKE_.js} +1 -1
  196. package/dist/client/assets/{use-navigate-to-agent-BL6ciQ9Y.js → use-navigate-to-agent-mziLMlnK.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-nWz-MFtZ.js → use-org-auth-client-D-a5lzlz.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-D-Dpc7wL.js → use-org-sso-DRXrpsuQ.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-DuvB4P7M.js → use-organization-roles-Bfvpk2iJ.js} +1 -1
  200. package/dist/client/assets/{use-organization-settings-DcpRbwzw.js → use-organization-settings-BIY_uMId.js} +1 -1
  201. package/dist/client/assets/{use-registry-app-CLQNyM7N.js → use-registry-app-Dah_IHSb.js} +1 -1
  202. package/dist/client/assets/{use-registry-connections-BgFdJfUy.js → use-registry-connections-Dt1w8c5m.js} +1 -1
  203. package/dist/client/assets/{use-secrets-DuyNYvJ7.js → use-secrets-CDDI4aok.js} +1 -1
  204. package/dist/client/assets/{use-status-sounds-CO1cS1Qf.js → use-status-sounds-Co4aEO2K.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-Ck3q6mF-.js → use-view-mode-D5dCZ-RY.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-DYkiFIJC.js → use-virtual-mcp-qSYuKLW8.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-BRBbsKnZ.js +1 -0
  208. package/dist/client/assets/{useQueries-DNJ2_DVv.js → useQueries-BoGu5qPQ.js} +1 -1
  209. package/dist/client/assets/{useRouterState-CSvDrQv7.js → useRouterState-Dmetv5YU.js} +1 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-BjnR7v75.js +1 -0
  211. package/dist/client/assets/{users-NNxyxZtX.js → users-BU2FMU03.js} +1 -1
  212. package/dist/client/assets/{variant-calendar-BotkXpCr.js → variant-calendar-Bby2_euu.js} +1 -1
  213. package/dist/client/assets/{view-mode-toggle-B0C9EwSq.js → view-mode-toggle-AG0DCuNp.js} +1 -1
  214. package/dist/client/index.html +1 -1
  215. package/dist/server/cli.js +3 -3
  216. package/dist/server/migrate.js +1 -1
  217. package/dist/server/server.js +3 -3
  218. package/package.json +1 -1
  219. package/dist/client/assets/page-seo-sheet-CgVitSBt.js +0 -1
  220. package/dist/client/assets/project-app-view-D-9tjTDx.js +0 -1
  221. package/dist/client/assets/record-editor-DoN02fjB.js +0 -1
  222. package/dist/client/assets/registry-BA7wbNAk.js +0 -2
  223. package/dist/client/assets/store-registry-7wOo-ziX.js +0 -2
  224. package/dist/client/assets/useInfiniteQuery-DwwDCJAw.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-DOVA9lC8.js +0 -1
@@ -1 +1 @@
1
- import{c as I,b as H,j as s,y as fs,B as be,d as ae,F as Q,G as ps,r as G,E as Xe,H as hs,x as xs,K as Mt,e as it,p as V,I as ze,m as B,a as $e,J as gs,v as bs,t as ce,M as js,P as vs,L as ys,n as _s,R as Ss,k as Ns,f as Cs,u as It,O as ks,U as ws}from"./index-D0GbPI_R.js";import{u as _e,S as Qe,a as Je,b as J,c as Y,d as q,e as Tt,f as Ms,g as Pt,h as Is,i as Ge,j as Ts,k as Ps,l as $s}from"./sidebar-JCplCzUs.js";import{u as $t}from"./use-mobile-orl9RI6e.js";import{C as As,p as Re,s as zs,a as Os,n as Es}from"./self-tool-result-JVOqtq7F.js";import{f as Ds,b as Ze,e as et,g as Rs,d as At,h as zt,a as Ot}from"./dialog-C1Qgh1pV.js";import{f as Fs}from"./tab-id-6SxTM-85.js";import{C as Ls,W as Et,g as Gs,u as Dt,S as Rt,a as rt}from"./use-mcp-client-2qqsLKMv.js";import{i as tt}from"./ArrowRight-NqG0gPh-.js";import{i as Ft}from"./ChevronRight-CyiD6-MW.js";import{i as Hs}from"./X-Ds6dL0ec.js";import{s as Bs,a as Us,t as Lt,i as Ws,b as Ks,c as qs,d as at,e as Vs,f as Ys,g as Gt,A as Ce,h as Xs,j as Qs,k as Js,l as Zs}from"./agent-icon-ZuDh9-Hb.js";import{S as se}from"./skeleton-rG0lAer-.js";import{i as Ht}from"./LayoutLeft-Dnk9I__a.js";import{O as He,A as st,u as en,a as tn,g as sn,b as nn,c as ln}from"./use-deco-credits-BEDSGMQk.js";import{T as ke,a as xe}from"./toolbar-BbjlhC11.js";import{P as Bt,a as Ut,b as Wt}from"./popover-BqPUB_i2.js";import{D as on,a as rn,b as an}from"./drawer-C-awTSYf.js";import{A as Be}from"./avatar-BaVe5mnj.js";import{T as je,a as ve,b as Kt,c as ye}from"./tooltip-CZxZ-Bns.js";import{a as Ue}from"./Copy01-DDeCwAgK.js";import{n as cn,i as dn}from"./Tool02-BK6vOVj2.js";import{n as mn}from"./LinkExternal01-DtG8qR-V.js";import{i as ct}from"./LogOut01-Bv49wu0L.js";import{i as We}from"./Monitor01-DEsYEg9j.js";import{n as un,a as fn}from"./Sun-BYgqmEv8.js";import{a as Oe}from"./Settings02-BRYke4o3.js";import{i as pn}from"./Shield01-DObW8vGC.js";import{a as hn}from"./Users03-CMTgzssO.js";import{u as xn}from"./use-deployment-admin-BAJ25R18.js";import"./index-poTj2wxK.js";import{a as qt}from"./XCircle-Bw2f1-oB.js";import{a as gn}from"./ZapSquare-CULLx7Oa.js";import{I as Vt}from"./invite-member-dialog-BSPugAve.js";import{u as dt}from"./use-copy-3pbdZZcV.js";import{i as Ke}from"./Check-dpauEaNI.js";import{m as bn,u as jn,c as vn}from"./use-api-keys-Yfc55xX1.js";import{u as yn,C as _n}from"./chat-context-BBbr98oD.js";import{v as Sn,C as mt}from"./connect-desktop-dialog-BuM5aUqF.js";import{u as nt}from"./use-organization-settings-DcpRbwzw.js";import{i as Nn}from"./FilterLines-CxHovx4d.js";import{T as Cn,a as kn}from"./toggle-group-BJ3nTIOw.js";import{u as Yt,a as wn}from"./use-virtual-mcp-DYkiFIJC.js";import{u as Mn,a as Xt,b as In,T as Tn}from"./hooks-BRAlfwVg.js";import{u as Qt,f as Pn}from"./shell-layout-BX_6t6Y4.js";import{C as $n,a as An,b as zn,c as On,d as En}from"./command-2wvo7x41.js";import{u as Jt}from"./studio-tools-CVP_bYI3.js";import{i as Zt}from"./Zap-cm7wIsil.js";import{S as es,M as Dn}from"./shell-controls-CjdX-cXs.js";import{n as Rn}from"./Stars02-CV1WX5s1.js";import{g as Fn,u as Ln,S as Gn}from"./use-clock-tick-CF0pPFJP.js";import{a as Hn}from"./format-time-BnbuEtat.js";import{t as Bn}from"./ChevronDown-BQLnN9E6.js";import{S as ts}from"./use-navigate-to-agent-BL6ciQ9Y.js";import"./integration-icon-bG23TCVO.js";import"./companions-core-D1MZ9B1U.js";import"./extract-connection-data-D2Q5eAdA.js";import"./metadata-dUsYcpuu.js";import"./github-repo-scope-DjMZbiKa.js";import"./CheckCircle-zW46MQTo.js";import"./form-Bcx3Dx5v.js";import"./label-5xpx6MdG.js";import"./input-Bb4p9_ik.js";import"./Eye-Dfg-461O.js";import"./use-debounced-value-DSrcUzF-.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./useQueries-DNJ2_DVv.js";import"./authenticate-and-persist-oauth-BimYrVCh.js";import"./mcp-oauth-I-PLDGs0.js";import"./auth--O1w_iKV.js";import"./AlertCircle-Cpl_iMHY.js";import"./Tool01-CbNqThfz.js";import"./ArrowUp-DMJUikwr.js";import"./ArrowUpRight-CtURRnV0.js";import"./TrendUp01-CbzGmSk7.js";import"./ChevronUp-DQvrAigY.js";import"./DotsVertical-Bj4PS0aF.js";import"./Star01-b06OrJx9.js";import"./Palette-3AyXb_ds.js";import"./SwitchHorizontal01-D9GLmxcG.js";import"./HardDrive-C67jRlzv.js";import"./Key01-D7-mKS4d.js";import"./Play-C5qDNLgC.js";import"./Plus-C7p4TBsq.js";import"./SearchLg-BP6dxoOu.js";import"./SearchMd-CFZ8th88.js";import"./Stars01-CwezkrCj.js";import"./Trash01-CZfSiRn_.js";import"./Upload01-OvmEXaXy.js";import"./User01-mA16LPDW.js";import"./Users01-D3kMDHBl.js";import"./XClose-CggKQboo.js";import"./alert-dialog-iJ0nuAo2.js";import"./use-registry-app-CLQNyM7N.js";import"./use-mcp-tools-DYZgnU0f.js";import"./github-repo-picker-CfFhjmhR.js";import"./collection-search-BtCuCV16.js";import"./use-connection-D67Pe6aW.js";import"./reusable-new-chat-CouMjkYR.js";import"./connection-card-CD-x-wIk.js";import"./use-registry-connections-BgFdJfUy.js";import"./useInfiniteQuery-DwwDCJAw.js";import"./use-infinite-scroll-CUTwghko.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./connection-slug-eyAPH6o3.js";import"./card-CCT9DM3i.js";import"./select-JTf4HMkB.js";import"./textarea-BDUOK9v4.js";import"./connection-form-helpers-bxVBlV5J.js";import"./collection-tabs-0Qyek4_u.js";import"./badge-rSCRRNZZ.js";import"./useSuspenseInfiniteQuery-DOVA9lC8.js";import"./use-ai-providers-RLFjMIPM.js";import"./use-org-auth-client-nWz-MFtZ.js";import"./use-organization-roles-DuvB4P7M.js";import"./use-decopilot-events-DqMtcih3.js";import"./decopilot-sse-pool-zU_w0iZh.js";import"./required-auth-layout-pINrUhAT.js";import"./use-org-sso-D-Dpc7wL.js";import"./index-CRfJJjBr.js";import"./differenceInSeconds-NQ4PDo0z.js";const Un="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function Wn(){const t=I.c(13),e=H();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),t[1]=e,t[2]=o):o=t[2];let l;t[3]!==o?(l=s.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),t[3]=o,t[4]=l):l=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:Un,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),t[5]=i):i=t[5];let r;t[6]!==e?(r=e("routes.commerceOnboarding.connectModal.quoteAuthor"),t[6]=e,t[7]=r):r=t[7];let a;t[8]!==r?(a=s.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,s.jsx("span",{className:"text-base font-medium",children:r})]}),t[8]=r,t[9]=a):a=t[9];let d;return t[10]!==l||t[11]!==a?(d=s.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[n,l,a]}),t[10]=l,t[11]=a,t[12]=d):d=t[12],d}function Kn(){const t=I.c(19),e=H();let n;t[0]!==e?(n=e("routes.commerceOnboarding.connectModal.trustRevoke"),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={Icon:Bs,label:n},t[2]=n,t[3]=o):o=t[3];let l;t[4]!==e?(l=e("routes.commerceOnboarding.connectModal.trustEncrypted"),t[4]=e,t[5]=l):l=t[5];let i;t[6]!==l?(i={Icon:fs,label:l},t[6]=l,t[7]=i):i=t[7];let r;t[8]!==e?(r=e("routes.commerceOnboarding.connectModal.trustNeverSold"),t[8]=e,t[9]=r):r=t[9];let a;t[10]!==r?(a={Icon:Us,label:r},t[10]=r,t[11]=a):a=t[11];let d;t[12]!==o||t[13]!==i||t[14]!==a?(d=[o,i,a],t[12]=o,t[13]=i,t[14]=a,t[15]=d):d=t[15];const c=d;let m;t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-px w-full bg-white/15"}),t[16]=m):m=t[16];let u;return t[17]!==c?(u=s.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,s.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:c.map(qn)})]}),t[17]=c,t[18]=u):u=t[18],u}function qn(t){const{Icon:e,label:n}=t;return s.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[s.jsx(e,{className:"size-4 shrink-0 opacity-85"}),n]},n)}function Vn(t){const e=I.c(22),{siteHost:n,footer:o,onClose:l,children:i}=t,r=H(),a=n?`https://www.google.com/s2/favicons?domain=${n}&sz=128`:null;let d;e[0]!==l||e[1]!==r?(d=l&&s.jsx("button",{type:"button",onClick:l,"aria-label":r("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:s.jsx(Hs,{size:18})}),e[0]=l,e[1]=r,e[2]=d):d=e[2];let c,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=c,e[4]=m):(c=e[3],m=e[4]);let u;e[5]!==a||e[6]!==n?(u=n&&s.jsxs(s.Fragment,{children:[s.jsx(Ft,{size:16,className:"shrink-0 text-foreground/25"}),a&&s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:s.jsx("img",{src:a,alt:"",className:"size-full"})}),s.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:n})]}),e[5]=a,e[6]=n,e[7]=u):u=e[7];let p;e[8]!==u?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[c,m,u]}),e[8]=u,e[9]=p):p=e[9];let x;e[10]!==o?(x=s.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=x):x=e[11];let f;e[12]!==i||e[13]!==p||e[14]!==x?(f=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[p,i,x]}),e[12]=i,e[13]=p,e[14]=x,e[15]=f):f=e[15];let g,h;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),h=s.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=g,e[17]=h):(g=e[16],h=e[17]);let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[g,h,s.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[s.jsx("div",{className:"flex-1"}),s.jsx(Wn,{}),s.jsx("div",{className:"flex-1"}),s.jsx(Kn,{})]})]}),e[18]=b):b=e[18];let v;return e[19]!==d||e[20]!==f?(v=s.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[d,f,b]}),e[19]=d,e[20]=f,e[21]=v):v=e[21],v}function Yn(t){const e=I.c(5),{ready:n,pending:o,label:l,onClick:i,children:r}=t,a=o||!n,d=n&&!o?r:null;let c;return e[0]!==l||e[1]!==i||e[2]!==a||e[3]!==d?(c=s.jsxs(be,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:a,children:[l,d]}),e[0]=l,e[1]=i,e[2]=a,e[3]=d,e[4]=c):c=e[4],c}function Xn(t){const e=I.c(22),{siteUrl:n}=t,o=ae(),{org:l}=Q(),i=H();let r;e[0]!==o||e[1]!==l.id||e[2]!==l.slug?(r=()=>{localStorage.setItem(ps.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:l.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Gs(l.id),main:Fs(Et.COMMERCE_DISCOVERY(l.id),Ls),sidepanel:0}})},e[0]=o,e[1]=l.id,e[2]=l.slug,e[3]=r):r=e[3];const a=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ds,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=d):d=e[4];let c;e[5]!==i?(c=i("routes.commerceOnboarding.connectModal.dialogTitle"),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==c?(m=s.jsx(Ze,{className:"sr-only",children:c}),e[7]=c,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==i?(u=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:i("routes.commerceOnboarding.connectModal.loadError")}),s.jsxs(be,{type:"button",size:"xl",className:"w-full",onClick:a,children:[i("routes.commerceOnboarding.connectModal.continueButton"),s.jsx(tt,{size:18})]})]}),e[9]=a,e[10]=i,e[11]=u):u=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(As,{}),e[12]=p):p=e[12];let x;e[13]!==a||e[14]!==n?(x=s.jsx(G.Suspense,{fallback:p,children:s.jsx(el,{siteUrlFromUrl:n,onComplete:a})}),e[13]=a,e[14]=n,e[15]=x):x=e[15];let f;e[16]!==u||e[17]!==x?(f=s.jsx(Xe,{fallback:u,children:x}),e[16]=u,e[17]=x,e[18]=f):f=e[18];let g;return e[19]!==m||e[20]!==f?(g=s.jsx(et,{open:!0,children:s.jsxs(Rs,{children:[d,s.jsxs(hs,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Zn,onPointerDownOutside:Jn,onInteractOutside:Qn,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,f]})]})}),e[19]=m,e[20]=f,e[21]=g):g=e[21],g}function Qn(t){return t.preventDefault()}function Jn(t){return t.preventDefault()}function Zn(t){return t.preventDefault()}function el({siteUrlFromUrl:t,onComplete:e}){const n=H(),{org:o}=Q(),l=Et.COMMERCE_DISCOVERY(o.id),i=Dt({connectionId:Rt,orgId:o.id,orgSlug:o.slug}),a=xs({queryKey:Mt.commerceDiscoveryConnection(o.id,l),queryFn:async()=>{const y=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:l}});return Re(y)},retry:!1}).data.item,d=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||d,m=zs(c),[u,p]=G.useState(!0),[x,f]=G.useState(null),g=it({mutationFn:async y=>Re(await i.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}})),retry:!1}),h=it({mutationFn:async y=>Re(await i.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:y}})),retry:!1}),b=async()=>{f(null),V("commerce_onboarding_open_report_clicked",{domain:m??void 0,organization_id:o.id});const y=c?Es(c):null;if(y?.ok)try{let j=await h.mutateAsync(y.value);if(j.triggered||(V("commerce_onboarding_run_reclaim",{domain:m??void 0,organization_id:o.id,reason:j.reason??"not_upgraded"}),await g.mutateAsync(y.value),j=await h.mutateAsync(y.value)),!j.triggered){V("commerce_onboarding_run_failed",{domain:m??void 0,organization_id:o.id,error:j.reason??"not_triggered"}),f(n("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(j){V("commerce_onboarding_run_failed",{domain:m??void 0,organization_id:o.id,error:j instanceof Error?j.message:String(j)}),f(n("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}e()},v=u;return s.jsx(Vn,{siteHost:m,footer:s.jsxs(s.Fragment,{children:[x?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:x}):null,s.jsx(Yn,{ready:v,pending:h.isPending,label:h.isPending?n("routes.commerceOnboarding.connectModal.openingReport"):n(v?"routes.commerceOnboarding.connectModal.viewFullReport":"routes.commerceOnboarding.connectModal.connectToolToContinue"),onClick:()=>{b()},children:s.jsx(tt,{size:18})})]}),children:s.jsx(Os,{org:o,cdConnectionId:l,siteUrl:c,onReadinessChange:p})})}function tl(t){const e=I.c(11),{onPointerDown:n,onDoubleClick:o}=t,l=H(),{state:i,isMobile:r}=_e();if(r||i==="collapsed")return null;let a;e[0]!==l?(a=l("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=l,e[1]=a):a=e[1];let d;e[2]!==l?(d=l("sidebar.sidebarResizeHandle.title"),e[2]=l,e[3]=d):d=e[3];let c,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={left:"var(--sidebar-width)"},m=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[4]=c,e[5]=m):(c=e[4],m=e[5]);let u;return e[6]!==o||e[7]!==n||e[8]!==a||e[9]!==d?(u=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a,title:d,onPointerDown:n,onDoubleClick:o,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:c,children:m}),e[6]=o,e[7]=n,e[8]=a,e[9]=d,e[10]=u):u=e[10],u}const lt=240,sl=400,nl="sidebar.width";function Ne(t){return Math.max(lt,Math.min(sl,t))}function ll(){const t=I.c(11),[e,n]=ze(nl,ol),o=G.useRef(null);let l;t[0]!==n||t[1]!==e?(l=m=>{m.preventDefault();const u=m.clientX,p=Ne(e),x=o.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),f=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of f)b.style.transition="none";const g=b=>{const v=Ne(p+(b.clientX-u));x?.style.setProperty("--sidebar-width",`${v}px`)},h=b=>{const v=Ne(p+(b.clientX-u));n(v);for(const y of f)y.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",h),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",h)},t[0]=n,t[1]=e,t[2]=l):l=t[2];const i=l;let r;t[3]!==n?(r=()=>{n(lt)},t[3]=n,t[4]=r):r=t[4];const a=r;let d;t[5]!==e?(d=Ne(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:o,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function ol(t){return typeof t=="number"?Ne(t):lt}function ss(){return[]}function ns(t){const e=I.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let l;return e[1]!==n?(l=s.jsxs(Qe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Je,{children:s.jsx(J,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=l):l=e[2],l}function ls(t){const e=I.c(18),{item:n}=t,{isMobile:o,setOpenMobile:l}=_e();let i;e[0]!==o||e[1]!==n||e[2]!==l?(i=()=>{V("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&l(!1)},e[0]=o,e[1]=n,e[2]=l,e[3]=i):i=e[3];const r=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=B(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]!==r||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(Y,{onClick:r,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=r,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let p;return e[14]!==n.key||e[15]!==c||e[16]!==u?(p=s.jsx(q,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=p):p=e[17],p}function il(t){const e=I.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Tt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,l=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(al),e[2]=n.group.items,e[3]=i):i=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(r=s.jsx(ns,{label:o,defaultExpanded:l,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=r):r=e[7],r}case"items":{let o;e[8]!==n.items?(o=n.items.map(rl),e[8]=n.items,e[9]=o):o=e[9];let l;return e[10]!==o?(l=s.jsx(Qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Je,{children:s.jsx(J,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=l):l=e[11],l}case"custom":return n.content}}function rl(t){return s.jsx(ls,{item:t},t.key)}function al(t){return s.jsx(ls,{item:t},t.key)}function cl(t){const e=I.c(17),{sections:n,footer:o,additionalContent:l,header:i,variant:r,contentClassName:a}=t,d=r===void 0?"sidebar":r;let c;e[0]!==i?(c=i&&s.jsx(Ms,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:i}),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=B("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n.map(dl),e[4]=n,e[5]=u):u=e[5];let p;e[6]!==l?(p=l&&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:l}),e[6]=l,e[7]=p):p=e[7];let x;e[8]!==m||e[9]!==u||e[10]!==p?(x=s.jsxs(Pt,{className:m,children:[u,p]}),e[8]=m,e[9]=u,e[10]=p,e[11]=x):x=e[11];let f;return e[12]!==o||e[13]!==c||e[14]!==x||e[15]!==d?(f=s.jsxs(Is,{variant:d,children:[c,x,o]}),e[12]=o,e[13]=c,e[14]=x,e[15]=d,e[16]=f):f=e[16],f}function dl(t,e){return s.jsx(il,{section:t},e)}function os(t){const e=I.c(2);let n;return e[0]!==t?(n=s.jsx(cl,{...t}),e[0]=t,e[1]=n):n=e[1],n}os.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(se,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ut(t){const e=I.c(18),{item:n,onClose:o}=t,l=n.isActive&&"z-10";let i;e[0]!==l?(i=B(l),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==o?(r=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==r||e[12]!==a||e[13]!==d?(c=s.jsxs(Y,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=r,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(q,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function ml(t){const e=I.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Tt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;if(e[2]!==o||e[3]!==n.group.items){let d;e[5]!==o?(d=c=>s.jsx(ut,{item:c,onClose:o},c.key),e[5]=o,e[6]=d):d=e[6],r=n.group.items.map(d),e[2]=o,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let l;if(e[11]!==o||e[12]!==n.items){let r;e[14]!==o?(r=a=>s.jsx(ut,{item:a,onClose:o},a.key),e[14]=o,e[15]=r):r=e[15],l=n.items.map(r),e[11]=o,e[12]=n.items,e[13]=l}else l=e[13];let i;return e[16]!==l?(i=s.jsx(Qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Je,{children:s.jsx(J,{className:"gap-1.5",children:l})})}),e[16]=l,e[17]=i):i=e[17],i}case"custom":return n.content}}function ul(t){const e=I.c(27),{sections:n,onClose:o,footer:l,additionalContent:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(He,{}),e[0]=r):r=e[0];let a;e[1]!==o?(a=s.jsx(st,{onNavigate:o}),e[1]=o,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1"}),e[3]=d):d=e[3];const c=H();let m;e[4]!==c?(m=c("sidebar.navigationMobile.closeSidebar"),e[4]=c,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ht,{size:16}),e[6]=u):u=e[6];let p;e[7]!==o||e[8]!==m?(p=s.jsx(ke,{onClick:o,"aria-label":m,children:u}),e[7]=o,e[8]=m,e[9]=p):p=e[9];let x;e[10]!==a||e[11]!==p?(x=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[r,a,d,p]}),e[10]=a,e[11]=p,e[12]=x):x=e[12];let f;if(e[13]!==o||e[14]!==n){let v;e[16]!==o?(v=(y,j)=>s.jsx(ml,{section:y,onClose:o},j),e[16]=o,e[17]=v):v=e[17],f=n.map(v),e[13]=o,e[14]=n,e[15]=f}else f=e[15];let g;e[18]!==i?(g=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[18]=i,e[19]=g):g=e[19];let h;e[20]!==g||e[21]!==f?(h=s.jsxs(Pt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,g]}),e[20]=g,e[21]=f,e[22]=h):h=e[22];let b;return e[23]!==l||e[24]!==h||e[25]!==x?(b=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[x,h,l]}),e[23]=l,e[24]=h,e[25]=x,e[26]=b):b=e[26],b}function ge(t){const e=I.c(26),{item:n,onClose:o}=t;let l;e[0]!==n.className?(l=B("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=l):l=e[1];const i=l;if(n.href){const m=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let p;e[2]!==n.icon?(p=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=p):p=e[3];let x;e[4]!==n.label?(x=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=x):x=e[5];let f;return e[6]!==i||e[7]!==n.href||e[8]!==o||e[9]!==m||e[10]!==u||e[11]!==p||e[12]!==x?(f=s.jsxs("a",{href:n.href,target:m,rel:u,className:i,onClick:o,children:[p,x]}),e[6]=i,e[7]=n.href,e[8]=o,e[9]=m,e[10]=u,e[11]=p,e[12]=x,e[13]=f):f=e[13],f}let r;e[14]!==n||e[15]!==o?(r=()=>{n.onClick?.(),o()},e[14]=n,e[15]=o,e[16]=r):r=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let d;e[19]!==n.label?(d=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=d):d=e[20];let c;return e[21]!==i||e[22]!==r||e[23]!==a||e[24]!==d?(c=s.jsxs("button",{type:"button",onClick:r,className:i,children:[a,d]}),e[21]=i,e[22]=r,e[23]=a,e[24]=d,e[25]=c):c=e[25],c}function fl(){const t=I.c(4),e=H();let n;t[0]!==e?(n=e("common.accountPopover.impersonating"),t[0]=e,t[1]=n):n=t[1];let o;return t[2]!==n?(o=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:n}),t[2]=n,t[3]=o):o=t[3],o}function ft(t){const e=I.c(38),{user:n,userImage:o,isImpersonating:l,isMobile:i}=t,r=H(),a=i?"py-4 border-b border-border":"py-3 mx-1 mt-1";let d;e[0]!==a?(d=B("flex items-center gap-3 px-4",a),e[0]=a,e[1]=d):d=e[1];const c=n?.name??"U";let m;e[2]!==c||e[3]!==o?(m=s.jsx(Be,{url:o,fallback:c,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=c,e[3]=o,e[4]=m):m=e[4];let u;e[5]!==r||e[6]!==n?.name?(u=n?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=n?.name,e[7]=u):u=e[7];let p;e[8]!==u?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:u}),e[8]=u,e[9]=p):p=e[9];let x;e[10]!==l?(x=l&&s.jsx(fl,{}),e[10]=l,e[11]=x):x=e[11];let f;e[12]!==p||e[13]!==x?(f=s.jsxs("div",{className:"flex items-center gap-2",children:[p,x]}),e[12]=p,e[13]=x,e[14]=f):f=e[14];const g=n?.email;let h;e[15]!==g?(h=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=h):h=e[16];let b;e[17]!==h||e[18]!==f?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[17]=h,e[18]=f,e[19]=b):b=e[19];let v;e[20]!==r||e[21]!==n?(v=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{ce.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=n,e[22]=v):v=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ue,{size:14}),e[23]=y):y=e[23];let j;e[24]!==v?(j=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[24]=v,e[25]=j):j=e[25];let _;e[26]!==r?(_=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=_):_=e[27];let C;e[28]!==_?(C=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:_})}),e[28]=_,e[29]=C):C=e[29];let N;e[30]!==j||e[31]!==C?(N=s.jsx(Kt,{delayDuration:300,children:s.jsxs(ye,{children:[j,C]})}),e[30]=j,e[31]=C,e[32]=N):N=e[32];let S;return e[33]!==b||e[34]!==N||e[35]!==d||e[36]!==m?(S=s.jsxs("div",{className:d,children:[m,b,N]}),e[33]=b,e[34]=N,e[35]=d,e[36]=m,e[37]=S):S=e[37],S}function pt(t){const e=I.c(35),{themeOptions:n,preferences:o,setPreferences:l,isMobile:i}=t,r=H(),a=i?"size-8":"size-7",d=i?"px-3 py-3":"px-2 py-1.5";let c;e[0]!==d?(c=B("flex items-center justify-between border-t border-border/50",d),e[0]=d,e[1]=c):c=e[1];let m;if(e[2]!==a||e[3]!==o.theme||e[4]!==l||e[5]!==n){let _;e[7]!==a||e[8]!==o.theme||e[9]!==l?(_=C=>{const{value:N,icon:S,label:w}=C;return s.jsx("button",{type:"button","aria-label":w,onClick:()=>l(k=>({...k,theme:N})),className:B(a,"rounded-md flex items-center justify-center transition-colors",o.theme===N?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:S},N)},e[7]=a,e[8]=o.theme,e[9]=l,e[10]=_):_=e[10],m=n.map(_),e[2]=a,e[3]=o.theme,e[4]=l,e[5]=n,e[6]=m}else m=e[6];let u;e[11]!==m?(u=s.jsx("div",{className:"flex items-center gap-0.5",children:m}),e[11]=m,e[12]=u):u=e[12];let p;e[13]!==o.enableSounds||e[14]!==r?(p=o.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=o.enableSounds,e[14]=r,e[15]=p):p=e[15];let x;e[16]!==l?(x=()=>l(pl),e[16]=l,e[17]=x):x=e[17];const f=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let g;e[18]!==a||e[19]!==f?(g=B(a,"rounded-md flex items-center justify-center transition-colors",f),e[18]=a,e[19]=f,e[20]=g):g=e[20];let h;e[21]!==o.enableSounds?(h=o.enableSounds?s.jsx(Ks,{size:14}):s.jsx(qs,{size:14}),e[21]=o.enableSounds,e[22]=h):h=e[22];let b;e[23]!==p||e[24]!==x||e[25]!==g||e[26]!==h?(b=s.jsx("button",{type:"button","aria-label":p,onClick:x,className:g,children:h}),e[23]=p,e[24]=x,e[25]=g,e[26]=h,e[27]=b):b=e[27];let v;e[28]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.126.1"]}),e[28]=v):v=e[28];let y;e[29]!==b?(y=s.jsxs("div",{className:"flex items-center gap-2",children:[b,v]}),e[29]=b,e[30]=y):y=e[30];let j;return e[31]!==y||e[32]!==c||e[33]!==u?(j=s.jsxs("div",{className:c,children:[u,y]}),e[31]=y,e[32]=c,e[33]=u,e[34]=j):j=e[34],j}function pl(t){return{...t,enableSounds:!t.enableSounds}}function ht(t){const e=I.c(54),{user:n,userImage:o,menuItems:l,signOutItem:i,stopImpersonatingItem:r,isImpersonating:a,themeOptions:d,preferences:c,setPreferences:m,close:u,isMobile:p}=t;if(p){let j;e[0]!==a||e[1]!==n||e[2]!==o?(j=s.jsx(ft,{user:n,userImage:o,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=o,e[3]=j):j=e[3];let _;if(e[4]!==u||e[5]!==l){let T;e[7]!==u?(T=M=>s.jsx(ge,{item:M,onClose:u},M.key),e[7]=u,e[8]=T):T=e[8],_=l.map(T),e[4]=u,e[5]=l,e[6]=_}else _=e[6];let C;e[9]!==u||e[10]!==r?(C=r&&s.jsx(ge,{item:r,onClose:u}),e[9]=u,e[10]=r,e[11]=C):C=e[11];let N;e[12]!==u||e[13]!==i?(N=s.jsx(ge,{item:i,onClose:u}),e[12]=u,e[13]=i,e[14]=N):N=e[14];let S;e[15]!==_||e[16]!==C||e[17]!==N?(S=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:[_,C,N]})}),e[15]=_,e[16]=C,e[17]=N,e[18]=S):S=e[18];let w;e[19]!==c||e[20]!==m||e[21]!==d?(w=s.jsx(pt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!0}),e[19]=c,e[20]=m,e[21]=d,e[22]=w):w=e[22];let k;return e[23]!==j||e[24]!==S||e[25]!==w?(k=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[j,S,w]}),e[23]=j,e[24]=S,e[25]=w,e[26]=k):k=e[26],k}let x;e[27]!==a||e[28]!==n||e[29]!==o?(x=s.jsx(ft,{user:n,userImage:o,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=o,e[30]=x):x=e[30];let f;if(e[31]!==u||e[32]!==l){let j;e[34]!==u?(j=_=>s.jsx(ge,{item:_,onClose:u},_.key),e[34]=u,e[35]=j):j=e[35],f=l.map(j),e[31]=u,e[32]=l,e[33]=f}else f=e[33];let g;e[36]!==u||e[37]!==r?(g=r&&s.jsx(ge,{item:r,onClose:u}),e[36]=u,e[37]=r,e[38]=g):g=e[38];let h;e[39]!==u||e[40]!==i?(h=s.jsx(ge,{item:i,onClose:u}),e[39]=u,e[40]=i,e[41]=h):h=e[41];let b;e[42]!==f||e[43]!==g||e[44]!==h?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[f,g,h]}),e[42]=f,e[43]=g,e[44]=h,e[45]=b):b=e[45];let v;e[46]!==c||e[47]!==m||e[48]!==d?(v=s.jsx(pt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!1}),e[46]=c,e[47]=m,e[48]=d,e[49]=v):v=e[49];let y;return e[50]!==x||e[51]!==b||e[52]!==v?(y=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[x,b,v]})}),e[50]=x,e[51]=b,e[52]=v,e[53]=y):y=e[53],y}function qe(){const t=I.c(99),e=H(),{data:n}=$e.useSession(),{org:o}=Q(),l=ae();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=gs(i)?.params.org,[d,c]=bs(),m=$t(),{isAdmin:u}=xn(),[p,x]=G.useState(!1),f=n?.user,g=f?.image,h=!!n?.session?.impersonatedBy;let b;t[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>x(!1),t[1]=b):b=t[1];const v=b;let y;t[2]!==e?(y=e("common.accountPopover.preferences"),t[2]=e,t[3]=y):y=t[3];let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Oe,{size:16}),t[4]=j):j=t[4];let _;t[5]!==l||t[6]!==a?(_=()=>{l({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=l,t[6]=a,t[7]=_):_=t[7];let C;t[8]!==y||t[9]!==_?(C={key:"preferences",label:y,icon:j,onClick:_},t[8]=y,t[9]=_,t[10]=C):C=t[10];let N;t[11]!==o||t[12]!==l||t[13]!==e?(N=o?[{key:"install-app",label:e("common.accountPopover.addToHomeScreen"),icon:s.jsx(cn,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:o.slug}})}},{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(mn,{size:16}),onClick:()=>{l({to:"/$org/settings/connect",params:{org:o.slug}})}}]:[],t[11]=o,t[12]=l,t[13]=e,t[14]=N):N=t[14];let S;t[15]!==e?(S=e("common.accountPopover.termsOfUse"),t[15]=e,t[16]=S):S=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Ws,{size:16}),t[17]=w):w=t[17];let k;t[18]!==S?(k={key:"terms",label:S,icon:w,href:"https://www.decocms.com/terms-of-use",external:!0},t[18]=S,t[19]=k):k=t[19];let T;t[20]!==e?(T=e("common.accountPopover.privacyPolicy"),t[20]=e,t[21]=T):T=t[21];let M;t[22]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(pn,{size:16}),t[22]=M):M=t[22];let z;t[23]!==T?(z={key:"privacy",label:T,icon:M,href:"https://www.decocms.com/privacy-policy",external:!0},t[23]=T,t[24]=z):z=t[24];let $;t[25]!==e?($=e("common.accountPopover.githubRepo"),t[25]=e,t[26]=$):$=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(js,{className:"w-4 h-4"}),t[27]=A):A=t[27];let R;t[28]!==$?(R={key:"github",label:$,icon:A,href:"https://github.com/decocms/studio",external:!0},t[28]=$,t[29]=R):R=t[29];let E;t[30]!==e?(E=e("common.accountPopover.community"),t[30]=e,t[31]=E):E=t[31];let O;t[32]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(hn,{size:16}),t[32]=O):O=t[32];let D;t[33]!==E?(D={key:"community",label:E,icon:O,href:"https://decocms.com/discord",external:!0},t[33]=E,t[34]=D):D=t[34];let F;t[35]!==e?(F=e("common.accountPopover.homepage"),t[35]=e,t[36]=F):F=t[36];let K;t[37]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(dn,{size:16}),t[37]=K):K=t[37];let Z;t[38]!==F?(Z={key:"homepage",label:F,icon:K,href:"https://decocms.com",external:!0},t[38]=F,t[39]=Z):Z=t[39];let ne;t[40]!==u||t[41]!==l||t[42]!==e?(ne=u?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(Lt,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-warning"}]:[],t[40]=u,t[41]=l,t[42]=e,t[43]=ne):ne=t[43];let de;t[44]!==z||t[45]!==R||t[46]!==D||t[47]!==Z||t[48]!==ne||t[49]!==C||t[50]!==N||t[51]!==k?(de=[C,...N,k,z,R,D,Z,...ne],t[44]=z,t[45]=R,t[46]=D,t[47]=Z,t[48]=ne,t[49]=C,t[50]=N,t[51]=k,t[52]=de):de=t[52];const le=de;let ee;t[53]!==e?(ee=e("common.accountPopover.signOut"),t[53]=e,t[54]=ee):ee=t[54];let oe;t[55]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ct,{size:16}),t[55]=oe):oe=t[55];let me;t[56]!==ee?(me={key:"logout",label:ee,icon:oe,onClick:xl},t[56]=ee,t[57]=me):me=t[57];const Se=me;let ue;t[58]!==h||t[59]!==e?(ue=h?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(ct,{size:16}),onClick:async()=>{const{error:ot}=await $e.admin.stopImpersonating();if(ot){ce.error(ot.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[58]=h,t[59]=e,t[60]=ue):ue=t[60];const fe=ue;let pe;t[61]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(un,{size:14}),t[61]=pe):pe=t[61];let ie;t[62]!==e?(ie=e("common.accountPopover.lightTheme"),t[62]=e,t[63]=ie):ie=t[63];let X;t[64]!==ie?(X={value:"light",icon:pe,label:ie},t[64]=ie,t[65]=X):X=t[65];let he;t[66]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(fn,{size:14}),t[66]=he):he=t[66];let te;t[67]!==e?(te=e("common.accountPopover.darkTheme"),t[67]=e,t[68]=te):te=t[68];let P;t[69]!==te?(P={value:"dark",icon:he,label:te},t[69]=te,t[70]=P):P=t[70];let L;t[71]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(We,{size:14}),t[71]=L):L=t[71];let W;t[72]!==e?(W=e("common.accountPopover.systemTheme"),t[72]=e,t[73]=W):W=t[73];let U;t[74]!==W?(U={value:"system",icon:L,label:W},t[74]=W,t[75]=U):U=t[75];let re;t[76]!==X||t[77]!==P||t[78]!==U?(re=[X,P,U],t[76]=X,t[77]=P,t[78]=U,t[79]=re):re=t[79];const De=re;let we;t[80]!==h||t[81]!==m||t[82]!==le||t[83]!==d||t[84]!==c||t[85]!==Se||t[86]!==fe||t[87]!==De||t[88]!==f||t[89]!==g?(we={user:f,userImage:g,menuItems:le,signOutItem:Se,stopImpersonatingItem:fe,isImpersonating:h,themeOptions:De,preferences:d,setPreferences:c,close:v,isMobile:m},t[80]=h,t[81]=m,t[82]=le,t[83]=d,t[84]=c,t[85]=Se,t[86]=fe,t[87]=De,t[88]=f,t[89]=g,t[90]=we):we=t[90];const Me=we;let Ie;return t[91]!==h||t[92]!==m||t[93]!==p||t[94]!==Me||t[95]!==e||t[96]!==f?.name||t[97]!==g?(Ie=s.jsx(s.Fragment,{children:m?s.jsxs(on,{open:p,onOpenChange:x,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>x(!0),className:B("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",h&&"border-2 border-dashed border-warning"),children:[s.jsx(Be,{url:g,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(rn,{className:"h-[80dvh] p-0",children:[s.jsx(an,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx(ht,{...Me})]})]}):s.jsxs(Bt,{open:p,onOpenChange:x,children:[s.jsx(Ut,{asChild:!0,children:s.jsxs(Y,{tooltip:f?.name??e("common.accountPopover.defaultAccountLabel"),className:B("rounded-md",h&&"border-2 border-dashed border-warning"),children:[s.jsx(Be,{url:g,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(Wt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:hl,children:s.jsx(ht,{...Me})})]})}),t[91]=h,t[92]=m,t[93]=p,t[94]=Me,t[95]=e,t[96]=f?.name,t[97]=g,t[98]=Ie):Ie=t[98],Ie}function hl(t){return t.preventDefault()}function xl(){V("signed_out",{source:"account_popover"}),vs(),$e.signOut()}const gl=["Browse and edit your Library files","Run your agents","Enable and call any MCP tool in this org"],bl="Connect: ";function jl(){return typeof window>"u"?"unknown host":window.location.hostname}function vl(t){const e=I.c(45),{onClose:n}=t,{org:o}=Q();let l;e[0]!==o.slug?(l=bn(o.slug),e[0]=o.slug,e[1]=l):l=e[1];const i=l,r=jn(),[a,d]=G.useState(null),c=dt(),m=dt();let u;e[2]!==r||e[3]!==o.slug?(u=()=>{r.mutate({name:`${bl}Claude Code on ${jl()}`,permissions:{"*":["*"]}},{onSuccess:R=>{const E=vn(o.slug,R.key);d(E),V("connect_studio_generate",{target:"claude-code"}),navigator.clipboard?.writeText(E).then(Nl,Sl)},onError:_l})},e[2]=r,e[3]=o.slug,e[4]=u):u=e[4];const p=u;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("span",{className:"size-8 rounded-lg bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(qt,{size:17})}),e[5]=x):x=e[5];let f;e[6]!==o.name?(f=s.jsxs(Ze,{className:"flex items-center gap-2.5",children:[x,"Connect ",o.name," to Claude"]}),e[6]=o.name,e[7]=f):f=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(zt,{children:"Hand Claude this org's MCP endpoint. Once linked, Claude can:"}),e[8]=g):g=e[8];let h;e[9]!==f?(h=s.jsxs(Ot,{children:[f,g]}),e[9]=f,e[10]=h):h=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("ul",{className:"flex flex-col gap-2 text-sm",children:gl.map(yl)}),e[11]=b):b=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(at,{size:15,className:"text-muted-foreground"}),e[12]=v):v=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[v,"Claude Code",s.jsx("span",{className:"ml-auto text-[11px] font-medium text-special uppercase tracking-wide",children:"Recommended"})]}),e[13]=y):y=e[13];let j;e[14]!==a||e[15]!==c||e[16]!==r.isPending||e[17]!==p?(j=s.jsxs("section",{className:"rounded-xl border border-border bg-muted/30 p-4 flex flex-col gap-3",children:[y,a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-lg border border-border bg-background p-3 max-h-32 overflow-y-auto",children:s.jsx("code",{className:"text-xs leading-relaxed break-all font-mono text-foreground/90 whitespace-pre-wrap",children:a})}),s.jsxs(be,{size:"sm",className:"gap-1.5 self-start",onClick:()=>{c.handleCopy(a),V("connect_studio_copy",{target:"claude-code"}),ce.success("Command copied — paste it in your terminal")},children:[c.copied?s.jsx(Ke,{size:14}):s.jsx(Ue,{size:14}),c.copied?"Copied":"Copy command"]}),s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2",children:[s.jsx(Lt,{size:14,className:"text-warning shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-xs leading-relaxed text-foreground/80",children:["No login step — this command embeds a"," ",s.jsx("span",{className:"font-medium text-foreground",children:"full-access token"}),". Treat it like a password; revoke it any time in Settings → Connect."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"One command, no browser login. We'll mint a scoped access token and embed it so Claude Code connects instantly."}),s.jsxs(be,{size:"sm",className:"gap-1.5 self-start",disabled:r.isPending,onClick:p,children:[s.jsx(at,{size:14}),r.isPending?"Generating…":"Generate connect command"]})]})]}),e[14]=a,e[15]=c,e[16]=r.isPending,e[17]=p,e[18]=j):j=e[18];let _,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(Vs,{size:15,className:"text-muted-foreground"}),"Claude Desktop or claude.ai"]}),C=s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Add a custom connector in Settings → Connectors and paste this URL. Claude signs in with OAuth on first use."}),e[19]=_,e[20]=C):(_=e[19],C=e[20]);let N;e[21]!==i?(N=s.jsx("code",{className:"text-xs flex-1 min-w-0 truncate font-mono text-foreground/90",children:i}),e[21]=i,e[22]=N):N=e[22];let S;e[23]!==i||e[24]!==m?(S=()=>{m.handleCopy(i),V("connect_studio_copy",{target:"claude-connector"})},e[23]=i,e[24]=m,e[25]=S):S=e[25];let w;e[26]!==m.copied?(w=m.copied?s.jsx(Ke,{size:14}):s.jsx(Ue,{size:14}),e[26]=m.copied,e[27]=w):w=e[27];let k;e[28]!==S||e[29]!==w?(k=s.jsx(be,{variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"Copy URL",onClick:S,children:w}),e[28]=S,e[29]=w,e[30]=k):k=e[30];let T;e[31]!==N||e[32]!==k?(T=s.jsxs("section",{className:"flex flex-col gap-2.5",children:[_,C,s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 pl-3 pr-1.5 py-1.5 min-w-0",children:[N,k]})]}),e[31]=N,e[32]=k,e[33]=T):T=e[33];let M;e[34]!==o.slug?(M={org:o.slug},e[34]=o.slug,e[35]=M):M=e[35];let z;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(tt,{size:12}),e[36]=z):z=e[36];let $;e[37]!==n||e[38]!==M?($=s.jsx("div",{className:"flex items-center border-t border-border pt-3",children:s.jsx(be,{asChild:!0,variant:"link",size:"sm",className:"px-0 text-xs gap-1",children:s.jsxs(ys,{to:"/$org/settings/connect",params:M,onClick:n,children:["More clients & API keys ",z]})})}),e[37]=n,e[38]=M,e[39]=$):$=e[39];let A;return e[40]!==j||e[41]!==T||e[42]!==$||e[43]!==h?(A=s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[h,b,j,T,$]}),e[40]=j,e[41]=T,e[42]=$,e[43]=h,e[44]=A):A=e[44],A}function yl(t){return s.jsxs("li",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"size-4 rounded-full bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(Ke,{size:11,strokeWidth:3})}),s.jsx("span",{className:"text-foreground",children:t})]},t)}function _l(t){return ce.error(t.message)}function Sl(){return ce.success("Command ready — copy it below")}function Nl(){return ce.success("Command copied — paste it in your terminal")}function Cl(t){const e=I.c(6),{open:n,onOpenChange:o}=t;let l;e[0]!==o?(l=s.jsx(At,{className:"max-w-lg gap-4",children:s.jsx(vl,{onClose:()=>o(!1)})}),e[0]=o,e[1]=l):l=e[1];let i;return e[2]!==o||e[3]!==n||e[4]!==l?(i=s.jsx(et,{open:n,onOpenChange:o,children:l}),e[2]=o,e[3]=n,e[4]=l,e[5]=i):i=e[5],i}function Ve(t){const e=I.c(50),{variant:n}=t===void 0?{}:t,o=n===void 0?"icon":n,l=H(),i=yn(),[r,a]=G.useState(!1);let d,c;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online||e[4]!==l){const j=Sn(i.capabilities,l);let _;e[7]!==i.online||e[8]!==l?(_=i.online?l("header.linkedDesktopIndicator.desktopLinked"):l("header.linkedDesktopIndicator.connectDesktop"),e[7]=i.online,e[8]=l,e[9]=_):_=e[9],d=_,c=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??l("header.linkedDesktopIndicator.desktopLinked")}),s.jsx("span",{className:"text-muted-foreground",children:j.length>0?l("header.linkedDesktopIndicator.availableCapabilities",{capabilities:j.join(", ")}):l("header.linkedDesktopIndicator.noCliAgents")})]}):s.jsx("span",{className:"text-xs",children:l("header.linkedDesktopIndicator.desktopDisconnected")}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=l,e[5]=d,e[6]=c}else d=e[5],c=e[6];const m=c;if(o==="full"){let j,_;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=()=>a(!0),_=s.jsx(We,{}),e[10]=j,e[11]=_):(j=e[10],_=e[11]);let C;e[12]!==d?(C=s.jsx("span",{children:d}),e[12]=d,e[13]=C):C=e[13];let N;e[14]!==i.online?(N=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[14]=i.online,e[15]=N):N=e[15];let S;e[16]!==d||e[17]!==C||e[18]!==N?(S=s.jsx(je,{asChild:!0,children:s.jsxs(Y,{tooltip:d,onClick:j,children:[_,C,N]})}),e[16]=d,e[17]=C,e[18]=N,e[19]=S):S=e[19];let w;e[20]!==m?(w=s.jsx(ve,{side:"right",children:m}),e[20]=m,e[21]=w):w=e[21];let k;e[22]!==S||e[23]!==w?(k=s.jsxs(ye,{children:[S,w]}),e[22]=S,e[23]=w,e[24]=k):k=e[24];let T;e[25]!==r?(T=s.jsx(mt,{open:r,onOpenChange:a}),e[25]=r,e[26]=T):T=e[26];let M;return e[27]!==T||e[28]!==k?(M=s.jsxs(s.Fragment,{children:[k,T]}),e[27]=T,e[28]=k,e[29]=M):M=e[29],M}let u;e[30]===Symbol.for("react.memo_cache_sentinel")?(u=()=>a(!0),e[30]=u):u=e[30];let p;e[31]!==i.online||e[32]!==l?(p=i.online?l("header.linkedDesktopIndicator.desktopLinked"):l("header.linkedDesktopIndicator.connectYourDesktop"),e[31]=i.online,e[32]=l,e[33]=p):p=e[33];let x;e[34]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(We,{size:16}),e[34]=x):x=e[34];let f;e[35]!==i.online?(f=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[35]=i.online,e[36]=f):f=e[36];let g;e[37]!==p||e[38]!==f?(g=s.jsx(je,{asChild:!0,children:s.jsxs(ke,{onClick:u,"aria-label":p,children:[x,f]})}),e[37]=p,e[38]=f,e[39]=g):g=e[39];let h;e[40]!==m?(h=s.jsx(ve,{side:"bottom",children:m}),e[40]=m,e[41]=h):h=e[41];let b;e[42]!==g||e[43]!==h?(b=s.jsxs(ye,{children:[g,h]}),e[42]=g,e[43]=h,e[44]=b):b=e[44];let v;e[45]!==r?(v=s.jsx(mt,{open:r,onOpenChange:a}),e[45]=r,e[46]=v):v=e[46];let y;return e[47]!==v||e[48]!==b?(y=s.jsxs(s.Fragment,{children:[b,v]}),e[47]=v,e[48]=b,e[49]=y):y=e[49],y}class kl extends G.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 wl(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Ml(){const t=I.c(17),e=ae(),{org:n}=Q(),{hasDecoKey:o,balanceDollars:l}=en();if(!o)return null;let i;t[0]!==l?(i=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=i):i=t[1];let r;t[2]!==l?(r=B(l!=null&&wl(l)),t[2]=l,t[3]=r):r=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ys,{}),t[7]=d):d=t[7];let c;t[8]!==l?(c=l!=null?`$${l.toFixed(2)}`:"Credits",t[8]=l,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]!==r||t[14]!==a||t[15]!==m?(u=s.jsx(J,{children:s.jsx(q,{children:s.jsxs(Y,{tooltip:i,className:r,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=r,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function xt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(kl,{children:s.jsx(G.Suspense,{fallback:null,children:s.jsx(Ml,{})})}),t[0]=e):e=t[0],e}function Il(){const t=I.c(14),e=H(),n=ae(),{org:o}=Q();let l;t[0]!==e?(l=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==o.slug?(i=()=>n({to:"/$org/settings",params:{org:o.slug}}),t[2]=n,t[3]=o.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Oe,{}),t[5]=r):r=t[5];let a;t[6]!==e?(a=e("sidebar.sidebarFooter.settings"),t[6]=e,t[7]=a):a=t[7];let d;t[8]!==a?(d=s.jsx("span",{children:a}),t[8]=a,t[9]=d):d=t[9];let c;return t[10]!==l||t[11]!==i||t[12]!==d?(c=s.jsxs(Y,{tooltip:l,onClick:i,children:[r,d]}),t[10]=l,t[11]=i,t[12]=d,t[13]=c):c=t[13],c}function Tl(){const t=I.c(9),e=H(),n=ae(),{org:o}=Q();let l;t[0]!==e?(l=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==o.slug?(i=()=>n({to:"/$org/settings",params:{org:o.slug}}),t[2]=n,t[3]=o.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Oe,{size:15}),t[5]=r):r=t[5];let a;return t[6]!==l||t[7]!==i?(a=s.jsx("button",{type:"button","aria-label":l,onClick:i,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:r}),t[6]=l,t[7]=i,t[8]=a):a=t[8],a}function gt(){const t=I.c(33),e=H(),[n,o]=G.useState(!1),[l,i]=G.useState(!1);let r;t[0]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=r):r=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Gt,{}),t[2]=a):a=t[2];let d;t[3]!==e?(d=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=d):d=t[4];let c;t[5]!==d?(c=s.jsx("span",{children:d}),t[5]=d,t[6]=c):c=t[6];let m;t[7]!==r||t[8]!==c?(m=s.jsx(q,{children:s.jsx(Vt,{trigger:s.jsxs(Y,{tooltip:r,children:[a,c]})})}),t[7]=r,t[8]=c,t[9]=m):m=t[9];let u;t[10]!==e?(u=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=u):u=t[11];let p,x;t[12]===Symbol.for("react.memo_cache_sentinel")?(p=()=>o(!0),x=s.jsx(gn,{}),t[12]=p,t[13]=x):(p=t[12],x=t[13]);let f;t[14]!==e?(f=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=f):f=t[15];let g;t[16]!==f?(g=s.jsx("span",{children:f}),t[16]=f,t[17]=g):g=t[17];let h;t[18]!==u||t[19]!==g?(h=s.jsx(q,{children:s.jsxs(Y,{tooltip:u,onClick:p,children:[x,g]})}),t[18]=u,t[19]=g,t[20]=h):h=t[20];let b;t[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(q,{children:s.jsxs(Y,{tooltip:"Connect to Claude",onClick:()=>{V("connect_studio_opened",{source:"sidebar_footer"}),i(!0)},children:[s.jsx(qt,{}),s.jsx("span",{children:"Connect to Claude"})]})}),t[21]=b):b=t[21];let v;t[22]!==h||t[23]!==m?(v=s.jsxs(J,{className:"gap-0.5",children:[m,h,b]}),t[22]=h,t[23]=m,t[24]=v):v=t[24];let y;t[25]!==n?(y=s.jsx(tn,{open:n,onOpenChange:o,mode:"browse"}),t[25]=n,t[26]=y):y=t[26];let j;t[27]!==l?(j=s.jsx(Cl,{open:l,onOpenChange:i}),t[27]=l,t[28]=j):j=t[28];let _;return t[29]!==v||t[30]!==y||t[31]!==j?(_=s.jsxs(s.Fragment,{children:[v,y,j]}),t[29]=v,t[30]=y,t[31]=j,t[32]=_):_=t[32],_}function bt(){const t=I.c(10),e=H();let n;t[0]!==e?(n=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=n):n=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Gt,{}),t[2]=o):o=t[2];let l;t[3]!==e?(l=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=l):l=t[4];let i;t[5]!==l?(i=s.jsx("span",{children:l}),t[5]=l,t[6]=i):i=t[6];let r;return t[7]!==n||t[8]!==i?(r=s.jsx(J,{className:"gap-0.5",children:s.jsx(q,{children:s.jsx(Vt,{trigger:s.jsxs(Y,{tooltip:n,children:[o,i]})})})}),t[7]=n,t[8]=i,t[9]=r):r=t[9],r}function Pl(){const t=I.c(19),{state:e}=_e(),n=e==="collapsed",o=nt(),l=!o;if(n){let m;t[0]!==o?(m=o?s.jsx(bt,{}):s.jsx(gt,{}),t[0]=o,t[1]=m):m=t[1];let u;t[2]!==l?(u=l&&s.jsx(xt,{}),t[2]=l,t[3]=u):u=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(q,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Ve,{})})}),t[4]=p):p=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(q,{children:s.jsx(Il,{})}),t[5]=x):x=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(J,{children:[p,x,s.jsx(q,{children:s.jsx(qe,{})})]}),t[6]=f):f=t[6];let g;return t[7]!==m||t[8]!==u?(g=s.jsxs(Ge,{className:"px-2 pb-3 gap-1",children:[m,u,f]}),t[7]=m,t[8]=u,t[9]=g):g=t[9],g}let i;t[10]!==o?(i=o?s.jsx(bt,{}):s.jsx(gt,{}),t[10]=o,t[11]=i):i=t[11];let r;t[12]!==l?(r=l&&s.jsx(xt,{}),t[12]=l,t[13]=r):r=t[13];let a;t[14]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{children:s.jsx(Ve,{variant:"full"})}),t[14]=a):a=t[14];let d;t[15]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(J,{className:"gap-0.5",children:[a,s.jsx(q,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(qe,{})}),s.jsx(Tl,{})]})})]}),t[15]=d):d=t[15];let c;return t[16]!==i||t[17]!==r?(c=s.jsxs(Ge,{className:"px-2 pb-3 gap-0.5",children:[i,r,d]}),t[16]=i,t[17]=r,t[18]=c):c=t[18],c}function $l(){const t=I.c(11),e=H(),n=ae(),{org:o}=Q(),{setOpenMobile:l}=_e();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(J,{children:s.jsx(q,{children:s.jsx(qe,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e?(r=e("sidebar.sidebarFooterMobile.settings"),t[1]=e,t[2]=r):r=t[2];let a;t[3]!==n||t[4]!==o.slug||t[5]!==l?(a=()=>{n({to:"/$org/settings",params:{org:o.slug}}),l(!1)},t[3]=n,t[4]=o.slug,t[5]=l,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Oe,{className:"size-4"}),t[7]=d):d=t[7];let c;return t[8]!==r||t[9]!==a?(c=s.jsx(Ge,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ke,{"aria-label":r,onClick:a,children:d})]})}),t[8]=r,t[9]=a,t[10]=c):c=t[10],c}function jt(t){const e=I.c(15),{className:n,wrapperClassName:o,children:l}=t,[i,r]=G.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&r(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 v=b.currentTarget;r(v.scrollHeight-v.scrollTop>v.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==o?(u=B("relative",o),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==l||e[5]!==n?(p=s.jsx("div",{ref:d,onScroll:m,className:n,children:l}),e[4]=l,e[5]=n,e[6]=p):p=e[6];const x=i?"opacity-100":"opacity-0";let f;e[7]!==x?(f=B("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]=f):f=e[8];let g;e[9]!==f?(g=s.jsx("div",{"aria-hidden":!0,className:f}),e[9]=f,e[10]=g):g=e[10];let h;return e[11]!==u||e[12]!==p||e[13]!==g?(h=s.jsxs("div",{className:u,children:[p,g]}),e[11]=u,e[12]=p,e[13]=g,e[14]=h):h=e[14],h}function Al(t){const e=I.c(9),{virtualMcpId:n,size:o,showAutomationBadge:l}=t,i=o===void 0?"sm":o,r=H();let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(zl,{virtualMcpId:n,size:i}):s.jsx(Ce,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let d;e[3]!==l||e[4]!==r?(d=l&&s.jsx("span",{"aria-label":r("tasksPanel.mcpAvatar.automationTriggered"),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(Zt,{size:10,className:"text-white"})}),e[3]=l,e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==a||e[7]!==d?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,d]}),e[6]=a,e[7]=d,e[8]=c):c=e[8],c}function zl(t){const e=I.c(6),{virtualMcpId:n,size:o}=t,l=Yt(n);if(!l){let a;return e[0]!==o?(a=s.jsx(Ce,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=l.icon??null;let r;return e[2]!==l.title||e[3]!==o||e[4]!==i?(r=s.jsx(Ce,{icon:i,name:l.title,size:o}),e[2]=l.title,e[3]=o,e[4]=i,e[5]=r):r=e[5],r}function vt(t){const e=I.c(53),{open:n,onOpenChange:o}=t,[l,i]=G.useState(""),{org:r}=Q(),{setTaskId:a}=Qt(),d=Jt(),c=H();let m,u,p;e[0]!==r.id||e[1]!==l?(p=l.trim(),u=_s,m=Mt.globalSearch(r.id,p),e[0]=r.id,e[1]=l,e[2]=m,e[3]=u,e[4]=p):(m=e[2],u=e[3],p=e[4]);const x=n&&p.length>0;let f;e[5]!==d||e[6]!==p?(f=async()=>await d.call("GLOBAL_SEARCH",{query:p,limit:20}),e[5]=d,e[6]=p,e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==x||e[10]!==f?(g={queryKey:m,enabled:x,queryFn:f,staleTime:1e4},e[8]=m,e[9]=x,e[10]=f,e[11]=g):g=e[11];const{data:h,isFetching:b}=u(g);let v;e[12]!==h?.items?(v=h?.items??[],e[12]=h?.items,e[13]=v):v=e[13];const y=v;let j;e[14]!==o?(j=F=>{F||i(""),o(F)},e[14]=o,e[15]=j):j=e[15];const _=j;let C;e[16]!==_||e[17]!==a?(C=F=>{_(!1),a(F.id,F.virtual_mcp_id??void 0)},e[16]=_,e[17]=a,e[18]=C):C=e[18];const N=C;let S;e[19]!==c?(S=c("tasksPanel.globalSearchDialog.title"),e[19]=c,e[20]=S):S=e[20];let w;e[21]!==S?(w=s.jsx(Ze,{children:S}),e[21]=S,e[22]=w):w=e[22];let k;e[23]!==c?(k=c("tasksPanel.globalSearchDialog.description"),e[23]=c,e[24]=k):k=e[24];let T;e[25]!==k?(T=s.jsx(zt,{children:k}),e[25]=k,e[26]=T):T=e[26];let M;e[27]!==w||e[28]!==T?(M=s.jsxs(Ot,{className:"sr-only",children:[w,T]}),e[27]=w,e[28]=T,e[29]=M):M=e[29];let z;e[30]!==c?(z=c("tasksPanel.globalSearchDialog.placeholder"),e[30]=c,e[31]=z):z=e[31];let $;e[32]!==l||e[33]!==z?($=s.jsx(zn,{value:l,onValueChange:i,placeholder:z}),e[32]=l,e[33]=z,e[34]=$):$=e[34];let A;e[35]!==N||e[36]!==b||e[37]!==y||e[38]!==c||e[39]!==p?(A=p?b&&y.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.searching")}):y.length===0?s.jsx($n,{children:c("tasksPanel.globalSearchDialog.noResults")}):y.map(F=>F.type==="thread"?s.jsxs(An,{value:`thread:${F.id}:${F.title}`,onSelect:()=>N(F),className:"gap-2.5",children:[s.jsx(Al,{virtualMcpId:F.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:F.title||c("tasksPanel.globalSearchDialog.untitledChat")})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(F.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${F.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.startTyping")}),e[35]=N,e[36]=b,e[37]=y,e[38]=c,e[39]=p,e[40]=A):A=e[40];let R;e[41]!==A?(R=s.jsx(On,{children:A}),e[41]=A,e[42]=R):R=e[42];let E;e[43]!==$||e[44]!==R?(E=s.jsxs(En,{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:[$,R]}),e[43]=$,e[44]=R,e[45]=E):E=e[45];let O;e[46]!==M||e[47]!==E?(O=s.jsxs(At,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[M,E]}),e[46]=M,e[47]=E,e[48]=O):O=e[48];let D;return e[49]!==_||e[50]!==n||e[51]!==O?(D=s.jsx(et,{open:n,onOpenChange:_,children:O}),e[49]=_,e[50]=n,e[51]=O,e[52]=D):D=e[52],D}function Ol(t){return t==="ephemeral"||t.startsWith("thread:")}function is(t){const e=I.c(45),{task:n,isActive:o,onClick:l,onArchive:i,showAutomationBadge:r,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=H(),u=Fn(n.status),p=u.icon,x=n.metadata?.kind==="tool_call_run",f=Yt(x?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=sn(f),e[0]=f,e[1]=g):g=e[1];const h=g;Ln(6e4);const b=r||!!n.trigger_id,v=n.id,y="button",j=0;let _;e[2]!==l?(_=K=>{K.target===K.currentTarget&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),l())},e[2]=l,e[3]=_):_=e[3];const C=c?"-ml-4 pl-6":"pl-[7px]",N=o?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==C||e[5]!==N?(S=B("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=S):S=e[6];let w;e[7]!==x||e[8]!==a||e[9]!==f?.icon||e[10]!==f?.title?(w=a&&!x&&s.jsx(Ce,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[7]=x,e[8]=a,e[9]=f?.icon,e[10]=f?.title,e[11]=w):w=e[11];let k;e[12]!==b||e[13]!==m?(k=b&&s.jsx(Zt,{size:12,"aria-label":m("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=b,e[13]=m,e[14]=k):k=e[14];let T;e[15]!==m||e[16]!==n.title?(T=n.title||m("tasksPanel.taskRow.untitledTask"),e[15]=m,e[16]=n.title,e[17]=T):T=e[17];let M;e[18]!==T?(M=s.jsx("div",{className:"text-sm text-foreground truncate",children:T}),e[18]=T,e[19]=M):M=e[19];let z;e[20]!==k||e[21]!==M?(z=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[k,M]}),e[20]=k,e[21]=M,e[22]=z):z=e[22];let $;e[23]!==h||e[24]!==o||e[25]!==n.branch||e[26]!==n.updated_at?($=n.updated_at&&s.jsxs("div",{className:B("flex items-center gap-1 text-[11px] min-w-0",o?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ol(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):h?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[h.owner,"/",h.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Hn(new Date(n.updated_at))})]}),e[23]=h,e[24]=o,e[25]=n.branch,e[26]=n.updated_at,e[27]=$):$=e[27];let A;e[28]!==z||e[29]!==$?(A=s.jsxs("div",{className:"flex-1 min-w-0",children:[z,$]}),e[28]=z,e[29]=$,e[30]=A):A=e[30];const R="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",E=!d&&s.jsx("span",{className:B("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",i&&"group-hover/row:opacity-0"),"aria-label":m("tasksPanel.taskRow.statusLabel",{status:u.label}),children:s.jsx(p,{size:14,className:B(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let O;e[31]!==i||e[32]!==m?(O=i&&s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":m("tasksPanel.taskRow.archiveTask"),onClick:K=>{K.stopPropagation(),i()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ss,{size:14})})}),s.jsx(ve,{side:"right",children:m("tasksPanel.taskRow.archive")})]}),e[31]=i,e[32]=m,e[33]=O):O=e[33];let D;e[34]!==E||e[35]!==O?(D=s.jsxs("div",{className:R,children:[E,O]}),e[34]=E,e[35]=O,e[36]=D):D=e[36];let F;return e[37]!==l||e[38]!==A||e[39]!==D||e[40]!==_||e[41]!==S||e[42]!==w||e[43]!==n.id?(F=s.jsxs("div",{"data-task-id":v,role:y,tabIndex:j,onClick:l,onKeyDown:_,className:S,children:[w,A,D]}),e[37]=l,e[38]=A,e[39]=D,e[40]=_,e[41]=S,e[42]=w,e[43]=n.id,e[44]=F):F=e[44],F}const yt=["requires_action","in_progress","failed","expired","completed"];function El(t){const e=new Map(yt.map(n=>[n,[]]));for(const n of t){const o=n.status??"completed";(e.get(o)??e.get("completed")).push(n)}return yt.map(n=>({status:n,threads:e.get(n)}))}const Dl="sidebar.group.expanded.";function Rl(t,e){const n=I.c(3),[o,l]=ze(`${Dl}${t}`,e);let i;return n[0]!==o||n[1]!==l?(i=[o,l],n[0]=o,n[1]=l,n[2]=i):i=n[2],i}function rs(t){const e=I.c(18),{onClick:n,isFetching:o,indented:l}=t,i=H();let r;e[0]!==i?(r=i("sidebar.showMoreButton.ariaLabel"),e[0]=i,e[1]=r):r=e[1];const a=l?"-ml-4 pl-6 pr-2":"px-2";let d;e[2]!==a?(d=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",a,"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[2]=a,e[3]=d):d=e[3];let c;e[4]!==o?(c=o&&s.jsx(Ns,{size:14,className:"animate-spin"}),e[4]=o,e[5]=c):c=e[5];let m;e[6]!==o||e[7]!==i?(m=i(o?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=o,e[7]=i,e[8]=m):m=e[8];let u;e[9]!==m?(u=s.jsx("span",{children:m}),e[9]=m,e[10]=u):u=e[10];let p;return e[11]!==o||e[12]!==n||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==u?(p=s.jsxs("button",{type:"button","aria-label":r,onClick:n,disabled:o,className:d,children:[c,u]}),e[11]=o,e[12]=n,e[13]=r,e[14]=d,e[15]=c,e[16]=u,e[17]=p):p=e[17],p}function Fl(t,e,n,o){return[t,e,n,o.type,o.member,o.currentUserId??""].join("|")}function Ll(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Pe=0;const Ye=[];function Gl(){for(;Pe<as&&Ye.length>0;){const t=Ye.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const o=()=>{Pe++,t().then(e,n).finally(()=>{Pe--,Gl()})};Pe<as?o():Ye.push(o)})}const Ee=10;function _t(t,e,n,o,l){const i={hidden:!1};o.member==="mine"&&o.currentUserId&&(i.created_by=o.currentUserId),o.type==="automation"&&(i.has_trigger=!0),o.type==="manual"&&(i.has_trigger=!1);const r={where:i,limit:l,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return r.status=e,r}function Hl(t,e,n,o){let l=0;for(const i of t)ds(i,e,n,o)&&l++;return l}function Fe(t,e,n,o){return Hl(t,e,n,o)}function Bl(t,e){return!!(t>=Ee||t===0&&e)}function St(t,e){return t<e}function Ul(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,o){return!(t.hidden||(t.status??"completed")!==n||o.member==="mine"&&o.currentUserId&&t.created_by!==o.currentUserId||o.type==="automation"&&!t.trigger_id||o.type==="manual"&&t.trigger_id)}const Ae=new Map,Te=new Map;function Wl(t,e){return e?t>=Ee?!0:null:!1}function Nt(t){return Ae.get(t)}function Kl(t,e){Ae.set(t,e)}function ql(t,e,n){const o=Ae.get(t);if(o!==void 0){n(o);return}let l=Te.get(t);l||(l=cs(e).then(i=>(Ae.set(t,i),Te.delete(t),i)).catch(()=>(Te.delete(t),Promise.reject(new Error("group probe failed")))),Te.set(t,l)),l.then(n,()=>n(!1))}function Ct(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ee,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Vl(t,e,n,o,l){let i=0;for(const r of t)e.has(r.id)||ds(r,n,o,l)&&i++;return i}function Yl(t,e,n,o){const l=I.c(8),{org:i}=Q(),r=Fl(i.id,t,e,n);let a;l[0]!==n?(a=Ll(n),l[0]=n,l[1]=a):a=l[1];const d=a,[c,m]=G.useState({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==r&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});const u=Mn(),{threads:p,hasMore:x}=Xt(),f=Fe(p,t,e,n),g=Bl(f,x),h=Wl(f,x),b=Jt();if(c.identity===r&&c.serverHasMore===null){const N=h??Nt(r);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===r&&c.serverHasMore===null&&h===null&&Nt(r)===void 0&&c.probeSubscribedIdentity!==r&&(m(N=>N.identity===r?{...N,isProbing:!0,probeSubscribedIdentity:r}:N),ql(r,async()=>{const N=_t(t,e,0,n,1),S=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:w}=Ct(S),k=Fe(u.threads.get(),t,e,n);return w===void 0?!1:St(k,w)},N=>{m(S=>S.identity!==r?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=r;m(w=>w.identity===S?{...w,isFetching:!0}:w);try{const w=Fe(p,t,e,n),k=_t(t,e,w,n,Ee),T=await cs(()=>b.call("COLLECTION_THREADS_LIST",k)),{items:M,hasMore:z,totalCount:$}=Ct(T),A=new Set(p.map(Xl)),R=Vl(M,A,t,e,n),E=w;u.mergeThreads(M),m(O=>{if(O.identity!==S)return O;let D;return $!==void 0?D=St(E+R,$):D=M.length===0||R===0?!1:z,Kl(S,D),{...O,isFetching:!1,serverHasMore:D}})}catch(w){const k=w,T=k instanceof Error?k.message:String(k);ce.error(`Could not load more tasks: ${T}`),m(M=>M.identity===S?{...M,isFetching:!1}:M)}},j=c.isFetching||c.isProbing,_=!d&&!j&&Ul(g,c.serverHasMore);let C;return l[2]!==j||l[3]!==y||l[4]!==_||l[5]!==c.isProbing||l[6]!==c.serverHasMore?(C={hasMore:_,isFetching:j,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},l[2]=j,l[3]=y,l[4]=_,l[5]=c.isProbing,l[6]=c.serverHasMore,l[7]=C):C=l[7],C}function Xl(t){return t.id}function Ql(t){const e=I.c(20),{status:n,threads:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:p,serverHasMore:x}=Yl("status",n,d),[f,g]=G.useState(!1);!f&&o.length===0&&x===!0&&!c&&!m&&(g(!0),queueMicrotask(()=>{u()}));let h;if(e[0]!==l||e[1]!==a||e[2]!==d||e[3]!==r||e[4]!==i||e[5]!==o){let y;e[7]!==l||e[8]!==a||e[9]!==d||e[10]!==r||e[11]!==i?(y=j=>s.jsx(is,{task:j,isActive:l===j.id,onClick:()=>i(j),onArchive:a&&j.created_by===d.currentUserId?()=>r(j):void 0,showAutomationBadge:!!j.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},j.id),e[7]=l,e[8]=a,e[9]=d,e[10]=r,e[11]=i,e[12]=y):y=e[12],h=o.map(y),e[0]=l,e[1]=a,e[2]=d,e[3]=r,e[4]=i,e[5]=o,e[6]=h}else h=e[6];let b;e[13]!==p||e[14]!==c||e[15]!==u?(b=(p||c)&&s.jsx(rs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=p,e[14]=c,e[15]=u,e[16]=b):b=e[16];let v;return e[17]!==h||e[18]!==b?(v=s.jsxs(s.Fragment,{children:[h,b]}),e[17]=h,e[18]=b,e[19]=v):v=e[19],v}function Jl(t){const e=I.c(36),{status:n,threads:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,c=Gn[n],m=c.icon,[u,p]=Rl(`status-${n}`,!1);let x;e[0]!==u||e[1]!==p?(x=function(){p(!u)},e[0]=u,e[1]=p,e[2]=x):x=e[2];const f=x;let g;e[3]!==f?(g=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),f())},e[3]=f,e[4]=g):g=e[4];let h;e[5]!==m||e[6]!==c.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=h):h=e[7];let b;e[8]!==u?(b=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Bn,{size:14}):s.jsx(Ft,{size:14})}),e[8]=u,e[9]=b):b=e[9];let v;e[10]!==h||e[11]!==b?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,b]}),e[10]=h,e[11]=b,e[12]=v):v=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let j;e[15]!==o.length?(j=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:o.length})}),e[15]=o.length,e[16]=j):j=e[16];let _;e[17]!==u||e[18]!==f||e[19]!==g||e[20]!==v||e[21]!==y||e[22]!==j?(_=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:f,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,y,j]}),e[17]=u,e[18]=f,e[19]=g,e[20]=v,e[21]=y,e[22]=j,e[23]=_):_=e[23];let C;e[24]!==l||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==r||e[29]!==i||e[30]!==n||e[31]!==o?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Ql,{status:n,threads:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d})}),e[24]=l,e[25]=a,e[26]=u,e[27]=d,e[28]=r,e[29]=i,e[30]=n,e[31]=o,e[32]=C):C=e[32];let N;return e[33]!==_||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,C]}),e[33]=_,e[34]=C,e[35]=N):N=e[35],N}function kt(t){const e=I.c(38),{threads:n,groupBy:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,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(Rn,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const b=u?"No chats match your filters":"No chats yet";let v;return e[1]!==b?(v=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:b})]}),e[1]=b,e[2]=v):v=e[2],v}const p=n.length>1||d;if(o==="status"){let h;if(e[3]!==l||e[4]!==p||e[5]!==a||e[6]!==r||e[7]!==i||e[8]!==n){let v;e[10]!==l||e[11]!==p||e[12]!==a||e[13]!==r||e[14]!==i?(v=y=>s.jsx(Jl,{status:y.status,threads:y.threads,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:p,filters:a},y.status),e[10]=l,e[11]=p,e[12]=a,e[13]=r,e[14]=i,e[15]=v):v=e[15],h=El(n).map(v),e[3]=l,e[4]=p,e[5]=a,e[6]=r,e[7]=i,e[8]=n,e[9]=h}else h=e[9];let b;return e[16]!==h?(b=s.jsx(s.Fragment,{children:h}),e[16]=h,e[17]=b):b=e[17],b}let x;if(e[18]!==l||e[19]!==p||e[20]!==a||e[21]!==r||e[22]!==i||e[23]!==n){let h;e[25]!==l||e[26]!==p||e[27]!==a||e[28]!==r||e[29]!==i?(h=b=>s.jsx(is,{task:b,isActive:l===b.id,onClick:()=>i(b),onArchive:p&&b.created_by===a.currentUserId?()=>r(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=l,e[26]=p,e[27]=a,e[28]=r,e[29]=i,e[30]=h):h=e[30],x=n.map(h),e[18]=l,e[19]=p,e[20]=a,e[21]=r,e[22]=i,e[23]=n,e[24]=x}else x=e[24];let f;e[31]!==d||e[32]!==c||e[33]!==m?(f=(d||c)&&s.jsx(rs,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=f):f=e[34];let g;return e[35]!==x||e[36]!==f?(g=s.jsxs(s.Fragment,{children:[x,f]}),e[35]=x,e[36]=f,e[37]=g):g=e[37],g}function Zl(t,e,n){if(!n)return;const o=t.findIndex(l=>l.id===e);if(o!==-1){for(let l=o+1;l<t.length;l++){const i=t[l];if(i?.created_by===n)return i}for(let l=o-1;l>=0;l--){const i=t[l];if(i?.created_by===n)return i}}}function wt(t){const e=I.c(17),{label:n,onClick:o,active:l,children:i}=t,[r,a]=G.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 p=l&&"bg-sidebar-accent text-foreground";let x;e[4]!==p?(x=B("md:size-[34px] rounded-lg",p),e[4]=p,e[5]=x):x=e[5];let f;e[6]!==i||e[7]!==n||e[8]!==o||e[9]!==x?(f=s.jsx(je,{asChild:!0,children:s.jsx(ke,{"aria-label":n,onClick:o,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:i})}),e[6]=i,e[7]=n,e[8]=o,e[9]=x,e[10]=f):f=e[10];let g;e[11]!==n?(g=s.jsx(ve,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let h;return e[13]!==r||e[14]!==f||e[15]!==g?(h=s.jsxs(ye,{open:r,children:[f,g]}),e[13]=r,e[14]=f,e[15]=g,e[16]=h):h=e[16],h}function Le(t){const e=I.c(13),{label:n,value:o,onChange:l,options:i}=t;let r;e[0]!==n?(r=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==l?(a=u=>u&&l(u),e[2]=l,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(eo),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==o?(c=s.jsx(kn,{type:"single",size:"sm",value:o,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]=o,e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r,c]}),e[10]=r,e[11]=c,e[12]=m):m=e[12],m}function eo(t){return s.jsxs(Cn,{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 ms({onNavigate:t}={}){const e=H(),{data:n}=$e.useSession(),o=n?.user?.id,{org:l}=Q(),i=Dt({connectionId:Rt,orgId:l.id,orgSlug:l.slug}),r=rt(l.id).id,a=wn(),{threads:d,hasMore:c,isFetchingMore:m,fetchNextPage:u}=Xt(),p=d.filter(P=>!P.hidden),{hide:x,setScope:f}=In(),g=ae(),{setTaskId:h,createNewTask:b}=Qt(),v=Cs({strict:!1}),y=It({strict:!1}),j=v.taskId??null,_=y.virtualmcpid??d.find(P=>P.id===j)?.virtual_mcp_id??null,C=()=>{t?.()},N=[...p].sort((P,L)=>(L.updated_at??"").localeCompare(P.updated_at??"")),[S,w]=G.useState("all"),[k,T]=G.useState("flat"),[M,z]=ze("sidebar-threads-scope-all",!1),[$,A]=G.useState(!1),[R,E]=G.useState(!1),O={type:S,member:"mine",currentUserId:o??null},D={};M||(D.created_by="me"),f(D);const F=P=>o?P.filter(L=>L.created_by===o):[],K=P=>S==="automation"?P.filter(L=>!!L.trigger_id):S==="manual"?P.filter(L=>!L.trigger_id):P,Z=F(N),ne=K(Z),de=K(N),le=M?de:ne,ee=P=>{if(o&&P.created_by&&P.created_by!==o)return;const L=P.id===j;if(x(P.id),Pn(P.id),!L)return;const W=Zl(le,P.id,o);C(),W?h(W.id,W.virtual_mcp_id):g({to:"/$org",params:{org:l.slug}})},oe=P=>{C(),h(P.id,P.virtual_mcp_id)},me=async P=>{try{const L=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P,limit:1,offset:0}});return((L.structuredContent??L).items?.length??0)===0}catch{return!1}},Se=async()=>{const P=_??r;V("sidebar_new_thread_clicked",{virtual_mcp_id:P});const L=Z.find(W=>W.virtual_mcp_id===P&&W.title==="New chat");if(L&&await me(L.id)){C(),h(L.id,P);return}C(),b(P)},{state:ue,isMobile:fe,toggleSidebar:pe}=_e();if(ue==="collapsed"&&!fe){const P=rt(l.id),L=new Map((a??[]).map(U=>[U.id,U])),W=U=>(U?L.get(U):void 0)??(U===r?P:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(nn,{orgParam:l.slug,side:"right",align:"start",trigger:s.jsx(Y,{tooltip:l.name,children:s.jsx(ln,{org:l,size:"sm"})})})}),s.jsxs(J,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(q,{children:s.jsx(Y,{"aria-label":e("sidebar.taskGroupsList.toggleSidebar"),tooltip:e("sidebar.taskGroupsList.toggleSidebar"),onClick:pe,children:s.jsx(Ht,{size:16})})}),le.map(U=>{const re=W(U.virtual_mcp_id);return s.jsx(q,{children:s.jsx(Y,{"aria-label":U.title||e("sidebar.taskGroupsList.newChat"),tooltip:U.title||e("sidebar.taskGroupsList.newChat"),isActive:U.id===j,onClick:()=>oe(U),children:s.jsx(Ce,{icon:re?.icon??null,name:re?.title??"Agent",size:"xs"})})},U.id)})]})]})}const X=k!=="flat"||S!=="all"||M===!0,he=s.jsxs(Bt,{children:[s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx(Ut,{asChild:!0,children:s.jsxs(ke,{"aria-label":e("sidebar.taskGroupsList.filterChats"),active:X,className:"md:size-[34px] rounded-lg",children:[s.jsx(Nn,{size:16}),X&&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:e("sidebar.taskGroupsList.filterChats")})]}),s.jsxs(Wt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Le,{label:e("sidebar.taskGroupsList.filterView"),value:k,onChange:P=>{V("tasks_panel_group_by_changed",{to_value:P}),T(P)},options:[{value:"flat",label:e("sidebar.taskGroupsList.viewList"),icon:s.jsx(Xs,{size:13})},{value:"status",label:e("sidebar.taskGroupsList.viewStatus"),icon:s.jsx(Qs,{size:13})}]}),s.jsx(Le,{label:e("sidebar.taskGroupsList.filterType"),value:S,onChange:P=>{V("tasks_panel_filter_changed",{to_value:P}),w(P)},options:[{value:"all",label:e("sidebar.taskGroupsList.typeAll")},{value:"manual",label:e("sidebar.taskGroupsList.typeChats")},{value:"automation",label:e("sidebar.taskGroupsList.typeAuto")}]}),s.jsx(Le,{label:e("sidebar.taskGroupsList.filterScope"),value:M?"team":"mine",onChange:P=>z(P==="team"),options:[{value:"mine",label:e("sidebar.taskGroupsList.scopeMine")},{value:"team",label:e("sidebar.taskGroupsList.scopeTeam")}]})]})]}),te=P=>s.jsx(Kt,{delayDuration:300,children:s.jsxs("div",{className:B("shrink-0 flex items-center justify-between",P?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!P&&s.jsx(es,{className:"md:size-[34px] rounded-lg"}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(wt,{label:e("sidebar.taskGroupsList.searchChats"),onClick:()=>{V("tasks_panel_search_opened"),E(!0),A(!0)},children:s.jsx(Js,{size:16})}),s.jsx(wt,{label:e("sidebar.taskGroupsList.newChat"),onClick:()=>{Se()},children:s.jsx(Zs,{size:16})})]})]})});return fe?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[te(!0),s.jsx(jt,{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(kt,{threads:le,groupBy:k,activeTaskId:j,onSelectTask:oe,onArchiveTask:ee,filters:O,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:X})}),R&&s.jsx(vt,{open:$,onOpenChange:A})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[te(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(jt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(kt,{threads:le,groupBy:k,activeTaskId:j,onSelectTask:oe,onArchiveTask:ee,filters:O,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:X})})}),R&&s.jsx(vt,{open:$,onOpenChange:A})]})}const to=5,so=[{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 us(){const t=I.c(3),{state:e}=_e();if(e==="collapsed"){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:to}).map(oo)}),t[0]=l):l=t[0],l}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(se,{className:"size-6 rounded-md"}),s.jsx(se,{className:"size-6 rounded-md"}),s.jsx(se,{className:"size-6 rounded-md"})]}),s.jsx(se,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=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:so.map(no)})]}),t[2]=o):o=t[2],o}function no(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(se,{className:"size-5 rounded-full shrink-0"}),s.jsx(se,{className:B("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(lo)})]},e)}function lo(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(se,{className:"h-3 flex-1 rounded-sm"})},e)}function oo(t,e){return s.jsx(se,{className:"size-10 rounded-lg mx-auto"},e)}function io(){const t=I.c(2);if(nt()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(He,{showName:!0}),t[0]=o):o=t[0],o}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(He,{}),s.jsx(st,{})]}),t[1]=n):n=t[1],n}function ro(){const t=I.c(5),e=ss();let n,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Pl,{}),o=s.jsx(io,{}),t[0]=n,t[1]=o):(n=t[0],o=t[1]);let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Xe,{children:s.jsx(G.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[2]=l):l=t[2];let i;return t[3]!==e?(i=s.jsx(ts,{children:s.jsx(os,{sections:e,footer:n,header:o,additionalContent:l})}),t[3]=e,t[4]=i):i=t[4],i}function ao(t){const e=I.c(8),{onClose:n}=t,o=ss();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx($l,{}),e[0]=l):l=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(us,{}),e[1]=i):i=e[1];let r;e[2]!==n?(r=s.jsx(Xe,{children:s.jsx(G.Suspense,{fallback:i,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(ts,{children:s.jsx(ul,{sections:o,onClose:n,footer:l,additionalContent:r})}),e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}const co="sidebar.open";function mo(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ws,{}),t[0]=e):e=t[0],e}function wr(){const t=I.c(37),e=$t(),n=nt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const{connect:l,siteUrl:i}=It(o),r=l==="1",[a,d]=ze(co,!1),{width:c,wrapperRef:m,onStartResize:u,resetWidth:p}=ll(),x=e;let f;t[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(es,{}),t[1]=f):f=t[1];let g;t[2]!==n?(g=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(st,{})}),t[2]=n,t[3]=g):g=t[3];let h,b,v,y,j;t[4]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ve,{}),b=s.jsx(xe.TogglesSlot,{}),v=s.jsx(xe.TabsSlot,{className:"shrink-0"}),y=s.jsx(xe.CenterSlot,{}),j=s.jsx(xe.RightSlot,{}),t[4]=h,t[5]=b,t[6]=v,t[7]=y,t[8]=j):(h=t[4],b=t[5],v=t[6],y=t[7],j=t[8]);let _;t[9]!==g?(_=s.jsx(xe.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[f,g,h,b,v,y,j]})}),t[9]=g,t[10]=_):_=t[10];const C=_;let N;t[11]===Symbol.for("react.memo_cache_sentinel")?(N={background:"transparent",containerType:"inline-size"},t[11]=N):N=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ts,{className:"flex flex-col min-h-0",style:N,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(G.Suspense,{fallback:s.jsx(mo,{}),children:s.jsx(ks,{})})})})}),t[12]=S):S=t[12];const w=S,k=x&&C,T=`${c}px`;let M;t[13]!==T?(M={"--sidebar-width":T,"--sidebar-width-icon":"3.125rem"},t[13]=T,t[14]=M):M=t[14];const z=M;let $;t[15]!==e||t[16]!==u||t[17]!==p?($=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ro,{}),s.jsx(tl,{onPointerDown:u,onDoubleClick:p})]}),t[15]=e,t[16]=u,t[17]=p,t[18]=$):$=t[18];let A;t[19]!==z||t[20]!==$||t[21]!==m?(A=s.jsxs(Ps,{ref:m,className:"flex-1 bg-sidebar relative min-h-0",style:z,children:[$,w]}),t[19]=z,t[20]=$,t[21]=m,t[22]=A):A=t[22];let R;t[23]!==e?(R=e&&s.jsx(Dn,{renderSidebar:uo}),t[23]=e,t[24]=R):R=t[24];let E;t[25]!==i||t[26]!==r?(E=r&&s.jsx(Xn,{siteUrl:i}),t[25]=i,t[26]=r,t[27]=E):E=t[27];let O;t[28]!==k||t[29]!==A||t[30]!==R||t[31]!==E?(O=s.jsx(_n,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[k,A,R,E]})}),t[28]=k,t[29]=A,t[30]=R,t[31]=E,t[32]=O):O=t[32];let D;return t[33]!==d||t[34]!==a||t[35]!==O?(D=s.jsx(Tn,{children:s.jsx(xe.Provider,{children:s.jsx($s,{open:a,onOpenChange:d,children:O})})}),t[33]=d,t[34]=a,t[35]=O,t[36]=D):D=t[36],D}function uo(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(ao,{onClose:e})})})}export{wr as default};
1
+ import{c as I,b as H,j as s,y as fs,B as be,d as ae,F as Q,G as ps,r as G,E as Xe,H as hs,x as xs,K as Mt,e as it,p as V,I as ze,m as B,a as $e,J as gs,v as bs,t as ce,M as js,P as vs,L as ys,n as _s,R as Ss,k as Ns,f as Cs,u as It,O as ks,U as ws}from"./index-D7ecmoEk.js";import{u as _e,S as Qe,a as Je,b as J,c as Y,d as q,e as Tt,f as Ms,g as Pt,h as Is,i as Ge,j as Ts,k as Ps,l as $s}from"./sidebar-BVI_V0Ou.js";import{u as $t}from"./use-mobile-BvPCUKE_.js";import{C as As,p as Re,s as zs,a as Os,n as Es}from"./self-tool-result-CGMZAwKq.js";import{f as Ds,b as Ze,e as et,g as Rs,d as At,h as zt,a as Ot}from"./dialog-Bx0tkWaQ.js";import{f as Fs}from"./tab-id-BUyXQAAI.js";import{C as Ls,W as Et,g as Gs,u as Dt,S as Rt,a as rt}from"./use-mcp-client-CnyXhKwV.js";import{i as tt}from"./ArrowRight-DDYoySSU.js";import{i as Ft}from"./ChevronRight-BewiR8jv.js";import{i as Hs}from"./X-BB9BsBG9.js";import{s as Bs,a as Us,t as Lt,i as Ws,b as Ks,c as qs,d as at,e as Vs,f as Ys,g as Gt,A as Ce,h as Xs,j as Qs,k as Js,l as Zs}from"./agent-icon-zWW3t6VG.js";import{S as se}from"./skeleton-DzEF007-.js";import{i as Ht}from"./LayoutLeft-BKoIFwRN.js";import{O as He,A as st,u as en,a as tn,g as sn,b as nn,c as ln}from"./use-deco-credits-BuBKE8oE.js";import{T as ke,a as xe}from"./toolbar-CdMnBYXx.js";import{P as Bt,a as Ut,b as Wt}from"./popover-uYC-XEIg.js";import{D as on,a as rn,b as an}from"./drawer-D1lsCtV4.js";import{A as Be}from"./avatar-BLfSxUga.js";import{T as je,a as ve,b as Kt,c as ye}from"./tooltip-DV8_wP4H.js";import{a as Ue}from"./Copy01-CXOBuKeI.js";import{n as cn,i as dn}from"./Tool02-CBXM0F92.js";import{n as mn}from"./LinkExternal01-B0YPc_S1.js";import{i as ct}from"./LogOut01-Cr7guD_C.js";import{i as We}from"./Monitor01-BDL-jnJs.js";import{n as un,a as fn}from"./Sun-BUqEkjZt.js";import{a as Oe}from"./Settings02-BCqIMlR1.js";import{i as pn}from"./Shield01-DmJb3xyD.js";import{a as hn}from"./Users03-X_nEGPVF.js";import{u as xn}from"./use-deployment-admin-BmhPiQqU.js";import"./index-99C6r-0O.js";import{a as qt}from"./XCircle-Cnd7dAXs.js";import{a as gn}from"./ZapSquare-l2Bo-FFh.js";import{I as Vt}from"./invite-member-dialog-Cgl5-4U8.js";import{u as dt}from"./use-copy-ChgQcxSu.js";import{i as Ke}from"./Check-C-gVe66h.js";import{m as bn,u as jn,c as vn}from"./use-api-keys-BfTMjXnb.js";import{u as yn,C as _n}from"./chat-context-CS8lxm9_.js";import{v as Sn,C as mt}from"./connect-desktop-dialog-DPG0q8Du.js";import{u as nt}from"./use-organization-settings-BIY_uMId.js";import{i as Nn}from"./FilterLines-Cmyrpv9O.js";import{T as Cn,a as kn}from"./toggle-group-D32XTjzk.js";import{u as Yt,a as wn}from"./use-virtual-mcp-qSYuKLW8.js";import{u as Mn,a as Xt,b as In,T as Tn}from"./hooks--vfnlMbG.js";import{u as Qt,f as Pn}from"./shell-layout-Bp9VqH1i.js";import{C as $n,a as An,b as zn,c as On,d as En}from"./command-BtKeqRh4.js";import{u as Jt}from"./studio-tools-BnkAV7Qh.js";import{i as Zt}from"./Zap-CjDEO_x2.js";import{S as es,M as Dn}from"./shell-controls-CH6DRW8q.js";import{n as Rn}from"./Stars02-DXc-e3hC.js";import{g as Fn,u as Ln,S as Gn}from"./use-clock-tick-CdvZtpVB.js";import{a as Hn}from"./format-time-BnbuEtat.js";import{t as Bn}from"./ChevronDown-CHUXS0bx.js";import{S as ts}from"./use-navigate-to-agent-mziLMlnK.js";import"./integration-icon-Bep1O6vd.js";import"./companions-core-CSljQMf_.js";import"./extract-connection-data-DN3g7eFu.js";import"./metadata-dUsYcpuu.js";import"./github-repo-scope-DjMZbiKa.js";import"./CheckCircle-DwQTzzLo.js";import"./form-Du5MP186.js";import"./label-C7DWPW8F.js";import"./input-Dc_Ksu2B.js";import"./Eye-BzQwpriV.js";import"./use-debounced-value-BC1HcYvB.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./useQueries-BoGu5qPQ.js";import"./authenticate-and-persist-oauth-B1ortyYw.js";import"./mcp-oauth-BaAftNVP.js";import"./auth-_9lv2gUI.js";import"./AlertCircle-wZFBWpo0.js";import"./Tool01-pmII3WpR.js";import"./ArrowUp-BfmJVXpe.js";import"./ArrowUpRight-CX0JFgau.js";import"./TrendUp01-BjARk23u.js";import"./ChevronUp-DbJPy-my.js";import"./DotsVertical-DSuOWFkK.js";import"./Star01-6fXqBYGO.js";import"./Palette-BAqGRxp5.js";import"./SwitchHorizontal01-CGOv_Rrr.js";import"./HardDrive-MuN_hYGO.js";import"./Key01-DsAMFomV.js";import"./Play-DgsbjMDE.js";import"./Plus--3XFCNRh.js";import"./SearchLg-fj8vBgbf.js";import"./SearchMd-Db6xGpMm.js";import"./Stars01-6mAfYED3.js";import"./Trash01-CJ9K1v0c.js";import"./Upload01-dYbrTK96.js";import"./User01-BWh29jlX.js";import"./Users01-CVpagA8a.js";import"./XClose-DYcmy7Dm.js";import"./alert-dialog-DboT2S2L.js";import"./use-registry-app-Dah_IHSb.js";import"./use-mcp-tools-Y11uuW0V.js";import"./github-repo-picker-CevuiACk.js";import"./collection-search-B27cYP5F.js";import"./use-connection-BVFqG9Id.js";import"./reusable-new-chat-CouMjkYR.js";import"./connection-card-CR8Tezk_.js";import"./use-registry-connections-Dt1w8c5m.js";import"./useInfiniteQuery-BRBbsKnZ.js";import"./use-infinite-scroll-DaBbmjUW.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./connection-slug-eyAPH6o3.js";import"./card-MKJv9EQN.js";import"./select-o--wOfO_.js";import"./textarea-BJyqw4SL.js";import"./connection-form-helpers-BHvHPEt2.js";import"./collection-tabs-CkE9QnXQ.js";import"./badge-Caz53JSJ.js";import"./useSuspenseInfiniteQuery-BjnR7v75.js";import"./use-ai-providers-CGmpPHf_.js";import"./use-org-auth-client-D-a5lzlz.js";import"./use-organization-roles-Bfvpk2iJ.js";import"./use-decopilot-events-hTj_0wvh.js";import"./decopilot-sse-pool-Cs4Wzcc3.js";import"./required-auth-layout-CWsSFaCw.js";import"./use-org-sso-DRXrpsuQ.js";import"./index-CGW3LfG6.js";import"./differenceInSeconds-NQ4PDo0z.js";const Un="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function Wn(){const t=I.c(13),e=H();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),t[1]=e,t[2]=o):o=t[2];let l;t[3]!==o?(l=s.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),t[3]=o,t[4]=l):l=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:Un,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),t[5]=i):i=t[5];let r;t[6]!==e?(r=e("routes.commerceOnboarding.connectModal.quoteAuthor"),t[6]=e,t[7]=r):r=t[7];let a;t[8]!==r?(a=s.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,s.jsx("span",{className:"text-base font-medium",children:r})]}),t[8]=r,t[9]=a):a=t[9];let d;return t[10]!==l||t[11]!==a?(d=s.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[n,l,a]}),t[10]=l,t[11]=a,t[12]=d):d=t[12],d}function Kn(){const t=I.c(19),e=H();let n;t[0]!==e?(n=e("routes.commerceOnboarding.connectModal.trustRevoke"),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={Icon:Bs,label:n},t[2]=n,t[3]=o):o=t[3];let l;t[4]!==e?(l=e("routes.commerceOnboarding.connectModal.trustEncrypted"),t[4]=e,t[5]=l):l=t[5];let i;t[6]!==l?(i={Icon:fs,label:l},t[6]=l,t[7]=i):i=t[7];let r;t[8]!==e?(r=e("routes.commerceOnboarding.connectModal.trustNeverSold"),t[8]=e,t[9]=r):r=t[9];let a;t[10]!==r?(a={Icon:Us,label:r},t[10]=r,t[11]=a):a=t[11];let d;t[12]!==o||t[13]!==i||t[14]!==a?(d=[o,i,a],t[12]=o,t[13]=i,t[14]=a,t[15]=d):d=t[15];const c=d;let m;t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-px w-full bg-white/15"}),t[16]=m):m=t[16];let u;return t[17]!==c?(u=s.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,s.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:c.map(qn)})]}),t[17]=c,t[18]=u):u=t[18],u}function qn(t){const{Icon:e,label:n}=t;return s.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[s.jsx(e,{className:"size-4 shrink-0 opacity-85"}),n]},n)}function Vn(t){const e=I.c(22),{siteHost:n,footer:o,onClose:l,children:i}=t,r=H(),a=n?`https://www.google.com/s2/favicons?domain=${n}&sz=128`:null;let d;e[0]!==l||e[1]!==r?(d=l&&s.jsx("button",{type:"button",onClick:l,"aria-label":r("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:s.jsx(Hs,{size:18})}),e[0]=l,e[1]=r,e[2]=d):d=e[2];let c,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=c,e[4]=m):(c=e[3],m=e[4]);let u;e[5]!==a||e[6]!==n?(u=n&&s.jsxs(s.Fragment,{children:[s.jsx(Ft,{size:16,className:"shrink-0 text-foreground/25"}),a&&s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:s.jsx("img",{src:a,alt:"",className:"size-full"})}),s.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:n})]}),e[5]=a,e[6]=n,e[7]=u):u=e[7];let p;e[8]!==u?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[c,m,u]}),e[8]=u,e[9]=p):p=e[9];let x;e[10]!==o?(x=s.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=x):x=e[11];let f;e[12]!==i||e[13]!==p||e[14]!==x?(f=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[p,i,x]}),e[12]=i,e[13]=p,e[14]=x,e[15]=f):f=e[15];let g,h;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),h=s.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=g,e[17]=h):(g=e[16],h=e[17]);let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[g,h,s.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[s.jsx("div",{className:"flex-1"}),s.jsx(Wn,{}),s.jsx("div",{className:"flex-1"}),s.jsx(Kn,{})]})]}),e[18]=b):b=e[18];let v;return e[19]!==d||e[20]!==f?(v=s.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[d,f,b]}),e[19]=d,e[20]=f,e[21]=v):v=e[21],v}function Yn(t){const e=I.c(5),{ready:n,pending:o,label:l,onClick:i,children:r}=t,a=o||!n,d=n&&!o?r:null;let c;return e[0]!==l||e[1]!==i||e[2]!==a||e[3]!==d?(c=s.jsxs(be,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:a,children:[l,d]}),e[0]=l,e[1]=i,e[2]=a,e[3]=d,e[4]=c):c=e[4],c}function Xn(t){const e=I.c(22),{siteUrl:n}=t,o=ae(),{org:l}=Q(),i=H();let r;e[0]!==o||e[1]!==l.id||e[2]!==l.slug?(r=()=>{localStorage.setItem(ps.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:l.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Gs(l.id),main:Fs(Et.COMMERCE_DISCOVERY(l.id),Ls),sidepanel:0}})},e[0]=o,e[1]=l.id,e[2]=l.slug,e[3]=r):r=e[3];const a=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ds,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=d):d=e[4];let c;e[5]!==i?(c=i("routes.commerceOnboarding.connectModal.dialogTitle"),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==c?(m=s.jsx(Ze,{className:"sr-only",children:c}),e[7]=c,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==i?(u=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:i("routes.commerceOnboarding.connectModal.loadError")}),s.jsxs(be,{type:"button",size:"xl",className:"w-full",onClick:a,children:[i("routes.commerceOnboarding.connectModal.continueButton"),s.jsx(tt,{size:18})]})]}),e[9]=a,e[10]=i,e[11]=u):u=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(As,{}),e[12]=p):p=e[12];let x;e[13]!==a||e[14]!==n?(x=s.jsx(G.Suspense,{fallback:p,children:s.jsx(el,{siteUrlFromUrl:n,onComplete:a})}),e[13]=a,e[14]=n,e[15]=x):x=e[15];let f;e[16]!==u||e[17]!==x?(f=s.jsx(Xe,{fallback:u,children:x}),e[16]=u,e[17]=x,e[18]=f):f=e[18];let g;return e[19]!==m||e[20]!==f?(g=s.jsx(et,{open:!0,children:s.jsxs(Rs,{children:[d,s.jsxs(hs,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Zn,onPointerDownOutside:Jn,onInteractOutside:Qn,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,f]})]})}),e[19]=m,e[20]=f,e[21]=g):g=e[21],g}function Qn(t){return t.preventDefault()}function Jn(t){return t.preventDefault()}function Zn(t){return t.preventDefault()}function el({siteUrlFromUrl:t,onComplete:e}){const n=H(),{org:o}=Q(),l=Et.COMMERCE_DISCOVERY(o.id),i=Dt({connectionId:Rt,orgId:o.id,orgSlug:o.slug}),a=xs({queryKey:Mt.commerceDiscoveryConnection(o.id,l),queryFn:async()=>{const y=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:l}});return Re(y)},retry:!1}).data.item,d=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||d,m=zs(c),[u,p]=G.useState(!0),[x,f]=G.useState(null),g=it({mutationFn:async y=>Re(await i.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}})),retry:!1}),h=it({mutationFn:async y=>Re(await i.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:y}})),retry:!1}),b=async()=>{f(null),V("commerce_onboarding_open_report_clicked",{domain:m??void 0,organization_id:o.id});const y=c?Es(c):null;if(y?.ok)try{let j=await h.mutateAsync(y.value);if(j.triggered||(V("commerce_onboarding_run_reclaim",{domain:m??void 0,organization_id:o.id,reason:j.reason??"not_upgraded"}),await g.mutateAsync(y.value),j=await h.mutateAsync(y.value)),!j.triggered){V("commerce_onboarding_run_failed",{domain:m??void 0,organization_id:o.id,error:j.reason??"not_triggered"}),f(n("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(j){V("commerce_onboarding_run_failed",{domain:m??void 0,organization_id:o.id,error:j instanceof Error?j.message:String(j)}),f(n("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}e()},v=u;return s.jsx(Vn,{siteHost:m,footer:s.jsxs(s.Fragment,{children:[x?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:x}):null,s.jsx(Yn,{ready:v,pending:h.isPending,label:h.isPending?n("routes.commerceOnboarding.connectModal.openingReport"):n(v?"routes.commerceOnboarding.connectModal.viewFullReport":"routes.commerceOnboarding.connectModal.connectToolToContinue"),onClick:()=>{b()},children:s.jsx(tt,{size:18})})]}),children:s.jsx(Os,{org:o,cdConnectionId:l,siteUrl:c,onReadinessChange:p})})}function tl(t){const e=I.c(11),{onPointerDown:n,onDoubleClick:o}=t,l=H(),{state:i,isMobile:r}=_e();if(r||i==="collapsed")return null;let a;e[0]!==l?(a=l("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=l,e[1]=a):a=e[1];let d;e[2]!==l?(d=l("sidebar.sidebarResizeHandle.title"),e[2]=l,e[3]=d):d=e[3];let c,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={left:"var(--sidebar-width)"},m=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[4]=c,e[5]=m):(c=e[4],m=e[5]);let u;return e[6]!==o||e[7]!==n||e[8]!==a||e[9]!==d?(u=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a,title:d,onPointerDown:n,onDoubleClick:o,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:c,children:m}),e[6]=o,e[7]=n,e[8]=a,e[9]=d,e[10]=u):u=e[10],u}const lt=240,sl=400,nl="sidebar.width";function Ne(t){return Math.max(lt,Math.min(sl,t))}function ll(){const t=I.c(11),[e,n]=ze(nl,ol),o=G.useRef(null);let l;t[0]!==n||t[1]!==e?(l=m=>{m.preventDefault();const u=m.clientX,p=Ne(e),x=o.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),f=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of f)b.style.transition="none";const g=b=>{const v=Ne(p+(b.clientX-u));x?.style.setProperty("--sidebar-width",`${v}px`)},h=b=>{const v=Ne(p+(b.clientX-u));n(v);for(const y of f)y.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",h),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",h)},t[0]=n,t[1]=e,t[2]=l):l=t[2];const i=l;let r;t[3]!==n?(r=()=>{n(lt)},t[3]=n,t[4]=r):r=t[4];const a=r;let d;t[5]!==e?(d=Ne(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:o,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function ol(t){return typeof t=="number"?Ne(t):lt}function ss(){return[]}function ns(t){const e=I.c(3),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[0];let l;return e[1]!==n?(l=s.jsxs(Qe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Je,{children:s.jsx(J,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=l):l=e[2],l}function ls(t){const e=I.c(18),{item:n}=t,{isMobile:o,setOpenMobile:l}=_e();let i;e[0]!==o||e[1]!==n||e[2]!==l?(i=()=>{V("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&l(!1)},e[0]=o,e[1]=n,e[2]=l,e[3]=i):i=e[3];const r=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=B(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]!==r||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(Y,{onClick:r,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=r,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let p;return e[14]!==n.key||e[15]!==c||e[16]!==u?(p=s.jsx(q,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=p):p=e[17],p}function il(t){const e=I.c(12),{section:n}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Tt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,l=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(al),e[2]=n.group.items,e[3]=i):i=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(r=s.jsx(ns,{label:o,defaultExpanded:l,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=r):r=e[7],r}case"items":{let o;e[8]!==n.items?(o=n.items.map(rl),e[8]=n.items,e[9]=o):o=e[9];let l;return e[10]!==o?(l=s.jsx(Qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Je,{children:s.jsx(J,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=l):l=e[11],l}case"custom":return n.content}}function rl(t){return s.jsx(ls,{item:t},t.key)}function al(t){return s.jsx(ls,{item:t},t.key)}function cl(t){const e=I.c(17),{sections:n,footer:o,additionalContent:l,header:i,variant:r,contentClassName:a}=t,d=r===void 0?"sidebar":r;let c;e[0]!==i?(c=i&&s.jsx(Ms,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:i}),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=B("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n.map(dl),e[4]=n,e[5]=u):u=e[5];let p;e[6]!==l?(p=l&&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:l}),e[6]=l,e[7]=p):p=e[7];let x;e[8]!==m||e[9]!==u||e[10]!==p?(x=s.jsxs(Pt,{className:m,children:[u,p]}),e[8]=m,e[9]=u,e[10]=p,e[11]=x):x=e[11];let f;return e[12]!==o||e[13]!==c||e[14]!==x||e[15]!==d?(f=s.jsxs(Is,{variant:d,children:[c,x,o]}),e[12]=o,e[13]=c,e[14]=x,e[15]=d,e[16]=f):f=e[16],f}function dl(t,e){return s.jsx(il,{section:t},e)}function os(t){const e=I.c(2);let n;return e[0]!==t?(n=s.jsx(cl,{...t}),e[0]=t,e[1]=n):n=e[1],n}os.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(se,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ut(t){const e=I.c(18),{item:n,onClose:o}=t,l=n.isActive&&"z-10";let i;e[0]!==l?(i=B(l),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==o?(r=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==r||e[12]!==a||e[13]!==d?(c=s.jsxs(Y,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=r,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(q,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function ml(t){const e=I.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Tt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;if(e[2]!==o||e[3]!==n.group.items){let d;e[5]!==o?(d=c=>s.jsx(ut,{item:c,onClose:o},c.key),e[5]=o,e[6]=d):d=e[6],r=n.group.items.map(d),e[2]=o,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let l;if(e[11]!==o||e[12]!==n.items){let r;e[14]!==o?(r=a=>s.jsx(ut,{item:a,onClose:o},a.key),e[14]=o,e[15]=r):r=e[15],l=n.items.map(r),e[11]=o,e[12]=n.items,e[13]=l}else l=e[13];let i;return e[16]!==l?(i=s.jsx(Qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Je,{children:s.jsx(J,{className:"gap-1.5",children:l})})}),e[16]=l,e[17]=i):i=e[17],i}case"custom":return n.content}}function ul(t){const e=I.c(27),{sections:n,onClose:o,footer:l,additionalContent:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(He,{}),e[0]=r):r=e[0];let a;e[1]!==o?(a=s.jsx(st,{onNavigate:o}),e[1]=o,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1"}),e[3]=d):d=e[3];const c=H();let m;e[4]!==c?(m=c("sidebar.navigationMobile.closeSidebar"),e[4]=c,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ht,{size:16}),e[6]=u):u=e[6];let p;e[7]!==o||e[8]!==m?(p=s.jsx(ke,{onClick:o,"aria-label":m,children:u}),e[7]=o,e[8]=m,e[9]=p):p=e[9];let x;e[10]!==a||e[11]!==p?(x=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[r,a,d,p]}),e[10]=a,e[11]=p,e[12]=x):x=e[12];let f;if(e[13]!==o||e[14]!==n){let v;e[16]!==o?(v=(y,j)=>s.jsx(ml,{section:y,onClose:o},j),e[16]=o,e[17]=v):v=e[17],f=n.map(v),e[13]=o,e[14]=n,e[15]=f}else f=e[15];let g;e[18]!==i?(g=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[18]=i,e[19]=g):g=e[19];let h;e[20]!==g||e[21]!==f?(h=s.jsxs(Pt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,g]}),e[20]=g,e[21]=f,e[22]=h):h=e[22];let b;return e[23]!==l||e[24]!==h||e[25]!==x?(b=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[x,h,l]}),e[23]=l,e[24]=h,e[25]=x,e[26]=b):b=e[26],b}function ge(t){const e=I.c(26),{item:n,onClose:o}=t;let l;e[0]!==n.className?(l=B("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=l):l=e[1];const i=l;if(n.href){const m=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let p;e[2]!==n.icon?(p=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=p):p=e[3];let x;e[4]!==n.label?(x=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=x):x=e[5];let f;return e[6]!==i||e[7]!==n.href||e[8]!==o||e[9]!==m||e[10]!==u||e[11]!==p||e[12]!==x?(f=s.jsxs("a",{href:n.href,target:m,rel:u,className:i,onClick:o,children:[p,x]}),e[6]=i,e[7]=n.href,e[8]=o,e[9]=m,e[10]=u,e[11]=p,e[12]=x,e[13]=f):f=e[13],f}let r;e[14]!==n||e[15]!==o?(r=()=>{n.onClick?.(),o()},e[14]=n,e[15]=o,e[16]=r):r=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let d;e[19]!==n.label?(d=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=d):d=e[20];let c;return e[21]!==i||e[22]!==r||e[23]!==a||e[24]!==d?(c=s.jsxs("button",{type:"button",onClick:r,className:i,children:[a,d]}),e[21]=i,e[22]=r,e[23]=a,e[24]=d,e[25]=c):c=e[25],c}function fl(){const t=I.c(4),e=H();let n;t[0]!==e?(n=e("common.accountPopover.impersonating"),t[0]=e,t[1]=n):n=t[1];let o;return t[2]!==n?(o=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:n}),t[2]=n,t[3]=o):o=t[3],o}function ft(t){const e=I.c(38),{user:n,userImage:o,isImpersonating:l,isMobile:i}=t,r=H(),a=i?"py-4 border-b border-border":"py-3 mx-1 mt-1";let d;e[0]!==a?(d=B("flex items-center gap-3 px-4",a),e[0]=a,e[1]=d):d=e[1];const c=n?.name??"U";let m;e[2]!==c||e[3]!==o?(m=s.jsx(Be,{url:o,fallback:c,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=c,e[3]=o,e[4]=m):m=e[4];let u;e[5]!==r||e[6]!==n?.name?(u=n?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=n?.name,e[7]=u):u=e[7];let p;e[8]!==u?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:u}),e[8]=u,e[9]=p):p=e[9];let x;e[10]!==l?(x=l&&s.jsx(fl,{}),e[10]=l,e[11]=x):x=e[11];let f;e[12]!==p||e[13]!==x?(f=s.jsxs("div",{className:"flex items-center gap-2",children:[p,x]}),e[12]=p,e[13]=x,e[14]=f):f=e[14];const g=n?.email;let h;e[15]!==g?(h=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=h):h=e[16];let b;e[17]!==h||e[18]!==f?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[17]=h,e[18]=f,e[19]=b):b=e[19];let v;e[20]!==r||e[21]!==n?(v=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{ce.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=n,e[22]=v):v=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ue,{size:14}),e[23]=y):y=e[23];let j;e[24]!==v?(j=s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[24]=v,e[25]=j):j=e[25];let _;e[26]!==r?(_=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=_):_=e[27];let C;e[28]!==_?(C=s.jsx(ve,{side:"right",children:s.jsx("p",{className:"text-xs",children:_})}),e[28]=_,e[29]=C):C=e[29];let N;e[30]!==j||e[31]!==C?(N=s.jsx(Kt,{delayDuration:300,children:s.jsxs(ye,{children:[j,C]})}),e[30]=j,e[31]=C,e[32]=N):N=e[32];let S;return e[33]!==b||e[34]!==N||e[35]!==d||e[36]!==m?(S=s.jsxs("div",{className:d,children:[m,b,N]}),e[33]=b,e[34]=N,e[35]=d,e[36]=m,e[37]=S):S=e[37],S}function pt(t){const e=I.c(35),{themeOptions:n,preferences:o,setPreferences:l,isMobile:i}=t,r=H(),a=i?"size-8":"size-7",d=i?"px-3 py-3":"px-2 py-1.5";let c;e[0]!==d?(c=B("flex items-center justify-between border-t border-border/50",d),e[0]=d,e[1]=c):c=e[1];let m;if(e[2]!==a||e[3]!==o.theme||e[4]!==l||e[5]!==n){let _;e[7]!==a||e[8]!==o.theme||e[9]!==l?(_=C=>{const{value:N,icon:S,label:w}=C;return s.jsx("button",{type:"button","aria-label":w,onClick:()=>l(k=>({...k,theme:N})),className:B(a,"rounded-md flex items-center justify-center transition-colors",o.theme===N?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:S},N)},e[7]=a,e[8]=o.theme,e[9]=l,e[10]=_):_=e[10],m=n.map(_),e[2]=a,e[3]=o.theme,e[4]=l,e[5]=n,e[6]=m}else m=e[6];let u;e[11]!==m?(u=s.jsx("div",{className:"flex items-center gap-0.5",children:m}),e[11]=m,e[12]=u):u=e[12];let p;e[13]!==o.enableSounds||e[14]!==r?(p=o.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=o.enableSounds,e[14]=r,e[15]=p):p=e[15];let x;e[16]!==l?(x=()=>l(pl),e[16]=l,e[17]=x):x=e[17];const f=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let g;e[18]!==a||e[19]!==f?(g=B(a,"rounded-md flex items-center justify-center transition-colors",f),e[18]=a,e[19]=f,e[20]=g):g=e[20];let h;e[21]!==o.enableSounds?(h=o.enableSounds?s.jsx(Ks,{size:14}):s.jsx(qs,{size:14}),e[21]=o.enableSounds,e[22]=h):h=e[22];let b;e[23]!==p||e[24]!==x||e[25]!==g||e[26]!==h?(b=s.jsx("button",{type:"button","aria-label":p,onClick:x,className:g,children:h}),e[23]=p,e[24]=x,e[25]=g,e[26]=h,e[27]=b):b=e[27];let v;e[28]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.126.2"]}),e[28]=v):v=e[28];let y;e[29]!==b?(y=s.jsxs("div",{className:"flex items-center gap-2",children:[b,v]}),e[29]=b,e[30]=y):y=e[30];let j;return e[31]!==y||e[32]!==c||e[33]!==u?(j=s.jsxs("div",{className:c,children:[u,y]}),e[31]=y,e[32]=c,e[33]=u,e[34]=j):j=e[34],j}function pl(t){return{...t,enableSounds:!t.enableSounds}}function ht(t){const e=I.c(54),{user:n,userImage:o,menuItems:l,signOutItem:i,stopImpersonatingItem:r,isImpersonating:a,themeOptions:d,preferences:c,setPreferences:m,close:u,isMobile:p}=t;if(p){let j;e[0]!==a||e[1]!==n||e[2]!==o?(j=s.jsx(ft,{user:n,userImage:o,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=o,e[3]=j):j=e[3];let _;if(e[4]!==u||e[5]!==l){let T;e[7]!==u?(T=M=>s.jsx(ge,{item:M,onClose:u},M.key),e[7]=u,e[8]=T):T=e[8],_=l.map(T),e[4]=u,e[5]=l,e[6]=_}else _=e[6];let C;e[9]!==u||e[10]!==r?(C=r&&s.jsx(ge,{item:r,onClose:u}),e[9]=u,e[10]=r,e[11]=C):C=e[11];let N;e[12]!==u||e[13]!==i?(N=s.jsx(ge,{item:i,onClose:u}),e[12]=u,e[13]=i,e[14]=N):N=e[14];let S;e[15]!==_||e[16]!==C||e[17]!==N?(S=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:[_,C,N]})}),e[15]=_,e[16]=C,e[17]=N,e[18]=S):S=e[18];let w;e[19]!==c||e[20]!==m||e[21]!==d?(w=s.jsx(pt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!0}),e[19]=c,e[20]=m,e[21]=d,e[22]=w):w=e[22];let k;return e[23]!==j||e[24]!==S||e[25]!==w?(k=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[j,S,w]}),e[23]=j,e[24]=S,e[25]=w,e[26]=k):k=e[26],k}let x;e[27]!==a||e[28]!==n||e[29]!==o?(x=s.jsx(ft,{user:n,userImage:o,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=o,e[30]=x):x=e[30];let f;if(e[31]!==u||e[32]!==l){let j;e[34]!==u?(j=_=>s.jsx(ge,{item:_,onClose:u},_.key),e[34]=u,e[35]=j):j=e[35],f=l.map(j),e[31]=u,e[32]=l,e[33]=f}else f=e[33];let g;e[36]!==u||e[37]!==r?(g=r&&s.jsx(ge,{item:r,onClose:u}),e[36]=u,e[37]=r,e[38]=g):g=e[38];let h;e[39]!==u||e[40]!==i?(h=s.jsx(ge,{item:i,onClose:u}),e[39]=u,e[40]=i,e[41]=h):h=e[41];let b;e[42]!==f||e[43]!==g||e[44]!==h?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[f,g,h]}),e[42]=f,e[43]=g,e[44]=h,e[45]=b):b=e[45];let v;e[46]!==c||e[47]!==m||e[48]!==d?(v=s.jsx(pt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!1}),e[46]=c,e[47]=m,e[48]=d,e[49]=v):v=e[49];let y;return e[50]!==x||e[51]!==b||e[52]!==v?(y=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[x,b,v]})}),e[50]=x,e[51]=b,e[52]=v,e[53]=y):y=e[53],y}function qe(){const t=I.c(99),e=H(),{data:n}=$e.useSession(),{org:o}=Q(),l=ae();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=gs(i)?.params.org,[d,c]=bs(),m=$t(),{isAdmin:u}=xn(),[p,x]=G.useState(!1),f=n?.user,g=f?.image,h=!!n?.session?.impersonatedBy;let b;t[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>x(!1),t[1]=b):b=t[1];const v=b;let y;t[2]!==e?(y=e("common.accountPopover.preferences"),t[2]=e,t[3]=y):y=t[3];let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Oe,{size:16}),t[4]=j):j=t[4];let _;t[5]!==l||t[6]!==a?(_=()=>{l({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=l,t[6]=a,t[7]=_):_=t[7];let C;t[8]!==y||t[9]!==_?(C={key:"preferences",label:y,icon:j,onClick:_},t[8]=y,t[9]=_,t[10]=C):C=t[10];let N;t[11]!==o||t[12]!==l||t[13]!==e?(N=o?[{key:"install-app",label:e("common.accountPopover.addToHomeScreen"),icon:s.jsx(cn,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:o.slug}})}},{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(mn,{size:16}),onClick:()=>{l({to:"/$org/settings/connect",params:{org:o.slug}})}}]:[],t[11]=o,t[12]=l,t[13]=e,t[14]=N):N=t[14];let S;t[15]!==e?(S=e("common.accountPopover.termsOfUse"),t[15]=e,t[16]=S):S=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Ws,{size:16}),t[17]=w):w=t[17];let k;t[18]!==S?(k={key:"terms",label:S,icon:w,href:"https://www.decocms.com/terms-of-use",external:!0},t[18]=S,t[19]=k):k=t[19];let T;t[20]!==e?(T=e("common.accountPopover.privacyPolicy"),t[20]=e,t[21]=T):T=t[21];let M;t[22]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(pn,{size:16}),t[22]=M):M=t[22];let z;t[23]!==T?(z={key:"privacy",label:T,icon:M,href:"https://www.decocms.com/privacy-policy",external:!0},t[23]=T,t[24]=z):z=t[24];let $;t[25]!==e?($=e("common.accountPopover.githubRepo"),t[25]=e,t[26]=$):$=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(js,{className:"w-4 h-4"}),t[27]=A):A=t[27];let R;t[28]!==$?(R={key:"github",label:$,icon:A,href:"https://github.com/decocms/studio",external:!0},t[28]=$,t[29]=R):R=t[29];let E;t[30]!==e?(E=e("common.accountPopover.community"),t[30]=e,t[31]=E):E=t[31];let O;t[32]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(hn,{size:16}),t[32]=O):O=t[32];let D;t[33]!==E?(D={key:"community",label:E,icon:O,href:"https://decocms.com/discord",external:!0},t[33]=E,t[34]=D):D=t[34];let F;t[35]!==e?(F=e("common.accountPopover.homepage"),t[35]=e,t[36]=F):F=t[36];let K;t[37]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(dn,{size:16}),t[37]=K):K=t[37];let Z;t[38]!==F?(Z={key:"homepage",label:F,icon:K,href:"https://decocms.com",external:!0},t[38]=F,t[39]=Z):Z=t[39];let ne;t[40]!==u||t[41]!==l||t[42]!==e?(ne=u?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(Lt,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-warning"}]:[],t[40]=u,t[41]=l,t[42]=e,t[43]=ne):ne=t[43];let de;t[44]!==z||t[45]!==R||t[46]!==D||t[47]!==Z||t[48]!==ne||t[49]!==C||t[50]!==N||t[51]!==k?(de=[C,...N,k,z,R,D,Z,...ne],t[44]=z,t[45]=R,t[46]=D,t[47]=Z,t[48]=ne,t[49]=C,t[50]=N,t[51]=k,t[52]=de):de=t[52];const le=de;let ee;t[53]!==e?(ee=e("common.accountPopover.signOut"),t[53]=e,t[54]=ee):ee=t[54];let oe;t[55]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ct,{size:16}),t[55]=oe):oe=t[55];let me;t[56]!==ee?(me={key:"logout",label:ee,icon:oe,onClick:xl},t[56]=ee,t[57]=me):me=t[57];const Se=me;let ue;t[58]!==h||t[59]!==e?(ue=h?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(ct,{size:16}),onClick:async()=>{const{error:ot}=await $e.admin.stopImpersonating();if(ot){ce.error(ot.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[58]=h,t[59]=e,t[60]=ue):ue=t[60];const fe=ue;let pe;t[61]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(un,{size:14}),t[61]=pe):pe=t[61];let ie;t[62]!==e?(ie=e("common.accountPopover.lightTheme"),t[62]=e,t[63]=ie):ie=t[63];let X;t[64]!==ie?(X={value:"light",icon:pe,label:ie},t[64]=ie,t[65]=X):X=t[65];let he;t[66]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(fn,{size:14}),t[66]=he):he=t[66];let te;t[67]!==e?(te=e("common.accountPopover.darkTheme"),t[67]=e,t[68]=te):te=t[68];let P;t[69]!==te?(P={value:"dark",icon:he,label:te},t[69]=te,t[70]=P):P=t[70];let L;t[71]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(We,{size:14}),t[71]=L):L=t[71];let W;t[72]!==e?(W=e("common.accountPopover.systemTheme"),t[72]=e,t[73]=W):W=t[73];let U;t[74]!==W?(U={value:"system",icon:L,label:W},t[74]=W,t[75]=U):U=t[75];let re;t[76]!==X||t[77]!==P||t[78]!==U?(re=[X,P,U],t[76]=X,t[77]=P,t[78]=U,t[79]=re):re=t[79];const De=re;let we;t[80]!==h||t[81]!==m||t[82]!==le||t[83]!==d||t[84]!==c||t[85]!==Se||t[86]!==fe||t[87]!==De||t[88]!==f||t[89]!==g?(we={user:f,userImage:g,menuItems:le,signOutItem:Se,stopImpersonatingItem:fe,isImpersonating:h,themeOptions:De,preferences:d,setPreferences:c,close:v,isMobile:m},t[80]=h,t[81]=m,t[82]=le,t[83]=d,t[84]=c,t[85]=Se,t[86]=fe,t[87]=De,t[88]=f,t[89]=g,t[90]=we):we=t[90];const Me=we;let Ie;return t[91]!==h||t[92]!==m||t[93]!==p||t[94]!==Me||t[95]!==e||t[96]!==f?.name||t[97]!==g?(Ie=s.jsx(s.Fragment,{children:m?s.jsxs(on,{open:p,onOpenChange:x,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>x(!0),className:B("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",h&&"border-2 border-dashed border-warning"),children:[s.jsx(Be,{url:g,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(rn,{className:"h-[80dvh] p-0",children:[s.jsx(an,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx(ht,{...Me})]})]}):s.jsxs(Bt,{open:p,onOpenChange:x,children:[s.jsx(Ut,{asChild:!0,children:s.jsxs(Y,{tooltip:f?.name??e("common.accountPopover.defaultAccountLabel"),className:B("rounded-md",h&&"border-2 border-dashed border-warning"),children:[s.jsx(Be,{url:g,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(Wt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:hl,children:s.jsx(ht,{...Me})})]})}),t[91]=h,t[92]=m,t[93]=p,t[94]=Me,t[95]=e,t[96]=f?.name,t[97]=g,t[98]=Ie):Ie=t[98],Ie}function hl(t){return t.preventDefault()}function xl(){V("signed_out",{source:"account_popover"}),vs(),$e.signOut()}const gl=["Browse and edit your Library files","Run your agents","Enable and call any MCP tool in this org"],bl="Connect: ";function jl(){return typeof window>"u"?"unknown host":window.location.hostname}function vl(t){const e=I.c(45),{onClose:n}=t,{org:o}=Q();let l;e[0]!==o.slug?(l=bn(o.slug),e[0]=o.slug,e[1]=l):l=e[1];const i=l,r=jn(),[a,d]=G.useState(null),c=dt(),m=dt();let u;e[2]!==r||e[3]!==o.slug?(u=()=>{r.mutate({name:`${bl}Claude Code on ${jl()}`,permissions:{"*":["*"]}},{onSuccess:R=>{const E=vn(o.slug,R.key);d(E),V("connect_studio_generate",{target:"claude-code"}),navigator.clipboard?.writeText(E).then(Nl,Sl)},onError:_l})},e[2]=r,e[3]=o.slug,e[4]=u):u=e[4];const p=u;let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("span",{className:"size-8 rounded-lg bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(qt,{size:17})}),e[5]=x):x=e[5];let f;e[6]!==o.name?(f=s.jsxs(Ze,{className:"flex items-center gap-2.5",children:[x,"Connect ",o.name," to Claude"]}),e[6]=o.name,e[7]=f):f=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(zt,{children:"Hand Claude this org's MCP endpoint. Once linked, Claude can:"}),e[8]=g):g=e[8];let h;e[9]!==f?(h=s.jsxs(Ot,{children:[f,g]}),e[9]=f,e[10]=h):h=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("ul",{className:"flex flex-col gap-2 text-sm",children:gl.map(yl)}),e[11]=b):b=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(at,{size:15,className:"text-muted-foreground"}),e[12]=v):v=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[v,"Claude Code",s.jsx("span",{className:"ml-auto text-[11px] font-medium text-special uppercase tracking-wide",children:"Recommended"})]}),e[13]=y):y=e[13];let j;e[14]!==a||e[15]!==c||e[16]!==r.isPending||e[17]!==p?(j=s.jsxs("section",{className:"rounded-xl border border-border bg-muted/30 p-4 flex flex-col gap-3",children:[y,a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-lg border border-border bg-background p-3 max-h-32 overflow-y-auto",children:s.jsx("code",{className:"text-xs leading-relaxed break-all font-mono text-foreground/90 whitespace-pre-wrap",children:a})}),s.jsxs(be,{size:"sm",className:"gap-1.5 self-start",onClick:()=>{c.handleCopy(a),V("connect_studio_copy",{target:"claude-code"}),ce.success("Command copied — paste it in your terminal")},children:[c.copied?s.jsx(Ke,{size:14}):s.jsx(Ue,{size:14}),c.copied?"Copied":"Copy command"]}),s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2",children:[s.jsx(Lt,{size:14,className:"text-warning shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-xs leading-relaxed text-foreground/80",children:["No login step — this command embeds a"," ",s.jsx("span",{className:"font-medium text-foreground",children:"full-access token"}),". Treat it like a password; revoke it any time in Settings → Connect."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"One command, no browser login. We'll mint a scoped access token and embed it so Claude Code connects instantly."}),s.jsxs(be,{size:"sm",className:"gap-1.5 self-start",disabled:r.isPending,onClick:p,children:[s.jsx(at,{size:14}),r.isPending?"Generating…":"Generate connect command"]})]})]}),e[14]=a,e[15]=c,e[16]=r.isPending,e[17]=p,e[18]=j):j=e[18];let _,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(Vs,{size:15,className:"text-muted-foreground"}),"Claude Desktop or claude.ai"]}),C=s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Add a custom connector in Settings → Connectors and paste this URL. Claude signs in with OAuth on first use."}),e[19]=_,e[20]=C):(_=e[19],C=e[20]);let N;e[21]!==i?(N=s.jsx("code",{className:"text-xs flex-1 min-w-0 truncate font-mono text-foreground/90",children:i}),e[21]=i,e[22]=N):N=e[22];let S;e[23]!==i||e[24]!==m?(S=()=>{m.handleCopy(i),V("connect_studio_copy",{target:"claude-connector"})},e[23]=i,e[24]=m,e[25]=S):S=e[25];let w;e[26]!==m.copied?(w=m.copied?s.jsx(Ke,{size:14}):s.jsx(Ue,{size:14}),e[26]=m.copied,e[27]=w):w=e[27];let k;e[28]!==S||e[29]!==w?(k=s.jsx(be,{variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"Copy URL",onClick:S,children:w}),e[28]=S,e[29]=w,e[30]=k):k=e[30];let T;e[31]!==N||e[32]!==k?(T=s.jsxs("section",{className:"flex flex-col gap-2.5",children:[_,C,s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 pl-3 pr-1.5 py-1.5 min-w-0",children:[N,k]})]}),e[31]=N,e[32]=k,e[33]=T):T=e[33];let M;e[34]!==o.slug?(M={org:o.slug},e[34]=o.slug,e[35]=M):M=e[35];let z;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(tt,{size:12}),e[36]=z):z=e[36];let $;e[37]!==n||e[38]!==M?($=s.jsx("div",{className:"flex items-center border-t border-border pt-3",children:s.jsx(be,{asChild:!0,variant:"link",size:"sm",className:"px-0 text-xs gap-1",children:s.jsxs(ys,{to:"/$org/settings/connect",params:M,onClick:n,children:["More clients & API keys ",z]})})}),e[37]=n,e[38]=M,e[39]=$):$=e[39];let A;return e[40]!==j||e[41]!==T||e[42]!==$||e[43]!==h?(A=s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[h,b,j,T,$]}),e[40]=j,e[41]=T,e[42]=$,e[43]=h,e[44]=A):A=e[44],A}function yl(t){return s.jsxs("li",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"size-4 rounded-full bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(Ke,{size:11,strokeWidth:3})}),s.jsx("span",{className:"text-foreground",children:t})]},t)}function _l(t){return ce.error(t.message)}function Sl(){return ce.success("Command ready — copy it below")}function Nl(){return ce.success("Command copied — paste it in your terminal")}function Cl(t){const e=I.c(6),{open:n,onOpenChange:o}=t;let l;e[0]!==o?(l=s.jsx(At,{className:"max-w-lg gap-4",children:s.jsx(vl,{onClose:()=>o(!1)})}),e[0]=o,e[1]=l):l=e[1];let i;return e[2]!==o||e[3]!==n||e[4]!==l?(i=s.jsx(et,{open:n,onOpenChange:o,children:l}),e[2]=o,e[3]=n,e[4]=l,e[5]=i):i=e[5],i}function Ve(t){const e=I.c(50),{variant:n}=t===void 0?{}:t,o=n===void 0?"icon":n,l=H(),i=yn(),[r,a]=G.useState(!1);let d,c;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online||e[4]!==l){const j=Sn(i.capabilities,l);let _;e[7]!==i.online||e[8]!==l?(_=i.online?l("header.linkedDesktopIndicator.desktopLinked"):l("header.linkedDesktopIndicator.connectDesktop"),e[7]=i.online,e[8]=l,e[9]=_):_=e[9],d=_,c=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??l("header.linkedDesktopIndicator.desktopLinked")}),s.jsx("span",{className:"text-muted-foreground",children:j.length>0?l("header.linkedDesktopIndicator.availableCapabilities",{capabilities:j.join(", ")}):l("header.linkedDesktopIndicator.noCliAgents")})]}):s.jsx("span",{className:"text-xs",children:l("header.linkedDesktopIndicator.desktopDisconnected")}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=l,e[5]=d,e[6]=c}else d=e[5],c=e[6];const m=c;if(o==="full"){let j,_;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=()=>a(!0),_=s.jsx(We,{}),e[10]=j,e[11]=_):(j=e[10],_=e[11]);let C;e[12]!==d?(C=s.jsx("span",{children:d}),e[12]=d,e[13]=C):C=e[13];let N;e[14]!==i.online?(N=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[14]=i.online,e[15]=N):N=e[15];let S;e[16]!==d||e[17]!==C||e[18]!==N?(S=s.jsx(je,{asChild:!0,children:s.jsxs(Y,{tooltip:d,onClick:j,children:[_,C,N]})}),e[16]=d,e[17]=C,e[18]=N,e[19]=S):S=e[19];let w;e[20]!==m?(w=s.jsx(ve,{side:"right",children:m}),e[20]=m,e[21]=w):w=e[21];let k;e[22]!==S||e[23]!==w?(k=s.jsxs(ye,{children:[S,w]}),e[22]=S,e[23]=w,e[24]=k):k=e[24];let T;e[25]!==r?(T=s.jsx(mt,{open:r,onOpenChange:a}),e[25]=r,e[26]=T):T=e[26];let M;return e[27]!==T||e[28]!==k?(M=s.jsxs(s.Fragment,{children:[k,T]}),e[27]=T,e[28]=k,e[29]=M):M=e[29],M}let u;e[30]===Symbol.for("react.memo_cache_sentinel")?(u=()=>a(!0),e[30]=u):u=e[30];let p;e[31]!==i.online||e[32]!==l?(p=i.online?l("header.linkedDesktopIndicator.desktopLinked"):l("header.linkedDesktopIndicator.connectYourDesktop"),e[31]=i.online,e[32]=l,e[33]=p):p=e[33];let x;e[34]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(We,{size:16}),e[34]=x):x=e[34];let f;e[35]!==i.online?(f=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[35]=i.online,e[36]=f):f=e[36];let g;e[37]!==p||e[38]!==f?(g=s.jsx(je,{asChild:!0,children:s.jsxs(ke,{onClick:u,"aria-label":p,children:[x,f]})}),e[37]=p,e[38]=f,e[39]=g):g=e[39];let h;e[40]!==m?(h=s.jsx(ve,{side:"bottom",children:m}),e[40]=m,e[41]=h):h=e[41];let b;e[42]!==g||e[43]!==h?(b=s.jsxs(ye,{children:[g,h]}),e[42]=g,e[43]=h,e[44]=b):b=e[44];let v;e[45]!==r?(v=s.jsx(mt,{open:r,onOpenChange:a}),e[45]=r,e[46]=v):v=e[46];let y;return e[47]!==v||e[48]!==b?(y=s.jsxs(s.Fragment,{children:[b,v]}),e[47]=v,e[48]=b,e[49]=y):y=e[49],y}class kl extends G.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 wl(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Ml(){const t=I.c(17),e=ae(),{org:n}=Q(),{hasDecoKey:o,balanceDollars:l}=en();if(!o)return null;let i;t[0]!==l?(i=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=i):i=t[1];let r;t[2]!==l?(r=B(l!=null&&wl(l)),t[2]=l,t[3]=r):r=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ys,{}),t[7]=d):d=t[7];let c;t[8]!==l?(c=l!=null?`$${l.toFixed(2)}`:"Credits",t[8]=l,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]!==r||t[14]!==a||t[15]!==m?(u=s.jsx(J,{children:s.jsx(q,{children:s.jsxs(Y,{tooltip:i,className:r,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=r,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function xt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(kl,{children:s.jsx(G.Suspense,{fallback:null,children:s.jsx(Ml,{})})}),t[0]=e):e=t[0],e}function Il(){const t=I.c(14),e=H(),n=ae(),{org:o}=Q();let l;t[0]!==e?(l=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==o.slug?(i=()=>n({to:"/$org/settings",params:{org:o.slug}}),t[2]=n,t[3]=o.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Oe,{}),t[5]=r):r=t[5];let a;t[6]!==e?(a=e("sidebar.sidebarFooter.settings"),t[6]=e,t[7]=a):a=t[7];let d;t[8]!==a?(d=s.jsx("span",{children:a}),t[8]=a,t[9]=d):d=t[9];let c;return t[10]!==l||t[11]!==i||t[12]!==d?(c=s.jsxs(Y,{tooltip:l,onClick:i,children:[r,d]}),t[10]=l,t[11]=i,t[12]=d,t[13]=c):c=t[13],c}function Tl(){const t=I.c(9),e=H(),n=ae(),{org:o}=Q();let l;t[0]!==e?(l=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==o.slug?(i=()=>n({to:"/$org/settings",params:{org:o.slug}}),t[2]=n,t[3]=o.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Oe,{size:15}),t[5]=r):r=t[5];let a;return t[6]!==l||t[7]!==i?(a=s.jsx("button",{type:"button","aria-label":l,onClick:i,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:r}),t[6]=l,t[7]=i,t[8]=a):a=t[8],a}function gt(){const t=I.c(33),e=H(),[n,o]=G.useState(!1),[l,i]=G.useState(!1);let r;t[0]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=r):r=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Gt,{}),t[2]=a):a=t[2];let d;t[3]!==e?(d=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=d):d=t[4];let c;t[5]!==d?(c=s.jsx("span",{children:d}),t[5]=d,t[6]=c):c=t[6];let m;t[7]!==r||t[8]!==c?(m=s.jsx(q,{children:s.jsx(Vt,{trigger:s.jsxs(Y,{tooltip:r,children:[a,c]})})}),t[7]=r,t[8]=c,t[9]=m):m=t[9];let u;t[10]!==e?(u=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=u):u=t[11];let p,x;t[12]===Symbol.for("react.memo_cache_sentinel")?(p=()=>o(!0),x=s.jsx(gn,{}),t[12]=p,t[13]=x):(p=t[12],x=t[13]);let f;t[14]!==e?(f=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=f):f=t[15];let g;t[16]!==f?(g=s.jsx("span",{children:f}),t[16]=f,t[17]=g):g=t[17];let h;t[18]!==u||t[19]!==g?(h=s.jsx(q,{children:s.jsxs(Y,{tooltip:u,onClick:p,children:[x,g]})}),t[18]=u,t[19]=g,t[20]=h):h=t[20];let b;t[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(q,{children:s.jsxs(Y,{tooltip:"Connect to Claude",onClick:()=>{V("connect_studio_opened",{source:"sidebar_footer"}),i(!0)},children:[s.jsx(qt,{}),s.jsx("span",{children:"Connect to Claude"})]})}),t[21]=b):b=t[21];let v;t[22]!==h||t[23]!==m?(v=s.jsxs(J,{className:"gap-0.5",children:[m,h,b]}),t[22]=h,t[23]=m,t[24]=v):v=t[24];let y;t[25]!==n?(y=s.jsx(tn,{open:n,onOpenChange:o,mode:"browse"}),t[25]=n,t[26]=y):y=t[26];let j;t[27]!==l?(j=s.jsx(Cl,{open:l,onOpenChange:i}),t[27]=l,t[28]=j):j=t[28];let _;return t[29]!==v||t[30]!==y||t[31]!==j?(_=s.jsxs(s.Fragment,{children:[v,y,j]}),t[29]=v,t[30]=y,t[31]=j,t[32]=_):_=t[32],_}function bt(){const t=I.c(10),e=H();let n;t[0]!==e?(n=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=n):n=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Gt,{}),t[2]=o):o=t[2];let l;t[3]!==e?(l=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=l):l=t[4];let i;t[5]!==l?(i=s.jsx("span",{children:l}),t[5]=l,t[6]=i):i=t[6];let r;return t[7]!==n||t[8]!==i?(r=s.jsx(J,{className:"gap-0.5",children:s.jsx(q,{children:s.jsx(Vt,{trigger:s.jsxs(Y,{tooltip:n,children:[o,i]})})})}),t[7]=n,t[8]=i,t[9]=r):r=t[9],r}function Pl(){const t=I.c(19),{state:e}=_e(),n=e==="collapsed",o=nt(),l=!o;if(n){let m;t[0]!==o?(m=o?s.jsx(bt,{}):s.jsx(gt,{}),t[0]=o,t[1]=m):m=t[1];let u;t[2]!==l?(u=l&&s.jsx(xt,{}),t[2]=l,t[3]=u):u=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(q,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Ve,{})})}),t[4]=p):p=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(q,{children:s.jsx(Il,{})}),t[5]=x):x=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(J,{children:[p,x,s.jsx(q,{children:s.jsx(qe,{})})]}),t[6]=f):f=t[6];let g;return t[7]!==m||t[8]!==u?(g=s.jsxs(Ge,{className:"px-2 pb-3 gap-1",children:[m,u,f]}),t[7]=m,t[8]=u,t[9]=g):g=t[9],g}let i;t[10]!==o?(i=o?s.jsx(bt,{}):s.jsx(gt,{}),t[10]=o,t[11]=i):i=t[11];let r;t[12]!==l?(r=l&&s.jsx(xt,{}),t[12]=l,t[13]=r):r=t[13];let a;t[14]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{children:s.jsx(Ve,{variant:"full"})}),t[14]=a):a=t[14];let d;t[15]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(J,{className:"gap-0.5",children:[a,s.jsx(q,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(qe,{})}),s.jsx(Tl,{})]})})]}),t[15]=d):d=t[15];let c;return t[16]!==i||t[17]!==r?(c=s.jsxs(Ge,{className:"px-2 pb-3 gap-0.5",children:[i,r,d]}),t[16]=i,t[17]=r,t[18]=c):c=t[18],c}function $l(){const t=I.c(11),e=H(),n=ae(),{org:o}=Q(),{setOpenMobile:l}=_e();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(J,{children:s.jsx(q,{children:s.jsx(qe,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e?(r=e("sidebar.sidebarFooterMobile.settings"),t[1]=e,t[2]=r):r=t[2];let a;t[3]!==n||t[4]!==o.slug||t[5]!==l?(a=()=>{n({to:"/$org/settings",params:{org:o.slug}}),l(!1)},t[3]=n,t[4]=o.slug,t[5]=l,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Oe,{className:"size-4"}),t[7]=d):d=t[7];let c;return t[8]!==r||t[9]!==a?(c=s.jsx(Ge,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ke,{"aria-label":r,onClick:a,children:d})]})}),t[8]=r,t[9]=a,t[10]=c):c=t[10],c}function jt(t){const e=I.c(15),{className:n,wrapperClassName:o,children:l}=t,[i,r]=G.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&r(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 v=b.currentTarget;r(v.scrollHeight-v.scrollTop>v.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==o?(u=B("relative",o),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==l||e[5]!==n?(p=s.jsx("div",{ref:d,onScroll:m,className:n,children:l}),e[4]=l,e[5]=n,e[6]=p):p=e[6];const x=i?"opacity-100":"opacity-0";let f;e[7]!==x?(f=B("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]=f):f=e[8];let g;e[9]!==f?(g=s.jsx("div",{"aria-hidden":!0,className:f}),e[9]=f,e[10]=g):g=e[10];let h;return e[11]!==u||e[12]!==p||e[13]!==g?(h=s.jsxs("div",{className:u,children:[p,g]}),e[11]=u,e[12]=p,e[13]=g,e[14]=h):h=e[14],h}function Al(t){const e=I.c(9),{virtualMcpId:n,size:o,showAutomationBadge:l}=t,i=o===void 0?"sm":o,r=H();let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(zl,{virtualMcpId:n,size:i}):s.jsx(Ce,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let d;e[3]!==l||e[4]!==r?(d=l&&s.jsx("span",{"aria-label":r("tasksPanel.mcpAvatar.automationTriggered"),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(Zt,{size:10,className:"text-white"})}),e[3]=l,e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==a||e[7]!==d?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,d]}),e[6]=a,e[7]=d,e[8]=c):c=e[8],c}function zl(t){const e=I.c(6),{virtualMcpId:n,size:o}=t,l=Yt(n);if(!l){let a;return e[0]!==o?(a=s.jsx(Ce,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=l.icon??null;let r;return e[2]!==l.title||e[3]!==o||e[4]!==i?(r=s.jsx(Ce,{icon:i,name:l.title,size:o}),e[2]=l.title,e[3]=o,e[4]=i,e[5]=r):r=e[5],r}function vt(t){const e=I.c(53),{open:n,onOpenChange:o}=t,[l,i]=G.useState(""),{org:r}=Q(),{setTaskId:a}=Qt(),d=Jt(),c=H();let m,u,p;e[0]!==r.id||e[1]!==l?(p=l.trim(),u=_s,m=Mt.globalSearch(r.id,p),e[0]=r.id,e[1]=l,e[2]=m,e[3]=u,e[4]=p):(m=e[2],u=e[3],p=e[4]);const x=n&&p.length>0;let f;e[5]!==d||e[6]!==p?(f=async()=>await d.call("GLOBAL_SEARCH",{query:p,limit:20}),e[5]=d,e[6]=p,e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==x||e[10]!==f?(g={queryKey:m,enabled:x,queryFn:f,staleTime:1e4},e[8]=m,e[9]=x,e[10]=f,e[11]=g):g=e[11];const{data:h,isFetching:b}=u(g);let v;e[12]!==h?.items?(v=h?.items??[],e[12]=h?.items,e[13]=v):v=e[13];const y=v;let j;e[14]!==o?(j=F=>{F||i(""),o(F)},e[14]=o,e[15]=j):j=e[15];const _=j;let C;e[16]!==_||e[17]!==a?(C=F=>{_(!1),a(F.id,F.virtual_mcp_id??void 0)},e[16]=_,e[17]=a,e[18]=C):C=e[18];const N=C;let S;e[19]!==c?(S=c("tasksPanel.globalSearchDialog.title"),e[19]=c,e[20]=S):S=e[20];let w;e[21]!==S?(w=s.jsx(Ze,{children:S}),e[21]=S,e[22]=w):w=e[22];let k;e[23]!==c?(k=c("tasksPanel.globalSearchDialog.description"),e[23]=c,e[24]=k):k=e[24];let T;e[25]!==k?(T=s.jsx(zt,{children:k}),e[25]=k,e[26]=T):T=e[26];let M;e[27]!==w||e[28]!==T?(M=s.jsxs(Ot,{className:"sr-only",children:[w,T]}),e[27]=w,e[28]=T,e[29]=M):M=e[29];let z;e[30]!==c?(z=c("tasksPanel.globalSearchDialog.placeholder"),e[30]=c,e[31]=z):z=e[31];let $;e[32]!==l||e[33]!==z?($=s.jsx(zn,{value:l,onValueChange:i,placeholder:z}),e[32]=l,e[33]=z,e[34]=$):$=e[34];let A;e[35]!==N||e[36]!==b||e[37]!==y||e[38]!==c||e[39]!==p?(A=p?b&&y.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.searching")}):y.length===0?s.jsx($n,{children:c("tasksPanel.globalSearchDialog.noResults")}):y.map(F=>F.type==="thread"?s.jsxs(An,{value:`thread:${F.id}:${F.title}`,onSelect:()=>N(F),className:"gap-2.5",children:[s.jsx(Al,{virtualMcpId:F.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:F.title||c("tasksPanel.globalSearchDialog.untitledChat")})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(F.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${F.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.startTyping")}),e[35]=N,e[36]=b,e[37]=y,e[38]=c,e[39]=p,e[40]=A):A=e[40];let R;e[41]!==A?(R=s.jsx(On,{children:A}),e[41]=A,e[42]=R):R=e[42];let E;e[43]!==$||e[44]!==R?(E=s.jsxs(En,{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:[$,R]}),e[43]=$,e[44]=R,e[45]=E):E=e[45];let O;e[46]!==M||e[47]!==E?(O=s.jsxs(At,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[M,E]}),e[46]=M,e[47]=E,e[48]=O):O=e[48];let D;return e[49]!==_||e[50]!==n||e[51]!==O?(D=s.jsx(et,{open:n,onOpenChange:_,children:O}),e[49]=_,e[50]=n,e[51]=O,e[52]=D):D=e[52],D}function Ol(t){return t==="ephemeral"||t.startsWith("thread:")}function is(t){const e=I.c(45),{task:n,isActive:o,onClick:l,onArchive:i,showAutomationBadge:r,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=H(),u=Fn(n.status),p=u.icon,x=n.metadata?.kind==="tool_call_run",f=Yt(x?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=sn(f),e[0]=f,e[1]=g):g=e[1];const h=g;Ln(6e4);const b=r||!!n.trigger_id,v=n.id,y="button",j=0;let _;e[2]!==l?(_=K=>{K.target===K.currentTarget&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),l())},e[2]=l,e[3]=_):_=e[3];const C=c?"-ml-4 pl-6":"pl-[7px]",N=o?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==C||e[5]!==N?(S=B("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=S):S=e[6];let w;e[7]!==x||e[8]!==a||e[9]!==f?.icon||e[10]!==f?.title?(w=a&&!x&&s.jsx(Ce,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[7]=x,e[8]=a,e[9]=f?.icon,e[10]=f?.title,e[11]=w):w=e[11];let k;e[12]!==b||e[13]!==m?(k=b&&s.jsx(Zt,{size:12,"aria-label":m("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=b,e[13]=m,e[14]=k):k=e[14];let T;e[15]!==m||e[16]!==n.title?(T=n.title||m("tasksPanel.taskRow.untitledTask"),e[15]=m,e[16]=n.title,e[17]=T):T=e[17];let M;e[18]!==T?(M=s.jsx("div",{className:"text-sm text-foreground truncate",children:T}),e[18]=T,e[19]=M):M=e[19];let z;e[20]!==k||e[21]!==M?(z=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[k,M]}),e[20]=k,e[21]=M,e[22]=z):z=e[22];let $;e[23]!==h||e[24]!==o||e[25]!==n.branch||e[26]!==n.updated_at?($=n.updated_at&&s.jsxs("div",{className:B("flex items-center gap-1 text-[11px] min-w-0",o?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ol(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):h?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[h.owner,"/",h.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Hn(new Date(n.updated_at))})]}),e[23]=h,e[24]=o,e[25]=n.branch,e[26]=n.updated_at,e[27]=$):$=e[27];let A;e[28]!==z||e[29]!==$?(A=s.jsxs("div",{className:"flex-1 min-w-0",children:[z,$]}),e[28]=z,e[29]=$,e[30]=A):A=e[30];const R="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",E=!d&&s.jsx("span",{className:B("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",i&&"group-hover/row:opacity-0"),"aria-label":m("tasksPanel.taskRow.statusLabel",{status:u.label}),children:s.jsx(p,{size:14,className:B(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let O;e[31]!==i||e[32]!==m?(O=i&&s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":m("tasksPanel.taskRow.archiveTask"),onClick:K=>{K.stopPropagation(),i()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ss,{size:14})})}),s.jsx(ve,{side:"right",children:m("tasksPanel.taskRow.archive")})]}),e[31]=i,e[32]=m,e[33]=O):O=e[33];let D;e[34]!==E||e[35]!==O?(D=s.jsxs("div",{className:R,children:[E,O]}),e[34]=E,e[35]=O,e[36]=D):D=e[36];let F;return e[37]!==l||e[38]!==A||e[39]!==D||e[40]!==_||e[41]!==S||e[42]!==w||e[43]!==n.id?(F=s.jsxs("div",{"data-task-id":v,role:y,tabIndex:j,onClick:l,onKeyDown:_,className:S,children:[w,A,D]}),e[37]=l,e[38]=A,e[39]=D,e[40]=_,e[41]=S,e[42]=w,e[43]=n.id,e[44]=F):F=e[44],F}const yt=["requires_action","in_progress","failed","expired","completed"];function El(t){const e=new Map(yt.map(n=>[n,[]]));for(const n of t){const o=n.status??"completed";(e.get(o)??e.get("completed")).push(n)}return yt.map(n=>({status:n,threads:e.get(n)}))}const Dl="sidebar.group.expanded.";function Rl(t,e){const n=I.c(3),[o,l]=ze(`${Dl}${t}`,e);let i;return n[0]!==o||n[1]!==l?(i=[o,l],n[0]=o,n[1]=l,n[2]=i):i=n[2],i}function rs(t){const e=I.c(18),{onClick:n,isFetching:o,indented:l}=t,i=H();let r;e[0]!==i?(r=i("sidebar.showMoreButton.ariaLabel"),e[0]=i,e[1]=r):r=e[1];const a=l?"-ml-4 pl-6 pr-2":"px-2";let d;e[2]!==a?(d=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",a,"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[2]=a,e[3]=d):d=e[3];let c;e[4]!==o?(c=o&&s.jsx(Ns,{size:14,className:"animate-spin"}),e[4]=o,e[5]=c):c=e[5];let m;e[6]!==o||e[7]!==i?(m=i(o?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=o,e[7]=i,e[8]=m):m=e[8];let u;e[9]!==m?(u=s.jsx("span",{children:m}),e[9]=m,e[10]=u):u=e[10];let p;return e[11]!==o||e[12]!==n||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==u?(p=s.jsxs("button",{type:"button","aria-label":r,onClick:n,disabled:o,className:d,children:[c,u]}),e[11]=o,e[12]=n,e[13]=r,e[14]=d,e[15]=c,e[16]=u,e[17]=p):p=e[17],p}function Fl(t,e,n,o){return[t,e,n,o.type,o.member,o.currentUserId??""].join("|")}function Ll(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Pe=0;const Ye=[];function Gl(){for(;Pe<as&&Ye.length>0;){const t=Ye.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const o=()=>{Pe++,t().then(e,n).finally(()=>{Pe--,Gl()})};Pe<as?o():Ye.push(o)})}const Ee=10;function _t(t,e,n,o,l){const i={hidden:!1};o.member==="mine"&&o.currentUserId&&(i.created_by=o.currentUserId),o.type==="automation"&&(i.has_trigger=!0),o.type==="manual"&&(i.has_trigger=!1);const r={where:i,limit:l,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return r.status=e,r}function Hl(t,e,n,o){let l=0;for(const i of t)ds(i,e,n,o)&&l++;return l}function Fe(t,e,n,o){return Hl(t,e,n,o)}function Bl(t,e){return!!(t>=Ee||t===0&&e)}function St(t,e){return t<e}function Ul(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,o){return!(t.hidden||(t.status??"completed")!==n||o.member==="mine"&&o.currentUserId&&t.created_by!==o.currentUserId||o.type==="automation"&&!t.trigger_id||o.type==="manual"&&t.trigger_id)}const Ae=new Map,Te=new Map;function Wl(t,e){return e?t>=Ee?!0:null:!1}function Nt(t){return Ae.get(t)}function Kl(t,e){Ae.set(t,e)}function ql(t,e,n){const o=Ae.get(t);if(o!==void 0){n(o);return}let l=Te.get(t);l||(l=cs(e).then(i=>(Ae.set(t,i),Te.delete(t),i)).catch(()=>(Te.delete(t),Promise.reject(new Error("group probe failed")))),Te.set(t,l)),l.then(n,()=>n(!1))}function Ct(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ee,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Vl(t,e,n,o,l){let i=0;for(const r of t)e.has(r.id)||ds(r,n,o,l)&&i++;return i}function Yl(t,e,n,o){const l=I.c(8),{org:i}=Q(),r=Fl(i.id,t,e,n);let a;l[0]!==n?(a=Ll(n),l[0]=n,l[1]=a):a=l[1];const d=a,[c,m]=G.useState({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==r&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});const u=Mn(),{threads:p,hasMore:x}=Xt(),f=Fe(p,t,e,n),g=Bl(f,x),h=Wl(f,x),b=Jt();if(c.identity===r&&c.serverHasMore===null){const N=h??Nt(r);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===r&&c.serverHasMore===null&&h===null&&Nt(r)===void 0&&c.probeSubscribedIdentity!==r&&(m(N=>N.identity===r?{...N,isProbing:!0,probeSubscribedIdentity:r}:N),ql(r,async()=>{const N=_t(t,e,0,n,1),S=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:w}=Ct(S),k=Fe(u.threads.get(),t,e,n);return w===void 0?!1:St(k,w)},N=>{m(S=>S.identity!==r?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=r;m(w=>w.identity===S?{...w,isFetching:!0}:w);try{const w=Fe(p,t,e,n),k=_t(t,e,w,n,Ee),T=await cs(()=>b.call("COLLECTION_THREADS_LIST",k)),{items:M,hasMore:z,totalCount:$}=Ct(T),A=new Set(p.map(Xl)),R=Vl(M,A,t,e,n),E=w;u.mergeThreads(M),m(O=>{if(O.identity!==S)return O;let D;return $!==void 0?D=St(E+R,$):D=M.length===0||R===0?!1:z,Kl(S,D),{...O,isFetching:!1,serverHasMore:D}})}catch(w){const k=w,T=k instanceof Error?k.message:String(k);ce.error(`Could not load more tasks: ${T}`),m(M=>M.identity===S?{...M,isFetching:!1}:M)}},j=c.isFetching||c.isProbing,_=!d&&!j&&Ul(g,c.serverHasMore);let C;return l[2]!==j||l[3]!==y||l[4]!==_||l[5]!==c.isProbing||l[6]!==c.serverHasMore?(C={hasMore:_,isFetching:j,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},l[2]=j,l[3]=y,l[4]=_,l[5]=c.isProbing,l[6]=c.serverHasMore,l[7]=C):C=l[7],C}function Xl(t){return t.id}function Ql(t){const e=I.c(20),{status:n,threads:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:p,serverHasMore:x}=Yl("status",n,d),[f,g]=G.useState(!1);!f&&o.length===0&&x===!0&&!c&&!m&&(g(!0),queueMicrotask(()=>{u()}));let h;if(e[0]!==l||e[1]!==a||e[2]!==d||e[3]!==r||e[4]!==i||e[5]!==o){let y;e[7]!==l||e[8]!==a||e[9]!==d||e[10]!==r||e[11]!==i?(y=j=>s.jsx(is,{task:j,isActive:l===j.id,onClick:()=>i(j),onArchive:a&&j.created_by===d.currentUserId?()=>r(j):void 0,showAutomationBadge:!!j.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},j.id),e[7]=l,e[8]=a,e[9]=d,e[10]=r,e[11]=i,e[12]=y):y=e[12],h=o.map(y),e[0]=l,e[1]=a,e[2]=d,e[3]=r,e[4]=i,e[5]=o,e[6]=h}else h=e[6];let b;e[13]!==p||e[14]!==c||e[15]!==u?(b=(p||c)&&s.jsx(rs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=p,e[14]=c,e[15]=u,e[16]=b):b=e[16];let v;return e[17]!==h||e[18]!==b?(v=s.jsxs(s.Fragment,{children:[h,b]}),e[17]=h,e[18]=b,e[19]=v):v=e[19],v}function Jl(t){const e=I.c(36),{status:n,threads:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,c=Gn[n],m=c.icon,[u,p]=Rl(`status-${n}`,!1);let x;e[0]!==u||e[1]!==p?(x=function(){p(!u)},e[0]=u,e[1]=p,e[2]=x):x=e[2];const f=x;let g;e[3]!==f?(g=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),f())},e[3]=f,e[4]=g):g=e[4];let h;e[5]!==m||e[6]!==c.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=h):h=e[7];let b;e[8]!==u?(b=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Bn,{size:14}):s.jsx(Ft,{size:14})}),e[8]=u,e[9]=b):b=e[9];let v;e[10]!==h||e[11]!==b?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,b]}),e[10]=h,e[11]=b,e[12]=v):v=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let j;e[15]!==o.length?(j=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:o.length})}),e[15]=o.length,e[16]=j):j=e[16];let _;e[17]!==u||e[18]!==f||e[19]!==g||e[20]!==v||e[21]!==y||e[22]!==j?(_=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:f,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[v,y,j]}),e[17]=u,e[18]=f,e[19]=g,e[20]=v,e[21]=y,e[22]=j,e[23]=_):_=e[23];let C;e[24]!==l||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==r||e[29]!==i||e[30]!==n||e[31]!==o?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Ql,{status:n,threads:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d})}),e[24]=l,e[25]=a,e[26]=u,e[27]=d,e[28]=r,e[29]=i,e[30]=n,e[31]=o,e[32]=C):C=e[32];let N;return e[33]!==_||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[_,C]}),e[33]=_,e[34]=C,e[35]=N):N=e[35],N}function kt(t){const e=I.c(38),{threads:n,groupBy:o,activeTaskId:l,onSelectTask:i,onArchiveTask:r,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(Rn,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const b=u?"No chats match your filters":"No chats yet";let v;return e[1]!==b?(v=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:b})]}),e[1]=b,e[2]=v):v=e[2],v}const p=n.length>1||d;if(o==="status"){let h;if(e[3]!==l||e[4]!==p||e[5]!==a||e[6]!==r||e[7]!==i||e[8]!==n){let v;e[10]!==l||e[11]!==p||e[12]!==a||e[13]!==r||e[14]!==i?(v=y=>s.jsx(Jl,{status:y.status,threads:y.threads,activeTaskId:l,onSelectTask:i,onArchiveTask:r,canArchive:p,filters:a},y.status),e[10]=l,e[11]=p,e[12]=a,e[13]=r,e[14]=i,e[15]=v):v=e[15],h=El(n).map(v),e[3]=l,e[4]=p,e[5]=a,e[6]=r,e[7]=i,e[8]=n,e[9]=h}else h=e[9];let b;return e[16]!==h?(b=s.jsx(s.Fragment,{children:h}),e[16]=h,e[17]=b):b=e[17],b}let x;if(e[18]!==l||e[19]!==p||e[20]!==a||e[21]!==r||e[22]!==i||e[23]!==n){let h;e[25]!==l||e[26]!==p||e[27]!==a||e[28]!==r||e[29]!==i?(h=b=>s.jsx(is,{task:b,isActive:l===b.id,onClick:()=>i(b),onArchive:p&&b.created_by===a.currentUserId?()=>r(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=l,e[26]=p,e[27]=a,e[28]=r,e[29]=i,e[30]=h):h=e[30],x=n.map(h),e[18]=l,e[19]=p,e[20]=a,e[21]=r,e[22]=i,e[23]=n,e[24]=x}else x=e[24];let f;e[31]!==d||e[32]!==c||e[33]!==m?(f=(d||c)&&s.jsx(rs,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=f):f=e[34];let g;return e[35]!==x||e[36]!==f?(g=s.jsxs(s.Fragment,{children:[x,f]}),e[35]=x,e[36]=f,e[37]=g):g=e[37],g}function Zl(t,e,n){if(!n)return;const o=t.findIndex(l=>l.id===e);if(o!==-1){for(let l=o+1;l<t.length;l++){const i=t[l];if(i?.created_by===n)return i}for(let l=o-1;l>=0;l--){const i=t[l];if(i?.created_by===n)return i}}}function wt(t){const e=I.c(17),{label:n,onClick:o,active:l,children:i}=t,[r,a]=G.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 p=l&&"bg-sidebar-accent text-foreground";let x;e[4]!==p?(x=B("md:size-[34px] rounded-lg",p),e[4]=p,e[5]=x):x=e[5];let f;e[6]!==i||e[7]!==n||e[8]!==o||e[9]!==x?(f=s.jsx(je,{asChild:!0,children:s.jsx(ke,{"aria-label":n,onClick:o,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:i})}),e[6]=i,e[7]=n,e[8]=o,e[9]=x,e[10]=f):f=e[10];let g;e[11]!==n?(g=s.jsx(ve,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let h;return e[13]!==r||e[14]!==f||e[15]!==g?(h=s.jsxs(ye,{open:r,children:[f,g]}),e[13]=r,e[14]=f,e[15]=g,e[16]=h):h=e[16],h}function Le(t){const e=I.c(13),{label:n,value:o,onChange:l,options:i}=t;let r;e[0]!==n?(r=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==l?(a=u=>u&&l(u),e[2]=l,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(eo),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==o?(c=s.jsx(kn,{type:"single",size:"sm",value:o,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]=o,e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r,c]}),e[10]=r,e[11]=c,e[12]=m):m=e[12],m}function eo(t){return s.jsxs(Cn,{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 ms({onNavigate:t}={}){const e=H(),{data:n}=$e.useSession(),o=n?.user?.id,{org:l}=Q(),i=Dt({connectionId:Rt,orgId:l.id,orgSlug:l.slug}),r=rt(l.id).id,a=wn(),{threads:d,hasMore:c,isFetchingMore:m,fetchNextPage:u}=Xt(),p=d.filter(P=>!P.hidden),{hide:x,setScope:f}=In(),g=ae(),{setTaskId:h,createNewTask:b}=Qt(),v=Cs({strict:!1}),y=It({strict:!1}),j=v.taskId??null,_=y.virtualmcpid??d.find(P=>P.id===j)?.virtual_mcp_id??null,C=()=>{t?.()},N=[...p].sort((P,L)=>(L.updated_at??"").localeCompare(P.updated_at??"")),[S,w]=G.useState("all"),[k,T]=G.useState("flat"),[M,z]=ze("sidebar-threads-scope-all",!1),[$,A]=G.useState(!1),[R,E]=G.useState(!1),O={type:S,member:"mine",currentUserId:o??null},D={};M||(D.created_by="me"),f(D);const F=P=>o?P.filter(L=>L.created_by===o):[],K=P=>S==="automation"?P.filter(L=>!!L.trigger_id):S==="manual"?P.filter(L=>!L.trigger_id):P,Z=F(N),ne=K(Z),de=K(N),le=M?de:ne,ee=P=>{if(o&&P.created_by&&P.created_by!==o)return;const L=P.id===j;if(x(P.id),Pn(P.id),!L)return;const W=Zl(le,P.id,o);C(),W?h(W.id,W.virtual_mcp_id):g({to:"/$org",params:{org:l.slug}})},oe=P=>{C(),h(P.id,P.virtual_mcp_id)},me=async P=>{try{const L=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P,limit:1,offset:0}});return((L.structuredContent??L).items?.length??0)===0}catch{return!1}},Se=async()=>{const P=_??r;V("sidebar_new_thread_clicked",{virtual_mcp_id:P});const L=Z.find(W=>W.virtual_mcp_id===P&&W.title==="New chat");if(L&&await me(L.id)){C(),h(L.id,P);return}C(),b(P)},{state:ue,isMobile:fe,toggleSidebar:pe}=_e();if(ue==="collapsed"&&!fe){const P=rt(l.id),L=new Map((a??[]).map(U=>[U.id,U])),W=U=>(U?L.get(U):void 0)??(U===r?P:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(nn,{orgParam:l.slug,side:"right",align:"start",trigger:s.jsx(Y,{tooltip:l.name,children:s.jsx(ln,{org:l,size:"sm"})})})}),s.jsxs(J,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(q,{children:s.jsx(Y,{"aria-label":e("sidebar.taskGroupsList.toggleSidebar"),tooltip:e("sidebar.taskGroupsList.toggleSidebar"),onClick:pe,children:s.jsx(Ht,{size:16})})}),le.map(U=>{const re=W(U.virtual_mcp_id);return s.jsx(q,{children:s.jsx(Y,{"aria-label":U.title||e("sidebar.taskGroupsList.newChat"),tooltip:U.title||e("sidebar.taskGroupsList.newChat"),isActive:U.id===j,onClick:()=>oe(U),children:s.jsx(Ce,{icon:re?.icon??null,name:re?.title??"Agent",size:"xs"})})},U.id)})]})]})}const X=k!=="flat"||S!=="all"||M===!0,he=s.jsxs(Bt,{children:[s.jsxs(ye,{children:[s.jsx(je,{asChild:!0,children:s.jsx(Ut,{asChild:!0,children:s.jsxs(ke,{"aria-label":e("sidebar.taskGroupsList.filterChats"),active:X,className:"md:size-[34px] rounded-lg",children:[s.jsx(Nn,{size:16}),X&&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:e("sidebar.taskGroupsList.filterChats")})]}),s.jsxs(Wt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Le,{label:e("sidebar.taskGroupsList.filterView"),value:k,onChange:P=>{V("tasks_panel_group_by_changed",{to_value:P}),T(P)},options:[{value:"flat",label:e("sidebar.taskGroupsList.viewList"),icon:s.jsx(Xs,{size:13})},{value:"status",label:e("sidebar.taskGroupsList.viewStatus"),icon:s.jsx(Qs,{size:13})}]}),s.jsx(Le,{label:e("sidebar.taskGroupsList.filterType"),value:S,onChange:P=>{V("tasks_panel_filter_changed",{to_value:P}),w(P)},options:[{value:"all",label:e("sidebar.taskGroupsList.typeAll")},{value:"manual",label:e("sidebar.taskGroupsList.typeChats")},{value:"automation",label:e("sidebar.taskGroupsList.typeAuto")}]}),s.jsx(Le,{label:e("sidebar.taskGroupsList.filterScope"),value:M?"team":"mine",onChange:P=>z(P==="team"),options:[{value:"mine",label:e("sidebar.taskGroupsList.scopeMine")},{value:"team",label:e("sidebar.taskGroupsList.scopeTeam")}]})]})]}),te=P=>s.jsx(Kt,{delayDuration:300,children:s.jsxs("div",{className:B("shrink-0 flex items-center justify-between",P?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!P&&s.jsx(es,{className:"md:size-[34px] rounded-lg"}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(wt,{label:e("sidebar.taskGroupsList.searchChats"),onClick:()=>{V("tasks_panel_search_opened"),E(!0),A(!0)},children:s.jsx(Js,{size:16})}),s.jsx(wt,{label:e("sidebar.taskGroupsList.newChat"),onClick:()=>{Se()},children:s.jsx(Zs,{size:16})})]})]})});return fe?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[te(!0),s.jsx(jt,{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(kt,{threads:le,groupBy:k,activeTaskId:j,onSelectTask:oe,onArchiveTask:ee,filters:O,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:X})}),R&&s.jsx(vt,{open:$,onOpenChange:A})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[te(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(jt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(kt,{threads:le,groupBy:k,activeTaskId:j,onSelectTask:oe,onArchiveTask:ee,filters:O,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:X})})}),R&&s.jsx(vt,{open:$,onOpenChange:A})]})}const to=5,so=[{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 us(){const t=I.c(3),{state:e}=_e();if(e==="collapsed"){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:to}).map(oo)}),t[0]=l):l=t[0],l}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(se,{className:"size-6 rounded-md"}),s.jsx(se,{className:"size-6 rounded-md"}),s.jsx(se,{className:"size-6 rounded-md"})]}),s.jsx(se,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=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:so.map(no)})]}),t[2]=o):o=t[2],o}function no(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(se,{className:"size-5 rounded-full shrink-0"}),s.jsx(se,{className:B("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(lo)})]},e)}function lo(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(se,{className:"h-3 flex-1 rounded-sm"})},e)}function oo(t,e){return s.jsx(se,{className:"size-10 rounded-lg mx-auto"},e)}function io(){const t=I.c(2);if(nt()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(He,{showName:!0}),t[0]=o):o=t[0],o}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(He,{}),s.jsx(st,{})]}),t[1]=n):n=t[1],n}function ro(){const t=I.c(5),e=ss();let n,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Pl,{}),o=s.jsx(io,{}),t[0]=n,t[1]=o):(n=t[0],o=t[1]);let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Xe,{children:s.jsx(G.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[2]=l):l=t[2];let i;return t[3]!==e?(i=s.jsx(ts,{children:s.jsx(os,{sections:e,footer:n,header:o,additionalContent:l})}),t[3]=e,t[4]=i):i=t[4],i}function ao(t){const e=I.c(8),{onClose:n}=t,o=ss();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx($l,{}),e[0]=l):l=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(us,{}),e[1]=i):i=e[1];let r;e[2]!==n?(r=s.jsx(Xe,{children:s.jsx(G.Suspense,{fallback:i,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(ts,{children:s.jsx(ul,{sections:o,onClose:n,footer:l,additionalContent:r})}),e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}const co="sidebar.open";function mo(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ws,{}),t[0]=e):e=t[0],e}function wr(){const t=I.c(37),e=$t(),n=nt();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const{connect:l,siteUrl:i}=It(o),r=l==="1",[a,d]=ze(co,!1),{width:c,wrapperRef:m,onStartResize:u,resetWidth:p}=ll(),x=e;let f;t[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(es,{}),t[1]=f):f=t[1];let g;t[2]!==n?(g=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(st,{})}),t[2]=n,t[3]=g):g=t[3];let h,b,v,y,j;t[4]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ve,{}),b=s.jsx(xe.TogglesSlot,{}),v=s.jsx(xe.TabsSlot,{className:"shrink-0"}),y=s.jsx(xe.CenterSlot,{}),j=s.jsx(xe.RightSlot,{}),t[4]=h,t[5]=b,t[6]=v,t[7]=y,t[8]=j):(h=t[4],b=t[5],v=t[6],y=t[7],j=t[8]);let _;t[9]!==g?(_=s.jsx(xe.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[f,g,h,b,v,y,j]})}),t[9]=g,t[10]=_):_=t[10];const C=_;let N;t[11]===Symbol.for("react.memo_cache_sentinel")?(N={background:"transparent",containerType:"inline-size"},t[11]=N):N=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ts,{className:"flex flex-col min-h-0",style:N,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(G.Suspense,{fallback:s.jsx(mo,{}),children:s.jsx(ks,{})})})})}),t[12]=S):S=t[12];const w=S,k=x&&C,T=`${c}px`;let M;t[13]!==T?(M={"--sidebar-width":T,"--sidebar-width-icon":"3.125rem"},t[13]=T,t[14]=M):M=t[14];const z=M;let $;t[15]!==e||t[16]!==u||t[17]!==p?($=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ro,{}),s.jsx(tl,{onPointerDown:u,onDoubleClick:p})]}),t[15]=e,t[16]=u,t[17]=p,t[18]=$):$=t[18];let A;t[19]!==z||t[20]!==$||t[21]!==m?(A=s.jsxs(Ps,{ref:m,className:"flex-1 bg-sidebar relative min-h-0",style:z,children:[$,w]}),t[19]=z,t[20]=$,t[21]=m,t[22]=A):A=t[22];let R;t[23]!==e?(R=e&&s.jsx(Dn,{renderSidebar:uo}),t[23]=e,t[24]=R):R=t[24];let E;t[25]!==i||t[26]!==r?(E=r&&s.jsx(Xn,{siteUrl:i}),t[25]=i,t[26]=r,t[27]=E):E=t[27];let O;t[28]!==k||t[29]!==A||t[30]!==R||t[31]!==E?(O=s.jsx(_n,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[k,A,R,E]})}),t[28]=k,t[29]=A,t[30]=R,t[31]=E,t[32]=O):O=t[32];let D;return t[33]!==d||t[34]!==a||t[35]!==O?(D=s.jsx(Tn,{children:s.jsx(xe.Provider,{children:s.jsx($s,{open:a,onOpenChange:d,children:O})})}),t[33]=d,t[34]=a,t[35]=O,t[36]=D):D=t[36],D}function uo(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(ao,{onClose:e})})})}export{wr as default};
@@ -1,4 +1,4 @@
1
- import{c as Me,r as ie,d as os,F as Tt,b as Ge,j as t,B as xe,t as Qe,m as qe,K as Qt,n as rs,z as Es,u as As,p as Wt,E as Vs}from"./index-D0GbPI_R.js";import{S as Ks}from"./search-input-DHMmvRu9.js";import{P as et}from"./index-25tDLcHQ.js";import{E as is}from"./empty-state-t-xxj99b.js";import{R as Us}from"./require-capability-2rozIXBv.js";import{x as ms,n as qs,y as Bs,z as us,B as Xt,D as qt,E as ys,H as Hs,I as fs,J as ws,A as Js,K as Qs}from"./automation-runs-CjoeGDB3.js";import{u as ts}from"./use-connection-D67Pe6aW.js";import{g as Ss}from"./connection-slug-eyAPH6o3.js";import{B as kt}from"./badge-rSCRRNZZ.js";import{P as $t,a as zt,b as Et}from"./popover-BqPUB_i2.js";import{c as Bt,T as Ht,a as Jt}from"./tooltip-CZxZ-Bns.js";import{i as Yt}from"./Check-dpauEaNI.js";import{a as Kt}from"./Copy01-DDeCwAgK.js";import{n as xs,a as At}from"./Tool02-BK6vOVj2.js";import{i as ns}from"./FilterLines-CxHovx4d.js";import{i as Gs}from"./Key01-D7-mKS4d.js";import{i as Ws}from"./Play-C5qDNLgC.js";import{aP as Xs,a2 as Ys,a8 as Zs}from"./agent-icon-ZuDh9-Hb.js";import{M as ps}from"./monaco-editor-3ZmYAdL5.js";import{u as el}from"./use-members-BBMl3rpc.js";import{S as tl,u as sl,W as ll}from"./use-mcp-client-2qqsLKMv.js";import{a as ol}from"./use-virtual-mcp-DYkiFIJC.js";import{c as rl}from"./SwitchHorizontal01-D9GLmxcG.js";import{s as il}from"./Plus-C7p4TBsq.js";import{s as nl}from"./Trash01-CZfSiRn_.js";import{I as Dt}from"./input-Bb4p9_ik.js";import{M as Rt}from"./multi-select-CCg5PDqH.js";import{a as Pt,b as Ft,d as He,c as _t,S as Ot}from"./select-JTf4HMkB.js";import{t as Is}from"./ChevronDown-BQLnN9E6.js";import{s as al}from"./Stars02-CV1WX5s1.js";import{C as cl}from"./calendar-B4BM6mn9.js";import{T as dl}from"./textarea-BDUOK9v4.js";import{C as ks}from"./collection-tabs-0Qyek4_u.js";import{S as ml}from"./switch-RfqMPlNx.js";import{L as ul}from"./label-5xpx6MdG.js";import{I as Ct}from"./integration-icon-bG23TCVO.js";import{A as Cs}from"./avatar-BaVe5mnj.js";import{A as fl,a as xl,b as pl}from"./alert-DktlcBN9.js";import{C as Ts}from"./card-CCT9DM3i.js";import{K as Ye}from"./monitoring-stats-row-D-FdpFBv.js";import{u as Ms}from"./studio-tools-CVP_bYI3.js";import{u as gl}from"./useSuspenseInfiniteQuery-DOVA9lC8.js";import{o as hl,m as vl,p as jl,q as Nl}from"./sidebar-JCplCzUs.js";import{T as tt,a as Gt,b as Ls,c as Ds,d as Ee,e as Rs}from"./table-CkAONPU-.js";import{n as bl}from"./ChevronUp-DQvrAigY.js";import{u as yl}from"./use-infinite-scroll-CUTwghko.js";import{c as wl,b as Sl}from"./use-automations-DMIHt0qx.js";import"./SearchMd-CFZ8th88.js";import"./use-capability-C9LPdJIR.js";import"./access-gate-B5Uu6KI_.js";import"./capability-load-error-C19nQZEJ.js";import"./useInfiniteQuery-DwwDCJAw.js";import"./use-clock-tick-CF0pPFJP.js";import"./AlertCircle-Cpl_iMHY.js";import"./CheckCircle-zW46MQTo.js";import"./DotsVertical-Bj4PS0aF.js";import"./XCircle-Bw2f1-oB.js";import"./Stars01-CwezkrCj.js";import"./ArrowRight-NqG0gPh-.js";import"./ChevronRight-CyiD6-MW.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-3pbdZZcV.js";import"./dialog-C1Qgh1pV.js";import"./X-Ds6dL0ec.js";import"./use-mobile-orl9RI6e.js";import"./tab-id-6SxTM-85.js";import"./hooks-BRAlfwVg.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-zU_w0iZh.js";import"./chat-context-BBbr98oD.js";import"./use-ai-providers-RLFjMIPM.js";import"./use-decopilot-events-DqMtcih3.js";import"./use-organization-settings-DcpRbwzw.js";import"./index-C_mT0QTy.js";import"./Eye-Dfg-461O.js";import"./Star01-b06OrJx9.js";import"./XClose-CggKQboo.js";import"./ZapSquare-CULLx7Oa.js";import"./Tool01-CbNqThfz.js";import"./Monitor01-DEsYEg9j.js";import"./Upload01-OvmEXaXy.js";import"./shell-layout-BX_6t6Y4.js";import"./Users03-CMTgzssO.js";import"./SearchLg-BP6dxoOu.js";import"./Zap-cm7wIsil.js";import"./required-auth-layout-pINrUhAT.js";import"./use-org-sso-D-Dpc7wL.js";import"./LinkExternal01-DtG8qR-V.js";import"./ArrowUpRight-CtURRnV0.js";import"./Palette-3AyXb_ds.js";import"./use-navigate-to-agent-BL6ciQ9Y.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BqFUuFcm.js";import"./form-Bcx3Dx5v.js";import"./ArrowUp-DMJUikwr.js";import"./Settings02-BRYke4o3.js";import"./TrendUp01-CbzGmSk7.js";import"./HardDrive-C67jRlzv.js";import"./LayoutLeft-Dnk9I__a.js";import"./LogOut01-Bv49wu0L.js";import"./Sun-BYgqmEv8.js";import"./Shield01-DObW8vGC.js";import"./User01-mA16LPDW.js";import"./Users01-D3kMDHBl.js";import"./use-org-auth-client-nWz-MFtZ.js";import"./auth--O1w_iKV.js";import"./checkbox-Bq4_WPl3.js";import"./command-2wvo7x41.js";import"./index-CRfJJjBr.js";const ss={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},Il=["eq","contains","exists","in"];function kl(s){return Il.includes(s)}function st(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Cl(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...d]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&kl(i)?i:"eq",value:decodeURIComponent(d.join(":")||"")}}).filter(e=>e!==void 0)}function Ut(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as Me,r as ie,d as os,F as Tt,b as Ge,j as t,B as xe,t as Qe,m as qe,K as Qt,n as rs,z as Es,u as As,p as Wt,E as Vs}from"./index-D7ecmoEk.js";import{S as Ks}from"./search-input-yjiuaHAG.js";import{P as et}from"./index-BGBjg2-p.js";import{E as is}from"./empty-state-CJ5pANud.js";import{R as Us}from"./require-capability-BiIETUd1.js";import{x as ms,n as qs,y as Bs,z as us,B as Xt,D as qt,E as ys,H as Hs,I as fs,J as ws,A as Js,K as Qs}from"./automation-runs-DIhCKhoX.js";import{u as ts}from"./use-connection-BVFqG9Id.js";import{g as Ss}from"./connection-slug-eyAPH6o3.js";import{B as kt}from"./badge-Caz53JSJ.js";import{P as $t,a as zt,b as Et}from"./popover-uYC-XEIg.js";import{c as Bt,T as Ht,a as Jt}from"./tooltip-DV8_wP4H.js";import{i as Yt}from"./Check-C-gVe66h.js";import{a as Kt}from"./Copy01-CXOBuKeI.js";import{n as xs,a as At}from"./Tool02-CBXM0F92.js";import{i as ns}from"./FilterLines-Cmyrpv9O.js";import{i as Gs}from"./Key01-DsAMFomV.js";import{i as Ws}from"./Play-DgsbjMDE.js";import{aP as Xs,a2 as Ys,a8 as Zs}from"./agent-icon-zWW3t6VG.js";import{M as ps}from"./monaco-editor-BgAWurBW.js";import{u as el}from"./use-members-SNaM7f-x.js";import{S as tl,u as sl,W as ll}from"./use-mcp-client-CnyXhKwV.js";import{a as ol}from"./use-virtual-mcp-qSYuKLW8.js";import{c as rl}from"./SwitchHorizontal01-CGOv_Rrr.js";import{s as il}from"./Plus--3XFCNRh.js";import{s as nl}from"./Trash01-CJ9K1v0c.js";import{I as Dt}from"./input-Dc_Ksu2B.js";import{M as Rt}from"./multi-select-CfZlB5Qw.js";import{a as Pt,b as Ft,d as He,c as _t,S as Ot}from"./select-o--wOfO_.js";import{t as Is}from"./ChevronDown-CHUXS0bx.js";import{s as al}from"./Stars02-DXc-e3hC.js";import{C as cl}from"./calendar-DDRNxoxt.js";import{T as dl}from"./textarea-BJyqw4SL.js";import{C as ks}from"./collection-tabs-CkE9QnXQ.js";import{S as ml}from"./switch-JdJblN-W.js";import{L as ul}from"./label-C7DWPW8F.js";import{I as Ct}from"./integration-icon-Bep1O6vd.js";import{A as Cs}from"./avatar-BLfSxUga.js";import{A as fl,a as xl,b as pl}from"./alert-CG7QTVbj.js";import{C as Ts}from"./card-MKJv9EQN.js";import{K as Ye}from"./monitoring-stats-row-Bm74hEZ0.js";import{u as Ms}from"./studio-tools-BnkAV7Qh.js";import{u as gl}from"./useSuspenseInfiniteQuery-BjnR7v75.js";import{o as hl,m as vl,p as jl,q as Nl}from"./sidebar-BVI_V0Ou.js";import{T as tt,a as Gt,b as Ls,c as Ds,d as Ee,e as Rs}from"./table-BsxxkDds.js";import{n as bl}from"./ChevronUp-DbJPy-my.js";import{u as yl}from"./use-infinite-scroll-DaBbmjUW.js";import{c as wl,b as Sl}from"./use-automations-DKxhc36V.js";import"./SearchMd-Db6xGpMm.js";import"./use-capability-ev2jDwzE.js";import"./access-gate-wIXn4O0u.js";import"./capability-load-error-CQIupxYq.js";import"./useInfiniteQuery-BRBbsKnZ.js";import"./use-clock-tick-CdvZtpVB.js";import"./AlertCircle-wZFBWpo0.js";import"./CheckCircle-DwQTzzLo.js";import"./DotsVertical-DSuOWFkK.js";import"./XCircle-Cnd7dAXs.js";import"./Stars01-6mAfYED3.js";import"./ArrowRight-DDYoySSU.js";import"./ChevronRight-BewiR8jv.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ChgQcxSu.js";import"./dialog-Bx0tkWaQ.js";import"./X-BB9BsBG9.js";import"./use-mobile-BvPCUKE_.js";import"./tab-id-BUyXQAAI.js";import"./hooks--vfnlMbG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Cs4Wzcc3.js";import"./chat-context-CS8lxm9_.js";import"./use-ai-providers-CGmpPHf_.js";import"./use-decopilot-events-hTj_0wvh.js";import"./use-organization-settings-BIY_uMId.js";import"./index-D7Rza1Tk.js";import"./Eye-BzQwpriV.js";import"./Star01-6fXqBYGO.js";import"./XClose-DYcmy7Dm.js";import"./ZapSquare-l2Bo-FFh.js";import"./Tool01-pmII3WpR.js";import"./Monitor01-BDL-jnJs.js";import"./Upload01-dYbrTK96.js";import"./shell-layout-Bp9VqH1i.js";import"./Users03-X_nEGPVF.js";import"./SearchLg-fj8vBgbf.js";import"./Zap-CjDEO_x2.js";import"./required-auth-layout-CWsSFaCw.js";import"./use-org-sso-DRXrpsuQ.js";import"./LinkExternal01-B0YPc_S1.js";import"./ArrowUpRight-CX0JFgau.js";import"./Palette-BAqGRxp5.js";import"./use-navigate-to-agent-mziLMlnK.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BWG_A2yL.js";import"./form-Du5MP186.js";import"./ArrowUp-BfmJVXpe.js";import"./Settings02-BCqIMlR1.js";import"./TrendUp01-BjARk23u.js";import"./HardDrive-MuN_hYGO.js";import"./LayoutLeft-BKoIFwRN.js";import"./LogOut01-Cr7guD_C.js";import"./Sun-BUqEkjZt.js";import"./Shield01-DmJb3xyD.js";import"./User01-BWh29jlX.js";import"./Users01-CVpagA8a.js";import"./use-org-auth-client-D-a5lzlz.js";import"./auth-_9lv2gUI.js";import"./checkbox-PaZ4NcMV.js";import"./command-BtKeqRh4.js";import"./index-CGW3LfG6.js";const ss={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},Il=["eq","contains","exists","in"];function kl(s){return Il.includes(s)}function st(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Cl(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...d]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&kl(i)?i:"eq",value:decodeURIComponent(d.join(":")||"")}}).filter(e=>e!==void 0)}function Ut(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function gs(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...i]=e.split("=");return{key:l||"",operator:"eq",value:i.join("=")}}if(e.includes("~")){const[l,...i]=e.split("~");return{key:l||"",operator:"contains",value:i.join("~")}}if(e.includes("@")){const[l,...i]=e.split("@");return{key:l||"",operator:"in",value:i.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Tl(s){const e={},l={},i=[],d={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":i.push(n.key);break;case"in":n.value&&(d[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:i.length>0?i:void 0,propertyInValues:Object.keys(d).length>0?d:void 0}}function hs(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const i=l.length;return i<=ss.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:i}:{content:l.slice(0,ss.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{c as g,f as p,j as s,k as u,N as a}from"./index-D0GbPI_R.js";import{a as x}from"./use-capability-C9LPdJIR.js";import{C as j}from"./capability-load-error-C19nQZEJ.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:c}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{c as g,f as p,j as s,k as u,N as a}from"./index-D7ecmoEk.js";import{a as x}from"./use-capability-ev2jDwzE.js";import{C as j}from"./capability-load-error-CQIupxYq.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:c}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(c){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1 +1 @@
1
- import{c as s,m as a,j as d}from"./index-D0GbPI_R.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{c as s,m as a,j as d}from"./index-D7ecmoEk.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{c as k,j as h,r as C,m as L}from"./index-D0GbPI_R.js";import{a as Z}from"./Tool02-BK6vOVj2.js";import{A as y}from"./agent-icon-ZuDh9-Hb.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
1
+ import{c as k,j as h,r as C,m as L}from"./index-D7ecmoEk.js";import{a as Z}from"./Tool02-CBXM0F92.js";import{A as y}from"./agent-icon-zWW3t6VG.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
@@ -1 +1 @@
1
- import{X as B,r as I,F as L,o as O,a as V,Z as K,b as q,e as z,p,t as c,K as v,j as o,B as j}from"./index-D0GbPI_R.js";import{e as Q,D as k,d as G,a as H,b as U,c as X}from"./dialog-C1Qgh1pV.js";import{a as Y,F as C,b as D,c as Z,d as M,e as S}from"./form-Bcx3Dx5v.js";import{S as J,a as W,b as $,c as _,d as ee}from"./select-JTf4HMkB.js";import{T as oe}from"./textarea-BDUOK9v4.js";import{u as ne}from"./use-org-auth-client-nWz-MFtZ.js";import{u as se}from"./use-organization-roles-DuvB4P7M.js";const ie=B().email("Invalid email address");function te(l){if(!l.trim())return[];const u=l.split(/[,;\n]/).map(r=>r.trim().toLowerCase()).filter(r=>r.length>0);return Array.from(new Set(u))}function he({trigger:l}){const[u,r]=I.useState(!1),{locator:h}=L(),w=ne(),x=O(),{data:F}=V.useSession(),f=F?.user?.email,{roles:E,isLoading:P}=se(),T=E.filter(n=>n.role!=="owner"),t=K({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),y=t.watch("emailsText"),A=t.watch("role"),m=te(y).filter(n=>{const e=ie.safeParse(n).success,i=!f||n!==f.toLowerCase();return e&&i}),s=q(),a=z({mutationFn:async({emails:n,role:e})=>{if(!e)throw new Error(s("common.inviteMemberDialog.errorSelectRole"));const i=await Promise.allSettled(n.map(async d=>{const g=await w.organization.inviteMember({email:d,role:e});if(g.error)throw new Error(g.error.message);return g.data})),b=i.filter(d=>d.status==="rejected");if(b.length>0)throw new Error(s("common.inviteMemberDialog.errorFailedInvite",{count:b.length}));return i},onSuccess:(n,{emails:e,role:i})=>{p("member_invited",{count:e.length,role:i}),x.invalidateQueries({queryKey:v.members(h)}),x.invalidateQueries({queryKey:v.invitations(h)}),c.success(e.length===1?s("common.inviteMemberDialog.successSingle"):s("common.inviteMemberDialog.successMultiple",{count:e.length})),t.reset({emailsText:"",role:"user"}),r(!1)},onError:(n,{emails:e,role:i})=>{p("member_invite_failed",{count:e.length,role:i,error:n instanceof Error?n.message:String(n)}),c.error(n instanceof Error?n.message:s("common.inviteMemberDialog.errorGeneric"))}}),N=n=>{if(m.length===0){c.error(s("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){c.error(s("common.inviteMemberDialog.errorSelectRole"));return}a.mutate({emails:m,role:n.role})},R=m.length>0&&!!A;return o.jsxs(Q,{open:u,onOpenChange:r,children:[o.jsx(k,{asChild:!0,children:l}),o.jsxs(G,{className:"sm:max-w-lg",children:[o.jsx(H,{children:o.jsx(U,{children:s("common.inviteMemberDialog.title")})}),o.jsx(Y,{...t,children:o.jsxs("form",{onSubmit:t.handleSubmit(N),className:"space-y-4",children:[o.jsx(C,{control:t.control,name:"emailsText",render:({field:n})=>o.jsxs(D,{children:[o.jsx(Z,{children:s("common.inviteMemberDialog.emailLabel")}),o.jsx(M,{children:o.jsx(oe,{...n,disabled:a.isPending,placeholder:s("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),o.jsx(S,{})]})}),o.jsx(C,{control:t.control,name:"role",render:({field:n})=>o.jsxs(D,{children:[o.jsx(M,{children:o.jsxs(J,{value:n.value,onValueChange:n.onChange,disabled:a.isPending||P,children:[o.jsx(W,{className:"w-full",children:o.jsx($,{placeholder:s("common.inviteMemberDialog.roleSelectPlaceholder")})}),o.jsx(_,{children:T.map(e=>{const i=[];return e.isBuiltin||(e.allowsAllStaticPermissions?i.push(s("common.inviteMemberDialog.permFullOrgAccess")):e.staticPermissionCount&&e.staticPermissionCount>0&&i.push(s("common.inviteMemberDialog.permOrgPerms",{count:e.staticPermissionCount})),e.allowsAllConnections?i.push(s("common.inviteMemberDialog.permAllConnections")):e.connectionCount&&e.connectionCount>0&&i.push(s("common.inviteMemberDialog.permConnections",{count:e.connectionCount})),(e.connectionCount!==0||e.allowsAllConnections)&&(e.allowsAllTools?i.push(s("common.inviteMemberDialog.permAllTools")):e.toolCount&&e.toolCount>0&&i.push(s("common.inviteMemberDialog.permTools",{count:e.toolCount})))),o.jsx(ee,{value:e.role,children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:e.label}),!e.isBuiltin&&i.length>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:i.join(", ")})]})},e.role)})})]})}),o.jsx(S,{})]})}),o.jsxs(X,{children:[o.jsx(j,{variant:"outline",onClick:()=>{t.reset({emailsText:"",role:"user"}),r(!1)},type:"button",disabled:a.isPending,children:s("common.inviteMemberDialog.cancelButton")}),o.jsx(j,{type:"submit",disabled:a.isPending||!R,children:a.isPending?s("common.inviteMemberDialog.invitingButton"):s("common.inviteMemberDialog.inviteButton",{count:m.length||0})})]})]})})]})]})}export{he as I};
1
+ import{X as B,r as I,F as L,o as O,a as V,Z as K,b as q,e as z,p,t as c,K as v,j as o,B as j}from"./index-D7ecmoEk.js";import{e as Q,D as k,d as G,a as H,b as U,c as X}from"./dialog-Bx0tkWaQ.js";import{a as Y,F as C,b as D,c as Z,d as M,e as S}from"./form-Du5MP186.js";import{S as J,a as W,b as $,c as _,d as ee}from"./select-o--wOfO_.js";import{T as oe}from"./textarea-BJyqw4SL.js";import{u as ne}from"./use-org-auth-client-D-a5lzlz.js";import{u as se}from"./use-organization-roles-Bfvpk2iJ.js";const ie=B().email("Invalid email address");function te(l){if(!l.trim())return[];const u=l.split(/[,;\n]/).map(r=>r.trim().toLowerCase()).filter(r=>r.length>0);return Array.from(new Set(u))}function he({trigger:l}){const[u,r]=I.useState(!1),{locator:h}=L(),w=ne(),x=O(),{data:F}=V.useSession(),f=F?.user?.email,{roles:E,isLoading:P}=se(),T=E.filter(n=>n.role!=="owner"),t=K({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),y=t.watch("emailsText"),A=t.watch("role"),m=te(y).filter(n=>{const e=ie.safeParse(n).success,i=!f||n!==f.toLowerCase();return e&&i}),s=q(),a=z({mutationFn:async({emails:n,role:e})=>{if(!e)throw new Error(s("common.inviteMemberDialog.errorSelectRole"));const i=await Promise.allSettled(n.map(async d=>{const g=await w.organization.inviteMember({email:d,role:e});if(g.error)throw new Error(g.error.message);return g.data})),b=i.filter(d=>d.status==="rejected");if(b.length>0)throw new Error(s("common.inviteMemberDialog.errorFailedInvite",{count:b.length}));return i},onSuccess:(n,{emails:e,role:i})=>{p("member_invited",{count:e.length,role:i}),x.invalidateQueries({queryKey:v.members(h)}),x.invalidateQueries({queryKey:v.invitations(h)}),c.success(e.length===1?s("common.inviteMemberDialog.successSingle"):s("common.inviteMemberDialog.successMultiple",{count:e.length})),t.reset({emailsText:"",role:"user"}),r(!1)},onError:(n,{emails:e,role:i})=>{p("member_invite_failed",{count:e.length,role:i,error:n instanceof Error?n.message:String(n)}),c.error(n instanceof Error?n.message:s("common.inviteMemberDialog.errorGeneric"))}}),N=n=>{if(m.length===0){c.error(s("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){c.error(s("common.inviteMemberDialog.errorSelectRole"));return}a.mutate({emails:m,role:n.role})},R=m.length>0&&!!A;return o.jsxs(Q,{open:u,onOpenChange:r,children:[o.jsx(k,{asChild:!0,children:l}),o.jsxs(G,{className:"sm:max-w-lg",children:[o.jsx(H,{children:o.jsx(U,{children:s("common.inviteMemberDialog.title")})}),o.jsx(Y,{...t,children:o.jsxs("form",{onSubmit:t.handleSubmit(N),className:"space-y-4",children:[o.jsx(C,{control:t.control,name:"emailsText",render:({field:n})=>o.jsxs(D,{children:[o.jsx(Z,{children:s("common.inviteMemberDialog.emailLabel")}),o.jsx(M,{children:o.jsx(oe,{...n,disabled:a.isPending,placeholder:s("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),o.jsx(S,{})]})}),o.jsx(C,{control:t.control,name:"role",render:({field:n})=>o.jsxs(D,{children:[o.jsx(M,{children:o.jsxs(J,{value:n.value,onValueChange:n.onChange,disabled:a.isPending||P,children:[o.jsx(W,{className:"w-full",children:o.jsx($,{placeholder:s("common.inviteMemberDialog.roleSelectPlaceholder")})}),o.jsx(_,{children:T.map(e=>{const i=[];return e.isBuiltin||(e.allowsAllStaticPermissions?i.push(s("common.inviteMemberDialog.permFullOrgAccess")):e.staticPermissionCount&&e.staticPermissionCount>0&&i.push(s("common.inviteMemberDialog.permOrgPerms",{count:e.staticPermissionCount})),e.allowsAllConnections?i.push(s("common.inviteMemberDialog.permAllConnections")):e.connectionCount&&e.connectionCount>0&&i.push(s("common.inviteMemberDialog.permConnections",{count:e.connectionCount})),(e.connectionCount!==0||e.allowsAllConnections)&&(e.allowsAllTools?i.push(s("common.inviteMemberDialog.permAllTools")):e.toolCount&&e.toolCount>0&&i.push(s("common.inviteMemberDialog.permTools",{count:e.toolCount})))),o.jsx(ee,{value:e.role,children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:e.label}),!e.isBuiltin&&i.length>0&&o.jsx("span",{className:"text-xs text-muted-foreground",children:i.join(", ")})]})},e.role)})})]})}),o.jsx(S,{})]})}),o.jsxs(X,{children:[o.jsx(j,{variant:"outline",onClick:()=>{t.reset({emailsText:"",role:"user"}),r(!1)},type:"button",disabled:a.isPending,children:s("common.inviteMemberDialog.cancelButton")}),o.jsx(j,{type:"submit",disabled:a.isPending||!R,children:a.isPending?s("common.inviteMemberDialog.invitingButton"):s("common.inviteMemberDialog.inviteButton",{count:m.length||0})})]})]})})]})]})}export{he as I};
@@ -1 +1 @@
1
- import{c as n,m as r,j as i,bx as p}from"./index-D0GbPI_R.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
1
+ import{c as n,m as r,j as i,bx as p}from"./index-D7ecmoEk.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};