decocms 4.92.3 → 4.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/client/assets/{AlertCircle-B9GlbKHh.js → AlertCircle-Njhn01cX.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DHN9bK0l.js → AreaChart-DRbAqxKW.js} +1 -1
  3. package/dist/client/assets/ArrowRight-esEXrLxn.js +1 -0
  4. package/dist/client/assets/{ArrowUp-DNZsq7Zt.js → ArrowUp-DxvzPWYP.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-DZZygrAi.js → ArrowUpRight-CxuPu6Tj.js} +1 -1
  6. package/dist/client/assets/Check-C8xezRP_.js +1 -0
  7. package/dist/client/assets/{CheckCircle-BEcdXH7-.js → CheckCircle-BQxAiBVq.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BSRiDjXd.js → ChevronDown-DnZfSUpf.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-YmTewr_B.js → ChevronRight-DsMfUSaC.js} +1 -1
  10. package/dist/client/assets/ChevronUp-DGO207B8.js +1 -0
  11. package/dist/client/assets/{Copy01-BkGYkmm-.js → Copy01-BvTvgPMW.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BmTi7wpl.js → DotsVertical-Cpk8Ctc8.js} +1 -1
  13. package/dist/client/assets/{Eye-B-ZfWIGj.js → Eye-BsbSF6dM.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BwWG7tAk.js → FilterLines-DBjnKQVG.js} +1 -1
  15. package/dist/client/assets/{Globe01-D3vBqhI7.js → Globe01-QTXFA3Hg.js} +1 -1
  16. package/dist/client/assets/{Globe04-pvxBukgJ.js → Globe04-Dpy9nX58.js} +1 -1
  17. package/dist/client/assets/{HardDrive-DutZPQFL.js → HardDrive-B9qgGqhY.js} +1 -1
  18. package/dist/client/assets/{Image01-PIeYnf-K.js → Image01-CMr6OOW9.js} +1 -1
  19. package/dist/client/assets/{Key01-DhLD806C.js → Key01-uLXewYdO.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-BI-sXAac.js → LayoutLeft-tArvHAmP.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-DO3QnLus.js → LinkExternal01-DXy81AX9.js} +1 -1
  22. package/dist/client/assets/{Monitor01-BOILvS2u.js → Monitor01-XHtWWQke.js} +1 -1
  23. package/dist/client/assets/{Package-DbEcG94t.js → Package-B0zWER5V.js} +1 -1
  24. package/dist/client/assets/{Palette-CyZvWKmI.js → Palette-00Ixb1J1.js} +1 -1
  25. package/dist/client/assets/{Play-B8fWmOst.js → Play-CzcsEB-0.js} +1 -1
  26. package/dist/client/assets/{Plus-2c1jULco.js → Plus-edG6Flwm.js} +1 -1
  27. package/dist/client/assets/{SearchLg-XmvudKlH.js → SearchLg-BZaz6095.js} +1 -1
  28. package/dist/client/assets/{SearchMd-lwIiBODG.js → SearchMd-CCfeLY5x.js} +1 -1
  29. package/dist/client/assets/{Settings02-DMpqOK24.js → Settings02-Bx_qgDLp.js} +1 -1
  30. package/dist/client/assets/{Shield01-gTFc9c17.js → Shield01-BiDz13pn.js} +1 -1
  31. package/dist/client/assets/{Star01-DoUbKevt.js → Star01-8Dyem59l.js} +1 -1
  32. package/dist/client/assets/{Stars01-CJsm_THn.js → Stars01-3-zqXKvS.js} +1 -1
  33. package/dist/client/assets/{Stars02-B08FvcHQ.js → Stars02-BQXVdDN3.js} +1 -1
  34. package/dist/client/assets/{Sun-nDXz4jeM.js → Sun-CB79h_pC.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-Rgis0XWf.js → SwitchHorizontal01-BvyA4hac.js} +1 -1
  36. package/dist/client/assets/{Tool01-BR3IBeV9.js → Tool01-B13YSnrO.js} +1 -1
  37. package/dist/client/assets/{Tool02-B0-a0UMl.js → Tool02-egoF7acO.js} +1 -1
  38. package/dist/client/assets/{Trash01-Ba6bCbNY.js → Trash01-DLyQDi2Y.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-CeRF_789.js → TrendUp01-B_4HE6HC.js} +1 -1
  40. package/dist/client/assets/{Upload01-B14IruoN.js → Upload01-C-fdZkjY.js} +1 -1
  41. package/dist/client/assets/{User01-ByIE6k8L.js → User01-ndlF2LEv.js} +1 -1
  42. package/dist/client/assets/{Users01-BdldAr7H.js → Users01-BRUbM3mR.js} +1 -1
  43. package/dist/client/assets/{Users03-Bx4g7VTC.js → Users03-D_q12QHD.js} +1 -1
  44. package/dist/client/assets/{X-Dif5I5BD.js → X-BLwtZL0s.js} +1 -1
  45. package/dist/client/assets/XCircle-DHvjqByD.js +1 -0
  46. package/dist/client/assets/{XClose-DomD4542.js → XClose-CeJxo_5O.js} +1 -1
  47. package/dist/client/assets/{Zap-CEUVQQOc.js → Zap-Biv_hWgJ.js} +1 -1
  48. package/dist/client/assets/{ZapSquare-EvC2T9CP.js → ZapSquare-CUzmnXYD.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-BprgOfkE.js → ZoomOut-BtlatfMa.js} +1 -1
  50. package/dist/client/assets/{access-gate-NCJKEJqO.js → access-gate-DlRgf45B.js} +1 -1
  51. package/dist/client/assets/add-section-modal-Cnzkvby6.js +1 -0
  52. package/dist/client/assets/agent-icon-DpP8KzFU.js +1 -0
  53. package/dist/client/assets/agents-list-DvnAEWGc.js +1 -0
  54. package/dist/client/assets/ai-providers-CDx5RbfA.js +1 -0
  55. package/dist/client/assets/{alert-C_4AvGUo.js → alert-DiBfJ3z6.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-DDtUbhoS.js → alert-dialog-BnLog6BT.js} +2 -2
  57. package/dist/client/assets/app-editor-DTp5bYYF.js +1 -0
  58. package/dist/client/assets/{auth-CsHQFHV_.js → auth-CmoeLSjh.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-_TQy6GDd.js → auth-catchall-CyJqULXt.js} +1 -1
  60. package/dist/client/assets/{auth-entry-_ePf9_J1.js → auth-entry-oOVL70ba.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-D9UYTbxy.js → auth-split-layout-BCda3jzi.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-CEv4KtcH.js → authenticate-and-persist-oauth-CJ808iDy.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-CyDHI_uf.js → automation-list-row-BZr8L7Uh.js} +1 -1
  64. package/dist/client/assets/{automation-runs-D8v8nlly.js → automation-runs-DS0XzTMW.js} +5 -5
  65. package/dist/client/assets/automations-BrHkbwwm.js +1 -0
  66. package/dist/client/assets/{autosend-BgYoPuWD.js → autosend-CQ-47-85.js} +1 -1
  67. package/dist/client/assets/{avatar-BVdHZbMN.js → avatar-CGcwSkmr.js} +1 -1
  68. package/dist/client/assets/{badge-C_9mnuBd.js → badge-BUVU0rMR.js} +1 -1
  69. package/dist/client/assets/{block-document-CcMdXbqY.js → block-document-B2r_hLd8.js} +1 -1
  70. package/dist/client/assets/{brand-context-B-nZCoNx.js → brand-context-Bpk1Tuz_.js} +1 -1
  71. package/dist/client/assets/buckets-Ba5z9iiC.js +1 -0
  72. package/dist/client/assets/bulk-category-panel-i79BTudx.js +1 -0
  73. package/dist/client/assets/{calendar-Bxkf6gvE.js → calendar-COt9TyKT.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-i6NCyxxk.js → capability-load-error-DOgFzcPM.js} +1 -1
  75. package/dist/client/assets/{card-C3gg1LtP.js → card-BoM9PVle.js} +1 -1
  76. package/dist/client/assets/category-editor-CZOD4Saa.js +1 -0
  77. package/dist/client/assets/{chat-context-DSveBxCg.js → chat-context-B5VF42iB.js} +7 -7
  78. package/dist/client/assets/checkbox-8MRm635N.js +1 -0
  79. package/dist/client/assets/{cli-auth-success-Cc2B25iW.js → cli-auth-success-CTl9Esai.js} +1 -1
  80. package/dist/client/assets/collection-detail-JnTCc17l.js +1 -0
  81. package/dist/client/assets/collection-display-button-DZt1zLnf.js +1 -0
  82. package/dist/client/assets/{collection-search-TcSAZpqK.js → collection-search-3CKEWWZt.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-H4bzUKoO.js → collection-table-wrapper-D20SVTuI.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-CIRa_M2W.js → collection-tabs-8kNejI0g.js} +1 -1
  85. package/dist/client/assets/{command-3z1R7bvy.js → command-BEYKuuWi.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-eKB7r6Ch.js +1 -0
  87. package/dist/client/assets/{companions-core-C68sN4Wc.js → companions-core-C3_LmblJ.js} +1 -1
  88. package/dist/client/assets/connect-DT6CnTMJ.js +8 -0
  89. package/dist/client/assets/connect-desktop-dialog-DwQ8Mjza.js +1 -0
  90. package/dist/client/assets/{connection-card-D_K36Swx.js → connection-card-WnbGcpbb.js} +1 -1
  91. package/dist/client/assets/connection-detail-Dd3EkXAN.js +1 -0
  92. package/dist/client/assets/{connection-form-helpers-DyOAEqE9.js → connection-form-helpers-BCcxv-0Z.js} +1 -1
  93. package/dist/client/assets/connections-CfhypjVY.js +1 -0
  94. package/dist/client/assets/{decopilot-sse-pool-CEQrv8Fn.js → decopilot-sse-pool-SXkhxj1m.js} +1 -1
  95. package/dist/client/assets/{dialog-DUqhzGiD.js → dialog-CV70WKsd.js} +1 -1
  96. package/dist/client/assets/{domain-settings-CRIqu0Bs.js → domain-settings-BwZkfjuf.js} +1 -1
  97. package/dist/client/assets/{drawer-DvhdIHph.js → drawer-DjOdYDA9.js} +1 -1
  98. package/dist/client/assets/dropdown-menu-mvaVV4Vk.js +1 -0
  99. package/dist/client/assets/{empty-state-BHuw6cM9.js → empty-state-DXghlCSF.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-_NDoBHMa.js → extract-connection-data-JVWAWvFf.js} +1 -1
  101. package/dist/client/assets/file-explorer-BHCYY9cJ.js +2 -0
  102. package/dist/client/assets/{file-type-icon-BOCZKON3.js → file-type-icon-CZv5YRkA.js} +1 -1
  103. package/dist/client/assets/{files-CelFf8dg.js → files-CxsC_UPe.js} +1 -1
  104. package/dist/client/assets/{form-C9InGmo4.js → form-DQ-7zIby.js} +1 -1
  105. package/dist/client/assets/general-CrovKb2x.js +1 -0
  106. package/dist/client/assets/{github-repo-picker-Biy9UFu8.js → github-repo-picker-BfsQbNwu.js} +1 -1
  107. package/dist/client/assets/{hooks-DU-2h9eZ.js → hooks-DQwk0XaJ.js} +1 -1
  108. package/dist/client/assets/{index-DnrPO2j2.js → index-4lUYXs_O.js} +1 -1
  109. package/dist/client/assets/{index-DivFugQC.js → index-9nw_Dv5I.js} +1 -1
  110. package/dist/client/assets/index-B7jBuFkn.css +1 -0
  111. package/dist/client/assets/{index-CbhDnqOu.js → index-BCiQIrz6.js} +1 -1
  112. package/dist/client/assets/index-C4jaN42X.js +2 -0
  113. package/dist/client/assets/{index-Du80fsxC.js → index-CF-xkULI.js} +5 -5
  114. package/dist/client/assets/{index-DBhNC4I_.js → index-COh-8QN3.js} +1 -1
  115. package/dist/client/assets/index-CSe3WpII.js +1 -0
  116. package/dist/client/assets/{index-BOgwoJjn.js → index-CdbTrQGO.js} +1 -1
  117. package/dist/client/assets/{index-CO3868Cu.js → index-Ckjl1Fry.js} +1 -1
  118. package/dist/client/assets/{index-Cs6hIS7C.js → index-Csozlno7.js} +3 -3
  119. package/dist/client/assets/index-DZseYmOn.js +1 -0
  120. package/dist/client/assets/{index-nNhZx5bw.js → index-G0zgTDdu.js} +14 -14
  121. package/dist/client/assets/{index-f6gbzJ8b.js → index-KNJ3OCd2.js} +1 -1
  122. package/dist/client/assets/{index-DmhdwAgP.js → index-cMDjfUVQ.js} +14 -14
  123. package/dist/client/assets/{index-redirect-hJFu02mm.js → index-redirect-D10_sM2p.js} +1 -1
  124. package/dist/client/assets/{input-TkvVVsQL.js → input-ChzvExXm.js} +1 -1
  125. package/dist/client/assets/{integration-icon-CWb3OXTV.js → integration-icon-Bhn0_xtP.js} +1 -1
  126. package/dist/client/assets/{invite-member-dialog-BA1mFY2X.js → invite-member-dialog-SQrGzC-z.js} +1 -1
  127. package/dist/client/assets/{label-CB2o7dZ2.js → label-CuJFo9yJ.js} +1 -1
  128. package/dist/client/assets/{layout-CqMMMVMm.js → layout-CwrVNWCG.js} +1 -1
  129. package/dist/client/assets/{login-B0EX352Z.js → login-C7gBuFYu.js} +1 -1
  130. package/dist/client/assets/{mcp-oauth-B5rKpHdd.js → mcp-oauth-BVO-f6t7.js} +1 -1
  131. package/dist/client/assets/members-Dlx5k3-8.js +1 -0
  132. package/dist/client/assets/{monaco-editor-DfuNvLfy.js → monaco-editor-CjU5L-zs.js} +1 -1
  133. package/dist/client/assets/{monitoring-stats-row-B43TP1bq.js → monitoring-stats-row-B9gtpPq-.js} +1 -1
  134. package/dist/client/assets/{multi-select-DhXl88EK.js → multi-select-De7VgXHU.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-BiKjtCpj.js → oauth-callback-ai-provider-UmcAlyJ2.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-CZ8I3e9V.js → oauth-callback-w52ryAZO.js} +1 -1
  137. package/dist/client/assets/{onboarding-U4YqP9I9.js → onboarding-BBWoRpXr.js} +1 -1
  138. package/dist/client/assets/{org-install-BYDat95r.js → org-install-ml9Q1TCX.js} +1 -1
  139. package/dist/client/assets/{org-layout-CVqWtNQa.js → org-layout-DmAo9qk4.js} +1 -1
  140. package/dist/client/assets/{organization-choice-CkG6QFWH.js → organization-choice-5F6o2RZD.js} +1 -1
  141. package/dist/client/assets/orgs-j7U5FSTV.js +1 -0
  142. package/dist/client/assets/{page-seo-form-8ToiuKnD.js → page-seo-form-CTnrck0_.js} +1 -1
  143. package/dist/client/assets/page-seo-sheet-fmIm-MrR.js +1 -0
  144. package/dist/client/assets/{popover-DwV6WXHS.js → popover-1mcOD1Dn.js} +1 -1
  145. package/dist/client/assets/post-editor-Dv_wlt7_.js +1 -0
  146. package/dist/client/assets/{primitives-RdkZFzQM.js → primitives-BaeBEsVv.js} +1 -1
  147. package/dist/client/assets/profile-CTuz7Go7.js +1 -0
  148. package/dist/client/assets/project-app-view-BtXFxvLq.js +1 -0
  149. package/dist/client/assets/record-editor-ZKO7gQiD.js +1 -0
  150. package/dist/client/assets/redirect-editor-qRjlDXct.js +1 -0
  151. package/dist/client/assets/registry-DtoSMqLy.js +2 -0
  152. package/dist/client/assets/{registry-layout-C2NoRJs0.js → registry-layout-WEtqp3AF.js} +3 -3
  153. package/dist/client/assets/{reports-J4B5GOoc.js → reports-CpbSj3oU.js} +2 -2
  154. package/dist/client/assets/{require-capability-DnfzULDW.js → require-capability-DF8ibYEg.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-ABsqitxw.js → required-auth-layout-rQ3tDKtk.js} +1 -1
  156. package/dist/client/assets/{reset-password-CbrThkFS.js → reset-password-D7FhrF53.js} +1 -1
  157. package/dist/client/assets/roles-BsYIEd1e.js +1 -0
  158. package/dist/client/assets/{search-input-B-RkAjzQ.js → search-input-75Re6Uqa.js} +1 -1
  159. package/dist/client/assets/secrets-B8bCoicB.js +1 -0
  160. package/dist/client/assets/{sections-editor-BW9cZUKJ.js → sections-editor-CM3ROkK7.js} +2 -2
  161. package/dist/client/assets/{select-model-BAk08l-M.js → select-model-CvnCrbwF.js} +1 -1
  162. package/dist/client/assets/select-sG3MQo05.js +1 -0
  163. package/dist/client/assets/self-tool-result-DR1KhJAE.js +1 -0
  164. package/dist/client/assets/seo-editor-Dz2QCY6k.js +1 -0
  165. package/dist/client/assets/settings-layout-rnH8GMkk.js +1 -0
  166. package/dist/client/assets/{settings-section-CNVe03BK.js → settings-section-DAwHE86q.js} +1 -1
  167. package/dist/client/assets/{shell-controls-5d4ZCRmi.js → shell-controls-Ck0Rc32A.js} +1 -1
  168. package/dist/client/assets/{shell-layout-6KUu0MA6.js → shell-layout-BXBrTj2H.js} +1 -1
  169. package/dist/client/assets/{sidebar-DnKMI8jz.js → sidebar-CCj6ri6x.js} +1 -1
  170. package/dist/client/assets/{skeleton-xDZ5Iwb8.js → skeleton-CoquA_ea.js} +1 -1
  171. package/dist/client/assets/sso-BOWh8JUl.js +1 -0
  172. package/dist/client/assets/store-registry-3_Y48Wu9.js +2 -0
  173. package/dist/client/assets/{store-BoCHTDSB.js → store-tszIV4qx.js} +1 -1
  174. package/dist/client/assets/{studio-tools-DIWsVaKg.js → studio-tools-Cet6XIhz.js} +1 -1
  175. package/dist/client/assets/{switch-DS9vYGS-.js → switch-DuPEp97y.js} +1 -1
  176. package/dist/client/assets/{table-DnoPpUup.js → table-LpLpROAI.js} +1 -1
  177. package/dist/client/assets/{tabs-2srR2H7A.js → tabs-CmiAgAjG.js} +1 -1
  178. package/dist/client/assets/{textarea-DjtAtA2l.js → textarea-CnNzHRRt.js} +1 -1
  179. package/dist/client/assets/{toggle-group-DGvoaiio.js → toggle-group-CKOvvRSl.js} +1 -1
  180. package/dist/client/assets/{toolbar-icon-button-Cr-N30KB.js → toolbar-icon-button-D8Ebc4H2.js} +1 -1
  181. package/dist/client/assets/{toolbar-CvkbyWaX.js → toolbar-uJC2H1eB.js} +1 -1
  182. package/dist/client/assets/{tooltip-cvFTpZ9W.js → tooltip-OGhXfeBg.js} +1 -1
  183. package/dist/client/assets/{use-ai-providers-ZLuBEaKb.js → use-ai-providers-BEU7q_EV.js} +1 -1
  184. package/dist/client/assets/use-api-keys-Bv4LYzyW.js +1 -0
  185. package/dist/client/assets/{use-automations-COcieFX-.js → use-automations-3WBbPXBU.js} +1 -1
  186. package/dist/client/assets/{use-autosave-C46oRXRb.js → use-autosave-GvQRDmC-.js} +1 -1
  187. package/dist/client/assets/{use-capability-3dRU8tE2.js → use-capability-RkVuWZII.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-BzcS25hV.js → use-clock-tick-CVs1XDyl.js} +1 -1
  189. package/dist/client/assets/{use-collections-DaXoNaLL.js → use-collections-DR_d-Teb.js} +1 -1
  190. package/dist/client/assets/{use-connection-DM1ROgj3.js → use-connection-CwuiKrFd.js} +1 -1
  191. package/dist/client/assets/{use-copy-DC217syR.js → use-copy-B6IC0gpM.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-Clu62lnk.js → use-create-virtual-mcp-sGGDSwNA.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-DYog9M6N.js → use-debounced-autosave-BwK3M221.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-CSp0_yRg.js → use-debounced-value-DLpyoptp.js} +1 -1
  195. package/dist/client/assets/use-deco-credits-q4i1Uz5r.js +1 -0
  196. package/dist/client/assets/{use-decopilot-events-CX_EuT5c.js → use-decopilot-events-BWABMe_S.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-CxGr7t4A.js → use-delete-connection-CzZLtWQx.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-C6-1CBki.js → use-deployment-admin-CMiQgY9e.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-DASxzk9O.js → use-file-configs-DzR4CKUR.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-XidGSyic.js → use-infinite-scroll-7EbHWl5i.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-CjypbTMc.js → use-join-requests-DGeGKSqv.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-BpAt0IbR.js → use-mcp-auth-status-Dc0BBxuQ.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-DseZ3Mea.js → use-mcp-client-CX21NflZ.js} +4 -4
  204. package/dist/client/assets/{use-mcp-tools-DJGNLf9H.js → use-mcp-tools-BsmNzwNJ.js} +1 -1
  205. package/dist/client/assets/{use-members-CncY3QG2.js → use-members-Dg0Z4TCy.js} +1 -1
  206. package/dist/client/assets/{use-mobile-D8w2xyip.js → use-mobile-iuGXq52B.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-YScxPu5L.js → use-navigate-to-agent-BGBWLfKe.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-DjREcL_I.js → use-org-auth-client-BWQzTMi-.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-diAgeADE.js → use-org-sso-C0w-Y45A.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-BuFi-QNO.js → use-organization-roles-3XOjGEsU.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-bBY4klS6.js → use-organization-settings-DVcDvmS7.js} +1 -1
  212. package/dist/client/assets/{use-registry-app-Cy7ipz7c.js → use-registry-app-9JpMfNFa.js} +1 -1
  213. package/dist/client/assets/{use-registry-connections-BZ0Z0jCg.js → use-registry-connections-hPmj3HSR.js} +1 -1
  214. package/dist/client/assets/{use-secrets-q_kPvC5B.js → use-secrets-BlieysxK.js} +1 -1
  215. package/dist/client/assets/{use-status-sounds-DG0Zyz9B.js → use-status-sounds-B7xlxGt9.js} +1 -1
  216. package/dist/client/assets/{use-t-BjZG1zRp.js → use-t-DpDrKRdg.js} +1 -1
  217. package/dist/client/assets/{use-view-mode-B02hzmMj.js → use-view-mode-DjI_33ML.js} +1 -1
  218. package/dist/client/assets/{use-virtual-mcp-urYy02xb.js → use-virtual-mcp-CMX7Masu.js} +1 -1
  219. package/dist/client/assets/useInfiniteQuery-BtjzjNju.js +1 -0
  220. package/dist/client/assets/{useRouterState-C7tRHRC7.js → useRouterState-BtVYUlaA.js} +1 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-DzpLVyna.js +1 -0
  222. package/dist/client/assets/{users-CZVOiXsq.js → users-B-S76Gnf.js} +1 -1
  223. package/dist/client/assets/variant-calendar-C5Z-PHCg.js +1 -0
  224. package/dist/client/assets/{view-mode-toggle-DziN7a9n.js → view-mode-toggle-DT808FUj.js} +1 -1
  225. package/dist/client/index.html +2 -2
  226. package/dist/server/cli.js +488 -488
  227. package/dist/server/server.js +313 -313
  228. package/package.json +1 -1
  229. package/dist/client/assets/ChevronUp-D5F6V6Tm.js +0 -1
  230. package/dist/client/assets/XCircle-C0OdV3N_.js +0 -1
  231. package/dist/client/assets/add-section-modal-DBjaDtzc.js +0 -1
  232. package/dist/client/assets/agent-icon-DicjSkHu.js +0 -1
  233. package/dist/client/assets/agents-list-Bt1R4ueI.js +0 -1
  234. package/dist/client/assets/ai-providers-TK1CCOpK.js +0 -1
  235. package/dist/client/assets/app-editor-ptKJtHHM.js +0 -1
  236. package/dist/client/assets/automations-BoSNNWPc.js +0 -1
  237. package/dist/client/assets/buckets-DcRE1RUQ.js +0 -1
  238. package/dist/client/assets/bulk-category-panel-BkJQrEio.js +0 -1
  239. package/dist/client/assets/category-editor-CaGAyBNX.js +0 -1
  240. package/dist/client/assets/checkbox-Ba2-hx8r.js +0 -1
  241. package/dist/client/assets/collection-detail-D9ZCPDhA.js +0 -1
  242. package/dist/client/assets/collection-display-button-D_kIgil2.js +0 -1
  243. package/dist/client/assets/commerce-onboarding-DbQ0hYyA.js +0 -1
  244. package/dist/client/assets/connect-desktop-dialog-DEEL81vf.js +0 -1
  245. package/dist/client/assets/connection-detail-CKGrDl_p.js +0 -1
  246. package/dist/client/assets/connections-BJO0R_-8.js +0 -1
  247. package/dist/client/assets/dropdown-menu-D5BTIZvH.js +0 -1
  248. package/dist/client/assets/file-explorer-CUr9mfMv.js +0 -2
  249. package/dist/client/assets/general-DlHL1tW3.js +0 -1
  250. package/dist/client/assets/index-629FAmzK.js +0 -1
  251. package/dist/client/assets/index-BQK4XWOD.js +0 -2
  252. package/dist/client/assets/index-Cb_X1LK0.js +0 -1
  253. package/dist/client/assets/index-oE__K1ye.css +0 -1
  254. package/dist/client/assets/members-Ds_Onv02.js +0 -1
  255. package/dist/client/assets/orgs-B4DrO8iC.js +0 -1
  256. package/dist/client/assets/page-seo-sheet-BTyypxho.js +0 -1
  257. package/dist/client/assets/post-editor-j9JAXwQN.js +0 -1
  258. package/dist/client/assets/profile-DwVJzm_R.js +0 -1
  259. package/dist/client/assets/project-app-view-e40sJb24.js +0 -1
  260. package/dist/client/assets/record-editor-BBPLTix7.js +0 -1
  261. package/dist/client/assets/redirect-editor-C8EDxpmx.js +0 -1
  262. package/dist/client/assets/registry-CFSvMZwJ.js +0 -2
  263. package/dist/client/assets/roles-BqueMkJJ.js +0 -1
  264. package/dist/client/assets/secrets-CEZOniOS.js +0 -1
  265. package/dist/client/assets/select-AzuoAc3H.js +0 -1
  266. package/dist/client/assets/self-tool-result-C94YNykg.js +0 -1
  267. package/dist/client/assets/seo-editor-CR8P7sfk.js +0 -1
  268. package/dist/client/assets/settings-layout-9yQD_m0n.js +0 -1
  269. package/dist/client/assets/sso-DNsZ7Hie.js +0 -1
  270. package/dist/client/assets/store-registry-WZUtBjlh.js +0 -2
  271. package/dist/client/assets/use-deco-credits-Bm6Hzrca.js +0 -1
  272. package/dist/client/assets/useInfiniteQuery-nK_JPgM8.js +0 -1
  273. package/dist/client/assets/useSuspenseInfiniteQuery-_ObcRUnC.js +0 -1
  274. package/dist/client/assets/variant-calendar-DibyF3zD.js +0 -1
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-nNhZx5bw.js","assets/index-DmhdwAgP.js","assets/index-oE__K1ye.css","assets/ArrowUp-DNZsq7Zt.js","assets/chat-context-DSveBxCg.js","assets/autosend-BgYoPuWD.js","assets/hooks-DU-2h9eZ.js","assets/use-mcp-client-DseZ3Mea.js","assets/auth-CsHQFHV_.js","assets/decopilot-sse-pool-CEQrv8Fn.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/studio-tools-DIWsVaKg.js","assets/use-virtual-mcp-urYy02xb.js","assets/use-collections-DaXoNaLL.js","assets/use-ai-providers-ZLuBEaKb.js","assets/location-BpLtHjTZ.js","assets/tab-id-BijBBRwE.js","assets/use-decopilot-events-CX_EuT5c.js","assets/use-organization-settings-bBY4klS6.js","assets/automation-runs-D8v8nlly.js","assets/select-AzuoAc3H.js","assets/tooltip-cvFTpZ9W.js","assets/ChevronUp-D5F6V6Tm.js","assets/ChevronDown-BSRiDjXd.js","assets/useInfiniteQuery-nK_JPgM8.js","assets/use-infinite-scroll-XidGSyic.js","assets/use-connection-DM1ROgj3.js","assets/card-C3gg1LtP.js","assets/sidebar-DnKMI8jz.js","assets/LayoutLeft-BI-sXAac.js","assets/use-mobile-D8w2xyip.js","assets/X-Dif5I5BD.js","assets/table-DnoPpUup.js","assets/empty-state-BHuw6cM9.js","assets/use-members-CncY3QG2.js","assets/use-org-auth-client-DjREcL_I.js","assets/use-clock-tick-BzcS25hV.js","assets/AlertCircle-B9GlbKHh.js","assets/CheckCircle-BEcdXH7-.js","assets/DotsVertical-BmTi7wpl.js","assets/agent-icon-DicjSkHu.js","assets/Tool01-BR3IBeV9.js","assets/Settings02-DMpqOK24.js","assets/Tool02-B0-a0UMl.js","assets/XCircle-C0OdV3N_.js","assets/ArrowUpRight-DZZygrAi.js","assets/TrendUp01-CeRF_789.js","assets/ZapSquare-EvC2T9CP.js","assets/ZoomOut-BprgOfkE.js","assets/Users03-Bx4g7VTC.js","assets/ChevronRight-YmTewr_B.js","assets/Stars02-B08FvcHQ.js","assets/Copy01-BkGYkmm-.js","assets/Globe01-D3vBqhI7.js","assets/Eye-B-ZfWIGj.js","assets/FilterLines-BwWG7tAk.js","assets/Star01-DoUbKevt.js","assets/Globe04-pvxBukgJ.js","assets/SwitchHorizontal01-Rgis0XWf.js","assets/HardDrive-DutZPQFL.js","assets/Image01-PIeYnf-K.js","assets/Key01-DhLD806C.js","assets/LinkExternal01-DO3QnLus.js","assets/Monitor01-BOILvS2u.js","assets/Sun-nDXz4jeM.js","assets/Package-DbEcG94t.js","assets/Palette-CyZvWKmI.js","assets/Play-B8fWmOst.js","assets/Plus-2c1jULco.js","assets/SearchLg-XmvudKlH.js","assets/SearchMd-lwIiBODG.js","assets/Shield01-gTFc9c17.js","assets/Stars01-CJsm_THn.js","assets/Trash01-Ba6bCbNY.js","assets/Upload01-B14IruoN.js","assets/User01-ByIE6k8L.js","assets/Users01-BdldAr7H.js","assets/XClose-DomD4542.js","assets/Zap-CEUVQQOc.js","assets/use-automations-COcieFX-.js","assets/useSuspenseInfiniteQuery-_ObcRUnC.js","assets/avatar-BVdHZbMN.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-DC217syR.js","assets/file-type-icon-BOCZKON3.js","assets/dialog-DUqhzGiD.js","assets/monaco-editor-DfuNvLfy.js","assets/index-DnrPO2j2.js","assets/index-f6gbzJ8b.js","assets/calendar-Bxkf6gvE.js","assets/use-t-BjZG1zRp.js","assets/shell-layout-6KUu0MA6.js","assets/required-auth-layout-ABsqitxw.js","assets/use-org-sso-diAgeADE.js","assets/integration-icon-CWb3OXTV.js","assets/use-navigate-to-agent-YScxPu5L.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-DHN9bK0l.js","assets/form-C9InGmo4.js","assets/label-CB2o7dZ2.js","assets/input-TkvVVsQL.js","assets/drawer-DvhdIHph.js","assets/collection-search-TcSAZpqK.js","assets/tabs-2srR2H7A.js","assets/toggle-group-DGvoaiio.js","assets/use-deco-credits-Bm6Hzrca.js","assets/extract-connection-data-_NDoBHMa.js","assets/connection-card-D_K36Swx.js","assets/use-registry-connections-BZ0Z0jCg.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-DjtAtA2l.js","assets/connection-form-helpers-DyOAEqE9.js","assets/authenticate-and-persist-oauth-CEv4KtcH.js","assets/mcp-oauth-B5rKpHdd.js","assets/collection-tabs-CIRa_M2W.js","assets/badge-C_9mnuBd.js","assets/connect-desktop-dialog-DEEL81vf.js","assets/select-model-BAk08l-M.js","assets/checkbox-Ba2-hx8r.js","assets/skeleton-xDZ5Iwb8.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-CNVe03BK.js","assets/get-initials-D-f_fDFw.js","assets/command-3z1R7bvy.js","assets/index-CO3868Cu.js","assets/popover-DwV6WXHS.js","assets/use-mcp-tools-DJGNLf9H.js","assets/dropdown-menu-D5BTIZvH.js","assets/index-Du80fsxC.js","assets/alert-dialog-DDtUbhoS.js","assets/toolbar-CvkbyWaX.js","assets/use-debounced-value-CSp0_yRg.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-DG0Zyz9B.js","assets/use-capability-3dRU8tE2.js","assets/toolbar-icon-button-Cr-N30KB.js","assets/use-debounced-autosave-DYog9M6N.js","assets/index-DBhNC4I_.js","assets/search-input-B-RkAjzQ.js","assets/use-mcp-auth-status-BpAt0IbR.js","assets/switch-DS9vYGS-.js","assets/use-registry-app-Cy7ipz7c.js","assets/github-repo-picker-Biy9UFu8.js","assets/provision-repo-scoped-github-connection-2iDn-wQ1.js","assets/github-repo-scope-DjMZbiKa.js","assets/use-secrets-q_kPvC5B.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/use-file-configs-DASxzk9O.js","assets/automation-list-row-CyDHI_uf.js","assets/index-DDGTF8rc.css"])))=>i.map(i=>d[i]);
2
- import{D as Ys,r as D,v as Vs,K as pt,c as B,C as Re,m as gt,a as Ws,n as ss,t as jt,ac as Xs,l as K,j as s,d as At,B as oe,E as Js,b as ws,p as gs,i as ns,u as Zs,aX as en}from"./index-DmhdwAgP.js";import{g as Se}from"./get-initials-D-f_fDFw.js";import{A as Ce}from"./avatar-BVdHZbMN.js";import{at as ls,T as tn,c as sn,am as _s,au as nn,av as ln,l as $t,W as vt,aw as an,d as rn,o as Ds,ar as on}from"./agent-icon-DicjSkHu.js";import{i as cn}from"./SwitchHorizontal01-Rgis0XWf.js";import{s as as}from"./Plus-2c1jULco.js";import{W as dn,m as ps,S as Is,C as ks,g as un,u as mn,h as fn,a as xn}from"./use-mcp-client-DseZ3Mea.js";import{u as gn,G as pn}from"./use-registry-app-Cy7ipz7c.js";import{d as rs,e as os,a as is,D as hn,h as yn,c as bn}from"./dialog-DUqhzGiD.js";import{b as jn,u as Nn}from"./use-connection-DM1ROgj3.js";import{g as vn}from"./github-repo-scope-DjMZbiKa.js";import{a as Sn}from"./authenticate-and-persist-oauth-CEv4KtcH.js";import{e as Cn}from"./extract-connection-data-_NDoBHMa.js";import{a as Es}from"./use-members-CncY3QG2.js";import{u as cs}from"./studio-tools-DIWsVaKg.js";import{t as wn,T as _n,S as ze}from"./decopilot-sse-pool-CEQrv8Fn.js";import{u as Dn}from"./use-decopilot-events-CX_EuT5c.js";import{a as In}from"./format-time-BnbuEtat.js";import{i as Ts}from"./AlertCircle-B9GlbKHh.js";import{i as ds}from"./CheckCircle-BEcdXH7-.js";import{a as kn}from"./DotsVertical-BmTi7wpl.js";import{s as En}from"./Eye-B-ZfWIGj.js";import{a as Ot,c as zt,d as ht,D as Rt}from"./dropdown-menu-D5BTIZvH.js";import{P as Yt,b as Vt,a as Wt}from"./popover-DwV6WXHS.js";import{b as As,C as $s,a as Oe,e as Pt,d as Os,c as zs}from"./command-3z1R7bvy.js";import{P as Xt,a as Tn,D as An,h as $n,j as On,C as zn,c as Rn}from"./calendar-Bxkf6gvE.js";import{u as Pn}from"./use-copy-DC217syR.js";import{i as qn}from"./ChevronUp-D5F6V6Tm.js";import{i as Fn}from"./ChevronRight-YmTewr_B.js";import{a as Mn}from"./Copy01-BkGYkmm-.js";import{n as Bn}from"./LinkExternal01-DO3QnLus.js";import{s as Jt}from"./User01-ByIE6k8L.js";import{i as hs}from"./X-Dif5I5BD.js";import{g as Ln,b as Un,e as Kn,f as Gn,a as Qn,D as Hn}from"./drawer-DvhdIHph.js";import{t as us}from"./ChevronDown-BSRiDjXd.js";import{i as Rs}from"./FilterLines-BwWG7tAk.js";import{s as Yn}from"./TrendUp01-CeRF_789.js";import{u as Vn}from"./shell-layout-6KUu0MA6.js";import{u as Wn}from"./hooks-DU-2h9eZ.js";import{u as Xn}from"./use-organization-settings-bBY4klS6.js";import{i as Ps}from"./XCircle-C0OdV3N_.js";import{f as Jn}from"./tab-id-BijBBRwE.js";import{u as Zt}from"./companions-core-C68sN4Wc.js";function Zn(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const Ja="__home__";function ms(t,e){return Ys.chatDraft(t,e)}function el(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function tl(t,e,n,a,l){const o=ms(e,n);if(Zn(a)){t.removeItem(o);return}const i={tiptapDoc:a,updatedAt:Date.now()},r=JSON.stringify(i);try{t.setItem(o,r)}catch(c){if(sl(c)){const u=new TextEncoder().encode(r).byteLength;l?.onQuotaExceeded?.({docSizeBytes:u});return}throw c}}function Za(t,e,n){const a=ms(e,n),l=t.getItem(a),o=el(l);return l!==null&&o===null&&t.removeItem(a),o}function er(t,e,n){t.removeItem(ms(e,n))}function sl(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}function nl(t){var e;const{char:n,allowSpaces:a,allowToIncludeChar:l,allowedPrefixes:o,startOfLine:i,$position:r}=t,c=a&&!l,u=On(n),x=new RegExp(`\\s${u}$`),m=i?"^":"",d=l?"":u,f=c?new RegExp(`${m}${u}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${m}(?:^)?${u}[^\\s${d}]*`,"gm"),j=((e=r.nodeBefore)==null?void 0:e.isText)&&r.nodeBefore.text;if(!j)return null;const p=r.pos-j.length,h=Array.from(j.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const g=h.input.slice(Math.max(0,h.index-1),h.index),y=new RegExp(`^[${o?.join("")}\0]?$`).test(g);if(o!==null&&!y)return null;const b=p+h.index;let v=b+h[0].length;return c&&x.test(j.slice(v-1,v+1))&&(h[0]+=" ",v+=1),b<r.pos&&v>=r.pos?{range:{from:b,to:v},query:h[0].slice(n.length),text:h[0]}:null}var ll=new Xt("suggestion");function al({pluginKey:t=ll,editor:e,char:n="@",allowSpaces:a=!1,allowToIncludeChar:l=!1,allowedPrefixes:o=[" "],startOfLine:i=!1,decorationTag:r="span",decorationClass:c="suggestion",decorationContent:u="",decorationEmptyClass:x="is-empty",command:m=()=>null,items:d=()=>[],render:f=()=>({}),allow:j=()=>!0,findSuggestionMatch:p=nl,shouldShow:h}){let g;const y=f?.(),b=()=>{const N=e.state.selection.$anchor.pos,_=e.view.coordsAtPos(N),{top:I,right:z,bottom:w,left:T}=_;try{return new DOMRect(T,I,z-T,w-I)}catch{return null}},v=(N,_)=>_?()=>{const I=t.getState(e.state),z=I?.decorationId,w=N.dom.querySelector(`[data-decoration-id="${z}"]`);return w?.getBoundingClientRect()||null}:b;function C(N,_){var I;try{const w=t.getState(N.state),T=w?.decorationId?N.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`):null,M={editor:e,range:w?.range||{from:0,to:0},query:w?.query||null,text:w?.text||null,items:[],command:F=>m({editor:e,range:w?.range||{from:0,to:0},props:F}),decorationNode:T,clientRect:v(N,T)};(I=y?.onExit)==null||I.call(y,M)}catch{}const z=N.state.tr.setMeta(_,{exit:!0});N.dispatch(z)}const E=new Tn({key:t,view(){return{update:async(N,_)=>{var I,z,w,T,M,F,L;const S=(I=this.key)==null?void 0:I.getState(_),A=(z=this.key)==null?void 0:z.getState(N.state),$=S.active&&A.active&&S.range.from!==A.range.from,Q=!S.active&&A.active,R=S.active&&!A.active,O=!Q&&!R&&S.query!==A.query,P=Q||$&&O,q=O||$,V=R||$&&O;if(!P&&!q&&!V)return;const H=V&&!P?S:A,Y=N.dom.querySelector(`[data-decoration-id="${H.decorationId}"]`);g={editor:e,range:H.range,query:H.query,text:H.text,items:[],command:ae=>m({editor:e,range:H.range,props:ae}),decorationNode:Y,clientRect:v(N,Y)},P&&((w=y?.onBeforeStart)==null||w.call(y,g)),q&&((T=y?.onBeforeUpdate)==null||T.call(y,g)),(q||P)&&(g.items=await d({editor:e,query:H.query})),V&&((M=y?.onExit)==null||M.call(y,g)),q&&((F=y?.onUpdate)==null||F.call(y,g)),P&&((L=y?.onStart)==null||L.call(y,g))},destroy:()=>{var N;g&&((N=y?.onExit)==null||N.call(y,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(N,_,I,z){const{isEditable:w}=e,{composing:T}=e.view,{selection:M}=N,{empty:F,from:L}=M,S={..._},A=N.getMeta(t);if(A&&A.exit)return S.active=!1,S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null,S;if(S.composing=T,w&&(F||e.view.composing)){(L<_.range.from||L>_.range.to)&&!T&&!_.composing&&(S.active=!1);const $=p({char:n,allowSpaces:a,allowToIncludeChar:l,allowedPrefixes:o,startOfLine:i,$position:M.$from}),Q=`id_${Math.floor(Math.random()*4294967295)}`;$&&j({editor:e,state:z,range:$.range,isActive:_.active})&&(!h||h({editor:e,range:$.range,query:$.query,text:$.text,transaction:N}))?(S.active=!0,S.decorationId=_.decorationId?_.decorationId:Q,S.range=$.range,S.query=$.query,S.text=$.text):S.active=!1}else S.active=!1;return S.active||(S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null),S}},props:{handleKeyDown(N,_){var I,z,w,T;const{active:M,range:F}=E.getState(N.state);if(!M)return!1;if(_.key==="Escape"||_.key==="Esc"){const S=E.getState(N.state),A=(I=g?.decorationNode)!=null?I:null,$=A??(S?.decorationId?N.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`):null);if(((z=y?.onKeyDown)==null?void 0:z.call(y,{view:N,event:_,range:S.range}))||!1)return!0;const R={editor:e,range:S.range,query:S.query,text:S.text,items:[],command:O=>m({editor:e,range:S.range,props:O}),decorationNode:$,clientRect:$?()=>$.getBoundingClientRect()||null:null};return(w=y?.onExit)==null||w.call(y,R),C(N,t),!0}return((T=y?.onKeyDown)==null?void 0:T.call(y,{view:N,event:_,range:F}))||!1},decorations(N){const{active:_,range:I,decorationId:z,query:w}=E.getState(N);if(!_)return null;const T=!w?.length,M=[c];return T&&M.push(x),An.create(N.doc,[$n.inline(I.from,I.to,{nodeName:r,class:M.join(" "),"data-decoration-id":z,"data-decoration-content":u})])}}});return E}function rl(t){const e=B.c(24),{editor:n,query:a,items:l,onSelect:o,onClose:i}=t,[r,c]=D.useState(0),u=D.useRef(l),x=D.useRef(r),m=D.useRef(o),d=D.useRef(i),f=D.useDeferredValue(a);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{c(0)},e[0]=j):j=e[0];let p;e[1]!==f?(p=[f],e[1]=f,e[2]=p):p=e[2],D.useEffect(j,p);let h,g;e[3]!==l.length||e[4]!==r?(h=()=>{r>=l.length&&l.length>0&&c(0)},g=[l.length,r],e[3]=l.length,e[4]=r,e[5]=h,e[6]=g):(h=e[5],g=e[6]),D.useEffect(h,g);let y,b;e[7]!==l?(y=()=>{u.current=l},b=[l],e[7]=l,e[8]=y,e[9]=b):(y=e[8],b=e[9]),D.useEffect(y,b);let v,C;e[10]!==r?(v=()=>{x.current=r},C=[r],e[10]=r,e[11]=v,e[12]=C):(v=e[11],C=e[12]),D.useEffect(v,C);let E,N;e[13]!==o?(N=()=>{m.current=o},E=[o],e[13]=o,e[14]=E,e[15]=N):(E=e[14],N=e[15]),D.useEffect(N,E);let _,I;e[16]!==i?(_=()=>{d.current=i},I=[i],e[16]=i,e[17]=_,e[18]=I):(_=e[17],I=e[18]),D.useEffect(_,I);let z,w;e[19]!==n?(z=()=>{if(n?.isDestroyed)return;let F;try{F=n.view.dom}catch{return}if(!F)return;const L=A=>{const $=u.current;if(!$.length)return!1;const Q=()=>c(O=>(O+1)%$.length),R=()=>c(O=>(O-1+$.length)%$.length);switch(A.key){case"ArrowUp":return A.preventDefault(),R(),!0;case"ArrowDown":return A.preventDefault(),Q(),!0;case"Tab":return A.preventDefault(),A.shiftKey?R():Q(),!0;case"Home":return A.preventDefault(),c(0),!0;case"End":return A.preventDefault(),c($.length-1),!0;case"Enter":{if(A.isComposing)return!1;A.preventDefault();const O=x.current;return O!==-1&&$[O]&&m.current?.($[O],O),!0}case"Escape":return A.preventDefault(),d.current?.(),!0;default:return!1}},S=A=>{L(A)};return F.addEventListener("keydown",S,!0),()=>{F?.removeEventListener("keydown",S,!0)}},w=[n],e[19]=n,e[20]=z,e[21]=w):(z=e[20],w=e[21]),D.useEffect(z,w);const T=l.length?r:void 0;let M;return e[22]!==T?(M={selectedIndex:T,setSelectedIndex:c},e[22]=T,e[23]=M):M=e[23],M}function ol(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const il=D.createContext(void 0);function cl(){const t=D.useContext(il);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function tr({editor:t,char:e,pluginKey:n,allow:a,onOpenChange:l}){const[o,i]=D.useReducer(ol,{open:!1,element:null,query:"",range:null,selectedItem:null}),r=D.useRef(l);return r.current=l,D.useEffect(()=>{if(t?.isDestroyed)return;const c=n instanceof Xt?n:new Xt(n);t.state.plugins.find(m=>m.spec.key===c)&&t.unregisterPlugin(c);const x=al({pluginKey:c,editor:t,char:e,allow(m){const d=t.state.doc.resolve(m.range.from);for(let f=d.depth;f>0;f--)if(d.node(f).type.name==="image")return!1;return!(a&&!a(m))},command(){},render:()=>({onStart:m=>{i({type:"ON_START",payload:{element:m.decorationNode??null,query:m.query,range:m.range}}),r.current?.(!0)},onUpdate:m=>{i({type:"ON_UPDATE",payload:{element:m.decorationNode??null,query:m.query,range:m.range}})},onKeyDown:m=>m.event.key==="Escape"?(i({type:"ON_EXIT"}),!0):!1,onExit:()=>{i({type:"ON_EXIT"}),r.current?.(!1)}}),items:()=>[]});return t.registerPlugin(x),()=>{t?.isDestroyed||t.unregisterPlugin(c)}},[t,n,e,i,a]),{state:o,dispatch:i}}function sr({editor:t,queryKey:e,queryFn:n,onSelect:a}){const{state:l,dispatch:o}=cl(),i=D.useDeferredValue(l.query),{data:r}=Vs({queryKey:pt.suggestionItems(e,l.open,i),queryFn:()=>l.open?n({query:i}):[]}),c=()=>{o({type:"ON_EXIT"})},u=async(m,d)=>{if(!(l.selectedItem!==null||!l.range)){o({type:"SET_SELECTED_ITEM",payload:m});try{const{view:f}=t,p=f.state.selection.$to.nodeAfter?.text?.startsWith(" "),h=l.range?{...l.range}:{from:0,to:0};p&&l.range&&(h.to+=1),await a({range:h,item:m})===!1?o({type:"SET_SELECTED_ITEM",payload:null}):c()}catch{c()}}},{selectedIndex:x}=rl({editor:t,query:i,items:r,onSelect:u,onClose:c});return{selectedItem:l.selectedItem,items:r,selectedIndex:x,close:c,onSelect:u}}function dl(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const ul=2e4;function ml(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function fl(){const t=B.c(17),{org:e}=Re(),n=dn.COMMERCE_DISCOVERY(e.id);let a;t[0]!==e.id||t[1]!==e.slug?(a=ps({connectionId:Is,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const{data:l}=gt(a),i=gt({queryKey:pt.commerceDiscoveryConnection(e.id,n),enabled:!!l,retry:!1,staleTime:6e4,queryFn:async()=>{if(!l)throw new Error("selfClient not ready");const b=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}});return Zt(b)}}).data?.item??null,{data:r}=gt({...ps({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!i}),c=pt.commerceDiscoveryDiagnostic(e.id,n),u=!!r;let x;t[3]!==r?(x=async()=>{if(!r)throw new Error("cdClient not ready");const b=await r.callTool({name:ks,arguments:{}});return Zt(b).diagnostic??null},t[3]=r,t[4]=x):x=t[4];let m;t[5]!==c||t[6]!==u||t[7]!==x?(m={queryKey:c,enabled:u,retry:1,refetchInterval:xl,queryFn:x},t[5]=c,t[6]=u,t[7]=x,t[8]=m):m=t[8];const d=gt(m),f=d.data??null,j=d.isSuccess,p=i?.metadata?.siteUrl;let h;t[9]!==p?(h=ml(p),t[9]=p,t[10]=h):h=t[10];const g=r??null;let y;return t[11]!==n||t[12]!==d.isSuccess||t[13]!==f||t[14]!==h||t[15]!==g?(y={diagnostic:f,isSuccess:j,host:h,connectionId:n,cdClient:g},t[11]=n,t[12]=d.isSuccess,t[13]=f,t[14]=h,t[15]=g,t[16]=y):y=t[16],y}function xl(t){return t.state.status!=="error"&&dl(t.state.data)==="generating"?ul:!1}function gl(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:un(t.id),main:Jn(e,ks)}}}function pl(t){const{org:e}=Re(),{data:n}=Ws.useSession(),a=jn(),l=ss(),o=mn({connectionId:Is,orgId:e.id,orgSlug:e.slug}),[i,r]=D.useState(!1),c=gn(t,{enabled:!1});return{connect:async()=>{if(!(i||!n?.user?.id||!e)){r(!0);try{const x=c.data??(await c.refetch()).data;if(!x){jt.error("Could not find this integration in the registry");return}const m=Cn(x,e.id,n.user.id,{remoteIndex:0});if(!m.connection_url){jt.error("This integration has no connection method available");return}const d=m.app_name?await hl(o,m.app_name):null,f=!d,j=d?.id??(await a.create.mutateAsync(m)).id,p=await Sn({connectionId:j,orgId:e.id,orgSlug:e.slug,persistFallback:h=>a.update.mutateAsync({id:j,data:{connection_token:h}}).then(()=>{})});if(p.ran&&!p.ok){if(f)try{await a.delete.mutateAsync(j)}catch{}jt.error(`Authentication failed: ${p.error??"no token"}`);return}Xs(l,e.id),jt.success(f?"Connected successfully":"Already connected")}catch(x){jt.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{r(!1)}}},isConnecting:i}}async function hl(t,e){return(await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_name"],operator:"eq",value:e},limit:1}})).structuredContent?.items?.[0]??null}function Te(t){const e=B.c(8),{size:n,className:a}=t,l=n===void 0?16:n;let o;e[0]!==l?(o={width:l,height:l},e[0]=l,e[1]=o):o=e[1];let i;e[2]!==a?(i=K("shrink-0 rounded-full object-cover",a),e[2]=a,e[3]=i):i=e[3];let r;return e[4]!==l||e[5]!==o||e[6]!==i?(r=s.jsx("img",{src:fn,alt:"Super Agent",width:l,height:l,style:o,className:i}),e[4]=l,e[5]=o,e[6]=i,e[7]=r):r=e[7],r}const ys=()=>0;function yl(t){const{orgSlug:e,enabled:n=!0,onUpdate:a,onDelete:l}=t,o=D.useRef(a);o.current=a;const i=D.useRef(l);i.current=l;const r=D.useRef(null),c=D.useRef(n),u=D.useRef(e);(!r.current||c.current!==n||u.current!==e)&&(c.current=n,u.current=e,r.current=m=>{if(!n||!e)return()=>{};const d=f=>{let j;try{j=JSON.parse(f.data)}catch{return}j.data&&(f.type===_n?i.current?.(j.data.id):o.current(j.data)),m()};return wn.subscribe(e,d)}),D.useSyncExternalStore(r.current,ys,ys)}function bl(){const t=B.c(27),{org:e,locator:n}=Re(),a=cs(),l=ss();let o;t[0]!==n?(o=pt.taskBoardItems(n),t[0]=n,t[1]=o):o=t[1];const i=o;let r;t[2]!==a?(r=async()=>(await a.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=a,t[3]=r):r=t[3];let c;t[4]!==i||t[5]!==r?(c={queryKey:i,queryFn:r},t[4]=i,t[5]=r,t[6]=c):c=t[6];const u=gt(c);let x,m;t[7]!==l||t[8]!==i?(x=g=>{l.setQueryData(i,y=>{const b=y??[],v=g;return b.some(C=>C.id===v.id)?b.map(C=>C.id===v.id?v:C):[v,...b]})},m=g=>{l.setQueryData(i,y=>y?.filter(b=>b.id!==g))},t[7]=l,t[8]=i,t[9]=x,t[10]=m):(x=t[9],m=t[10]);let d;t[11]!==e.slug||t[12]!==x||t[13]!==m?(d={orgSlug:e.slug,onUpdate:x,onDelete:m},t[11]=e.slug,t[12]=x,t[13]=m,t[14]=d):d=t[14],yl(d);let f;t[15]!==l||t[16]!==i?(f=g=>{const y=g.subject,b=g.data.status;l.setQueryData(i,v=>v?.map(C=>C.threads.some(E=>E.threadId===y)?{...C,threads:C.threads.map(E=>E.threadId===y?{...E,status:b}:E)}:C))},t[15]=l,t[16]=i,t[17]=f):f=t[17];let j;t[18]!==e.slug||t[19]!==f?(j={orgSlug:e.slug,onTaskStatus:f},t[18]=e.slug,t[19]=f,t[20]=j):j=t[20],Dn(j);let p;t[21]!==u.data?(p=u.data??[],t[21]=u.data,t[22]=p):p=t[22];let h;return t[23]!==u.error||t[24]!==u.isLoading||t[25]!==p?(h={items:p,isLoading:u.isLoading,error:u.error},t[23]=u.error,t[24]=u.isLoading,t[25]=p,t[26]=h):h=t[26],h}function jl(){const t=B.c(36),{locator:e}=Re(),n=cs(),a=ss();let l;t[0]!==e?(l=pt.taskBoardItems(e),t[0]=e,t[1]=l):l=t[1];const o=l;let i;t[2]!==a||t[3]!==o?(i=()=>a.invalidateQueries({queryKey:o}),t[2]=a,t[3]=o,t[4]=i):i=t[4];const r=i;let c;t[5]!==n?(c=N=>n.call("TASK_BOARD_ITEM_CREATE",N),t[5]=n,t[6]=c):c=t[6];let u;t[7]!==r||t[8]!==c?(u={mutationFn:c,onSuccess:r},t[7]=r,t[8]=c,t[9]=u):u=t[9];const x=At(u);let m;t[10]!==n?(m=N=>n.call("TASK_BOARD_ITEM_UPDATE",N),t[10]=n,t[11]=m):m=t[11];let d,f;t[12]!==a||t[13]!==o?(d=async N=>{await a.cancelQueries({queryKey:o});const _=a.getQueryData(o);return a.setQueryData(o,I=>I?.map(z=>z.id===N.id?{...z,...N}:z)),{previous:_}},f=(N,_,I)=>{I?.previous&&a.setQueryData(o,I.previous)},t[12]=a,t[13]=o,t[14]=d,t[15]=f):(d=t[14],f=t[15]);let j;t[16]!==r||t[17]!==m||t[18]!==d||t[19]!==f?(j={mutationFn:m,onMutate:d,onError:f,onSettled:r},t[16]=r,t[17]=m,t[18]=d,t[19]=f,t[20]=j):j=t[20];const p=At(j);let h;t[21]!==n?(h=N=>n.call("TASK_BOARD_ITEM_DELETE",{id:N}),t[21]=n,t[22]=h):h=t[22];let g;t[23]!==r||t[24]!==h?(g={mutationFn:h,onSuccess:r},t[23]=r,t[24]=h,t[25]=g):g=t[25];const y=At(g);let b;t[26]!==n?(b=N=>n.call("TASK_BOARD_ITEM_UPDATE",N),t[26]=n,t[27]=b):b=t[27];let v;t[28]!==r||t[29]!==b?(v={mutationFn:b,onSuccess:r},t[28]=r,t[29]=b,t[30]=v):v=t[30];const C=At(v);let E;return t[31]!==x||t[32]!==C||t[33]!==y||t[34]!==p?(E={create:x,update:p,remove:y,link:C},t[31]=x,t[32]=C,t[33]=y,t[34]=p,t[35]=E):E=t[35],E}function es(t){return t.threads.some(e=>e.status==="requires_action")}function Nl(t){return t.threads[0]}const qs=["triage","todo","in_progress","in_review","done"],ve={triage:{label:"Backlog",icon:Ts,iconClassName:"text-muted-foreground"},todo:{label:"To Do",icon:kn,iconClassName:"text-muted-foreground"},in_progress:{label:"In Progress",icon:ls,iconClassName:"text-primary"},in_review:{label:"In Review",icon:En,iconClassName:"text-warning"},done:{label:"Done",icon:ds,iconClassName:"text-success"}},Fs=["none","low","medium","high","urgent"],we={none:{label:"No priority",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50"},low:{label:"Low",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40"},medium:{label:"Medium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500"},high:{label:"High",flagClassName:"text-warning",dotClassName:"bg-warning"},urgent:{label:"Urgent",flagClassName:"text-destructive",dotClassName:"bg-destructive"}};function vl(t){const e=B.c(10),{locator:n}=Re(),a=cs();let l;e[0]!==t||e[1]!==n?(l=pt.taskBoardItemPrs(n,t??""),e[0]=t,e[1]=n,e[2]=l):l=e[2];const o=!!t;let i;e[3]!==t||e[4]!==a?(i=async()=>(await a.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:t})).prs,e[3]=t,e[4]=a,e[5]=i):i=e[5];let r;return e[6]!==l||e[7]!==o||e[8]!==i?(r={queryKey:l,enabled:o,queryFn:i},e[6]=l,e[7]=o,e[8]=i,e[9]=r):r=e[9],gt(r)}function Sl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function bs(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const Cl=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Nt="inline-flex h-9 items-center gap-2 rounded-lg border border-border px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted sm:border-transparent",wl={failed:{label:"Error",className:"text-destructive",icon:nn},requires_action:{label:"Needs input",className:"text-warning",icon:_s},in_progress:{label:"Running",className:"text-primary",icon:ls,spin:!0},completed:{label:"Completed",className:"text-success",icon:ds},expired:{label:"Expired",className:"text-muted-foreground",icon:Ts}};function _l(t){const e=B.c(188),{open:n,onClose:a,item:l,defaultStatus:o,onSubmit:i,onDelete:r,onOpenThread:c,onNewChat:u,isSaving:x}=t,{data:m}=Es(),d=m?.data?.members??[],{handleCopy:f,copied:j}=Pn(),[p,h]=D.useState(l?.title??""),[g,y]=D.useState(l?.description??""),[b,v]=D.useState(l?.status??o??"triage"),[C,E]=D.useState(l?.priority??"medium"),[N,_]=D.useState(l?.assigneeId??null),I=l?.dueDate;let z;e[0]!==I?(z=bs(I),e[0]=I,e[1]=z):z=e[1];const[w,T]=D.useState(z),[M,F]=D.useState(!1),[L,S]=D.useState(!1);let A;e[2]!==o||e[3]!==l?.assigneeId||e[4]!==l?.description||e[5]!==l?.dueDate||e[6]!==l?.priority||e[7]!==l?.status||e[8]!==l?.title||e[9]!==_||e[10]!==T?(A=()=>{h(l?.title??""),y(l?.description??""),v(l?.status??o??"triage"),E(l?.priority??"medium"),_(l?.assigneeId??null),T(bs(l?.dueDate))},e[2]=o,e[3]=l?.assigneeId,e[4]=l?.description,e[5]=l?.dueDate,e[6]=l?.priority,e[7]=l?.status,e[8]=l?.title,e[9]=_,e[10]=T,e[11]=A):A=e[11];const $=A;let Q;e[12]!==a||e[13]!==$?(Q=()=>{a(),$()},e[12]=a,e[13]=$,e[14]=Q):Q=e[14];const R=Q;let O;e[15]!==N||e[16]!==g||e[17]!==w||e[18]!==i||e[19]!==C||e[20]!==b||e[21]!==p?(O=()=>{const k=p.trim();k&&i({title:k,description:g.trim()||null,status:b,priority:C,assigneeId:N,dueDate:w?Sl(w):null})},e[15]=N,e[16]=g,e[17]=w,e[18]=i,e[19]=C,e[20]=b,e[21]=p,e[22]=O):O=e[22];const P=O,q=N===ze;let V;e[23]!==N?(V=k=>k.userId===N,e[23]=N,e[24]=V):V=e[24];const H=d.find(V),Y=l?.assignedBy?d.find(k=>k.userId===l.assignedBy):void 0,ae=ve[b].icon,re=os;let fe;e[25]!==R?(fe=k=>!k&&R(),e[25]=R,e[26]=fe):fe=e[26];const Ae=rs,yt="flex max-h-[90vh] flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:h-[85vh] sm:max-h-[640px] sm:max-w-[850px]",bt="hidden",xe=l?"Edit task":"New task";let J;e[27]!==xe?(J=s.jsx(is,{className:"sr-only",children:xe}),e[27]=xe,e[28]=J):J=e[28];let ie;e[29]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(hs,{size:16}),e[29]=ie):ie=e[29];let Z;e[30]!==R?(Z=s.jsx("button",{type:"button","aria-label":"Close",onClick:R,className:"absolute right-2.5 top-2.5 z-10 flex size-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:ie}),e[30]=R,e[31]=Z):Z=e[31];const _e="flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden";let ce;e[32]===Symbol.for("react.memo_cache_sentinel")?(ce=k=>{h(k.target.value),k.target.style.height="auto",k.target.style.height=`${k.target.scrollHeight}px`},e[32]=ce):ce=e[32];let de;e[33]!==p?(de=s.jsx("textarea",{ref:Il,value:p,onChange:ce,onKeyDown:Dl,placeholder:"Task title...",autoFocus:!0,rows:1,className:"w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30"}),e[33]=p,e[34]=de):de=e[34];let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=k=>y(k.target.value),e[35]=G):G=e[35];let W;e[36]!==g?(W=s.jsx("textarea",{value:g,onChange:G,placeholder:"Describe a task for an agent...",className:"min-h-[96px] w-full flex-1 resize-none border-0 bg-transparent text-[15px] leading-relaxed text-foreground outline-none placeholder:text-muted-foreground/50 sm:min-h-[120px]"}),e[36]=g,e[37]=W):W=e[37];let X;e[38]!==j||e[39]!==g||e[40]!==f?(X=g&&s.jsx(oe,{type:"button",variant:"ghost",size:"icon","aria-label":"Copy description",className:"absolute right-0 top-0 size-7 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100",onClick:()=>f(g),children:j?s.jsx(qn,{size:14}):s.jsx(Mn,{size:14})}),e[38]=j,e[39]=g,e[40]=f,e[41]=X):X=e[41];let ge;e[42]!==W||e[43]!==X?(ge=s.jsxs("div",{className:"group relative flex flex-1 flex-col",children:[W,X]}),e[42]=W,e[43]=X,e[44]=ge):ge=e[44];const De=l&&l.threads.length>0&&s.jsx("div",{className:"flex flex-col gap-2",children:l.threads.map(k=>s.jsx(kl,{thread:k,startedBy:Y??H,onOpen:c},k.threadId))});let Ie;e[45]!==l?(Ie=l?.id&&s.jsx(Al,{itemId:l.id}),e[45]=l,e[46]=Ie):Ie=e[46];let ue;e[47]!==de||e[48]!==ge||e[49]!==De||e[50]!==Ie?(ue=s.jsxs("div",{className:"flex min-w-0 flex-col gap-6 p-6 sm:flex-1 sm:overflow-y-auto sm:p-8",children:[de,ge,De,Ie]}),e[47]=de,e[48]=ge,e[49]=De,e[50]=Ie,e[51]=ue):ue=e[51];const xs="flex w-full shrink-0 flex-col gap-4 border-t border-border p-6 sm:w-[220px] sm:border-t-0 sm:border-l sm:px-6 sm:py-10";let be;e[52]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:"Properties"}),e[52]=be):be=e[52];const Pe="flex flex-wrap gap-2 sm:flex-col",ke=ve[b];let ee;e[53]!==ae||e[54]!==ke.iconClassName?(ee=s.jsx(ae,{size:16,className:ke.iconClassName}),e[53]=ae,e[54]=ke.iconClassName,e[55]=ee):ee=e[55];const pe=ve[b];let he;e[56]!==ee||e[57]!==pe.label?(he=s.jsx(Ot,{asChild:!0,children:s.jsxs("button",{type:"button",className:Nt,children:[ee,pe.label]})}),e[56]=ee,e[57]=pe.label,e[58]=he):he=e[58];let je;e[59]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(zt,{align:"start",className:"w-44",children:qs.map(k=>{const ye=ve[k].icon;return s.jsxs(ht,{onSelect:()=>v(k),className:"gap-2",children:[s.jsx(ye,{size:16,className:ve[k].iconClassName}),ve[k].label]},k)})}),e[59]=je):je=e[59];let te;e[60]!==he?(te=s.jsxs(Rt,{children:[he,je]}),e[60]=he,e[61]=te):te=e[61];const $e=C==="none"&&"text-muted-foreground";let me;e[62]!==$e?(me=K(Nt,$e),e[62]=$e,e[63]=me):me=e[63];let se;e[64]!==C?(se=C==="none"?s.jsxs(s.Fragment,{children:[s.jsx(tn,{size:16}),"Set priority"]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:K("size-2 rounded-full",we[C].dotClassName)}),we[C].label]}),e[64]=C,e[65]=se):se=e[65];let ne;e[66]!==me||e[67]!==se?(ne=s.jsx(Ot,{asChild:!0,children:s.jsx("button",{type:"button",className:me,children:se})}),e[66]=me,e[67]=se,e[68]=ne):ne=e[68];let Ne;e[69]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(zt,{align:"start",className:"w-40",children:Fs.map(k=>s.jsxs(ht,{onSelect:()=>E(k),children:[s.jsx("span",{className:K("size-2 rounded-full",we[k].dotClassName)}),we[k].label]},k))}),e[69]=Ne):Ne=e[69];let le;e[70]!==ne?(le=s.jsxs(Rt,{children:[ne,Ne]}),e[70]=ne,e[71]=le):le=e[71];const Ee="flex flex-col",U=Vt,Mt=!0,Bt=Yt,Qs=!0,Hs="button",Lt=!N&&"text-muted-foreground";let qe;e[72]!==Lt?(qe=K(Nt,Lt),e[72]=Lt,e[73]=qe):qe=e[73];const Ut=q&&Y?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[s.jsx(Ce,{url:Y.user?.image??void 0,fallback:Se(Y.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:Y.user?.name??"Super Agent"})]}),s.jsxs("span",{className:"flex items-center gap-2 sm:hidden",children:[s.jsxs("span",{className:"inline-flex items-center",children:[s.jsx(Ce,{url:Y.user?.image??void 0,fallback:Se(Y.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),s.jsx(Te,{size:16,className:"ring-2 ring-background"})]}),"Super Agent"]})]}):q?s.jsxs(s.Fragment,{children:[s.jsx(Te,{size:16}),"Super Agent"]}):H?s.jsxs(s.Fragment,{children:[s.jsx(Ce,{url:H.user?.image??void 0,fallback:Se(H.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:H.user?.name??"Unassigned"})]}):s.jsxs(s.Fragment,{children:[s.jsx(sn,{size:16,className:"text-muted-foreground"}),"Assign"]});let Fe;e[74]!==qe||e[75]!==Ut?(Fe=s.jsx("button",{type:Hs,className:qe,children:Ut}),e[74]=qe,e[75]=Ut,e[76]=Fe):Fe=e[76];let Me;e[77]!==Bt||e[78]!==Fe?(Me=s.jsx(Bt,{asChild:Qs,children:Fe}),e[77]=Bt,e[78]=Fe,e[79]=Me):Me=e[79];let St;e[80]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(As,{placeholder:"Assign to…",className:"h-9"}),e[80]=St):St=e[80];let Ct;e[81]===Symbol.for("react.memo_cache_sentinel")?(Ct=s.jsx($s,{children:"No members found."}),e[81]=Ct):Ct=e[81];let Be;e[82]!==_||e[83]!==S?(Be=()=>{_(ze),S(!1)},e[82]=_,e[83]=S,e[84]=Be):Be=e[84];let wt,_t;e[85]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(Te,{size:16}),_t=s.jsx("span",{className:"truncate",children:"Super Agent"}),e[85]=wt,e[86]=_t):(wt=e[85],_t=e[86]);let Le;e[87]!==Be?(Le=s.jsxs(Oe,{value:"Super Agent",onSelect:Be,className:"gap-2",children:[wt,_t]}),e[87]=Be,e[88]=Le):Le=e[88];let Ue;e[89]!==_||e[90]!==S?(Ue=()=>{_(null),S(!1)},e[89]=_,e[90]=S,e[91]=Ue):Ue=e[91];let Dt,It;e[92]===Symbol.for("react.memo_cache_sentinel")?(Dt=s.jsx(Jt,{size:16,className:"text-muted-foreground"}),It=s.jsx("span",{className:"truncate",children:"Unassigned"}),e[92]=Dt,e[93]=It):(Dt=e[92],It=e[93]);let Ke;e[94]!==Ue?(Ke=s.jsxs(Oe,{value:"Unassigned",onSelect:Ue,className:"gap-2",children:[Dt,It]}),e[94]=Ue,e[95]=Ke):Ke=e[95];let Ge;e[96]!==Le||e[97]!==Ke?(Ge=s.jsxs(Pt,{children:[Le,Ke]}),e[96]=Le,e[97]=Ke,e[98]=Ge):Ge=e[98];let Qe;if(e[99]!==d||e[100]!==_||e[101]!==S){let k;e[103]!==_||e[104]!==S?(k=ye=>s.jsxs(Oe,{value:ye.user?.name??ye.userId,onSelect:()=>{_(ye.userId),S(!1)},className:"gap-2",children:[s.jsx(Ce,{url:ye.user?.image??void 0,fallback:Se(ye.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:ye.user?.name??ye.userId})]},ye.userId),e[103]=_,e[104]=S,e[105]=k):k=e[105],Qe=d.map(k),e[99]=d,e[100]=_,e[101]=S,e[102]=Qe}else Qe=e[102];let He;e[106]!==Qe?(He=s.jsx(Pt,{heading:"Members",children:Qe}),e[106]=Qe,e[107]=He):He=e[107];let Ye;e[108]!==Ge||e[109]!==He?(Ye=s.jsx(Wt,{align:"start",className:"w-56 p-0",children:s.jsxs(Os,{children:[St,s.jsxs(zs,{children:[Ct,Ge,He]})]})}),e[108]=Ge,e[109]=He,e[110]=Ye):Ye=e[110];let Ve;e[111]!==U||e[112]!==L||e[113]!==S||e[114]!==Me||e[115]!==Ye?(Ve=s.jsxs(U,{open:L,onOpenChange:S,modal:Mt,children:[Me,Ye]}),e[111]=U,e[112]=L,e[113]=S,e[114]=Me,e[115]=Ye,e[116]=Ve):Ve=e[116];let We;e[117]!==Y||e[118]!==q?(We=q&&Y&&s.jsxs("div",{className:"relative mt-1.5 hidden items-center pl-5 sm:flex",children:[s.jsx("span",{className:"absolute -top-1.5 left-5 h-[calc(50%+0.375rem)] w-2.5 rounded-bl-md border-b border-l border-border"}),s.jsxs("span",{className:K(Nt,"pointer-events-none"),children:[s.jsx(Te,{size:16}),"Super Agent"]})]}),e[117]=Y,e[118]=q,e[119]=We):We=e[119];let Xe;e[120]!==Ve||e[121]!==We?(Xe=s.jsxs("div",{className:Ee,children:[Ve,We]}),e[120]=Ve,e[121]=We,e[122]=Xe):Xe=e[122];const Kt=!w&&"text-muted-foreground";let Je;e[123]!==Kt?(Je=K(Nt,Kt),e[123]=Kt,e[124]=Je):Je=e[124];let kt;e[125]===Symbol.for("react.memo_cache_sentinel")?(kt=s.jsx(vt,{size:16,className:"text-muted-foreground"}),e[125]=kt):kt=e[125];let Ze;e[126]!==w?(Ze=w?Cl.format(w):"Due date",e[126]=w,e[127]=Ze):Ze=e[127];let et;e[128]!==w||e[129]!==T?(et=w&&s.jsx("span",{role:"button",tabIndex:0,"aria-label":"Clear due date",className:"-mr-1 ml-0.5 flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onClick:k=>{k.stopPropagation(),T(null)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),T(null))},children:s.jsx(hs,{size:12})}),e[128]=w,e[129]=T,e[130]=et):et=e[130];let tt;e[131]!==Je||e[132]!==Ze||e[133]!==et?(tt=s.jsx(Yt,{asChild:!0,children:s.jsxs("button",{type:"button",className:Je,children:[kt,Ze,et]})}),e[131]=Je,e[132]=Ze,e[133]=et,e[134]=tt):tt=e[134];const Gt=w??void 0;let st;e[135]!==T||e[136]!==F?(st=k=>{T(k??null),k&&F(!1)},e[135]=T,e[136]=F,e[137]=st):st=e[137];let nt;e[138]!==Gt||e[139]!==st?(nt=s.jsx(Wt,{className:"w-auto p-0",align:"start",children:s.jsx(zn,{mode:"single",selected:Gt,onSelect:st,initialFocus:!0})}),e[138]=Gt,e[139]=st,e[140]=nt):nt=e[140];let lt;e[141]!==M||e[142]!==F||e[143]!==tt||e[144]!==nt?(lt=s.jsxs(Vt,{open:M,onOpenChange:F,children:[tt,nt]}),e[141]=M,e[142]=F,e[143]=tt,e[144]=nt,e[145]=lt):lt=e[145];let at;e[146]!==te||e[147]!==le||e[148]!==Xe||e[149]!==lt?(at=s.jsxs("div",{className:Pe,children:[te,le,Xe,lt]}),e[146]=te,e[147]=le,e[148]=Xe,e[149]=lt,e[150]=at):at=e[150];let rt;e[151]!==be||e[152]!==at?(rt=s.jsxs("div",{className:xs,children:[be,at]}),e[151]=be,e[152]=at,e[153]=rt):rt=e[153];let ot;e[154]!==ue||e[155]!==rt?(ot=s.jsxs("div",{className:_e,children:[ue,rt]}),e[154]=ue,e[155]=rt,e[156]=ot):ot=e[156];let it;e[157]!==l||e[158]!==r?(it=l&&r?s.jsx(oe,{variant:"ghost",size:"icon","aria-label":"Delete task",className:"size-10 text-muted-foreground hover:text-destructive",onClick:r,children:s.jsx(an,{size:16})}):s.jsx("span",{}),e[157]=l,e[158]=r,e[159]=it):it=e[159];let ct;e[160]!==l||e[161]!==u?(ct=l&&u&&s.jsxs(oe,{variant:"outline",size:"sm",onClick:u,children:[s.jsx(rn,{size:16}),"New chat"]}),e[160]=l,e[161]=u,e[162]=ct):ct=e[162];let dt;e[163]!==x||e[164]!==p?(dt=!p.trim()||x,e[163]=x,e[164]=p,e[165]=dt):dt=e[165];let Et;e[166]===Symbol.for("react.memo_cache_sentinel")?(Et=s.jsx(as,{size:16}),e[166]=Et):Et=e[166];const Qt=l?"Save":"Create task";let ut;e[167]!==P||e[168]!==dt||e[169]!==Qt?(ut=s.jsxs(oe,{size:"sm",disabled:dt,onClick:P,children:[Et,Qt]}),e[167]=P,e[168]=dt,e[169]=Qt,e[170]=ut):ut=e[170];let mt;e[171]!==ct||e[172]!==ut?(mt=s.jsxs("div",{className:"flex items-center gap-2",children:[ct,ut]}),e[171]=ct,e[172]=ut,e[173]=mt):mt=e[173];let ft;e[174]!==it||e[175]!==mt?(ft=s.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[it,mt]}),e[174]=it,e[175]=mt,e[176]=ft):ft=e[176];let xt;e[177]!==Ae||e[178]!==J||e[179]!==Z||e[180]!==ot||e[181]!==ft?(xt=s.jsxs(Ae,{className:yt,closeButtonClassName:bt,children:[J,Z,ot,ft]}),e[177]=Ae,e[178]=J,e[179]=Z,e[180]=ot,e[181]=ft,e[182]=xt):xt=e[182];let Tt;return e[183]!==re||e[184]!==n||e[185]!==fe||e[186]!==xt?(Tt=s.jsx(re,{open:n,onOpenChange:fe,children:xt}),e[183]=re,e[184]=n,e[185]=fe,e[186]=xt,e[187]=Tt):Tt=e[187],Tt}function Dl(t){t.key==="Enter"&&t.preventDefault()}function Il(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function kl(t){const e=B.c(16),{thread:n,startedBy:a,onOpen:l}=t,o=n.status?wl[n.status]:null,i=n.lastMessage;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Te,{size:16}),e[0]=r):r=e[0];const c=n.title||"Super Agent";let u;e[1]!==c?(u=s.jsx("span",{className:"truncate text-sm text-foreground",children:c}),e[1]=c,e[2]=u):u=e[2];let x;e[3]!==a?(x=a&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-sm text-muted-foreground/50",children:"started by"}),s.jsx(Ce,{url:a.user?.image??void 0,fallback:Se(a.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate text-sm text-foreground",children:a.user?.name??"someone"})]}),e[3]=a,e[4]=x):x=e[4];let m;e[5]!==u||e[6]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3.5",children:[r,u,x]}),e[5]=u,e[6]=x,e[7]=m):m=e[7];let d;e[8]!==i||e[9]!==l||e[10]!==o||e[11]!==n?(d=o&&s.jsxs("button",{type:"button",disabled:!l,onClick:()=>l?.(n),className:"flex items-center gap-2 border-t border-border px-4 py-2 text-left transition-colors enabled:hover:bg-muted disabled:cursor-default",children:[s.jsxs("span",{className:K("flex items-center gap-1.5",o.className),children:[s.jsx(o.icon,{size:16,className:K(o.spin&&"animate-spin")}),s.jsx("span",{className:"text-sm",children:o.label})]}),i&&s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:i}),l&&s.jsx(Fn,{size:16,className:"ml-auto shrink-0 text-muted-foreground"})]}),e[8]=i,e[9]=l,e[10]=o,e[11]=n,e[12]=d):d=e[12];let f;return e[13]!==m||e[14]!==d?(f=s.jsxs("div",{className:"flex flex-col overflow-hidden rounded-lg border border-border",children:[m,d]}),e[13]=m,e[14]=d,e[15]=f):f=e[15],f}function El(t){return t.merged?{label:"Merged",className:"text-special",icon:ln}:t.state==="closed"?{label:"Closed",className:"text-destructive",icon:$t}:t.draft?{label:"Draft",className:"text-muted-foreground",icon:$t}:{label:"Open",className:"text-success",icon:$t}}function Tl(t){const e=B.c(38),{pr:n}=t;let a,l,o,i,r,c,u,x;if(e[0]!==n){l=El(n);let C;e[9]!==n.body?(C=n.body?.trim(),e[9]=n.body,e[10]=C):C=e[10],a=C,r=n.url,c="_blank",u="noreferrer",x="flex flex-col gap-1 border-t border-border px-4 py-2 transition-colors hover:bg-muted",i="flex items-center gap-2",o=K("flex items-center gap-1.5",l.className),e[0]=n,e[1]=a,e[2]=l,e[3]=o,e[4]=i,e[5]=r,e[6]=c,e[7]=u,e[8]=x}else a=e[1],l=e[2],o=e[3],i=e[4],r=e[5],c=e[6],u=e[7],x=e[8];let m;e[11]!==l.icon?(m=s.jsx(l.icon,{size:16}),e[11]=l.icon,e[12]=m):m=e[12];let d;e[13]!==l.label?(d=s.jsx("span",{className:"text-sm",children:l.label}),e[13]=l.label,e[14]=d):d=e[14];let f;e[15]!==o||e[16]!==m||e[17]!==d?(f=s.jsxs("span",{className:o,children:[m,d]}),e[15]=o,e[16]=m,e[17]=d,e[18]=f):f=e[18];const j=n.title??`${n.repoOwner}/${n.repoName}`;let p;e[19]!==j?(p=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:j}),e[19]=j,e[20]=p):p=e[20];let h;e[21]!==n.number?(h=s.jsxs("span",{className:"shrink-0 text-sm text-muted-foreground",children:["#",n.number]}),e[21]=n.number,e[22]=h):h=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Bn,{size:16,className:"shrink-0 text-muted-foreground"}),e[23]=g):g=e[23];let y;e[24]!==p||e[25]!==h||e[26]!==i||e[27]!==f?(y=s.jsxs("span",{className:i,children:[f,p,h,g]}),e[24]=p,e[25]=h,e[26]=i,e[27]=f,e[28]=y):y=e[28];let b;e[29]!==a?(b=a?s.jsx("span",{className:"line-clamp-3 whitespace-pre-line text-xs text-muted-foreground",children:a}):null,e[29]=a,e[30]=b):b=e[30];let v;return e[31]!==y||e[32]!==b||e[33]!==r||e[34]!==c||e[35]!==u||e[36]!==x?(v=s.jsxs("a",{href:r,target:c,rel:u,className:x,children:[y,b]}),e[31]=y,e[32]=b,e[33]=r,e[34]=c,e[35]=u,e[36]=x,e[37]=v):v=e[37],v}function Al(t){const e=B.c(5),{itemId:n}=t,{data:a,isLoading:l}=vl(n);if(!l&&(!a||a.length===0))return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3.5",children:[s.jsx($t,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm text-foreground",children:"Pull requests"})]}),e[0]=o):o=e[0];let i;e[1]!==a?(i=a?a.map($l):s.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-4 py-2 text-sm text-muted-foreground",children:[s.jsx(ls,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Loading…"})]}),e[1]=a,e[2]=i):i=e[2];let r;return e[3]!==i?(r=s.jsxs("div",{className:"flex flex-col overflow-hidden rounded-lg border border-border",children:[o,i]}),e[3]=i,e[4]=r):r=e[4],r}function $l(t){return s.jsx(Tl,{pr:t},t.url)}const ts="__unassigned__",qt={assignee:null,priority:null,due:null};function Ol(t){return t.assignee!==null||t.priority!==null||t.due!==null}function zl(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const Rl=864e5;function Pl(t,e){const n=new Date(t),a=new Date(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()}function ql(t,e){if(e.assignee!==null){if(e.assignee===ts){if(t.assigneeId!==null)return!1}else if(t.assigneeId!==e.assignee)return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const n=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&n>=a||e.due==="today"&&!Pl(n,a)||e.due==="week"&&(n<a||n>a+7*Rl))return!1}return!0}const js=[{value:"overdue",label:"Overdue"},{value:"today",label:"Due today"},{value:"week",label:"Due this week"},{value:"none",label:"No due date"}];function Ft(t,e=!1){return K("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Fl(t){const e=B.c(62),{value:n,members:a,onChange:l,block:o}=t,[i,r]=D.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Jt,{size:14,className:"shrink-0"}),e[0]=c):c=e[0];let u=c,x="Assignee";if(n===ts)x="Unassigned";else if(n===ze){let R;e[1]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Te,{size:14}),e[1]=R):R=e[1],u=R,x="Super Agent"}else if(n){let R,O,P,q;if(e[2]!==a||e[3]!==n){let H;e[8]!==n?(H=Y=>Y.userId===n,e[8]=n,e[9]=H):H=e[9],O=a.find(H),R=Ce,P=O?.user?.image??void 0,q=Se(O?.user?.name),e[2]=a,e[3]=n,e[4]=R,e[5]=O,e[6]=P,e[7]=q}else R=e[4],O=e[5],P=e[6],q=e[7];let V;e[10]!==R||e[11]!==P||e[12]!==q?(V=s.jsx(R,{url:P,fallback:q,shape:"circle",size:"2xs"}),e[10]=R,e[11]=P,e[12]=q,e[13]=V):V=e[13],u=V,x=O?.user?.name??"Member"}let m;e[14]!==l?(m=R=>{l(R),r(!1)},e[14]=l,e[15]=m):m=e[15];const d=m,f=n!==null;let j;e[16]!==o||e[17]!==f?(j=Ft(f,o),e[16]=o,e[17]=f,e[18]=j):j=e[18];const p=j,h=o&&"ml-auto";let g;e[19]!==h?(g=K("shrink-0 opacity-60",h),e[19]=h,e[20]=g):g=e[20];const y=g;let b;e[21]!==x?(b=s.jsx("span",{className:"max-w-[10rem] truncate",children:x}),e[21]=x,e[22]=b):b=e[22];let v;e[23]!==y?(v=s.jsx(us,{size:12,className:y}),e[23]=y,e[24]=v):v=e[24];let C;e[25]!==u||e[26]!==b||e[27]!==v||e[28]!==p?(C=s.jsx(Yt,{asChild:!0,children:s.jsxs("button",{type:"button",className:p,children:[u,b,v]})}),e[25]=u,e[26]=b,e[27]=v,e[28]=p,e[29]=C):C=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(As,{placeholder:"Filter by assignee…",className:"h-9"}),e[30]=E):E=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx($s,{children:"No members found."}),e[31]=N):N=e[31];let _;e[32]!==d?(_=s.jsx(Oe,{value:"Anyone",onSelect:()=>d(null),children:"Anyone"}),e[32]=d,e[33]=_):_=e[33];let I;e[34]!==d?(I=()=>d(ts),e[34]=d,e[35]=I):I=e[35];let z;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Jt,{size:16,className:"text-muted-foreground"}),e[36]=z):z=e[36];let w;e[37]!==I?(w=s.jsxs(Oe,{value:"Unassigned",onSelect:I,className:"gap-2",children:[z,"Unassigned"]}),e[37]=I,e[38]=w):w=e[38];let T;e[39]!==d?(T=()=>d(ze),e[39]=d,e[40]=T):T=e[40];let M;e[41]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Te,{size:16}),e[41]=M):M=e[41];let F;e[42]!==T?(F=s.jsxs(Oe,{value:"Super Agent",onSelect:T,className:"gap-2",children:[M,"Super Agent"]}),e[42]=T,e[43]=F):F=e[43];let L;e[44]!==_||e[45]!==w||e[46]!==F?(L=s.jsxs(Pt,{children:[_,w,F]}),e[44]=_,e[45]=w,e[46]=F,e[47]=L):L=e[47];let S;if(e[48]!==a||e[49]!==d){let R;e[51]!==d?(R=O=>s.jsxs(Oe,{value:O.user?.name??O.userId,onSelect:()=>d(O.userId),className:"gap-2",children:[s.jsx(Ce,{url:O.user?.image??void 0,fallback:Se(O.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:O.user?.name??O.userId})]},O.userId),e[51]=d,e[52]=R):R=e[52],S=a.map(R),e[48]=a,e[49]=d,e[50]=S}else S=e[50];let A;e[53]!==S?(A=s.jsx(Pt,{heading:"Members",children:S}),e[53]=S,e[54]=A):A=e[54];let $;e[55]!==L||e[56]!==A?($=s.jsx(Wt,{align:"start",className:"w-56 p-0",children:s.jsxs(Os,{children:[E,s.jsxs(zs,{children:[N,L,A]})]})}),e[55]=L,e[56]=A,e[57]=$):$=e[57];let Q;return e[58]!==i||e[59]!==$||e[60]!==C?(Q=s.jsxs(Vt,{open:i,onOpenChange:r,children:[C,$]}),e[58]=i,e[59]=$,e[60]=C,e[61]=Q):Q=e[61],Q}function Ml(t){const e=B.c(23),{value:n,onChange:a,block:l}=t,o=n!==null;let i;e[0]!==l||e[1]!==o?(i=Ft(o,l),e[0]=l,e[1]=o,e[2]=i):i=e[2];const r=i,c=l&&"ml-auto";let u;e[3]!==c?(u=K("shrink-0 opacity-60",c),e[3]=c,e[4]=u):u=e[4];const x=u;let m;e[5]!==n?(m=n?s.jsx("span",{className:K("size-2 shrink-0 rounded-full",we[n].dotClassName)}):s.jsx(Yn,{size:14,className:"shrink-0"}),e[5]=n,e[6]=m):m=e[6];const d=n?we[n].label:"Priority";let f;e[7]!==x?(f=s.jsx(us,{size:12,className:x}),e[7]=x,e[8]=f):f=e[8];let j;e[9]!==m||e[10]!==d||e[11]!==f||e[12]!==r?(j=s.jsx(Ot,{asChild:!0,children:s.jsxs("button",{type:"button",className:r,children:[m,d,f]})}),e[9]=m,e[10]=d,e[11]=f,e[12]=r,e[13]=j):j=e[13];let p,h;e[14]!==a?(h=s.jsx(ht,{onSelect:()=>a(null),children:"Any priority"}),p=Fs.map(b=>s.jsxs(ht,{onSelect:()=>a(b),className:"gap-2",children:[s.jsx("span",{className:K("size-2 rounded-full",we[b].dotClassName)}),we[b].label]},b)),e[14]=a,e[15]=p,e[16]=h):(p=e[15],h=e[16]);let g;e[17]!==p||e[18]!==h?(g=s.jsxs(zt,{align:"start",className:"w-40",children:[h,p]}),e[17]=p,e[18]=h,e[19]=g):g=e[19];let y;return e[20]!==g||e[21]!==j?(y=s.jsxs(Rt,{children:[j,g]}),e[20]=g,e[21]=j,e[22]=y):y=e[22],y}function Bl(t){const e=B.c(27),{value:n,onChange:a,block:l}=t;let o;e[0]!==n?(o=js.find(N=>N.value===n)?.label,e[0]=n,e[1]=o):o=e[1];const i=o,r=n!==null;let c;e[2]!==l||e[3]!==r?(c=Ft(r,l),e[2]=l,e[3]=r,e[4]=c):c=e[4];const u=c,x=l&&"ml-auto";let m;e[5]!==x?(m=K("shrink-0 opacity-60",x),e[5]=x,e[6]=m):m=e[6];const d=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(vt,{size:14,className:"shrink-0"}),e[7]=f):f=e[7];const j=i??"Due date";let p;e[8]!==d?(p=s.jsx(us,{size:12,className:d}),e[8]=d,e[9]=p):p=e[9];let h;e[10]!==j||e[11]!==p||e[12]!==u?(h=s.jsx(Ot,{asChild:!0,children:s.jsxs("button",{type:"button",className:u,children:[f,j,p]})}),e[10]=j,e[11]=p,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==a?(g=()=>a(null),e[14]=a,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(vt,{size:16,className:"text-muted-foreground"}),e[16]=y):y=e[16];let b;e[17]!==g?(b=s.jsxs(ht,{onSelect:g,className:"gap-2",children:[y,"Any time"]}),e[17]=g,e[18]=b):b=e[18];let v;e[19]!==a?(v=js.map(N=>{const _=N.value==="overdue";return s.jsxs(ht,{onSelect:()=>a(N.value),className:K("gap-2",_&&"text-destructive"),children:[s.jsx(vt,{size:16,className:K("shrink-0",_?"text-destructive":"text-muted-foreground")}),N.label]},N.value)}),e[19]=a,e[20]=v):v=e[20];let C;e[21]!==b||e[22]!==v?(C=s.jsxs(zt,{align:"start",className:"w-44",children:[b,v]}),e[21]=b,e[22]=v,e[23]=C):C=e[23];let E;return e[24]!==C||e[25]!==h?(E=s.jsxs(Rt,{children:[h,C]}),e[24]=C,e[25]=h,e[26]=E):E=e[26],E}function Ms(t){const e=B.c(26),{filters:n,members:a,onChange:l,block:o}=t;let i;e[0]!==n||e[1]!==l?(i=f=>l({...n,assignee:f}),e[0]=n,e[1]=l,e[2]=i):i=e[2];let r;e[3]!==o||e[4]!==n.assignee||e[5]!==a||e[6]!==i?(r=s.jsx(Fl,{block:o,value:n.assignee,members:a,onChange:i}),e[3]=o,e[4]=n.assignee,e[5]=a,e[6]=i,e[7]=r):r=e[7];let c;e[8]!==n||e[9]!==l?(c=f=>l({...n,priority:f}),e[8]=n,e[9]=l,e[10]=c):c=e[10];let u;e[11]!==o||e[12]!==n.priority||e[13]!==c?(u=s.jsx(Ml,{block:o,value:n.priority,onChange:c}),e[11]=o,e[12]=n.priority,e[13]=c,e[14]=u):u=e[14];let x;e[15]!==n||e[16]!==l?(x=f=>l({...n,due:f}),e[15]=n,e[16]=l,e[17]=x):x=e[17];let m;e[18]!==o||e[19]!==n.due||e[20]!==x?(m=s.jsx(Bl,{block:o,value:n.due,onChange:x}),e[18]=o,e[19]=n.due,e[20]=x,e[21]=m):m=e[21];let d;return e[22]!==r||e[23]!==u||e[24]!==m?(d=s.jsxs(s.Fragment,{children:[r,u,m]}),e[22]=r,e[23]=u,e[24]=m,e[25]=d):d=e[25],d}function Ll(t){const e=B.c(11),{filters:n,members:a,onChange:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Rs,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let i;e[1]!==n||e[2]!==a||e[3]!==l?(i=s.jsx(Ms,{filters:n,members:a,onChange:l}),e[1]=n,e[2]=a,e[3]=l,e[4]=i):i=e[4];let r;e[5]!==n||e[6]!==l?(r=Ol(n)&&s.jsx("button",{type:"button",onClick:()=>l(qt),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Clear"}),e[5]=n,e[6]=l,e[7]=r):r=e[7];let c;return e[8]!==i||e[9]!==r?(c=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,i,r]}),e[8]=i,e[9]=r,e[10]=c):c=e[10],c}function Ul(t){const e=B.c(26),{filters:n,members:a,onChange:l}=t,[o,i]=D.useState(!1),r=zl(n),c=r>0;let u;e[0]!==c?(u=Ft(c),e[0]=c,e[1]=u):u=e[1];const x=u;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Rs,{size:14,className:"shrink-0"}),e[2]=m):m=e[2];let d;e[3]!==r?(d=r>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:r}),e[3]=r,e[4]=d):d=e[4];let f;e[5]!==d||e[6]!==x?(f=s.jsx(Ln,{asChild:!0,children:s.jsxs("button",{type:"button",className:x,children:[m,"Filters",d]})}),e[5]=d,e[6]=x,e[7]=f):f=e[7];let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Un,{className:"px-4 pt-4 text-base font-medium text-foreground",children:"Filters"}),e[8]=j):j=e[8];let p;e[9]!==n||e[10]!==a||e[11]!==l?(p=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Ms,{block:!0,filters:n,members:a,onChange:l})}),e[9]=n,e[10]=a,e[11]=l,e[12]=p):p=e[12];let h;e[13]!==r||e[14]!==l?(h=r>0&&s.jsx(oe,{variant:"outline",className:"flex-1",onClick:()=>l(qt),children:"Clear all"}),e[13]=r,e[14]=l,e[15]=h):h=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Kn,{asChild:!0,children:s.jsx(oe,{className:"flex-1",children:"Done"})}),e[16]=g):g=e[16];let y;e[17]!==h?(y=s.jsxs(Gn,{className:"flex-row gap-2",children:[h,g]}),e[17]=h,e[18]=y):y=e[18];let b;e[19]!==y||e[20]!==p?(b=s.jsxs(Qn,{className:"p-0",children:[j,p,y]}),e[19]=y,e[20]=p,e[21]=b):b=e[21];let v;return e[22]!==o||e[23]!==b||e[24]!==f?(v=s.jsxs(Hn,{open:o,onOpenChange:i,direction:"bottom",children:[f,b]}),e[22]=o,e[23]=b,e[24]=f,e[25]=v):v=e[25],v}const Ns=380,Kl=90,vs=5,Gl="cubic-bezier(0.22, 0.61, 0.36, 1)",Ql=8;function Hl(t,e){const n=D.useRef(new Map);D.useLayoutEffect(()=>{const a=t.current;if(!a)return;const l=a.querySelectorAll("[data-flip-id]"),o=n.current,i=new Map,r=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,c=[];for(const d of l){const f=d.dataset.flipId;if(!f)continue;const j=d.getBoundingClientRect();i.set(f,j);const p=o.get(f);if(!p)continue;const h=p.left-j.left,g=p.top-j.top;(h||g)&&c.push({el:d,dx:h,dy:g,lane:Math.abs(h)>Ql})}if(n.current=i,r||c.length===0)return;for(const d of c){const f=d.lane?` rotate(${d.dx>0?vs:-vs}deg)`:"";d.el.style.transition="none",d.el.style.transform=`translate(${d.dx}px, ${d.dy}px)${f}`,d.lane&&(d.el.style.zIndex="10")}let u=0;const x=[],m=requestAnimationFrame(()=>{for(const d of c){const f=d.lane?u++*Kl:0;d.el.style.transition=`transform ${Ns}ms ${Gl} ${f}ms`,d.el.style.transform="",x.push(window.setTimeout(()=>{d.el.style.transition="",d.el.style.transform="",d.el.style.zIndex=""},Ns+f+30))}});return()=>{cancelAnimationFrame(m);for(const d of x)clearTimeout(d)}},[e,t])}const Yl="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",Vl=["Todas as tarefas do diagnóstico, priorizadas no seu quadro","Um relatório recorrente do seu site, sempre atualizado","O agente resolve cada tarefa e deixa pronta para a sua revisão"],Ss={price:"R$ 99",anchor:"R$ 499"};function Wl(t){const e=B.c(5),{onOpen:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-success/10",children:s.jsx(Ds,{size:16,className:"text-success"})}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[a,s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Seu plano de ação está a um clique"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Desbloqueie o diagnóstico completo e as tarefas entram aqui, da maior prioridade para a menor."})]})]}),e[1]=l):l=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ps,{size:16}),e[2]=o):o=e[2];let i;return e[3]!==n?(i=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-4 card-shadow sm:flex-row sm:items-center sm:gap-4",children:[l,s.jsxs(oe,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:["Desbloquear diagnóstico",o]})]}),e[3]=n,e[4]=i):i=e[4],i}function Xl({open:t,onOpenChange:e,cdClient:n,onExpired:a}){const[l,o]=D.useState(!1),i=async()=>{if(!n){a();return}o(!0);try{const r=await n.callTool({name:"start_checkout",arguments:{}}),{url:c}=Zt(r);if(new URL(c).protocol!=="https:")throw new Error("unsafe checkout url");window.open(c,"_blank","noopener,noreferrer"),e(!1)}catch{a()}finally{o(!1)}};return s.jsx(os,{open:t,onOpenChange:e,children:s.jsxs(rs,{className:"gap-0 p-3 sm:max-w-[500px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[s.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:s.jsx("img",{src:Yl,alt:"Prévia do seu quadro de tarefas desbloqueado",className:"h-[208px] w-full object-cover object-left-top"})}),s.jsxs("div",{className:"flex flex-col gap-7 px-3 pb-3 pt-7",children:[s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(is,{className:"text-xl font-semibold text-foreground",children:"Desbloqueie seu plano de trabalho"}),s.jsx("ul",{className:"flex flex-col gap-3.5",children:Vl.map(r=>s.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[s.jsx(ds,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),s.jsx("span",{className:"leading-snug text-foreground",children:r})]},r))})]}),s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("span",{className:"text-2xl font-semibold text-foreground",children:Ss.price}),s.jsx("span",{className:"text-sm text-muted-foreground line-through",children:Ss.anchor})]}),s.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[s.jsx(oe,{variant:"ghost",onClick:()=>e(!1),disabled:l,className:"order-2 w-full sm:order-none sm:w-auto",children:"Explorar"}),s.jsxs(oe,{onClick:i,disabled:l,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[l?s.jsx(ns,{size:16,className:"animate-spin"}):null,"Desbloquear diagnóstico",!l&&s.jsx(Ps,{size:16})]})]})]})]})]})})}function Ht(t){return`board-paywall-seen:${t}`}function Jl(){const t=B.c(26),{org:e}=Re(),n=ws(),{diagnostic:a,cdClient:l,connectionId:o}=fl();let i;t[0]!==e.id?(i=()=>({orgId:e.id,open:!sessionStorage.getItem(Ht(e.id))}),t[0]=e.id,t[1]=i):i=t[1];const[r,c]=D.useState(i);let u;t[2]!==r.open||t[3]!==r.orgId||t[4]!==e.id?(u=r.orgId===e.id?r.open:!sessionStorage.getItem(Ht(e.id)),t[2]=r.open,t[3]=r.orgId,t[4]=e.id,t[5]=u):u=t[5];const x=u;if(!a?.locked)return null;let m;t[6]!==e.id?(m=v=>c({orgId:e.id,open:v}),t[6]=e.id,t[7]=m):m=t[7];const d=m;let f;t[8]!==e.id||t[9]!==d?(f=v=>{d(v),v||sessionStorage.setItem(Ht(e.id),"1")},t[8]=e.id,t[9]=d,t[10]=f):f=t[10];const j=f;let p;t[11]!==o||t[12]!==n||t[13]!==e?(p=()=>{gs("board_paywall_report_opened",{organization_id:e.id}),n(gl(e,o))},t[11]=o,t[12]=n,t[13]=e,t[14]=p):p=t[14];const h=p;let g;t[15]!==e.id||t[16]!==d?(g=s.jsx(Wl,{onOpen:()=>{gs("board_paywall_banner_clicked",{organization_id:e.id}),d(!0)}}),t[15]=e.id,t[16]=d,t[17]=g):g=t[17];let y;t[18]!==l||t[19]!==j||t[20]!==x||t[21]!==h?(y=s.jsx(Xl,{open:x,onOpenChange:j,cdClient:l,onExpired:h}),t[18]=l,t[19]=j,t[20]=x,t[21]=h,t[22]=y):y=t[22];let b;return t[23]!==g||t[24]!==y?(b=s.jsxs(s.Fragment,{children:[g,y]}),t[23]=g,t[24]=y,t[25]=b):b=t[25],b}function Zl(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Js,{fallback:null,children:s.jsx(Jl,{})}),t[0]=e):e=t[0],e}en(()=>import("./index-nNhZx5bw.js").then(t=>t.b2),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152])).catch(()=>{});function ea(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:s.jsx("div",{className:"h-full p-0.5 pt-0.25",children:s.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:s.jsx(Gs,{})})})}),t[0]=e):e=t[0],e}const ta=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function sa(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:ta.format(e),overdue:n}}const fs="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1 text-xs font-medium text-muted-foreground";function Bs(){const t=B.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=K(fs,"border-warning/30 text-warning"),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("span",{className:e,title:"The agent is waiting for your input",children:[s.jsx(_s,{size:14}),"Needs input"]}),t[1]=n):n=t[1],n}function Ls(t){const e=B.c(7),{priority:n}=t,a=we[n];let l;e[0]!==a.dotClassName?(l=K("size-2 rounded-full",a.dotClassName),e[0]=a.dotClassName,e[1]=l):l=e[1];let o;e[2]!==l?(o=s.jsx("span",{className:l}),e[2]=l,e[3]=o):o=e[3];let i;return e[4]!==a.label||e[5]!==o?(i=s.jsxs("span",{className:fs,children:[o,a.label]}),e[4]=a.label,e[5]=o,e[6]=i):i=e[6],i}function Us(t){const e=B.c(7),{iso:n}=t;let a,l;if(e[0]!==n){const{label:r,overdue:c}=sa(n);a=r,l=K(fs,c&&"border-destructive/30 text-destructive"),e[0]=n,e[1]=a,e[2]=l}else a=e[1],l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{size:14}),e[3]=o):o=e[3];let i;return e[4]!==a||e[5]!==l?(i=s.jsxs("span",{className:l,children:[o,a]}),e[4]=a,e[5]=l,e[6]=i):i=e[6],i}function Ks(t){const e=B.c(11),{item:n,assignee:a,assignedBy:l}=t;if(n.assigneeId===ze){const o=l?.user?.name?`Assigned to Super Agent by ${l.user.name}`:"Assigned to Super Agent";let i;e[0]!==l?(i=l&&s.jsx(Ce,{url:l.user?.image??void 0,fallback:Se(l.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),e[0]=l,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Te,{size:16,className:"ring-2 ring-background"}),e[2]=r):r=e[2];let c;return e[3]!==o||e[4]!==i?(c=s.jsxs("span",{className:"inline-flex items-center",title:o,children:[i,r]}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c}if(a){const o=a.user?.image??void 0,i=a.user?.name;let r;e[6]!==i?(r=Se(i),e[6]=i,e[7]=r):r=e[7];let c;return e[8]!==o||e[9]!==r?(c=s.jsx(Ce,{url:o,fallback:r,shape:"circle",size:"2xs"}),e[8]=o,e[9]=r,e[10]=c):c=e[10],c}return null}function Gs(){const t=B.c(107),{items:e,isLoading:n}=bl(),a=jl(),l=Xn();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={slug:"mcp-github"},t[0]=o):o=t[0];const i=Nn(o);let r;t[1]!==i?(r=vn(i),t[1]=i,t[2]=r):r=t[2];const c=r.length>0,[u,x]=D.useState(!1),{data:m}=Es();let d,f;t[3]!==m?.data?.members?(d=m?.data?.members??[],f=new Map(d.map(na)),t[3]=m?.data?.members,t[4]=d,t[5]=f):(d=t[4],f=t[5]);const j=f,[p,h]=D.useState("board"),[g,y]=D.useState(qt),[b,v]=D.useState(!1),[C,E]=D.useState(null),[N,_]=D.useState(null),{setTaskId:I}=Vn(),{create:z}=Wn(),{org:w,locator:T}=Re(),M=ws();let F;t[6]===Symbol.for("react.memo_cache_sentinel")?(F={strict:!1},t[6]=F):F=t[6];const{task:L}=Zs(F);let S;t[7]!==L||t[8]!==e?(S=L?e.find(G=>G.id===L)??null:null,t[7]=L,t[8]=e,t[9]=S):S=t[9];const A=S;let $;t[10]!==L||t[11]!==M||t[12]!==w?($=()=>{L&&M({to:"/$org/board",params:{org:w.slug},search:{},replace:!0})},t[10]=L,t[11]=M,t[12]=w,t[13]=$):$=t[13];const Q=$;let R;t[14]!==a||t[15]!==z||t[16]!==T||t[17]!==w||t[18]!==I?(R=async G=>{const W=crypto.randomUUID(),X=xn(w.id).id,ge={type:"doc",content:[{type:"paragraph",content:[Rn({id:G.id,name:G.title,char:"@",kind:"task",metadata:{title:G.title,description:G.description}}),{type:"text",text:" "}]}]};tl(sessionStorage,T,W,ge),v(!1);try{await z({id:W,virtual_mcp_id:X}),await a.link.mutateAsync({id:G.id,linkThreadId:W})}catch{}I(W,X)},t[14]=a,t[15]=z,t[16]=T,t[17]=w,t[18]=I,t[19]=R):R=t[19];const O=R;let P,q,V,H,Y,ae,re;if(t[20]!==a||t[21]!==Q||t[22]!==A||t[23]!==b||t[24]!==C||t[25]!==g||t[26]!==c||t[27]!==n||t[28]!==e||t[29]!==p||t[30]!==j||t[31]!==d||t[32]!==l){Y=Symbol.for("react.early_return_sentinel");e:{let G;t[40]!==g?(G=U=>ql(U,g),t[40]=g,t[41]=G):G=t[41];const W=e.filter(G);let X;t[42]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{E(null),_(null),v(!0)},t[42]=X):X=t[42];const ge=X;let De;t[43]===Symbol.for("react.memo_cache_sentinel")?(De=U=>{E(null),_(U),v(!0)},t[43]=De):De=t[43];const Ie=De;let ue;t[44]===Symbol.for("react.memo_cache_sentinel")?(ue=U=>{E(U),v(!0)},t[44]=ue):ue=t[44];const be=ue;P=C??A,V=b||!!A;let Pe;if(t[45]!==Q?(Pe=()=>{v(!1),E(null),_(null),Q()},t[45]=Q,t[46]=Pe):Pe=t[46],q=Pe,n&&e.length===0){let U;t[47]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(ns,{size:20,className:"animate-spin text-muted-foreground"})}),t[47]=U):U=t[47],Y=U;break e}ae="flex min-h-0 flex-1 flex-col";let ke;t[48]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx("h1",{className:"text-xl font-medium text-foreground",children:"Tasks"}),t[48]=ke):ke=t[48];let ee;t[49]!==l?(ee=l&&s.jsx(Zl,{}),t[49]=l,t[50]=ee):ee=t[50];let pe;t[51]!==g||t[52]!==e.length||t[53]!==d?(pe=e.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"sm:hidden",children:s.jsx(Ul,{filters:g,members:d,onChange:y})}),s.jsx("div",{className:"hidden sm:block",children:s.jsx(Ll,{filters:g,members:d,onChange:y})})]}),t[51]=g,t[52]=e.length,t[53]=d,t[54]=pe):pe=t[54];const he=p==="list";let je;t[55]===Symbol.for("react.memo_cache_sentinel")?(je=()=>h("list"),t[55]=je):je=t[55];let te;t[56]!==he?(te=s.jsx(Cs,{active:he,onClick:je,icon:cn,label:"List"}),t[56]=he,t[57]=te):te=t[57];const $e=p==="board";let me;t[58]===Symbol.for("react.memo_cache_sentinel")?(me=()=>h("board"),t[58]=me):me=t[58];let se;t[59]!==$e?(se=s.jsx(Cs,{active:$e,onClick:me,icon:on,label:"Board"}),t[59]=$e,t[60]=se):se=t[60];let ne;t[61]!==te||t[62]!==se?(ne=s.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[te,se]}),t[61]=te,t[62]=se,t[63]=ne):ne=t[63];let Ne;t[64]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsxs(oe,{size:"sm",onClick:ge,children:[s.jsx(as,{size:16}),"New task"]}),t[64]=Ne):Ne=t[64];let le;t[65]!==ne?(le=s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[ne,Ne]}),t[65]=ne,t[66]=le):le=t[66];let Ee;t[67]!==pe||t[68]!==le?(Ee=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[pe,le]}),t[67]=pe,t[68]=le,t[69]=Ee):Ee=t[69],t[70]!==ee||t[71]!==Ee?(re=s.jsxs("div",{className:"mx-auto flex w-full max-w-[1680px] flex-col gap-4 px-4 pt-6 sm:px-8 sm:pt-8",children:[ke,ee,Ee]}),t[70]=ee,t[71]=Ee,t[72]=re):re=t[72],H=e.length===0?s.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:s.jsx("div",{className:"rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:"No tasks yet. Start one with New task."})}):W.length===0?s.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:["No tasks match these filters.",s.jsx(oe,{variant:"outline",size:"sm",onClick:()=>y(qt),children:"Clear filters"})]})}):p==="board"?s.jsx(aa,{items:W,memberByUserId:j,onOpen:be,onCreate:Ie,onMove:(U,Mt)=>a.update.mutate({id:U,status:Mt}),onAutoFix:l?U=>{if(!c){x(!0);return}a.update.mutate({id:U.id,assigneeId:ze})}:void 0}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-16 sm:px-8",children:s.jsx("div",{className:"mx-auto flex max-w-[820px] flex-col gap-2",children:W.map(U=>s.jsx(ia,{item:U,assignee:U.assigneeId?j.get(U.assigneeId):void 0,assignedBy:U.assignedBy?j.get(U.assignedBy):void 0,onOpen:()=>be(U)},U.id))})})}t[20]=a,t[21]=Q,t[22]=A,t[23]=b,t[24]=C,t[25]=g,t[26]=c,t[27]=n,t[28]=e,t[29]=p,t[30]=j,t[31]=d,t[32]=l,t[33]=P,t[34]=q,t[35]=V,t[36]=H,t[37]=Y,t[38]=ae,t[39]=re}else P=t[33],q=t[34],V=t[35],H=t[36],Y=t[37],ae=t[38],re=t[39];if(Y!==Symbol.for("react.early_return_sentinel"))return Y;const fe=V?P?.id??`new-${N??"default"}`:"closed",Ae=P??void 0,yt=N??void 0,bt=a.create.isPending||a.update.isPending;let xe;t[73]!==a.create||t[74]!==a.update||t[75]!==P||t[76]!==q?(xe=G=>{P?a.update.mutate({id:P.id,...G}):a.create.mutate(G),q()},t[73]=a.create,t[74]=a.update,t[75]=P,t[76]=q,t[77]=xe):xe=t[77];let J;t[78]!==a.remove||t[79]!==P||t[80]!==q?(J=P?()=>{a.remove.mutate(P.id),q()}:void 0,t[78]=a.remove,t[79]=P,t[80]=q,t[81]=J):J=t[81];let ie;t[82]!==P||t[83]!==O?(ie=P?()=>{O(P)}:void 0,t[82]=P,t[83]=O,t[84]=ie):ie=t[84];let Z;t[85]!==q||t[86]!==I?(Z=G=>{G.virtualMcpId&&(q(),I(G.threadId,G.virtualMcpId,{main:G.hasPreview?"preview":"board"}))},t[85]=q,t[86]=I,t[87]=Z):Z=t[87];let _e;t[88]!==q||t[89]!==V||t[90]!==fe||t[91]!==Ae||t[92]!==yt||t[93]!==bt||t[94]!==xe||t[95]!==J||t[96]!==ie||t[97]!==Z?(_e=s.jsx(_l,{open:V,onClose:q,item:Ae,defaultStatus:yt,isSaving:bt,onSubmit:xe,onDelete:J,onNewChat:ie,onOpenThread:Z},fe),t[88]=q,t[89]=V,t[90]=fe,t[91]=Ae,t[92]=yt,t[93]=bt,t[94]=xe,t[95]=J,t[96]=ie,t[97]=Z,t[98]=_e):_e=t[98];let ce;t[99]!==u?(ce=s.jsx(la,{open:u,onOpenChange:x}),t[99]=u,t[100]=ce):ce=t[100];let de;return t[101]!==H||t[102]!==_e||t[103]!==ce||t[104]!==ae||t[105]!==re?(de=s.jsxs("div",{className:ae,children:[re,H,_e,ce]}),t[101]=H,t[102]=_e,t[103]=ce,t[104]=ae,t[105]=re,t[106]=de):de=t[106],de}function na(t){return[t.userId,t]}function la(t){const e=B.c(14),{open:n,onOpenChange:a}=t,{connect:l,isConnecting:o}=pl("deco/mcp-github");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(hn,{children:[s.jsx(is,{children:"Connect GitHub"}),s.jsx(yn,{children:"Auto-fix hands the task to the Super Agent, which opens a pull request with the change. Connect GitHub so it can push and open PRs."})]}),e[0]=i):i=e[0];let r;e[1]!==l||e[2]!==a?(r=async()=>{await l(),a(!1)},e[1]=l,e[2]=a,e[3]=r):r=e[3];let c;e[4]!==o?(c=o?s.jsx(ns,{size:16,className:"animate-spin"}):s.jsx(pn,{className:"size-4"}),e[4]=o,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==r||e[8]!==c?(u=s.jsxs(rs,{className:"sm:max-w-md",children:[i,s.jsx(bn,{children:s.jsxs(oe,{onClick:r,disabled:o,className:"gap-2",children:[c,"Connect GitHub"]})})]}),e[6]=o,e[7]=r,e[8]=c,e[9]=u):u=e[9];let x;return e[10]!==a||e[11]!==n||e[12]!==u?(x=s.jsx(os,{open:n,onOpenChange:a,children:u}),e[10]=a,e[11]=n,e[12]=u,e[13]=x):x=e[13],x}function Cs(t){const e=B.c(11),{active:n,onClick:a,icon:l,label:o}=t,i=`${o} view`,r=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let c;e[0]!==r?(c=K("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",r),e[0]=r,e[1]=c):c=e[1];let u;e[2]!==l?(u=s.jsx(l,{size:14}),e[2]=l,e[3]=u):u=e[3];let x;return e[4]!==n||e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==c||e[9]!==u?(x=s.jsxs("button",{type:"button",onClick:a,"aria-label":i,"aria-pressed":n,className:c,children:[u,o]}),e[4]=n,e[5]=o,e[6]=a,e[7]=i,e[8]=c,e[9]=u,e[10]=x):x=e[10],x}function aa(t){const e=B.c(12),{items:n,memberByUserId:a,onOpen:l,onCreate:o,onMove:i,onAutoFix:r}=t,[c,u]=D.useState(null),x=D.useRef(null);let m;e[0]!==n?(m=n.map(ra).join(","),e[0]=n,e[1]=m):m=e[1],Hl(x,m);let f;e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==c?(f=qs.map(p=>{const h=n.filter(b=>b.status===p),g=ve[p],y=g.icon;return s.jsxs("div",{onDragOver:b=>{b.preventDefault(),u(p)},onDragLeave:b=>{b.currentTarget.contains(b.relatedTarget)||u(null)},onDrop:b=>{b.preventDefault();const v=b.dataTransfer.getData("text/plain");v&&i(v,p),u(null)},className:K("flex w-[300px] shrink-0 flex-col rounded-xl p-1 transition-colors",c===p&&"bg-muted/50"),children:[s.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-2 bg-background px-2 py-1.5",children:[s.jsx(y,{size:15,className:K("shrink-0",g.iconClassName)}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:g.label}),s.jsx("span",{className:"rounded-md bg-muted px-1.5 text-[11px] font-medium text-muted-foreground",children:h.length}),s.jsx("button",{type:"button","aria-label":`New task in ${g.label}`,title:`New task in ${g.label}`,onClick:()=>o(p),className:"ml-auto flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:s.jsx(as,{size:15})})]}),s.jsx("div",{className:"flex min-h-12 flex-col gap-2 pt-1",children:h.map(b=>s.jsx(oa,{item:b,assignee:b.assigneeId?a.get(b.assigneeId):void 0,assignedBy:b.assignedBy?a.get(b.assignedBy):void 0,onOpen:()=>l(b),onAutoFix:r?()=>r(b):void 0},b.id))})]},p)}),e[2]=n,e[3]=a,e[4]=r,e[5]=o,e[6]=i,e[7]=l,e[8]=c,e[9]=f):f=e[9];let j;return e[10]!==f?(j=s.jsx("div",{ref:x,className:"min-h-0 flex-1 overflow-x-auto overflow-y-auto",children:s.jsx("div",{className:"mx-auto flex w-full max-w-[1680px] gap-3 px-4 pt-6 pb-16 sm:px-8",children:f})}),e[10]=f,e[11]=j):j=e[11],j}function ra(t){return`${t.id}:${t.status}`}function oa(t){const e=B.c(33),{item:n,assignee:a,assignedBy:l,onOpen:o,onAutoFix:i}=t,r=ve[n.status],c=r.icon,u=Nl(n)?.lastMessage,x=i&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==ze,m=n.id;let d;e[0]!==n.id?(d=N=>{N.dataTransfer.setData("text/plain",n.id),N.dataTransfer.effectAllowed="move"},e[0]=n.id,e[1]=d):d=e[1];const f=n.title;let j;e[2]!==r.iconClassName?(j=K("mt-px shrink-0",r.iconClassName),e[2]=r.iconClassName,e[3]=j):j=e[3];let p;e[4]!==c||e[5]!==j?(p=s.jsx(c,{size:16,className:j}),e[4]=c,e[5]=j,e[6]=p):p=e[6];let h;e[7]!==n.title?(h=s.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug text-foreground line-clamp-2",children:n.title}),e[7]=n.title,e[8]=h):h=e[8];let g;e[9]!==l||e[10]!==a||e[11]!==n?(g=s.jsx(Ks,{item:n,assignee:a,assignedBy:l}),e[9]=l,e[10]=a,e[11]=n,e[12]=g):g=e[12];let y;e[13]!==p||e[14]!==h||e[15]!==g?(y=s.jsxs("div",{className:"flex items-start gap-2",children:[p,h,g]}),e[13]=p,e[14]=h,e[15]=g,e[16]=y):y=e[16];let b;e[17]!==u?(b=u&&s.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:u}),e[17]=u,e[18]=b):b=e[18];let v;e[19]!==n?(v=(es(n)||n.priority!=="none"||!!n.dueDate)&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[es(n)&&s.jsx(Bs,{}),n.priority!=="none"&&s.jsx(Ls,{priority:n.priority}),n.dueDate&&s.jsx(Us,{iso:n.dueDate})]}),e[19]=n,e[20]=v):v=e[20];let C;e[21]!==i||e[22]!==x?(C=x&&s.jsxs("button",{type:"button",onClick:N=>{N.stopPropagation(),i()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-accent",children:[s.jsx(Ds,{size:12}),"Auto-fix"]}),e[21]=i,e[22]=x,e[23]=C):C=e[23];let E;return e[24]!==n.id||e[25]!==n.title||e[26]!==o||e[27]!==v||e[28]!==C||e[29]!==d||e[30]!==y||e[31]!==b?(E=s.jsxs("button",{type:"button",draggable:!0,"data-flip-id":m,onDragStart:d,onClick:o,className:"group flex cursor-grab flex-col gap-2 rounded-xl bg-card px-3 py-2.5 text-left card-shadow transition-colors will-change-transform hover:bg-accent/60 active:cursor-grabbing",title:f,children:[y,b,v,C]}),e[24]=n.id,e[25]=n.title,e[26]=o,e[27]=v,e[28]=C,e[29]=d,e[30]=y,e[31]=b,e[32]=E):E=e[32],E}function ia(t){const e=B.c(30),{item:n,assignee:a,assignedBy:l,onOpen:o}=t,i=ve[n.status],r=i.icon;let c;e[0]!==i.iconClassName?(c=K("shrink-0",i.iconClassName),e[0]=i.iconClassName,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==c?(u=s.jsx(r,{size:16,className:c}),e[2]=r,e[3]=c,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let m;e[7]!==n?(m=es(n)&&s.jsx(Bs,{}),e[7]=n,e[8]=m):m=e[8];let d;e[9]!==n.priority?(d=n.priority!=="none"&&s.jsx("span",{className:"hidden sm:inline-flex",children:s.jsx(Ls,{priority:n.priority})}),e[9]=n.priority,e[10]=d):d=e[10];let f;e[11]!==n.dueDate?(f=n.dueDate&&s.jsx("span",{className:"hidden sm:inline-flex",children:s.jsx(Us,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=f):f=e[12];let j;e[13]!==l||e[14]!==a||e[15]!==n?(j=s.jsx(Ks,{item:n,assignee:a,assignedBy:l}),e[13]=l,e[14]=a,e[15]=n,e[16]=j):j=e[16];let p;e[17]!==n.createdAt?(p=In(new Date(n.createdAt)),e[17]=n.createdAt,e[18]=p):p=e[18];let h;e[19]!==p?(h=s.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:p}),e[19]=p,e[20]=h):h=e[20];let g;return e[21]!==o||e[22]!==u||e[23]!==x||e[24]!==m||e[25]!==d||e[26]!==f||e[27]!==j||e[28]!==h?(g=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-accent/60",children:[u,x,m,d,f,j,h]}),e[21]=o,e[22]=u,e[23]=x,e[24]=m,e[25]=d,e[26]=f,e[27]=j,e[28]=h,e[29]=g):g=e[29],g}const nr=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:Gs,default:ea},Symbol.toStringTag,{value:"Module"}));export{Ja as H,we as P,il as S,_l as T,cl as a,sr as b,er as c,fl as d,dl as e,gl as f,pl as g,bl as h,Zn as i,jl as j,ve as k,Te as l,Gs as m,nr as n,Za as r,tr as u,tl as w};
@@ -1 +0,0 @@
1
- import{c as I,b as ne,C as X,D as xs,j as s,B as je,r as M,F as ps,E as We,a as te,v as gs,K as Ct,d as Le,p as Z,G as Ce,l as O,H as bs,I as js,J as vs,M as ys,P as Ss,q as _s,t as oe,s as Ns,i as wt,e as Ve,u as we,L as Cs,R as ws,U as ks,V as Is,W as As,m as zs,X as $s,O as Ts,Y as Os}from"./index-DmhdwAgP.js";import{u as re,S as qe,a as Ke,b as ee,c as K,d as H,e as kt,f as Ms,g as It,h as Es,i as he,j as Ps,k as Ds,l as Fs}from"./sidebar-DnKMI8jz.js";import{u as Ye}from"./use-mobile-D8w2xyip.js";import{C as Rs,p as Ee,s as Ls,b as Hs,S as Bs,d as Us,e as Gs,c as Ws,n as Vs}from"./self-tool-result-C94YNykg.js";import{f as qs,a as At,e as zt,g as Ks,D as Ys,h as Xs,d as Qs}from"./dialog-DUqhzGiD.js";import{f as Js}from"./tab-id-BijBBRwE.js";import{C as Zs,W as $t,g as en,u as Tt,S as Ot,a as _e,i as tn,b as sn}from"./use-mcp-client-DseZ3Mea.js";import{i as Mt}from"./XCircle-C0OdV3N_.js";import{S as se}from"./skeleton-xDZ5Iwb8.js";import{i as Et}from"./LayoutLeft-BI-sXAac.js";import{t as Xe}from"./ChevronDown-BSRiDjXd.js";import{T as le,a as ae,b as ce,c as Pt}from"./tooltip-cvFTpZ9W.js";import{u as Dt,a as Qe}from"./use-virtual-mcp-urYy02xb.js";import{A as de,t as nn,a as on,i as rn,b as ln,c as Ft,d as ot,e as an,s as cn,f as dn}from"./agent-icon-DicjSkHu.js";import{P as fe,a as ke,b as Ie}from"./popover-DwV6WXHS.js";import{i as Rt}from"./ChevronUp-D5F6V6Tm.js";import{s as xe}from"./Plus-2c1jULco.js";import{i as Lt}from"./SearchMd-lwIiBODG.js";import{s as mn}from"./XClose-DomD4542.js";import{A as un,a as fn,b as hn,c as xn,d as pn,e as gn,f as bn}from"./alert-dialog-DDtUbhoS.js";import{F as jn,a as vn,b as yn,c as Sn,d as _n,e as Nn,f as Cn}from"./form-C9InGmo4.js";import{I as wn}from"./input-TkvVVsQL.js";import{S as kn,u as In,C as An}from"./chat-context-DSveBxCg.js";import{T as me}from"./toolbar-icon-button-Cr-N30KB.js";import{D as Ht,a as Bt,b as Ut}from"./drawer-DvhdIHph.js";import{G as zn}from"./use-registry-app-Cy7ipz7c.js";import{G as $n}from"./github-repo-picker-Biy9UFu8.js";import{u as Gt,a as Je,b as Tn,T as On}from"./hooks-DU-2h9eZ.js";import{r as Mn,u as Ze,f as En}from"./shell-layout-6KUu0MA6.js";import{u as Pn,g as Dn,a as Fn,b as Rn,S as Wt}from"./use-navigate-to-agent-YScxPu5L.js";import{g as Ln,a as Vt,u as Hn,A as Bn,b as Un}from"./use-deco-credits-Bm6Hzrca.js";import{f as Gn}from"./reusable-new-chat-CouMjkYR.js";import{A as He}from"./avatar-BVdHZbMN.js";import{a as Wn}from"./Copy01-BkGYkmm-.js";import{n as Vn,i as qn}from"./Globe01-D3vBqhI7.js";import{i as Kn}from"./ZoomOut-BprgOfkE.js";import{i as rt,a as Yn}from"./ZapSquare-EvC2T9CP.js";import{i as Be}from"./Monitor01-BOILvS2u.js";import{n as Xn,a as Qn}from"./Sun-nDXz4jeM.js";import{a as Ae}from"./Settings02-DMpqOK24.js";import{i as Jn}from"./Shield01-gTFc9c17.js";import{a as Zn}from"./Users03-Bx4g7VTC.js";import{u as ei}from"./use-deployment-admin-C6-1CBki.js";import"./index-BOgwoJjn.js";import{I as qt}from"./invite-member-dialog-BA1mFY2X.js";import{v as ti,C as lt}from"./connect-desktop-dialog-DEEL81vf.js";import{u as ze}from"./use-organization-settings-bBY4klS6.js";import{i as si}from"./FilterLines-BwWG7tAk.js";import{T as ni,a as ii}from"./toggle-group-DGvoaiio.js";import{C as oi,a as ri,b as li,c as ai,d as ci}from"./command-3z1R7bvy.js";import{u as Kt}from"./studio-tools-DIWsVaKg.js";import{i as Yt}from"./Zap-CEUVQQOc.js";import{S as Xt,M as di}from"./shell-controls-5d4ZCRmi.js";import{n as mi}from"./Stars02-B08FvcHQ.js";import{g as ui,u as fi,S as hi}from"./use-clock-tick-BzcS25hV.js";import{a as xi}from"./format-time-BnbuEtat.js";import{i as pi}from"./ChevronRight-YmTewr_B.js";import{T as J}from"./toolbar-CvkbyWaX.js";import"./X-Dif5I5BD.js";import"./integration-icon-CWb3OXTV.js";import"./Tool02-B0-a0UMl.js";import"./CheckCircle-BEcdXH7-.js";import"./companions-core-C68sN4Wc.js";import"./extract-connection-data-_NDoBHMa.js";import"./github-repo-scope-DjMZbiKa.js";import"./Eye-B-ZfWIGj.js";import"./use-debounced-value-CSp0_yRg.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./authenticate-and-persist-oauth-CEv4KtcH.js";import"./mcp-oauth-B5rKpHdd.js";import"./auth-CsHQFHV_.js";import"./ArrowUpRight-DZZygrAi.js";import"./use-collections-DaXoNaLL.js";import"./AlertCircle-B9GlbKHh.js";import"./Tool01-BR3IBeV9.js";import"./ArrowUp-DNZsq7Zt.js";import"./TrendUp01-CeRF_789.js";import"./DotsVertical-BmTi7wpl.js";import"./Star01-DoUbKevt.js";import"./Globe04-pvxBukgJ.js";import"./SwitchHorizontal01-Rgis0XWf.js";import"./HardDrive-DutZPQFL.js";import"./Image01-PIeYnf-K.js";import"./Key01-DhLD806C.js";import"./LinkExternal01-DO3QnLus.js";import"./Package-DbEcG94t.js";import"./Palette-CyZvWKmI.js";import"./Play-B8fWmOst.js";import"./SearchLg-XmvudKlH.js";import"./Stars01-CJsm_THn.js";import"./Trash01-Ba6bCbNY.js";import"./Upload01-B14IruoN.js";import"./User01-ByIE6k8L.js";import"./Users01-BdldAr7H.js";import"./label-CB2o7dZ2.js";import"./autosend-BgYoPuWD.js";import"./use-ai-providers-ZLuBEaKb.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-CX_EuT5c.js";import"./decopilot-sse-pool-CEQrv8Fn.js";import"./backoff-CrEUbyZT.js";import"./use-mcp-tools-DJGNLf9H.js";import"./collection-search-TcSAZpqK.js";import"./use-connection-DM1ROgj3.js";import"./delay-CnY5UFtP.js";import"./use-t-BjZG1zRp.js";import"./required-auth-layout-ABsqitxw.js";import"./use-org-sso-diAgeADE.js";import"./connection-card-D_K36Swx.js";import"./use-registry-connections-BZ0Z0jCg.js";import"./useInfiniteQuery-nK_JPgM8.js";import"./use-infinite-scroll-XidGSyic.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-C3gg1LtP.js";import"./select-AzuoAc3H.js";import"./textarea-DjtAtA2l.js";import"./connection-form-helpers-DyOAEqE9.js";import"./collection-tabs-CIRa_M2W.js";import"./badge-C_9mnuBd.js";import"./useSuspenseInfiniteQuery-_ObcRUnC.js";import"./use-org-auth-client-DjREcL_I.js";import"./use-organization-roles-BuFi-QNO.js";import"./index-CO3868Cu.js";import"./differenceInSeconds-NQ4PDo0z.js";function gi(t){const e=I.c(15),{siteUrl:n}=t,o=ne(),{org:i}=X();let r;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(r=()=>{localStorage.setItem(xs.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:i.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:en(i.id),main:Js($t.COMMERCE_DISCOVERY(i.id),Zs),sidepanel:0}})},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=r):r=e[3];const l=r;let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qs,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=a):a=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(At,{className:"sr-only",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),e[5]=m):m=e[5];let c;e[6]!==l?(c=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Não foi possível carregar as integrações. Você pode continuar e abrir o relatório mesmo assim."}),s.jsxs(je,{type:"button",size:"xl",className:"w-full",onClick:l,children:["Continuar",s.jsx(Mt,{size:18})]})]}),e[6]=l,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rs,{}),e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==n?(u=s.jsx(M.Suspense,{fallback:d,children:s.jsx(yi,{siteUrlFromUrl:n,onComplete:l})}),e[9]=l,e[10]=n,e[11]=u):u=e[11];let f;return e[12]!==c||e[13]!==u?(f=s.jsx(zt,{open:!0,children:s.jsxs(Ks,{children:[a,s.jsxs(ps,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:vi,onPointerDownOutside:ji,onInteractOutside:bi,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,s.jsx(We,{fallback:c,children:u})]})]})}),e[12]=c,e[13]=u,e[14]=f):f=e[14],f}function bi(t){return t.preventDefault()}function ji(t){return t.preventDefault()}function vi(t){return t.preventDefault()}function yi({siteUrlFromUrl:t,onComplete:e}){const{org:n}=X(),{data:o}=te.useSession(),i=$t.COMMERCE_DISCOVERY(n.id),r=Tt({connectionId:Ot,orgId:n.id,orgSlug:n.slug}),a=gs({queryKey:Ct.commerceDiscoveryConnection(n.id,i),queryFn:async()=>{const v=await r.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return Ee(v)},retry:!1}).data.item,m=typeof a?.metadata?.siteUrl=="string"?a.metadata.siteUrl:void 0,c=t||m,d=Ls(c),[u,f]=M.useState(!0),[h,x]=M.useState(null),g=Le({mutationFn:async v=>Ee(await r.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:v}})),retry:!1}),p=Le({mutationFn:async v=>Ee(await r.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:v}})),retry:!1}),b=Hs({siteUrl:c,email:o?.user?.email}),j=async()=>{x(null),Z("commerce_onboarding_open_report_clicked",{domain:d??void 0,organization_id:n.id});const v=c?Vs(c):null;if(v?.ok)try{let y=await p.mutateAsync(v.value);if(y.triggered||(Z("commerce_onboarding_run_reclaim",{domain:d??void 0,organization_id:n.id,reason:y.reason??"not_upgraded"}),await g.mutateAsync(v.value),y=await p.mutateAsync(v.value)),!y.triggered){Z("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:y.reason??"not_triggered"}),x("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(y){Z("commerce_onboarding_run_failed",{domain:d??void 0,organization_id:n.id,error:y instanceof Error?y.message:String(y)}),x("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[d?s.jsx(Bs,{host:d}):null,s.jsx(Us,{org:n,cdConnectionId:i,siteUrl:c,onReadinessChange:f}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(Gs,{href:b,orgId:n.id,className:"lg:hidden"}),h?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:h}):null,s.jsxs(je,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{j()},disabled:p.isPending||!u,children:[p.isPending?"Abrindo relatório...":u?"Ver relatório completo":"Conecte uma ferramenta para continuar",!p.isPending&&u?s.jsx(Mt,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(Ws,{href:b,orgId:n.id})})]})}function Si(t){const e=I.c(5),{onPointerDown:n,onDoubleClick:o}=t,{state:i,isMobile:r}=re();if(r||i==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let m;return e[2]!==o||e[3]!==n?(m=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:o,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=o,e[3]=n,e[4]=m):m=e[4],m}const et=240,_i=400,Ni="sidebar.width";function pe(t){return Math.max(et,Math.min(_i,t))}function Ci(){const t=I.c(11),[e,n]=Ce(Ni,wi),o=M.useRef(null);let i;t[0]!==n||t[1]!==e?(i=d=>{d.preventDefault();const u=d.clientX,f=pe(e),h=o.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of x)b.style.transition="none";const g=b=>{const j=pe(f+(b.clientX-u));h?.style.setProperty("--sidebar-width",`${j}px`)},p=b=>{const j=pe(f+(b.clientX-u));n(j);for(const v of x)v.style.transition="";window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",g),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let l;t[3]!==n?(l=()=>{n(et)},t[3]=n,t[4]=l):l=t[4];const a=l;let m;t[5]!==e?(m=pe(e),t[5]=e,t[6]=m):m=t[6];let c;return t[7]!==r||t[8]!==a||t[9]!==m?(c={width:m,wrapperRef:o,onStartResize:r,resetWidth:a},t[7]=r,t[8]=a,t[9]=m,t[10]=c):c=t[10],c}function wi(t){return typeof t=="number"?pe(t):et}function Qt(){return[]}function Jt(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 i;return e[1]!==n?(i=s.jsxs(qe,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,s.jsx(Ke,{children:s.jsx(ee,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function Zt(t){const e=I.c(18),{item:n}=t,{isMobile:o,setOpenMobile:i}=re();let r;e[0]!==o||e[1]!==n||e[2]!==i?(r=()=>{Z("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:o}),n.onClick?.(),o&&i(!1)},e[0]=o,e[1]=n,e[2]=i,e[3]=r):r=e[3];const l=r,a=n.key,m=n.isActive&&"z-10";let c;e[4]!==m?(c=O(m),e[4]=m,e[5]=c):c=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let u;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(u=s.jsxs(K,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(H,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function ki(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(kt,{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,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(Ai),e[2]=n.group.items,e[3]=r):r=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(l=s.jsx(Jt,{label:o,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==n.items?(o=n.items.map(Ii),e[8]=n.items,e[9]=o):o=e[9];let i;return e[10]!==o?(i=s.jsx(qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ke,{children:s.jsx(ee,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=i):i=e[11],i}case"custom":return n.content}}function Ii(t){return s.jsx(Zt,{item:t},t.key)}function Ai(t){return s.jsx(Zt,{item:t},t.key)}function zi(t){const e=I.c(17),{sections:n,footer:o,additionalContent:i,header:r,variant:l,contentClassName:a}=t,m=l===void 0?"sidebar":l;let c;e[0]!==r?(c=r&&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:r}),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=O("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=n.map($i),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==i?(f=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[6]=i,e[7]=f):f=e[7];let h;e[8]!==d||e[9]!==u||e[10]!==f?(h=s.jsxs(It,{className:d,children:[u,f]}),e[8]=d,e[9]=u,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==o||e[13]!==c||e[14]!==h||e[15]!==m?(x=s.jsxs(Es,{variant:m,children:[c,h,o]}),e[12]=o,e[13]=c,e[14]=h,e[15]=m,e[16]=x):x=e[16],x}function $i(t,e){return s.jsx(ki,{section:t},e)}function es(t){const e=I.c(2);let n;return e[0]!==t?(n=s.jsx(zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}es.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 ts(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ti=bs({name:js().min(2,"Organization name is required")});function Oi(t){const e=I.c(41),{open:n,onOpenChange:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:vs(Ti),defaultValues:{name:""}},e[0]=i):i=e[0];const r=ys(i);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Ei,onSuccess:Mi},e[1]=l):l=e[1];const a=Le(l),m=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(hn,{children:[s.jsx(xn,{children:"Create a new organization"}),s.jsx(pn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let d;if(e[3]!==a||e[4]!==r){let _;e[6]!==a?(_=N=>a.mutateAsync(N),e[6]=a,e[7]=_):_=e[7],d=r.handleSubmit(_),e[3]=a,e[4]=r,e[5]=d}else d=e[5];let u;e[8]!==r.formState.isSubmitting?(u=_=>{const{field:N}=_;return s.jsxs(yn,{children:[s.jsx(Sn,{children:"Organization Name"}),s.jsx(_n,{children:s.jsx(wn,{...N,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(Nn,{children:"The name of your company or organization"}),N.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ts(N.value)]})]}),s.jsx(Cn,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(jn,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==m?(h=m&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:m}),e[13]=m,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==r?(x=()=>{a.reset(),r.reset()},e[15]=a,e[16]=r,e[17]=x):x=e[17];let g;e[18]!==r.formState.isSubmitting||e[19]!==x?(g=s.jsx(un,{disabled:r.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=x,e[20]=g):g=e[20];const p=!r.formState.isValid||r.formState.isSubmitting;let b;e[21]!==r.formState.isSubmitting?(b=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(kn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==p||e[24]!==b?(j=s.jsx(je,{type:"submit",variant:"default",disabled:p,children:b}),e[23]=p,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==g?(v=s.jsxs(gn,{children:[g,j]}),e[26]=j,e[27]=g,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==d||e[31]!==f||e[32]!==h?(y=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,h,v]}),e[29]=v,e[30]=d,e[31]=f,e[32]=h,e[33]=y):y=e[33];let S;e[34]!==r||e[35]!==y?(S=s.jsxs(fn,{children:[c,s.jsx(vn,{...r,children:y})]}),e[34]=r,e[35]=y,e[36]=S):S=e[36];let C;return e[37]!==o||e[38]!==n||e[39]!==S?(C=s.jsx(bn,{open:n,onOpenChange:o,children:S}),e[37]=o,e[38]=n,e[39]=S,e[40]=C):C=e[40],C}function Mi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ei(t){const e=ts(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await te.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const o=n?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function ss(){const t=M.useContext(Ss),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function Pi(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function $e(t){const e=I.c(13),{org:n,size:o}=t,i=o===void 0?"sm":o,r=i==="xs"?"size-5":"size-6",l=i==="xs"?"text-[9px]":"text-xs";let a;e[0]!==r?(a=O(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=a):a=e[1];let m;e[2]!==n.logo||e[3]!==n.name?(m=n.logo?void 0:Pi(n.name),e[2]=n.logo,e[3]=n.name,e[4]=m):m=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:O("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==m||e[11]!==c?(d=s.jsx("div",{className:a,style:m,children:c}),e[9]=a,e[10]=m,e[11]=c,e[12]=d):d=e[12],d}function Di({invitation:t,onChanged:e}){const[n,o]=M.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{o(!0);try{const m=await te.organization.acceptInvitation({invitationId:t.id});if(m.error){oe.error(m.error.message),o(!1);return}}catch{oe.error("Failed to accept invitation"),o(!1);return}oe.success(`Joined ${i}`),Ns();let a;try{a=(await te.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},l=async()=>{o(!0);try{const a=await te.organization.rejectInvitation({invitationId:t.id});if(a.error){oe.error(a.error.message),o(!1);return}oe.success("Invitation declined"),o(!1),e()}catch{oe.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx($e,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(mn,{size:14})})]})]})}function Fi(t){const e=I.c(29),{orgParam:n,onSelectOrg:o,onCreateOrg:i}=t,{data:r}=_s(),{invitations:l,refetch:a}=ss();let m;e[0]!==n?(m=(k,$)=>k.slug===n?-1:$.slug===n?1:k.name.localeCompare($.name),e[0]=n,e[1]=m):m=e[1];const c=[...r??[]].sort(m),[d,u]=M.useState(""),f=d.toLowerCase(),h=f?c.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Lt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>u(k.target.value),e[3]=g):g=e[3];let p;e[4]!==d?(p=k=>k.key==="Escape"&&d&&u(""),e[4]=d,e[5]=p):p=e[5];let b;e[6]!==d||e[7]!==p?(b=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:g,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=b):b=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xe,{size:16}),e[9]=j):j=e[9];let v;e[10]!==i?(v=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=i,e[11]=v):v=e[11];let y;e[12]!==b||e[13]!==v?(y=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,v]}),e[12]=b,e[13]=v,e[14]=y):y=e[14];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==l||e[16]!==d||e[17]!==a?(C=!d&&l.map(k=>s.jsx(Di,{invitation:k,onChanged:a},k.id)),e[15]=l,e[16]=d,e[17]=a,e[18]=C):C=e[18];const _=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let N;e[19]!==o||e[20]!==n?(N=k=>s.jsxs("button",{type:"button",onClick:()=>o(k.slug),className:O("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx($e,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(Rt,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[19]=o,e[20]=n,e[21]=N):N=e[21];const w=h.map(N);let A;e[22]!==C||e[23]!==_||e[24]!==w?(A=s.jsxs("div",{className:S,children:[C,_,w]}),e[22]=C,e[23]=_,e[24]=w,e[25]=A):A=e[25];let z;return e[26]!==A||e[27]!==y?(z=s.jsxs(s.Fragment,{children:[y,A]}),e[26]=A,e[27]=y,e[28]=z):z=e[28],z}function ns(t){const e=I.c(22),{trigger:n,orgParam:o,align:i,side:r}=t,l=i===void 0?"start":i,a=r===void 0?"bottom":r,m=ne(),[c,d]=M.useState(!1),[u,f]=M.useState(!1);let h;e[0]!==n?(h=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const x=String(c);let g;e[2]!==m?(g=C=>{d(!1),m({to:"/$org",params:{org:C}})},e[2]=m,e[3]=g):g=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{d(!1),f(!0)},e[4]=p):p=e[4];let b;e[5]!==o||e[6]!==x||e[7]!==g?(b=s.jsx(Fi,{orgParam:o,onSelectOrg:g,onCreateOrg:p},x),e[5]=o,e[6]=x,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==l||e[10]!==a||e[11]!==b?(j=s.jsx(ke,{side:a,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Li,onCloseAutoFocus:Ri,children:b}),e[9]=l,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==h||e[15]!==j?(v=s.jsxs(Ie,{open:c,onOpenChange:d,children:[h,j]}),e[13]=c,e[14]=h,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Oi,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let S;return e[19]!==y||e[20]!==v?(S=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=S):S=e[21],S}function Ri(t){return t.preventDefault()}function Li(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Hi(t){const e=I.c(21),{value:n,onChange:o,placeholder:i,onKeyDown:r,className:l,isSearching:a,disabled:m}=t,c=i===void 0?"Search...":i;let d;e[0]!==l?(d=O("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=d):d=e[1];const u=m?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=O("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let x;e[6]!==o?(x=j=>o(j.target.value),e[6]=o,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==c||e[11]!==x||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:r,placeholder:c,disabled:m,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=m,e[9]=r,e[10]=c,e[11]=x,e[12]=n,e[13]=g):g=e[13];let p;e[14]!==f||e[15]!==h||e[16]!==g?(p=s.jsxs("label",{className:f,children:[h,g]}),e[14]=f,e[15]=h,e[16]=g,e[17]=p):p=e[17];let b;return e[18]!==d||e[19]!==p?(b=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=b):b=e[20],b}const Bi="Select an existing agent";function Ui(t){const e=I.c(5),{children:n}=t;let o;e[0]!==n?(o=s.jsx(le,{asChild:!0,children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ae,{side:"right",sideOffset:8,children:Bi}),e[2]=i):i=e[2];let r;return e[3]!==o?(r=s.jsxs(ce,{defaultOpen:!0,delayDuration:0,children:[o,i]}),e[3]=o,e[4]=r):r=e[4],r}function Gi(t){const e=ne(),{create:n}=Gt(),{locator:o}=X(),i=Ve({strict:!1}),r=we({strict:!1});return async l=>{const a=crypto.randomUUID(),m=l===r.virtualmcpid?Mn(t,o,i.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...m?{branch:m}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Pe(t){const e=I.c(20),{agent:n,selected:o,onClick:i}=t,r=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==r?(l=O("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(de,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let m;e[5]!==n.title?(m=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=m):m=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let d;e[9]!==m||e[10]!==c?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=d):d=e[11];let u;e[12]!==o?(u=o&&s.jsx(Rt,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==l||e[16]!==a||e[17]!==d||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:l,children:[a,d,u]}),e[14]=i,e[15]=l,e[16]=a,e[17]=d,e[18]=u,e[19]=f):f=e[19],f}function at(t){const e=I.c(5),{children:n,action:o}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==o||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,o]}),e[2]=o,e[3]=i,e[4]=r):r=e[4],r}function Wi(t){const e=I.c(27),{onClose:n,onSelectAgent:o,selectedAgentId:i,onImportFromGithub:r}=t,[l,a]=M.useState(""),m=Dt(),c=m??[],{org:d}=X(),{data:u}=te.useSession(),f=u?.user?.id??"anon",h=Dn(m),x=Fn(),g=Gi(d.slug),p=Ln(m),b=l.toLowerCase(),j=c.filter(Yi).filter(V=>!p.has(V.id)).filter(Ki).filter(V=>!l||V.title.toLowerCase().includes(b)),v=j.filter(qi),y=j.filter(Vi),S=_e(d.id),C=!l||S.title.toLowerCase().includes(b),_=!!(o&&C);let N;e[0]!==n||e[1]!==o?(N=()=>{o?.(null),n(),a("")},e[0]=n,e[1]=o,e[2]=N):N=e[2];const w=N,A=V=>{if(o){o(V.id),n(),a("");return}Rn({orgId:d.id,userId:f},V.id,h),x(),n(),a(""),g(V.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let k;e[3]!==l?(k=s.jsx(Hi,{value:l,onChange:a,placeholder:"Search agents..."}),e[3]=l,e[4]=k):k=e[4];const $="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",D=o&&C&&S&&s.jsx(Pe,{agent:S,selected:!i||i===S.id,onClick:w}),R=(v.length>0||!l)&&s.jsx(at,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(zn,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),B=v.map(V=>s.jsx(Pe,{agent:V,selected:o?i===V.id:void 0,onClick:()=>A(V)},V.id)),L=y.length>0&&s.jsx(at,{children:"Agents"}),P=y.map(V=>s.jsx(Pe,{agent:V,selected:o?i===V.id:void 0,onClick:()=>A(V)},V.id));let E;e[5]!==_||e[6]!==l||e[7]!==j.length?(E=j.length===0&&!_&&l&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=_,e[6]=l,e[7]=j.length,e[8]=E):E=e[8];let F;e[9]!==E||e[10]!==D||e[11]!==R||e[12]!==B||e[13]!==L||e[14]!==P?(F=s.jsxs("div",{className:$,children:[D,R,B,L,P,E]}),e[9]=E,e[10]=D,e[11]=R,e[12]=B,e[13]=L,e[14]=P,e[15]=F):F=e[15];let U;e[16]!==d.slug?(U={org:d.slug},e[16]=d.slug,e[17]=U):U=e[17];let G;e[18]!==n?(G=()=>n(),e[18]=n,e[19]=G):G=e[19];let W;e[20]!==U||e[21]!==G?(W=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Cs,{to:"/$org/settings/agents",params:U,onClick:G,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=U,e[21]=G,e[22]=W):W=e[22];let Y;return e[23]!==F||e[24]!==W||e[25]!==k?(Y=s.jsxs("div",{className:z,children:[k,F,W]}),e[23]=F,e[24]=W,e[25]=k,e[26]=Y):Y=e[26],Y}function Vi(t){return!Vt(t.metadata)}function qi(t){return Vt(t.metadata)}function Ki(t){return!sn(t.id)}function Yi(t){return!tn(t.id)}function Xi(t){const e=I.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:o,trigger:i,onSelectAgent:r,selectedAgentId:l,side:a,align:m}=n,c=o===void 0?!1:o,d=a===void 0?"right":a,u=m===void 0?"start":m,[f,h]=M.useState(!1),[x,g]=M.useState(!1),p=Ye(),{setOpenMobile:b}=re(),j=Pn(),v=j?"border border-border":void 0;let y;e[2]!==j?(y=R=>j?s.jsx(Ui,{children:R}):R,e[2]=j,e[3]=y):y=e[3];const S=y;let C;e[4]!==p||e[5]!==b?(C=()=>{h(!1),p&&b(!1)},e[4]=p,e[5]=b,e[6]=C):C=e[6];const _=C;let N;e[7]!==_?(N=()=>{_(),g(!0)},e[7]=_,e[8]=N):N=e[8];const w=N;let A;e[9]!==_||e[10]!==w||e[11]!==r||e[12]!==f||e[13]!==l?(A=f&&s.jsx(M.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(se,{className:"h-4 w-24"})}),children:s.jsx(Wi,{onClose:_,onSelectAgent:r,selectedAgentId:l,onImportFromGithub:w})}),e[9]=_,e[10]=w,e[11]=r,e[12]=f,e[13]=l,e[14]=A):A=e[14];const z=A;let k;e[15]!==u||e[16]!==c||e[17]!==v||e[18]!==j||e[19]!==p||e[20]!==f||e[21]!==z||e[22]!==d||e[23]!==i||e[24]!==S?(k=p?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?S(s.jsx(me,{"aria-label":"Browse agents",className:O(v),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx(xe,{className:"size-4"})})):s.jsx(H,{children:S(s.jsxs(K,{tooltip:j?void 0:"Browse agents",className:O(v),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx(xe,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ht,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Bt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Ut,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ie,{open:f,onOpenChange:R=>{R&&!f&&Z("agent_browser_opened",{surface:"desktop_popover"}),h(R)},children:[i?s.jsx(fe,{asChild:!0,children:i}):c?S(s.jsx(fe,{asChild:!0,children:s.jsx(me,{"aria-label":"Browse agents",className:O(v),children:s.jsx(xe,{className:"size-4"})})})):s.jsx(H,{children:S(s.jsx(fe,{asChild:!0,children:s.jsxs(K,{tooltip:j?void 0:"Browse agents",className:O(v),children:[s.jsx(xe,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(ke,{className:"w-[380px] p-0 overflow-hidden",side:d,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=v,e[18]=j,e[19]=p,e[20]=f,e[21]=z,e[22]=d,e[23]=i,e[24]=S,e[25]=k):k=e[25];let $;e[26]!==x?($=s.jsx($n,{open:x,onOpenChange:g,mode:"agent"}),e[26]=x,e[27]=$):$=e[27];let D;return e[28]!==$||e[29]!==k?(D=s.jsxs(s.Fragment,{children:[k,$]}),e[28]=$,e[29]=k,e[30]=D):D=e[30],D}const Qi="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Ji(t){const e=I.c(19),{agentId:n,fallback:o,onOpenHome:i,onPick:r}=t,l=Qe(n)??o??null,a=l?.title??"Super Agent",m=`Open ${a} home`,c=l?.icon??null;let d;e[0]!==c||e[1]!==a?(d=s.jsx(de,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=d):d=e[2];let u;e[3]!==i||e[4]!==m||e[5]!==d?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":m,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:d}),e[3]=i,e[4]=m,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:Qi,children:[f,h]}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==n||e[13]!==r||e[14]!==x?(g=s.jsx(Xi,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=g):g=e[15];let p;return e[16]!==u||e[17]!==g?(p=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=p):p=e[18],p}function Ue(t){const e=I.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:o}=n,{org:i}=X(),{state:r,isMobile:l}=re(),a=ss().invitations.length>0,m=r==="collapsed"||l,c=a?`${i.name} — switch organization (pending invitation)`:`${i.name} — switch organization`;let d;e[2]!==i?(d=s.jsx($e,{org:i,size:"sm"}),e[2]=i,e[3]=d):d=e[3];let u;e[4]!==a||e[5]!==m?(u=a&&s.jsx("span",{className:O("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==d||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[d,u]}),e[7]=d,e[8]=u,e[9]=f):f=e[9];let h;e[10]!==i.name||e[11]!==o?(h=o&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[10]=i.name,e[11]=o,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Xe,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==h?(g=s.jsx(le,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[f,h,x]})}),e[14]=c,e[15]=f,e[16]=h,e[17]=g):g=e[17];let p;e[18]!==i.slug||e[19]!==g?(p=s.jsx(ns,{orgParam:i.slug,trigger:g}),e[18]=i.slug,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==i.name?(b=s.jsx(ae,{side:"bottom",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==p?(j=s.jsxs(ce,{children:[p,b]}),e[23]=b,e[24]=p,e[25]=j):j=e[25],j}function Te(t){const e=I.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:o}=n,{org:i}=X(),r=ne();let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[2]=l):l=e[2];const a=Ve(l);let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[3]=m):m=e[3];const c=we(m),{threads:d}=Je(),{data:u}=te.useSession(),{setTaskId:f,createNewTask:h}=Ze();let x;e[4]!==i.id?(x=_e(i.id),e[4]=i.id,e[5]=x):x=e[5];const g=x,p=g.id,b=a.taskId?c.virtualmcpid??p:p;let j;e[6]!==h||e[7]!==p||e[8]!==r||e[9]!==o||e[10]!==i.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==d?(j=N=>{if(!N||N===p){r({to:"/$org",params:{org:i.slug}}),o?.();return}const w=Gn(d,N,u?.user?.id);w?f(w.id,N):h(N),o?.()},e[6]=h,e[7]=p,e[8]=r,e[9]=o,e[10]=i.slug,e[11]=u?.user?.id,e[12]=f,e[13]=d,e[14]=j):j=e[14];const v=j;let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=y):y=e[15];const S=b===p?g:void 0;let C;e[16]!==b||e[17]!==v?(C=()=>v(b),e[16]=b,e[17]=v,e[18]=C):C=e[18];let _;return e[19]!==b||e[20]!==v||e[21]!==S||e[22]!==C?(_=s.jsx(M.Suspense,{fallback:y,children:s.jsx(Ji,{agentId:b,fallback:S,onOpenHome:C,onPick:v})}),e[19]=b,e[20]=v,e[21]=S,e[22]=C,e[23]=_):_=e[23],_}function ct(t){const e=I.c(18),{item:n,onClose:o}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=O(i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n||e[3]!==o?(l=()=>{n.onClick?.(),o()},e[2]=n,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let m;e[7]!==n.label?(m=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=m):m=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==m?(c=s.jsxs(K,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,m]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=m,e[14]=c):c=e[14];let d;return e[15]!==r||e[16]!==c?(d=s.jsx(H,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=d):d=e[17],d}function Zi(t){const e=I.c(18),{section:n,onClose:o}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(kt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==n.group.items){let m;e[5]!==o?(m=c=>s.jsx(ct,{item:c,onClose:o},c.key),e[5]=o,e[6]=m):m=e[6],l=n.group.items.map(m),e[2]=o,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(Jt,{label:i,defaultExpanded:r,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let i;if(e[11]!==o||e[12]!==n.items){let l;e[14]!==o?(l=a=>s.jsx(ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],i=n.items.map(l),e[11]=o,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(qe,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ke,{children:s.jsx(ee,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function eo(t){const e=I.c(24),{sections:n,onClose:o,footer:i,additionalContent:r}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ue,{}),e[0]=l):l=e[0];let a;e[1]!==o?(a=s.jsx(Te,{onNavigate:o}),e[1]=o,e[2]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1"}),e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Et,{size:16}),e[4]=c):c=e[4];let d;e[5]!==o?(d=s.jsx(me,{onClick:o,"aria-label":"Close sidebar",children:c}),e[5]=o,e[6]=d):d=e[6];let u;e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[l,a,m,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;if(e[10]!==o||e[11]!==n){let p;e[13]!==o?(p=(b,j)=>s.jsx(Zi,{section:b,onClose:o},j),e[13]=o,e[14]=p):p=e[14],f=n.map(p),e[10]=o,e[11]=n,e[12]=f}else f=e[12];let h;e[15]!==r?(h=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs(It,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let g;return e[20]!==i||e[21]!==u||e[22]!==x?(g=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[u,x,i]}),e[20]=i,e[21]=u,e[22]=x,e[23]=g):g=e[23],g}function ue(t){const e=I.c(26),{item:n,onClose:o}=t;let i;e[0]!==n.className?(i=O("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=i):i=e[1];const r=i;if(n.href){const d=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let h;e[4]!==n.label?(h=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=h):h=e[5];let x;return e[6]!==r||e[7]!==n.href||e[8]!==o||e[9]!==d||e[10]!==u||e[11]!==f||e[12]!==h?(x=s.jsxs("a",{href:n.href,target:d,rel:u,className:r,onClick:o,children:[f,h]}),e[6]=r,e[7]=n.href,e[8]=o,e[9]=d,e[10]=u,e[11]=f,e[12]=h,e[13]=x):x=e[13],x}let l;e[14]!==n||e[15]!==o?(l=()=>{n.onClick?.(),o()},e[14]=n,e[15]=o,e[16]=l):l=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let m;e[19]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=m):m=e[20];let c;return e[21]!==r||e[22]!==l||e[23]!==a||e[24]!==m?(c=s.jsxs("button",{type:"button",onClick:l,className:r,children:[a,m]}),e[21]=r,e[22]=l,e[23]=a,e[24]=m,e[25]=c):c=e[25],c}function to(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:"Impersonating"}),t[0]=e):e=t[0],e}function dt(t){const e=I.c(30),{user:n,userImage:o,isImpersonating:i,isMobile:r}=t,l=r?"py-4 border-b border-border":"py-3 mx-1 mt-1";let a;e[0]!==l?(a=O("flex items-center gap-3 px-4",l),e[0]=l,e[1]=a):a=e[1];const m=n?.name??"U";let c;e[2]!==m||e[3]!==o?(c=s.jsx(He,{url:o,fallback:m,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=m,e[3]=o,e[4]=c):c=e[4];const d=n?.name??"User";let u;e[5]!==d?(u=s.jsx("p",{className:"text-sm font-medium truncate",children:d}),e[5]=d,e[6]=u):u=e[6];let f;e[7]!==i?(f=i&&s.jsx(to,{}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==u||e[10]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2",children:[u,f]}),e[9]=u,e[10]=f,e[11]=h):h=e[11];const x=n?.email;let g;e[12]!==x?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x}),e[12]=x,e[13]=g):g=e[13];let p;e[14]!==g||e[15]!==h?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,g]}),e[14]=g,e[15]=h,e[16]=p):p=e[16];let b;e[17]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(so)},e[17]=n,e[18]=b):b=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Wn,{size:14}),e[19]=j):j=e[19];let v;e[20]!==b?(v=s.jsx(le,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:j})}),e[20]=b,e[21]=v):v=e[21];let y;e[22]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ae,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[22]=y):y=e[22];let S;e[23]!==v?(S=s.jsx(Pt,{delayDuration:300,children:s.jsxs(ce,{children:[v,y]})}),e[23]=v,e[24]=S):S=e[24];let C;return e[25]!==p||e[26]!==S||e[27]!==a||e[28]!==c?(C=s.jsxs("div",{className:a,children:[c,p,S]}),e[25]=p,e[26]=S,e[27]=a,e[28]=c,e[29]=C):C=e[29],C}function so(){oe.success("User ID copied")}function mt(t){const e=I.c(32),{themeOptions:n,preferences:o,setPreferences:i,isMobile:r}=t,l=r?"size-8":"size-7",a=r?"px-3 py-3":"px-2 py-1.5";let m;e[0]!==a?(m=O("flex items-center justify-between border-t border-border/50",a),e[0]=a,e[1]=m):m=e[1];let c;if(e[2]!==l||e[3]!==o.theme||e[4]!==i||e[5]!==n){let y;e[7]!==l||e[8]!==o.theme||e[9]!==i?(y=S=>{const{value:C,icon:_,label:N}=S;return s.jsx("button",{type:"button","aria-label":N,onClick:()=>i(w=>({...w,theme:C})),className:O(l,"rounded-md flex items-center justify-center transition-colors",o.theme===C?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:_},C)},e[7]=l,e[8]=o.theme,e[9]=i,e[10]=y):y=e[10],c=n.map(y),e[2]=l,e[3]=o.theme,e[4]=i,e[5]=n,e[6]=c}else c=e[6];let d;e[11]!==c?(d=s.jsx("div",{className:"flex items-center gap-0.5",children:c}),e[11]=c,e[12]=d):d=e[12];const u=o.enableSounds?"Disable sounds":"Enable sounds";let f;e[13]!==i?(f=()=>i(no),e[13]=i,e[14]=f):f=e[14];const h=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let x;e[15]!==l||e[16]!==h?(x=O(l,"rounded-md flex items-center justify-center transition-colors",h),e[15]=l,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==o.enableSounds?(g=o.enableSounds?s.jsx(on,{size:14}):s.jsx(rn,{size:14}),e[18]=o.enableSounds,e[19]=g):g=e[19];let p;e[20]!==u||e[21]!==f||e[22]!==x||e[23]!==g?(p=s.jsx("button",{type:"button","aria-label":u,onClick:f,className:x,children:g}),e[20]=u,e[21]=f,e[22]=x,e[23]=g,e[24]=p):p=e[24];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.92.3"]}),e[25]=b):b=e[25];let j;e[26]!==p?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[p,b]}),e[26]=p,e[27]=j):j=e[27];let v;return e[28]!==j||e[29]!==m||e[30]!==d?(v=s.jsxs("div",{className:m,children:[d,j]}),e[28]=j,e[29]=m,e[30]=d,e[31]=v):v=e[31],v}function no(t){return{...t,enableSounds:!t.enableSounds}}function ut(t){const e=I.c(54),{user:n,userImage:o,menuItems:i,signOutItem:r,stopImpersonatingItem:l,isImpersonating:a,themeOptions:m,preferences:c,setPreferences:d,close:u,isMobile:f}=t;if(f){let y;e[0]!==a||e[1]!==n||e[2]!==o?(y=s.jsx(dt,{user:n,userImage:o,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=o,e[3]=y):y=e[3];let S;if(e[4]!==u||e[5]!==i){let z;e[7]!==u?(z=k=>s.jsx(ue,{item:k,onClose:u},k.key),e[7]=u,e[8]=z):z=e[8],S=i.map(z),e[4]=u,e[5]=i,e[6]=S}else S=e[6];let C;e[9]!==u||e[10]!==l?(C=l&&s.jsx(ue,{item:l,onClose:u}),e[9]=u,e[10]=l,e[11]=C):C=e[11];let _;e[12]!==u||e[13]!==r?(_=s.jsx(ue,{item:r,onClose:u}),e[12]=u,e[13]=r,e[14]=_):_=e[14];let N;e[15]!==S||e[16]!==C||e[17]!==_?(N=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:[S,C,_]})}),e[15]=S,e[16]=C,e[17]=_,e[18]=N):N=e[18];let w;e[19]!==c||e[20]!==d||e[21]!==m?(w=s.jsx(mt,{themeOptions:m,preferences:c,setPreferences:d,isMobile:!0}),e[19]=c,e[20]=d,e[21]=m,e[22]=w):w=e[22];let A;return e[23]!==y||e[24]!==N||e[25]!==w?(A=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,N,w]}),e[23]=y,e[24]=N,e[25]=w,e[26]=A):A=e[26],A}let h;e[27]!==a||e[28]!==n||e[29]!==o?(h=s.jsx(dt,{user:n,userImage:o,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=o,e[30]=h):h=e[30];let x;if(e[31]!==u||e[32]!==i){let y;e[34]!==u?(y=S=>s.jsx(ue,{item:S,onClose:u},S.key),e[34]=u,e[35]=y):y=e[35],x=i.map(y),e[31]=u,e[32]=i,e[33]=x}else x=e[33];let g;e[36]!==u||e[37]!==l?(g=l&&s.jsx(ue,{item:l,onClose:u}),e[36]=u,e[37]=l,e[38]=g):g=e[38];let p;e[39]!==u||e[40]!==r?(p=s.jsx(ue,{item:r,onClose:u}),e[39]=u,e[40]=r,e[41]=p):p=e[41];let b;e[42]!==x||e[43]!==g||e[44]!==p?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[x,g,p]}),e[42]=x,e[43]=g,e[44]=p,e[45]=b):b=e[45];let j;e[46]!==c||e[47]!==d||e[48]!==m?(j=s.jsx(mt,{themeOptions:m,preferences:c,setPreferences:d,isMobile:!1}),e[46]=c,e[47]=d,e[48]=m,e[49]=j):j=e[49];let v;return e[50]!==h||e[51]!==b||e[52]!==j?(v=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[h,b,j]})}),e[50]=h,e[51]=b,e[52]=j,e[53]=v):v=e[53],v}function ge(){const t=I.c(43),{data:e}=te.useSession(),{org:n}=X(),o=ne();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const l=ws(i)?.params.org,[a,m]=ks(),c=Ye(),{isAdmin:d}=ei(),[u,f]=M.useState(!1),h=e?.user,x=h?.image,g=!!e?.session?.impersonatedBy;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>f(!1),t[1]=p):p=t[1];const b=p;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ae,{size:16}),t[2]=j):j=t[2];let v;t[3]!==o||t[4]!==l?(v={key:"preferences",label:"Preferences",icon:j,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[3]=o,t[4]=l,t[5]=v):v=t[5];let y;t[6]!==n||t[7]!==o?(y=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Vn,{size:16}),onClick:()=>{o({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=o,t[8]=y):y=t[8];let S;t[9]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Kn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=S):S=t[9];let C;t[10]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(Jn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=C):C=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"github",label:"decocms/studio",icon:s.jsx(Is,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=_):_=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N={key:"community",label:"Community",icon:s.jsx(Zn,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=N):N=t[12];let w;t[13]===Symbol.for("react.memo_cache_sentinel")?(w={key:"homepage",label:"Homepage",icon:s.jsx(qn,{size:16}),href:"https://decocms.com",external:!0},t[13]=w):w=t[13];let A;t[14]!==d||t[15]!==o?(A=d?[{key:"admin-dashboard",label:"Admin Dashboard",icon:s.jsx(nn,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[14]=d,t[15]=o,t[16]=A):A=t[16];let z;t[17]!==A||t[18]!==v||t[19]!==y?(z=[v,...y,S,C,_,N,w,...A],t[17]=A,t[18]=v,t[19]=y,t[20]=z):z=t[20];const k=z;let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($={key:"logout",label:"Sign out",icon:s.jsx(rt,{size:16}),onClick:ro},t[21]=$):$=t[21];const D=$;let R;t[22]!==g?(R=g?{key:"stop-impersonating",label:"Stop impersonation",icon:s.jsx(rt,{size:16}),onClick:oo,className:"text-warning"}:null,t[22]=g,t[23]=R):R=t[23];const B=R;let L;t[24]===Symbol.for("react.memo_cache_sentinel")?(L={value:"light",icon:s.jsx(Xn,{size:14}),label:"Light theme"},t[24]=L):L=t[24];let P;t[25]===Symbol.for("react.memo_cache_sentinel")?(P={value:"dark",icon:s.jsx(Qn,{size:14}),label:"Dark theme"},t[25]=P):P=t[25];let E;t[26]===Symbol.for("react.memo_cache_sentinel")?(E=[L,P,{value:"system",icon:s.jsx(Be,{size:14}),label:"System theme"}],t[26]=E):E=t[26];const F=E;let U;t[27]!==g||t[28]!==c||t[29]!==k||t[30]!==a||t[31]!==m||t[32]!==B||t[33]!==h||t[34]!==x?(U={user:h,userImage:x,menuItems:k,signOutItem:D,stopImpersonatingItem:B,isImpersonating:g,themeOptions:F,preferences:a,setPreferences:m,close:b,isMobile:c},t[27]=g,t[28]=c,t[29]=k,t[30]=a,t[31]=m,t[32]=B,t[33]=h,t[34]=x,t[35]=U):U=t[35];const G=U;let W;return t[36]!==g||t[37]!==c||t[38]!==u||t[39]!==G||t[40]!==h?.name||t[41]!==x?(W=s.jsx(s.Fragment,{children:c?s.jsxs(Ht,{open:u,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:O("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",g&&"border-2 border-dashed border-warning"),children:[s.jsx(He,{url:x,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),s.jsxs(Bt,{className:"h-[80dvh] p-0",children:[s.jsx(Ut,{className:"sr-only",children:"Account"}),s.jsx(ut,{...G})]})]}):s.jsxs(Ie,{open:u,onOpenChange:f,children:[s.jsx(fe,{asChild:!0,children:s.jsxs(K,{tooltip:h?.name??"Account",className:O("rounded-md",g&&"border-2 border-dashed border-warning"),children:[s.jsx(He,{url:x,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??"Account"})]})}),s.jsx(ke,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:io,children:s.jsx(ut,{...G})})]})}),t[36]=g,t[37]=c,t[38]=u,t[39]=G,t[40]=h?.name,t[41]=x,t[42]=W):W=t[42],W}function io(t){return t.preventDefault()}async function oo(){const{error:t}=await te.admin.stopImpersonating();if(t){oe.error(t.message||"Failed to stop impersonation");return}window.location.href="/"}function ro(){Z("signed_out",{source:"account_popover"}),As(),te.signOut()}function be(t){const e=I.c(43),{variant:n}=t===void 0?{}:t,o=n===void 0?"icon":n,i=In(),[r,l]=M.useState(!1);let a,m;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const v=ti(i.capabilities);a=i.online?"Desktop linked":"Connect desktop",m=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:v.length>0?`Available: ${v.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=a,e[5]=m}else a=e[4],m=e[5];const c=m;if(o==="full"){let v,y;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=()=>l(!0),y=s.jsx(Be,{}),e[6]=v,e[7]=y):(v=e[6],y=e[7]);let S;e[8]!==a?(S=s.jsx("span",{children:a}),e[8]=a,e[9]=S):S=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let _;e[12]!==a||e[13]!==S||e[14]!==C?(_=s.jsx(le,{asChild:!0,children:s.jsxs(K,{tooltip:a,onClick:v,children:[y,S,C]})}),e[12]=a,e[13]=S,e[14]=C,e[15]=_):_=e[15];let N;e[16]!==c?(N=s.jsx(ae,{side:"right",children:c}),e[16]=c,e[17]=N):N=e[17];let w;e[18]!==_||e[19]!==N?(w=s.jsxs(ce,{children:[_,N]}),e[18]=_,e[19]=N,e[20]=w):w=e[20];let A;e[21]!==r?(A=s.jsx(lt,{open:r,onOpenChange:l}),e[21]=r,e[22]=A):A=e[22];let z;return e[23]!==A||e[24]!==w?(z=s.jsxs(s.Fragment,{children:[w,A]}),e[23]=A,e[24]=w,e[25]=z):z=e[25],z}let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=()=>l(!0),e[26]=d):d=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Be,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let x;e[30]!==u||e[31]!==h?(x=s.jsx(le,{asChild:!0,children:s.jsxs(me,{onClick:d,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=x):x=e[32];let g;e[33]!==c?(g=s.jsx(ae,{side:"bottom",children:c}),e[33]=c,e[34]=g):g=e[34];let p;e[35]!==x||e[36]!==g?(p=s.jsxs(ce,{children:[x,g]}),e[35]=x,e[36]=g,e[37]=p):p=e[37];let b;e[38]!==r?(b=s.jsx(lt,{open:r,onOpenChange:l}),e[38]=r,e[39]=b):b=e[39];let j;return e[40]!==b||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[40]=b,e[41]=p,e[42]=j):j=e[42],j}class lo extends M.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 ao(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function co(){const t=I.c(17),e=ne(),{org:n}=X(),{hasDecoKey:o,balanceDollars:i}=Hn();if(!o)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let l;t[2]!==i?(l=O(i!=null&&ao(i)),t[2]=i,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let m;t[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ln,{}),t[7]=m):m=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let d;t[10]!==c?(d=s.jsx("span",{children:c}),t[10]=c,t[11]=d):d=t[11];let u;return t[12]!==r||t[13]!==l||t[14]!==a||t[15]!==d?(u=s.jsx(ee,{children:s.jsx(H,{children:s.jsxs(K,{tooltip:r,className:l,onClick:a,children:[m,d]})})}),t[12]=r,t[13]=l,t[14]=a,t[15]=d,t[16]=u):u=t[16],u}function ft(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(lo,{children:s.jsx(M.Suspense,{fallback:null,children:s.jsx(co,{})})}),t[0]=e):e=t[0],e}function De(){const t=I.c(7),e=ne(),{org:n}=X();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ae,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let l;return t[5]!==o?(l=s.jsxs(K,{tooltip:"Settings",onClick:o,children:[i,r]}),t[5]=o,t[6]=l):l=t[6],l}function mo(){const t=I.c(6),e=ne(),{org:n}=X();let o;t[0]!==e||t[1]!==n.slug?(o=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=o):o=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ae,{size:15}),t[3]=i):i=t[3];let r;return t[4]!==o?(r=s.jsx("button",{type:"button","aria-label":"Settings",onClick:o,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:i}),t[4]=o,t[5]=r):r=t[5],r}function ht(){const t=I.c(4),[e,n]=M.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(H,{children:s.jsx(qt,{trigger:s.jsxs(K,{tooltip:"Invite members",children:[s.jsx(Ft,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ee,{className:"gap-0.5",children:[o,s.jsx(H,{children:s.jsxs(K,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Yn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(Bn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function xt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ee,{className:"gap-0.5",children:s.jsx(H,{children:s.jsx(qt,{trigger:s.jsxs(K,{tooltip:"Invite members",children:[s.jsx(Ft,{}),s.jsx("span",{children:"Invite members"})]})})})}),t[0]=e):e=t[0],e}function uo(){const t=I.c(17),{state:e}=re(),n=e==="collapsed";if(ze()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(xt,{}),t[0]=f):f=t[0];let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(H,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(be,{})})}),t[1]=h):h=t[1];let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(H,{children:s.jsx(De,{})}),t[2]=x):x=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(he,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(ee,{children:[h,x,s.jsx(H,{children:s.jsx(ge,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xt,{}),t[4]=c):c=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(H,{children:s.jsx(be,{variant:"full"})}),t[5]=d):d=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(he,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(ee,{className:"gap-0.5",children:[d,s.jsx(H,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ge,{})}),s.jsx(mo,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ht,{}),d=s.jsx(ft,{}),t[7]=c,t[8]=d):(c=t[7],d=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(H,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(be,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(H,{children:s.jsx(De,{})}),t[10]=f):f=t[10];let h;return t[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(he,{className:"px-2 pb-3 gap-1",children:[c,d,s.jsxs(ee,{children:[u,f,s.jsx(H,{children:s.jsx(ge,{})})]})]}),t[11]=h):h=t[11],h}let i,r;t[12]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ht,{}),r=s.jsx(ft,{}),t[12]=i,t[13]=r):(i=t[12],r=t[13]);let l;t[14]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(H,{children:s.jsx(be,{variant:"full"})}),t[14]=l):l=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(H,{children:s.jsx(De,{})}),t[15]=a):a=t[15];let m;return t[16]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(he,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ee,{className:"gap-0.5",children:[l,a,s.jsx(H,{children:s.jsx(ge,{})})]})]}),t[16]=m):m=t[16],m}function fo(){const t=I.c(8),e=ne(),{org:n}=X(),{setOpenMobile:o}=re();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ee,{children:s.jsx(H,{children:s.jsx(ge,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==o?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),o(!1)},t[1]=e,t[2]=n.slug,t[3]=o,t[4]=r):r=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ae,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==r?(a=s.jsx(he,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(me,{"aria-label":"Settings",onClick:r,children:l})]})}),t[6]=r,t[7]=a):a=t[7],a}function pt(t){const e=I.c(15),{className:n,wrapperClassName:o,children:i}=t,[r,l]=M.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&l(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const m=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const d=c;let u;e[2]!==o?(u=O("relative",o),e[2]=o,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:m,onScroll:d,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let x;e[7]!==h?(x=O("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=x):x=e[8];let g;e[9]!==x?(g=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=g):g=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==g?(p=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=p):p=e[14],p}function ho(t){const e=I.c(8),{virtualMcpId:n,size:o,showAutomationBadge:i}=t,r=o===void 0?"sm":o;let l;e[0]!==r||e[1]!==n?(l=n?s.jsx(xo,{virtualMcpId:n,size:r}):s.jsx(de,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==i?(a=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Yt,{size:10,className:"text-white"})}),e[3]=i,e[4]=a):a=e[4];let m;return e[5]!==l||e[6]!==a?(m=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=m):m=e[7],m}function xo(t){const e=I.c(6),{virtualMcpId:n,size:o}=t,i=Qe(n);if(!i){let a;return e[0]!==o?(a=s.jsx(de,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const r=i.icon??null;let l;return e[2]!==i.title||e[3]!==o||e[4]!==r?(l=s.jsx(de,{icon:r,name:i.title,size:o}),e[2]=i.title,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function gt(t){const e=I.c(36),{open:n,onOpenChange:o}=t,[i,r]=M.useState(""),{org:l}=X(),{setTaskId:a}=Ze(),m=Kt();let c,d,u;e[0]!==l.id||e[1]!==i?(u=i.trim(),d=zs,c=Ct.globalSearch(l.id,u),e[0]=l.id,e[1]=i,e[2]=c,e[3]=d,e[4]=u):(c=e[2],d=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==m||e[6]!==u?(h=async()=>await m.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=m,e[6]=u,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==h?(x={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=x):x=e[11];const{data:g,isFetching:p}=d(x);let b;e[12]!==g?.items?(b=g?.items??[],e[12]=g?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==o?(v=$=>{$||r(""),o($)},e[14]=o,e[15]=v):v=e[15];const y=v;let S;e[16]!==y||e[17]!==a?(S=$=>{y(!1),a($.id,$.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=S):S=e[18];const C=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Ys,{className:"sr-only",children:[s.jsx(At,{children:"Search"}),s.jsx(Xs,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let N;e[20]!==i?(N=s.jsx(li,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=N):N=e[21];let w;e[22]!==C||e[23]!==p||e[24]!==j||e[25]!==u?(w=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(oi,{children:"No results."}):j.map($=>$.type==="thread"?s.jsxs(ri,{value:`thread:${$.id}:${$.title}`,onSelect:()=>C($),className:"gap-2.5",children:[s.jsx(ho,{virtualMcpId:$.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:$.title||"Untitled chat"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date($.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${$.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=p,e[24]=j,e[25]=u,e[26]=w):w=e[26];let A;e[27]!==w?(A=s.jsx(ai,{children:w}),e[27]=w,e[28]=A):A=e[28];let z;e[29]!==N||e[30]!==A?(z=s.jsxs(Qs,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(ci,{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:[N,A]})]}),e[29]=N,e[30]=A,e[31]=z):z=e[31];let k;return e[32]!==y||e[33]!==n||e[34]!==z?(k=s.jsx(zt,{open:n,onOpenChange:y,children:z}),e[32]=y,e[33]=n,e[34]=z,e[35]=k):k=e[35],k}function po(t){return t==="ephemeral"||t.startsWith("thread:")}function is(t){const e=I.c(40),{task:n,isActive:o,onClick:i,onArchive:r,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:m,indented:c}=t,d=ui(n.status),u=d.icon,f=n.metadata?.kind==="tool_call_run",h=Qe(f?void 0:n.virtual_mcp_id);let x;e[0]!==h?(x=Un(h),e[0]=h,e[1]=x):x=e[1];const g=x;fi(6e4);const p=l||!!n.trigger_id,b=n.id,j="button",v=0;let y;e[2]!==i?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),i())},e[2]=i,e[3]=y):y=e[3];const S=c?"-ml-4 pl-6":"pl-[7px]",C=o?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==S||e[5]!==C?(_=O("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",S,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=S,e[5]=C,e[6]=_):_=e[6];let N;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(N=a&&!f&&s.jsx(de,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=N):N=e[11];let w;e[12]!==p?(w=p&&s.jsx(Yt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=w):w=e[13];const A=n.title||"Untitled task";let z;e[14]!==A?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:A}),e[14]=A,e[15]=z):z=e[15];let k;e[16]!==w||e[17]!==z?(k=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,z]}),e[16]=w,e[17]=z,e[18]=k):k=e[18];let $;e[19]!==g||e[20]!==o||e[21]!==n.branch||e[22]!==n.updated_at?($=n.updated_at&&s.jsxs("div",{className:O("flex items-center gap-1 text-[11px] min-w-0",o?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!po(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):g?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[g.owner,"/",g.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:xi(new Date(n.updated_at))})]}),e[19]=g,e[20]=o,e[21]=n.branch,e[22]=n.updated_at,e[23]=$):$=e[23];let D;e[24]!==k||e[25]!==$?(D=s.jsxs("div",{className:"flex-1 min-w-0",children:[k,$]}),e[24]=k,e[25]=$,e[26]=D):D=e[26];const R="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",B=!m&&s.jsx("span",{className:O("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":d.label,children:s.jsx(u,{size:14,className:O(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let L;e[27]!==r?(L=r&&s.jsxs(ce,{children:[s.jsx(le,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:F=>{F.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx($s,{size:14})})}),s.jsx(ae,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=L):L=e[28];let P;e[29]!==B||e[30]!==L?(P=s.jsxs("div",{className:R,children:[B,L]}),e[29]=B,e[30]=L,e[31]=P):P=e[31];let E;return e[32]!==i||e[33]!==D||e[34]!==P||e[35]!==y||e[36]!==_||e[37]!==N||e[38]!==n.id?(E=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:v,onClick:i,onKeyDown:y,className:_,children:[N,D,P]}),e[32]=i,e[33]=D,e[34]=P,e[35]=y,e[36]=_,e[37]=N,e[38]=n.id,e[39]=E):E=e[39],E}const bt=["requires_action","in_progress","failed","expired","completed"];function go(t){const e=new Map(bt.map(n=>[n,[]]));for(const n of t){const o=n.status??"completed";(e.get(o)??e.get("completed")).push(n)}return bt.map(n=>({status:n,threads:e.get(n)}))}const bo="sidebar.group.expanded.";function jo(t,e){const n=I.c(3),[o,i]=Ce(`${bo}${t}`,e);let r;return n[0]!==o||n[1]!==i?(r=[o,i],n[0]=o,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=I.c(12),{onClick:n,isFetching:o,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==r?(l=O("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=l):l=e[1];let a;e[2]!==o?(a=o&&s.jsx(wt,{size:14,className:"animate-spin"}),e[2]=o,e[3]=a):a=e[3];const m=o?"Loading…":"Show more";let c;e[4]!==m?(c=s.jsx("span",{children:m}),e[4]=m,e[5]=c):c=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==c?(d=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:o,className:l,children:[a,c]}),e[6]=o,e[7]=n,e[8]=l,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function vo(t,e,n,o){return[t,e,n,o.type,o.member,o.currentUserId??""].join("|")}function yo(t){return t.member==="mine"&&!t.currentUserId}const rs=4;let Se=0;const Ge=[];function So(){for(;Se<rs&&Ge.length>0;){const t=Ge.shift();t&&t()}}function ls(t){return new Promise((e,n)=>{const o=()=>{Se++,t().then(e,n).finally(()=>{Se--,So()})};Se<rs?o():Ge.push(o)})}const Oe=10;function jt(t,e,n,o,i){const r={hidden:!1};o.member==="mine"&&o.currentUserId&&(r.created_by=o.currentUserId),o.type==="automation"&&(r.has_trigger=!0),o.type==="manual"&&(r.has_trigger=!1);const l={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function _o(t,e,n,o){let i=0;for(const r of t)as(r,e,n,o)&&i++;return i}function Fe(t,e,n,o){return _o(t,e,n,o)}function No(t,e){return!!(t>=Oe||t===0&&e)}function vt(t,e){return t<e}function Co(t,e){return e===!1?!1:e===!0?!0:t}function as(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 Ne=new Map,ye=new Map;function wo(t,e){return e?t>=Oe?!0:null:!1}function yt(t){return Ne.get(t)}function ko(t,e){Ne.set(t,e)}function Io(t,e,n){const o=Ne.get(t);if(o!==void 0){n(o);return}let i=ye.get(t);i||(i=ls(e).then(r=>(Ne.set(t,r),ye.delete(t),r)).catch(()=>(ye.delete(t),Promise.reject(new Error("group probe failed")))),ye.set(t,i)),i.then(n,()=>n(!1))}function St(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Oe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ao(t,e,n,o,i){let r=0;for(const l of t)e.has(l.id)||as(l,n,o,i)&&r++;return r}function zo(t,e,n,o){const i=I.c(8),{org:r}=X(),l=vo(r.id,t,e,n);let a;i[0]!==n?(a=yo(n),i[0]=n,i[1]=a):a=i[1];const m=a,[c,d]=M.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==l&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const u=Tn(),{threads:f,hasMore:h}=Je(),x=Fe(f,t,e,n),g=No(x,h),p=wo(x,h),b=Kt();if(c.identity===l&&c.serverHasMore===null){const _=p??yt(l);_!==void 0&&d({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!m&&c.identity===l&&c.serverHasMore===null&&p===null&&yt(l)===void 0&&c.probeSubscribedIdentity!==l&&(d(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),Io(l,async()=>{const _=jt(t,e,0,n,1),N=await b.call("COLLECTION_THREADS_LIST",_),{totalCount:w}=St(N),A=Fe(u.threads.get(),t,e,n);return w===void 0?!1:vt(A,w)},_=>{d(N=>N.identity!==l?N:{...N,isProbing:!1,serverHasMore:_})}));const v=async function(){if(c.isFetching||c.isProbing||m)return;const N=l;d(w=>w.identity===N?{...w,isFetching:!0}:w);try{const w=Fe(f,t,e,n),A=jt(t,e,w,n,Oe),z=await ls(()=>b.call("COLLECTION_THREADS_LIST",A)),{items:k,hasMore:$,totalCount:D}=St(z),R=new Set(f.map($o)),B=Ao(k,R,t,e,n),L=w;u.mergeThreads(k),d(P=>{if(P.identity!==N)return P;let E;return D!==void 0?E=vt(L+B,D):E=k.length===0||B===0?!1:$,ko(N,E),{...P,isFetching:!1,serverHasMore:E}})}catch(w){const A=w,z=A instanceof Error?A.message:String(A);oe.error(`Could not load more tasks: ${z}`),d(k=>k.identity===N?{...k,isFetching:!1}:k)}},y=c.isFetching||c.isProbing,S=!m&&!y&&Co(g,c.serverHasMore);let C;return i[2]!==y||i[3]!==v||i[4]!==S||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:S,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},i[2]=y,i[3]=v,i[4]=S,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function $o(t){return t.id}function To(t){const e=I.c(20),{status:n,threads:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:a,filters:m}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:f,serverHasMore:h}=zo("status",n,m),[x,g]=M.useState(!1);!x&&o.length===0&&h===!0&&!c&&!d&&(g(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==i||e[1]!==a||e[2]!==m||e[3]!==l||e[4]!==r||e[5]!==o){let v;e[7]!==i||e[8]!==a||e[9]!==m||e[10]!==l||e[11]!==r?(v=y=>s.jsx(is,{task:y,isActive:i===y.id,onClick:()=>r(y),onArchive:a&&y.created_by===m.currentUserId?()=>l(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=a,e[9]=m,e[10]=l,e[11]=r,e[12]=v):v=e[12],p=o.map(v),e[0]=i,e[1]=a,e[2]=m,e[3]=l,e[4]=r,e[5]=o,e[6]=p}else p=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[p,b]}),e[17]=p,e[18]=b,e[19]=j):j=e[19],j}function Oo(t){const e=I.c(36),{status:n,threads:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:a,filters:m}=t,c=hi[n],d=c.icon,[u,f]=jo(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const x=h;let g;e[3]!==x?(g=N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),x())},e[3]=x,e[4]=g):g=e[4];let p;e[5]!==d||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=p):p=e[7];let b;e[8]!==u?(b=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(Xe,{size:14}):s.jsx(pi,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==p||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,b]}),e[10]=p,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c.label?(v=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=v):v=e[14];let y;e[15]!==o.length?(y=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]=y):y=e[16];let S;e[17]!==u||e[18]!==x||e[19]!==g||e[20]!==j||e[21]!==v||e[22]!==y?(S=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,v,y]}),e[17]=u,e[18]=x,e[19]=g,e[20]=j,e[21]=v,e[22]=y,e[23]=S):S=e[23];let C;e[24]!==i||e[25]!==a||e[26]!==u||e[27]!==m||e[28]!==l||e[29]!==r||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(To,{status:n,threads:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:a,filters:m})}),e[24]=i,e[25]=a,e[26]=u,e[27]=m,e[28]=l,e[29]=r,e[30]=n,e[31]=o,e[32]=C):C=e[32];let _;return e[33]!==S||e[34]!==C?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[S,C]}),e[33]=S,e[34]=C,e[35]=_):_=e[35],_}function _t(t){const e=I.c(38),{threads:n,groupBy:o,activeTaskId:i,onSelectTask:r,onArchiveTask:l,filters:a,hasMore:m,isFetchingMore:c,onLoadMore:d,filtersActive:u}=t;if(n.length===0&&!m&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(mi,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||m;if(o==="status"){let p;if(e[3]!==i||e[4]!==f||e[5]!==a||e[6]!==l||e[7]!==r||e[8]!==n){let j;e[10]!==i||e[11]!==f||e[12]!==a||e[13]!==l||e[14]!==r?(j=v=>s.jsx(Oo,{status:v.status,threads:v.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:l,canArchive:f,filters:a},v.status),e[10]=i,e[11]=f,e[12]=a,e[13]=l,e[14]=r,e[15]=j):j=e[15],p=go(n).map(j),e[3]=i,e[4]=f,e[5]=a,e[6]=l,e[7]=r,e[8]=n,e[9]=p}else p=e[9];let b;return e[16]!==p?(b=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=b):b=e[17],b}let h;if(e[18]!==i||e[19]!==f||e[20]!==a||e[21]!==l||e[22]!==r||e[23]!==n){let p;e[25]!==i||e[26]!==f||e[27]!==a||e[28]!==l||e[29]!==r?(p=b=>s.jsx(is,{task:b,isActive:i===b.id,onClick:()=>r(b),onArchive:f&&b.created_by===a.currentUserId?()=>l(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=i,e[26]=f,e[27]=a,e[28]=l,e[29]=r,e[30]=p):p=e[30],h=n.map(p),e[18]=i,e[19]=f,e[20]=a,e[21]=l,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let x;e[31]!==m||e[32]!==c||e[33]!==d?(x=(m||c)&&s.jsx(os,{onClick:d,isFetching:c}),e[31]=m,e[32]=c,e[33]=d,e[34]=x):x=e[34];let g;return e[35]!==h||e[36]!==x?(g=s.jsxs(s.Fragment,{children:[h,x]}),e[35]=h,e[36]=x,e[37]=g):g=e[37],g}function Mo(t,e,n){if(!n)return;const o=t.findIndex(i=>i.id===e);if(o!==-1){for(let i=o+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=o-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Nt(t){const e=I.c(17),{label:n,onClick:o,active:i,children:r}=t,[l,a]=M.useState(!1);let m,c,d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),c=()=>a(!1),d=()=>a(!0),u=()=>a(!1),e[0]=m,e[1]=c,e[2]=d,e[3]=u):(m=e[0],c=e[1],d=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=O("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=h):h=e[5];let x;e[6]!==r||e[7]!==n||e[8]!==o||e[9]!==h?(x=s.jsx(le,{asChild:!0,children:s.jsx(me,{"aria-label":n,onClick:o,onPointerEnter:m,onPointerLeave:c,onFocus:d,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=o,e[9]=h,e[10]=x):x=e[10];let g;e[11]!==n?(g=s.jsx(ae,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let p;return e[13]!==l||e[14]!==x||e[15]!==g?(p=s.jsxs(ce,{open:l,children:[x,g]}),e[13]=l,e[14]=x,e[15]=g,e[16]=p):p=e[16],p}function Re(t){const e=I.c(13),{label:n,value:o,onChange:i,options:r}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==i?(a=u=>u&&i(u),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==r?(m=r.map(Eo),e[4]=r,e[5]=m):m=e[5];let c;e[6]!==a||e[7]!==m||e[8]!==o?(c=s.jsx(ii,{type:"single",size:"sm",value:o,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:m}),e[6]=a,e[7]=m,e[8]=o,e[9]=c):c=e[9];let d;return e[10]!==l||e[11]!==c?(d=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,c]}),e[10]=l,e[11]=c,e[12]=d):d=e[12],d}function Eo(t){return s.jsxs(ni,{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 cs({onNavigate:t}={}){const{data:e}=te.useSession(),n=e?.user?.id,{org:o}=X(),i=Tt({connectionId:Ot,orgId:o.id,orgSlug:o.slug}),r=_e(o.id).id,l=Dt(),{threads:a,hasMore:m,isFetchingMore:c,fetchNextPage:d}=Je(),u=a.filter(T=>!T.hidden),{hide:f,setScope:h}=Gt(),x=ne(),{setTaskId:g,createNewTask:p}=Ze(),b=Ve({strict:!1}),j=we({strict:!1}),v=b.taskId??null,y=j.virtualmcpid??a.find(T=>T.id===v)?.virtual_mcp_id??null,S=()=>{t?.()},C=[...u].sort((T,q)=>(q.updated_at??"").localeCompare(T.updated_at??"")),[_,N]=M.useState("all"),[w,A]=M.useState("flat"),[z,k]=Ce("sidebar-threads-scope-all",!1),[$,D]=M.useState(!1),[R,B]=M.useState(!1),L={type:_,member:"mine",currentUserId:n??null},P={};z||(P.created_by="me"),h(P);const E=T=>n?T.filter(q=>q.created_by===n):[],F=T=>_==="automation"?T.filter(q=>!!q.trigger_id):_==="manual"?T.filter(q=>!q.trigger_id):T,U=E(C),G=F(U),W=F(C),Y=z?W:G,V=T=>{if(n&&T.created_by&&T.created_by!==n)return;const q=T.id===v;if(f(T.id),En(T.id),!q)return;const ie=Mo(Y,T.id,n);S(),ie?g(ie.id,ie.virtual_mcp_id):x({to:"/$org",params:{org:o.slug}})},Me=T=>{S(),g(T.id,T.virtual_mcp_id)},ms=async T=>{try{const q=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((q.structuredContent??q).items?.length??0)===0}catch{return!1}},tt=async()=>{const T=y??r;Z("sidebar_new_thread_clicked",{virtual_mcp_id:T});const q=U.find(ie=>ie.virtual_mcp_id===T&&ie.title==="New chat");if(q&&await ms(q.id)){S(),g(q.id,T);return}S(),p(T)},{state:us,isMobile:st,toggleSidebar:fs}=re();if(us==="collapsed"&&!st){const T=_e(o.id),q=new Map((l??[]).map(Q=>[Q.id,Q])),ie=Q=>(Q?q.get(Q):void 0)??(Q===r?T:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(ns,{orgParam:o.slug,side:"right",align:"start",trigger:s.jsx(K,{tooltip:o.name,children:s.jsx($e,{org:o,size:"sm"})})})}),s.jsxs(ee,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(H,{children:s.jsx(K,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fs,children:s.jsx(Et,{size:16})})}),s.jsx(H,{children:s.jsx(K,{"aria-label":"New chat",tooltip:"New chat",onClick:()=>{tt()},children:s.jsx(ot,{size:16})})}),Y.map(Q=>{const it=ie(Q.virtual_mcp_id);return s.jsx(H,{children:s.jsx(K,{"aria-label":Q.title||"New chat",tooltip:Q.title||"New chat",isActive:Q.id===v,onClick:()=>Me(Q),children:s.jsx(de,{icon:it?.icon??null,name:it?.title??"Agent",size:"xs"})})},Q.id)})]})]})}const ve=w!=="flat"||_!=="all"||z===!0,hs=s.jsxs(Ie,{children:[s.jsxs(ce,{children:[s.jsx(le,{asChild:!0,children:s.jsx(fe,{asChild:!0,children:s.jsxs(me,{"aria-label":"Filter chats",active:ve,className:"md:size-[34px] rounded-lg",children:[s.jsx(si,{size:16}),ve&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(ae,{side:"bottom",children:"Filter chats"})]}),s.jsxs(ke,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Re,{label:"View",value:w,onChange:T=>{Z("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(cn,{size:13})},{value:"status",label:"Status",icon:s.jsx(dn,{size:13})}]}),s.jsx(Re,{label:"Type",value:_,onChange:T=>{Z("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Re,{label:"Scope",value:z?"team":"mine",onChange:T=>k(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),nt=T=>s.jsx(Pt,{delayDuration:300,children:s.jsxs("div",{className:O("shrink-0 flex items-center justify-between",T?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Xt,{className:"md:size-[34px] rounded-lg"}),hs]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Nt,{label:"Search chats",onClick:()=>{Z("tasks_panel_search_opened"),B(!0),D(!0)},children:s.jsx(an,{size:16})}),s.jsx(Nt,{label:"New chat",onClick:()=>{tt()},children:s.jsx(ot,{size:16})})]})]})});return st?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[nt(!0),s.jsx(pt,{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(_t,{threads:Y,groupBy:w,activeTaskId:v,onSelectTask:Me,onArchiveTask:V,filters:L,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:ve})}),R&&s.jsx(gt,{open:$,onOpenChange:D})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[nt(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(pt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(_t,{threads:Y,groupBy:w,activeTaskId:v,onSelectTask:Me,onArchiveTask:V,filters:L,hasMore:m,isFetchingMore:c,onLoadMore:()=>{d()},filtersActive:ve})})}),R&&s.jsx(gt,{open:$,onOpenChange:D})]})}const Po=5,Do=[{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 ds(){const t=I.c(3),{state:e}=re();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Po}).map(Lo)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(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:Do.map(Fo)})]}),t[2]=o):o=t[2],o}function Fo(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:O("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(Ro)})]},e)}function Ro(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 Lo(t,e){return s.jsx(se,{className:"size-10 rounded-lg mx-auto"},e)}function Ho(){const t=I.c(2);if(ze()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ue,{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(Ue,{}),s.jsx(Te,{})]}),t[1]=n):n=t[1],n}function Bo(){const t=I.c(5),e=Qt();let n,o;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(uo,{}),o=s.jsx(Ho,{}),t[0]=n,t[1]=o):(n=t[0],o=t[1]);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(We,{children:s.jsx(M.Suspense,{fallback:s.jsx(ds,{}),children:s.jsx(cs,{})})}),t[2]=i):i=t[2];let r;return t[3]!==e?(r=s.jsx(Wt,{children:s.jsx(es,{sections:e,footer:n,header:o,additionalContent:i})}),t[3]=e,t[4]=r):r=t[4],r}function Uo(t){const e=I.c(8),{onClose:n}=t,o=Qt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(fo,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ds,{}),e[1]=r):r=e[1];let l;e[2]!==n?(l=s.jsx(We,{children:s.jsx(M.Suspense,{fallback:r,children:s.jsx(cs,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==o||e[6]!==l?(a=s.jsx(Wt,{children:s.jsx(eo,{sections:o,onClose:n,footer:i,additionalContent:l})}),e[4]=n,e[5]=o,e[6]=l,e[7]=a):a=e[7],a}const Go="sidebar.open";function Wo(){const t=I.c(1),{state:e}=re(),n=ze();if(e!=="collapsed"||n)return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Te,{}),t[0]=o):o=t[0],o}function Vo(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Os,{}),t[0]=e):e=t[0],e}function ua(){const t=I.c(43),e=Ye(),n=ze();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const{connect:i,siteUrl:r}=we(o),l=i==="1",[a,m]=Ce(Go,!1),{width:c,wrapperRef:d,onStartResize:u,resetWidth:f}=Ci(),h=!e;let x,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(J.LeftColumn,{children:[s.jsx(Wo,{}),s.jsx(J.TogglesSlot,{})]}),g=s.jsx(J.CenterSlot,{}),t[1]=x,t[2]=g):(x=t[1],g=t[2]);let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(J.Header,{children:[x,g,s.jsxs(J.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(J.TabsSlot,{})}),s.jsx(J.RightSlot,{})]})]}),t[3]=p):p=t[3];const b=p;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Xt,{}),t[4]=j):j=t[4];let v;t[5]!==n?(v=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(Te,{})}),t[5]=n,t[6]=v):v=t[6];let y,S,C,_,N;t[7]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(be,{}),C=s.jsx(J.TogglesSlot,{}),_=s.jsx(J.TabsSlot,{className:"shrink-0"}),N=s.jsx(J.CenterSlot,{}),y=s.jsx(J.RightSlot,{}),t[7]=y,t[8]=S,t[9]=C,t[10]=_,t[11]=N):(y=t[7],S=t[8],C=t[9],_=t[10],N=t[11]);let w;t[12]!==v?(w=s.jsx(J.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,v,S,C,_,N,y]})}),t[12]=v,t[13]=w):w=t[13];const A=w;let z;t[14]===Symbol.for("react.memo_cache_sentinel")?(z={background:"transparent",containerType:"inline-size"},t[14]=z):z=t[14];let k;t[15]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Ps,{className:"flex flex-col min-h-0",style:z,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(M.Suspense,{fallback:s.jsx(Vo,{}),children:s.jsx(Ts,{})})})})}),t[15]=k):k=t[15];const $=k,D=!h&&(e?A:b),R=`${c}px`;let B;t[16]!==R?(B={"--sidebar-width":R,"--sidebar-width-icon":"3.125rem"},t[16]=R,t[17]=B):B=t[17];const L=B;let P;t[18]!==e||t[19]!==u||t[20]!==f?(P=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Bo,{}),s.jsx(Si,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=P):P=t[21];let E;t[22]!==h?(E=h?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,$]}):$,t[22]=h,t[23]=E):E=t[23];let F;t[24]!==L||t[25]!==P||t[26]!==E||t[27]!==d?(F=s.jsxs(Ds,{ref:d,className:"flex-1 bg-sidebar relative min-h-0",style:L,children:[P,E]}),t[24]=L,t[25]=P,t[26]=E,t[27]=d,t[28]=F):F=t[28];let U;t[29]!==e?(U=e&&s.jsx(di,{renderSidebar:qo}),t[29]=e,t[30]=U):U=t[30];let G;t[31]!==r||t[32]!==l?(G=l&&s.jsx(gi,{siteUrl:r}),t[31]=r,t[32]=l,t[33]=G):G=t[33];let W;t[34]!==D||t[35]!==F||t[36]!==U||t[37]!==G?(W=s.jsx(An,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[D,F,U,G]})}),t[34]=D,t[35]=F,t[36]=U,t[37]=G,t[38]=W):W=t[38];let Y;return t[39]!==m||t[40]!==a||t[41]!==W?(Y=s.jsx(On,{children:s.jsx(J.Provider,{children:s.jsx(Fs,{open:a,onOpenChange:m,children:W})})}),t[39]=m,t[40]=a,t[41]=W,t[42]=Y):Y=t[42],Y}function qo(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(Uo,{onClose:e})})})}export{ua as default};