decocms 4.322.2 → 4.323.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 (252) hide show
  1. package/dist/client/assets/{AlertCircle-BdM4T3q4.js → AlertCircle-CbIethWO.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CBKDIRkx.js → AreaChart-BQf75cYf.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BB2YSrj7.js → ArrowLeft-y7fvMHg1.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DXR_g3Oy.js → ArrowUp-ClH9KzFx.js} +1 -1
  5. package/dist/client/assets/{Check-BJGjAkvt.js → Check-CViV2AKw.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DgTrlZto.js → CheckCircle-BceWKyuF.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CHp6MjLR.js → ChevronRight-Ub3Wi__5.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-Da9x7uGK.js → ChevronSelectorVertical-DYY47Opi.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DFgGozEE.js → ChevronUp-BZvKWnmE.js} +1 -1
  10. package/dist/client/assets/{Copy01-DDcupHo2.js → Copy01-CVNVXHfJ.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CsLC5KKl.js → CreditCard01-CMcaGH-G.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Dk2gGlzc.js → DotsVertical-CUO5Z4B7.js} +1 -1
  13. package/dist/client/assets/{Download01-DvOKymrY.js → Download01-C-8_yc1P.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-BI6nGi9H.js → ErrorBarContext-D5mNZU-_.js} +1 -1
  15. package/dist/client/assets/{Eye-R1eRKyhu.js → Eye-CRgiNYAI.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-BBspe_Vp.js → GitBranch01-Cw03iCHW.js} +1 -1
  17. package/dist/client/assets/{Globe01-V5XnEtkA.js → Globe01-BzEZgPZH.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DAYJSGLm.js → HardDrive-BShCW8xo.js} +1 -1
  19. package/dist/client/assets/{Image01-IiqdNeem.js → Image01-BDqKYCHs.js} +1 -1
  20. package/dist/client/assets/{Key01-DR_fsQ3N.js → Key01-BihM9W_4.js} +1 -1
  21. package/dist/client/assets/{Link01-Bf0vi3uA.js → Link01-Bj9F9FFy.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-5D43FTN7.js → LinkExternal01-B-j6voaz.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DDLQMt97.js → Monitor01-DJok5Oby.js} +1 -1
  24. package/dist/client/assets/{Package-CgY7o2Oy.js → Package-DyPeIzqD.js} +1 -1
  25. package/dist/client/assets/{Palette-C4zLuwLo.js → Palette-Di_3G4BB.js} +1 -1
  26. package/dist/client/assets/{Play-CzdOVHC_.js → Play-C-Ctr0Bg.js} +1 -1
  27. package/dist/client/assets/{Plus-D9-o85Y8.js → Plus-Dy3OwbdP.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CCAvAiQ4.js → SearchMd-GhWQt9H_.js} +1 -1
  29. package/dist/client/assets/{Sector-BzLBp_iA.js → Sector-B06pf8NJ.js} +1 -1
  30. package/dist/client/assets/{Settings02-DQ6FNBsz.js → Settings02-Xf5MNOeS.js} +1 -1
  31. package/dist/client/assets/{Share07-zz-abOvJ.js → Share07-CkZjV7Y4.js} +1 -1
  32. package/dist/client/assets/{Shield01-BJRCG3ZI.js → Shield01-AHWHm-DS.js} +1 -1
  33. package/dist/client/assets/{Stars01-CT8rep-q.js → Stars01-D65oRIoj.js} +1 -1
  34. package/dist/client/assets/{Sun-CZqZcuoO.js → Sun-vk_cPGMJ.js} +1 -1
  35. package/dist/client/assets/{Tool01-DM2pGQ6v.js → Tool01-C9Fh4pyK.js} +1 -1
  36. package/dist/client/assets/{Tool02-Dam9-7yl.js → Tool02-CZJjuIxA.js} +1 -1
  37. package/dist/client/assets/{Trash01-By4vj34E.js → Trash01-B-u_-iqS.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-BbsZIxmR.js → TrendUp01-D_qxLEW7.js} +1 -1
  39. package/dist/client/assets/{Upload01-B7yw_2WY.js → Upload01-CVk2PCsw.js} +1 -1
  40. package/dist/client/assets/{User01-ZmS0OLZp.js → User01-CAS_KrTr.js} +1 -1
  41. package/dist/client/assets/{UserSquare-FX00ULoq.js → UserSquare-BeyEkA5D.js} +1 -1
  42. package/dist/client/assets/{Users01-OgAilsyn.js → Users01-ub3QFuz_.js} +1 -1
  43. package/dist/client/assets/{Users03-B2Ia9ZKz.js → Users03-9eRhfMnl.js} +1 -1
  44. package/dist/client/assets/{XCircle-CoovHOYi.js → XCircle-Bd6dXhOj.js} +1 -1
  45. package/dist/client/assets/{XClose-D3uTH-Mn.js → XClose-auuJ_GRB.js} +1 -1
  46. package/dist/client/assets/{Zap-BOxAISnm.js → Zap-b3NblJtQ.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-2E5tImca.js → ZoomOut-BQIO6WB6.js} +1 -1
  48. package/dist/client/assets/{access-gate-BcA-iWkW.js → access-gate-YwNE0EiY.js} +1 -1
  49. package/dist/client/assets/{agent-icon-RU6MjYuo.js → agent-icon-_mOvC4lh.js} +1 -1
  50. package/dist/client/assets/{agents-list-9j0k7jbf.js → agents-list-BuzhpqLT.js} +1 -1
  51. package/dist/client/assets/{ai-providers-DsiwGC8l.js → ai-providers-tOnDEcsq.js} +1 -1
  52. package/dist/client/assets/{alert-DclC12S_.js → alert-Be1JSz0u.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BeZT9KXA.js → alert-dialog-FC7tFvol.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-DE9dPGhZ.js → analytics-tab-rcgtUzan.js} +1 -1
  55. package/dist/client/assets/{api-keys-BWefs2Th.js → api-keys-CTBEYMnC.js} +1 -1
  56. package/dist/client/assets/api-keys-JtWtYNuu.js +1 -0
  57. package/dist/client/assets/{app-editor-DDJ-GQvN.js → app-editor-DQYPxUQA.js} +1 -1
  58. package/dist/client/assets/{auth-CDhx2a9v.js → auth-D6hknNuL.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-DtDEvIAp.js → auth-catchall-B4fYfbHP.js} +1 -1
  60. package/dist/client/assets/{auth-entry-FzT7ADF9.js → auth-entry-C8j1nXjw.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-BMIKx1vW.js → auth-split-layout-CBxH-91G.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-dNQSv230.js → authenticate-and-persist-oauth-Ca9jI9n9.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-D0_h1jsr.js → automation-list-row-S_f1Oum9.js} +1 -1
  64. package/dist/client/assets/{automation-runs-DK9gGf1S.js → automation-runs-DTbShgpv.js} +1 -1
  65. package/dist/client/assets/{automations-_yk8g7V1.js → automations-B754zppB.js} +1 -1
  66. package/dist/client/assets/{avatar-C_trePYC.js → avatar-BAJ_UwLY.js} +1 -1
  67. package/dist/client/assets/{badge-xmxCuDz6.js → badge-3ZvX9jce.js} +1 -1
  68. package/dist/client/assets/{block-document-CxBXrToo.js → block-document-DLV7xODC.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-DoFt2ti7.js → breadcrumb-DHpQRSkO.js} +1 -1
  70. package/dist/client/assets/{buckets-DEMafnW1.js → buckets-kBZLIk_3.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-D7lS97vx.js → bulk-category-panel-CcZ-TeGm.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-CdbT_OS3.js → capability-load-error-o4hp9_9S.js} +1 -1
  73. package/dist/client/assets/{cards-DXWWOf4y.js → cards-YJY6OImM.js} +1 -1
  74. package/dist/client/assets/{category-editor-CiG41A_G.js → category-editor-BkGCdnTz.js} +1 -1
  75. package/dist/client/assets/{cdn-tab-Cej9_faF.js → cdn-tab-CD1vNcFc.js} +1 -1
  76. package/dist/client/assets/{chart-BFXjHsv2.js → chart-DuPWPZVO.js} +1 -1
  77. package/dist/client/assets/{chat-context-X9yDx1g4.js → chat-context-DoE_-ERG.js} +1 -1
  78. package/dist/client/assets/{checkbox-DHpVnXQF.js → checkbox-DM__T45b.js} +1 -1
  79. package/dist/client/assets/{choose-editor-Bv5NIfCE.js → choose-editor-Ceh05UP8.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BHurDJuQ.js → cli-auth-success-DRCsiyHM.js} +1 -1
  81. package/dist/client/assets/{client-icons-CuJcR9_t.js → client-icons-CP-8jMQ6.js} +1 -1
  82. package/dist/client/assets/{collection-detail-BT0nSZMR.js → collection-detail-CBcNSBGR.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-Cn5CPEeQ.js → collection-display-button-D7w8XJnR.js} +1 -1
  84. package/dist/client/assets/{collection-search-A173OqC9.js → collection-search-jeWHAmV1.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-DQH4XpNH.js → collection-table-wrapper-BEZHi3FT.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-BM5JVl4y.js → collection-tabs-BUx5Y6ne.js} +1 -1
  87. package/dist/client/assets/{command-BxTndh_x.js → command-DYMcXrYb.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-FVw2X5Uy.js → commerce-onboarding-CKV1VIHd.js} +1 -1
  89. package/dist/client/assets/{connect-Bq_JbM88.js → connect-DtGLP_di.js} +1 -1
  90. package/dist/client/assets/{connect-layout-uq8SiI3I.js → connect-layout-CpZLZAi6.js} +1 -1
  91. package/dist/client/assets/{connection-CdZ-bOjV.js → connection-Bpxwt4sD.js} +1 -1
  92. package/dist/client/assets/{connection-card-C7OwHWDn.js → connection-card-D0u9_kRo.js} +1 -1
  93. package/dist/client/assets/{connection-detail-Dxm-wtFw.js → connection-detail-DKyvL8ps.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-CYdb5KmR.js → connection-form-helpers-Blb0GPpJ.js} +1 -1
  95. package/dist/client/assets/{connections-DvDKq4gC.js → connections-CBNZEeRd.js} +1 -1
  96. package/dist/client/assets/{create-organization-dialog-C8PgPbxE.js → create-organization-dialog-HAvzqd5d.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool-cy7vRre7.js → decopilot-sse-pool-BT-eLzU1.js} +1 -1
  98. package/dist/client/assets/{dialog-ZVeNES6Y.js → dialog-_eOGpV_R.js} +1 -1
  99. package/dist/client/assets/{domain-settings-anAeQVrN.js → domain-settings-DeuY7PiW.js} +1 -1
  100. package/dist/client/assets/{drawer-DKqEBSsG.js → drawer-BH5TUdft.js} +1 -1
  101. package/dist/client/assets/{dropdown-menu-CNysK88m.js → dropdown-menu-DAkDKRcv.js} +1 -1
  102. package/dist/client/assets/{e2e-tab--LXJgLL9.js → e2e-tab-B47B8D6p.js} +1 -1
  103. package/dist/client/assets/{editor-qm9nQJWW.js → editor-Kqw7F1U3.js} +1 -1
  104. package/dist/client/assets/{empty-state-Bnpmn7z7.js → empty-state-B5IW3FY0.js} +1 -1
  105. package/dist/client/assets/{empty-state-HWkqG6y-.js → empty-state-DTiYxZyX.js} +1 -1
  106. package/dist/client/assets/{extract-connection-data-PPlXuj4-.js → extract-connection-data-B0tz2bg7.js} +1 -1
  107. package/dist/client/assets/{file-explorer-DWd-Q3K0.js → file-explorer-D6bSC078.js} +1 -1
  108. package/dist/client/assets/{file-type-icon-x2A4TA0T.js → file-type-icon-CqqlGtY8.js} +1 -1
  109. package/dist/client/assets/{folder-icon-C2P2rJRH.js → folder-icon-WWKk1P4a.js} +1 -1
  110. package/dist/client/assets/{form-CZTZut6T.js → form-DVlwcFzf.js} +1 -1
  111. package/dist/client/assets/{general-DxB_pvng.js → general-BLb79GyS.js} +1 -1
  112. package/dist/client/assets/{github-repo-picker-DzkavMQV.js → github-repo-picker-BvXosldt.js} +1 -1
  113. package/dist/client/assets/{hooks-B1ozPSur.js → hooks-C1zHirdm.js} +1 -1
  114. package/dist/client/assets/{hosting-tab-NISwa-jm.js → hosting-tab-WXFSVJlX.js} +1 -1
  115. package/dist/client/assets/{index-B5qs3kIA.js → index-B1NfLh28.js} +7 -7
  116. package/dist/client/assets/index-BF5Hkav7.js +5 -0
  117. package/dist/client/assets/{index-UxKUNJc7.js → index-BaLSCAcE.js} +1 -1
  118. package/dist/client/assets/{index-c0FWNVub.js → index-ByNRxI-W.js} +1 -1
  119. package/dist/client/assets/{index-O2zi1Oqi.js → index-C-AVMdC1.js} +1 -1
  120. package/dist/client/assets/{index-Dd3k4kvJ.js → index-DbYn9c50.js} +1 -1
  121. package/dist/client/assets/{index-DQGh1B2U.js → index-DqFuEMY3.js} +1 -1
  122. package/dist/client/assets/{index-B6sByWv7.js → index-Ds3rGGA1.js} +6 -6
  123. package/dist/client/assets/{index-redirect-BDZq9Bm0.js → index-redirect-CL2ti6mP.js} +1 -1
  124. package/dist/client/assets/{index-QYpWN0fW.js → index-tE-Tf4Hw.js} +1 -1
  125. package/dist/client/assets/{index-Dg4k0KJy.js → index-vvsCvtEs.js} +1 -1
  126. package/dist/client/assets/{infra-billing-Bxd1BRHX.js → infra-billing-Bqv_tVB5.js} +1 -1
  127. package/dist/client/assets/{input-CBrhJBCe.js → input-6kxANu4D.js} +1 -1
  128. package/dist/client/assets/{integration-icon-Toawfu3g.js → integration-icon-Dw9EWqM9.js} +1 -1
  129. package/dist/client/assets/{invite-member-dialog-Cbo3EoYk.js → invite-member-dialog-CtpRiSXv.js} +1 -1
  130. package/dist/client/assets/{label-BruZmOj-.js → label-W4OZ7SIR.js} +1 -1
  131. package/dist/client/assets/{layout-DUe8o_1s.js → layout-BLJ2rW8z.js} +1 -1
  132. package/dist/client/assets/{login-1H4TDrv3.js → login-xMe8uq97.js} +1 -1
  133. package/dist/client/assets/{markdown-CtesyoMy.js → markdown-nQrYOrJu.js} +1 -1
  134. package/dist/client/assets/{mcp-oauth-ChFHNRUT.js → mcp-oauth-CH8aXrUS.js} +1 -1
  135. package/dist/client/assets/{members-B5wuE5jp.js → members-os2LlbCD.js} +1 -1
  136. package/dist/client/assets/{monaco-editor-KRO47ntI.js → monaco-editor-D-OtVr_n.js} +1 -1
  137. package/dist/client/assets/{monitoring-stats-row-BuWssBjZ.js → monitoring-stats-row-CisDt-Oh.js} +1 -1
  138. package/dist/client/assets/{multi-select-Bmn2K279.js → multi-select-CCFiS0YC.js} +1 -1
  139. package/dist/client/assets/{oauth-callback-D-FswPqB.js → oauth-callback-BwNVh8Ay.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-DoFRxmuI.js → oauth-callback-ai-provider-SsrtddQ7.js} +1 -1
  141. package/dist/client/assets/{onboarding-AuXLu4SZ.js → onboarding-1pFeUwfe.js} +1 -1
  142. package/dist/client/assets/org-layout-ByaNaRAg.js +1 -0
  143. package/dist/client/assets/{organization-choice-DmSP3wHN.js → organization-choice-CKdaBKmF.js} +1 -1
  144. package/dist/client/assets/{orgs-CzG7nmGC.js → orgs-Cm-yPANa.js} +1 -1
  145. package/dist/client/assets/{page-seo-form-DB0vGLb8.js → page-seo-form-CVhe-B9N.js} +1 -1
  146. package/dist/client/assets/{popover-Dtmo4a9i.js → popover-CiSRUL8W.js} +1 -1
  147. package/dist/client/assets/{post-calendar-HP69Onnc.js → post-calendar-BlOmmMBz.js} +1 -1
  148. package/dist/client/assets/{post-editor-zK6bMM7V.js → post-editor-DDFHZpuO.js} +1 -1
  149. package/dist/client/assets/{primitives-BUTbHvg9.js → primitives-BnQfJsjI.js} +1 -1
  150. package/dist/client/assets/{profile-MlTKkAB2.js → profile-BuGbWdFA.js} +1 -1
  151. package/dist/client/assets/{project-app-view-Bs9Xs-vH.js → project-app-view-Cw_plhk8.js} +1 -1
  152. package/dist/client/assets/{prompts-o2vocrsg.js → prompts-C3gNSt_0.js} +1 -1
  153. package/dist/client/assets/record-editor-DtUJGWvr.js +1 -0
  154. package/dist/client/assets/redirect-editor-D0vXfu9N.js +1 -0
  155. package/dist/client/assets/registry-QzkuDmLd.js +2 -0
  156. package/dist/client/assets/{registry-layout-CFgbh5Bs.js → registry-layout-ChN51H5w.js} +1 -1
  157. package/dist/client/assets/{reports-xA2seRNN.js → reports-CYciSEvO.js} +1 -1
  158. package/dist/client/assets/{require-capability-4qAlBGtY.js → require-capability-Bzaxi0tw.js} +1 -1
  159. package/dist/client/assets/{required-auth-layout-BDVHvS6l.js → required-auth-layout-B5RfO5xE.js} +1 -1
  160. package/dist/client/assets/{reset-password-DNNtdZ2j.js → reset-password-c2RD-cMF.js} +1 -1
  161. package/dist/client/assets/{review-settings-BijkQ1jm.js → review-settings-CVRC6VQz.js} +1 -1
  162. package/dist/client/assets/roles-CKg_erdA.js +1 -0
  163. package/dist/client/assets/{schema-BBadp0i1.js → schema-BMBwySNw.js} +1 -1
  164. package/dist/client/assets/{scroll-area-BZ5Qyrr3.js → scroll-area-D1O9Z5bn.js} +1 -1
  165. package/dist/client/assets/{search-input-CQmUWmgl.js → search-input-HJiyo5_T.js} +1 -1
  166. package/dist/client/assets/{secrets-DjI1BiGF.js → secrets-yGNqTUjE.js} +1 -1
  167. package/dist/client/assets/{sections-editor-C5_pzWj6.js → sections-editor-nXz1E_RK.js} +1 -1
  168. package/dist/client/assets/{select-DRlA17pU.js → select-KntX1BWy.js} +1 -1
  169. package/dist/client/assets/{select-model-LklToqN0.js → select-model-D4UnKm_D.js} +1 -1
  170. package/dist/client/assets/{self-tool-result-CG7SIkHG.js → self-tool-result-Bw-jg1H9.js} +1 -1
  171. package/dist/client/assets/{seo-editor-eKy-K1LH.js → seo-editor-BMV5Py3q.js} +1 -1
  172. package/dist/client/assets/settings-layout-BxW8PXZR.js +1 -0
  173. package/dist/client/assets/{settings-sidebar-DKOy0LGW.js → settings-sidebar-C_XqwVow.js} +1 -1
  174. package/dist/client/assets/{shell-controls-CnLmt5Cj.js → shell-controls-y2P0ze9V.js} +1 -1
  175. package/dist/client/assets/{shell-layout-Cvf8Eoe7.js → shell-layout-CYnXtCwc.js} +1 -1
  176. package/dist/client/assets/{skill-preview-C9i4y1Q7.js → skill-preview-DDtUylxS.js} +1 -1
  177. package/dist/client/assets/{skills-BkepWnYL.js → skills-C02q4DQE.js} +1 -1
  178. package/dist/client/assets/{sso-DnEwQUmd.js → sso-E35RJK0S.js} +1 -1
  179. package/dist/client/assets/{store-BdufbVvU.js → store-DtCD5trg.js} +1 -1
  180. package/dist/client/assets/store-registry-CMA16J1j.js +2 -0
  181. package/dist/client/assets/{switch-BtlVCVTj.js → switch-RffCohYW.js} +1 -1
  182. package/dist/client/assets/{synced-repos-BOIxXDwi.js → synced-repos-D746RY0r.js} +1 -1
  183. package/dist/client/assets/{table-C-bH2e50.js → table-DHae8Nm6.js} +1 -1
  184. package/dist/client/assets/{tabs-DZGF5am8.js → tabs-Bw-iT1Tk.js} +1 -1
  185. package/dist/client/assets/{task-board-DjY-MoL5.js → task-board-Cpu4KbdQ.js} +1 -1
  186. package/dist/client/assets/{task-route-Hg0072mG.js → task-route-BF9yN3PC.js} +1 -1
  187. package/dist/client/assets/tasks-O7NdYknu.js +1 -0
  188. package/dist/client/assets/{textarea-BuV0Q4Wn.js → textarea-D69PAPp0.js} +1 -1
  189. package/dist/client/assets/{thread-intent-BmK3id7c.js → thread-intent-B9RGGbT7.js} +1 -1
  190. package/dist/client/assets/{thread-route-DTEQuzTB.js → thread-route-DghMzEvi.js} +1 -1
  191. package/dist/client/assets/{toggle-group-BSU6drSx.js → toggle-group-D2J6TMAE.js} +1 -1
  192. package/dist/client/assets/{toolbar-l37D9w2L.js → toolbar-CQKJCOWO.js} +1 -1
  193. package/dist/client/assets/{toolbar-icon-button-vCbnU1BH.js → toolbar-icon-button-D5UWifRH.js} +1 -1
  194. package/dist/client/assets/{track-CFiNnqLI.js → track-CPuXhWGG.js} +1 -1
  195. package/dist/client/assets/{types-uTLk2Oif.js → types-D9TUiUC5.js} +1 -1
  196. package/dist/client/assets/{use-ai-providers-D2gdHqRM.js → use-ai-providers-BDymGfsX.js} +1 -1
  197. package/dist/client/assets/{use-automations-DwriaZ_Y.js → use-automations-D-er4402.js} +1 -1
  198. package/dist/client/assets/{use-autosave-ChGoJB1H.js → use-autosave-BYuOuBAD.js} +1 -1
  199. package/dist/client/assets/{use-connection-Bcqmd-0E.js → use-connection-DjqJprQ0.js} +1 -1
  200. package/dist/client/assets/{use-copy-DfWIv5Q0.js → use-copy-Cc5MlhjA.js} +1 -1
  201. package/dist/client/assets/{use-create-virtual-mcp-Bu8ybBAx.js → use-create-virtual-mcp-BpDoBwW0.js} +1 -1
  202. package/dist/client/assets/{use-debounced-autosave-BLFyOoIV.js → use-debounced-autosave-ZIgtFc1M.js} +1 -1
  203. package/dist/client/assets/{use-debounced-value-BL0b9aeb.js → use-debounced-value-BSLeeOpX.js} +1 -1
  204. package/dist/client/assets/{use-decopilot-events-CmPJ_T7T.js → use-decopilot-events-DJzsWHaW.js} +1 -1
  205. package/dist/client/assets/{use-delete-connection-Bv6qQJUF.js → use-delete-connection-ChV1b6nT.js} +1 -1
  206. package/dist/client/assets/{use-deployment-admin-DqUW-FiZ.js → use-deployment-admin-De_oldAV.js} +1 -1
  207. package/dist/client/assets/{use-destination-route-F2w4a22p.js → use-destination-route-CG9NdNN9.js} +1 -1
  208. package/dist/client/assets/{use-file-configs-JKMDnd3t.js → use-file-configs-DXL12ksv.js} +1 -1
  209. package/dist/client/assets/{use-infinite-scroll-BJi77uUl.js → use-infinite-scroll-D5DcjHPJ.js} +1 -1
  210. package/dist/client/assets/{use-join-requests-B_gkX1wR.js → use-join-requests-BwgxmP4k.js} +1 -1
  211. package/dist/client/assets/{use-mcp-auth-status-BpMUYkUL.js → use-mcp-auth-status-BmzTeush.js} +1 -1
  212. package/dist/client/assets/{use-mcp-client-DBWSfFW4.js → use-mcp-client-BsCYwuYG.js} +1 -1
  213. package/dist/client/assets/{use-mcp-prompts-CQk2PJOu.js → use-mcp-prompts-r_b-m13M.js} +1 -1
  214. package/dist/client/assets/{use-mcp-tools-C9BbSSY5.js → use-mcp-tools-DFUdHDOx.js} +1 -1
  215. package/dist/client/assets/{use-members-DMiuR5EJ.js → use-members-uyLHU2hg.js} +1 -1
  216. package/dist/client/assets/{use-navigate-to-agent-OVEm8SGC.js → use-navigate-to-agent-IY8mCF-a.js} +1 -1
  217. package/dist/client/assets/{use-org-auth-client-pdf6su9B.js → use-org-auth-client-CRXTM1Db.js} +1 -1
  218. package/dist/client/assets/{use-org-sso-DeQYTHJu.js → use-org-sso-D2ngO8eF.js} +1 -1
  219. package/dist/client/assets/{use-organization-roles-BX-WHfZP.js → use-organization-roles-E5m8U-S7.js} +1 -1
  220. package/dist/client/assets/{use-organization-settings-BbuUyMwK.js → use-organization-settings-CVRBbGpW.js} +1 -1
  221. package/dist/client/assets/{use-panel-navigate-BeN2FB5r.js → use-panel-navigate-Cbxz5kt0.js} +1 -1
  222. package/dist/client/assets/{use-project-scope-C9SLEVZG.js → use-project-scope-BPel4oYu.js} +1 -1
  223. package/dist/client/assets/{use-registry-connections-w1qpzPqp.js → use-registry-connections-DDAHT7mn.js} +1 -1
  224. package/dist/client/assets/{use-secrets-CfStaXMf.js → use-secrets-CxYf3QgY.js} +1 -1
  225. package/dist/client/assets/{use-section-preview-base-w9jGzZf3.js → use-section-preview-base-nwXYuQik.js} +1 -1
  226. package/dist/client/assets/{use-status-sounds-B4fgiFff.js → use-status-sounds-BsArCG5q.js} +1 -1
  227. package/dist/client/assets/{use-tags-DMg6alLK.js → use-tags-7szl89Un.js} +1 -1
  228. package/dist/client/assets/{use-view-mode-BYghl9YG.js → use-view-mode-BCpG25HS.js} +1 -1
  229. package/dist/client/assets/{use-virtual-mcp-afg1XeYZ.js → use-virtual-mcp-GrNV8gSX.js} +1 -1
  230. package/dist/client/assets/useInfiniteQuery-Ba_5G2Dq.js +1 -0
  231. package/dist/client/assets/useSuspenseInfiniteQuery-Day-b8LH.js +1 -0
  232. package/dist/client/assets/{users-BuXRKaMd.js → users-t7wRTjGx.js} +1 -1
  233. package/dist/client/assets/{variant-calendar-1GL7Yn2Y.js → variant-calendar-De-JgJ0u.js} +1 -1
  234. package/dist/client/assets/{view-mode-toggle-B4tbXNCc.js → view-mode-toggle-BUL9QJav.js} +1 -1
  235. package/dist/client/index.html +1 -1
  236. package/dist/server/cli.js +680 -623
  237. package/dist/server/migrate-dbos.js +2 -2
  238. package/dist/server/migrate.js +193 -172
  239. package/dist/server/server.js +437 -401
  240. package/package.json +1 -1
  241. package/dist/client/assets/api-keys--fpnrdj1.js +0 -1
  242. package/dist/client/assets/index-b3hcIvy1.js +0 -5
  243. package/dist/client/assets/org-layout-Crz5uS5X.js +0 -1
  244. package/dist/client/assets/record-editor-Co1jLxU2.js +0 -1
  245. package/dist/client/assets/redirect-editor-BHyQuv7O.js +0 -1
  246. package/dist/client/assets/registry-CPar81QY.js +0 -2
  247. package/dist/client/assets/roles-DV_Xk-ZG.js +0 -1
  248. package/dist/client/assets/settings-layout-Cp_WaX5t.js +0 -1
  249. package/dist/client/assets/store-registry-D27Ew_-v.js +0 -2
  250. package/dist/client/assets/tasks-BMYVA5sP.js +0 -1
  251. package/dist/client/assets/useInfiniteQuery-BlUSgUeu.js +0 -1
  252. package/dist/client/assets/useSuspenseInfiniteQuery-BRHzp2YA.js +0 -1
@@ -1 +1 @@
1
- import{bW as ws,c as R,l as X,j as s,h as He,r as z,I as Gt,G as As,o as Z,b as Q,b6 as Is,W as ge,d as qt,a6 as Qt,_ as Wt,L as Ts,a1 as $e,a2 as Oe,a4 as Re,a as Ct,F as Bs,ar as Fs,as as Ps,B as be,t as oe,H as Es,J as Ms,K as ye,n as vt,a7 as kt,m as Yt,e as Le,bm as Ls,ap as $s}from"./index-B5qs3kIA.js";import{c as Xt,u as Os,d as Jt}from"./thread-route-DTEQuzTB.js";import{t as Ve}from"./ChevronUp-DFgGozEE.js";import{A as Zt,N as Rs,s as dt,aJ as Ks,aK as zs,aL as Ft,aM as Vs,t as Us,aN as Hs,a6 as Gs,aO as qs,o as Qs,aP as Ws,a4 as ut,a3 as Ys,aa as Xs}from"./agent-icon-RU6MjYuo.js";import{a as es,i as Js,e as Zs,S as en,f as tn}from"./constants-DNuUCxmW.js";import{b as Nt,u as sn}from"./use-virtual-mcp-afg1XeYZ.js";import{g as nn}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-vCbnU1BH.js";import{P as nt,a as ze,b as ot}from"./popover-Dtmo4a9i.js";import{D as _t,a as St,b as Dt,c as on,e as an,f as ss,g as ns,d as ln}from"./drawer-DKqEBSsG.js";import{i as rn}from"./SearchMd-CCAvAiQ4.js";import{i as Ge}from"./Check-BJGjAkvt.js";import{s as Qe}from"./Plus-D9-o85Y8.js";import{G as ht,a as cn}from"./github-repo-picker-DzkavMQV.js";import{g as dn,u as un,b as os}from"./hooks-B1ozPSur.js";import{g as fn,b as as}from"./use-project-scope-C9SLEVZG.js";import{u as ls}from"./shell-layout-Cvf8Eoe7.js";import{a as mn}from"./use-navigate-to-agent-OVEm8SGC.js";import{d as gn}from"./thread-intent-BmK3id7c.js";import{C as pn}from"./collection-search-A173OqC9.js";import{g as hn,b as xn,a as jn,e as bn}from"./extract-connection-data-PPlXuj4-.js";import{u as is,a as rs,g as yn,C as ft}from"./connection-card-C7OwHWDn.js";import{D as cs,b as ds,c as us,d as fs,h as Cn,e as vn}from"./dialog-ZVeNES6Y.js";import{d as ce,a as de,e as ue,b as fe,c as me,F as Pt}from"./form-CZTZut6T.js";import{I as _e}from"./input-CBrhJBCe.js";import{S as kn,a as Nn,b as _n,c as Sn,d as Ue}from"./select-DRlA17pU.js";import{T as Dn}from"./textarea-BuV0Q4Wn.js";import{b as ms}from"./use-connection-Bcqmd-0E.js";import{n as et,a as mt,i as gs}from"./Tool02-Dam9-7yl.js";import{b as wn,d as An}from"./UserSquare-FX00ULoq.js";import{s as In}from"./XClose-D3uTH-Mn.js";import{c as Tn,i as Xe,a as Et,E as Bn,p as Fn,b as Pn,d as En}from"./connection-form-helpers-CYdb5KmR.js";import{a as gt}from"./authenticate-and-persist-oauth-dNQSv230.js";import{g as Mn}from"./connection-slug-CITJ0kGN.js";import{C as Ln}from"./collection-tabs-BM5JVl4y.js";import{u as Mt}from"./use-infinite-scroll-BJi77uUl.js";import{B as Je}from"./badge-xmxCuDz6.js";import{u as $n}from"./useSuspenseInfiniteQuery-BRHzp2YA.js";import{u as On}from"./use-mcp-client-DBWSfFW4.js";import{g as tt}from"./metadata-dUsYcpuu.js";import{u as Rn}from"./use-ai-providers-D2gdHqRM.js";import{T as Kn,C as wt,c as zn,d as Vn,S as xt}from"./task-board-DjY-MoL5.js";import{t as Un}from"./decopilot-sse-pool-cy7vRre7.js";import{u as Hn}from"./use-decopilot-events-CmPJ_T7T.js";import{A as Lt}from"./avatar-C_trePYC.js";import{h as st,D as ps,b as hs,g as xs,c as js}from"./dropdown-menu-CNysK88m.js";import{a as At,c as It,d as ve,e as qe,b as Tt,C as Bt}from"./command-BxTndh_x.js";import{s as Gn}from"./TrendUp01-BbsZIxmR.js";import{a as qn}from"./Settings02-DQ6FNBsz.js";import{s as $t}from"./User01-ZmS0OLZp.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{i as Qn}from"./AlertCircle-BdM4T3q4.js";import{i as Wn}from"./CheckCircle-DgTrlZto.js";import{a as bs}from"./DotsVertical-Dk2gGlzc.js";import{s as Yn}from"./Eye-R1eRKyhu.js";import{i as Xn}from"./Shield01-BJRCG3ZI.js";const Jn=ws("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function Zn(t){const e=R.c(21),{value:n,onChange:a,placeholder:i,onKeyDown:l,className:o,isSearching:d,disabled:c}=t,u=i===void 0?"Search...":i;let f;e[0]!==o?(f=X("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=f):f=e[1];const p=c?"cursor-not-allowed opacity-50":"cursor-text";let r;e[2]!==p?(r=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=r):r=e[3];let m;e[4]!==d?(m=d?s.jsx(He,{className:"size-4 text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=m):m=e[5];let g;e[6]!==a?(g=S=>a(S.target.value),e[6]=a,e[7]=g):g=e[7];let h;e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==g||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:l,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=l,e[10]=u,e[11]=g,e[12]=n,e[13]=h):h=e[13];let x;e[14]!==r||e[15]!==m||e[16]!==h?(x=s.jsxs("label",{className:r,children:[m,h]}),e[14]=r,e[15]=m,e[16]=h,e[17]=x):x=e[17];let b;return e[18]!==f||e[19]!==x?(b=s.jsx("div",{className:f,children:x}),e[18]=f,e[19]=x,e[20]=b):b=e[20],b}function eo(t,e,n){if(!n)return null;const a=dn(t,e);return a?a.threads.get().find(l=>l.id===n)?.branch??null:null}const ys=z.createContext(null);function ml(t){const e=R.c(5),{children:n}=t,[a,i]=z.useState(!1);let l;e[0]!==a?(l={empty:a,setEmpty:i},e[0]=a,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=s.jsx(ys.Provider,{value:l,children:n}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function to(){return z.useContext(ys)?.empty??!1}function so(t){const e=R.c(6),{value:n,onChange:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==a||e[3]!==l||e[4]!==n?(o=s.jsx(Zn,{value:n,onChange:a,placeholder:l}),e[2]=a,e[3]=l,e[4]=n,e[5]=o):o=e[5],o}function no(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:n}),t[2]=n,t[3]=a):a=t[3],a}function oo(t){const e=R.c(10),{org:n,onClose:a}=t,i=Q();let l;e[0]!==n.slug?(l={org:n.slug},e[0]=n.slug,e[1]=l):l=e[1];let o;e[2]!==a?(o=()=>a(),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==i?(d=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==l||e[7]!==o||e[8]!==d?(c=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ts,{to:"/$org/settings/agents",params:l,onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:d})}),e[6]=l,e[7]=o,e[8]=d,e[9]=c):c=e[9],c}function ao(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Cs,{children:n}),t[2]=n,t[3]=a):a=t[3],a}function lo(t){const e=R.c(11),{onImportFromGithub:n}=t,a=Q();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ht,{className:"size-3.5"}),e[0]=i):i=e[0];let l;e[1]!==a?(l=a("sidebar.agentsSection.import"),e[1]=a,e[2]=l):l=e[2];let o;e[3]!==n||e[4]!==l?(o=s.jsxs("button",{type:"button",onClick:n,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:[i,l]}),e[3]=n,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==a?(d=a("sidebar.agentsSection.codeAgents"),e[6]=a,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==d?(c=s.jsx(Cs,{action:o,children:d}),e[8]=o,e[9]=d,e[10]=c):c=e[10],c}function io(t){const e=R.c(11),{setOpen:n,emptyCtaClass:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X(a),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==n?(d=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[4]=n,e[5]=d):d=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{className:"size-4"}),e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==o||e[9]!==d?(u=s.jsx(ts,{"aria-label":l,className:o,onClick:d,children:c}),e[7]=l,e[8]=o,e[9]=d,e[10]=u):u=e[10],u}function ro(t){const e=R.c(17),{setOpen:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==n?(c=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[5]=n,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qe,{}),e[7]=u):u=e[7];let f;e[8]!==l?(f=l("sidebar.agentsSection.newAgent"),e[8]=l,e[9]=f):f=e[9];let p;e[10]!==f?(p=s.jsx("span",{children:f}),e[10]=f,e[11]=p):p=e[11];let r;return e[12]!==o||e[13]!==d||e[14]!==c||e[15]!==p?(r=s.jsx(Qt,{children:s.jsxs(Wt,{tooltip:o,className:d,onClick:c,children:[u,p]})}),e[12]=o,e[13]=d,e[14]=c,e[15]=p,e[16]=r):r=e[16],r}function co(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Dt,{className:"sr-only",children:n}),t[2]=n,t[3]=a):a=t[3],a}function uo(t){const e=R.c(8),{emptyCtaClass:n}=t,a=Q();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==n?(l=X(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qe,{className:"size-4"}),e[4]=o):o=e[4];let d;return e[5]!==i||e[6]!==l?(d=s.jsx(ts,{"aria-label":i,className:l,children:o}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function fo(t){const e=R.c(19),{wrapEmptyHint:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{}),e[5]=c):c=e[5];let u;e[6]!==l?(u=l("sidebar.agentsSection.newAgent"),e[6]=l,e[7]=u):u=e[7];let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==d||e[12]!==f?(p=s.jsx(ze,{asChild:!0,children:s.jsxs(Wt,{tooltip:o,className:d,children:[c,f]})}),e[10]=o,e[11]=d,e[12]=f,e[13]=p):p=e[13];let r;e[14]!==p||e[15]!==n?(r=n(p),e[14]=p,e[15]=n,e[16]=r):r=e[16];let m;return e[17]!==r?(m=s.jsx(Qt,{children:r}),e[17]=r,e[18]=m):m=e[18],m}function mo(t){const e=R.c(9),{children:n}=t,a=Q();let i;e[0]!==n?(i=s.jsx($e,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==a?(l=a("sidebar.agentsSection.selectAnExistingAgent"),e[2]=a,e[3]=l):l=e[3];let o;e[4]!==l?(o=s.jsx(Oe,{side:"right",sideOffset:8,children:l}),e[4]=l,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function go(t){const e=qt(),{create:n}=un(),{locator:a}=ge(),i=Xt(),l=Os();return async o=>{const d=crypto.randomUUID(),c=o===l?eo(t,a,i??""):null;try{await n({id:d,virtual_mcp_id:o,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:d},search:{virtualmcpid:o}})}}function pt(t){const e=R.c(20),{agent:n,selected:a,onClick:i}=t,l=a?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==l?(o=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==n.icon||e[3]!==n.title?(d=s.jsx(Zt,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=d):d=e[4];let c;e[5]!==n.title?(c=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.description?(u=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=u):u=e[8];let f;e[9]!==c||e[10]!==u?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[9]=c,e[10]=u,e[11]=f):f=e[11];let p;e[12]!==a?(p=a&&s.jsx(Ge,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=a,e[13]=p):p=e[13];let r;return e[14]!==i||e[15]!==o||e[16]!==d||e[17]!==f||e[18]!==p?(r=s.jsxs("button",{type:"button",onClick:i,className:o,children:[d,f,p]}),e[14]=i,e[15]=o,e[16]=d,e[17]=f,e[18]=p,e[19]=r):r=e[19],r}function Cs(t){const e=R.c(5),{children:n,action:a}=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 l;return e[2]!==a||e[3]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,a]}),e[2]=a,e[3]=i,e[4]=l):l=e[4],l}function po(t){const e=R.c(43),{onClose:n,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:l}=t,[o,d]=z.useState(""),c=z.useDeferredValue(o),u=c||void 0;let f;e[0]!==u?(f={searchTerm:u},e[0]=u,e[1]=f):f=e[1];const p=Nt(f),r=p??[],{org:m}=ge(),g=go(m.slug),h=fn(p),x=c.toLowerCase(),b=r.filter(bo).filter(V=>!h.has(V.id)).filter(jo),S=b.filter(xo),y=b.filter(ho),v=es(m.id),k=!c||v.title.toLowerCase().includes(x),C=!!(a&&k);let w;e[2]!==n||e[3]!==a?(w=()=>{a?.(null),n(),d("")},e[2]=n,e[3]=a,e[4]=w):w=e[4];const j=w;let _;e[5]!==g||e[6]!==n||e[7]!==a?(_=V=>{if(a){a(V.id),n(),d("");return}n(),d(""),g(V.id)},e[5]=g,e[6]=n,e[7]=a,e[8]=_):_=e[8];const D=_,I="flex flex-col max-h-[min(640px,80dvh)]";let E;e[9]!==o?(E=s.jsx(so,{value:o,onChange:d}),e[9]=o,e[10]=E):E=e[10];const N="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let A;e[11]!==v||e[12]!==a||e[13]!==j||e[14]!==i||e[15]!==k?(A=a&&k&&v&&s.jsx(pt,{agent:v,selected:!i||i===v.id,onClick:j}),e[11]=v,e[12]=a,e[13]=j,e[14]=i,e[15]=k,e[16]=A):A=e[16];const T=(S.length>0||!c)&&s.jsx(lo,{onImportFromGithub:l});let O;e[17]!==D||e[18]!==a||e[19]!==i?(O=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[17]=D,e[18]=a,e[19]=i,e[20]=O):O=e[20];const B=S.map(O),F=y.length>0&&s.jsx(ao,{});let $;e[21]!==D||e[22]!==a||e[23]!==i?($=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[21]=D,e[22]=a,e[23]=i,e[24]=$):$=e[24];const G=y.map($);let P;e[25]!==C||e[26]!==c||e[27]!==b.length?(P=b.length===0&&!C&&c&&s.jsx(no,{}),e[25]=C,e[26]=c,e[27]=b.length,e[28]=P):P=e[28];let K;e[29]!==B||e[30]!==F||e[31]!==G||e[32]!==P||e[33]!==A||e[34]!==T?(K=s.jsxs("div",{className:N,children:[A,T,B,F,G,P]}),e[29]=B,e[30]=F,e[31]=G,e[32]=P,e[33]=A,e[34]=T,e[35]=K):K=e[35];let L;e[36]!==n||e[37]!==m?(L=s.jsx(oo,{org:m,onClose:n}),e[36]=n,e[37]=m,e[38]=L):L=e[38];let U;return e[39]!==K||e[40]!==L||e[41]!==E?(U=s.jsxs("div",{className:I,children:[E,K,L]}),e[39]=K,e[40]=L,e[41]=E,e[42]=U):U=e[42],U}function ho(t){return!as(t.metadata)}function xo(t){return as(t.metadata)}function jo(t){return!Zs(t.id)}function bo(t){return!Js(t.id)}function yo(t){const e=R.c(14),{compact:n,trigger:a,onSelectAgent:i,selectedAgentId:l,side:o,align:d}=t===void 0?{}:t,c=n===void 0?!1:n,u=o===void 0?"right":o,f=d===void 0?"start":d,[p,r]=z.useState(!1),[m,g]=z.useState(!1),h=Gt(),{setOpenMobile:x}=As(),b=to(),S=b?"border border-border":void 0;let y;e[0]!==b?(y=N=>b?s.jsx(mo,{children:N}):N,e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==h||e[3]!==x?(k=()=>{r(!1),h&&x(!1)},e[2]=h,e[3]=x,e[4]=k):k=e[4];const C=k;let w;e[5]!==C||e[6]!==g?(w=()=>{C(),g(!0)},e[5]=C,e[6]=g,e[7]=w):w=e[7];const j=w,_=p&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Is,{className:"h-4 w-24"})}),children:s.jsx(po,{onClose:C,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:j})}),D=h?s.jsxs(s.Fragment,{children:[a?z.cloneElement(a,{onClick:N=>{a.props.onClick?.(N),r(!0)}}):c?v(s.jsx(io,{setOpen:r,emptyCtaClass:S})):s.jsx(ro,{setOpen:r,highlightEmpty:b,emptyCtaClass:S}),s.jsx(_t,{open:p,onOpenChange:r,direction:"bottom",children:s.jsxs(St,{className:"max-h-[85dvh] p-0",children:[s.jsx(co,{}),_]})})]}):s.jsxs(nt,{open:p,onOpenChange:N=>{N&&!p&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(N)},children:[a?s.jsx(ze,{asChild:!0,children:a}):c?v(s.jsx(ze,{asChild:!0,children:s.jsx(uo,{emptyCtaClass:S})})):s.jsx(fo,{wrapEmptyHint:v,highlightEmpty:b,emptyCtaClass:S}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:u,align:f,children:_})]});let I;e[8]!==m||e[9]!==g?(I=s.jsx(cn,{open:m,onOpenChange:g,mode:"agent"}),e[8]=m,e[9]=g,e[10]=I):I=e[10];let E;return e[11]!==D||e[12]!==I?(E=s.jsxs(s.Fragment,{children:[D,I]}),e[11]=D,e[12]=I,e[13]=E):E=e[13],E}function Co(){const t=R.c(2),e=Nt()??[];let n;return t[0]!==e?(n=a=>{if(!a)return;const i=e.find(l=>l.id===a);return i?gn(i.metadata):void 0},t[0]=e,t[1]=n):n=t[1],n}const vo="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 ko(t){const e=R.c(29),{agentId:n,fallback:a,onOpenHome:i,onPick:l}=t,o=Q(),d=sn(n)??a??null;let c,u,f,p,r;e[0]!==d?.title||e[1]!==i||e[2]!==o?(r=d?.title??o("header.shellBreadcrumb.superAgentDefaultName"),p="flex min-w-0 items-center gap-0",c="button",u=i,f=o("header.shellBreadcrumb.openAgentHome",{name:r}),e[0]=d?.title,e[1]=i,e[2]=o,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=r):(c=e[3],u=e[4],f=e[5],p=e[6],r=e[7]);const m=d?.icon??null;let g;e[8]!==m||e[9]!==r?(g=s.jsx(Zt,{icon:m,name:r,size:"xs"}),e[8]=m,e[9]=r,e[10]=g):g=e[10];let h;e[11]!==c||e[12]!==u||e[13]!==f||e[14]!==g?(h=s.jsx("button",{type:c,onClick:u,"aria-label":f,className:"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:g}),e[11]=c,e[12]=u,e[13]=f,e[14]=g,e[15]=h):h=e[15];let x;e[16]!==r?(x=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:r}),e[16]=r,e[17]=x):x=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ve,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=b):b=e[18];let S;e[19]!==x?(S=s.jsxs("button",{type:"button",className:vo,children:[x,b]}),e[19]=x,e[20]=S):S=e[20];let y;e[21]!==n||e[22]!==l||e[23]!==S?(y=s.jsx(yo,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:S}),e[21]=n,e[22]=l,e[23]=S,e[24]=y):y=e[24];let v;return e[25]!==y||e[26]!==p||e[27]!==h?(v=s.jsxs("div",{className:p,children:[h,y]}),e[25]=y,e[26]=p,e[27]=h,e[28]=v):v=e[28],v}function gl(t){const e=R.c(22);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:a}=n,{org:i}=ge(),{threads:l}=os(),o=Nt(),{data:d}=Ct.useSession(),{setTaskId:c,createNewTask:u}=ls(),f=Co();let p;e[2]!==i.id?(p=es(i.id),e[2]=i.id,e[3]=p):p=e[3];const r=p,m=r.id,g=Jt();let h;e[4]!==o||e[5]!==u||e[6]!==m||e[7]!==a||e[8]!==f||e[9]!==d?.user?.id||e[10]!==c||e[11]!==l?(h=k=>{const C=k??m,w=(o??[]).find(_=>_.id===C),j=mn(l,C,d?.user?.id,f(C),!!(w&&nn(w)));j?c(j.id,C):u(C),a?.()},e[4]=o,e[5]=u,e[6]=m,e[7]=a,e[8]=f,e[9]=d?.user?.id,e[10]=c,e[11]=l,e[12]=h):h=e[12];const x=h;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const S=g===m?r:void 0;let y;e[14]!==g||e[15]!==x?(y=()=>x(g),e[14]=g,e[15]=x,e[16]=y):y=e[16];let v;return e[17]!==g||e[18]!==x||e[19]!==S||e[20]!==y?(v=s.jsx(z.Suspense,{fallback:b,children:s.jsx(ko,{agentId:g,fallback:S,onOpenHome:y,onPick:x})}),e[17]=g,e[18]=x,e[19]=S,e[20]=y,e[21]=v):v=e[21],v}function pl(){const t=R.c(20),e=Q(),{threads:n}=os(),{createNewTask:a}=ls(),i=Jt(),l=Xt();let o;t[0]!==l||t[1]!==n?(o=n.find(x=>x.id===l)?.branch??null,t[0]=l,t[1]=n,t[2]=o):o=t[2];const d=o;let c;t[3]!==i||t[4]!==a||t[5]!==d?(c=()=>{a(i,d)},t[3]=i,t[4]=a,t[5]=d,t[6]=c):c=t[6];const u=c;let f;t[7]!==e?(f=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rs,{size:16}),t[9]=p):p=t[9];let r;t[10]!==u||t[11]!==f?(r=s.jsx($e,{asChild:!0,children:s.jsx("button",{type:"button",onClick:u,"aria-label":f,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p})}),t[10]=u,t[11]=f,t[12]=r):r=t[12];let m;t[13]!==e?(m=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=m):m=t[14];let g;t[15]!==m?(g=s.jsx(Oe,{side:"bottom",children:m}),t[15]=m,t[16]=g):g=t[16];let h;return t[17]!==r||t[18]!==g?(h=s.jsxs(Re,{children:[r,g]}),t[17]=r,t[18]=g,t[19]=h):h=t[19],h}function No({open:t,onOpenChange:e,onCreated:n}){const a=Q(),{org:i}=ge(),{data:l}=Ct.useSession(),{stdioEnabled:o}=Bs(),d=Gt(),c=ms(),u=is(),p=rs(u,"").items,r=Fs({resolver:Ps(Tn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),g=r.watch("connection_url"),h=r.watch("npx_package"),x=Xe({uiType:m,connectionUrl:g??"",npxPackage:h??""})??Et({uiType:m,connectionUrl:g??"",registryItems:p}),b=j=>{const _=j.trim();if(!_)return;const D=!!r.formState.dirtyFields.title,I=!!r.formState.dirtyFields.description,E=!!r.formState.dirtyFields.env_vars,N=T=>{if(T&&(!D&&!r.getValues("title").trim()&&T.title&&r.setValue("title",T.title,{shouldDirty:!1}),!I&&!(r.getValues("description")??"").trim()&&T.description&&r.setValue("description",T.description,{shouldDirty:!1}),!E&&T.envVarKeys?.length)){const O=r.getValues("env_vars")??[],B=new Set(O.map($=>$.key)),F=T.envVarKeys.filter($=>!B.has($));F.length>0&&r.setValue("env_vars",[...O,...F.map($=>({key:$,value:""}))],{shouldDirty:!0})}},A=Fn(_);if(A&&o){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",A.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),N(Xe({uiType:"NPX",npxPackage:A.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const T=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",_,{shouldDirty:!0}),N(Xe({uiType:T,connectionUrl:_})??Et({uiType:T,connectionUrl:_,registryItems:p}));return}m==="NPX"&&N(Xe({uiType:"NPX",npxPackage:_}))},S=j=>{j||r.reset(),e(j)},y=async j=>{let _,D=null,I=null,E=null;j.ui_type==="NPX"?(_="STDIO",D="",E=Pn(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(_="STDIO",D="",E=En(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(_=j.ui_type,D=j.connection_url||"",I=j.connection_token||null);const N=hn("conn");try{await c.create.mutateAsync({id:N,title:j.title,description:j.description||null,connection_type:_,connection_url:D,connection_token:I,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:i.id,icon:j.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),n?.(N)}catch{oe.error(a("connections.createConnectionDialog.failedToCreateConnection"))}},v=a("connections.createConnectionDialog.title"),k=a("connections.createConnectionDialog.description"),C=r.formState.isSubmitting?a("connections.createConnectionDialog.saving"):a("connections.createConnectionDialog.createButton"),w=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(ce,{control:r.control,name:"ui_type",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.typeLabel")}),s.jsxs(kn,{value:j.value,onValueChange:j.onChange,children:[s.jsx(fe,{children:s.jsx(Nn,{children:s.jsx(_n,{})})}),s.jsxs(Sn,{children:[s.jsx(Ue,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.httpType")]})}),s.jsx(Ue,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.sseType")]})}),s.jsx(Ue,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.websocketType")]})}),o&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"w-4 h-4"}),a("connections.createConnectionDialog.npxPackageType")]})}),s.jsx(Ue,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-4 h-4"}),a("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(me,{})]})}),m==="NPX"&&s.jsx(ce,{control:r.control,name:"npx_package",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.npmPackagePlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),m==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(ce,{control:r.control,name:"stdio_command",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.commandLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.commandPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"stdio_args",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.argumentsLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.argumentsPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"stdio_cwd",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.workingDirectoryPlaceholder"),...j,value:j.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(me,{})]})})]}),(m==="NPX"||m==="STDIO")&&s.jsx(ce,{control:r.control,name:"env_vars",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(fe,{children:s.jsx(Bn,{value:j.value??[],onChange:j.onChange})}),s.jsx(me,{})]})}),m!=="NPX"&&m!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{control:r.control,name:"connection_url",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.urlLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.urlPlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"connection_token",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:x?.token?.label??a("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(fe,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??a("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...j,value:j.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:a("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"title",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.nameLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.namePlaceholder"),...j})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"description",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.descriptionLabel")}),s.jsx(fe,{children:s.jsx(Dn,{placeholder:a("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),s.jsx(me,{})]})})]});return d?s.jsx(_t,{open:t,onOpenChange:S,children:s.jsxs(St,{className:"max-h-[90vh]",children:[s.jsx(on,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(Dt,{children:v}),s.jsx(an,{className:"mt-1",children:k})]}),s.jsx(ss,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(In,{size:16})})})]})}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:w}),s.jsx(ns,{children:s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(cs,{open:t,onOpenChange:S,children:s.jsxs(ds,{className:"sm:max-w-[525px]",children:[s.jsxs(us,{children:[s.jsx(fs,{children:v}),s.jsx(Cn,{children:k})]}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"py-4",children:w}),s.jsxs(vn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:a("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function _o(t){const e=R.c(72),{mode:n,agentId:a,addedConnectionIds:i,onAdd:l,onCloneAndAdd:o,onConnectAndAdd:d,connectingItemId:c,search:u,onCreateConnection:f,onBrowseNavigate:p,defaultTab:r}=t,m=n===void 0?"add":n,g=r===void 0?"connected":r,h=Q(),{org:x}=ge(),b=z.useDeferredValue(u),S=u!==b;let y;e[0]!==b?(y=b.trim().toLowerCase(),e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==g?(k=M=>M??g,e[2]=g,e[3]=k):k=e[3];const[C,w]=Es(Ms.connectionsTab(x.slug)+(g==="all"?":home-modal":":agent-modal"),k);let j;e[4]!==C||e[5]!==w?(j=M=>{M!==C&&Z("connections_dialog_tab_changed",{to_tab:M}),w(M)},e[4]=C,e[5]=w,e[6]=j):j=e[6];const _=j;let D;e[7]!==x.id||e[8]!==x.slug?(D={connectionId:en,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=D):D=e[9];const I=On(D),E=b?.trim().split(/\s+/).filter(Boolean)??[],N=E.length>0?{operator:"or",conditions:E.flatMap(Fo)}:void 0,A={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:O,fetchNextPage:B,hasNextPage:F,isFetchingNextPage:$}=$n({queryKey:ye.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async M=>{const{pageParam:Y}=M,je=Y===void 0?0:Y;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:je}})).structuredContent},initialPageParam:0,getNextPageParam:To,staleTime:3e4}),G=O?.pages.flatMap(Io)??[],P=yn(G),K=new Set(G.filter(Ao).map(wo)),L=is(),U=rs(L,b),V=Mt(U.loadMore,U.hasMore,U.isLoadingMore),J=Mt(B,F??!1,$),W=C==="all"||!!v,pe=W?U.items.filter(M=>{const Y=xn(M);if(Y&&K.has(Y))return!1;if(!v)return!0;const je=tt(M._meta),ke=[M.title,M.description,M.name,M.server?.title,M.server?.description,M.server?.name,je?.friendly_name,je?.friendlyName].filter(Boolean).join(" ").toLowerCase();return E.some(re=>ke.includes(re.toLowerCase()))}):[],te=pe.filter(Do),se=pe.filter(So);let ae;e[10]!==i?(ae=M=>M.some(Y=>i.has(Y.id)),e[10]=i,e[11]=ae):ae=e[11];const ie=ae;let he;e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==ie||e[16]!==m||e[17]!==l||e[18]!==p||e[19]!==o||e[20]!==h?(he=(M,Y,je,ke,re)=>{const Ye=ie(re),Me=re.find(Ne=>!i.has(Ne.id)),ne=re[0];if(m==="browse"){const Ne=Mn(ne);return s.jsx(ft,{connection:{title:Y,icon:je,description:re.length>1?`${re.length} instances`:ke??void 0},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{Z("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:re.length}),p?.(Ne)}},M)}return s.jsx(ft,{connection:{title:Y,icon:je,description:ke},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(Z("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Me.id}),a&&Z("agent_connection_attached",{agent_id:a,connection_id:Me.id,app_name:ne.app_name??null,mode:"existing"}),l(Me.id)):(Z("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),o(ne))},children:h("virtualMcp.connectionDialogContent.add")})]})},M)},e[12]=i,e[13]=a,e[14]=c,e[15]=ie,e[16]=m,e[17]=l,e[18]=p,e[19]=o,e[20]=h,e[21]=he):he=e[21];const H=he;let q;e[22]!==c||e[23]!==m||e[24]!==d||e[25]!==h?(q=M=>{const Y=tt(M._meta),je=Y?.friendlyName||Y?.friendly_name||M.server?.title||M.title||M.server?.name||M.name||M.id||"",ke=M.server?.description||M.description||null,re=M.server?.icons?.[0]?.src||jn(M.server?.repository)||null,Ye=Y?.official===!0,Me=Y?.verified===!0,ne=Y?.owner==="deco";return s.jsx(ft,{connection:{title:je,description:ke,icon:re},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ne&&Ye&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ne&&!Ye&&Me&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Z("connection_add_clicked",{action:"connect_new",registry_item_id:M.id,app_name:Y?.friendlyName||M.server?.name||M.name||null}),d(M)},children:c===M.id?s.jsx(He,{className:"size-3.5"}):h(m==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${M.id}`)},e[22]=c,e[23]=m,e[24]=d,e[25]=h,e[26]=q):q=e[26];const xe=q;let ee;e[27]!==C||e[28]!==_||e[29]!==f||e[30]!==v||e[31]!==h?(ee=!v&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(Ln,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:M=>_(M)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Z("connections_dialog_custom_clicked"),f()},children:[s.jsx(Qe,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=f,e[30]=v,e[31]=h,e[32]=ee):ee=e[32];const Ce=S&&"opacity-50 pointer-events-none";let le;e[33]!==Ce?(le=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ce),e[33]=Ce,e[34]=le):le=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let we;e[35]!==H?(we=M=>{if(M.type==="group")return H(M.key,M.title,M.icon,null,M.connections);const Y=M.connection;return H(Y.id,Y.title,Y.icon,Y.description??null,[Y])},e[35]=H,e[36]=we):we=e[36];const at=P.map(we);let Ae;e[37]!==J?(Ae=s.jsx("div",{ref:J,className:"col-span-full h-1"}),e[37]=J,e[38]=Ae):Ae=e[38];let Ie;e[39]!==$?(Ie=$&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[39]=$,e[40]=Ie):Ie=e[40];const lt=W&&te.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(mt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=W&&te.map(xe),rt=W&&se.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ct=W&&se.map(xe);let Te;e[41]!==V||e[42]!==L||e[43]!==W?(Te=W&&L.length>0&&s.jsx("div",{ref:V,className:"col-span-full h-1"}),e[41]=V,e[42]=L,e[43]=W,e[44]=Te):Te=e[44];let Be;e[45]!==U.isLoadingMore||e[46]!==W?(Be=W&&U.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[45]=U.isLoadingMore,e[46]=W,e[47]=Be):Be=e[47];let Fe;e[48]!==at||e[49]!==Ae||e[50]!==Ie||e[51]!==lt||e[52]!==it||e[53]!==rt||e[54]!==ct||e[55]!==Te||e[56]!==Be?(Fe=s.jsxs("div",{className:De,children:[at,Ae,Ie,lt,it,rt,ct,Te,Be]}),e[48]=at,e[49]=Ae,e[50]=Ie,e[51]=lt,e[52]=it,e[53]=rt,e[54]=ct,e[55]=Te,e[56]=Be,e[57]=Fe):Fe=e[57];let Pe;e[58]!==C||e[59]!==P.length||e[60]!==se||e[61]!==u||e[62]!==h||e[63]!==te?(Pe=P.length===0&&te.length===0&&se.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):h(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=P.length,e[60]=se,e[61]=u,e[62]=h,e[63]=te,e[64]=Pe):Pe=e[64];let Ee;e[65]!==le||e[66]!==Fe||e[67]!==Pe?(Ee=s.jsxs("div",{className:le,children:[Fe,Pe]}),e[65]=le,e[66]=Fe,e[67]=Pe,e[68]=Ee):Ee=e[68];let We;return e[69]!==ee||e[70]!==Ee?(We=s.jsxs(s.Fragment,{children:[ee,Ee]}),e[69]=ee,e[70]=Ee,e[71]=We):We=e[71],We}function So(t){return!t.verified&&!tt(t._meta)?.verified&&!t.meta?.verified}function Do(t){return t.verified||tt(t._meta)?.verified||t.meta?.verified}function wo(t){return t.app_name}function Ao(t){return t.app_name}function Io(t){return t?.items??[]}function To(t,e){if(t?.hasMore)return e.reduce(Bo,0)}function Bo(t,e){return t+(e?.items?.length??0)}function Fo(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function hl({open:t,onOpenChange:e,defaultTab:n,initialSearch:a="",...i}){const l=Q(),o=i.mode??"add",d="agentId"in i?i.agentId:void 0,c="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,u="onAdd"in i&&i.onAdd?i.onAdd:N=>{},f=(N,A,T)=>{d&&Z("agent_connection_attached",{agent_id:d,connection_id:N,app_name:A,mode:T})},[p,r]=z.useState(null),[m,g]=z.useState(a),[h,x]=z.useState(!1),[b,S]=z.useState(t);t!==b&&(S(t),t&&g(a));const{org:y}=ge(),{data:v}=Ct.useSession(),k=ms(),C=vt(),w=qt(),j=N=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const A=N.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(N,A)=>{Z("connection_oauth_succeeded",{connection_id:N,flow:A});const T=new URL(`/api/${y.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ye.isMCPAuthenticated(T.href,null)}),_()},I=async N=>{r(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,B=(await k.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,F=await gt({connectionId:B,orgId:y.id,orgSlug:y.slug,persistFallback:$=>k.update.mutateAsync({id:B,data:{connection_token:$}}).then(()=>{})});if(F.ran&&!F.ok){Z("connection_oauth_failed",{connection_id:B,flow:"clone",error:F.error??"no_token"}),oe.error(l("virtualMcp.addConnectionDialog.authenticationFailedError",{error:F.error??"no token received"})),await k.delete.mutateAsync(B);return}F.ran&&await D(B,"clone"),f(B,N.app_name??null,"clone"),u(B)}catch(A){console.error("Failed to add connection:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},E=async N=>{if(!(!y||!v?.user?.id)){r(N.id);try{const A=bn(N,y.id,v.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",O=!!A.connection_url,B=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!O&&!B){oe.error(l("virtualMcp.addConnectionDialog.mcpServerConnectionError")),r(null);return}const{id:F}=await k.create.mutateAsync(A),$=await gt({connectionId:F,orgId:y.id,orgSlug:y.slug,persistFallback:G=>k.update.mutateAsync({id:F,data:{connection_token:G}}).then(()=>{})});if($.ran&&!$.ok){Z("connection_oauth_failed",{connection_id:F,flow:"connect_new",error:$.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:$.error??"no token received"})}),f(F,A.app_name??null,"new"),u(F);return}$.ran?(await D(F,"connect_new"),oe.success(l("virtualMcp.addConnectionDialog.connectedAuthenticated"))):oe.success(l("virtualMcp.addConnectionDialog.connected")),f(F,A.app_name??null,"new"),u(F)}catch(A){console.error("Failed to connect:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToConnect"))}finally{r(null)}}};return s.jsxs(cs,{open:t,onOpenChange:e,children:[s.jsxs(ds,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(us,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(fs,{className:"text-base font-semibold",children:l(o==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(pn,{value:m,onChange:g,placeholder:l("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),children:s.jsx(_o,{mode:o,agentId:d,addedConnectionIds:c,onAdd:u,onCloneAndAdd:I,onConnectAndAdd:E,connectingItemId:p,search:m,onCreateConnection:()=>x(!0),onBrowseNavigate:j,defaultTab:n})})]}),s.jsx(No,{open:h,onOpenChange:x,onCreated:async N=>{x(!1);const A=await gt({connectionId:N,orgId:y.id,orgSlug:y.slug,persistFallback:T=>k.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:A.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),f(N,null,"custom"),u(N),e(!1);return}A.ran&&await D(N,"custom_create"),f(N,null,"custom"),u(N),e(!1)}})]})}const Rt=new Map;function xl(){const{org:t}=ge(),e=kt(),n=Rn(),a=n.find(x=>x.providerId==="deco"),{data:i,isLoading:l,refetch:o,isFetching:d}=Yt({queryKey:ye.aiProviderCredits(t.id,"deco"),enabled:!!a,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=i?.balanceCents??null,u=c!=null?c/100:null,f=z.useRef(new Map);if(c!=null){const x=Rt.get(t.id);f.current.get(t.id)&&x!=null&&c>x&&Z("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Rt.set(t.id,c),f.current.set(t.id,!0)}const p=!!a,r=c!=null&&c>0,m=c!=null&&c===0,g=c!=null&&c===200,h=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:a?.id??null,balanceCents:c,balanceDollars:u,hasCredits:r,isZeroBalance:m,isInitialFreeCredit:g,hasOnlyDecoProvider:h,isLoading:l,isFetching:d,refetch:o}}const Po=4,Eo="TASK";function Mo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,Po)||Eo}function Lo(t,e){return e==null?null:`${Mo(t)}-${String(e).padStart(2,"0")}`}const $o=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function Oo(t){const e=$o.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function Kt(t){const e=R.c(8),{size:n,className:a}=t,i=n===void 0?16:n;let l;e[0]!==i?(l={width:i,height:i},e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X("shrink-0 rounded-full object-cover",a),e[2]=a,e[3]=o):o=e[3];let d;return e[4]!==i||e[5]!==l||e[6]!==o?(d=s.jsx("img",{src:tn,alt:"Super Agent",width:i,height:i,style:l,className:o}),e[4]=i,e[5]=l,e[6]=o,e[7]=d):d=e[7],d}function jl(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(a=>{const i=a.bucket.toLowerCase();return a.siteSlug?.toLowerCase()===n||i===n||i===`deco-assets-${n}`})??null}const zt=()=>0;function Ro(t){const{orgSlug:e,enabled:n=!0,onUpdate:a,onDelete:i,onResync:l}=t,o=z.useRef(a);o.current=a;const d=z.useRef(i);d.current=i;const c=z.useRef(l);c.current=l;const u=z.useRef(null),f=z.useRef(n),p=z.useRef(e);(!u.current||f.current!==n||p.current!==e)&&(f.current=n,p.current=e,u.current=m=>{if(!n||!e)return()=>{};const g=h=>{let x;try{x=JSON.parse(h.data)}catch{return}x.data&&(h.type===Kn?d.current?.(x.data.id):o.current(x.data)),m()};return Un.subscribe(e,g,()=>c.current?.())}),z.useSyncExternalStore(u.current,zt,zt)}function Ko(t,e){return{queryKey:ye.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function zo(){const t=R.c(21),{org:e,locator:n}=ge(),a=vt();let i;t[0]!==n?(i=ye.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const l=i;let o;t[2]!==n||t[3]!==a||t[4]!==l?(o=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.some(g=>g.id===r.id)?m.items.map(g=>g.id===r.id?r:g):[r,...m.items]}),a.invalidateQueries({queryKey:ye.taskBoardActivity(n,r.id)})},t[2]=n,t[3]=a,t[4]=l,t[5]=o):o=t[5];let d,c;t[6]!==a||t[7]!==l?(d=()=>{a.invalidateQueries({queryKey:l})},c=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.filter(g=>g.id!==r)})},t[6]=a,t[7]=l,t[8]=d,t[9]=c):(d=t[8],c=t[9]);let u;t[10]!==e.slug||t[11]!==o||t[12]!==d||t[13]!==c?(u={orgSlug:e.slug,onUpdate:o,onResync:d,onDelete:c},t[10]=e.slug,t[11]=o,t[12]=d,t[13]=c,t[14]=u):u=t[14],Ro(u);let f;t[15]!==a||t[16]!==l?(f=r=>{const m=r.subject,g=r.data.status;a.cancelQueries({queryKey:l}),a.setQueryData(l,h=>h&&{...h,items:h.items.map(x=>x.threads.some(b=>b.threadId===m)?{...x,threads:x.threads.map(b=>b.threadId===m?{...b,status:g}:b)}:x)})},t[15]=a,t[16]=l,t[17]=f):f=t[17];let p;t[18]!==e.slug||t[19]!==f?(p={orgSlug:e.slug,onTaskStatus:f},t[18]=e.slug,t[19]=f,t[20]=p):p=t[20],Hn(p)}function bl(){const t=R.c(9),{locator:e}=ge(),n=kt();let a;t[0]!==e||t[1]!==n?(a=Ko(e,n),t[0]=e,t[1]=n,t[2]=a):a=t[2];const i=Yt(a);zo();let l;t[3]!==i.data?.items?(l=i.data?.items??[],t[3]=i.data?.items,t[4]=l):l=t[4];let o;return t[5]!==i.error||t[6]!==i.isLoading||t[7]!==l?(o={items:l,isLoading:i.isLoading,error:i.error},t[5]=i.error,t[6]=i.isLoading,t[7]=l,t[8]=o):o=t[8],o}function yl(){const t=R.c(70),{org:e,locator:n}=ge(),a=kt(),i=vt(),l=Q();let o;t[0]!==n?(o=ye.taskBoardItems(n),t[0]=n,t[1]=o):o=t[1];const d=o;let c;t[2]!==i||t[3]!==d?(c=()=>i.invalidateQueries({queryKey:d}),t[2]=i,t[3]=d,t[4]=c):c=t[4];const u=c;let f;t[5]!==a?(f=P=>a.call("TASK_BOARD_ITEM_CREATE",P),t[5]=a,t[6]=f):f=t[6];let p;t[7]!==u||t[8]!==f?(p={mutationFn:f,onSuccess:u},t[7]=u,t[8]=f,t[9]=p):p=t[9];const r=Le(p);let m;t[10]!==a?(m=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[10]=a,t[11]=m):m=t[11];let g;t[12]!==i||t[13]!==d?(g=async P=>{await i.cancelQueries({queryKey:d});const K=i.getQueryData(d);return i.setQueryData(d,L=>L&&{...L,items:L.items.map(U=>U.id===P.id?{...U,...P}:U)}),{previous:K}},t[12]=i,t[13]=d,t[14]=g):g=t[14];let h;t[15]!==e?(h=(P,K)=>{K.status==="done"&&Z("task_marked_done",{organization_id:e.id,task_board_item_id:K.id})},t[15]=e,t[16]=h):h=t[16];let x;t[17]!==i||t[18]!==d?(x=(P,K,L)=>{L?.previous&&i.setQueryData(d,L.previous)},t[17]=i,t[18]=d,t[19]=x):x=t[19];let b;t[20]!==u||t[21]!==n||t[22]!==i?(b=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[20]=u,t[21]=n,t[22]=i,t[23]=b):b=t[23];let S;t[24]!==m||t[25]!==g||t[26]!==h||t[27]!==x||t[28]!==b?(S={mutationFn:m,onMutate:g,onSuccess:h,onError:x,onSettled:b},t[24]=m,t[25]=g,t[26]=h,t[27]=x,t[28]=b,t[29]=S):S=t[29];const y=Le(S);let v;t[30]!==a?(v=P=>a.call("TASK_BOARD_ITEM_DELETE",{id:P}),t[30]=a,t[31]=v):v=t[31];let k;t[32]!==u||t[33]!==l?(k=P=>{oe.error(P instanceof Error&&P.message?P.message:l("taskBoard.taskBoard.deleteError")),u()},t[32]=u,t[33]=l,t[34]=k):k=t[34];let C;t[35]!==u||t[36]!==v||t[37]!==k?(C={mutationFn:v,onSuccess:u,onError:k},t[35]=u,t[36]=v,t[37]=k,t[38]=C):C=t[38];const w=Le(C);let j;t[39]!==a?(j=async P=>{const K=await Promise.allSettled(P.map(L=>a.call("TASK_BOARD_ITEM_DELETE",{id:L})));return{total:P.length,failed:K.filter(Vo).length}},t[39]=a,t[40]=j):j=t[40];let _,D;t[41]!==l?(_=P=>{const{total:K,failed:L}=P;L!==0&&oe.error(l("taskBoard.taskBoard.deleteBulkError",{failed:String(L),total:String(K)}))},D=()=>oe.error(l("taskBoard.taskBoard.deleteError")),t[41]=l,t[42]=_,t[43]=D):(_=t[42],D=t[43]);let I;t[44]!==u||t[45]!==j||t[46]!==_||t[47]!==D?(I={mutationFn:j,onSuccess:_,onError:D,onSettled:u},t[44]=u,t[45]=j,t[46]=_,t[47]=D,t[48]=I):I=t[48];const E=Le(I);let N;t[49]!==a?(N=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[49]=a,t[50]=N):N=t[50];let A;t[51]!==u||t[52]!==N?(A={mutationFn:N,onSuccess:u},t[51]=u,t[52]=N,t[53]=A):A=t[53];const T=Le(A);let O;t[54]!==a?(O=P=>a.call("TASK_BOARD_ITEM_RERUN",P),t[54]=a,t[55]=O):O=t[55];let B;t[56]!==u||t[57]!==n||t[58]!==i?(B=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[56]=u,t[57]=n,t[58]=i,t[59]=B):B=t[59];let F;t[60]!==O||t[61]!==B?(F={mutationFn:O,onSettled:B},t[60]=O,t[61]=B,t[62]=F):F=t[62];const $=Le(F);let G;return t[63]!==r||t[64]!==T||t[65]!==w||t[66]!==E||t[67]!==$||t[68]!==y?(G={create:r,update:y,remove:w,removeMany:E,link:T,rerun:$},t[63]=r,t[64]=T,t[65]=w,t[66]=E,t[67]=$,t[68]=y,t[69]=G):G=t[69],G}function Vo(t){return t.status==="rejected"}const Uo=["ended_after_delivery","superseded"];function Ho(t){return!!t&&Uo.includes(t)}function Cl(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function vl(t){return t.failureKind!=="superseded"}function vs(t){return t.threads.some(e=>e.status==="requires_action")}function kl(t){return t.status==="in_review"&&!t.assigneeId}function Nl(t){return vs(t)}function _l(t){return t.status==="in_progress"&&vs(t)?"text-warning animate-pulse":Ns(t.status).iconClassName}function Sl(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!Ho(n.failureKind))?"failed":null}function Dl(t,e,n){const a=t.findIndex(f=>f.id===n),i=e===n?t[a+1]?.id??null:e,l=t.filter(f=>f.id!==n),o=i?l.findIndex(f=>f.id===i):-1,d=o===-1?l.length:o,c=l[d-1],u=l[d];return c&&u?(c.sortOrder+u.sortOrder)/2:c?c.sortOrder+1:u?u.sortOrder-1:0}function wl(t,e){return Array.from({length:e},(n,a)=>t-(e-1-a)*1e-4)}const Go=["archived"],ks={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Qn,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:bs,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Gs,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Yn,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Hs,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:An,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:Us,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Wn,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Ls,iconClassName:"text-muted-foreground"}},qo={icon:bs,iconClassName:"text-muted-foreground"},Qo=ks;function Ns(t){return Qo[t]??qo}function Al(t,e){const n=ks[t];return{label:n?e(n.labelKey):t,visual:Ns(t)}}const Il=["bug","feature","chore","spike","security"],Tl={bug:{labelKey:"taskBoard.config.typeBug",icon:Jn,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ws,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Qs,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:qs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Xn,iconClassName:"text-purple-500"}};function jt(t){return Vn.includes(t)}function Bl(t){return wt.filter(e=>t||!jt(e))}function Fl({deliveryEnabled:t,shownLanes:e,occupied:n}){const a=wt.filter(o=>t||!jt(o)||n.includes(o)),i=a.filter(o=>Go.includes(o)||!t&&jt(o)),l=i.filter(o=>!e.includes(o));return{lanes:a.filter(o=>!l.includes(o)),hidden:l,hideable:i}}const Vt="lane:";function Wo(t){return wt.includes(t)}function Pl({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),a=n.startsWith(Vt)?n.slice(Vt.length):e(n);return a!==void 0&&Wo(a)?a:null}const Yo=["none","low","medium","high","urgent"],Ze={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Ft,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:Vs,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Ft,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:zs,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:Ks,iconClassName:"text-destructive"}};function El(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Xo*864e5?"soon":null}const Xo=3;function Ut(t){return`color-mix(in oklab, ${t??zn} var(--user-color-strength), transparent)`}const bt="__unassigned__",yt="__no_repo__",Ke="__any__",_s={assignee:null,priority:null,due:null,tags:[],repo:null,search:""};function Jo(t){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||t.repo!==null||t.search.trim()!==""}function Zo(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(t.repo!==null?1:0)+(t.search.trim()!==""?1:0)}const ea=864e5;function ta(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 Ss(t,e){const n=t.trim();return n===""?!1:e!=null&&Oo(n)===e}function sa(t,e){return t.assigneeId===e?!0:t.assigneeId===xt&&t.assignedBy===e}function Ml(t,e){const n=e.search.trim().toLowerCase();if(n!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(n)&&!Ss(n,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===bt){if(t.assigneeId!==null)return!1}else if(!sa(t,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 a=new Date(t.dueDate).getTime(),i=Date.now();if(e.due==="overdue"&&a>=i||e.due==="today"&&!ta(a,i)||e.due==="week"&&(a<i||a>i+7*ea))return!1}if(e.tags.length>0){const a=t.tags.map(i=>i.id);if(!e.tags.some(i=>a.includes(i)))return!1}if(e.repo!==null){if(e.repo===yt){if(t.repo!=null)return!1}else if(t.repo?.toLowerCase()!==e.repo.toLowerCase())return!1}return!0}const Ht={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Se(t,e=!1){return X("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",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 na(t){const e=R.c(107),{value:n,members:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($t,{size:14,className:"shrink-0"}),e[0]=u):u=e[0];let f=u,p;e[1]!==o?(p=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=p):p=e[2];let r=p;if(n===bt){let H;e[3]!==o?(H=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=H):H=e[4],r=H}else if(n===xt){let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Kt,{size:14}),e[5]=H):H=e[5],f=H;let q;e[6]!==o?(q=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=q):q=e[7],r=q}else if(n){let H,q,xe,ee;if(e[8]!==a||e[9]!==n){let De;e[14]!==n?(De=we=>we.userId===n,e[14]=n,e[15]=De):De=e[15],q=a.find(De),H=Lt,xe=q?.user?.image??void 0,ee=Ot(q?.user?.name),e[8]=a,e[9]=n,e[10]=H,e[11]=q,e[12]=xe,e[13]=ee}else H=e[10],q=e[11],xe=e[12],ee=e[13];let Ce;e[16]!==H||e[17]!==xe||e[18]!==ee?(Ce=s.jsx(H,{url:xe,fallback:ee,shape:"circle",size:"2xs"}),e[16]=H,e[17]=xe,e[18]=ee,e[19]=Ce):Ce=e[19],f=Ce;let le;e[20]!==q?.user?.name||e[21]!==o?(le=q?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=q?.user?.name,e[21]=o,e[22]=le):le=e[22],r=le}let m;e[23]!==i?(m=H=>{i(H),c(!1)},e[23]=i,e[24]=m):m=e[24];const g=m,h=n!==null;let x;e[25]!==l||e[26]!==h?(x=Se(h,l),e[25]=l,e[26]=h,e[27]=x):x=e[27];const b=x,S=l&&"ml-auto";let y;e[28]!==S?(y=X("shrink-0 opacity-60",S),e[28]=S,e[29]=y):y=e[29];const v=y;let k;e[30]!==r?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[30]=r,e[31]=k):k=e[31];let C;e[32]!==v?(C=s.jsx(Ve,{size:12,className:v}),e[32]=v,e[33]=C):C=e[33];let w;e[34]!==f||e[35]!==k||e[36]!==C||e[37]!==b?(w=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:b,children:[f,k,C]})}),e[34]=f,e[35]=k,e[36]=C,e[37]=b,e[38]=w):w=e[38];let j;e[39]!==o?(j=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=j):j=e[40];let _;e[41]!==o?(_=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=o,e[42]=_):_=e[42];let D;e[43]!==j||e[44]!==_?(D=s.jsx(At,{placeholder:j,"aria-label":_,className:"h-9"}),e[43]=j,e[44]=_,e[45]=D):D=e[45];let I;e[46]!==o?(I=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=o,e[47]=I):I=e[47];let E;e[48]!==I?(E=s.jsx(It,{children:I}),e[48]=I,e[49]=E):E=e[49];let N;e[50]!==o?(N=o("taskBoard.taskFilters.assigneeAnyone"),e[50]=o,e[51]=N):N=e[51];let A;e[52]!==g?(A=()=>g(null),e[52]=g,e[53]=A):A=e[53];let T;e[54]!==o?(T=o("taskBoard.taskFilters.assigneeAnyone"),e[54]=o,e[55]=T):T=e[55];let O;e[56]!==N||e[57]!==A||e[58]!==T?(O=s.jsx(ve,{value:N,onSelect:A,children:T}),e[56]=N,e[57]=A,e[58]=T,e[59]=O):O=e[59];let B;e[60]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[60]=o,e[61]=B):B=e[61];let F;e[62]!==g?(F=()=>g(bt),e[62]=g,e[63]=F):F=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx($t,{size:16,className:"text-muted-foreground"}),e[64]=$):$=e[64];let G;e[65]!==o?(G=o("taskBoard.taskFilters.assigneeUnassigned"),e[65]=o,e[66]=G):G=e[66];let P;e[67]!==B||e[68]!==F||e[69]!==G?(P=s.jsxs(ve,{value:B,onSelect:F,className:"gap-2",children:[$,G]}),e[67]=B,e[68]=F,e[69]=G,e[70]=P):P=e[70];let K;e[71]!==o?(K=o("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=o,e[72]=K):K=e[72];let L;e[73]!==g?(L=()=>g(xt),e[73]=g,e[74]=L):L=e[74];let U;e[75]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Kt,{size:16}),e[75]=U):U=e[75];let V;e[76]!==o?(V=o("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=o,e[77]=V):V=e[77];let J;e[78]!==K||e[79]!==L||e[80]!==V?(J=s.jsxs(ve,{value:K,onSelect:L,className:"gap-2",children:[U,V]}),e[78]=K,e[79]=L,e[80]=V,e[81]=J):J=e[81];let W;e[82]!==O||e[83]!==P||e[84]!==J?(W=s.jsxs(qe,{children:[O,P,J]}),e[82]=O,e[83]=P,e[84]=J,e[85]=W):W=e[85];let pe;e[86]!==o?(pe=o("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=o,e[87]=pe):pe=e[87];let te;if(e[88]!==a||e[89]!==g){let H;e[91]!==g?(H=q=>s.jsxs(ve,{value:q.user?.name??q.userId,onSelect:()=>g(q.userId),className:"gap-2",children:[s.jsx(Lt,{url:q.user?.image??void 0,fallback:Ot(q.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:q.user?.name??q.userId})]},q.userId),e[91]=g,e[92]=H):H=e[92],te=a.map(H),e[88]=a,e[89]=g,e[90]=te}else te=e[90];let se;e[93]!==pe||e[94]!==te?(se=s.jsx(qe,{heading:pe,children:te}),e[93]=pe,e[94]=te,e[95]=se):se=e[95];let ae;e[96]!==E||e[97]!==W||e[98]!==se?(ae=s.jsxs(Tt,{children:[E,W,se]}),e[96]=E,e[97]=W,e[98]=se,e[99]=ae):ae=e[99];let ie;e[100]!==D||e[101]!==ae?(ie=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[D,ae]})}),e[100]=D,e[101]=ae,e[102]=ie):ie=e[102];let he;return e[103]!==d||e[104]!==w||e[105]!==ie?(he=s.jsxs(nt,{open:d,onOpenChange:c,children:[w,ie]}),e[103]=d,e[104]=w,e[105]=ie,e[106]=he):he=e[106],he}function oa(t){const e=R.c(33),{value:n,onChange:a,block:i}=t,l=Q(),o=n!==null;let d;e[0]!==i||e[1]!==o?(d=Se(o,i),e[0]=i,e[1]=o,e[2]=d):d=e[2];const c=d,u=i&&"ml-auto";let f;e[3]!==u?(f=X("shrink-0 opacity-60",u),e[3]=u,e[4]=f):f=e[4];const p=f;let r;e[5]!==n?(r=n?s.jsx("span",{className:X("size-2 shrink-0 rounded-full",Ze[n].dotClassName)}):s.jsx(Gn,{size:14,className:"shrink-0"}),e[5]=n,e[6]=r):r=e[6];let m;e[7]!==l||e[8]!==n?(m=l(n?Ze[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=l,e[8]=n,e[9]=m):m=e[9];let g;e[10]!==p?(g=s.jsx(Ve,{size:12,className:p}),e[10]=p,e[11]=g):g=e[11];let h;e[12]!==r||e[13]!==m||e[14]!==g||e[15]!==c?(h=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[r,m,g]})}),e[12]=r,e[13]=m,e[14]=g,e[15]=c,e[16]=h):h=e[16];const x=n??Ke;let b;e[17]!==a?(b=w=>a(w===Ke?null:w),e[17]=a,e[18]=b):b=e[18];let S;e[19]!==l?(S=l("taskBoard.taskFilters.priorityAnyPriority"),e[19]=l,e[20]=S):S=e[20];let y;e[21]!==S?(y=s.jsx(st,{value:Ke,children:S}),e[21]=S,e[22]=y):y=e[22];let v;e[23]!==l?(v=Yo.map(w=>s.jsxs(st,{value:w,className:"gap-2",children:[s.jsx("span",{className:X("size-2 rounded-full",Ze[w].dotClassName)}),l(Ze[w].labelKey)]},w)),e[23]=l,e[24]=v):v=e[24];let k;e[25]!==b||e[26]!==y||e[27]!==v||e[28]!==x?(k=s.jsx(hs,{align:"start",className:"w-40",children:s.jsxs(xs,{value:x,onValueChange:b,children:[y,v]})}),e[25]=b,e[26]=y,e[27]=v,e[28]=x,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==h?(C=s.jsxs(js,{children:[h,k]}),e[30]=k,e[31]=h,e[32]=C):C=e[32],C}function aa(t){const e=R.c(35),{value:n,onChange:a,block:i}=t,l=Q();let o;e[0]!==l||e[1]!==n?(o=n?l(Ht[n]):void 0,e[0]=l,e[1]=n,e[2]=o):o=e[2];const d=o,c=n!==null;let u;e[3]!==i||e[4]!==c?(u=Se(c,i),e[3]=i,e[4]=c,e[5]=u):u=e[5];const f=u,p=i&&"ml-auto";let r;e[6]!==p?(r=X("shrink-0 opacity-60",p),e[6]=p,e[7]=r):r=e[7];const m=r;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ut,{size:14,className:"shrink-0"}),e[8]=g):g=e[8];let h;e[9]!==d||e[10]!==l?(h=d??l("taskBoard.taskFilters.dueDateLabel"),e[9]=d,e[10]=l,e[11]=h):h=e[11];let x;e[12]!==m?(x=s.jsx(Ve,{size:12,className:m}),e[12]=m,e[13]=x):x=e[13];let b;e[14]!==h||e[15]!==x||e[16]!==f?(b=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,children:[g,h,x]})}),e[14]=h,e[15]=x,e[16]=f,e[17]=b):b=e[17];const S=n??Ke;let y;e[18]!==a?(y=D=>a(D===Ke?null:D),e[18]=a,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:16,className:"text-muted-foreground"}),e[20]=v):v=e[20];let k;e[21]!==l?(k=l("taskBoard.taskFilters.dueDateAnyTime"),e[21]=l,e[22]=k):k=e[22];let C;e[23]!==k?(C=s.jsxs(st,{value:Ke,className:"gap-2",children:[v,k]}),e[23]=k,e[24]=C):C=e[24];let w;e[25]!==l?(w=Object.entries(Ht).map(D=>{const[I,E]=D,N=I==="overdue";return s.jsxs(st,{value:I,className:X("gap-2",N&&"text-destructive"),children:[s.jsx(ut,{size:16,className:X("shrink-0",N?"text-destructive":"text-muted-foreground")}),l(E)]},I)}),e[25]=l,e[26]=w):w=e[26];let j;e[27]!==S||e[28]!==y||e[29]!==C||e[30]!==w?(j=s.jsx(hs,{align:"start",className:"w-44",children:s.jsxs(xs,{value:S,onValueChange:y,children:[C,w]})}),e[27]=S,e[28]=y,e[29]=C,e[30]=w,e[31]=j):j=e[31];let _;return e[32]!==j||e[33]!==b?(_=s.jsxs(js,{children:[b,j]}),e[32]=j,e[33]=b,e[34]=_):_=e[34],_}function la(t){const e=R.c(56),{value:n,tags:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==i||e[1]!==n?(u=B=>i(n.includes(B)?n.filter(F=>F!==B):[...n,B]),e[0]=i,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==o||e[4]!==a||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?o("taskBoard.taskFilters.tagsLabel"):n.length===1?a.find(B=>B.id===n[0])?.name??o("taskBoard.taskFilters.tagsLabel"):o("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=o,e[4]=a,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const r=p,m=n.length>0;let g;e[8]!==l||e[9]!==m?(g=Se(m,l),e[8]=l,e[9]=m,e[10]=g):g=e[10];const h=g,x=l&&"ml-auto";let b;e[11]!==x?(b=X("shrink-0 opacity-60",x),e[11]=x,e[12]=b):b=e[12];const S=b;let y;e[13]!==a||e[14]!==n[0]||e[15]!==n.length?(y=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(a.find(B=>B.id===n[0])?.color)}}):s.jsx(Ys,{size:14,className:"shrink-0"}),e[13]=a,e[14]=n[0],e[15]=n.length,e[16]=y):y=e[16];let v;e[17]!==r?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=v):v=e[18];let k;e[19]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[19]=S,e[20]=k):k=e[20];let C;e[21]!==y||e[22]!==v||e[23]!==k||e[24]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[21]=y,e[22]=v,e[23]=k,e[24]=h,e[25]=C):C=e[25];let w;e[26]!==o?(w=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=o,e[27]=w):w=e[27];let j;e[28]!==o?(j=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=o,e[29]=j):j=e[29];let _;e[30]!==w||e[31]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[30]=w,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==o?(D=o("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=o,e[34]=D):D=e[34];let I;e[35]!==D?(I=s.jsx(It,{children:D}),e[35]=D,e[36]=I):I=e[36];let E;if(e[37]!==a||e[38]!==f||e[39]!==n){let B;e[41]!==f||e[42]!==n?(B=F=>s.jsxs(ve,{value:F.name,onSelect:()=>f(F.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(F.color)}}),s.jsx("span",{className:"flex-1 truncate",children:F.name}),n.includes(F.id)&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},F.id),e[41]=f,e[42]=n,e[43]=B):B=e[43],E=a.map(B),e[37]=a,e[38]=f,e[39]=n,e[40]=E}else E=e[40];let N;e[44]!==E?(N=s.jsx(qe,{children:E}),e[44]=E,e[45]=N):N=e[45];let A;e[46]!==I||e[47]!==N?(A=s.jsxs(Tt,{children:[I,N]}),e[46]=I,e[47]=N,e[48]=A):A=e[48];let T;e[49]!==_||e[50]!==A?(T=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[_,A]})}),e[49]=_,e[50]=A,e[51]=T):T=e[51];let O;return e[52]!==d||e[53]!==C||e[54]!==T?(O=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,T]}),e[52]=d,e[53]=C,e[54]=T,e[55]=O):O=e[55],O}function ia(t){const e=R.c(73),{value:n,repos:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==o||e[1]!==n?(u=n===null?o("taskBoard.taskFilters.repoLabel"):n===yt?o("taskBoard.taskFilters.repoNoRepo"):n,e[0]=o,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==i?(p=J=>{i(J),c(!1)},e[3]=i,e[4]=p):p=e[4];const r=p,m=n!==null;let g;e[5]!==l||e[6]!==m?(g=Se(m,l),e[5]=l,e[6]=m,e[7]=g):g=e[7];const h=g,x=l&&"ml-auto";let b;e[8]!==x?(b=X("shrink-0 opacity-60",x),e[8]=x,e[9]=b):b=e[9];const S=b;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ht,{className:"size-3.5 shrink-0"}),e[10]=y):y=e[10];let v;e[11]!==f?(v=s.jsx("span",{className:"max-w-[12rem] truncate",children:f}),e[11]=f,e[12]=v):v=e[12];let k;e[13]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[13]=S,e[14]=k):k=e[14];let C;e[15]!==v||e[16]!==k||e[17]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[15]=v,e[16]=k,e[17]=h,e[18]=C):C=e[18];let w;e[19]!==o?(w=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[19]=o,e[20]=w):w=e[20];let j;e[21]!==o?(j=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[21]=o,e[22]=j):j=e[22];let _;e[23]!==w||e[24]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[23]=w,e[24]=j,e[25]=_):_=e[25];let D;e[26]!==o?(D=o("taskBoard.taskFilters.repoNoReposFound"),e[26]=o,e[27]=D):D=e[27];let I;e[28]!==D?(I=s.jsx(It,{children:D}),e[28]=D,e[29]=I):I=e[29];let E;e[30]!==o?(E=o("taskBoard.taskFilters.repoAnyRepo"),e[30]=o,e[31]=E):E=e[31];let N;e[32]!==r?(N=()=>r(null),e[32]=r,e[33]=N):N=e[33];let A;e[34]!==o?(A=o("taskBoard.taskFilters.repoAnyRepo"),e[34]=o,e[35]=A):A=e[35];let T;e[36]!==E||e[37]!==N||e[38]!==A?(T=s.jsx(ve,{value:E,onSelect:N,children:A}),e[36]=E,e[37]=N,e[38]=A,e[39]=T):T=e[39];let O;e[40]!==o?(O=o("taskBoard.taskFilters.repoNoRepo"),e[40]=o,e[41]=O):O=e[41];let B;e[42]!==r?(B=()=>r(yt),e[42]=r,e[43]=B):B=e[43];let F;e[44]!==o?(F=o("taskBoard.taskFilters.repoNoRepo"),e[44]=o,e[45]=F):F=e[45];let $;e[46]!==O||e[47]!==B||e[48]!==F?($=s.jsx(ve,{value:O,onSelect:B,children:F}),e[46]=O,e[47]=B,e[48]=F,e[49]=$):$=e[49];let G;e[50]!==T||e[51]!==$?(G=s.jsxs(qe,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=G):G=e[52];let P;if(e[53]!==a||e[54]!==r||e[55]!==n){let J;e[57]!==r||e[58]!==n?(J=W=>s.jsxs(ve,{value:W,onSelect:()=>r(W),className:"gap-2",children:[s.jsx(ht,{className:"size-4 shrink-0"}),s.jsx("span",{className:"flex-1 truncate",children:W}),n===W&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},W),e[57]=r,e[58]=n,e[59]=J):J=e[59],P=a.map(J),e[53]=a,e[54]=r,e[55]=n,e[56]=P}else P=e[56];let K;e[60]!==P?(K=s.jsx(qe,{children:P}),e[60]=P,e[61]=K):K=e[61];let L;e[62]!==I||e[63]!==G||e[64]!==K?(L=s.jsxs(Tt,{children:[I,G,K]}),e[62]=I,e[63]=G,e[64]=K,e[65]=L):L=e[65];let U;e[66]!==_||e[67]!==L?(U=s.jsx(ot,{align:"start",className:"w-64 p-0",children:s.jsxs(Bt,{children:[_,L]})}),e[66]=_,e[67]=L,e[68]=U):U=e[68];let V;return e[69]!==d||e[70]!==C||e[71]!==U?(V=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,U]}),e[69]=d,e[70]=C,e[71]=U,e[72]=V):V=e[72],V}function ra(t){const e=R.c(25),{value:n,onChange:a,block:i}=t,l=Q(),[o,d]=z.useState(n!==""),[c,u]=z.useState(!1),[f,p]=z.useState(n);n!==f&&(p(n),n===""&&!c&&d(!1));const r=o||i,m=r?"w-32 sm:w-44":"w-8 px-0 justify-center",g=i&&"h-10 w-full px-3 text-sm sm:w-full";let h;e[0]!==m||e[1]!==g?(h=X("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",m,g),e[0]=m,e[1]=g,e[2]=h):h=e[2];let x;e[3]!==l?(x=l("taskBoard.taskFilters.searchLabel"),e[3]=l,e[4]=x):x=e[4];let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[5]=b):b=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Xs,{size:14}),e[6]=S):S=e[6];let y;e[7]!==x?(y=s.jsx("button",{type:"button","aria-label":x,onClick:b,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=y):y=e[8];let v;e[9]!==i||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==n?(v=r&&s.jsx("input",{autoFocus:!i,value:n,onChange:w=>a(w.target.value),onFocus:()=>u(!0),onBlur:()=>{u(!1),n===""&&d(!1)},placeholder:l("taskBoard.taskFilters.searchPlaceholder"),"aria-label":l("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=i,e[10]=r,e[11]=a,e[12]=l,e[13]=n,e[14]=v):v=e[14];let k;e[15]!==i||e[16]!==a||e[17]!==l||e[18]!==n?(k=n!==""&&s.jsx("button",{type:"button","aria-label":l("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ca,onClick:()=>{a(""),i||d(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx($s,{size:14})}),e[15]=i,e[16]=a,e[17]=l,e[18]=n,e[19]=k):k=e[19];let C;return e[20]!==h||e[21]!==y||e[22]!==v||e[23]!==k?(C=s.jsxs("div",{className:h,children:[y,v,k]}),e[20]=h,e[21]=y,e[22]=v,e[23]=k,e[24]=C):C=e[24],C}function ca(t){return t.preventDefault()}function da(t){const e=R.c(20),{block:n,onClick:a}=t,i=Q();let l;e[0]!==i?(l=i("taskBoard.taskFilters.boardSettingsLabel"),e[0]=i,e[1]=l):l=e[1];const o=l;let d;e[2]!==n?(d=X(Se(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qn,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let u;e[5]!==n||e[6]!==o?(u=n&&s.jsx("span",{children:o}),e[5]=n,e[6]=o,e[7]=u):u=e[7];let f;e[8]!==o||e[9]!==a||e[10]!==d||e[11]!==u?(f=s.jsxs("button",{type:"button",onClick:a,"aria-label":o,className:d,children:[c,u]}),e[8]=o,e[9]=a,e[10]=d,e[11]=u,e[12]=f):f=e[12];const p=f;if(n)return p;let r;e[13]!==p?(r=s.jsx($e,{asChild:!0,children:p}),e[13]=p,e[14]=r):r=e[14];let m;e[15]!==o?(m=s.jsx(Oe,{side:"top",children:o}),e[15]=o,e[16]=m):m=e[16];let g;return e[17]!==r||e[18]!==m?(g=s.jsxs(Re,{children:[r,m]}),e[17]=r,e[18]=m,e[19]=g):g=e[19],g}function Ds(t){const e=R.c(53),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d,block:c}=t;let u;e[0]!==n||e[1]!==o?(u=C=>o({...n,search:C}),e[0]=n,e[1]=o,e[2]=u):u=e[2];let f;e[3]!==c||e[4]!==n.search||e[5]!==u?(f=s.jsx(ra,{block:c,value:n.search,onChange:u}),e[3]=c,e[4]=n.search,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==n||e[8]!==o?(p=C=>o({...n,assignee:C}),e[7]=n,e[8]=o,e[9]=p):p=e[9];let r;e[10]!==c||e[11]!==n.assignee||e[12]!==a||e[13]!==p?(r=s.jsx(na,{block:c,value:n.assignee,members:a,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=a,e[13]=p,e[14]=r):r=e[14];let m;e[15]!==n||e[16]!==o?(m=C=>o({...n,priority:C}),e[15]=n,e[16]=o,e[17]=m):m=e[17];let g;e[18]!==c||e[19]!==n.priority||e[20]!==m?(g=s.jsx(oa,{block:c,value:n.priority,onChange:m}),e[18]=c,e[19]=n.priority,e[20]=m,e[21]=g):g=e[21];let h;e[22]!==n||e[23]!==o?(h=C=>o({...n,due:C}),e[22]=n,e[23]=o,e[24]=h):h=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==h?(x=s.jsx(aa,{block:c,value:n.due,onChange:h}),e[25]=c,e[26]=n.due,e[27]=h,e[28]=x):x=e[28];let b;e[29]!==n||e[30]!==o?(b=C=>o({...n,tags:C}),e[29]=n,e[30]=o,e[31]=b):b=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==b||e[35]!==i?(S=s.jsx(la,{block:c,value:n.tags,tags:i,onChange:b}),e[32]=c,e[33]=n.tags,e[34]=b,e[35]=i,e[36]=S):S=e[36];let y;e[37]!==c||e[38]!==n||e[39]!==o||e[40]!==l?(y=(l.length>0||n.repo!==null)&&s.jsx(ia,{block:c,value:n.repo,repos:l,onChange:C=>o({...n,repo:C})}),e[37]=c,e[38]=n,e[39]=o,e[40]=l,e[41]=y):y=e[41];let v;e[42]!==c||e[43]!==d?(v=s.jsx(da,{block:c,onClick:d}),e[42]=c,e[43]=d,e[44]=v):v=e[44];let k;return e[45]!==S||e[46]!==y||e[47]!==v||e[48]!==f||e[49]!==r||e[50]!==g||e[51]!==x?(k=s.jsxs(s.Fragment,{children:[f,r,g,x,S,y,v]}),e[45]=S,e[46]=y,e[47]=v,e[48]=f,e[49]=r,e[50]=g,e[51]=x,e[52]=k):k=e[52],k}function Ll(t){const e=R.c(15),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(gs,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=u):u=e[0];let f;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==d||e[5]!==l||e[6]!==i?(f=s.jsx(Ds,{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}),e[1]=n,e[2]=a,e[3]=o,e[4]=d,e[5]=l,e[6]=i,e[7]=f):f=e[7];let p;e[8]!==n||e[9]!==o||e[10]!==c?(p=Jo(n)&&s.jsx("button",{type:"button",onClick:()=>o(_s),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=o,e[10]=c,e[11]=p):p=e[11];let r;return e[12]!==f||e[13]!==p?(r=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u,f,p]}),e[12]=f,e[13]=p,e[14]=r):r=e[14],r}function $l(t){const e=R.c(41),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q(),[u,f]=z.useState(!1),p=Zo(n),r=p>0;let m;e[0]!==r?(m=Se(r),e[0]=r,e[1]=m):m=e[1];const g=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(gs,{size:14,className:"shrink-0"}),e[2]=h):h=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let b;e[5]!==p?(b=p>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:p}),e[5]=p,e[6]=b):b=e[6];let S;e[7]!==x||e[8]!==b||e[9]!==g?(S=s.jsx(ln,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[h,x,b]})}),e[7]=x,e[8]=b,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==c?(y=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=y):y=e[12];let v;e[13]!==y?(v=s.jsx(Dt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let k;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==d||e[19]!==l||e[20]!==i?(k=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Ds,{block:!0,filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d})}),e[15]=n,e[16]=a,e[17]=o,e[18]=d,e[19]=l,e[20]=i,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==o||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>o(_s),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=o,e[24]=c,e[25]=C):C=e[25];let w;e[26]!==c?(w=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=w):w=e[27];let j;e[28]!==w?(j=s.jsx(ss,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:w})}),e[28]=w,e[29]=j):j=e[29];let _;e[30]!==C||e[31]!==j?(_=s.jsxs(ns,{className:"flex-row gap-2",children:[C,j]}),e[30]=C,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==_||e[34]!==v||e[35]!==k?(D=s.jsxs(St,{className:"p-0",children:[v,k,_]}),e[33]=_,e[34]=v,e[35]=k,e[36]=D):D=e[36];let I;return e[37]!==u||e[38]!==D||e[39]!==S?(I=s.jsxs(_t,{open:u,onOpenChange:f,direction:"bottom",children:[S,D]}),e[37]=u,e[38]=D,e[39]=S,e[40]=I):I=e[40],I}function Ol(t,e){return Lo(t,e.keySeq)??e.id}function Rl(t,e){const n=e?.trim();if(n)return t.find(a=>Ss(n,a.keySeq))??t.find(a=>a.id===n)}export{hl as A,wl as B,Fl as C,Sl as D,_s as E,Nl as F,Dl as G,Pl as H,Ml as I,Go as J,El as K,Vt as L,Co as M,pl as N,Ze as P,Kt as S,Tl as T,Ol as a,kl as b,Ko as c,ml as d,gl as e,zo as f,yl as g,Yo as h,vs as i,Il as j,Ut as k,Al as l,jl as m,Ns as n,Bl as o,Cl as p,vl as q,Ho as r,_l as s,Lo as t,xl as u,ks as v,bl as w,Rl as x,$l as y,Ll as z};
1
+ import{bW as ws,c as R,l as X,j as s,h as He,r as z,I as Gt,G as As,o as Z,b as Q,b6 as Is,W as ge,d as qt,a6 as Qt,_ as Wt,L as Ts,a1 as $e,a2 as Oe,a4 as Re,a as Ct,F as Bs,ar as Fs,as as Ps,B as be,t as oe,H as Es,J as Ms,K as ye,n as vt,a7 as kt,m as Yt,e as Le,bm as Ls,ap as $s}from"./index-B1NfLh28.js";import{c as Xt,u as Os,d as Jt}from"./thread-route-DghMzEvi.js";import{t as Ve}from"./ChevronUp-BZvKWnmE.js";import{A as Zt,N as Rs,s as dt,aJ as Ks,aK as zs,aL as Ft,aM as Vs,t as Us,aN as Hs,a6 as Gs,aO as qs,o as Qs,aP as Ws,a4 as ut,a3 as Ys,aa as Xs}from"./agent-icon-_mOvC4lh.js";import{a as es,i as Js,e as Zs,S as en,f as tn}from"./constants-DNuUCxmW.js";import{b as Nt,u as sn}from"./use-virtual-mcp-GrNV8gSX.js";import{g as nn}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-D5UWifRH.js";import{P as nt,a as ze,b as ot}from"./popover-CiSRUL8W.js";import{D as _t,a as St,b as Dt,c as on,e as an,f as ss,g as ns,d as ln}from"./drawer-BH5TUdft.js";import{i as rn}from"./SearchMd-GhWQt9H_.js";import{i as Ge}from"./Check-CViV2AKw.js";import{s as Qe}from"./Plus-Dy3OwbdP.js";import{G as ht,a as cn}from"./github-repo-picker-BvXosldt.js";import{g as dn,u as un,b as os}from"./hooks-C1zHirdm.js";import{g as fn,b as as}from"./use-project-scope-BPel4oYu.js";import{u as ls}from"./shell-layout-CYnXtCwc.js";import{a as mn}from"./use-navigate-to-agent-IY8mCF-a.js";import{d as gn}from"./thread-intent-B9RGGbT7.js";import{C as pn}from"./collection-search-jeWHAmV1.js";import{g as hn,b as xn,a as jn,e as bn}from"./extract-connection-data-B0tz2bg7.js";import{u as is,a as rs,g as yn,C as ft}from"./connection-card-D0u9_kRo.js";import{D as cs,b as ds,c as us,d as fs,h as Cn,e as vn}from"./dialog-_eOGpV_R.js";import{d as ce,a as de,e as ue,b as fe,c as me,F as Pt}from"./form-DVlwcFzf.js";import{I as _e}from"./input-6kxANu4D.js";import{S as kn,a as Nn,b as _n,c as Sn,d as Ue}from"./select-KntX1BWy.js";import{T as Dn}from"./textarea-D69PAPp0.js";import{b as ms}from"./use-connection-DjqJprQ0.js";import{n as et,a as mt,i as gs}from"./Tool02-CZJjuIxA.js";import{b as wn,d as An}from"./UserSquare-BeyEkA5D.js";import{s as In}from"./XClose-auuJ_GRB.js";import{c as Tn,i as Xe,a as Et,E as Bn,p as Fn,b as Pn,d as En}from"./connection-form-helpers-Blb0GPpJ.js";import{a as gt}from"./authenticate-and-persist-oauth-Ca9jI9n9.js";import{g as Mn}from"./connection-slug-CITJ0kGN.js";import{C as Ln}from"./collection-tabs-BUx5Y6ne.js";import{u as Mt}from"./use-infinite-scroll-D5DcjHPJ.js";import{B as Je}from"./badge-3ZvX9jce.js";import{u as $n}from"./useSuspenseInfiniteQuery-Day-b8LH.js";import{u as On}from"./use-mcp-client-BsCYwuYG.js";import{g as tt}from"./metadata-dUsYcpuu.js";import{u as Rn}from"./use-ai-providers-BDymGfsX.js";import{T as Kn,C as wt,c as zn,d as Vn,S as xt}from"./task-board-Cpu4KbdQ.js";import{t as Un}from"./decopilot-sse-pool-BT-eLzU1.js";import{u as Hn}from"./use-decopilot-events-DJzsWHaW.js";import{A as Lt}from"./avatar-BAJ_UwLY.js";import{h as st,D as ps,b as hs,g as xs,c as js}from"./dropdown-menu-DAkDKRcv.js";import{a as At,c as It,d as ve,e as qe,b as Tt,C as Bt}from"./command-DYMcXrYb.js";import{s as Gn}from"./TrendUp01-D_qxLEW7.js";import{a as qn}from"./Settings02-Xf5MNOeS.js";import{s as $t}from"./User01-CAS_KrTr.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{i as Qn}from"./AlertCircle-CbIethWO.js";import{i as Wn}from"./CheckCircle-BceWKyuF.js";import{a as bs}from"./DotsVertical-CUO5Z4B7.js";import{s as Yn}from"./Eye-CRgiNYAI.js";import{i as Xn}from"./Shield01-AHWHm-DS.js";const Jn=ws("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function Zn(t){const e=R.c(21),{value:n,onChange:a,placeholder:i,onKeyDown:l,className:o,isSearching:d,disabled:c}=t,u=i===void 0?"Search...":i;let f;e[0]!==o?(f=X("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=f):f=e[1];const p=c?"cursor-not-allowed opacity-50":"cursor-text";let r;e[2]!==p?(r=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=r):r=e[3];let m;e[4]!==d?(m=d?s.jsx(He,{className:"size-4 text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=m):m=e[5];let g;e[6]!==a?(g=S=>a(S.target.value),e[6]=a,e[7]=g):g=e[7];let h;e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==g||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:l,placeholder:u,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=l,e[10]=u,e[11]=g,e[12]=n,e[13]=h):h=e[13];let x;e[14]!==r||e[15]!==m||e[16]!==h?(x=s.jsxs("label",{className:r,children:[m,h]}),e[14]=r,e[15]=m,e[16]=h,e[17]=x):x=e[17];let b;return e[18]!==f||e[19]!==x?(b=s.jsx("div",{className:f,children:x}),e[18]=f,e[19]=x,e[20]=b):b=e[20],b}function eo(t,e,n){if(!n)return null;const a=dn(t,e);return a?a.threads.get().find(l=>l.id===n)?.branch??null:null}const ys=z.createContext(null);function ml(t){const e=R.c(5),{children:n}=t,[a,i]=z.useState(!1);let l;e[0]!==a?(l={empty:a,setEmpty:i},e[0]=a,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=s.jsx(ys.Provider,{value:l,children:n}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function to(){return z.useContext(ys)?.empty??!1}function so(t){const e=R.c(6),{value:n,onChange:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==a||e[3]!==l||e[4]!==n?(o=s.jsx(Zn,{value:n,onChange:a,placeholder:l}),e[2]=a,e[3]=l,e[4]=n,e[5]=o):o=e[5],o}function no(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:n}),t[2]=n,t[3]=a):a=t[3],a}function oo(t){const e=R.c(10),{org:n,onClose:a}=t,i=Q();let l;e[0]!==n.slug?(l={org:n.slug},e[0]=n.slug,e[1]=l):l=e[1];let o;e[2]!==a?(o=()=>a(),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==i?(d=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==l||e[7]!==o||e[8]!==d?(c=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ts,{to:"/$org/settings/agents",params:l,onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:d})}),e[6]=l,e[7]=o,e[8]=d,e[9]=c):c=e[9],c}function ao(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Cs,{children:n}),t[2]=n,t[3]=a):a=t[3],a}function lo(t){const e=R.c(11),{onImportFromGithub:n}=t,a=Q();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ht,{className:"size-3.5"}),e[0]=i):i=e[0];let l;e[1]!==a?(l=a("sidebar.agentsSection.import"),e[1]=a,e[2]=l):l=e[2];let o;e[3]!==n||e[4]!==l?(o=s.jsxs("button",{type:"button",onClick:n,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:[i,l]}),e[3]=n,e[4]=l,e[5]=o):o=e[5];let d;e[6]!==a?(d=a("sidebar.agentsSection.codeAgents"),e[6]=a,e[7]=d):d=e[7];let c;return e[8]!==o||e[9]!==d?(c=s.jsx(Cs,{action:o,children:d}),e[8]=o,e[9]=d,e[10]=c):c=e[10],c}function io(t){const e=R.c(11),{setOpen:n,emptyCtaClass:a}=t,i=Q();let l;e[0]!==i?(l=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X(a),e[2]=a,e[3]=o):o=e[3];let d;e[4]!==n?(d=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[4]=n,e[5]=d):d=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{className:"size-4"}),e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==o||e[9]!==d?(u=s.jsx(ts,{"aria-label":l,className:o,onClick:d,children:c}),e[7]=l,e[8]=o,e[9]=d,e[10]=u):u=e[10],u}function ro(t){const e=R.c(17),{setOpen:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==n?(c=()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[5]=n,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Qe,{}),e[7]=u):u=e[7];let f;e[8]!==l?(f=l("sidebar.agentsSection.newAgent"),e[8]=l,e[9]=f):f=e[9];let p;e[10]!==f?(p=s.jsx("span",{children:f}),e[10]=f,e[11]=p):p=e[11];let r;return e[12]!==o||e[13]!==d||e[14]!==c||e[15]!==p?(r=s.jsx(Qt,{children:s.jsxs(Wt,{tooltip:o,className:d,onClick:c,children:[u,p]})}),e[12]=o,e[13]=d,e[14]=c,e[15]=p,e[16]=r):r=e[16],r}function co(){const t=R.c(4),e=Q();let n;t[0]!==e?(n=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=n):n=t[1];let a;return t[2]!==n?(a=s.jsx(Dt,{className:"sr-only",children:n}),t[2]=n,t[3]=a):a=t[3],a}function uo(t){const e=R.c(8),{emptyCtaClass:n}=t,a=Q();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==n?(l=X(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qe,{className:"size-4"}),e[4]=o):o=e[4];let d;return e[5]!==i||e[6]!==l?(d=s.jsx(ts,{"aria-label":i,className:l,children:o}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function fo(t){const e=R.c(19),{wrapEmptyHint:n,highlightEmpty:a,emptyCtaClass:i}=t,l=Q();let o;e[0]!==a||e[1]!==l?(o=a?void 0:l("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qe,{}),e[5]=c):c=e[5];let u;e[6]!==l?(u=l("sidebar.agentsSection.newAgent"),e[6]=l,e[7]=u):u=e[7];let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==d||e[12]!==f?(p=s.jsx(ze,{asChild:!0,children:s.jsxs(Wt,{tooltip:o,className:d,children:[c,f]})}),e[10]=o,e[11]=d,e[12]=f,e[13]=p):p=e[13];let r;e[14]!==p||e[15]!==n?(r=n(p),e[14]=p,e[15]=n,e[16]=r):r=e[16];let m;return e[17]!==r?(m=s.jsx(Qt,{children:r}),e[17]=r,e[18]=m):m=e[18],m}function mo(t){const e=R.c(9),{children:n}=t,a=Q();let i;e[0]!==n?(i=s.jsx($e,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==a?(l=a("sidebar.agentsSection.selectAnExistingAgent"),e[2]=a,e[3]=l):l=e[3];let o;e[4]!==l?(o=s.jsx(Oe,{side:"right",sideOffset:8,children:l}),e[4]=l,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs(Re,{defaultOpen:!0,delayDuration:0,children:[i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function go(t){const e=qt(),{create:n}=un(),{locator:a}=ge(),i=Xt(),l=Os();return async o=>{const d=crypto.randomUUID(),c=o===l?eo(t,a,i??""):null;try{await n({id:d,virtual_mcp_id:o,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:d},search:{virtualmcpid:o}})}}function pt(t){const e=R.c(20),{agent:n,selected:a,onClick:i}=t,l=a?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==l?(o=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==n.icon||e[3]!==n.title?(d=s.jsx(Zt,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=d):d=e[4];let c;e[5]!==n.title?(c=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.description?(u=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=u):u=e[8];let f;e[9]!==c||e[10]!==u?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),e[9]=c,e[10]=u,e[11]=f):f=e[11];let p;e[12]!==a?(p=a&&s.jsx(Ge,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=a,e[13]=p):p=e[13];let r;return e[14]!==i||e[15]!==o||e[16]!==d||e[17]!==f||e[18]!==p?(r=s.jsxs("button",{type:"button",onClick:i,className:o,children:[d,f,p]}),e[14]=i,e[15]=o,e[16]=d,e[17]=f,e[18]=p,e[19]=r):r=e[19],r}function Cs(t){const e=R.c(5),{children:n,action:a}=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 l;return e[2]!==a||e[3]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,a]}),e[2]=a,e[3]=i,e[4]=l):l=e[4],l}function po(t){const e=R.c(43),{onClose:n,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:l}=t,[o,d]=z.useState(""),c=z.useDeferredValue(o),u=c||void 0;let f;e[0]!==u?(f={searchTerm:u},e[0]=u,e[1]=f):f=e[1];const p=Nt(f),r=p??[],{org:m}=ge(),g=go(m.slug),h=fn(p),x=c.toLowerCase(),b=r.filter(bo).filter(V=>!h.has(V.id)).filter(jo),S=b.filter(xo),y=b.filter(ho),v=es(m.id),k=!c||v.title.toLowerCase().includes(x),C=!!(a&&k);let w;e[2]!==n||e[3]!==a?(w=()=>{a?.(null),n(),d("")},e[2]=n,e[3]=a,e[4]=w):w=e[4];const j=w;let _;e[5]!==g||e[6]!==n||e[7]!==a?(_=V=>{if(a){a(V.id),n(),d("");return}n(),d(""),g(V.id)},e[5]=g,e[6]=n,e[7]=a,e[8]=_):_=e[8];const D=_,I="flex flex-col max-h-[min(640px,80dvh)]";let E;e[9]!==o?(E=s.jsx(so,{value:o,onChange:d}),e[9]=o,e[10]=E):E=e[10];const N="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let A;e[11]!==v||e[12]!==a||e[13]!==j||e[14]!==i||e[15]!==k?(A=a&&k&&v&&s.jsx(pt,{agent:v,selected:!i||i===v.id,onClick:j}),e[11]=v,e[12]=a,e[13]=j,e[14]=i,e[15]=k,e[16]=A):A=e[16];const T=(S.length>0||!c)&&s.jsx(lo,{onImportFromGithub:l});let O;e[17]!==D||e[18]!==a||e[19]!==i?(O=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[17]=D,e[18]=a,e[19]=i,e[20]=O):O=e[20];const B=S.map(O),F=y.length>0&&s.jsx(ao,{});let $;e[21]!==D||e[22]!==a||e[23]!==i?($=V=>s.jsx(pt,{agent:V,selected:a?i===V.id:void 0,onClick:()=>D(V)},V.id),e[21]=D,e[22]=a,e[23]=i,e[24]=$):$=e[24];const G=y.map($);let P;e[25]!==C||e[26]!==c||e[27]!==b.length?(P=b.length===0&&!C&&c&&s.jsx(no,{}),e[25]=C,e[26]=c,e[27]=b.length,e[28]=P):P=e[28];let K;e[29]!==B||e[30]!==F||e[31]!==G||e[32]!==P||e[33]!==A||e[34]!==T?(K=s.jsxs("div",{className:N,children:[A,T,B,F,G,P]}),e[29]=B,e[30]=F,e[31]=G,e[32]=P,e[33]=A,e[34]=T,e[35]=K):K=e[35];let L;e[36]!==n||e[37]!==m?(L=s.jsx(oo,{org:m,onClose:n}),e[36]=n,e[37]=m,e[38]=L):L=e[38];let U;return e[39]!==K||e[40]!==L||e[41]!==E?(U=s.jsxs("div",{className:I,children:[E,K,L]}),e[39]=K,e[40]=L,e[41]=E,e[42]=U):U=e[42],U}function ho(t){return!as(t.metadata)}function xo(t){return as(t.metadata)}function jo(t){return!Zs(t.id)}function bo(t){return!Js(t.id)}function yo(t){const e=R.c(14),{compact:n,trigger:a,onSelectAgent:i,selectedAgentId:l,side:o,align:d}=t===void 0?{}:t,c=n===void 0?!1:n,u=o===void 0?"right":o,f=d===void 0?"start":d,[p,r]=z.useState(!1),[m,g]=z.useState(!1),h=Gt(),{setOpenMobile:x}=As(),b=to(),S=b?"border border-border":void 0;let y;e[0]!==b?(y=N=>b?s.jsx(mo,{children:N}):N,e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==h||e[3]!==x?(k=()=>{r(!1),h&&x(!1)},e[2]=h,e[3]=x,e[4]=k):k=e[4];const C=k;let w;e[5]!==C||e[6]!==g?(w=()=>{C(),g(!0)},e[5]=C,e[6]=g,e[7]=w):w=e[7];const j=w,_=p&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Is,{className:"h-4 w-24"})}),children:s.jsx(po,{onClose:C,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:j})}),D=h?s.jsxs(s.Fragment,{children:[a?z.cloneElement(a,{onClick:N=>{a.props.onClick?.(N),r(!0)}}):c?v(s.jsx(io,{setOpen:r,emptyCtaClass:S})):s.jsx(ro,{setOpen:r,highlightEmpty:b,emptyCtaClass:S}),s.jsx(_t,{open:p,onOpenChange:r,direction:"bottom",children:s.jsxs(St,{className:"max-h-[85dvh] p-0",children:[s.jsx(co,{}),_]})})]}):s.jsxs(nt,{open:p,onOpenChange:N=>{N&&!p&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(N)},children:[a?s.jsx(ze,{asChild:!0,children:a}):c?v(s.jsx(ze,{asChild:!0,children:s.jsx(uo,{emptyCtaClass:S})})):s.jsx(fo,{wrapEmptyHint:v,highlightEmpty:b,emptyCtaClass:S}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:u,align:f,children:_})]});let I;e[8]!==m||e[9]!==g?(I=s.jsx(cn,{open:m,onOpenChange:g,mode:"agent"}),e[8]=m,e[9]=g,e[10]=I):I=e[10];let E;return e[11]!==D||e[12]!==I?(E=s.jsxs(s.Fragment,{children:[D,I]}),e[11]=D,e[12]=I,e[13]=E):E=e[13],E}function Co(){const t=R.c(2),e=Nt()??[];let n;return t[0]!==e?(n=a=>{if(!a)return;const i=e.find(l=>l.id===a);return i?gn(i.metadata):void 0},t[0]=e,t[1]=n):n=t[1],n}const vo="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 ko(t){const e=R.c(29),{agentId:n,fallback:a,onOpenHome:i,onPick:l}=t,o=Q(),d=sn(n)??a??null;let c,u,f,p,r;e[0]!==d?.title||e[1]!==i||e[2]!==o?(r=d?.title??o("header.shellBreadcrumb.superAgentDefaultName"),p="flex min-w-0 items-center gap-0",c="button",u=i,f=o("header.shellBreadcrumb.openAgentHome",{name:r}),e[0]=d?.title,e[1]=i,e[2]=o,e[3]=c,e[4]=u,e[5]=f,e[6]=p,e[7]=r):(c=e[3],u=e[4],f=e[5],p=e[6],r=e[7]);const m=d?.icon??null;let g;e[8]!==m||e[9]!==r?(g=s.jsx(Zt,{icon:m,name:r,size:"xs"}),e[8]=m,e[9]=r,e[10]=g):g=e[10];let h;e[11]!==c||e[12]!==u||e[13]!==f||e[14]!==g?(h=s.jsx("button",{type:c,onClick:u,"aria-label":f,className:"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:g}),e[11]=c,e[12]=u,e[13]=f,e[14]=g,e[15]=h):h=e[15];let x;e[16]!==r?(x=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:r}),e[16]=r,e[17]=x):x=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ve,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=b):b=e[18];let S;e[19]!==x?(S=s.jsxs("button",{type:"button",className:vo,children:[x,b]}),e[19]=x,e[20]=S):S=e[20];let y;e[21]!==n||e[22]!==l||e[23]!==S?(y=s.jsx(yo,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:S}),e[21]=n,e[22]=l,e[23]=S,e[24]=y):y=e[24];let v;return e[25]!==y||e[26]!==p||e[27]!==h?(v=s.jsxs("div",{className:p,children:[h,y]}),e[25]=y,e[26]=p,e[27]=h,e[28]=v):v=e[28],v}function gl(t){const e=R.c(22);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:a}=n,{org:i}=ge(),{threads:l}=os(),o=Nt(),{data:d}=Ct.useSession(),{setTaskId:c,createNewTask:u}=ls(),f=Co();let p;e[2]!==i.id?(p=es(i.id),e[2]=i.id,e[3]=p):p=e[3];const r=p,m=r.id,g=Jt();let h;e[4]!==o||e[5]!==u||e[6]!==m||e[7]!==a||e[8]!==f||e[9]!==d?.user?.id||e[10]!==c||e[11]!==l?(h=k=>{const C=k??m,w=(o??[]).find(_=>_.id===C),j=mn(l,C,d?.user?.id,f(C),!!(w&&nn(w)));j?c(j.id,C):u(C),a?.()},e[4]=o,e[5]=u,e[6]=m,e[7]=a,e[8]=f,e[9]=d?.user?.id,e[10]=c,e[11]=l,e[12]=h):h=e[12];const x=h;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const S=g===m?r:void 0;let y;e[14]!==g||e[15]!==x?(y=()=>x(g),e[14]=g,e[15]=x,e[16]=y):y=e[16];let v;return e[17]!==g||e[18]!==x||e[19]!==S||e[20]!==y?(v=s.jsx(z.Suspense,{fallback:b,children:s.jsx(ko,{agentId:g,fallback:S,onOpenHome:y,onPick:x})}),e[17]=g,e[18]=x,e[19]=S,e[20]=y,e[21]=v):v=e[21],v}function pl(){const t=R.c(20),e=Q(),{threads:n}=os(),{createNewTask:a}=ls(),i=Jt(),l=Xt();let o;t[0]!==l||t[1]!==n?(o=n.find(x=>x.id===l)?.branch??null,t[0]=l,t[1]=n,t[2]=o):o=t[2];const d=o;let c;t[3]!==i||t[4]!==a||t[5]!==d?(c=()=>{a(i,d)},t[3]=i,t[4]=a,t[5]=d,t[6]=c):c=t[6];const u=c;let f;t[7]!==e?(f=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rs,{size:16}),t[9]=p):p=t[9];let r;t[10]!==u||t[11]!==f?(r=s.jsx($e,{asChild:!0,children:s.jsx("button",{type:"button",onClick:u,"aria-label":f,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p})}),t[10]=u,t[11]=f,t[12]=r):r=t[12];let m;t[13]!==e?(m=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=m):m=t[14];let g;t[15]!==m?(g=s.jsx(Oe,{side:"bottom",children:m}),t[15]=m,t[16]=g):g=t[16];let h;return t[17]!==r||t[18]!==g?(h=s.jsxs(Re,{children:[r,g]}),t[17]=r,t[18]=g,t[19]=h):h=t[19],h}function No({open:t,onOpenChange:e,onCreated:n}){const a=Q(),{org:i}=ge(),{data:l}=Ct.useSession(),{stdioEnabled:o}=Bs(),d=Gt(),c=ms(),u=is(),p=rs(u,"").items,r=Fs({resolver:Ps(Tn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),g=r.watch("connection_url"),h=r.watch("npx_package"),x=Xe({uiType:m,connectionUrl:g??"",npxPackage:h??""})??Et({uiType:m,connectionUrl:g??"",registryItems:p}),b=j=>{const _=j.trim();if(!_)return;const D=!!r.formState.dirtyFields.title,I=!!r.formState.dirtyFields.description,E=!!r.formState.dirtyFields.env_vars,N=T=>{if(T&&(!D&&!r.getValues("title").trim()&&T.title&&r.setValue("title",T.title,{shouldDirty:!1}),!I&&!(r.getValues("description")??"").trim()&&T.description&&r.setValue("description",T.description,{shouldDirty:!1}),!E&&T.envVarKeys?.length)){const O=r.getValues("env_vars")??[],B=new Set(O.map($=>$.key)),F=T.envVarKeys.filter($=>!B.has($));F.length>0&&r.setValue("env_vars",[...O,...F.map($=>({key:$,value:""}))],{shouldDirty:!0})}},A=Fn(_);if(A&&o){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",A.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),N(Xe({uiType:"NPX",npxPackage:A.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const T=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",_,{shouldDirty:!0}),N(Xe({uiType:T,connectionUrl:_})??Et({uiType:T,connectionUrl:_,registryItems:p}));return}m==="NPX"&&N(Xe({uiType:"NPX",npxPackage:_}))},S=j=>{j||r.reset(),e(j)},y=async j=>{let _,D=null,I=null,E=null;j.ui_type==="NPX"?(_="STDIO",D="",E=Pn(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(_="STDIO",D="",E=En(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(_=j.ui_type,D=j.connection_url||"",I=j.connection_token||null);const N=hn("conn");try{await c.create.mutateAsync({id:N,title:j.title,description:j.description||null,connection_type:_,connection_url:D,connection_token:I,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:i.id,icon:j.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),n?.(N)}catch{oe.error(a("connections.createConnectionDialog.failedToCreateConnection"))}},v=a("connections.createConnectionDialog.title"),k=a("connections.createConnectionDialog.description"),C=r.formState.isSubmitting?a("connections.createConnectionDialog.saving"):a("connections.createConnectionDialog.createButton"),w=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(ce,{control:r.control,name:"ui_type",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.typeLabel")}),s.jsxs(kn,{value:j.value,onValueChange:j.onChange,children:[s.jsx(fe,{children:s.jsx(Nn,{children:s.jsx(_n,{})})}),s.jsxs(Sn,{children:[s.jsx(Ue,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.httpType")]})}),s.jsx(Ue,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.sseType")]})}),s.jsx(Ue,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(dt,{className:"w-4 h-4"}),a("connections.createConnectionDialog.websocketType")]})}),o&&s.jsxs(s.Fragment,{children:[s.jsx(Ue,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(et,{className:"w-4 h-4"}),a("connections.createConnectionDialog.npxPackageType")]})}),s.jsx(Ue,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-4 h-4"}),a("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(me,{})]})}),m==="NPX"&&s.jsx(ce,{control:r.control,name:"npx_package",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.npmPackagePlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),m==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(ce,{control:r.control,name:"stdio_command",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.commandLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.commandPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"stdio_args",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.argumentsLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.argumentsPlaceholder"),...j,value:j.value??""})}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"stdio_cwd",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.workingDirectoryPlaceholder"),...j,value:j.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(me,{})]})})]}),(m==="NPX"||m==="STDIO")&&s.jsx(ce,{control:r.control,name:"env_vars",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(fe,{children:s.jsx(Bn,{value:j.value??[],onChange:j.onChange})}),s.jsx(me,{})]})}),m!=="NPX"&&m!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{control:r.control,name:"connection_url",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.urlLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.urlPlaceholder"),...j,value:j.value??"",onPaste:_=>{const D=_.clipboardData.getData("text");D&&(_.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),b(D))},onBlur:_=>{b(_.target.value),j.onBlur()}})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"connection_token",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:x?.token?.label??a("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(fe,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??a("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...j,value:j.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:a("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(me,{})]})})]}),s.jsx(ce,{control:r.control,name:"title",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.nameLabel")}),s.jsx(fe,{children:s.jsx(_e,{placeholder:a("connections.createConnectionDialog.namePlaceholder"),...j})}),s.jsx(me,{})]})}),s.jsx(ce,{control:r.control,name:"description",render:({field:j})=>s.jsxs(de,{children:[s.jsx(ue,{children:a("connections.createConnectionDialog.descriptionLabel")}),s.jsx(fe,{children:s.jsx(Dn,{placeholder:a("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),s.jsx(me,{})]})})]});return d?s.jsx(_t,{open:t,onOpenChange:S,children:s.jsxs(St,{className:"max-h-[90vh]",children:[s.jsx(on,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(Dt,{children:v}),s.jsx(an,{className:"mt-1",children:k})]}),s.jsx(ss,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(In,{size:16})})})]})}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:w}),s.jsx(ns,{children:s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(cs,{open:t,onOpenChange:S,children:s.jsxs(ds,{className:"sm:max-w-[525px]",children:[s.jsxs(us,{children:[s.jsx(fs,{children:v}),s.jsx(Cn,{children:k})]}),s.jsx(Pt,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(y),children:[s.jsx("div",{className:"py-4",children:w}),s.jsxs(vn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:a("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function _o(t){const e=R.c(72),{mode:n,agentId:a,addedConnectionIds:i,onAdd:l,onCloneAndAdd:o,onConnectAndAdd:d,connectingItemId:c,search:u,onCreateConnection:f,onBrowseNavigate:p,defaultTab:r}=t,m=n===void 0?"add":n,g=r===void 0?"connected":r,h=Q(),{org:x}=ge(),b=z.useDeferredValue(u),S=u!==b;let y;e[0]!==b?(y=b.trim().toLowerCase(),e[0]=b,e[1]=y):y=e[1];const v=y;let k;e[2]!==g?(k=M=>M??g,e[2]=g,e[3]=k):k=e[3];const[C,w]=Es(Ms.connectionsTab(x.slug)+(g==="all"?":home-modal":":agent-modal"),k);let j;e[4]!==C||e[5]!==w?(j=M=>{M!==C&&Z("connections_dialog_tab_changed",{to_tab:M}),w(M)},e[4]=C,e[5]=w,e[6]=j):j=e[6];const _=j;let D;e[7]!==x.id||e[8]!==x.slug?(D={connectionId:en,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=D):D=e[9];const I=On(D),E=b?.trim().split(/\s+/).filter(Boolean)??[],N=E.length>0?{operator:"or",conditions:E.flatMap(Fo)}:void 0,A={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:O,fetchNextPage:B,hasNextPage:F,isFetchingNextPage:$}=$n({queryKey:ye.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async M=>{const{pageParam:Y}=M,je=Y===void 0?0:Y;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:je}})).structuredContent},initialPageParam:0,getNextPageParam:To,staleTime:3e4}),G=O?.pages.flatMap(Io)??[],P=yn(G),K=new Set(G.filter(Ao).map(wo)),L=is(),U=rs(L,b),V=Mt(U.loadMore,U.hasMore,U.isLoadingMore),J=Mt(B,F??!1,$),W=C==="all"||!!v,pe=W?U.items.filter(M=>{const Y=xn(M);if(Y&&K.has(Y))return!1;if(!v)return!0;const je=tt(M._meta),ke=[M.title,M.description,M.name,M.server?.title,M.server?.description,M.server?.name,je?.friendly_name,je?.friendlyName].filter(Boolean).join(" ").toLowerCase();return E.some(re=>ke.includes(re.toLowerCase()))}):[],te=pe.filter(Do),se=pe.filter(So);let ae;e[10]!==i?(ae=M=>M.some(Y=>i.has(Y.id)),e[10]=i,e[11]=ae):ae=e[11];const ie=ae;let he;e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==ie||e[16]!==m||e[17]!==l||e[18]!==p||e[19]!==o||e[20]!==h?(he=(M,Y,je,ke,re)=>{const Ye=ie(re),Me=re.find(Ne=>!i.has(Ne.id)),ne=re[0];if(m==="browse"){const Ne=Mn(ne);return s.jsx(ft,{connection:{title:Y,icon:je,description:re.length>1?`${re.length} instances`:ke??void 0},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{Z("connection_browse_clicked",{app_name:ne.app_name??null,connection_id:ne.id,instances_count:re.length}),p?.(Ne)}},M)}return s.jsx(ft,{connection:{title:Y,icon:je,description:ke},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Ye&&s.jsxs(Je,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(Ge,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(Z("connection_add_clicked",{action:"use_existing",app_name:ne.app_name??null,connection_id:Me.id}),a&&Z("agent_connection_attached",{agent_id:a,connection_id:Me.id,app_name:ne.app_name??null,mode:"existing"}),l(Me.id)):(Z("connection_add_clicked",{action:"clone",app_name:ne.app_name??null,base_connection_id:ne.id}),o(ne))},children:h("virtualMcp.connectionDialogContent.add")})]})},M)},e[12]=i,e[13]=a,e[14]=c,e[15]=ie,e[16]=m,e[17]=l,e[18]=p,e[19]=o,e[20]=h,e[21]=he):he=e[21];const H=he;let q;e[22]!==c||e[23]!==m||e[24]!==d||e[25]!==h?(q=M=>{const Y=tt(M._meta),je=Y?.friendlyName||Y?.friendly_name||M.server?.title||M.title||M.server?.name||M.name||M.id||"",ke=M.server?.description||M.description||null,re=M.server?.icons?.[0]?.src||jn(M.server?.repository)||null,Ye=Y?.official===!0,Me=Y?.verified===!0,ne=Y?.owner==="deco";return s.jsx(ft,{connection:{title:je,description:ke,icon:re},fallbackIcon:s.jsx(et,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[ne&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!ne&&Ye&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!ne&&!Ye&&Me&&s.jsxs(Re,{children:[s.jsx($e,{asChild:!0,children:s.jsx(Je,{variant:"outline",size:"icon",children:s.jsx(mt,{})})}),s.jsx(Oe,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Z("connection_add_clicked",{action:"connect_new",registry_item_id:M.id,app_name:Y?.friendlyName||M.server?.name||M.name||null}),d(M)},children:c===M.id?s.jsx(He,{className:"size-3.5"}):h(m==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${M.id}`)},e[22]=c,e[23]=m,e[24]=d,e[25]=h,e[26]=q):q=e[26];const xe=q;let ee;e[27]!==C||e[28]!==_||e[29]!==f||e[30]!==v||e[31]!==h?(ee=!v&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(Ln,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:M=>_(M)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{Z("connections_dialog_custom_clicked"),f()},children:[s.jsx(Qe,{size:12}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=f,e[30]=v,e[31]=h,e[32]=ee):ee=e[32];const Ce=S&&"opacity-50 pointer-events-none";let le;e[33]!==Ce?(le=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ce),e[33]=Ce,e[34]=le):le=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let we;e[35]!==H?(we=M=>{if(M.type==="group")return H(M.key,M.title,M.icon,null,M.connections);const Y=M.connection;return H(Y.id,Y.title,Y.icon,Y.description??null,[Y])},e[35]=H,e[36]=we):we=e[36];const at=P.map(we);let Ae;e[37]!==J?(Ae=s.jsx("div",{ref:J,className:"col-span-full h-1"}),e[37]=J,e[38]=Ae):Ae=e[38];let Ie;e[39]!==$?(Ie=$&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[39]=$,e[40]=Ie):Ie=e[40];const lt=W&&te.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(mt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),it=W&&te.map(xe),rt=W&&se.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ct=W&&se.map(xe);let Te;e[41]!==V||e[42]!==L||e[43]!==W?(Te=W&&L.length>0&&s.jsx("div",{ref:V,className:"col-span-full h-1"}),e[41]=V,e[42]=L,e[43]=W,e[44]=Te):Te=e[44];let Be;e[45]!==U.isLoadingMore||e[46]!==W?(Be=W&&U.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),e[45]=U.isLoadingMore,e[46]=W,e[47]=Be):Be=e[47];let Fe;e[48]!==at||e[49]!==Ae||e[50]!==Ie||e[51]!==lt||e[52]!==it||e[53]!==rt||e[54]!==ct||e[55]!==Te||e[56]!==Be?(Fe=s.jsxs("div",{className:De,children:[at,Ae,Ie,lt,it,rt,ct,Te,Be]}),e[48]=at,e[49]=Ae,e[50]=Ie,e[51]=lt,e[52]=it,e[53]=rt,e[54]=ct,e[55]=Te,e[56]=Be,e[57]=Fe):Fe=e[57];let Pe;e[58]!==C||e[59]!==P.length||e[60]!==se||e[61]!==u||e[62]!==h||e[63]!==te?(Pe=P.length===0&&te.length===0&&se.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):h(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=P.length,e[60]=se,e[61]=u,e[62]=h,e[63]=te,e[64]=Pe):Pe=e[64];let Ee;e[65]!==le||e[66]!==Fe||e[67]!==Pe?(Ee=s.jsxs("div",{className:le,children:[Fe,Pe]}),e[65]=le,e[66]=Fe,e[67]=Pe,e[68]=Ee):Ee=e[68];let We;return e[69]!==ee||e[70]!==Ee?(We=s.jsxs(s.Fragment,{children:[ee,Ee]}),e[69]=ee,e[70]=Ee,e[71]=We):We=e[71],We}function So(t){return!t.verified&&!tt(t._meta)?.verified&&!t.meta?.verified}function Do(t){return t.verified||tt(t._meta)?.verified||t.meta?.verified}function wo(t){return t.app_name}function Ao(t){return t.app_name}function Io(t){return t?.items??[]}function To(t,e){if(t?.hasMore)return e.reduce(Bo,0)}function Bo(t,e){return t+(e?.items?.length??0)}function Fo(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function hl({open:t,onOpenChange:e,defaultTab:n,initialSearch:a="",...i}){const l=Q(),o=i.mode??"add",d="agentId"in i?i.agentId:void 0,c="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,u="onAdd"in i&&i.onAdd?i.onAdd:N=>{},f=(N,A,T)=>{d&&Z("agent_connection_attached",{agent_id:d,connection_id:N,app_name:A,mode:T})},[p,r]=z.useState(null),[m,g]=z.useState(a),[h,x]=z.useState(!1),[b,S]=z.useState(t);t!==b&&(S(t),t&&g(a));const{org:y}=ge(),{data:v}=Ct.useSession(),k=ms(),C=vt(),w=qt(),j=N=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const A=N.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(N,A)=>{Z("connection_oauth_succeeded",{connection_id:N,flow:A});const T=new URL(`/api/${y.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ye.isMCPAuthenticated(T.href,null)}),_()},I=async N=>{r(N.app_name??N.id);try{const T=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,B=(await k.create.mutateAsync({title:T,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,F=await gt({connectionId:B,orgId:y.id,orgSlug:y.slug,persistFallback:$=>k.update.mutateAsync({id:B,data:{connection_token:$}}).then(()=>{})});if(F.ran&&!F.ok){Z("connection_oauth_failed",{connection_id:B,flow:"clone",error:F.error??"no_token"}),oe.error(l("virtualMcp.addConnectionDialog.authenticationFailedError",{error:F.error??"no token received"})),await k.delete.mutateAsync(B);return}F.ran&&await D(B,"clone"),f(B,N.app_name??null,"clone"),u(B)}catch(A){console.error("Failed to add connection:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},E=async N=>{if(!(!y||!v?.user?.id)){r(N.id);try{const A=bn(N,y.id,v.user.id,{remoteIndex:0}),T=A.connection_type==="STDIO",O=!!A.connection_url,B=T&&A.connection_headers&&typeof A.connection_headers=="object"&&"command"in A.connection_headers;if(!O&&!B){oe.error(l("virtualMcp.addConnectionDialog.mcpServerConnectionError")),r(null);return}const{id:F}=await k.create.mutateAsync(A),$=await gt({connectionId:F,orgId:y.id,orgSlug:y.slug,persistFallback:G=>k.update.mutateAsync({id:F,data:{connection_token:G}}).then(()=>{})});if($.ran&&!$.ok){Z("connection_oauth_failed",{connection_id:F,flow:"connect_new",error:$.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:$.error??"no token received"})}),f(F,A.app_name??null,"new"),u(F);return}$.ran?(await D(F,"connect_new"),oe.success(l("virtualMcp.addConnectionDialog.connectedAuthenticated"))):oe.success(l("virtualMcp.addConnectionDialog.connected")),f(F,A.app_name??null,"new"),u(F)}catch(A){console.error("Failed to connect:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToConnect"))}finally{r(null)}}};return s.jsxs(cs,{open:t,onOpenChange:e,children:[s.jsxs(ds,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(us,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(fs,{className:"text-base font-semibold",children:l(o==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(pn,{value:m,onChange:g,placeholder:l("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(He,{className:"size-6 text-muted-foreground"})}),children:s.jsx(_o,{mode:o,agentId:d,addedConnectionIds:c,onAdd:u,onCloneAndAdd:I,onConnectAndAdd:E,connectingItemId:p,search:m,onCreateConnection:()=>x(!0),onBrowseNavigate:j,defaultTab:n})})]}),s.jsx(No,{open:h,onOpenChange:x,onCreated:async N=>{x(!1);const A=await gt({connectionId:N,orgId:y.id,orgSlug:y.slug,persistFallback:T=>k.update.mutateAsync({id:N,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:A.error??"no_token"}),oe.warning(l("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:l("virtualMcp.addConnectionDialog.signInFailedDescription",{error:A.error??"no token received"})}),f(N,null,"custom"),u(N),e(!1);return}A.ran&&await D(N,"custom_create"),f(N,null,"custom"),u(N),e(!1)}})]})}const Rt=new Map;function xl(){const{org:t}=ge(),e=kt(),n=Rn(),a=n.find(x=>x.providerId==="deco"),{data:i,isLoading:l,refetch:o,isFetching:d}=Yt({queryKey:ye.aiProviderCredits(t.id,"deco"),enabled:!!a,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=i?.balanceCents??null,u=c!=null?c/100:null,f=z.useRef(new Map);if(c!=null){const x=Rt.get(t.id);f.current.get(t.id)&&x!=null&&c>x&&Z("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Rt.set(t.id,c),f.current.set(t.id,!0)}const p=!!a,r=c!=null&&c>0,m=c!=null&&c===0,g=c!=null&&c===200,h=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:a?.id??null,balanceCents:c,balanceDollars:u,hasCredits:r,isZeroBalance:m,isInitialFreeCredit:g,hasOnlyDecoProvider:h,isLoading:l,isFetching:d,refetch:o}}const Po=4,Eo="TASK";function Mo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,Po)||Eo}function Lo(t,e){return e==null?null:`${Mo(t)}-${String(e).padStart(2,"0")}`}const $o=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function Oo(t){const e=$o.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function Kt(t){const e=R.c(8),{size:n,className:a}=t,i=n===void 0?16:n;let l;e[0]!==i?(l={width:i,height:i},e[0]=i,e[1]=l):l=e[1];let o;e[2]!==a?(o=X("shrink-0 rounded-full object-cover",a),e[2]=a,e[3]=o):o=e[3];let d;return e[4]!==i||e[5]!==l||e[6]!==o?(d=s.jsx("img",{src:tn,alt:"Super Agent",width:i,height:i,style:l,className:o}),e[4]=i,e[5]=l,e[6]=o,e[7]=d):d=e[7],d}function jl(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(a=>{const i=a.bucket.toLowerCase();return a.siteSlug?.toLowerCase()===n||i===n||i===`deco-assets-${n}`})??null}const zt=()=>0;function Ro(t){const{orgSlug:e,enabled:n=!0,onUpdate:a,onDelete:i,onResync:l}=t,o=z.useRef(a);o.current=a;const d=z.useRef(i);d.current=i;const c=z.useRef(l);c.current=l;const u=z.useRef(null),f=z.useRef(n),p=z.useRef(e);(!u.current||f.current!==n||p.current!==e)&&(f.current=n,p.current=e,u.current=m=>{if(!n||!e)return()=>{};const g=h=>{let x;try{x=JSON.parse(h.data)}catch{return}x.data&&(h.type===Kn?d.current?.(x.data.id):o.current(x.data)),m()};return Un.subscribe(e,g,()=>c.current?.())}),z.useSyncExternalStore(u.current,zt,zt)}function Ko(t,e){return{queryKey:ye.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function zo(){const t=R.c(21),{org:e,locator:n}=ge(),a=vt();let i;t[0]!==n?(i=ye.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const l=i;let o;t[2]!==n||t[3]!==a||t[4]!==l?(o=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.some(g=>g.id===r.id)?m.items.map(g=>g.id===r.id?r:g):[r,...m.items]}),a.invalidateQueries({queryKey:ye.taskBoardActivity(n,r.id)})},t[2]=n,t[3]=a,t[4]=l,t[5]=o):o=t[5];let d,c;t[6]!==a||t[7]!==l?(d=()=>{a.invalidateQueries({queryKey:l})},c=r=>{a.cancelQueries({queryKey:l}),a.setQueryData(l,m=>m&&{...m,items:m.items.filter(g=>g.id!==r)})},t[6]=a,t[7]=l,t[8]=d,t[9]=c):(d=t[8],c=t[9]);let u;t[10]!==e.slug||t[11]!==o||t[12]!==d||t[13]!==c?(u={orgSlug:e.slug,onUpdate:o,onResync:d,onDelete:c},t[10]=e.slug,t[11]=o,t[12]=d,t[13]=c,t[14]=u):u=t[14],Ro(u);let f;t[15]!==a||t[16]!==l?(f=r=>{const m=r.subject,g=r.data.status;a.cancelQueries({queryKey:l}),a.setQueryData(l,h=>h&&{...h,items:h.items.map(x=>x.threads.some(b=>b.threadId===m)?{...x,threads:x.threads.map(b=>b.threadId===m?{...b,status:g}:b)}:x)})},t[15]=a,t[16]=l,t[17]=f):f=t[17];let p;t[18]!==e.slug||t[19]!==f?(p={orgSlug:e.slug,onTaskStatus:f},t[18]=e.slug,t[19]=f,t[20]=p):p=t[20],Hn(p)}function bl(){const t=R.c(9),{locator:e}=ge(),n=kt();let a;t[0]!==e||t[1]!==n?(a=Ko(e,n),t[0]=e,t[1]=n,t[2]=a):a=t[2];const i=Yt(a);zo();let l;t[3]!==i.data?.items?(l=i.data?.items??[],t[3]=i.data?.items,t[4]=l):l=t[4];let o;return t[5]!==i.error||t[6]!==i.isLoading||t[7]!==l?(o={items:l,isLoading:i.isLoading,error:i.error},t[5]=i.error,t[6]=i.isLoading,t[7]=l,t[8]=o):o=t[8],o}function yl(){const t=R.c(70),{org:e,locator:n}=ge(),a=kt(),i=vt(),l=Q();let o;t[0]!==n?(o=ye.taskBoardItems(n),t[0]=n,t[1]=o):o=t[1];const d=o;let c;t[2]!==i||t[3]!==d?(c=()=>i.invalidateQueries({queryKey:d}),t[2]=i,t[3]=d,t[4]=c):c=t[4];const u=c;let f;t[5]!==a?(f=P=>a.call("TASK_BOARD_ITEM_CREATE",P),t[5]=a,t[6]=f):f=t[6];let p;t[7]!==u||t[8]!==f?(p={mutationFn:f,onSuccess:u},t[7]=u,t[8]=f,t[9]=p):p=t[9];const r=Le(p);let m;t[10]!==a?(m=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[10]=a,t[11]=m):m=t[11];let g;t[12]!==i||t[13]!==d?(g=async P=>{await i.cancelQueries({queryKey:d});const K=i.getQueryData(d);return i.setQueryData(d,L=>L&&{...L,items:L.items.map(U=>U.id===P.id?{...U,...P}:U)}),{previous:K}},t[12]=i,t[13]=d,t[14]=g):g=t[14];let h;t[15]!==e?(h=(P,K)=>{K.status==="done"&&Z("task_marked_done",{organization_id:e.id,task_board_item_id:K.id})},t[15]=e,t[16]=h):h=t[16];let x;t[17]!==i||t[18]!==d?(x=(P,K,L)=>{L?.previous&&i.setQueryData(d,L.previous)},t[17]=i,t[18]=d,t[19]=x):x=t[19];let b;t[20]!==u||t[21]!==n||t[22]!==i?(b=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[20]=u,t[21]=n,t[22]=i,t[23]=b):b=t[23];let S;t[24]!==m||t[25]!==g||t[26]!==h||t[27]!==x||t[28]!==b?(S={mutationFn:m,onMutate:g,onSuccess:h,onError:x,onSettled:b},t[24]=m,t[25]=g,t[26]=h,t[27]=x,t[28]=b,t[29]=S):S=t[29];const y=Le(S);let v;t[30]!==a?(v=P=>a.call("TASK_BOARD_ITEM_DELETE",{id:P}),t[30]=a,t[31]=v):v=t[31];let k;t[32]!==u||t[33]!==l?(k=P=>{oe.error(P instanceof Error&&P.message?P.message:l("taskBoard.taskBoard.deleteError")),u()},t[32]=u,t[33]=l,t[34]=k):k=t[34];let C;t[35]!==u||t[36]!==v||t[37]!==k?(C={mutationFn:v,onSuccess:u,onError:k},t[35]=u,t[36]=v,t[37]=k,t[38]=C):C=t[38];const w=Le(C);let j;t[39]!==a?(j=async P=>{const K=await Promise.allSettled(P.map(L=>a.call("TASK_BOARD_ITEM_DELETE",{id:L})));return{total:P.length,failed:K.filter(Vo).length}},t[39]=a,t[40]=j):j=t[40];let _,D;t[41]!==l?(_=P=>{const{total:K,failed:L}=P;L!==0&&oe.error(l("taskBoard.taskBoard.deleteBulkError",{failed:String(L),total:String(K)}))},D=()=>oe.error(l("taskBoard.taskBoard.deleteError")),t[41]=l,t[42]=_,t[43]=D):(_=t[42],D=t[43]);let I;t[44]!==u||t[45]!==j||t[46]!==_||t[47]!==D?(I={mutationFn:j,onSuccess:_,onError:D,onSettled:u},t[44]=u,t[45]=j,t[46]=_,t[47]=D,t[48]=I):I=t[48];const E=Le(I);let N;t[49]!==a?(N=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[49]=a,t[50]=N):N=t[50];let A;t[51]!==u||t[52]!==N?(A={mutationFn:N,onSuccess:u},t[51]=u,t[52]=N,t[53]=A):A=t[53];const T=Le(A);let O;t[54]!==a?(O=P=>a.call("TASK_BOARD_ITEM_RERUN",P),t[54]=a,t[55]=O):O=t[55];let B;t[56]!==u||t[57]!==n||t[58]!==i?(B=(P,K,L)=>{u(),i.invalidateQueries({queryKey:ye.taskBoardActivity(n,L.id)})},t[56]=u,t[57]=n,t[58]=i,t[59]=B):B=t[59];let F;t[60]!==O||t[61]!==B?(F={mutationFn:O,onSettled:B},t[60]=O,t[61]=B,t[62]=F):F=t[62];const $=Le(F);let G;return t[63]!==r||t[64]!==T||t[65]!==w||t[66]!==E||t[67]!==$||t[68]!==y?(G={create:r,update:y,remove:w,removeMany:E,link:T,rerun:$},t[63]=r,t[64]=T,t[65]=w,t[66]=E,t[67]=$,t[68]=y,t[69]=G):G=t[69],G}function Vo(t){return t.status==="rejected"}const Uo=["ended_after_delivery","superseded"];function Ho(t){return!!t&&Uo.includes(t)}function Cl(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function vl(t){return t.failureKind!=="superseded"}function vs(t){return t.threads.some(e=>e.status==="requires_action")}function kl(t){return t.status==="in_review"&&!t.assigneeId}function Nl(t){return vs(t)}function _l(t){return t.status==="in_progress"&&vs(t)?"text-warning animate-pulse":Ns(t.status).iconClassName}function Sl(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!Ho(n.failureKind))?"failed":null}function Dl(t,e,n){const a=t.findIndex(f=>f.id===n),i=e===n?t[a+1]?.id??null:e,l=t.filter(f=>f.id!==n),o=i?l.findIndex(f=>f.id===i):-1,d=o===-1?l.length:o,c=l[d-1],u=l[d];return c&&u?(c.sortOrder+u.sortOrder)/2:c?c.sortOrder+1:u?u.sortOrder-1:0}function wl(t,e){return Array.from({length:e},(n,a)=>t-(e-1-a)*1e-4)}const Go=["archived"],ks={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Qn,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:bs,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Gs,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Yn,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Hs,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:An,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:Us,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Wn,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Ls,iconClassName:"text-muted-foreground"}},qo={icon:bs,iconClassName:"text-muted-foreground"},Qo=ks;function Ns(t){return Qo[t]??qo}function Al(t,e){const n=ks[t];return{label:n?e(n.labelKey):t,visual:Ns(t)}}const Il=["bug","feature","chore","spike","security"],Tl={bug:{labelKey:"taskBoard.config.typeBug",icon:Jn,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Ws,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:Qs,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:qs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Xn,iconClassName:"text-purple-500"}};function jt(t){return Vn.includes(t)}function Bl(t){return wt.filter(e=>t||!jt(e))}function Fl({deliveryEnabled:t,shownLanes:e,occupied:n}){const a=wt.filter(o=>t||!jt(o)||n.includes(o)),i=a.filter(o=>Go.includes(o)||!t&&jt(o)),l=i.filter(o=>!e.includes(o));return{lanes:a.filter(o=>!l.includes(o)),hidden:l,hideable:i}}const Vt="lane:";function Wo(t){return wt.includes(t)}function Pl({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),a=n.startsWith(Vt)?n.slice(Vt.length):e(n);return a!==void 0&&Wo(a)?a:null}const Yo=["none","low","medium","high","urgent"],Ze={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Ft,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:Vs,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Ft,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:zs,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:Ks,iconClassName:"text-destructive"}};function El(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Xo*864e5?"soon":null}const Xo=3;function Ut(t){return`color-mix(in oklab, ${t??zn} var(--user-color-strength), transparent)`}const bt="__unassigned__",yt="__no_repo__",Ke="__any__",_s={assignee:null,priority:null,due:null,tags:[],repo:null,search:""};function Jo(t){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||t.repo!==null||t.search.trim()!==""}function Zo(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(t.repo!==null?1:0)+(t.search.trim()!==""?1:0)}const ea=864e5;function ta(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 Ss(t,e){const n=t.trim();return n===""?!1:e!=null&&Oo(n)===e}function sa(t,e){return t.assigneeId===e?!0:t.assigneeId===xt&&t.assignedBy===e}function Ml(t,e){const n=e.search.trim().toLowerCase();if(n!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(n)&&!Ss(n,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===bt){if(t.assigneeId!==null)return!1}else if(!sa(t,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 a=new Date(t.dueDate).getTime(),i=Date.now();if(e.due==="overdue"&&a>=i||e.due==="today"&&!ta(a,i)||e.due==="week"&&(a<i||a>i+7*ea))return!1}if(e.tags.length>0){const a=t.tags.map(i=>i.id);if(!e.tags.some(i=>a.includes(i)))return!1}if(e.repo!==null){if(e.repo===yt){if(t.repo!=null)return!1}else if(t.repo?.toLowerCase()!==e.repo.toLowerCase())return!1}return!0}const Ht={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function Se(t,e=!1){return X("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",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 na(t){const e=R.c(107),{value:n,members:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx($t,{size:14,className:"shrink-0"}),e[0]=u):u=e[0];let f=u,p;e[1]!==o?(p=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=p):p=e[2];let r=p;if(n===bt){let H;e[3]!==o?(H=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=H):H=e[4],r=H}else if(n===xt){let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Kt,{size:14}),e[5]=H):H=e[5],f=H;let q;e[6]!==o?(q=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=q):q=e[7],r=q}else if(n){let H,q,xe,ee;if(e[8]!==a||e[9]!==n){let De;e[14]!==n?(De=we=>we.userId===n,e[14]=n,e[15]=De):De=e[15],q=a.find(De),H=Lt,xe=q?.user?.image??void 0,ee=Ot(q?.user?.name),e[8]=a,e[9]=n,e[10]=H,e[11]=q,e[12]=xe,e[13]=ee}else H=e[10],q=e[11],xe=e[12],ee=e[13];let Ce;e[16]!==H||e[17]!==xe||e[18]!==ee?(Ce=s.jsx(H,{url:xe,fallback:ee,shape:"circle",size:"2xs"}),e[16]=H,e[17]=xe,e[18]=ee,e[19]=Ce):Ce=e[19],f=Ce;let le;e[20]!==q?.user?.name||e[21]!==o?(le=q?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=q?.user?.name,e[21]=o,e[22]=le):le=e[22],r=le}let m;e[23]!==i?(m=H=>{i(H),c(!1)},e[23]=i,e[24]=m):m=e[24];const g=m,h=n!==null;let x;e[25]!==l||e[26]!==h?(x=Se(h,l),e[25]=l,e[26]=h,e[27]=x):x=e[27];const b=x,S=l&&"ml-auto";let y;e[28]!==S?(y=X("shrink-0 opacity-60",S),e[28]=S,e[29]=y):y=e[29];const v=y;let k;e[30]!==r?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[30]=r,e[31]=k):k=e[31];let C;e[32]!==v?(C=s.jsx(Ve,{size:12,className:v}),e[32]=v,e[33]=C):C=e[33];let w;e[34]!==f||e[35]!==k||e[36]!==C||e[37]!==b?(w=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:b,children:[f,k,C]})}),e[34]=f,e[35]=k,e[36]=C,e[37]=b,e[38]=w):w=e[38];let j;e[39]!==o?(j=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=j):j=e[40];let _;e[41]!==o?(_=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=o,e[42]=_):_=e[42];let D;e[43]!==j||e[44]!==_?(D=s.jsx(At,{placeholder:j,"aria-label":_,className:"h-9"}),e[43]=j,e[44]=_,e[45]=D):D=e[45];let I;e[46]!==o?(I=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=o,e[47]=I):I=e[47];let E;e[48]!==I?(E=s.jsx(It,{children:I}),e[48]=I,e[49]=E):E=e[49];let N;e[50]!==o?(N=o("taskBoard.taskFilters.assigneeAnyone"),e[50]=o,e[51]=N):N=e[51];let A;e[52]!==g?(A=()=>g(null),e[52]=g,e[53]=A):A=e[53];let T;e[54]!==o?(T=o("taskBoard.taskFilters.assigneeAnyone"),e[54]=o,e[55]=T):T=e[55];let O;e[56]!==N||e[57]!==A||e[58]!==T?(O=s.jsx(ve,{value:N,onSelect:A,children:T}),e[56]=N,e[57]=A,e[58]=T,e[59]=O):O=e[59];let B;e[60]!==o?(B=o("taskBoard.taskFilters.assigneeUnassigned"),e[60]=o,e[61]=B):B=e[61];let F;e[62]!==g?(F=()=>g(bt),e[62]=g,e[63]=F):F=e[63];let $;e[64]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx($t,{size:16,className:"text-muted-foreground"}),e[64]=$):$=e[64];let G;e[65]!==o?(G=o("taskBoard.taskFilters.assigneeUnassigned"),e[65]=o,e[66]=G):G=e[66];let P;e[67]!==B||e[68]!==F||e[69]!==G?(P=s.jsxs(ve,{value:B,onSelect:F,className:"gap-2",children:[$,G]}),e[67]=B,e[68]=F,e[69]=G,e[70]=P):P=e[70];let K;e[71]!==o?(K=o("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=o,e[72]=K):K=e[72];let L;e[73]!==g?(L=()=>g(xt),e[73]=g,e[74]=L):L=e[74];let U;e[75]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Kt,{size:16}),e[75]=U):U=e[75];let V;e[76]!==o?(V=o("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=o,e[77]=V):V=e[77];let J;e[78]!==K||e[79]!==L||e[80]!==V?(J=s.jsxs(ve,{value:K,onSelect:L,className:"gap-2",children:[U,V]}),e[78]=K,e[79]=L,e[80]=V,e[81]=J):J=e[81];let W;e[82]!==O||e[83]!==P||e[84]!==J?(W=s.jsxs(qe,{children:[O,P,J]}),e[82]=O,e[83]=P,e[84]=J,e[85]=W):W=e[85];let pe;e[86]!==o?(pe=o("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=o,e[87]=pe):pe=e[87];let te;if(e[88]!==a||e[89]!==g){let H;e[91]!==g?(H=q=>s.jsxs(ve,{value:q.user?.name??q.userId,onSelect:()=>g(q.userId),className:"gap-2",children:[s.jsx(Lt,{url:q.user?.image??void 0,fallback:Ot(q.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:q.user?.name??q.userId})]},q.userId),e[91]=g,e[92]=H):H=e[92],te=a.map(H),e[88]=a,e[89]=g,e[90]=te}else te=e[90];let se;e[93]!==pe||e[94]!==te?(se=s.jsx(qe,{heading:pe,children:te}),e[93]=pe,e[94]=te,e[95]=se):se=e[95];let ae;e[96]!==E||e[97]!==W||e[98]!==se?(ae=s.jsxs(Tt,{children:[E,W,se]}),e[96]=E,e[97]=W,e[98]=se,e[99]=ae):ae=e[99];let ie;e[100]!==D||e[101]!==ae?(ie=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[D,ae]})}),e[100]=D,e[101]=ae,e[102]=ie):ie=e[102];let he;return e[103]!==d||e[104]!==w||e[105]!==ie?(he=s.jsxs(nt,{open:d,onOpenChange:c,children:[w,ie]}),e[103]=d,e[104]=w,e[105]=ie,e[106]=he):he=e[106],he}function oa(t){const e=R.c(33),{value:n,onChange:a,block:i}=t,l=Q(),o=n!==null;let d;e[0]!==i||e[1]!==o?(d=Se(o,i),e[0]=i,e[1]=o,e[2]=d):d=e[2];const c=d,u=i&&"ml-auto";let f;e[3]!==u?(f=X("shrink-0 opacity-60",u),e[3]=u,e[4]=f):f=e[4];const p=f;let r;e[5]!==n?(r=n?s.jsx("span",{className:X("size-2 shrink-0 rounded-full",Ze[n].dotClassName)}):s.jsx(Gn,{size:14,className:"shrink-0"}),e[5]=n,e[6]=r):r=e[6];let m;e[7]!==l||e[8]!==n?(m=l(n?Ze[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=l,e[8]=n,e[9]=m):m=e[9];let g;e[10]!==p?(g=s.jsx(Ve,{size:12,className:p}),e[10]=p,e[11]=g):g=e[11];let h;e[12]!==r||e[13]!==m||e[14]!==g||e[15]!==c?(h=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[r,m,g]})}),e[12]=r,e[13]=m,e[14]=g,e[15]=c,e[16]=h):h=e[16];const x=n??Ke;let b;e[17]!==a?(b=w=>a(w===Ke?null:w),e[17]=a,e[18]=b):b=e[18];let S;e[19]!==l?(S=l("taskBoard.taskFilters.priorityAnyPriority"),e[19]=l,e[20]=S):S=e[20];let y;e[21]!==S?(y=s.jsx(st,{value:Ke,children:S}),e[21]=S,e[22]=y):y=e[22];let v;e[23]!==l?(v=Yo.map(w=>s.jsxs(st,{value:w,className:"gap-2",children:[s.jsx("span",{className:X("size-2 rounded-full",Ze[w].dotClassName)}),l(Ze[w].labelKey)]},w)),e[23]=l,e[24]=v):v=e[24];let k;e[25]!==b||e[26]!==y||e[27]!==v||e[28]!==x?(k=s.jsx(hs,{align:"start",className:"w-40",children:s.jsxs(xs,{value:x,onValueChange:b,children:[y,v]})}),e[25]=b,e[26]=y,e[27]=v,e[28]=x,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==h?(C=s.jsxs(js,{children:[h,k]}),e[30]=k,e[31]=h,e[32]=C):C=e[32],C}function aa(t){const e=R.c(35),{value:n,onChange:a,block:i}=t,l=Q();let o;e[0]!==l||e[1]!==n?(o=n?l(Ht[n]):void 0,e[0]=l,e[1]=n,e[2]=o):o=e[2];const d=o,c=n!==null;let u;e[3]!==i||e[4]!==c?(u=Se(c,i),e[3]=i,e[4]=c,e[5]=u):u=e[5];const f=u,p=i&&"ml-auto";let r;e[6]!==p?(r=X("shrink-0 opacity-60",p),e[6]=p,e[7]=r):r=e[7];const m=r;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ut,{size:14,className:"shrink-0"}),e[8]=g):g=e[8];let h;e[9]!==d||e[10]!==l?(h=d??l("taskBoard.taskFilters.dueDateLabel"),e[9]=d,e[10]=l,e[11]=h):h=e[11];let x;e[12]!==m?(x=s.jsx(Ve,{size:12,className:m}),e[12]=m,e[13]=x):x=e[13];let b;e[14]!==h||e[15]!==x||e[16]!==f?(b=s.jsx(ps,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,children:[g,h,x]})}),e[14]=h,e[15]=x,e[16]=f,e[17]=b):b=e[17];const S=n??Ke;let y;e[18]!==a?(y=D=>a(D===Ke?null:D),e[18]=a,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{size:16,className:"text-muted-foreground"}),e[20]=v):v=e[20];let k;e[21]!==l?(k=l("taskBoard.taskFilters.dueDateAnyTime"),e[21]=l,e[22]=k):k=e[22];let C;e[23]!==k?(C=s.jsxs(st,{value:Ke,className:"gap-2",children:[v,k]}),e[23]=k,e[24]=C):C=e[24];let w;e[25]!==l?(w=Object.entries(Ht).map(D=>{const[I,E]=D,N=I==="overdue";return s.jsxs(st,{value:I,className:X("gap-2",N&&"text-destructive"),children:[s.jsx(ut,{size:16,className:X("shrink-0",N?"text-destructive":"text-muted-foreground")}),l(E)]},I)}),e[25]=l,e[26]=w):w=e[26];let j;e[27]!==S||e[28]!==y||e[29]!==C||e[30]!==w?(j=s.jsx(hs,{align:"start",className:"w-44",children:s.jsxs(xs,{value:S,onValueChange:y,children:[C,w]})}),e[27]=S,e[28]=y,e[29]=C,e[30]=w,e[31]=j):j=e[31];let _;return e[32]!==j||e[33]!==b?(_=s.jsxs(js,{children:[b,j]}),e[32]=j,e[33]=b,e[34]=_):_=e[34],_}function la(t){const e=R.c(56),{value:n,tags:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==i||e[1]!==n?(u=B=>i(n.includes(B)?n.filter(F=>F!==B):[...n,B]),e[0]=i,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==o||e[4]!==a||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?o("taskBoard.taskFilters.tagsLabel"):n.length===1?a.find(B=>B.id===n[0])?.name??o("taskBoard.taskFilters.tagsLabel"):o("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=o,e[4]=a,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const r=p,m=n.length>0;let g;e[8]!==l||e[9]!==m?(g=Se(m,l),e[8]=l,e[9]=m,e[10]=g):g=e[10];const h=g,x=l&&"ml-auto";let b;e[11]!==x?(b=X("shrink-0 opacity-60",x),e[11]=x,e[12]=b):b=e[12];const S=b;let y;e[13]!==a||e[14]!==n[0]||e[15]!==n.length?(y=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(a.find(B=>B.id===n[0])?.color)}}):s.jsx(Ys,{size:14,className:"shrink-0"}),e[13]=a,e[14]=n[0],e[15]=n.length,e[16]=y):y=e[16];let v;e[17]!==r?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=v):v=e[18];let k;e[19]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[19]=S,e[20]=k):k=e[20];let C;e[21]!==y||e[22]!==v||e[23]!==k||e[24]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[21]=y,e[22]=v,e[23]=k,e[24]=h,e[25]=C):C=e[25];let w;e[26]!==o?(w=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=o,e[27]=w):w=e[27];let j;e[28]!==o?(j=o("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=o,e[29]=j):j=e[29];let _;e[30]!==w||e[31]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[30]=w,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==o?(D=o("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=o,e[34]=D):D=e[34];let I;e[35]!==D?(I=s.jsx(It,{children:D}),e[35]=D,e[36]=I):I=e[36];let E;if(e[37]!==a||e[38]!==f||e[39]!==n){let B;e[41]!==f||e[42]!==n?(B=F=>s.jsxs(ve,{value:F.name,onSelect:()=>f(F.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ut(F.color)}}),s.jsx("span",{className:"flex-1 truncate",children:F.name}),n.includes(F.id)&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},F.id),e[41]=f,e[42]=n,e[43]=B):B=e[43],E=a.map(B),e[37]=a,e[38]=f,e[39]=n,e[40]=E}else E=e[40];let N;e[44]!==E?(N=s.jsx(qe,{children:E}),e[44]=E,e[45]=N):N=e[45];let A;e[46]!==I||e[47]!==N?(A=s.jsxs(Tt,{children:[I,N]}),e[46]=I,e[47]=N,e[48]=A):A=e[48];let T;e[49]!==_||e[50]!==A?(T=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[_,A]})}),e[49]=_,e[50]=A,e[51]=T):T=e[51];let O;return e[52]!==d||e[53]!==C||e[54]!==T?(O=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,T]}),e[52]=d,e[53]=C,e[54]=T,e[55]=O):O=e[55],O}function ia(t){const e=R.c(73),{value:n,repos:a,onChange:i,block:l}=t,o=Q(),[d,c]=z.useState(!1);let u;e[0]!==o||e[1]!==n?(u=n===null?o("taskBoard.taskFilters.repoLabel"):n===yt?o("taskBoard.taskFilters.repoNoRepo"):n,e[0]=o,e[1]=n,e[2]=u):u=e[2];const f=u;let p;e[3]!==i?(p=J=>{i(J),c(!1)},e[3]=i,e[4]=p):p=e[4];const r=p,m=n!==null;let g;e[5]!==l||e[6]!==m?(g=Se(m,l),e[5]=l,e[6]=m,e[7]=g):g=e[7];const h=g,x=l&&"ml-auto";let b;e[8]!==x?(b=X("shrink-0 opacity-60",x),e[8]=x,e[9]=b):b=e[9];const S=b;let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ht,{className:"size-3.5 shrink-0"}),e[10]=y):y=e[10];let v;e[11]!==f?(v=s.jsx("span",{className:"max-w-[12rem] truncate",children:f}),e[11]=f,e[12]=v):v=e[12];let k;e[13]!==S?(k=s.jsx(Ve,{size:12,className:S}),e[13]=S,e[14]=k):k=e[14];let C;e[15]!==v||e[16]!==k||e[17]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,v,k]})}),e[15]=v,e[16]=k,e[17]=h,e[18]=C):C=e[18];let w;e[19]!==o?(w=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[19]=o,e[20]=w):w=e[20];let j;e[21]!==o?(j=o("taskBoard.taskFilters.repoFilterPlaceholder"),e[21]=o,e[22]=j):j=e[22];let _;e[23]!==w||e[24]!==j?(_=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[23]=w,e[24]=j,e[25]=_):_=e[25];let D;e[26]!==o?(D=o("taskBoard.taskFilters.repoNoReposFound"),e[26]=o,e[27]=D):D=e[27];let I;e[28]!==D?(I=s.jsx(It,{children:D}),e[28]=D,e[29]=I):I=e[29];let E;e[30]!==o?(E=o("taskBoard.taskFilters.repoAnyRepo"),e[30]=o,e[31]=E):E=e[31];let N;e[32]!==r?(N=()=>r(null),e[32]=r,e[33]=N):N=e[33];let A;e[34]!==o?(A=o("taskBoard.taskFilters.repoAnyRepo"),e[34]=o,e[35]=A):A=e[35];let T;e[36]!==E||e[37]!==N||e[38]!==A?(T=s.jsx(ve,{value:E,onSelect:N,children:A}),e[36]=E,e[37]=N,e[38]=A,e[39]=T):T=e[39];let O;e[40]!==o?(O=o("taskBoard.taskFilters.repoNoRepo"),e[40]=o,e[41]=O):O=e[41];let B;e[42]!==r?(B=()=>r(yt),e[42]=r,e[43]=B):B=e[43];let F;e[44]!==o?(F=o("taskBoard.taskFilters.repoNoRepo"),e[44]=o,e[45]=F):F=e[45];let $;e[46]!==O||e[47]!==B||e[48]!==F?($=s.jsx(ve,{value:O,onSelect:B,children:F}),e[46]=O,e[47]=B,e[48]=F,e[49]=$):$=e[49];let G;e[50]!==T||e[51]!==$?(G=s.jsxs(qe,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=G):G=e[52];let P;if(e[53]!==a||e[54]!==r||e[55]!==n){let J;e[57]!==r||e[58]!==n?(J=W=>s.jsxs(ve,{value:W,onSelect:()=>r(W),className:"gap-2",children:[s.jsx(ht,{className:"size-4 shrink-0"}),s.jsx("span",{className:"flex-1 truncate",children:W}),n===W&&s.jsx(Ge,{size:14,className:"shrink-0 text-foreground"})]},W),e[57]=r,e[58]=n,e[59]=J):J=e[59],P=a.map(J),e[53]=a,e[54]=r,e[55]=n,e[56]=P}else P=e[56];let K;e[60]!==P?(K=s.jsx(qe,{children:P}),e[60]=P,e[61]=K):K=e[61];let L;e[62]!==I||e[63]!==G||e[64]!==K?(L=s.jsxs(Tt,{children:[I,G,K]}),e[62]=I,e[63]=G,e[64]=K,e[65]=L):L=e[65];let U;e[66]!==_||e[67]!==L?(U=s.jsx(ot,{align:"start",className:"w-64 p-0",children:s.jsxs(Bt,{children:[_,L]})}),e[66]=_,e[67]=L,e[68]=U):U=e[68];let V;return e[69]!==d||e[70]!==C||e[71]!==U?(V=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,U]}),e[69]=d,e[70]=C,e[71]=U,e[72]=V):V=e[72],V}function ra(t){const e=R.c(25),{value:n,onChange:a,block:i}=t,l=Q(),[o,d]=z.useState(n!==""),[c,u]=z.useState(!1),[f,p]=z.useState(n);n!==f&&(p(n),n===""&&!c&&d(!1));const r=o||i,m=r?"w-32 sm:w-44":"w-8 px-0 justify-center",g=i&&"h-10 w-full px-3 text-sm sm:w-full";let h;e[0]!==m||e[1]!==g?(h=X("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",m,g),e[0]=m,e[1]=g,e[2]=h):h=e[2];let x;e[3]!==l?(x=l("taskBoard.taskFilters.searchLabel"),e[3]=l,e[4]=x):x=e[4];let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>d(!0),e[5]=b):b=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Xs,{size:14}),e[6]=S):S=e[6];let y;e[7]!==x?(y=s.jsx("button",{type:"button","aria-label":x,onClick:b,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=y):y=e[8];let v;e[9]!==i||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==n?(v=r&&s.jsx("input",{autoFocus:!i,value:n,onChange:w=>a(w.target.value),onFocus:()=>u(!0),onBlur:()=>{u(!1),n===""&&d(!1)},placeholder:l("taskBoard.taskFilters.searchPlaceholder"),"aria-label":l("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=i,e[10]=r,e[11]=a,e[12]=l,e[13]=n,e[14]=v):v=e[14];let k;e[15]!==i||e[16]!==a||e[17]!==l||e[18]!==n?(k=n!==""&&s.jsx("button",{type:"button","aria-label":l("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ca,onClick:()=>{a(""),i||d(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx($s,{size:14})}),e[15]=i,e[16]=a,e[17]=l,e[18]=n,e[19]=k):k=e[19];let C;return e[20]!==h||e[21]!==y||e[22]!==v||e[23]!==k?(C=s.jsxs("div",{className:h,children:[y,v,k]}),e[20]=h,e[21]=y,e[22]=v,e[23]=k,e[24]=C):C=e[24],C}function ca(t){return t.preventDefault()}function da(t){const e=R.c(20),{block:n,onClick:a}=t,i=Q();let l;e[0]!==i?(l=i("taskBoard.taskFilters.boardSettingsLabel"),e[0]=i,e[1]=l):l=e[1];const o=l;let d;e[2]!==n?(d=X(Se(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(qn,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let u;e[5]!==n||e[6]!==o?(u=n&&s.jsx("span",{children:o}),e[5]=n,e[6]=o,e[7]=u):u=e[7];let f;e[8]!==o||e[9]!==a||e[10]!==d||e[11]!==u?(f=s.jsxs("button",{type:"button",onClick:a,"aria-label":o,className:d,children:[c,u]}),e[8]=o,e[9]=a,e[10]=d,e[11]=u,e[12]=f):f=e[12];const p=f;if(n)return p;let r;e[13]!==p?(r=s.jsx($e,{asChild:!0,children:p}),e[13]=p,e[14]=r):r=e[14];let m;e[15]!==o?(m=s.jsx(Oe,{side:"top",children:o}),e[15]=o,e[16]=m):m=e[16];let g;return e[17]!==r||e[18]!==m?(g=s.jsxs(Re,{children:[r,m]}),e[17]=r,e[18]=m,e[19]=g):g=e[19],g}function Ds(t){const e=R.c(53),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d,block:c}=t;let u;e[0]!==n||e[1]!==o?(u=C=>o({...n,search:C}),e[0]=n,e[1]=o,e[2]=u):u=e[2];let f;e[3]!==c||e[4]!==n.search||e[5]!==u?(f=s.jsx(ra,{block:c,value:n.search,onChange:u}),e[3]=c,e[4]=n.search,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==n||e[8]!==o?(p=C=>o({...n,assignee:C}),e[7]=n,e[8]=o,e[9]=p):p=e[9];let r;e[10]!==c||e[11]!==n.assignee||e[12]!==a||e[13]!==p?(r=s.jsx(na,{block:c,value:n.assignee,members:a,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=a,e[13]=p,e[14]=r):r=e[14];let m;e[15]!==n||e[16]!==o?(m=C=>o({...n,priority:C}),e[15]=n,e[16]=o,e[17]=m):m=e[17];let g;e[18]!==c||e[19]!==n.priority||e[20]!==m?(g=s.jsx(oa,{block:c,value:n.priority,onChange:m}),e[18]=c,e[19]=n.priority,e[20]=m,e[21]=g):g=e[21];let h;e[22]!==n||e[23]!==o?(h=C=>o({...n,due:C}),e[22]=n,e[23]=o,e[24]=h):h=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==h?(x=s.jsx(aa,{block:c,value:n.due,onChange:h}),e[25]=c,e[26]=n.due,e[27]=h,e[28]=x):x=e[28];let b;e[29]!==n||e[30]!==o?(b=C=>o({...n,tags:C}),e[29]=n,e[30]=o,e[31]=b):b=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==b||e[35]!==i?(S=s.jsx(la,{block:c,value:n.tags,tags:i,onChange:b}),e[32]=c,e[33]=n.tags,e[34]=b,e[35]=i,e[36]=S):S=e[36];let y;e[37]!==c||e[38]!==n||e[39]!==o||e[40]!==l?(y=(l.length>0||n.repo!==null)&&s.jsx(ia,{block:c,value:n.repo,repos:l,onChange:C=>o({...n,repo:C})}),e[37]=c,e[38]=n,e[39]=o,e[40]=l,e[41]=y):y=e[41];let v;e[42]!==c||e[43]!==d?(v=s.jsx(da,{block:c,onClick:d}),e[42]=c,e[43]=d,e[44]=v):v=e[44];let k;return e[45]!==S||e[46]!==y||e[47]!==v||e[48]!==f||e[49]!==r||e[50]!==g||e[51]!==x?(k=s.jsxs(s.Fragment,{children:[f,r,g,x,S,y,v]}),e[45]=S,e[46]=y,e[47]=v,e[48]=f,e[49]=r,e[50]=g,e[51]=x,e[52]=k):k=e[52],k}function Ll(t){const e=R.c(15),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(gs,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=u):u=e[0];let f;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==d||e[5]!==l||e[6]!==i?(f=s.jsx(Ds,{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}),e[1]=n,e[2]=a,e[3]=o,e[4]=d,e[5]=l,e[6]=i,e[7]=f):f=e[7];let p;e[8]!==n||e[9]!==o||e[10]!==c?(p=Jo(n)&&s.jsx("button",{type:"button",onClick:()=>o(_s),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=o,e[10]=c,e[11]=p):p=e[11];let r;return e[12]!==f||e[13]!==p?(r=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u,f,p]}),e[12]=f,e[13]=p,e[14]=r):r=e[14],r}function $l(t){const e=R.c(41),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q(),[u,f]=z.useState(!1),p=Zo(n),r=p>0;let m;e[0]!==r?(m=Se(r),e[0]=r,e[1]=m):m=e[1];const g=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(gs,{size:14,className:"shrink-0"}),e[2]=h):h=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let b;e[5]!==p?(b=p>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:p}),e[5]=p,e[6]=b):b=e[6];let S;e[7]!==x||e[8]!==b||e[9]!==g?(S=s.jsx(ln,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[h,x,b]})}),e[7]=x,e[8]=b,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==c?(y=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=y):y=e[12];let v;e[13]!==y?(v=s.jsx(Dt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=v):v=e[14];let k;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==d||e[19]!==l||e[20]!==i?(k=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Ds,{block:!0,filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d})}),e[15]=n,e[16]=a,e[17]=o,e[18]=d,e[19]=l,e[20]=i,e[21]=k):k=e[21];let C;e[22]!==p||e[23]!==o||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>o(_s),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=o,e[24]=c,e[25]=C):C=e[25];let w;e[26]!==c?(w=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=w):w=e[27];let j;e[28]!==w?(j=s.jsx(ss,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:w})}),e[28]=w,e[29]=j):j=e[29];let _;e[30]!==C||e[31]!==j?(_=s.jsxs(ns,{className:"flex-row gap-2",children:[C,j]}),e[30]=C,e[31]=j,e[32]=_):_=e[32];let D;e[33]!==_||e[34]!==v||e[35]!==k?(D=s.jsxs(St,{className:"p-0",children:[v,k,_]}),e[33]=_,e[34]=v,e[35]=k,e[36]=D):D=e[36];let I;return e[37]!==u||e[38]!==D||e[39]!==S?(I=s.jsxs(_t,{open:u,onOpenChange:f,direction:"bottom",children:[S,D]}),e[37]=u,e[38]=D,e[39]=S,e[40]=I):I=e[40],I}function Ol(t,e){return Lo(t,e.keySeq)??e.id}function Rl(t,e){const n=e?.trim();if(n)return t.find(a=>Ss(n,a.keySeq))??t.find(a=>a.id===n)}export{hl as A,wl as B,Fl as C,Sl as D,_s as E,Nl as F,Dl as G,Pl as H,Ml as I,Go as J,El as K,Vt as L,Co as M,pl as N,Ze as P,Kt as S,Tl as T,Ol as a,kl as b,Ko as c,ml as d,gl as e,zo as f,yl as g,Yo as h,vs as i,Il as j,Ut as k,Al as l,jl as m,Ns as n,Bl as o,Cl as p,vl as q,Ho as r,_l as s,Lo as t,xl as u,ks as v,bl as w,Rl as x,$l as y,Ll as z};
@@ -0,0 +1 @@
1
+ import{c as N,r as J,j as a,l as W,B as H,W as U,a7 as z,K as G,m as V,n as te,e as se,b as K,b6 as ie,t as q,dr as Z,ds as Q,dq as re,P as X,dt as fe,p as ue}from"./index-B1NfLh28.js";import{I as ee}from"./input-6kxANu4D.js";import{i as oe}from"./Check-CViV2AKw.js";import{i as ce}from"./ChevronSelectorVertical-DYY47Opi.js";import{s as ge}from"./Plus-Dy3OwbdP.js";import{s as pe}from"./Trash01-B-u_-iqS.js";import{a as xe,c as je,d as he,e as be,b as ye,C as Se}from"./command-DYMcXrYb.js";import{a as ve,P as Ne,b as Te}from"./popover-CiSRUL8W.js";import{S as we}from"./switch-RffCohYW.js";import{T as de}from"./textarea-D69PAPp0.js";import{c as _e,d as Ce,b as Pe,f as Ae,g as ke,e as Ie,a as Re,A as Ee}from"./alert-dialog-FC7tFvol.js";import{R as Oe,A as $e}from"./review-settings-CVRC6VQz.js";import{f as De}from"./task-board-Cpu4KbdQ.js";import{R as Be}from"./require-capability-Bzaxi0tw.js";import"./index-C-AVMdC1.js";import"./dialog-_eOGpV_R.js";import"./SearchMd-GhWQt9H_.js";import"./UserSquare-BeyEkA5D.js";import"./GitBranch01-Cw03iCHW.js";import"./use-organization-settings-CVRBbGpW.js";import"./constants-DNuUCxmW.js";import"./schema-BMBwySNw.js";import"./access-gate-YwNE0EiY.js";import"./capability-load-error-o4hp9_9S.js";function Fe(t){const e=N.c(41),{options:n,value:s,onChange:i,placeholder:l,triggerClassName:r,contentClassName:o,width:u,renderTrigger:f,renderItem:d,emptyMessage:c,searchPlaceholder:m,filter:g}=t,p=l===void 0?"Select...":l,b=u===void 0?"w-[200px]":u,j=c===void 0?"No results found.":c,x=m===void 0?"Search...":m;let h;e[0]!==s?(h=L=>L.value===s,e[0]=s,e[1]=h):h=e[1];const y=n.find(h),[S,v]=J.useState(!1),T=Ne,w=ve,P=!0,_=f?a.jsx("div",{className:W("cursor-pointer",r),children:f(y)}):a.jsxs(H,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let C;e[2]!==w||e[3]!==_?(C=a.jsx(w,{asChild:P,children:_}),e[2]=w,e[3]=_,e[4]=C):C=e[4];let A;e[5]!==o?(A=W("p-0",o),e[5]=o,e[6]=A):A=e[6];let D;e[7]===Symbol.for("react.memo_cache_sentinel")?(D={width:"var(--radix-popover-trigger-width)"},e[7]=D):D=e[7];let B;e[8]!==x?(B=a.jsx(xe,{placeholder:x,className:"h-9"}),e[8]=x,e[9]=B):B=e[9];let I;e[10]!==j?(I=a.jsx(je,{children:j}),e[10]=j,e[11]=I):I=e[11];let R;if(e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==v||e[16]!==s){let L;e[18]!==i||e[19]!==d||e[20]!==v||e[21]!==s?(L=k=>{const ne=s===k.value;return a.jsx(he,{value:k.label,onSelect:()=>{i(k.value===s?"":k.value),v(!1)},children:d?d(k,ne):a.jsxs(a.Fragment,{children:[k.label,a.jsx(oe,{className:W("ml-auto",ne?"opacity-100":"opacity-0")})]})},k.value)},e[18]=i,e[19]=d,e[20]=v,e[21]=s,e[22]=L):L=e[22],R=n.map(L),e[12]=i,e[13]=n,e[14]=d,e[15]=v,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(be,{children:R}),e[23]=R,e[24]=E):E=e[24];let M;e[25]!==I||e[26]!==E?(M=a.jsxs(ye,{children:[I,E]}),e[25]=I,e[26]=E,e[27]=M):M=e[27];let O;e[28]!==g||e[29]!==B||e[30]!==M?(O=a.jsxs(Se,{filter:g,children:[B,M]}),e[28]=g,e[29]=B,e[30]=M,e[31]=O):O=e[31];let $;e[32]!==O||e[33]!==A?($=a.jsx(Te,{className:A,style:D,children:O}),e[32]=O,e[33]=A,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==S||e[37]!==v||e[38]!==$||e[39]!==C?(F=a.jsxs(T,{open:S,onOpenChange:v,children:[C,$]}),e[35]=T,e[36]=S,e[37]=v,e[38]=$,e[39]=C,e[40]=F):F=e[40],F}function Le(t){const e=N.c(4),{size:n,className:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0z"}),e[0]=i):i=e[0];let l;return e[1]!==s||e[2]!==n?(l=a.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:i}),e[1]=s,e[2]=n,e[3]=l):l=e[3],l}function me(t){const e=t.projectName?.replace(/\s+/g," ").trim(),n=t.name.trim();return e?{primary:e,secondary:[n,t.projectKey].filter(Boolean).join(" · ")}:{primary:n,secondary:t.projectKey??""}}function qe(t){const{primary:e,secondary:n}=me(t);return[e,n,`#${t.id}`].filter(Boolean).join(" ")}function ae(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const n=ae(e).trim();if(!n)return 1;const s=ae(t);return n.split(/\s+/).every(i=>s.includes(i))?1:0}function Me(){const t=N.c(7),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=n,t[3]=i):i=t[3];let l;return t[4]!==s||t[5]!==i?(l={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6],V(l)}function le(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>(await n.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Je(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=()=>n.call("JIRA_INTEGRATION_DELETE",{}),t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Ue(t){const e=N.c(8),{org:n}=U(),s=z();let i;e[0]!==n.id?(i=G.jiraBoards(n.id),e[0]=n.id,e[1]=i):i=e[1];let l;e[2]!==s?(l=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==i||e[6]!==l?(r={queryKey:i,enabled:t,staleTime:6e4,queryFn:l},e[4]=t,e[5]=i,e[6]=l,e[7]=r):r=e[7],V(r)}function ze(t){const e=N.c(10),{org:n}=U(),s=z();let i;e[0]!==t||e[1]!==n.id?(i=G.jiraBoardColumns(n.id,t),e[0]=t,e[1]=n.id,e[2]=i):i=e[2];const l=t!==null;let r;e[3]!==t||e[4]!==s?(r=async()=>(await s.call("JIRA_BOARD_COLUMNS_LIST",{boardId:t??""})).columns,e[3]=t,e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==i||e[7]!==l||e[8]!==r?(o={queryKey:i,enabled:l,staleTime:6e4,queryFn:r},e[6]=i,e[7]=l,e[8]=r,e[9]=o):o=e[9],V(o)}function Ge(){const t=N.c(7),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.jiraAutomations(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("JIRA_AUTOMATION_LIST",{})).automations,t[2]=n,t[3]=i):i=t[3];let l;return t[4]!==s||t[5]!==i?(l={queryKey:s,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6],V(l)}function He(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>{if(o.prompt===null){await n.call("JIRA_AUTOMATION_DELETE",{jiraStatus:o.jiraStatus});return}await n.call("JIRA_AUTOMATION_UPSERT",{jiraStatus:o.jiraStatus,prompt:o.prompt.trim()===""?void 0:o.prompt})},t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.jiraAutomations(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Qe(){const t=N.c(12),{org:e}=U(),n=z();let s;t[0]!==e.id?(s=G.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let i;t[2]!==n?(i=async()=>(await n.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=n,t[3]=i):i=t[3];let l;t[4]!==s||t[5]!==i?(l={queryKey:s,staleTime:6e4,queryFn:i},t[4]=s,t[5]=i,t[6]=l):l=t[6];const r=V(l);let o;t[7]!==r.data?(o=r.data?.find(We)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let u;return t[9]!==r.isPending||t[10]!==o?(u={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=u):u=t[11],u}function We(t){return t.columnKey===null}function Ve(){const t=N.c(8),{org:e}=U(),n=z(),s=te();let i;t[0]!==n?(i=async o=>{const u=o.trim();if(!u){await n.call("TASK_BOARD_PROMPT_DELETE",{});return}await n.call("TASK_BOARD_PROMPT_UPSERT",{prompt:u})},t[0]=n,t[1]=i):i=t[1];let l;t[2]!==e||t[3]!==s?(l=()=>s.invalidateQueries({queryKey:G.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=l):l=t[4];let r;return t[5]!==i||t[6]!==l?(r={mutationFn:i,onSettled:l},t[5]=i,t[6]=l,t[7]=r):r=t[7],se(r)}function Ye(){const t=N.c(16),e=K(),{prompt:n,isPending:s}=Qe(),i=Ve(),[l,r]=J.useState(n),[o,u]=J.useState(n);o!==n&&(u(n),r(n));let f;t[0]!==e?(f=e("settings.taskPrompt.title"),t[0]=e,t[1]=f):f=t[1];let d;t[2]!==e?(d=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=d):d=t[3];let c;t[4]!==l||t[5]!==s||t[6]!==n||t[7]!==i||t[8]!==e?(c=s?a.jsx(ie,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(de,{value:l,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(H,{size:"sm",disabled:l===n||i.isPending,onClick:()=>i.mutate(l,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=l,t[5]=s,t[6]=n,t[7]=i,t[8]=e,t[9]=c):c=t[9];let m;t[10]!==d||t[11]!==c?(m=a.jsx(Z,{children:a.jsx(Q,{title:d,children:c})}),t[10]=d,t[11]=c,t[12]=m):m=t[12];let g;return t[13]!==f||t[14]!==m?(g=a.jsx(re,{title:f,children:m}),t[13]=f,t[14]=m,t[15]=g):g=t[15],g}function Y(t,e){return t instanceof Error?t.message:e}const Xe="https://id.atlassian.com/manage-profile/security/api-tokens";function Ze(t){const e=N.c(7),{stepKeys:n}=t,s=K();let i;if(e[0]!==n||e[1]!==s){let r;e[3]!==s?(r=o=>a.jsx("li",{children:s(o)},o),e[3]=s,e[4]=r):r=e[4],i=n.map(r),e[0]=n,e[1]=s,e[2]=i}else i=e[2];let l;return e[5]!==i?(l=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:i}),e[5]=i,e[6]=l):l=e[6],l}function et(){const t=N.c(69),e=K(),n=le(),[s,i]=J.useState(""),[l,r]=J.useState(""),[o,u]=J.useState("");let f;t[0]!==o||t[1]!==l||t[2]!==s?(f=s.trim()!==""&&l.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=l,t[2]=s,t[3]=f):f=t[3];const d=f;let c;t[4]!==e?(c=e("settings.jira.siteLabel"),t[4]=e,t[5]=c):c=t[5];let m;t[6]!==c?(m=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c}),t[6]=c,t[7]=m):m=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=k=>i(k.target.value),t[8]=g):g=t[8];let p;t[9]!==e?(p=e("settings.jira.sitePlaceholder"),t[9]=e,t[10]=p):p=t[10];let b;t[11]!==s||t[12]!==p?(b=a.jsx(ee,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let j;t[14]!==m||t[15]!==b?(j=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,b]}),t[14]=m,t[15]=b,t[16]=j):j=t[16];let x;t[17]!==e?(x=e("settings.jira.emailLabel"),t[17]=e,t[18]=x):x=t[18];let h;t[19]!==x?(h=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:x}),t[19]=x,t[20]=h):h=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=k=>r(k.target.value),t[21]=y):y=t[21];let S;t[22]!==e?(S=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=S):S=t[23];let v;t[24]!==l||t[25]!==S?(v=a.jsx(ee,{value:l,onChange:y,placeholder:S,autoComplete:"off"}),t[24]=l,t[25]=S,t[26]=v):v=t[26];let T;t[27]!==v||t[28]!==h?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,v]}),t[27]=v,t[28]=h,t[29]=T):T=t[29];let w;t[30]!==e?(w=e("settings.jira.tokenLabel"),t[30]=e,t[31]=w):w=t[31];let P;t[32]!==w?(P=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),t[32]=w,t[33]=P):P=t[33];let _;t[34]!==e?(_=e("settings.jira.createTokenLink"),t[34]=e,t[35]=_):_=t[35];let C;t[36]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(ue,{size:12}),t[36]=C):C=t[36];let A;t[37]!==_?(A=a.jsxs("a",{href:Xe,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[_,C]}),t[37]=_,t[38]=A):A=t[38];let D;t[39]!==P||t[40]!==A?(D=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,A]}),t[39]=P,t[40]=A,t[41]=D):D=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=k=>u(k.target.value),t[42]=B):B=t[42];let I;t[43]!==e?(I=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=I):I=t[44];let R;t[45]!==o||t[46]!==I?(R=a.jsx(ee,{type:"password",value:o,onChange:B,placeholder:I,autoComplete:"off"}),t[45]=o,t[46]=I,t[47]=R):R=t[47];let E;t[48]!==D||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[D,R]}),t[48]=D,t[49]=R,t[50]=E):E=t[50];const M=!d||n.isPending;let O;t[51]!==o||t[52]!==l||t[53]!==s||t[54]!==e||t[55]!==n?(O=()=>n.mutate({siteUrl:s.trim(),email:l.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:k=>q.error(Y(k,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=l,t[53]=s,t[54]=e,t[55]=n,t[56]=O):O=t[56];let $;t[57]!==e||t[58]!==n.isPending?($=n.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=n.isPending,t[59]=$):$=t[59];let F;t[60]!==M||t[61]!==O||t[62]!==$?(F=a.jsx(H,{size:"sm",className:"w-fit",disabled:M,onClick:O,children:$}),t[60]=M,t[61]=O,t[62]=$,t[63]=F):F=t[63];let L;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==j?(L=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[j,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=j,t[68]=L):L=t[68],L}function tt(t){const e=N.c(44),{integration:n}=t,s=K(),i=Je(),[l,r]=J.useState(!1),o=n.siteUrl,u=n.email;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>r(!0),e[0]=f):f=e[0];let d;e[1]!==s?(d=s("settings.jira.disconnect"),e[1]=s,e[2]=d):d=e[2];let c;e[3]!==d?(c=a.jsx(H,{variant:"outline",size:"sm",onClick:f,children:d}),e[3]=d,e[4]=c):c=e[4];let m;e[5]!==n.email||e[6]!==n.siteUrl||e[7]!==c?(m=a.jsx(Q,{title:o,description:u,action:c}),e[5]=n.email,e[6]=n.siteUrl,e[7]=c,e[8]=m):m=e[8];let g;e[9]!==s?(g=s("settings.jira.disconnectTitle"),e[9]=s,e[10]=g):g=e[10];let p;e[11]!==g?(p=a.jsx(_e,{children:g}),e[11]=g,e[12]=p):p=e[12];let b;e[13]!==s?(b=s("settings.jira.disconnectDescription"),e[13]=s,e[14]=b):b=e[14];let j;e[15]!==b?(j=a.jsx(Ce,{children:b}),e[15]=b,e[16]=j):j=e[16];let x;e[17]!==j||e[18]!==p?(x=a.jsxs(Pe,{children:[p,j]}),e[17]=j,e[18]=p,e[19]=x):x=e[19];let h;e[20]!==s?(h=s("settings.jira.cancel"),e[20]=s,e[21]=h):h=e[21];let y;e[22]!==h?(y=a.jsx(Ae,{children:h}),e[22]=h,e[23]=y):y=e[23];let S;e[24]!==i||e[25]!==s?(S=()=>i.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:A=>q.error(Y(A,s("settings.jira.saveFailed")))}),e[24]=i,e[25]=s,e[26]=S):S=e[26];let v;e[27]!==s?(v=s("settings.jira.disconnect"),e[27]=s,e[28]=v):v=e[28];let T;e[29]!==S||e[30]!==v?(T=a.jsx(ke,{onClick:S,children:v}),e[29]=S,e[30]=v,e[31]=T):T=e[31];let w;e[32]!==y||e[33]!==T?(w=a.jsxs(Ie,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=w):w=e[34];let P;e[35]!==x||e[36]!==w?(P=a.jsxs(Re,{children:[x,w]}),e[35]=x,e[36]=w,e[37]=P):P=e[37];let _;e[38]!==l||e[39]!==P?(_=a.jsx(Ee,{open:l,onOpenChange:r,children:P}),e[38]=l,e[39]=P,e[40]=_):_=e[40];let C;return e[41]!==_||e[42]!==m?(C=a.jsxs(a.Fragment,{children:[m,_]}),e[41]=_,e[42]=m,e[43]=C):C=e[43],C}function st(t){const e=N.c(36),{integration:n}=t,s=K(),i=le(),l=Ue(!0);let r,o;e[0]!==l.data||e[1]!==n.boardId||e[2]!==n.boardName?(r=(l.data??[]).map(lt),o=n.boardId?r.find(y=>y.value===n.boardId)?.primary??n.boardName??n.boardId:null,e[0]=l.data,e[1]=n.boardId,e[2]=n.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const u=o;let f;e[5]!==s?(f=s("settings.jira.boardLabel"),e[5]=s,e[6]=f):f=e[6];let d;e[7]!==s?(d=s("settings.jira.boardDescription"),e[7]=s,e[8]=d):d=e[8];const c=n.boardId??"";let m;e[9]!==s?(m=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=m):m=e[10];let g;e[11]!==s?(g=s("settings.jira.boardSearchPlaceholder"),e[11]=s,e[12]=g):g=e[12];let p;e[13]!==l.isPending||e[14]!==s?(p=l.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=l.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==u||e[17]!==s?(b=()=>a.jsxs(H,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:u??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=u,e[17]=s,e[18]=b):b=e[18];let j;e[19]!==r||e[20]!==n.boardId||e[21]!==s||e[22]!==i?(j=y=>{!y||y===n.boardId||i.mutate({boardId:y,boardName:r.find(S=>S.value===y)?.primary??null},{onError:S=>q.error(Y(S,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=n.boardId,e[21]=s,e[22]=i,e[23]=j):j=e[23];let x;e[24]!==r||e[25]!==c||e[26]!==m||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==j?(x=a.jsx(Fe,{options:r,value:c,width:"w-72",triggerClassName:"shrink-0",placeholder:m,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:it,onChange:j}),e[24]=r,e[25]=c,e[26]=m,e[27]=g,e[28]=p,e[29]=b,e[30]=j,e[31]=x):x=e[31];let h;return e[32]!==x||e[33]!==f||e[34]!==d?(h=a.jsx(Q,{title:f,description:d,action:x}),e[32]=x,e[33]=f,e[34]=d,e[35]=h):h=e[35],h}function it(t,e){return a.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate",children:t.primary}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.secondary})]}),a.jsx(oe,{className:W("mt-0.5 shrink-0",e?"opacity-100":"opacity-0")})]})}function lt(t){const{primary:e,secondary:n}=me(t);return{value:String(t.id),label:qe(t),primary:e,secondary:n}}function nt(t){const e=N.c(30),{boardId:n}=t,s=K(),i=ze(n),l=Ge();let r;if(i.isPending||l.isPending){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(ie,{className:"h-40 w-full"}),e[0]=c):c=e[0],r=c}else if(i.isError){let c;e[1]!==s?(c=s("settings.jira.columnsFailed"),e[1]=s,e[2]=c):c=e[2];let m;e[3]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[3]=c,e[4]=m):m=e[4],r=m}else if((i.data??[]).length===0){let c;e[5]!==s?(c=s("settings.jira.noColumnsYet"),e[5]=s,e[6]=c):c=e[6];let m;e[7]!==c?(m=a.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8],r=m}else{let c;e[9]!==l.data?(c=new Map((l.data??[]).map(at)),e[9]=l.data,e[10]=c):c=e[10];const m=c;let g;e[11]!==i.data?(g=i.data??[],e[11]=i.data,e[12]=g):g=e[12];let p;if(e[13]!==m||e[14]!==g){let j;e[16]!==m?(j=x=>x.statuses.map(h=>a.jsx(rt,{columnName:x.name,status:h,showStatus:h!==x.name||x.statuses.length>1,hasAutomation:m.has(h),prompt:m.get(h)??null},`${x.name}:${h}`)),e[16]=m,e[17]=j):j=e[17],p=g.flatMap(j),e[13]=m,e[14]=g,e[15]=p}else p=e[15];let b;e[18]!==p?(b=a.jsx("div",{className:"flex w-full flex-col gap-3",children:p}),e[18]=p,e[19]=b):b=e[19],r=b}let o;e[20]!==s?(o=s("settings.jira.automationsLabel"),e[20]=s,e[21]=o):o=e[21];let u;e[22]!==s?(u=s("settings.jira.automationsDescription"),e[22]=s,e[23]=u):u=e[23];let f;e[24]!==r?(f=a.jsx("div",{className:"mt-3",children:r}),e[24]=r,e[25]=f):f=e[25];let d;return e[26]!==o||e[27]!==u||e[28]!==f?(d=a.jsx(Q,{title:o,description:u,children:f}),e[26]=o,e[27]=u,e[28]=f,e[29]=d):d=e[29],d}function at(t){return[t.jiraStatus,t.prompt]}function rt(t){const e=N.c(22),{columnName:n,status:s,showStatus:i,hasAutomation:l,prompt:r}=t,o=K(),u=He(),[f,d]=J.useState(r??""),[c,m]=J.useState(r);c!==r&&(m(r),d(r??""));let g;e[0]!==u||e[1]!==s||e[2]!==o?(g=S=>u.mutate({jiraStatus:s,prompt:S},{onError:v=>q.error(Y(v,o("settings.jira.saveFailed")))}),e[0]=u,e[1]=s,e[2]=o,e[3]=g):g=e[3];const p=g;let b;e[4]!==n?(b=a.jsx("span",{className:"truncate text-sm font-medium",children:n}),e[4]=n,e[5]=b):b=e[5];let j;e[6]!==i||e[7]!==s?(j=i&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s}),e[6]=i,e[7]=s,e[8]=j):j=e[8];let x;e[9]!==b||e[10]!==j?(x=a.jsxs("div",{className:"flex flex-col min-w-0",children:[b,j]}),e[9]=b,e[10]=j,e[11]=x):x=e[11];let h;e[12]!==f||e[13]!==l||e[14]!==r||e[15]!==p||e[16]!==s||e[17]!==o?(h=l?a.jsxs("div",{className:"flex flex-col gap-2 rounded-lg bg-muted/40 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-medium",children:o("settings.jira.automationOn")}),a.jsx(H,{variant:"ghost",size:"sm","aria-label":o("settings.jira.removeAriaLabel",{status:s}),onClick:()=>p(null),children:a.jsx(pe,{size:14})})]}),a.jsx(de,{value:f,rows:2,placeholder:o("settings.jira.promptPlaceholder"),onChange:S=>d(S.target.value),onBlur:()=>{f!==(r??"")&&p(f)},"data-jira-automation-prompt":s}),a.jsx("p",{className:"text-xs text-muted-foreground",children:o("settings.jira.promptHelp")})]}):a.jsxs(H,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>p(""),children:[a.jsx(ge,{size:14}),o("settings.jira.addAutomation")]}),e[12]=f,e[13]=l,e[14]=r,e[15]=p,e[16]=s,e[17]=o,e[18]=h):h=e[18];let y;return e[19]!==x||e[20]!==h?(y=a.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border p-3",children:[x,h]}),e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function ot(t){const e=N.c(16),{integration:n}=t,s=K(),i=le();let l;e[0]!==s?(l=s("settings.jira.enabledLabel"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==s?(r=s("settings.jira.enabledDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==n.boardId||e[5]!==s||e[6]!==i?(o=d=>{if(d&&!n.boardId){q.error(s("settings.jira.enableRequirements"));return}i.mutate({enabled:d},{onError:c=>q.error(Y(c,s("settings.jira.saveFailed")))})},e[4]=n.boardId,e[5]=s,e[6]=i,e[7]=o):o=e[7];let u;e[8]!==n.enabled||e[9]!==o||e[10]!==i.isPending?(u=a.jsx(we,{checked:n.enabled,disabled:i.isPending,onCheckedChange:o}),e[8]=n.enabled,e[9]=o,e[10]=i.isPending,e[11]=u):u=e[11];let f;return e[12]!==l||e[13]!==r||e[14]!==u?(f=a.jsx(Q,{title:l,description:r,action:u}),e[12]=l,e[13]=r,e[14]=u,e[15]=f):f=e[15],f}function ct(t){const e=N.c(24),{integration:n}=t,s=K(),i=`${window.location.origin}/api/_jira/webhook/${n.webhookSecret}`;let l;e[0]!==s?(l=s("settings.jira.webhookTitle"),e[0]=s,e[1]=l):l=e[1];let r;e[2]!==s?(r=s("settings.jira.webhookDescription"),e[2]=s,e[3]=r):r=e[3];let o;e[4]!==i?(o=a.jsx(ee,{readOnly:!0,value:i,className:"font-mono text-xs"}),e[4]=i,e[5]=o):o=e[5];let u;e[6]!==s||e[7]!==i?(u=()=>{navigator.clipboard.writeText(i),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==s?(f=s("settings.jira.webhookCopy"),e[9]=s,e[10]=f):f=e[10];let d;e[11]!==u||e[12]!==f?(d=a.jsx(H,{variant:"outline",size:"sm",className:"shrink-0",onClick:u,children:f}),e[11]=u,e[12]=f,e[13]=d):d=e[13];let c;e[14]!==o||e[15]!==d?(c=a.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[14]=o,e[15]=d,e[16]=c):c=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Ze,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=m):m=e[17];let g;e[18]!==c?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[c,m]}),e[18]=c,e[19]=g):g=e[19];let p;return e[20]!==l||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:l,description:r,children:g}),e[20]=l,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function dt(){const t=N.c(23),e=K(),n=Me();if(n.isPending){let d;return t[0]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Z,{children:a.jsx("div",{className:"p-4",children:a.jsx(ie,{className:"h-40 w-full"})})}),t[0]=d):d=t[0],d}if(!n.data){let d;t[1]!==e?(d=e("settings.jira.connectTitle"),t[1]=e,t[2]=d):d=t[2];let c;t[3]!==e?(c=e("settings.jira.connectDescription"),t[3]=e,t[4]=c):c=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(et,{}),t[5]=m):m=t[5];let g;return t[6]!==d||t[7]!==c?(g=a.jsx(Z,{children:a.jsx(Q,{title:d,description:c,children:m})}),t[6]=d,t[7]=c,t[8]=g):g=t[8],g}const s=n.data;let i,l;t[9]!==s?(i=a.jsx(tt,{integration:s}),l=a.jsx(st,{integration:s}),t[9]=s,t[10]=i,t[11]=l):(i=t[10],l=t[11]);let r;t[12]!==s.boardId?(r=s.boardId&&a.jsx(nt,{boardId:s.boardId}),t[12]=s.boardId,t[13]=r):r=t[13];let o,u;t[14]!==s?(o=a.jsx(ot,{integration:s}),u=a.jsx(ct,{integration:s}),t[14]=s,t[15]=o,t[16]=u):(o=t[15],u=t[16]);let f;return t[17]!==i||t[18]!==l||t[19]!==r||t[20]!==o||t[21]!==u?(f=a.jsxs(Z,{children:[i,l,r,o,u]}),t[17]=i,t[18]=l,t[19]=r,t[20]=o,t[21]=u,t[22]=f):f=t[22],f}function mt(){const t=N.c(18),e=K();let n;t[0]!==e?(n=e("settings.nav.tasks"),t[0]=e,t[1]=n):n=t[1];let s;t[2]!==n?(s=a.jsx(X.Title,{children:n}),t[2]=n,t[3]=s):s=t[3];let i,l,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Oe,{}),l=a.jsx(Ye,{}),r=a.jsx($e,{}),t[4]=i,t[5]=l,t[6]=r):(i=t[4],l=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Le,{size:18}),t[7]=o):o=t[7];let u;t[8]!==e?(u=e("settings.jira.sectionTitle"),t[8]=e,t[9]=u):u=t[9];let f;t[10]!==u?(f=a.jsxs("span",{className:"flex items-center gap-2",children:[o,u]}),t[10]=u,t[11]=f):f=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(dt,{}),t[12]=d):d=t[12];let c;t[13]!==f?(c=a.jsx(re,{title:f,children:d}),t[13]=f,t[14]=c):c=t[14];let m;return t[15]!==s||t[16]!==c?(m=a.jsx(X,{children:a.jsx(X.Content,{children:a.jsx(X.Body,{children:a.jsxs(fe,{children:[s,i,l,r,c]})})})}),t[15]=s,t[16]=c,t[17]=m):m=t[17],m}function Dt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(Be,{capability:"org:manage",area:"settings",children:a.jsx(mt,{})}),t[0]=e):e=t[0],e}export{Dt as default};
@@ -1 +1 @@
1
- import{c as o,l,j as n}from"./index-B5qs3kIA.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
1
+ import{c as o,l,j as n}from"./index-B1NfLh28.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
@@ -1 +1 @@
1
- import{s as h}from"./slugify-CEUa2lfQ.js";import{J as m}from"./index-B5qs3kIA.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
1
+ import{s as h}from"./slugify-CEUa2lfQ.js";import{J as m}from"./index-B1NfLh28.js";function c(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function d(r){return c(r?.previewServerUrl)??c(r?.productionUrl)}function I(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function p(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return c(n)}function S(r){const t=h(r??"");return t?p(`${t}.deco.site`):null}function l(r){return r==="cms"||r==="sandbox"?r:null}function w(r){return!!d(r)&&r?.fastPreview===!0}function y(r){return w(r)?"cms":"sandbox"}function T(r,t){return l(r?.runtime)??y(t)}function a(r,t){return m.chatThreadIntent(r,t)}function U(r,t,n,e){if(!(!e.runtime&&!e.branch))try{r.setItem(a(t,n),JSON.stringify(e))}catch{}}function g(r,t,n){try{r.removeItem(a(t,n))}catch{}}function P(r,t,n){const e=a(t,n);let u=null;try{u=r.getItem(e),r.removeItem(e)}catch{return{}}if(!u)return{};let i;try{i=JSON.parse(u)}catch{return{}}if(!i||typeof i!="object")return{};const o=i,s=l(o.runtime),f=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...s?{runtime:s}:{},...f?{branch:f}:{}}}export{d as a,p as b,P as c,y as d,g as e,S as f,I as g,l as p,T as r,c as s,U as w};
@@ -1 +1 @@
1
- import{c as y,b as T,j as i,B as L,r as O,J as U,u as k,f as D,W as E,d as V,Z as H,y as z,dz as B}from"./index-B5qs3kIA.js";import{d as J,h as K,c as F,b as G,D as W}from"./dialog-ZVeNES6Y.js";import{i as Y}from"./Check-BJGjAkvt.js";import{a as Q}from"./Copy01-DDcupHo2.js";import{n as X}from"./Download01-DvOKymrY.js";import{u as M,D as j}from"./use-destination-route-F2w4a22p.js";import{a as $}from"./constants-DNuUCxmW.js";const Z="https://github.com/decocms/studio/releases";function q(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function ee(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function we(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function te(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function ne(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function P(e){const t=y.c(12),{copiedLabel:n}=e,s=T(),[o,r]=O.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=q(),t[0]=l):l=t[0];const a=l;let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:a}),t[1]=c):c=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{ne(navigator.clipboard,a).then(p=>{p&&(r(!0),setTimeout(()=>r(!1),2e3))})},t[2]=d):d=t[2];let u;t[3]!==o?(u=o?i.jsx(Y,{size:16}):i.jsx(Q,{size:16}),t[3]=o,t[4]=u):u=t[4];let f;t[5]!==o||t[6]!==n||t[7]!==s?(f=o?n:s("downloadApp.copyLabel"),t[5]=o,t[6]=n,t[7]=s,t[8]=f):f=t[8];let m;return t[9]!==u||t[10]!==f?(m=i.jsxs("div",{className:"flex flex-col gap-3",children:[c,i.jsxs(L,{type:"button",className:"w-full gap-2",onClick:d,children:[u,f]})]}),t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function oe(){const e=y.c(18),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabel"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.terminalHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;return e[15]!==s||e[16]!==c?(d=i.jsxs(i.Fragment,{children:[s,c]}),e[15]=s,e[16]=c,e[17]=d):d=e[17],d}function se(){const e=y.c(42),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let u;e[17]!==d?(u=i.jsx("p",{children:d}),e[17]=d,e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=ee("4.322.2"),e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=i.jsx(L,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:i.jsxs("a",{href:f,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let S;e[25]!==t?(S=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=S):S=e[26];let I;e[27]!==S?(I=i.jsx("p",{children:S}),e[27]=S,e[28]=I):I=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=i.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let A;e[33]!==h||e[34]!==I||e[35]!==x||e[36]!==u?(A=i.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[u,h,I,x]}),e[33]=h,e[34]=I,e[35]=x,e[36]=u,e[37]=A):A=e[37];let _;return e[38]!==s||e[39]!==A||e[40]!==c?(_=i.jsxs(i.Fragment,{children:[s,c,A]}),e[38]=s,e[39]=A,e[40]=c,e[41]=_):_=e[41],_}function je(e){const t=y.c(19),{open:n,onOpenChange:s}=e,o=T();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=te(),t[0]=r):r=t[0];const l=r;let a;t[1]!==o?(a=o("downloadApp.title"),t[1]=o,t[2]=a):a=t[2];let c;t[3]!==a?(c=i.jsx(J,{children:a}),t[3]=a,t[4]=c):c=t[4];let d;t[5]!==o?(d=o(l?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=o,t[6]=d):d=t[6];let u;t[7]!==d?(u=i.jsx(K,{children:d}),t[7]=d,t[8]=u):u=t[8];let f;t[9]!==c||t[10]!==u?(f=i.jsxs(F,{children:[c,u]}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=l?i.jsx(se,{}):i.jsx(oe,{}),t[12]=m):m=t[12];let p;t[13]!==f?(p=i.jsxs(G,{className:"sm:max-w-md",children:[f,m]}),t[13]=f,t[14]=p):p=t[14];let h;return t[15]!==s||t[16]!==n||t[17]!==p?(h=i.jsx(W,{open:n,onOpenChange:s,children:p}),t[15]=s,t[16]=n,t[17]=p,t[18]=h):h=t[18],h}const re=1e4,Te="true",R=2;function N(e,t){return U.chatAutosend(e,t)}function ae(e){return e==="pending"||e==="sending"}function le(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const n=t;let s=0;n.status==="sending"?s=n.retryAt===void 0?1:R:n.retryAt!==void 0&&(s=1);const o=n.attempt===void 0?s:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!ae(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof o!="number"||!Number.isInteger(o)||o<0||o>R?null:{...t,attempt:o}}function De(e,t,n,s,o=Date.now()){const r={message:s,createdAt:o,status:"pending",attempt:0};return e.setItem(N(t,n),JSON.stringify(r)),r}function ie(e,t,n){const s=N(t,n),o=le(e.getItem(s));return o||(e.removeItem(s),null)}function Ne(e,t,n,s=Date.now()){const o=N(t,n),r=ie(e,t,n);if(!r||r.status!=="pending")return null;if(r.attempt>=R)return e.removeItem(o),null;const l=r.retryAt??r.createdAt;if(s-l>=re)return e.removeItem(o),null;const a={...r,status:"sending",attempt:r.attempt+1};return e.setItem(o,JSON.stringify(a)),{message:a.message,createdAt:a.createdAt,attempt:a.attempt}}function Re(e,t,n){e.removeItem(N(t,n))}const ce="/shell/$org/org-shell/agent-shell";function de(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function ue(e){return e.taskIdParam??e.threadSearch??null}function ke(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const o=k(s);let r;return e[2]!==n.taskId||e[3]!==o.thread?(r=ue({taskIdParam:n.taskId,threadSearch:o.thread}),e[2]=n.taskId,e[3]=o.thread,e[4]=r):r=e[4],r}function fe(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function me(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],D(t).taskId!==void 0}function pe(){const e=y.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=k(t),s=M(),o=me(),r=s===j.agents,l=s===j.home;let a;return e[1]!==o||e[2]!==n.virtualmcpid||e[3]!==r||e[4]!==l?(a=fe({virtualMcpIdSearch:n.virtualmcpid,onAgentsRoute:r,onHomeRoute:l,legacyRoute:o}),e[1]=o,e[2]=n.virtualmcpid,e[3]=r,e[4]=l,e[5]=a):a=e[5],a}function Le(){const e=y.c(3),{org:t}=E(),n=pe();let s;return e[0]!==t||e[1]!==n?(s=n??$(t.id).id,e[0]=t,e[1]=n,e[2]=s):s=e[2],s}function he(e){const{virtualmcpid:t,...n}=e.changes;return{...e.prev,...n,thread:e.threadId}}function Ee(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ge(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function xe(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:ce,shouldThrow:!1},e[1]=s):s=e[1],!!H(s)&&n.taskId===void 0}function Me(){const e=y.c(12),t=V();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const s=D(n),o=xe(),{org:r}=E(),l=s.org??"",a=M()===j.agents;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[1]=c):c=e[1];const d=k(c),u=a?d.virtualmcpid:void 0,f=s.panel;let m;e[2]!==r.id?(m=$(r.id),e[2]=r.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==f||e[5]!==u||e[6]!==p||e[7]!==t||e[8]!==a||e[9]!==l||e[10]!==o?(h=(S,I,g)=>{const x=de({threadInSearch:o,orgSlug:l,threadId:S}),A=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:I,replace:A});const _=ge({currentProject:u,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),w=g?.view&&g.view.tabId!==void 0?z(g.view.tabId):g?.view?{panel:void 0,payload:B()}:null,C=_.kind==="relocate"&&!a,b=v=>he({prev:C?{sidepanel:v.sidepanel}:v,changes:{...I(v),...w?.payload??{}},threadId:S});return _.kind==="relocate"?t({to:j.agents,params:{org:l,panel:w?w.panel:f},search:v=>({...typeof b=="function"?b(v):b,virtualmcpid:_.project}),replace:A}):t({to:".",params:v=>w?{...v,panel:w.panel}:v,search:v=>({...typeof b=="function"?b(v):b,...a?{virtualmcpid:_.project}:{}}),replace:A})},e[4]=f,e[5]=u,e[6]=p,e[7]=t,e[8]=a,e[9]=l,e[10]=o,e[11]=h):h=e[11],h}export{Te as A,je as D,te as a,Me as b,ke as c,Le as d,Ne as e,Re as f,we as i,Ee as r,pe as u,De as w};
1
+ import{c as y,b as T,j as i,B as L,r as O,J as U,u as k,f as D,W as E,d as V,Z as H,y as z,dz as B}from"./index-B1NfLh28.js";import{d as J,h as K,c as F,b as G,D as W}from"./dialog-_eOGpV_R.js";import{i as Y}from"./Check-CViV2AKw.js";import{a as Q}from"./Copy01-CVNVXHfJ.js";import{n as X}from"./Download01-C-8_yc1P.js";import{u as M,D as j}from"./use-destination-route-CG9NdNN9.js";import{a as $}from"./constants-DNuUCxmW.js";const Z="https://github.com/decocms/studio/releases";function q(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function ee(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function we(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function te(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function ne(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function P(e){const t=y.c(12),{copiedLabel:n}=e,s=T(),[o,r]=O.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=q(),t[0]=l):l=t[0];const a=l;let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:a}),t[1]=c):c=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{ne(navigator.clipboard,a).then(p=>{p&&(r(!0),setTimeout(()=>r(!1),2e3))})},t[2]=d):d=t[2];let u;t[3]!==o?(u=o?i.jsx(Y,{size:16}):i.jsx(Q,{size:16}),t[3]=o,t[4]=u):u=t[4];let f;t[5]!==o||t[6]!==n||t[7]!==s?(f=o?n:s("downloadApp.copyLabel"),t[5]=o,t[6]=n,t[7]=s,t[8]=f):f=t[8];let m;return t[9]!==u||t[10]!==f?(m=i.jsxs("div",{className:"flex flex-col gap-3",children:[c,i.jsxs(L,{type:"button",className:"w-full gap-2",onClick:d,children:[u,f]})]}),t[9]=u,t[10]=f,t[11]=m):m=t[11],m}function oe(){const e=y.c(18),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabel"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.terminalHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;return e[15]!==s||e[16]!==c?(d=i.jsxs(i.Fragment,{children:[s,c]}),e[15]=s,e[16]=c,e[17]=d):d=e[17],d}function se(){const e=y.c(42),t=T();let n;e[0]!==t?(n=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==n?(s=i.jsx(P,{copiedLabel:n}),e[2]=n,e[3]=s):s=e[3];let o;e[4]!==t?(o=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r=i.jsx("p",{children:o}),e[6]=o,e[7]=r):r=e[7];let l;e[8]!==t?(l=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=l):l=e[9];let a;e[10]!==l?(a=i.jsx("p",{children:l}),e[10]=l,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==a?(c=i.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[r,a]}),e[12]=r,e[13]=a,e[14]=c):c=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let u;e[17]!==d?(u=i.jsx("p",{children:d}),e[17]=d,e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=ee("4.323.0"),e[19]=f):f=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=i.jsx(L,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:i.jsxs("a",{href:f,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let S;e[25]!==t?(S=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=S):S=e[26];let I;e[27]!==S?(I=i.jsx("p",{children:S}),e[27]=S,e[28]=I):I=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=i.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let A;e[33]!==h||e[34]!==I||e[35]!==x||e[36]!==u?(A=i.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[u,h,I,x]}),e[33]=h,e[34]=I,e[35]=x,e[36]=u,e[37]=A):A=e[37];let _;return e[38]!==s||e[39]!==A||e[40]!==c?(_=i.jsxs(i.Fragment,{children:[s,c,A]}),e[38]=s,e[39]=A,e[40]=c,e[41]=_):_=e[41],_}function je(e){const t=y.c(19),{open:n,onOpenChange:s}=e,o=T();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=te(),t[0]=r):r=t[0];const l=r;let a;t[1]!==o?(a=o("downloadApp.title"),t[1]=o,t[2]=a):a=t[2];let c;t[3]!==a?(c=i.jsx(J,{children:a}),t[3]=a,t[4]=c):c=t[4];let d;t[5]!==o?(d=o(l?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=o,t[6]=d):d=t[6];let u;t[7]!==d?(u=i.jsx(K,{children:d}),t[7]=d,t[8]=u):u=t[8];let f;t[9]!==c||t[10]!==u?(f=i.jsxs(F,{children:[c,u]}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=l?i.jsx(se,{}):i.jsx(oe,{}),t[12]=m):m=t[12];let p;t[13]!==f?(p=i.jsxs(G,{className:"sm:max-w-md",children:[f,m]}),t[13]=f,t[14]=p):p=t[14];let h;return t[15]!==s||t[16]!==n||t[17]!==p?(h=i.jsx(W,{open:n,onOpenChange:s,children:p}),t[15]=s,t[16]=n,t[17]=p,t[18]=h):h=t[18],h}const re=1e4,Te="true",R=2;function N(e,t){return U.chatAutosend(e,t)}function ae(e){return e==="pending"||e==="sending"}function le(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const n=t;let s=0;n.status==="sending"?s=n.retryAt===void 0?1:R:n.retryAt!==void 0&&(s=1);const o=n.attempt===void 0?s:n.attempt;return typeof n.createdAt!="number"||typeof n.message!="object"||!ae(n.status)||n.retryAt!==void 0&&typeof n.retryAt!="number"||typeof o!="number"||!Number.isInteger(o)||o<0||o>R?null:{...t,attempt:o}}function De(e,t,n,s,o=Date.now()){const r={message:s,createdAt:o,status:"pending",attempt:0};return e.setItem(N(t,n),JSON.stringify(r)),r}function ie(e,t,n){const s=N(t,n),o=le(e.getItem(s));return o||(e.removeItem(s),null)}function Ne(e,t,n,s=Date.now()){const o=N(t,n),r=ie(e,t,n);if(!r||r.status!=="pending")return null;if(r.attempt>=R)return e.removeItem(o),null;const l=r.retryAt??r.createdAt;if(s-l>=re)return e.removeItem(o),null;const a={...r,status:"sending",attempt:r.attempt+1};return e.setItem(o,JSON.stringify(a)),{message:a.message,createdAt:a.createdAt,attempt:a.attempt}}function Re(e,t,n){e.removeItem(N(t,n))}const ce="/shell/$org/org-shell/agent-shell";function de(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function ue(e){return e.taskIdParam??e.threadSearch??null}function ke(){const e=y.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const o=k(s);let r;return e[2]!==n.taskId||e[3]!==o.thread?(r=ue({taskIdParam:n.taskId,threadSearch:o.thread}),e[2]=n.taskId,e[3]=o.thread,e[4]=r):r=e[4],r}function fe(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function me(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],D(t).taskId!==void 0}function pe(){const e=y.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=k(t),s=M(),o=me(),r=s===j.agents,l=s===j.home;let a;return e[1]!==o||e[2]!==n.virtualmcpid||e[3]!==r||e[4]!==l?(a=fe({virtualMcpIdSearch:n.virtualmcpid,onAgentsRoute:r,onHomeRoute:l,legacyRoute:o}),e[1]=o,e[2]=n.virtualmcpid,e[3]=r,e[4]=l,e[5]=a):a=e[5],a}function Le(){const e=y.c(3),{org:t}=E(),n=pe();let s;return e[0]!==t||e[1]!==n?(s=n??$(t.id).id,e[0]=t,e[1]=n,e[2]=s):s=e[2],s}function he(e){const{virtualmcpid:t,...n}=e.changes;return{...e.prev,...n,thread:e.threadId}}function Ee(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ge(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function xe(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=D(t);let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:ce,shouldThrow:!1},e[1]=s):s=e[1],!!H(s)&&n.taskId===void 0}function Me(){const e=y.c(12),t=V();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const s=D(n),o=xe(),{org:r}=E(),l=s.org??"",a=M()===j.agents;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[1]=c):c=e[1];const d=k(c),u=a?d.virtualmcpid:void 0,f=s.panel;let m;e[2]!==r.id?(m=$(r.id),e[2]=r.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==f||e[5]!==u||e[6]!==p||e[7]!==t||e[8]!==a||e[9]!==l||e[10]!==o?(h=(S,I,g)=>{const x=de({threadInSearch:o,orgSlug:l,threadId:S}),A=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:I,replace:A});const _=ge({currentProject:u,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),w=g?.view&&g.view.tabId!==void 0?z(g.view.tabId):g?.view?{panel:void 0,payload:B()}:null,C=_.kind==="relocate"&&!a,b=v=>he({prev:C?{sidepanel:v.sidepanel}:v,changes:{...I(v),...w?.payload??{}},threadId:S});return _.kind==="relocate"?t({to:j.agents,params:{org:l,panel:w?w.panel:f},search:v=>({...typeof b=="function"?b(v):b,virtualmcpid:_.project}),replace:A}):t({to:".",params:v=>w?{...v,panel:w.panel}:v,search:v=>({...typeof b=="function"?b(v):b,...a?{virtualmcpid:_.project}:{}}),replace:A})},e[4]=f,e[5]=u,e[6]=p,e[7]=t,e[8]=a,e[9]=l,e[10]=o,e[11]=h):h=e[11],h}export{Te as A,je as D,te as a,Me as b,ke as c,Le as d,Ne as e,Re as f,we as i,Ee as r,pe as u,De as w};
@@ -1 +1 @@
1
- import{r as x,br as b,j as c,bo as m,bu as k,bb as p,dv as M,dw as T,bt as S,dx as A,bq as F,bE as $,c as P,l as C}from"./index-B5qs3kIA.js";var j="Toggle",_=x.forwardRef((r,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...a}=r,[t,o]=b({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":r.disabled?"":void 0,...a,ref:e,onClick:k(r.onClick,()=>{r.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[w]=F(v,[T]),I=T(),h=p.forwardRef((r,e)=>{const{type:l,...s}=r;if(l==="single"){const n=s;return c.jsx(D,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(B,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});h.displayName=v;var[z,y]=w(v),D=p.forwardRef((r,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...a}=r,[t,o]=b({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(z,{scope:r.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...a,ref:e})})}),B=p.forwardRef((r,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...a}=r,[t,o]=b({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(z,{scope:r.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...a,ref:e})})});h.displayName=v;var[O,q]=w(v),R=p.forwardRef((r,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:a,dir:t,loop:o=!0,...i}=r,d=I(l),u=S(t),g={role:"group",dir:u,...i};return c.jsx(O,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(A,{asChild:!0,...d,orientation:a,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",E=p.forwardRef((r,e)=>{const l=y(f,r.__scopeToggleGroup),s=q(f,r.__scopeToggleGroup),n=I(r.__scopeToggleGroup),a=l.value.includes(r.value),t=s.disabled||r.disabled,o={...r,pressed:a,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(M,{asChild:!0,...n,focusable:!t,active:a,ref:i,children:c.jsx(G,{...o,ref:e})}):c.jsx(G,{...o,ref:e})});E.displayName=f;var G=p.forwardRef((r,e)=>{const{__scopeToggleGroup:l,value:s,...n}=r,a=y(f,l),t={role:"radio","aria-checked":r.pressed,"aria-pressed":void 0},o=a.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?a.onItemActivate(s):a.onItemDeactivate(s)}})}),H=h,L=E;const U=$("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=x.createContext({size:"default",variant:"default"});function K(r){const e=P.c(20);let l,s,n,a,t;e[0]!==r?({className:s,variant:t,size:a,children:l,...n}=r,e[0]=r,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=t):(l=e[1],s=e[2],n=e[3],a=e[4],t=e[5]);let o;e[6]!==s?(o=C("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==a||e[9]!==t?(i={variant:t,size:a},e[8]=a,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(N.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==a||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(H,{"data-slot":"toggle-group","data-variant":t,"data-size":a,className:o,...n,children:d}),e[14]=n,e[15]=a,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(r){const e=P.c(18);let l,s,n,a,t;e[0]!==r?({className:s,children:l,variant:t,size:a,...n}=r,e[0]=r,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=t):(l=e[1],s=e[2],n=e[3],a=e[4],t=e[5]);const o=x.useContext(N),i=o.variant||t,d=o.size||a;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==a||e[10]!==t?(u=C(U({variant:o.variant||t,size:o.size||a}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=a,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(L,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{K as T,Q as a};
1
+ import{r as x,br as b,j as c,bo as m,bu as k,bb as p,dv as M,dw as T,bt as S,dx as A,bq as F,bE as $,c as P,l as C}from"./index-B1NfLh28.js";var j="Toggle",_=x.forwardRef((r,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...a}=r,[t,o]=b({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":r.disabled?"":void 0,...a,ref:e,onClick:k(r.onClick,()=>{r.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[w]=F(v,[T]),I=T(),h=p.forwardRef((r,e)=>{const{type:l,...s}=r;if(l==="single"){const n=s;return c.jsx(D,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(B,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});h.displayName=v;var[z,y]=w(v),D=p.forwardRef((r,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...a}=r,[t,o]=b({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(z,{scope:r.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...a,ref:e})})}),B=p.forwardRef((r,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...a}=r,[t,o]=b({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(z,{scope:r.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...a,ref:e})})});h.displayName=v;var[O,q]=w(v),R=p.forwardRef((r,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:a,dir:t,loop:o=!0,...i}=r,d=I(l),u=S(t),g={role:"group",dir:u,...i};return c.jsx(O,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(A,{asChild:!0,...d,orientation:a,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",E=p.forwardRef((r,e)=>{const l=y(f,r.__scopeToggleGroup),s=q(f,r.__scopeToggleGroup),n=I(r.__scopeToggleGroup),a=l.value.includes(r.value),t=s.disabled||r.disabled,o={...r,pressed:a,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(M,{asChild:!0,...n,focusable:!t,active:a,ref:i,children:c.jsx(G,{...o,ref:e})}):c.jsx(G,{...o,ref:e})});E.displayName=f;var G=p.forwardRef((r,e)=>{const{__scopeToggleGroup:l,value:s,...n}=r,a=y(f,l),t={role:"radio","aria-checked":r.pressed,"aria-pressed":void 0},o=a.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?a.onItemActivate(s):a.onItemDeactivate(s)}})}),H=h,L=E;const U=$("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),N=x.createContext({size:"default",variant:"default"});function K(r){const e=P.c(20);let l,s,n,a,t;e[0]!==r?({className:s,variant:t,size:a,children:l,...n}=r,e[0]=r,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=t):(l=e[1],s=e[2],n=e[3],a=e[4],t=e[5]);let o;e[6]!==s?(o=C("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==a||e[9]!==t?(i={variant:t,size:a},e[8]=a,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(N.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==a||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(H,{"data-slot":"toggle-group","data-variant":t,"data-size":a,className:o,...n,children:d}),e[14]=n,e[15]=a,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(r){const e=P.c(18);let l,s,n,a,t;e[0]!==r?({className:s,children:l,variant:t,size:a,...n}=r,e[0]=r,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=t):(l=e[1],s=e[2],n=e[3],a=e[4],t=e[5]);const o=x.useContext(N),i=o.variant||t,d=o.size||a;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==a||e[10]!==t?(u=C(U({variant:o.variant||t,size:o.size||a}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=a,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(L,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{K as T,Q as a};