decocms 4.321.3 → 4.321.4

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 (248) hide show
  1. package/dist/client/assets/{AlertCircle-DlZdUT4y.js → AlertCircle-Dv6G1zch.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CDaTYOly.js → AreaChart-Bh324PJ7.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-B_C58IhS.js → ArrowLeft-Dyo7ZseM.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-0zKbGhZX.js → ArrowUp-Dl1f2e9F.js} +1 -1
  5. package/dist/client/assets/{Check-Bu3XsPtR.js → Check-DiuzOTdo.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DKTcHnyM.js → CheckCircle-BTMeEcth.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DuX1hKVe.js → ChevronRight-CYJzqw1W.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-CUY38lF0.js → ChevronSelectorVertical-C0Fdqi9U.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DDdMqJL1.js → ChevronUp-CHN7dU5d.js} +1 -1
  10. package/dist/client/assets/{Copy01-BbXi4FYi.js → Copy01-CZOGrHZ9.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-gu6q0yZd.js → CreditCard01-CxZhImMf.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-PUVVFLTP.js → DotsVertical-CsIT64BQ.js} +1 -1
  13. package/dist/client/assets/{Download01-AtmH14NN.js → Download01-DEU1JkfL.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-qLO8ohog.js → ErrorBarContext-44kQWZkn.js} +1 -1
  15. package/dist/client/assets/{Eye-Z_2DhwO_.js → Eye-DNWGZGwG.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-BritbDKe.js → GitBranch01-4HvT92Fb.js} +1 -1
  17. package/dist/client/assets/{Globe01-DIQAtDkP.js → Globe01-CySbwdvS.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DjrfIOu4.js → HardDrive-CkhRSS5J.js} +1 -1
  19. package/dist/client/assets/{Image01-CGO7yG2R.js → Image01-CnSVldaE.js} +1 -1
  20. package/dist/client/assets/{Key01-m5a-9O7E.js → Key01-BvfZtZef.js} +1 -1
  21. package/dist/client/assets/{Link01-_3xhMoAr.js → Link01-DELnIRjt.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DFZf17HG.js → LinkExternal01-6r85JlVB.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Cym0a0IH.js → Monitor01-Ciyr-Z_-.js} +1 -1
  24. package/dist/client/assets/{Package-BA5DvHbm.js → Package-CGoiEMne.js} +1 -1
  25. package/dist/client/assets/{Palette-DVp1cbTL.js → Palette-CLInuq6o.js} +1 -1
  26. package/dist/client/assets/{Play-CC767BNc.js → Play-CFcccqRE.js} +1 -1
  27. package/dist/client/assets/{Plus-BsdY3vta.js → Plus-DfniZcTj.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CQywkGC8.js → SearchMd-MV7l96VN.js} +1 -1
  29. package/dist/client/assets/{Sector-6c8v6F9Y.js → Sector-CXJOKUEx.js} +1 -1
  30. package/dist/client/assets/{Settings02-B3BHuFlc.js → Settings02-DLKKNdDt.js} +1 -1
  31. package/dist/client/assets/{Share07-DQRfeucj.js → Share07-BdYeKEPF.js} +1 -1
  32. package/dist/client/assets/{Shield01-CfLUCs7T.js → Shield01-Dbav6S5n.js} +1 -1
  33. package/dist/client/assets/{Stars01-D7oX_8Wb.js → Stars01-PjG8UcMP.js} +1 -1
  34. package/dist/client/assets/{Sun-DwFd1air.js → Sun-DmqaD0GF.js} +1 -1
  35. package/dist/client/assets/{Tool01-Dh-2dHg7.js → Tool01-CdkG5j9q.js} +1 -1
  36. package/dist/client/assets/{Tool02-C5-ESFs5.js → Tool02-CtS9_9Au.js} +1 -1
  37. package/dist/client/assets/{Trash01-DgYh1NxX.js → Trash01-DpQq-xrz.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-0nrjwpEZ.js → TrendUp01-Dwgdtlxo.js} +1 -1
  39. package/dist/client/assets/{Upload01-jkHCXrUI.js → Upload01-C-aUSpkq.js} +1 -1
  40. package/dist/client/assets/{User01-yXo0r48U.js → User01-CIlNhP30.js} +1 -1
  41. package/dist/client/assets/{UserSquare-B19aw2mP.js → UserSquare-CDP0762p.js} +1 -1
  42. package/dist/client/assets/{Users01-BiFVZazG.js → Users01-CJ-REDik.js} +1 -1
  43. package/dist/client/assets/{Users03-C9WBhoi4.js → Users03-C7y8d7lq.js} +1 -1
  44. package/dist/client/assets/{XCircle-DRYTYfoJ.js → XCircle-D4lh-8UY.js} +1 -1
  45. package/dist/client/assets/{XClose-D_sSgqWY.js → XClose-CUFBDVP-.js} +1 -1
  46. package/dist/client/assets/{Zap-BwqaqJR6.js → Zap-BD_2K_N7.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DL9fn9Rn.js → ZoomOut-CYflMQc3.js} +1 -1
  48. package/dist/client/assets/{access-gate-Cr4kGdoG.js → access-gate-B8SIJFr7.js} +1 -1
  49. package/dist/client/assets/{agent-icon-RpsSZWOm.js → agent-icon-Dj2ko6xN.js} +1 -1
  50. package/dist/client/assets/agents-list-DedSGOjL.js +1 -0
  51. package/dist/client/assets/{ai-providers-dfmBmLi1.js → ai-providers-PLInDAtU.js} +1 -1
  52. package/dist/client/assets/{alert-DDOSdHF1.js → alert-D50pTGlG.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BwkydmfJ.js → alert-dialog-DN6vGwKb.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-CfuMS2EL.js → analytics-tab-DkOamiBu.js} +1 -1
  55. package/dist/client/assets/api-keys-BT6wuuDI.js +1 -0
  56. package/dist/client/assets/{api-keys-DMRP4EpN.js → api-keys-CUuIcLOK.js} +1 -1
  57. package/dist/client/assets/{app-editor-DqP-YnLu.js → app-editor-CXxJdDRj.js} +1 -1
  58. package/dist/client/assets/{auth-1n-nSaCp.js → auth-BF15VDKW.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-DjUs0QfG.js → auth-catchall-CfznBWAb.js} +1 -1
  60. package/dist/client/assets/{auth-entry-l2FufJt_.js → auth-entry-BmdnPyAe.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-BFjeh5RK.js → auth-split-layout-D8Qd5X5d.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-CczjH39y.js → authenticate-and-persist-oauth-ORS2OKxY.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-DJmiHAcQ.js → automation-list-row-D_CbqNGG.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CPO7lLwq.js → automation-runs-oTVIsV-n.js} +1 -1
  65. package/dist/client/assets/{automations-nuUr74Pw.js → automations-CkLUemPj.js} +1 -1
  66. package/dist/client/assets/{avatar-D7BI9kIY.js → avatar-BLCEls6Y.js} +1 -1
  67. package/dist/client/assets/{badge-C7G_dwIu.js → badge-CSQtV4I1.js} +1 -1
  68. package/dist/client/assets/{block-document-DoNf7H3D.js → block-document-DHWwd1Xg.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-BAjbmNYL.js → breadcrumb-BY2L4Yur.js} +1 -1
  70. package/dist/client/assets/{buckets-BzOMvHnI.js → buckets-BgzCy0Wo.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-CDcCaEVa.js → bulk-category-panel-BsKaZScD.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DdUEYVnx.js → capability-load-error-CpA6LOWl.js} +1 -1
  73. package/dist/client/assets/{cards-evwCQ3BJ.js → cards-DDW_x79J.js} +1 -1
  74. package/dist/client/assets/{category-editor-BUgoXsGS.js → category-editor-Ddez8F9D.js} +1 -1
  75. package/dist/client/assets/{cdn-tab-C7HzaQJs.js → cdn-tab-DFZvtAMl.js} +1 -1
  76. package/dist/client/assets/{chart-BbiPqYsI.js → chart-CMxD7edM.js} +1 -1
  77. package/dist/client/assets/{chat-context-5h3SEksi.js → chat-context-C5TtMbeA.js} +1 -1
  78. package/dist/client/assets/{checkbox-DrLBm6Hu.js → checkbox-CHvOkNek.js} +1 -1
  79. package/dist/client/assets/{choose-editor-C_UqQB0X.js → choose-editor-Bl3IlbHF.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-mbtPKAeO.js → cli-auth-success-CEFSPlKa.js} +1 -1
  81. package/dist/client/assets/{client-icons-Dx7ZT4qY.js → client-icons-CIyJtQzW.js} +1 -1
  82. package/dist/client/assets/{collection-detail-3F2jLAIe.js → collection-detail-V8ouNFsx.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-BuGIMFHI.js → collection-display-button-ch8VsZJ-.js} +1 -1
  84. package/dist/client/assets/{collection-search-Byf9covb.js → collection-search-C0aemqyU.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-C9hfGOql.js → collection-table-wrapper-RraLzE6q.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-4YD6nwky.js → collection-tabs-DM3JgymS.js} +1 -1
  87. package/dist/client/assets/{command-Bz-l73oK.js → command-aq94pylP.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-Dt2M_QAS.js → commerce-onboarding-C6pquuZu.js} +1 -1
  89. package/dist/client/assets/{connect-DaJLytlD.js → connect-Db_FA2vM.js} +1 -1
  90. package/dist/client/assets/{connect-layout-D7bRiFvQ.js → connect-layout-DUtKqe8O.js} +1 -1
  91. package/dist/client/assets/{connection-Corqb4nW.js → connection-D4KVb2vi.js} +1 -1
  92. package/dist/client/assets/{connection-card-kBzgkq3q.js → connection-card-DZD9pIth.js} +1 -1
  93. package/dist/client/assets/{connection-detail-BixLRE2Y.js → connection-detail-Rd3BNYmU.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-CkY6wGpq.js → connection-form-helpers-CJ7gQUqN.js} +1 -1
  95. package/dist/client/assets/{connections-NFtaWcpm.js → connections-DP-c-cpk.js} +1 -1
  96. package/dist/client/assets/{create-organization-dialog-CZnpESma.js → create-organization-dialog-BFeoMeJI.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool-Ccw1vgMp.js → decopilot-sse-pool-B2Ek6f9E.js} +1 -1
  98. package/dist/client/assets/{dialog-lVg2I_FW.js → dialog-BVuXhd_n.js} +1 -1
  99. package/dist/client/assets/{domain-settings-2IuIzWRo.js → domain-settings-Creutor_.js} +1 -1
  100. package/dist/client/assets/{drawer-F0hkjkWK.js → drawer-CXBUq1b4.js} +1 -1
  101. package/dist/client/assets/{dropdown-menu-QVhpTnbw.js → dropdown-menu-7nrlUaMG.js} +1 -1
  102. package/dist/client/assets/{e2e-tab-CIhvZ7jB.js → e2e-tab-Dr-mwFjd.js} +1 -1
  103. package/dist/client/assets/{editor-DHSROqSc.js → editor-CSXnkhqo.js} +1 -1
  104. package/dist/client/assets/{empty-state-B6_Ul4U9.js → empty-state-D1TMU-hy.js} +1 -1
  105. package/dist/client/assets/{empty-state-BoTu9lkL.js → empty-state-N8rf9YSi.js} +1 -1
  106. package/dist/client/assets/{extract-connection-data-DcfPnaRL.js → extract-connection-data-fYPcP0VJ.js} +1 -1
  107. package/dist/client/assets/{file-explorer-FGaad9SC.js → file-explorer-Ku7EjWAL.js} +1 -1
  108. package/dist/client/assets/{file-type-icon-iSdqxvCJ.js → file-type-icon-BnBH2hK9.js} +1 -1
  109. package/dist/client/assets/{folder-icon-DoL1wgM6.js → folder-icon-1xzQyJ7C.js} +1 -1
  110. package/dist/client/assets/{form-BzptyBk4.js → form-D7fAV9eN.js} +1 -1
  111. package/dist/client/assets/{general-D6b_Y3aW.js → general-DLE7dZPk.js} +1 -1
  112. package/dist/client/assets/{github-repo-picker-B1n6OBj4.js → github-repo-picker-CVdHp0M0.js} +1 -1
  113. package/dist/client/assets/{hooks-bhKP99Ax.js → hooks-y1rkw2ir.js} +1 -1
  114. package/dist/client/assets/{hosting-tab-s8sW7wxN.js → hosting-tab-BAPE6MlT.js} +1 -1
  115. package/dist/client/assets/{index-fXvyzo6h.js → index-B9n6l693.js} +1 -1
  116. package/dist/client/assets/{index-MnhhExK7.js → index-BOJEwmSU.js} +1 -1
  117. package/dist/client/assets/{index-D7xeSGeI.js → index-BgfHML7J.js} +1 -1
  118. package/dist/client/assets/{index-CGetbWoq.js → index-CbU-T1m1.js} +1 -1
  119. package/dist/client/assets/{index-CW6L2S49.js → index-Ciqhx4Es.js} +2 -2
  120. package/dist/client/assets/{index-nFRHQC-L.js → index-CmirxoQz.js} +1 -1
  121. package/dist/client/assets/{index-BNJPAEna.js → index-DHZW87eM.js} +1 -1
  122. package/dist/client/assets/{index-DWxzACaY.js → index-DK46XAl9.js} +6 -6
  123. package/dist/client/assets/{index-ruQQqW4p.js → index-Dr0vXAye.js} +1 -1
  124. package/dist/client/assets/{index-Bw600I7i.js → index-o5eMIupH.js} +1 -1
  125. package/dist/client/assets/{index-redirect-CGJzac9E.js → index-redirect-Dy4llany.js} +1 -1
  126. package/dist/client/assets/{infra-billing-DzmhWVEh.js → infra-billing-CDH62RCF.js} +1 -1
  127. package/dist/client/assets/{input-DPKIPveM.js → input-HiBvv-tS.js} +1 -1
  128. package/dist/client/assets/{integration-icon-D9FdHsn5.js → integration-icon-B63L2HtM.js} +1 -1
  129. package/dist/client/assets/{invite-member-dialog-CyxMgQZJ.js → invite-member-dialog-S-x8vUoc.js} +1 -1
  130. package/dist/client/assets/{label-CqIRBXyv.js → label-CGF50XGa.js} +1 -1
  131. package/dist/client/assets/{layout-C4M3_yhL.js → layout-Cf_v7v8J.js} +1 -1
  132. package/dist/client/assets/{login-qzbpt226.js → login-BRT3iRa2.js} +1 -1
  133. package/dist/client/assets/{markdown-BiJIqYGv.js → markdown-Srunai6w.js} +1 -1
  134. package/dist/client/assets/{mcp-oauth-HjvSjKSb.js → mcp-oauth-Bmt9vIvY.js} +1 -1
  135. package/dist/client/assets/{members-D2It71TM.js → members-_klSSf7w.js} +1 -1
  136. package/dist/client/assets/{monaco-editor-DkHBERIE.js → monaco-editor-BXDxtePS.js} +1 -1
  137. package/dist/client/assets/{monitoring-stats-row-B68839YD.js → monitoring-stats-row-D1pJtu9I.js} +1 -1
  138. package/dist/client/assets/{multi-select-jl7Hbzaz.js → multi-select-BZ-tCaud.js} +1 -1
  139. package/dist/client/assets/{oauth-callback--dbFGP9K.js → oauth-callback-F8D4D968.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ai-provider-BRBN5fiB.js → oauth-callback-ai-provider-DlKy27tT.js} +1 -1
  141. package/dist/client/assets/{onboarding-HFAUcTGc.js → onboarding-CoNP24fk.js} +1 -1
  142. package/dist/client/assets/org-layout-D6WucjyK.js +1 -0
  143. package/dist/client/assets/{organization-choice-G8mAnjMS.js → organization-choice-nbe4I9kY.js} +1 -1
  144. package/dist/client/assets/{orgs-CgeiXFFD.js → orgs-o3NxI1V6.js} +1 -1
  145. package/dist/client/assets/{page-seo-form-DTFWlSs6.js → page-seo-form-DDV7VjV-.js} +1 -1
  146. package/dist/client/assets/{popover-Cfo1Nvgv.js → popover-CRkM20y5.js} +1 -1
  147. package/dist/client/assets/{post-calendar-D0PKhtb8.js → post-calendar-BacBxT2V.js} +1 -1
  148. package/dist/client/assets/{post-editor-BsMV7w5K.js → post-editor-4rU4mFOM.js} +1 -1
  149. package/dist/client/assets/{primitives-Dshx-6vZ.js → primitives-RPdPdtiK.js} +1 -1
  150. package/dist/client/assets/{profile-6Ncb3Njd.js → profile-weZdXHvp.js} +1 -1
  151. package/dist/client/assets/{project-app-view-DJ4h95de.js → project-app-view-Ben78Ktd.js} +1 -1
  152. package/dist/client/assets/{prompts-6dW4jofl.js → prompts-DqEM2vI1.js} +1 -1
  153. package/dist/client/assets/record-editor-CcDRxPdh.js +1 -0
  154. package/dist/client/assets/redirect-editor-DN0sxwSC.js +1 -0
  155. package/dist/client/assets/registry-4_qn65ff.js +2 -0
  156. package/dist/client/assets/{registry-layout-CEF3gBC_.js → registry-layout-BmS41XeK.js} +1 -1
  157. package/dist/client/assets/{reports-hh8ZI3ZJ.js → reports-Ex-p9Q6U.js} +1 -1
  158. package/dist/client/assets/{require-capability-B7CJKsKK.js → require-capability-B6bbEttD.js} +1 -1
  159. package/dist/client/assets/{required-auth-layout-BASPIPDt.js → required-auth-layout-BNGtvzOt.js} +1 -1
  160. package/dist/client/assets/{reset-password-B5OEAnS-.js → reset-password-CKdYnon5.js} +1 -1
  161. package/dist/client/assets/{review-settings-DJxQp0XZ.js → review-settings-DHtFpGrU.js} +1 -1
  162. package/dist/client/assets/{roles-Bx1AV-1M.js → roles-DEuEeqHH.js} +1 -1
  163. package/dist/client/assets/{schema-CmTu1Qcv.js → schema-BSi9J6XG.js} +1 -1
  164. package/dist/client/assets/{scroll-area-gq3Q2AeD.js → scroll-area-CjEkqIar.js} +1 -1
  165. package/dist/client/assets/{search-input-B-_TRDC7.js → search-input-kDCevv38.js} +1 -1
  166. package/dist/client/assets/{secrets-C8NxHpd-.js → secrets-FJlGtZJz.js} +1 -1
  167. package/dist/client/assets/{sections-editor-Bh7OpK8E.js → sections-editor-Db_XanCD.js} +1 -1
  168. package/dist/client/assets/{select-DamLPfhf.js → select-Dx7GTm0n.js} +1 -1
  169. package/dist/client/assets/{select-model-QU5hzlSe.js → select-model-BkS3JCk0.js} +1 -1
  170. package/dist/client/assets/{self-tool-result-Lz_-Z0nG.js → self-tool-result-9rkDiIrM.js} +1 -1
  171. package/dist/client/assets/{seo-editor-DwIreVEK.js → seo-editor-BLeAZw1O.js} +1 -1
  172. package/dist/client/assets/settings-layout-B0kIHXCh.js +1 -0
  173. package/dist/client/assets/{settings-sidebar-BfPvugP6.js → settings-sidebar-BAeW8psv.js} +1 -1
  174. package/dist/client/assets/{shell-controls-CeHXl7mZ.js → shell-controls-jJMoCrxb.js} +1 -1
  175. package/dist/client/assets/{shell-layout-CBZfZSo4.js → shell-layout-r6wI2dxA.js} +1 -1
  176. package/dist/client/assets/{skill-preview-Cq3_PFMf.js → skill-preview-BV5lD9Ur.js} +1 -1
  177. package/dist/client/assets/{skills-BHXTZ7NQ.js → skills-mHNv9mjy.js} +1 -1
  178. package/dist/client/assets/{sso-DU8cw1b0.js → sso-DQXV-Z9b.js} +1 -1
  179. package/dist/client/assets/{store-BVdwdwPL.js → store-B5QBWbgI.js} +1 -1
  180. package/dist/client/assets/store-registry-8k7WpgtY.js +2 -0
  181. package/dist/client/assets/{switch-Mdu4u0WR.js → switch-U7uzAFmD.js} +1 -1
  182. package/dist/client/assets/{synced-repos-DaH0mQuQ.js → synced-repos-CPCzRDss.js} +1 -1
  183. package/dist/client/assets/{table-D3m7ArKR.js → table-D3Y6ENY8.js} +1 -1
  184. package/dist/client/assets/{tabs-C6SXoslH.js → tabs-DuT8Yq6b.js} +1 -1
  185. package/dist/client/assets/{task-board-BR_hukMd.js → task-board-DWHUF-M8.js} +1 -1
  186. package/dist/client/assets/{task-route-Dm9sxint.js → task-route-CushdBcU.js} +1 -1
  187. package/dist/client/assets/{tasks-BRPJVj0A.js → tasks-Bj-Geic7.js} +1 -1
  188. package/dist/client/assets/{textarea-DoEBjnc4.js → textarea-bCfy8lu-.js} +1 -1
  189. package/dist/client/assets/{thread-intent-1OmKxTfG.js → thread-intent-CisrByhq.js} +1 -1
  190. package/dist/client/assets/{thread-route-xvjmSQIh.js → thread-route-b08GDb6K.js} +1 -1
  191. package/dist/client/assets/{toggle-group-CNANG2fZ.js → toggle-group-3YvrBCWM.js} +1 -1
  192. package/dist/client/assets/{toolbar-B341Epq4.js → toolbar-BtJG1jFO.js} +1 -1
  193. package/dist/client/assets/{toolbar-icon-button-BO82E-n0.js → toolbar-icon-button-CCWdMNhD.js} +1 -1
  194. package/dist/client/assets/{track-Bj2VKdRl.js → track-CIoIWcra.js} +1 -1
  195. package/dist/client/assets/{types-DLFi4V7L.js → types-BL_Cd649.js} +1 -1
  196. package/dist/client/assets/{use-ai-providers-tSdCWAm9.js → use-ai-providers-ZNJMa2Qe.js} +1 -1
  197. package/dist/client/assets/{use-automations-DjM5YwJ5.js → use-automations-CO5qll04.js} +1 -1
  198. package/dist/client/assets/{use-autosave-DdDTzW-p.js → use-autosave-CWnBHJNw.js} +1 -1
  199. package/dist/client/assets/{use-connection--sEuYWk0.js → use-connection-BY4RTRF-.js} +1 -1
  200. package/dist/client/assets/{use-copy-IMBiDrGI.js → use-copy-MarDfxAW.js} +1 -1
  201. package/dist/client/assets/{use-create-virtual-mcp-DsfSBfvB.js → use-create-virtual-mcp-BZY8HplW.js} +1 -1
  202. package/dist/client/assets/{use-debounced-autosave-DyX30vD8.js → use-debounced-autosave-CKZ9WmVu.js} +1 -1
  203. package/dist/client/assets/{use-debounced-value-DS9pfZWp.js → use-debounced-value-DM_0TZ22.js} +1 -1
  204. package/dist/client/assets/{use-decopilot-events-DNS0SnLr.js → use-decopilot-events-GHwUJFdQ.js} +1 -1
  205. package/dist/client/assets/{use-delete-connection-DIc-Qfav.js → use-delete-connection-p_Lc_Grq.js} +1 -1
  206. package/dist/client/assets/{use-deployment-admin-CH4neEKc.js → use-deployment-admin-BZ1DWC9e.js} +1 -1
  207. package/dist/client/assets/{use-destination-route-7JP5O6OJ.js → use-destination-route-BbzQn-n1.js} +1 -1
  208. package/dist/client/assets/{use-file-configs-CUpgfUZo.js → use-file-configs-Dme4FNCs.js} +1 -1
  209. package/dist/client/assets/{use-infinite-scroll-BYZDUtLT.js → use-infinite-scroll-BnNCHFKn.js} +1 -1
  210. package/dist/client/assets/{use-join-requests-DLCB2F3F.js → use-join-requests-Camfhmzs.js} +1 -1
  211. package/dist/client/assets/{use-mcp-auth-status-DS3icTNp.js → use-mcp-auth-status-DwCKSgFq.js} +1 -1
  212. package/dist/client/assets/{use-mcp-client-BkpxeCP2.js → use-mcp-client-CLQpYb65.js} +1 -1
  213. package/dist/client/assets/{use-mcp-prompts-DCcZ3Vir.js → use-mcp-prompts-B4YApHQz.js} +1 -1
  214. package/dist/client/assets/{use-mcp-tools-zprouZ07.js → use-mcp-tools-DxNdkpqp.js} +1 -1
  215. package/dist/client/assets/{use-members-CI2nYVE7.js → use-members-Nw1pRVDm.js} +1 -1
  216. package/dist/client/assets/{use-navigate-to-agent-ChEjWy4D.js → use-navigate-to-agent-BP5fBiR_.js} +1 -1
  217. package/dist/client/assets/{use-org-auth-client-S97f03iK.js → use-org-auth-client-CKoQfJfQ.js} +1 -1
  218. package/dist/client/assets/{use-org-sso-BjH4Z9oA.js → use-org-sso-DaGSGBc8.js} +1 -1
  219. package/dist/client/assets/{use-organization-roles-CPwpLNzf.js → use-organization-roles-G6vi9RUF.js} +1 -1
  220. package/dist/client/assets/{use-organization-settings-BPN8rXNO.js → use-organization-settings-Bj_N-FZ1.js} +1 -1
  221. package/dist/client/assets/{use-panel-navigate-fLU7dGE0.js → use-panel-navigate-ChqtBgPV.js} +1 -1
  222. package/dist/client/assets/{use-project-scope-BgyywlH_.js → use-project-scope-DuXQlLft.js} +1 -1
  223. package/dist/client/assets/{use-registry-connections-Dzb0fhHm.js → use-registry-connections-DzkmhEYo.js} +1 -1
  224. package/dist/client/assets/{use-secrets-Dts0cF77.js → use-secrets-CPol22BF.js} +1 -1
  225. package/dist/client/assets/{use-section-preview-base-D94KMpp4.js → use-section-preview-base-CIXOY0XP.js} +1 -1
  226. package/dist/client/assets/{use-status-sounds-DHbTO7IH.js → use-status-sounds-DjB7YACH.js} +1 -1
  227. package/dist/client/assets/{use-tags-C7VYYpbH.js → use-tags-DhPuQwXu.js} +1 -1
  228. package/dist/client/assets/{use-view-mode-DsDWXQJ2.js → use-view-mode-XpzZpQOU.js} +1 -1
  229. package/dist/client/assets/{use-virtual-mcp-BhEuXWFl.js → use-virtual-mcp-Dc_tNJd3.js} +1 -1
  230. package/dist/client/assets/useInfiniteQuery-DYvex915.js +1 -0
  231. package/dist/client/assets/useSuspenseInfiniteQuery-zzJOxA7J.js +1 -0
  232. package/dist/client/assets/{users-CuirzC-v.js → users-B-Fjt6R6.js} +1 -1
  233. package/dist/client/assets/{variant-calendar-Bhuv7S39.js → variant-calendar-BXwjNPsZ.js} +1 -1
  234. package/dist/client/assets/{view-mode-toggle-CvuuImgL.js → view-mode-toggle-BMxnYhp9.js} +1 -1
  235. package/dist/client/index.html +1 -1
  236. package/dist/server/cli.js +2 -2
  237. package/dist/server/server.js +2 -2
  238. package/package.json +1 -1
  239. package/dist/client/assets/agents-list-D2gG4rxl.js +0 -1
  240. package/dist/client/assets/api-keys-aPYST39a.js +0 -1
  241. package/dist/client/assets/org-layout-H_iF2Jpr.js +0 -1
  242. package/dist/client/assets/record-editor-C1_htYBv.js +0 -1
  243. package/dist/client/assets/redirect-editor-Cj58js0D.js +0 -1
  244. package/dist/client/assets/registry-Blrslzvj.js +0 -2
  245. package/dist/client/assets/settings-layout-C-8zm3_h.js +0 -1
  246. package/dist/client/assets/store-registry-DUIUtqr7.js +0 -2
  247. package/dist/client/assets/useInfiniteQuery-BNd4lP3z.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-DOhopmGX.js +0 -1
@@ -1 +1 @@
1
- import{bW as Ds,c as R,l as X,j as s,h as He,r as G,I as Gt,G as ws,o as Z,b as Q,b6 as As,W as ge,d as qt,a6 as Qt,_ as Wt,L as Is,a1 as $e,a2 as Oe,a4 as Re,a as Ct,F as Ts,ar as Bs,as as Fs,B as be,t as oe,H as Ps,J as Es,K as ye,n as vt,a7 as kt,m as Yt,e as Le,bm as Ms,ap as Ls}from"./index-CW6L2S49.js";import{c as Xt,u as $s,d as Jt}from"./thread-route-xvjmSQIh.js";import{t as Ve}from"./ChevronUp-DDdMqJL1.js";import{A as Zt,N as Os,s as dt,aL as Rs,aM as Ks,aN as Ft,aO as zs,t as Vs,aP as Us,a6 as Hs,aQ as Gs,o as qs,aR as Qs,a4 as ut,a3 as Ws,aa as Ys}from"./agent-icon-RpsSZWOm.js";import{a as es,i as Xs,e as Js,S as Zs,f as en}from"./constants-DNuUCxmW.js";import{b as Nt,u as tn}from"./use-virtual-mcp-BhEuXWFl.js";import{g as sn}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-BO82E-n0.js";import{P as nt,a as ze,b as ot}from"./popover-Cfo1Nvgv.js";import{D as _t,a as St,b as Dt,c as nn,e as on,f as ss,g as ns,d as an}from"./drawer-F0hkjkWK.js";import{i as ln}from"./SearchMd-CQywkGC8.js";import{i as Ge}from"./Check-Bu3XsPtR.js";import{s as Qe}from"./Plus-BsdY3vta.js";import{G as ht,a as rn}from"./github-repo-picker-B1n6OBj4.js";import{g as cn,u as dn,b as os}from"./hooks-bhKP99Ax.js";import{g as un,b as as}from"./use-project-scope-BgyywlH_.js";import{b as fn,c as mn,a as gn}from"./use-navigate-to-agent-ChEjWy4D.js";import{u as ls}from"./shell-layout-CBZfZSo4.js";import{d as pn}from"./thread-intent-1OmKxTfG.js";import{C as hn}from"./collection-search-Byf9covb.js";import{g as xn,b as jn,a as bn,e as yn}from"./extract-connection-data-DcfPnaRL.js";import{u as is,a as rs,g as Cn,C as ft}from"./connection-card-kBzgkq3q.js";import{D as cs,b as ds,c as us,d as fs,h as vn,e as kn}from"./dialog-lVg2I_FW.js";import{d as ce,a as de,e as ue,b as fe,c as me,F as Pt}from"./form-BzptyBk4.js";import{I as _e}from"./input-DPKIPveM.js";import{S as Nn,a as _n,b as Sn,c as Dn,d as Ue}from"./select-DamLPfhf.js";import{T as wn}from"./textarea-DoEBjnc4.js";import{b as ms}from"./use-connection--sEuYWk0.js";import{n as et,a as mt,i as gs}from"./Tool02-C5-ESFs5.js";import{b as An,d as In}from"./UserSquare-B19aw2mP.js";import{s as Tn}from"./XClose-D_sSgqWY.js";import{c as Bn,i as Xe,a as Et,E as Fn,p as Pn,b as En,d as Mn}from"./connection-form-helpers-CkY6wGpq.js";import{a as gt}from"./authenticate-and-persist-oauth-CczjH39y.js";import{g as Ln}from"./connection-slug-CITJ0kGN.js";import{C as $n}from"./collection-tabs-4YD6nwky.js";import{u as Mt}from"./use-infinite-scroll-BYZDUtLT.js";import{B as Je}from"./badge-C7G_dwIu.js";import{u as On}from"./useSuspenseInfiniteQuery-DOhopmGX.js";import{u as Rn}from"./use-mcp-client-BkpxeCP2.js";import{g as tt}from"./metadata-dUsYcpuu.js";import{u as Kn}from"./use-ai-providers-tSdCWAm9.js";import{T as zn,C as wt,c as Vn,d as Un,S as xt}from"./task-board-BR_hukMd.js";import{t as Hn}from"./decopilot-sse-pool-Ccw1vgMp.js";import{u as Gn}from"./use-decopilot-events-DNS0SnLr.js";import{A as Lt}from"./avatar-D7BI9kIY.js";import{h as st,D as ps,b as hs,g as xs,c as js}from"./dropdown-menu-QVhpTnbw.js";import{a as At,c as It,d as ve,e as qe,b as Tt,C as Bt}from"./command-Bz-l73oK.js";import{s as qn}from"./TrendUp01-0nrjwpEZ.js";import{a as Qn}from"./Settings02-B3BHuFlc.js";import{s as $t}from"./User01-yXo0r48U.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{i as Wn}from"./AlertCircle-DlZdUT4y.js";import{i as Yn}from"./CheckCircle-DKTcHnyM.js";import{a as bs}from"./DotsVertical-PUVVFLTP.js";import{s as Xn}from"./Eye-Z_2DhwO_.js";import{i as Jn}from"./Shield01-CfLUCs7T.js";const Zn=Ds("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 eo(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(ln,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=m):m=e[5];let g;e[6]!==a?(g=_=>a(_.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 to(t,e,n){if(!n)return null;const a=cn(t,e);return a?a.threads.get().find(l=>l.id===n)?.branch??null:null}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(eo,{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(Is,{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(ys,{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(ys,{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}=dn(),{locator:a}=ge(),i=Xt(),l=$s();return async o=>{const d=crypto.randomUUID(),c=o===l?to(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 ys(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(44),{onClose:n,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:l}=t,[o,d]=G.useState(""),c=G.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=mn(),h=go(m.slug),x=un(p),b=c.toLowerCase(),_=r.filter(bo).filter(z=>!x.has(z.id)).filter(jo),y=_.filter(xo),N=_.filter(ho),k=es(m.id),C=!c||k.title.toLowerCase().includes(b),w=!!(a&&C);let j;e[2]!==n||e[3]!==a?(j=()=>{a?.(null),n(),d("")},e[2]=n,e[3]=a,e[4]=j):j=e[4];const S=j;let D;e[5]!==g||e[6]!==h||e[7]!==n||e[8]!==a?(D=z=>{if(a){a(z.id),n(),d("");return}g(),n(),d(""),h(z.id)},e[5]=g,e[6]=h,e[7]=n,e[8]=a,e[9]=D):D=e[9];const I=D,M="flex flex-col max-h-[min(640px,80dvh)]";let v;e[10]!==o?(v=s.jsx(so,{value:o,onChange:d}),e[10]=o,e[11]=v):v=e[11];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let T;e[12]!==k||e[13]!==a||e[14]!==S||e[15]!==i||e[16]!==C?(T=a&&C&&k&&s.jsx(pt,{agent:k,selected:!i||i===k.id,onClick:S}),e[12]=k,e[13]=a,e[14]=S,e[15]=i,e[16]=C,e[17]=T):T=e[17];const O=(y.length>0||!c)&&s.jsx(lo,{onImportFromGithub:l});let B;e[18]!==I||e[19]!==a||e[20]!==i?(B=z=>s.jsx(pt,{agent:z,selected:a?i===z.id:void 0,onClick:()=>I(z)},z.id),e[18]=I,e[19]=a,e[20]=i,e[21]=B):B=e[21];const F=y.map(B),$=N.length>0&&s.jsx(ao,{});let U;e[22]!==I||e[23]!==a||e[24]!==i?(U=z=>s.jsx(pt,{agent:z,selected:a?i===z.id:void 0,onClick:()=>I(z)},z.id),e[22]=I,e[23]=a,e[24]=i,e[25]=U):U=e[25];const P=N.map(U);let K;e[26]!==w||e[27]!==c||e[28]!==_.length?(K=_.length===0&&!w&&c&&s.jsx(no,{}),e[26]=w,e[27]=c,e[28]=_.length,e[29]=K):K=e[29];let L;e[30]!==F||e[31]!==$||e[32]!==P||e[33]!==K||e[34]!==T||e[35]!==O?(L=s.jsxs("div",{className:A,children:[T,O,F,$,P,K]}),e[30]=F,e[31]=$,e[32]=P,e[33]=K,e[34]=T,e[35]=O,e[36]=L):L=e[36];let V;e[37]!==n||e[38]!==m?(V=s.jsx(oo,{org:m,onClose:n}),e[37]=n,e[38]=m,e[39]=V):V=e[39];let J;return e[40]!==L||e[41]!==V||e[42]!==v?(J=s.jsxs("div",{className:M,children:[v,L,V]}),e[40]=L,e[41]=V,e[42]=v,e[43]=J):J=e[43],J}function ho(t){return!as(t.metadata)}function xo(t){return as(t.metadata)}function jo(t){return!Js(t.id)}function bo(t){return!Xs(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]=G.useState(!1),[m,g]=G.useState(!1),h=Gt(),{setOpenMobile:x}=ws(),b=fn(),_=b?"border border-border":void 0;let y;e[0]!==b?(y=v=>b?s.jsx(mo,{children:v}):v,e[0]=b,e[1]=y):y=e[1];const N=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,S=p&&s.jsx(G.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(As,{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?G.cloneElement(a,{onClick:v=>{a.props.onClick?.(v),r(!0)}}):c?N(s.jsx(io,{setOpen:r,emptyCtaClass:_})):s.jsx(ro,{setOpen:r,highlightEmpty:b,emptyCtaClass:_}),s.jsx(_t,{open:p,onOpenChange:r,direction:"bottom",children:s.jsxs(St,{className:"max-h-[85dvh] p-0",children:[s.jsx(co,{}),S]})})]}):s.jsxs(nt,{open:p,onOpenChange:v=>{v&&!p&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(v)},children:[a?s.jsx(ze,{asChild:!0,children:a}):c?N(s.jsx(ze,{asChild:!0,children:s.jsx(uo,{emptyCtaClass:_})})):s.jsx(fo,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:_}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:u,align:f,children:S})]});let I;e[8]!==m||e[9]!==g?(I=s.jsx(rn,{open:m,onOpenChange:g,mode:"agent"}),e[8]=m,e[9]=g,e[10]=I):I=e[10];let M;return e[11]!==D||e[12]!==I?(M=s.jsxs(s.Fragment,{children:[D,I]}),e[11]=D,e[12]=I,e[13]=M):M=e[13],M}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?pn(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=tn(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 _;e[19]!==x?(_=s.jsxs("button",{type:"button",className:vo,children:[x,b]}),e[19]=x,e[20]=_):_=e[20];let y;e[21]!==n||e[22]!==l||e[23]!==_?(y=s.jsx(yo,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:_}),e[21]=n,e[22]=l,e[23]=_,e[24]=y):y=e[24];let N;return e[25]!==y||e[26]!==p||e[27]!==h?(N=s.jsxs("div",{className:p,children:[h,y]}),e[25]=y,e[26]=p,e[27]=h,e[28]=N):N=e[28],N}function ml(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(S=>S.id===C),j=gn(l,C,d?.user?.id,f(C),!!(w&&sn(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 _=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 N;return e[17]!==g||e[18]!==x||e[19]!==_||e[20]!==y?(N=s.jsx(G.Suspense,{fallback:b,children:s.jsx(ko,{agentId:g,fallback:_,onOpenHome:y,onPick:x})}),e[17]=g,e[18]=x,e[19]=_,e[20]=y,e[21]=N):N=e[21],N}function gl(){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(Os,{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}=Ts(),d=Gt(),c=ms(),u=is(),p=rs(u,"").items,r=Bs({resolver:Fs(Bn),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 S=j.trim();if(!S)return;const D=!!r.formState.dirtyFields.title,I=!!r.formState.dirtyFields.description,M=!!r.formState.dirtyFields.env_vars,v=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}),!M&&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=Pn(S);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}),v(Xe({uiType:"NPX",npxPackage:A.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const T=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",S,{shouldDirty:!0}),v(Xe({uiType:T,connectionUrl:S})??Et({uiType:T,connectionUrl:S,registryItems:p}));return}m==="NPX"&&v(Xe({uiType:"NPX",npxPackage:S}))},_=j=>{j||r.reset(),e(j)},y=async j=>{let S,D=null,I=null,M=null;j.ui_type==="NPX"?(S="STDIO",D="",M=En(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(S="STDIO",D="",M=Mn(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(S=j.ui_type,D=j.connection_url||"",I=j.connection_token||null);const v=xn("conn");try{await c.create.mutateAsync({id:v,title:j.title,description:j.description||null,connection_type:S,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:M,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),n?.(v)}catch{oe.error(a("connections.createConnectionDialog.failedToCreateConnection"))}},N=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(Nn,{value:j.value,onValueChange:j.onChange,children:[s.jsx(fe,{children:s.jsx(_n,{children:s.jsx(Sn,{})})}),s.jsxs(Dn,{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(An,{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:S=>{const D=S.clipboardData.getData("text");D&&(S.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),b(D))},onBlur:S=>{b(S.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(Fn,{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:S=>{const D=S.clipboardData.getData("text");D&&(S.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),b(D))},onBlur:S=>{b(S.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(wn,{placeholder:a("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),s.jsx(me,{})]})})]});return d?s.jsx(_t,{open:t,onOpenChange:_,children:s.jsxs(St,{className:"max-h-[90vh]",children:[s.jsx(nn,{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:N}),s.jsx(on,{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(Tn,{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:_,children:s.jsxs(ds,{className:"sm:max-w-[525px]",children:[s.jsxs(us,{children:[s.jsx(fs,{children:N}),s.jsx(vn,{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(kn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>_(!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=G.useDeferredValue(u),_=u!==b;let y;e[0]!==b?(y=b.trim().toLowerCase(),e[0]=b,e[1]=y):y=e[1];const N=y;let k;e[2]!==g?(k=E=>E??g,e[2]=g,e[3]=k):k=e[3];const[C,w]=Ps(Es.connectionsTab(x.slug)+(g==="all"?":home-modal":":agent-modal"),k);let j;e[4]!==C||e[5]!==w?(j=E=>{E!==C&&Z("connections_dialog_tab_changed",{to_tab:E}),w(E)},e[4]=C,e[5]=w,e[6]=j):j=e[6];const S=j;let D;e[7]!==x.id||e[8]!==x.slug?(D={connectionId:Zs,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=D):D=e[9];const I=Rn(D),M=b?.trim().split(/\s+/).filter(Boolean)??[],v=M.length>0?{operator:"or",conditions:M.flatMap(Fo)}:void 0,A={...v&&{where:v},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:O,fetchNextPage:B,hasNextPage:F,isFetchingNextPage:$}=On({queryKey:ye.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async E=>{const{pageParam:Y}=E,je=Y===void 0?0:Y;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...v&&{where:v},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:je}})).structuredContent},initialPageParam:0,getNextPageParam:To,staleTime:3e4}),U=O?.pages.flatMap(Io)??[],P=Cn(U),K=new Set(U.filter(Ao).map(wo)),L=is(),V=rs(L,b),J=Mt(V.loadMore,V.hasMore,V.isLoadingMore),z=Mt(B,F??!1,$),W=C==="all"||!!N,pe=W?V.items.filter(E=>{const Y=jn(E);if(Y&&K.has(Y))return!1;if(!N)return!0;const je=tt(E._meta),ke=[E.title,E.description,E.name,E.server?.title,E.server?.description,E.server?.name,je?.friendly_name,je?.friendlyName].filter(Boolean).join(" ").toLowerCase();return M.some(re=>ke.includes(re.toLowerCase()))}):[],te=pe.filter(Do),se=pe.filter(So);let ae;e[10]!==i?(ae=E=>E.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=(E,Y,je,ke,re)=>{const Ye=ie(re),Me=re.find(Ne=>!i.has(Ne.id)),ne=re[0];if(m==="browse"){const Ne=Ln(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)}},E)}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")})]})},E)},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=E=>{const Y=tt(E._meta),je=Y?.friendlyName||Y?.friendly_name||E.server?.title||E.title||E.server?.name||E.name||E.id||"",ke=E.server?.description||E.description||null,re=E.server?.icons?.[0]?.src||bn(E.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:E.id,app_name:Y?.friendlyName||E.server?.name||E.name||null}),d(E)},children:c===E.id?s.jsx(He,{className:"size-3.5"}):h(m==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${E.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]!==S||e[29]!==f||e[30]!==N||e[31]!==h?(ee=!N&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx($n,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:E=>S(E)}),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]=S,e[29]=f,e[30]=N,e[31]=h,e[32]=ee):ee=e[32];const Ce=_&&"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=E=>{if(E.type==="group")return H(E.key,E.title,E.icon,null,E.connections);const Y=E.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]!==z?(Ae=s.jsx("div",{ref:z,className:"col-span-full h-1"}),e[37]=z,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]!==J||e[42]!==L||e[43]!==W?(Te=W&&L.length>0&&s.jsx("div",{ref:J,className:"col-span-full h-1"}),e[41]=J,e[42]=L,e[43]=W,e[44]=Te):Te=e[44];let Be;e[45]!==V.isLoadingMore||e[46]!==W?(Be=W&&V.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]=V.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 pl({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:v=>{},f=(v,A,T)=>{d&&Z("agent_connection_attached",{agent_id:d,connection_id:v,app_name:A,mode:T})},[p,r]=G.useState(null),[m,g]=G.useState(a),[h,x]=G.useState(!1),[b,_]=G.useState(t);t!==b&&(_(t),t&&g(a));const{org:y}=ge(),{data:N}=Ct.useSession(),k=ms(),C=vt(),w=qt(),j=v=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:v}})},S=()=>{C.invalidateQueries({predicate:v=>{const A=v.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(v,A)=>{Z("connection_oauth_succeeded",{connection_id:v,flow:A});const T=new URL(`/api/${y.slug}/mcp/${v}`,window.location.origin);await C.invalidateQueries({queryKey:ye.isMCPAuthenticated(T.href,null)}),S()},I=async v=>{r(v.app_name??v.id);try{const T=`${v.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,B=(await k.create.mutateAsync({title:T,description:v.description??null,connection_type:v.connection_type,connection_url:v.connection_url??null,connection_token:null,icon:v.icon??null,app_name:v.app_name??null,app_id:v.app_id??null,connection_headers:v.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,v.app_name??null,"clone"),u(B)}catch(A){console.error("Failed to add connection:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},M=async v=>{if(!(!y||!N?.user?.id)){r(v.id);try{const A=yn(v,y.id,N.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:U=>k.update.mutateAsync({id:F,data:{connection_token:U}}).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(hn,{value:m,onChange:g,placeholder:l("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(G.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:M,connectingItemId:p,search:m,onCreateConnection:()=>x(!0),onBrowseNavigate:j,defaultTab:n})})]}),s.jsx(No,{open:h,onOpenChange:x,onCreated:async v=>{x(!1);const A=await gt({connectionId:v,orgId:y.id,orgSlug:y.slug,persistFallback:T=>k.update.mutateAsync({id:v,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:v,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(v,null,"custom"),u(v),e(!1);return}A.ran&&await D(v,"custom_create"),f(v,null,"custom"),u(v),e(!1)}})]})}const Rt=new Map;function hl(){const{org:t}=ge(),e=kt(),n=Kn(),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=G.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:en,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 xl(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=G.useRef(a);o.current=a;const d=G.useRef(i);d.current=i;const c=G.useRef(l);c.current=l;const u=G.useRef(null),f=G.useRef(n),p=G.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===zn?d.current?.(x.data.id):o.current(x.data)),m()};return Hn.subscribe(e,g,()=>c.current?.())}),G.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],Gn(p)}function jl(){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 bl(){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(V=>V.id===P.id?{...V,...P}:V)}),{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 _;t[24]!==m||t[25]!==g||t[26]!==h||t[27]!==x||t[28]!==b?(_={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]=_):_=t[29];const y=Le(_);let N;t[30]!==a?(N=P=>a.call("TASK_BOARD_ITEM_DELETE",{id:P}),t[30]=a,t[31]=N):N=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]!==N||t[37]!==k?(C={mutationFn:N,onSuccess:u,onError:k},t[35]=u,t[36]=N,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 S,D;t[41]!==l?(S=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]=S,t[43]=D):(S=t[42],D=t[43]);let I;t[44]!==u||t[45]!==j||t[46]!==S||t[47]!==D?(I={mutationFn:j,onSuccess:S,onError:D,onSettled:u},t[44]=u,t[45]=j,t[46]=S,t[47]=D,t[48]=I):I=t[48];const M=Le(I);let v;t[49]!==a?(v=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[49]=a,t[50]=v):v=t[50];let A;t[51]!==u||t[52]!==v?(A={mutationFn:v,onSuccess:u},t[51]=u,t[52]=v,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 U;return t[63]!==r||t[64]!==T||t[65]!==w||t[66]!==M||t[67]!==$||t[68]!==y?(U={create:r,update:y,remove:w,removeMany:M,link:T,rerun:$},t[63]=r,t[64]=T,t[65]=w,t[66]=M,t[67]=$,t[68]=y,t[69]=U):U=t[69],U}function Vo(t){return t.status==="rejected"}const Uo=["ended_after_delivery","superseded"];function Ho(t){return!!t&&Uo.includes(t)}function yl(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function Cl(t){return t.failureKind!=="superseded"}function Cs(t){return t.threads.some(e=>e.status==="requires_action")}function vl(t){return t.status==="in_review"&&!t.assigneeId}function kl(t){return Cs(t)}function Nl(t){return t.status==="in_progress"&&Cs(t)?"text-warning animate-pulse":ks(t.status).iconClassName}function _l(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!Ho(n.failureKind))?"failed":null}function Sl(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 Dl(t,e){return Array.from({length:e},(n,a)=>t-(e-1-a)*1e-4)}const Go=["archived"],vs={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Wn,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:bs,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Hs,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Xn,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Us,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:In,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:Vs,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Yn,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Ms,iconClassName:"text-muted-foreground"}},qo={icon:bs,iconClassName:"text-muted-foreground"},Qo=vs;function ks(t){return Qo[t]??qo}function wl(t,e){const n=vs[t];return{label:n?e(n.labelKey):t,visual:ks(t)}}const Al=["bug","feature","chore","spike","security"],Il={bug:{labelKey:"taskBoard.config.typeBug",icon:Zn,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Qs,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:qs,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:Gs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Jn,iconClassName:"text-purple-500"}};function jt(t){return Un.includes(t)}function Tl(t){return wt.filter(e=>t||!jt(e))}function Bl({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 Fl({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:zs,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:Ks,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:Rs,iconClassName:"text-destructive"}};function Pl(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??Vn} var(--user-color-strength), transparent)`}const bt="__unassigned__",yt="__no_repo__",Ke="__any__",Ns={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 _s(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 El(t,e){const n=e.search.trim().toLowerCase();if(n!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(n)&&!_s(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]=G.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,_=l&&"ml-auto";let y;e[28]!==_?(y=X("shrink-0 opacity-60",_),e[28]=_,e[29]=y):y=e[29];const N=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]!==N?(C=s.jsx(Ve,{size:12,className:N}),e[32]=N,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 S;e[41]!==o?(S=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=o,e[42]=S):S=e[42];let D;e[43]!==j||e[44]!==S?(D=s.jsx(At,{placeholder:j,"aria-label":S,className:"h-9"}),e[43]=j,e[44]=S,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 M;e[48]!==I?(M=s.jsx(It,{children:I}),e[48]=I,e[49]=M):M=e[49];let v;e[50]!==o?(v=o("taskBoard.taskFilters.assigneeAnyone"),e[50]=o,e[51]=v):v=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]!==v||e[57]!==A||e[58]!==T?(O=s.jsx(ve,{value:v,onSelect:A,children:T}),e[56]=v,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 U;e[65]!==o?(U=o("taskBoard.taskFilters.assigneeUnassigned"),e[65]=o,e[66]=U):U=e[66];let P;e[67]!==B||e[68]!==F||e[69]!==U?(P=s.jsxs(ve,{value:B,onSelect:F,className:"gap-2",children:[$,U]}),e[67]=B,e[68]=F,e[69]=U,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 V;e[75]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Kt,{size:16}),e[75]=V):V=e[75];let J;e[76]!==o?(J=o("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=o,e[77]=J):J=e[77];let z;e[78]!==K||e[79]!==L||e[80]!==J?(z=s.jsxs(ve,{value:K,onSelect:L,className:"gap-2",children:[V,J]}),e[78]=K,e[79]=L,e[80]=J,e[81]=z):z=e[81];let W;e[82]!==O||e[83]!==P||e[84]!==z?(W=s.jsxs(qe,{children:[O,P,z]}),e[82]=O,e[83]=P,e[84]=z,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]!==M||e[97]!==W||e[98]!==se?(ae=s.jsxs(Tt,{children:[M,W,se]}),e[96]=M,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(qn,{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 _;e[19]!==l?(_=l("taskBoard.taskFilters.priorityAnyPriority"),e[19]=l,e[20]=_):_=e[20];let y;e[21]!==_?(y=s.jsx(st,{value:Ke,children:_}),e[21]=_,e[22]=y):y=e[22];let N;e[23]!==l?(N=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]=N):N=e[24];let k;e[25]!==b||e[26]!==y||e[27]!==N||e[28]!==x?(k=s.jsx(hs,{align:"start",className:"w-40",children:s.jsxs(xs,{value:x,onValueChange:b,children:[y,N]})}),e[25]=b,e[26]=y,e[27]=N,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 _=n??Ke;let y;e[18]!==a?(y=D=>a(D===Ke?null:D),e[18]=a,e[19]=y):y=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ut,{size:16,className:"text-muted-foreground"}),e[20]=N):N=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:[N,k]}),e[23]=k,e[24]=C):C=e[24];let w;e[25]!==l?(w=Object.entries(Ht).map(D=>{const[I,M]=D,v=I==="overdue";return s.jsxs(st,{value:I,className:X("gap-2",v&&"text-destructive"),children:[s.jsx(ut,{size:16,className:X("shrink-0",v?"text-destructive":"text-muted-foreground")}),l(M)]},I)}),e[25]=l,e[26]=w):w=e[26];let j;e[27]!==_||e[28]!==y||e[29]!==C||e[30]!==w?(j=s.jsx(hs,{align:"start",className:"w-44",children:s.jsxs(xs,{value:_,onValueChange:y,children:[C,w]})}),e[27]=_,e[28]=y,e[29]=C,e[30]=w,e[31]=j):j=e[31];let S;return e[32]!==j||e[33]!==b?(S=s.jsxs(js,{children:[b,j]}),e[32]=j,e[33]=b,e[34]=S):S=e[34],S}function la(t){const e=R.c(56),{value:n,tags:a,onChange:i,block:l}=t,o=Q(),[d,c]=G.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 _=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(Ws,{size:14,className:"shrink-0"}),e[13]=a,e[14]=n[0],e[15]=n.length,e[16]=y):y=e[16];let N;e[17]!==r?(N=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=N):N=e[18];let k;e[19]!==_?(k=s.jsx(Ve,{size:12,className:_}),e[19]=_,e[20]=k):k=e[20];let C;e[21]!==y||e[22]!==N||e[23]!==k||e[24]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,N,k]})}),e[21]=y,e[22]=N,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 S;e[30]!==w||e[31]!==j?(S=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[30]=w,e[31]=j,e[32]=S):S=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 M;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],M=a.map(B),e[37]=a,e[38]=f,e[39]=n,e[40]=M}else M=e[40];let v;e[44]!==M?(v=s.jsx(qe,{children:M}),e[44]=M,e[45]=v):v=e[45];let A;e[46]!==I||e[47]!==v?(A=s.jsxs(Tt,{children:[I,v]}),e[46]=I,e[47]=v,e[48]=A):A=e[48];let T;e[49]!==S||e[50]!==A?(T=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[S,A]})}),e[49]=S,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]=G.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=z=>{i(z),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 _=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 N;e[11]!==f?(N=s.jsx("span",{className:"max-w-[12rem] truncate",children:f}),e[11]=f,e[12]=N):N=e[12];let k;e[13]!==_?(k=s.jsx(Ve,{size:12,className:_}),e[13]=_,e[14]=k):k=e[14];let C;e[15]!==N||e[16]!==k||e[17]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,N,k]})}),e[15]=N,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 S;e[23]!==w||e[24]!==j?(S=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[23]=w,e[24]=j,e[25]=S):S=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 M;e[30]!==o?(M=o("taskBoard.taskFilters.repoAnyRepo"),e[30]=o,e[31]=M):M=e[31];let v;e[32]!==r?(v=()=>r(null),e[32]=r,e[33]=v):v=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]!==M||e[37]!==v||e[38]!==A?(T=s.jsx(ve,{value:M,onSelect:v,children:A}),e[36]=M,e[37]=v,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 U;e[50]!==T||e[51]!==$?(U=s.jsxs(qe,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=U):U=e[52];let P;if(e[53]!==a||e[54]!==r||e[55]!==n){let z;e[57]!==r||e[58]!==n?(z=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]=z):z=e[59],P=a.map(z),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]!==U||e[64]!==K?(L=s.jsxs(Tt,{children:[I,U,K]}),e[62]=I,e[63]=U,e[64]=K,e[65]=L):L=e[65];let V;e[66]!==S||e[67]!==L?(V=s.jsx(ot,{align:"start",className:"w-64 p-0",children:s.jsxs(Bt,{children:[S,L]})}),e[66]=S,e[67]=L,e[68]=V):V=e[68];let J;return e[69]!==d||e[70]!==C||e[71]!==V?(J=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,V]}),e[69]=d,e[70]=C,e[71]=V,e[72]=J):J=e[72],J}function ra(t){const e=R.c(25),{value:n,onChange:a,block:i}=t,l=Q(),[o,d]=G.useState(n!==""),[c,u]=G.useState(!1),[f,p]=G.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 _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ys,{size:14}),e[6]=_):_=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:_}),e[7]=x,e[8]=y):y=e[8];let N;e[9]!==i||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==n?(N=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]=N):N=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(Ls,{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]!==N||e[23]!==k?(C=s.jsxs("div",{className:h,children:[y,N,k]}),e[20]=h,e[21]=y,e[22]=N,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 Ss(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 _;e[32]!==c||e[33]!==n.tags||e[34]!==b||e[35]!==i?(_=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]=_):_=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 N;e[42]!==c||e[43]!==d?(N=s.jsx(da,{block:c,onClick:d}),e[42]=c,e[43]=d,e[44]=N):N=e[44];let k;return e[45]!==_||e[46]!==y||e[47]!==N||e[48]!==f||e[49]!==r||e[50]!==g||e[51]!==x?(k=s.jsxs(s.Fragment,{children:[f,r,g,x,_,y,N]}),e[45]=_,e[46]=y,e[47]=N,e[48]=f,e[49]=r,e[50]=g,e[51]=x,e[52]=k):k=e[52],k}function Ml(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(Ss,{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(Ns),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 Ll(t){const e=R.c(41),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q(),[u,f]=G.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 _;e[7]!==x||e[8]!==b||e[9]!==g?(_=s.jsx(an,{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]=_):_=e[10];let y;e[11]!==c?(y=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=y):y=e[12];let N;e[13]!==y?(N=s.jsx(Dt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=N):N=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(Ss,{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(Ns),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 S;e[30]!==C||e[31]!==j?(S=s.jsxs(ns,{className:"flex-row gap-2",children:[C,j]}),e[30]=C,e[31]=j,e[32]=S):S=e[32];let D;e[33]!==S||e[34]!==N||e[35]!==k?(D=s.jsxs(St,{className:"p-0",children:[N,k,S]}),e[33]=S,e[34]=N,e[35]=k,e[36]=D):D=e[36];let I;return e[37]!==u||e[38]!==D||e[39]!==_?(I=s.jsxs(_t,{open:u,onOpenChange:f,direction:"bottom",children:[_,D]}),e[37]=u,e[38]=D,e[39]=_,e[40]=I):I=e[40],I}function $l(t,e){return Lo(t,e.keySeq)??e.id}function Ol(t,e){const n=e?.trim();if(n)return t.find(a=>_s(n,a.keySeq))??t.find(a=>a.id===n)}export{pl as A,Bl as B,_l as C,kl as D,Ns as E,Sl as F,Fl as G,El as H,Go as I,Pl as J,Co as K,Vt as L,gl as N,Ze as P,Kt as S,Il as T,$l as a,vl as b,Ko as c,ml as d,zo as e,bl as f,Yo as g,Al as h,Cs as i,Ut as j,ks as k,wl as l,xl as m,Tl as n,yl as o,Cl as p,Ho as q,vs as r,Nl as s,Lo as t,hl as u,jl as v,Ol as w,Ll as x,Ml as y,Dl as z};
1
+ import{bW as Ds,c as R,l as X,j as s,h as He,r as G,I as Gt,G as ws,o as Z,b as Q,b6 as As,W as ge,d as qt,a6 as Qt,_ as Wt,L as Is,a1 as $e,a2 as Oe,a4 as Re,a as Ct,F as Ts,ar as Bs,as as Fs,B as be,t as oe,H as Ps,J as Es,K as ye,n as vt,a7 as kt,m as Yt,e as Le,bm as Ms,ap as Ls}from"./index-Ciqhx4Es.js";import{c as Xt,u as $s,d as Jt}from"./thread-route-b08GDb6K.js";import{t as Ve}from"./ChevronUp-CHN7dU5d.js";import{A as Zt,N as Os,s as dt,aL as Rs,aM as Ks,aN as Ft,aO as zs,t as Vs,aP as Us,a6 as Hs,aQ as Gs,o as qs,aR as Qs,a4 as ut,a3 as Ws,aa as Ys}from"./agent-icon-Dj2ko6xN.js";import{a as es,i as Xs,e as Js,S as Zs,f as en}from"./constants-DNuUCxmW.js";import{b as Nt,u as tn}from"./use-virtual-mcp-Dc_tNJd3.js";import{g as sn}from"./github-repo-BpKUwJal.js";import{T as ts}from"./toolbar-icon-button-CCWdMNhD.js";import{P as nt,a as ze,b as ot}from"./popover-CRkM20y5.js";import{D as _t,a as St,b as Dt,c as nn,e as on,f as ss,g as ns,d as an}from"./drawer-CXBUq1b4.js";import{i as ln}from"./SearchMd-MV7l96VN.js";import{i as Ge}from"./Check-DiuzOTdo.js";import{s as Qe}from"./Plus-DfniZcTj.js";import{G as ht,a as rn}from"./github-repo-picker-CVdHp0M0.js";import{g as cn,u as dn,b as os}from"./hooks-y1rkw2ir.js";import{g as un,b as as}from"./use-project-scope-DuXQlLft.js";import{b as fn,c as mn,a as gn}from"./use-navigate-to-agent-BP5fBiR_.js";import{u as ls}from"./shell-layout-r6wI2dxA.js";import{d as pn}from"./thread-intent-CisrByhq.js";import{C as hn}from"./collection-search-C0aemqyU.js";import{g as xn,b as jn,a as bn,e as yn}from"./extract-connection-data-fYPcP0VJ.js";import{u as is,a as rs,g as Cn,C as ft}from"./connection-card-DZD9pIth.js";import{D as cs,b as ds,c as us,d as fs,h as vn,e as kn}from"./dialog-BVuXhd_n.js";import{d as ce,a as de,e as ue,b as fe,c as me,F as Pt}from"./form-D7fAV9eN.js";import{I as _e}from"./input-HiBvv-tS.js";import{S as Nn,a as _n,b as Sn,c as Dn,d as Ue}from"./select-Dx7GTm0n.js";import{T as wn}from"./textarea-bCfy8lu-.js";import{b as ms}from"./use-connection-BY4RTRF-.js";import{n as et,a as mt,i as gs}from"./Tool02-CtS9_9Au.js";import{b as An,d as In}from"./UserSquare-CDP0762p.js";import{s as Tn}from"./XClose-CUFBDVP-.js";import{c as Bn,i as Xe,a as Et,E as Fn,p as Pn,b as En,d as Mn}from"./connection-form-helpers-CJ7gQUqN.js";import{a as gt}from"./authenticate-and-persist-oauth-ORS2OKxY.js";import{g as Ln}from"./connection-slug-CITJ0kGN.js";import{C as $n}from"./collection-tabs-DM3JgymS.js";import{u as Mt}from"./use-infinite-scroll-BnNCHFKn.js";import{B as Je}from"./badge-CSQtV4I1.js";import{u as On}from"./useSuspenseInfiniteQuery-zzJOxA7J.js";import{u as Rn}from"./use-mcp-client-CLQpYb65.js";import{g as tt}from"./metadata-dUsYcpuu.js";import{u as Kn}from"./use-ai-providers-ZNJMa2Qe.js";import{T as zn,C as wt,c as Vn,d as Un,S as xt}from"./task-board-DWHUF-M8.js";import{t as Hn}from"./decopilot-sse-pool-B2Ek6f9E.js";import{u as Gn}from"./use-decopilot-events-GHwUJFdQ.js";import{A as Lt}from"./avatar-BLCEls6Y.js";import{h as st,D as ps,b as hs,g as xs,c as js}from"./dropdown-menu-7nrlUaMG.js";import{a as At,c as It,d as ve,e as qe,b as Tt,C as Bt}from"./command-aq94pylP.js";import{s as qn}from"./TrendUp01-Dwgdtlxo.js";import{a as Qn}from"./Settings02-DLKKNdDt.js";import{s as $t}from"./User01-CIlNhP30.js";import{g as Ot}from"./get-initials-D-f_fDFw.js";import{i as Wn}from"./AlertCircle-Dv6G1zch.js";import{i as Yn}from"./CheckCircle-BTMeEcth.js";import{a as bs}from"./DotsVertical-CsIT64BQ.js";import{s as Xn}from"./Eye-DNWGZGwG.js";import{i as Jn}from"./Shield01-Dbav6S5n.js";const Zn=Ds("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 eo(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(ln,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=m):m=e[5];let g;e[6]!==a?(g=_=>a(_.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 to(t,e,n){if(!n)return null;const a=cn(t,e);return a?a.threads.get().find(l=>l.id===n)?.branch??null:null}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(eo,{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(Is,{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(ys,{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(ys,{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}=dn(),{locator:a}=ge(),i=Xt(),l=$s();return async o=>{const d=crypto.randomUUID(),c=o===l?to(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 ys(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(44),{onClose:n,onSelectAgent:a,selectedAgentId:i,onImportFromGithub:l}=t,[o,d]=G.useState(""),c=G.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=mn(),h=go(m.slug),x=un(p),b=c.toLowerCase(),_=r.filter(bo).filter(z=>!x.has(z.id)).filter(jo),y=_.filter(xo),N=_.filter(ho),k=es(m.id),C=!c||k.title.toLowerCase().includes(b),w=!!(a&&C);let j;e[2]!==n||e[3]!==a?(j=()=>{a?.(null),n(),d("")},e[2]=n,e[3]=a,e[4]=j):j=e[4];const S=j;let D;e[5]!==g||e[6]!==h||e[7]!==n||e[8]!==a?(D=z=>{if(a){a(z.id),n(),d("");return}g(),n(),d(""),h(z.id)},e[5]=g,e[6]=h,e[7]=n,e[8]=a,e[9]=D):D=e[9];const I=D,M="flex flex-col max-h-[min(640px,80dvh)]";let v;e[10]!==o?(v=s.jsx(so,{value:o,onChange:d}),e[10]=o,e[11]=v):v=e[11];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5";let T;e[12]!==k||e[13]!==a||e[14]!==S||e[15]!==i||e[16]!==C?(T=a&&C&&k&&s.jsx(pt,{agent:k,selected:!i||i===k.id,onClick:S}),e[12]=k,e[13]=a,e[14]=S,e[15]=i,e[16]=C,e[17]=T):T=e[17];const O=(y.length>0||!c)&&s.jsx(lo,{onImportFromGithub:l});let B;e[18]!==I||e[19]!==a||e[20]!==i?(B=z=>s.jsx(pt,{agent:z,selected:a?i===z.id:void 0,onClick:()=>I(z)},z.id),e[18]=I,e[19]=a,e[20]=i,e[21]=B):B=e[21];const F=y.map(B),$=N.length>0&&s.jsx(ao,{});let U;e[22]!==I||e[23]!==a||e[24]!==i?(U=z=>s.jsx(pt,{agent:z,selected:a?i===z.id:void 0,onClick:()=>I(z)},z.id),e[22]=I,e[23]=a,e[24]=i,e[25]=U):U=e[25];const P=N.map(U);let K;e[26]!==w||e[27]!==c||e[28]!==_.length?(K=_.length===0&&!w&&c&&s.jsx(no,{}),e[26]=w,e[27]=c,e[28]=_.length,e[29]=K):K=e[29];let L;e[30]!==F||e[31]!==$||e[32]!==P||e[33]!==K||e[34]!==T||e[35]!==O?(L=s.jsxs("div",{className:A,children:[T,O,F,$,P,K]}),e[30]=F,e[31]=$,e[32]=P,e[33]=K,e[34]=T,e[35]=O,e[36]=L):L=e[36];let V;e[37]!==n||e[38]!==m?(V=s.jsx(oo,{org:m,onClose:n}),e[37]=n,e[38]=m,e[39]=V):V=e[39];let J;return e[40]!==L||e[41]!==V||e[42]!==v?(J=s.jsxs("div",{className:M,children:[v,L,V]}),e[40]=L,e[41]=V,e[42]=v,e[43]=J):J=e[43],J}function ho(t){return!as(t.metadata)}function xo(t){return as(t.metadata)}function jo(t){return!Js(t.id)}function bo(t){return!Xs(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]=G.useState(!1),[m,g]=G.useState(!1),h=Gt(),{setOpenMobile:x}=ws(),b=fn(),_=b?"border border-border":void 0;let y;e[0]!==b?(y=v=>b?s.jsx(mo,{children:v}):v,e[0]=b,e[1]=y):y=e[1];const N=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,S=p&&s.jsx(G.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(As,{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?G.cloneElement(a,{onClick:v=>{a.props.onClick?.(v),r(!0)}}):c?N(s.jsx(io,{setOpen:r,emptyCtaClass:_})):s.jsx(ro,{setOpen:r,highlightEmpty:b,emptyCtaClass:_}),s.jsx(_t,{open:p,onOpenChange:r,direction:"bottom",children:s.jsxs(St,{className:"max-h-[85dvh] p-0",children:[s.jsx(co,{}),S]})})]}):s.jsxs(nt,{open:p,onOpenChange:v=>{v&&!p&&Z("agent_browser_opened",{surface:"desktop_popover"}),r(v)},children:[a?s.jsx(ze,{asChild:!0,children:a}):c?N(s.jsx(ze,{asChild:!0,children:s.jsx(uo,{emptyCtaClass:_})})):s.jsx(fo,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:_}),s.jsx(ot,{className:"w-[380px] p-0 overflow-hidden",side:u,align:f,children:S})]});let I;e[8]!==m||e[9]!==g?(I=s.jsx(rn,{open:m,onOpenChange:g,mode:"agent"}),e[8]=m,e[9]=g,e[10]=I):I=e[10];let M;return e[11]!==D||e[12]!==I?(M=s.jsxs(s.Fragment,{children:[D,I]}),e[11]=D,e[12]=I,e[13]=M):M=e[13],M}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?pn(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=tn(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 _;e[19]!==x?(_=s.jsxs("button",{type:"button",className:vo,children:[x,b]}),e[19]=x,e[20]=_):_=e[20];let y;e[21]!==n||e[22]!==l||e[23]!==_?(y=s.jsx(yo,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:l,trigger:_}),e[21]=n,e[22]=l,e[23]=_,e[24]=y):y=e[24];let N;return e[25]!==y||e[26]!==p||e[27]!==h?(N=s.jsxs("div",{className:p,children:[h,y]}),e[25]=y,e[26]=p,e[27]=h,e[28]=N):N=e[28],N}function ml(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(S=>S.id===C),j=gn(l,C,d?.user?.id,f(C),!!(w&&sn(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 _=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 N;return e[17]!==g||e[18]!==x||e[19]!==_||e[20]!==y?(N=s.jsx(G.Suspense,{fallback:b,children:s.jsx(ko,{agentId:g,fallback:_,onOpenHome:y,onPick:x})}),e[17]=g,e[18]=x,e[19]=_,e[20]=y,e[21]=N):N=e[21],N}function gl(){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(Os,{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}=Ts(),d=Gt(),c=ms(),u=is(),p=rs(u,"").items,r=Bs({resolver:Fs(Bn),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 S=j.trim();if(!S)return;const D=!!r.formState.dirtyFields.title,I=!!r.formState.dirtyFields.description,M=!!r.formState.dirtyFields.env_vars,v=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}),!M&&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=Pn(S);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}),v(Xe({uiType:"NPX",npxPackage:A.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const T=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",T,{shouldDirty:!0}),r.setValue("connection_url",S,{shouldDirty:!0}),v(Xe({uiType:T,connectionUrl:S})??Et({uiType:T,connectionUrl:S,registryItems:p}));return}m==="NPX"&&v(Xe({uiType:"NPX",npxPackage:S}))},_=j=>{j||r.reset(),e(j)},y=async j=>{let S,D=null,I=null,M=null;j.ui_type==="NPX"?(S="STDIO",D="",M=En(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(S="STDIO",D="",M=Mn(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(S=j.ui_type,D=j.connection_url||"",I=j.connection_token||null);const v=xn("conn");try{await c.create.mutateAsync({id:v,title:j.title,description:j.description||null,connection_type:S,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:M,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),r.reset(),e(!1),n?.(v)}catch{oe.error(a("connections.createConnectionDialog.failedToCreateConnection"))}},N=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(Nn,{value:j.value,onValueChange:j.onChange,children:[s.jsx(fe,{children:s.jsx(_n,{children:s.jsx(Sn,{})})}),s.jsxs(Dn,{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(An,{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:S=>{const D=S.clipboardData.getData("text");D&&(S.preventDefault(),r.setValue("npx_package",D.trim(),{shouldDirty:!0}),b(D))},onBlur:S=>{b(S.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(Fn,{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:S=>{const D=S.clipboardData.getData("text");D&&(S.preventDefault(),r.setValue("connection_url",D.trim(),{shouldDirty:!0}),b(D))},onBlur:S=>{b(S.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(wn,{placeholder:a("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),s.jsx(me,{})]})})]});return d?s.jsx(_t,{open:t,onOpenChange:_,children:s.jsxs(St,{className:"max-h-[90vh]",children:[s.jsx(nn,{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:N}),s.jsx(on,{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(Tn,{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:_,children:s.jsxs(ds,{className:"sm:max-w-[525px]",children:[s.jsxs(us,{children:[s.jsx(fs,{children:N}),s.jsx(vn,{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(kn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>_(!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=G.useDeferredValue(u),_=u!==b;let y;e[0]!==b?(y=b.trim().toLowerCase(),e[0]=b,e[1]=y):y=e[1];const N=y;let k;e[2]!==g?(k=E=>E??g,e[2]=g,e[3]=k):k=e[3];const[C,w]=Ps(Es.connectionsTab(x.slug)+(g==="all"?":home-modal":":agent-modal"),k);let j;e[4]!==C||e[5]!==w?(j=E=>{E!==C&&Z("connections_dialog_tab_changed",{to_tab:E}),w(E)},e[4]=C,e[5]=w,e[6]=j):j=e[6];const S=j;let D;e[7]!==x.id||e[8]!==x.slug?(D={connectionId:Zs,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=D):D=e[9];const I=Rn(D),M=b?.trim().split(/\s+/).filter(Boolean)??[],v=M.length>0?{operator:"or",conditions:M.flatMap(Fo)}:void 0,A={...v&&{where:v},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(A),{data:O,fetchNextPage:B,hasNextPage:F,isFetchingNextPage:$}=On({queryKey:ye.collectionListInfinite(I,x.id,"","CONNECTIONS",T),queryFn:async E=>{const{pageParam:Y}=E,je=Y===void 0?0:Y;return(await I.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...v&&{where:v},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:je}})).structuredContent},initialPageParam:0,getNextPageParam:To,staleTime:3e4}),U=O?.pages.flatMap(Io)??[],P=Cn(U),K=new Set(U.filter(Ao).map(wo)),L=is(),V=rs(L,b),J=Mt(V.loadMore,V.hasMore,V.isLoadingMore),z=Mt(B,F??!1,$),W=C==="all"||!!N,pe=W?V.items.filter(E=>{const Y=jn(E);if(Y&&K.has(Y))return!1;if(!N)return!0;const je=tt(E._meta),ke=[E.title,E.description,E.name,E.server?.title,E.server?.description,E.server?.name,je?.friendly_name,je?.friendlyName].filter(Boolean).join(" ").toLowerCase();return M.some(re=>ke.includes(re.toLowerCase()))}):[],te=pe.filter(Do),se=pe.filter(So);let ae;e[10]!==i?(ae=E=>E.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=(E,Y,je,ke,re)=>{const Ye=ie(re),Me=re.find(Ne=>!i.has(Ne.id)),ne=re[0];if(m==="browse"){const Ne=Ln(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)}},E)}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")})]})},E)},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=E=>{const Y=tt(E._meta),je=Y?.friendlyName||Y?.friendly_name||E.server?.title||E.title||E.server?.name||E.name||E.id||"",ke=E.server?.description||E.description||null,re=E.server?.icons?.[0]?.src||bn(E.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:E.id,app_name:Y?.friendlyName||E.server?.name||E.name||null}),d(E)},children:c===E.id?s.jsx(He,{className:"size-3.5"}):h(m==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${E.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]!==S||e[29]!==f||e[30]!==N||e[31]!==h?(ee=!N&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx($n,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:E=>S(E)}),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]=S,e[29]=f,e[30]=N,e[31]=h,e[32]=ee):ee=e[32];const Ce=_&&"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=E=>{if(E.type==="group")return H(E.key,E.title,E.icon,null,E.connections);const Y=E.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]!==z?(Ae=s.jsx("div",{ref:z,className:"col-span-full h-1"}),e[37]=z,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]!==J||e[42]!==L||e[43]!==W?(Te=W&&L.length>0&&s.jsx("div",{ref:J,className:"col-span-full h-1"}),e[41]=J,e[42]=L,e[43]=W,e[44]=Te):Te=e[44];let Be;e[45]!==V.isLoadingMore||e[46]!==W?(Be=W&&V.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]=V.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 pl({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:v=>{},f=(v,A,T)=>{d&&Z("agent_connection_attached",{agent_id:d,connection_id:v,app_name:A,mode:T})},[p,r]=G.useState(null),[m,g]=G.useState(a),[h,x]=G.useState(!1),[b,_]=G.useState(t);t!==b&&(_(t),t&&g(a));const{org:y}=ge(),{data:N}=Ct.useSession(),k=ms(),C=vt(),w=qt(),j=v=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:v}})},S=()=>{C.invalidateQueries({predicate:v=>{const A=v.queryKey;return A[1]===y.id&&A[3]==="collection"&&A[4]==="CONNECTIONS"}})},D=async(v,A)=>{Z("connection_oauth_succeeded",{connection_id:v,flow:A});const T=new URL(`/api/${y.slug}/mcp/${v}`,window.location.origin);await C.invalidateQueries({queryKey:ye.isMCPAuthenticated(T.href,null)}),S()},I=async v=>{r(v.app_name??v.id);try{const T=`${v.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,B=(await k.create.mutateAsync({title:T,description:v.description??null,connection_type:v.connection_type,connection_url:v.connection_url??null,connection_token:null,icon:v.icon??null,app_name:v.app_name??null,app_id:v.app_id??null,connection_headers:v.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,v.app_name??null,"clone"),u(B)}catch(A){console.error("Failed to add connection:",A),oe.error(l("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{r(null)}},M=async v=>{if(!(!y||!N?.user?.id)){r(v.id);try{const A=yn(v,y.id,N.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:U=>k.update.mutateAsync({id:F,data:{connection_token:U}}).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(hn,{value:m,onChange:g,placeholder:l("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(G.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:M,connectingItemId:p,search:m,onCreateConnection:()=>x(!0),onBrowseNavigate:j,defaultTab:n})})]}),s.jsx(No,{open:h,onOpenChange:x,onCreated:async v=>{x(!1);const A=await gt({connectionId:v,orgId:y.id,orgSlug:y.slug,persistFallback:T=>k.update.mutateAsync({id:v,data:{connection_token:T}}).then(()=>{})});if(A.ran&&!A.ok){Z("connection_oauth_failed",{connection_id:v,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(v,null,"custom"),u(v),e(!1);return}A.ran&&await D(v,"custom_create"),f(v,null,"custom"),u(v),e(!1)}})]})}const Rt=new Map;function hl(){const{org:t}=ge(),e=kt(),n=Kn(),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=G.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:en,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 xl(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=G.useRef(a);o.current=a;const d=G.useRef(i);d.current=i;const c=G.useRef(l);c.current=l;const u=G.useRef(null),f=G.useRef(n),p=G.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===zn?d.current?.(x.data.id):o.current(x.data)),m()};return Hn.subscribe(e,g,()=>c.current?.())}),G.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],Gn(p)}function jl(){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 bl(){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(V=>V.id===P.id?{...V,...P}:V)}),{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 _;t[24]!==m||t[25]!==g||t[26]!==h||t[27]!==x||t[28]!==b?(_={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]=_):_=t[29];const y=Le(_);let N;t[30]!==a?(N=P=>a.call("TASK_BOARD_ITEM_DELETE",{id:P}),t[30]=a,t[31]=N):N=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]!==N||t[37]!==k?(C={mutationFn:N,onSuccess:u,onError:k},t[35]=u,t[36]=N,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 S,D;t[41]!==l?(S=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]=S,t[43]=D):(S=t[42],D=t[43]);let I;t[44]!==u||t[45]!==j||t[46]!==S||t[47]!==D?(I={mutationFn:j,onSuccess:S,onError:D,onSettled:u},t[44]=u,t[45]=j,t[46]=S,t[47]=D,t[48]=I):I=t[48];const M=Le(I);let v;t[49]!==a?(v=P=>a.call("TASK_BOARD_ITEM_UPDATE",P),t[49]=a,t[50]=v):v=t[50];let A;t[51]!==u||t[52]!==v?(A={mutationFn:v,onSuccess:u},t[51]=u,t[52]=v,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 U;return t[63]!==r||t[64]!==T||t[65]!==w||t[66]!==M||t[67]!==$||t[68]!==y?(U={create:r,update:y,remove:w,removeMany:M,link:T,rerun:$},t[63]=r,t[64]=T,t[65]=w,t[66]=M,t[67]=$,t[68]=y,t[69]=U):U=t[69],U}function Vo(t){return t.status==="rejected"}const Uo=["ended_after_delivery","superseded"];function Ho(t){return!!t&&Uo.includes(t)}function yl(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function Cl(t){return t.failureKind!=="superseded"}function Cs(t){return t.threads.some(e=>e.status==="requires_action")}function vl(t){return t.status==="in_review"&&!t.assigneeId}function kl(t){return Cs(t)}function Nl(t){return t.status==="in_progress"&&Cs(t)?"text-warning animate-pulse":ks(t.status).iconClassName}function _l(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!Ho(n.failureKind))?"failed":null}function Sl(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 Dl(t,e){return Array.from({length:e},(n,a)=>t-(e-1-a)*1e-4)}const Go=["archived"],vs={triage:{labelKey:"taskBoard.config.statusBacklog",icon:Wn,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:bs,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Hs,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:Xn,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:Us,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:In,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:Vs,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Yn,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Ms,iconClassName:"text-muted-foreground"}},qo={icon:bs,iconClassName:"text-muted-foreground"},Qo=vs;function ks(t){return Qo[t]??qo}function wl(t,e){const n=vs[t];return{label:n?e(n.labelKey):t,visual:ks(t)}}const Al=["bug","feature","chore","spike","security"],Il={bug:{labelKey:"taskBoard.config.typeBug",icon:Zn,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:Qs,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:qs,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:Gs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Jn,iconClassName:"text-purple-500"}};function jt(t){return Un.includes(t)}function Tl(t){return wt.filter(e=>t||!jt(e))}function Bl({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 Fl({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:zs,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:Ks,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:Rs,iconClassName:"text-destructive"}};function Pl(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??Vn} var(--user-color-strength), transparent)`}const bt="__unassigned__",yt="__no_repo__",Ke="__any__",Ns={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 _s(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 El(t,e){const n=e.search.trim().toLowerCase();if(n!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(n)&&!_s(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]=G.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,_=l&&"ml-auto";let y;e[28]!==_?(y=X("shrink-0 opacity-60",_),e[28]=_,e[29]=y):y=e[29];const N=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]!==N?(C=s.jsx(Ve,{size:12,className:N}),e[32]=N,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 S;e[41]!==o?(S=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=o,e[42]=S):S=e[42];let D;e[43]!==j||e[44]!==S?(D=s.jsx(At,{placeholder:j,"aria-label":S,className:"h-9"}),e[43]=j,e[44]=S,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 M;e[48]!==I?(M=s.jsx(It,{children:I}),e[48]=I,e[49]=M):M=e[49];let v;e[50]!==o?(v=o("taskBoard.taskFilters.assigneeAnyone"),e[50]=o,e[51]=v):v=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]!==v||e[57]!==A||e[58]!==T?(O=s.jsx(ve,{value:v,onSelect:A,children:T}),e[56]=v,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 U;e[65]!==o?(U=o("taskBoard.taskFilters.assigneeUnassigned"),e[65]=o,e[66]=U):U=e[66];let P;e[67]!==B||e[68]!==F||e[69]!==U?(P=s.jsxs(ve,{value:B,onSelect:F,className:"gap-2",children:[$,U]}),e[67]=B,e[68]=F,e[69]=U,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 V;e[75]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(Kt,{size:16}),e[75]=V):V=e[75];let J;e[76]!==o?(J=o("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=o,e[77]=J):J=e[77];let z;e[78]!==K||e[79]!==L||e[80]!==J?(z=s.jsxs(ve,{value:K,onSelect:L,className:"gap-2",children:[V,J]}),e[78]=K,e[79]=L,e[80]=J,e[81]=z):z=e[81];let W;e[82]!==O||e[83]!==P||e[84]!==z?(W=s.jsxs(qe,{children:[O,P,z]}),e[82]=O,e[83]=P,e[84]=z,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]!==M||e[97]!==W||e[98]!==se?(ae=s.jsxs(Tt,{children:[M,W,se]}),e[96]=M,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(qn,{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 _;e[19]!==l?(_=l("taskBoard.taskFilters.priorityAnyPriority"),e[19]=l,e[20]=_):_=e[20];let y;e[21]!==_?(y=s.jsx(st,{value:Ke,children:_}),e[21]=_,e[22]=y):y=e[22];let N;e[23]!==l?(N=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]=N):N=e[24];let k;e[25]!==b||e[26]!==y||e[27]!==N||e[28]!==x?(k=s.jsx(hs,{align:"start",className:"w-40",children:s.jsxs(xs,{value:x,onValueChange:b,children:[y,N]})}),e[25]=b,e[26]=y,e[27]=N,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 _=n??Ke;let y;e[18]!==a?(y=D=>a(D===Ke?null:D),e[18]=a,e[19]=y):y=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ut,{size:16,className:"text-muted-foreground"}),e[20]=N):N=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:[N,k]}),e[23]=k,e[24]=C):C=e[24];let w;e[25]!==l?(w=Object.entries(Ht).map(D=>{const[I,M]=D,v=I==="overdue";return s.jsxs(st,{value:I,className:X("gap-2",v&&"text-destructive"),children:[s.jsx(ut,{size:16,className:X("shrink-0",v?"text-destructive":"text-muted-foreground")}),l(M)]},I)}),e[25]=l,e[26]=w):w=e[26];let j;e[27]!==_||e[28]!==y||e[29]!==C||e[30]!==w?(j=s.jsx(hs,{align:"start",className:"w-44",children:s.jsxs(xs,{value:_,onValueChange:y,children:[C,w]})}),e[27]=_,e[28]=y,e[29]=C,e[30]=w,e[31]=j):j=e[31];let S;return e[32]!==j||e[33]!==b?(S=s.jsxs(js,{children:[b,j]}),e[32]=j,e[33]=b,e[34]=S):S=e[34],S}function la(t){const e=R.c(56),{value:n,tags:a,onChange:i,block:l}=t,o=Q(),[d,c]=G.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 _=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(Ws,{size:14,className:"shrink-0"}),e[13]=a,e[14]=n[0],e[15]=n.length,e[16]=y):y=e[16];let N;e[17]!==r?(N=s.jsx("span",{className:"max-w-[10rem] truncate",children:r}),e[17]=r,e[18]=N):N=e[18];let k;e[19]!==_?(k=s.jsx(Ve,{size:12,className:_}),e[19]=_,e[20]=k):k=e[20];let C;e[21]!==y||e[22]!==N||e[23]!==k||e[24]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,N,k]})}),e[21]=y,e[22]=N,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 S;e[30]!==w||e[31]!==j?(S=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[30]=w,e[31]=j,e[32]=S):S=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 M;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],M=a.map(B),e[37]=a,e[38]=f,e[39]=n,e[40]=M}else M=e[40];let v;e[44]!==M?(v=s.jsx(qe,{children:M}),e[44]=M,e[45]=v):v=e[45];let A;e[46]!==I||e[47]!==v?(A=s.jsxs(Tt,{children:[I,v]}),e[46]=I,e[47]=v,e[48]=A):A=e[48];let T;e[49]!==S||e[50]!==A?(T=s.jsx(ot,{align:"start",className:"w-56 p-0",children:s.jsxs(Bt,{children:[S,A]})}),e[49]=S,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]=G.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=z=>{i(z),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 _=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 N;e[11]!==f?(N=s.jsx("span",{className:"max-w-[12rem] truncate",children:f}),e[11]=f,e[12]=N):N=e[12];let k;e[13]!==_?(k=s.jsx(Ve,{size:12,className:_}),e[13]=_,e[14]=k):k=e[14];let C;e[15]!==N||e[16]!==k||e[17]!==h?(C=s.jsx(ze,{asChild:!0,children:s.jsxs("button",{type:"button",className:h,children:[y,N,k]})}),e[15]=N,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 S;e[23]!==w||e[24]!==j?(S=s.jsx(At,{placeholder:w,"aria-label":j,className:"h-9"}),e[23]=w,e[24]=j,e[25]=S):S=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 M;e[30]!==o?(M=o("taskBoard.taskFilters.repoAnyRepo"),e[30]=o,e[31]=M):M=e[31];let v;e[32]!==r?(v=()=>r(null),e[32]=r,e[33]=v):v=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]!==M||e[37]!==v||e[38]!==A?(T=s.jsx(ve,{value:M,onSelect:v,children:A}),e[36]=M,e[37]=v,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 U;e[50]!==T||e[51]!==$?(U=s.jsxs(qe,{children:[T,$]}),e[50]=T,e[51]=$,e[52]=U):U=e[52];let P;if(e[53]!==a||e[54]!==r||e[55]!==n){let z;e[57]!==r||e[58]!==n?(z=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]=z):z=e[59],P=a.map(z),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]!==U||e[64]!==K?(L=s.jsxs(Tt,{children:[I,U,K]}),e[62]=I,e[63]=U,e[64]=K,e[65]=L):L=e[65];let V;e[66]!==S||e[67]!==L?(V=s.jsx(ot,{align:"start",className:"w-64 p-0",children:s.jsxs(Bt,{children:[S,L]})}),e[66]=S,e[67]=L,e[68]=V):V=e[68];let J;return e[69]!==d||e[70]!==C||e[71]!==V?(J=s.jsxs(nt,{open:d,onOpenChange:c,children:[C,V]}),e[69]=d,e[70]=C,e[71]=V,e[72]=J):J=e[72],J}function ra(t){const e=R.c(25),{value:n,onChange:a,block:i}=t,l=Q(),[o,d]=G.useState(n!==""),[c,u]=G.useState(!1),[f,p]=G.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 _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ys,{size:14}),e[6]=_):_=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:_}),e[7]=x,e[8]=y):y=e[8];let N;e[9]!==i||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==n?(N=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]=N):N=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(Ls,{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]!==N||e[23]!==k?(C=s.jsxs("div",{className:h,children:[y,N,k]}),e[20]=h,e[21]=y,e[22]=N,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 Ss(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 _;e[32]!==c||e[33]!==n.tags||e[34]!==b||e[35]!==i?(_=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]=_):_=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 N;e[42]!==c||e[43]!==d?(N=s.jsx(da,{block:c,onClick:d}),e[42]=c,e[43]=d,e[44]=N):N=e[44];let k;return e[45]!==_||e[46]!==y||e[47]!==N||e[48]!==f||e[49]!==r||e[50]!==g||e[51]!==x?(k=s.jsxs(s.Fragment,{children:[f,r,g,x,_,y,N]}),e[45]=_,e[46]=y,e[47]=N,e[48]=f,e[49]=r,e[50]=g,e[51]=x,e[52]=k):k=e[52],k}function Ml(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(Ss,{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(Ns),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 Ll(t){const e=R.c(41),{filters:n,members:a,tags:i,repos:l,onChange:o,onOpenBoardSettings:d}=t,c=Q(),[u,f]=G.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 _;e[7]!==x||e[8]!==b||e[9]!==g?(_=s.jsx(an,{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]=_):_=e[10];let y;e[11]!==c?(y=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=y):y=e[12];let N;e[13]!==y?(N=s.jsx(Dt,{className:"px-4 pt-4 text-base font-medium text-foreground",children:y}),e[13]=y,e[14]=N):N=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(Ss,{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(Ns),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 S;e[30]!==C||e[31]!==j?(S=s.jsxs(ns,{className:"flex-row gap-2",children:[C,j]}),e[30]=C,e[31]=j,e[32]=S):S=e[32];let D;e[33]!==S||e[34]!==N||e[35]!==k?(D=s.jsxs(St,{className:"p-0",children:[N,k,S]}),e[33]=S,e[34]=N,e[35]=k,e[36]=D):D=e[36];let I;return e[37]!==u||e[38]!==D||e[39]!==_?(I=s.jsxs(_t,{open:u,onOpenChange:f,direction:"bottom",children:[_,D]}),e[37]=u,e[38]=D,e[39]=_,e[40]=I):I=e[40],I}function $l(t,e){return Lo(t,e.keySeq)??e.id}function Ol(t,e){const n=e?.trim();if(n)return t.find(a=>_s(n,a.keySeq))??t.find(a=>a.id===n)}export{pl as A,Bl as B,_l as C,kl as D,Ns as E,Sl as F,Fl as G,El as H,Go as I,Pl as J,Co as K,Vt as L,gl as N,Ze as P,Kt as S,Il as T,$l as a,vl as b,Ko as c,ml as d,zo as e,bl as f,Yo as g,Al as h,Cs as i,Ut as j,ks as k,wl as l,xl as m,Tl as n,yl as o,Cl as p,Ho as q,vs as r,Nl as s,Lo as t,hl as u,jl as v,Ol as w,Ll as x,Ml as y,Dl as z};
@@ -1 +1 @@
1
- import{c as P,r as z,j as a,l as W,B as U,W as J,a7 as G,K as H,m as ee,n as te,e as se,b as M,b6 as ae,t as q,dr as Y,ds as Q,dq as re,P as V,dt as fe,p as me}from"./index-CW6L2S49.js";import{I as X}from"./input-DPKIPveM.js";import{i as oe}from"./Check-Bu3XsPtR.js";import{i as ce}from"./ChevronSelectorVertical-CUY38lF0.js";import{a as ue,c as ge,d as pe,e as he,b as je,C as xe}from"./command-Bz-l73oK.js";import{a as be,P as ye,b as Se}from"./popover-Cfo1Nvgv.js";import{S as ve}from"./switch-Mdu4u0WR.js";import{c as Pe,d as Te,b as Ne,f as Ce,g as we,e as _e,a as ke,A as Ie}from"./alert-dialog-BwkydmfJ.js";import{R as Ae,A as Re}from"./review-settings-DJxQp0XZ.js";import{T as Ee}from"./textarea-DoEBjnc4.js";import{f as De}from"./task-board-BR_hukMd.js";import{R as $e}from"./require-capability-B7CJKsKK.js";import"./index-MnhhExK7.js";import"./dialog-lVg2I_FW.js";import"./SearchMd-CQywkGC8.js";import"./UserSquare-B19aw2mP.js";import"./GitBranch01-BritbDKe.js";import"./use-organization-settings-BPN8rXNO.js";import"./constants-DNuUCxmW.js";import"./schema-CmTu1Qcv.js";import"./access-gate-Cr4kGdoG.js";import"./capability-load-error-DdUEYVnx.js";function Oe(t){const e=P.c(41),{options:l,value:s,onChange:n,placeholder:i,triggerClassName:r,contentClassName:o,width:c,renderTrigger:d,renderItem:f,emptyMessage:m,searchPlaceholder:u,filter:g}=t,p=i===void 0?"Select...":i,b=c===void 0?"w-[200px]":c,h=m===void 0?"No results found.":m,j=u===void 0?"Search...":u;let x;e[0]!==s?(x=K=>K.value===s,e[0]=s,e[1]=x):x=e[1];const y=l.find(x),[v,S]=z.useState(!1),T=ye,N=be,_=!0,C=d?a.jsx("div",{className:W("cursor-pointer",r),children:d(y)}):a.jsxs(U,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let w;e[2]!==N||e[3]!==C?(w=a.jsx(N,{asChild:_,children:C}),e[2]=N,e[3]=C,e[4]=w):w=e[4];let k;e[5]!==o?(k=W("p-0",o),e[5]=o,e[6]=k):k=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let B;e[8]!==j?(B=a.jsx(ue,{placeholder:j,className:"h-9"}),e[8]=j,e[9]=B):B=e[9];let A;e[10]!==h?(A=a.jsx(ge,{children:h}),e[10]=h,e[11]=A):A=e[11];let R;if(e[12]!==n||e[13]!==l||e[14]!==f||e[15]!==S||e[16]!==s){let K;e[18]!==n||e[19]!==f||e[20]!==S||e[21]!==s?(K=I=>{const le=s===I.value;return a.jsx(pe,{value:I.label,onSelect:()=>{n(I.value===s?"":I.value),S(!1)},children:f?f(I,le):a.jsxs(a.Fragment,{children:[I.label,a.jsx(oe,{className:W("ml-auto",le?"opacity-100":"opacity-0")})]})},I.value)},e[18]=n,e[19]=f,e[20]=S,e[21]=s,e[22]=K):K=e[22],R=l.map(K),e[12]=n,e[13]=l,e[14]=f,e[15]=S,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(he,{children:R}),e[23]=R,e[24]=E):E=e[24];let L;e[25]!==A||e[26]!==E?(L=a.jsxs(je,{children:[A,E]}),e[25]=A,e[26]=E,e[27]=L):L=e[27];let D;e[28]!==g||e[29]!==B||e[30]!==L?(D=a.jsxs(xe,{filter:g,children:[B,L]}),e[28]=g,e[29]=B,e[30]=L,e[31]=D):D=e[31];let $;e[32]!==D||e[33]!==k?($=a.jsx(Se,{className:k,style:O,children:D}),e[32]=D,e[33]=k,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==v||e[37]!==S||e[38]!==$||e[39]!==w?(F=a.jsxs(T,{open:v,onOpenChange:S,children:[w,$]}),e[35]=T,e[36]=v,e[37]=S,e[38]=$,e[39]=w,e[40]=F):F=e[40],F}function Be(t){const e=P.c(4),{size:l,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=e[0];let i;return e[1]!==s||e[2]!==l?(i=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=l,e[3]=i):i=e[3],i}function de(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Fe(t){const{primary:e,secondary:l}=de(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function ne(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const l=ne(e).trim();if(!l)return 1;const s=ne(t);return l.split(/\s+/).every(n=>s.includes(n))?1:0}function Le(){const t=P.c(7),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=n):n=t[3];let i;return t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6],ee(i)}function ie(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function qe(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Me(t){const e=P.c(8),{org:l}=J(),s=G();let n;e[0]!==l.id?(n=H.jiraBoards(l.id),e[0]=l.id,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==i?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:i},e[4]=t,e[5]=n,e[6]=i,e[7]=r):r=e[7],ee(r)}function ze(){const t=P.c(12),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data?.find(Ue)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let c;return t[9]!==r.isPending||t[10]!==o?(c={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=c):c=t[11],c}function Ue(t){return t.columnKey===null}function Je(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>{const c=o.trim();if(!c){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:c})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Ge(){const t=P.c(16),e=M(),{prompt:l,isPending:s}=ze(),n=Je(),[i,r]=z.useState(l),[o,c]=z.useState(l);o!==l&&(c(l),r(l));let d;t[0]!==e?(d=e("settings.taskPrompt.title"),t[0]=e,t[1]=d):d=t[1];let f;t[2]!==e?(f=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=f):f=t[3];let m;t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==n||t[8]!==e?(m=s?a.jsx(ae,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(Ee,{value:i,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(U,{size:"sm",disabled:i===l||n.isPending,onClick:()=>n.mutate(i,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=i,t[5]=s,t[6]=l,t[7]=n,t[8]=e,t[9]=m):m=t[9];let u;t[10]!==f||t[11]!==m?(u=a.jsx(Y,{children:a.jsx(Q,{title:f,children:m})}),t[10]=f,t[11]=m,t[12]=u):u=t[12];let g;return t[13]!==d||t[14]!==u?(g=a.jsx(re,{title:d,children:u}),t[13]=d,t[14]=u,t[15]=g):g=t[15],g}function Z(t,e){return t instanceof Error?t.message:e}const He="https://id.atlassian.com/manage-profile/security/api-tokens";function Qe(t){const e=P.c(7),{stepKeys:l}=t,s=M();let n;if(e[0]!==l||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],n=l.map(r),e[0]=l,e[1]=s,e[2]=n}else n=e[2];let i;return e[5]!==n?(i=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function We(){const t=P.c(69),e=M(),l=ie(),[s,n]=z.useState(""),[i,r]=z.useState(""),[o,c]=z.useState("");let d;t[0]!==o||t[1]!==i||t[2]!==s?(d=s.trim()!==""&&i.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=i,t[2]=s,t[3]=d):d=t[3];const f=d;let m;t[4]!==e?(m=e("settings.jira.siteLabel"),t[4]=e,t[5]=m):m=t[5];let u;t[6]!==m?(u=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:m}),t[6]=m,t[7]=u):u=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=I=>n(I.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(X,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let h;t[14]!==u||t[15]!==b?(h=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[u,b]}),t[14]=u,t[15]=b,t[16]=h):h=t[16];let j;t[17]!==e?(j=e("settings.jira.emailLabel"),t[17]=e,t[18]=j):j=t[18];let x;t[19]!==j?(x=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:j}),t[19]=j,t[20]=x):x=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=I=>r(I.target.value),t[21]=y):y=t[21];let v;t[22]!==e?(v=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=v):v=t[23];let S;t[24]!==i||t[25]!==v?(S=a.jsx(X,{value:i,onChange:y,placeholder:v,autoComplete:"off"}),t[24]=i,t[25]=v,t[26]=S):S=t[26];let T;t[27]!==S||t[28]!==x?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[x,S]}),t[27]=S,t[28]=x,t[29]=T):T=t[29];let N;t[30]!==e?(N=e("settings.jira.tokenLabel"),t[30]=e,t[31]=N):N=t[31];let _;t[32]!==N?(_=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:N}),t[32]=N,t[33]=_):_=t[33];let C;t[34]!==e?(C=e("settings.jira.createTokenLink"),t[34]=e,t[35]=C):C=t[35];let w;t[36]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(me,{size:12}),t[36]=w):w=t[36];let k;t[37]!==C?(k=a.jsxs("a",{href:He,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[C,w]}),t[37]=C,t[38]=k):k=t[38];let O;t[39]!==_||t[40]!==k?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_,k]}),t[39]=_,t[40]=k,t[41]=O):O=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=I=>c(I.target.value),t[42]=B):B=t[42];let A;t[43]!==e?(A=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=A):A=t[44];let R;t[45]!==o||t[46]!==A?(R=a.jsx(X,{type:"password",value:o,onChange:B,placeholder:A,autoComplete:"off"}),t[45]=o,t[46]=A,t[47]=R):R=t[47];let E;t[48]!==O||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,R]}),t[48]=O,t[49]=R,t[50]=E):E=t[50];const L=!f||l.isPending;let D;t[51]!==o||t[52]!==i||t[53]!==s||t[54]!==e||t[55]!==l?(D=()=>l.mutate({siteUrl:s.trim(),email:i.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:I=>q.error(Z(I,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=i,t[53]=s,t[54]=e,t[55]=l,t[56]=D):D=t[56];let $;t[57]!==e||t[58]!==l.isPending?($=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=$):$=t[59];let F;t[60]!==L||t[61]!==D||t[62]!==$?(F=a.jsx(U,{size:"sm",className:"w-fit",disabled:L,onClick:D,children:$}),t[60]=L,t[61]=D,t[62]=$,t[63]=F):F=t[63];let K;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==h?(K=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[h,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=h,t[68]=K):K=t[68],K}function Ve(t){const e=P.c(44),{integration:l}=t,s=M(),n=qe(),[i,r]=z.useState(!1),o=l.siteUrl,c=l.email;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r(!0),e[0]=d):d=e[0];let f;e[1]!==s?(f=s("settings.jira.disconnect"),e[1]=s,e[2]=f):f=e[2];let m;e[3]!==f?(m=a.jsx(U,{variant:"outline",size:"sm",onClick:d,children:f}),e[3]=f,e[4]=m):m=e[4];let u;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==m?(u=a.jsx(Q,{title:o,description:c,action:m}),e[5]=l.email,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=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(Pe,{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 h;e[15]!==b?(h=a.jsx(Te,{children:b}),e[15]=b,e[16]=h):h=e[16];let j;e[17]!==h||e[18]!==p?(j=a.jsxs(Ne,{children:[p,h]}),e[17]=h,e[18]=p,e[19]=j):j=e[19];let x;e[20]!==s?(x=s("settings.jira.cancel"),e[20]=s,e[21]=x):x=e[21];let y;e[22]!==x?(y=a.jsx(Ce,{children:x}),e[22]=x,e[23]=y):y=e[23];let v;e[24]!==n||e[25]!==s?(v=()=>n.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:k=>q.error(Z(k,s("settings.jira.saveFailed")))}),e[24]=n,e[25]=s,e[26]=v):v=e[26];let S;e[27]!==s?(S=s("settings.jira.disconnect"),e[27]=s,e[28]=S):S=e[28];let T;e[29]!==v||e[30]!==S?(T=a.jsx(we,{onClick:v,children:S}),e[29]=v,e[30]=S,e[31]=T):T=e[31];let N;e[32]!==y||e[33]!==T?(N=a.jsxs(_e,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=N):N=e[34];let _;e[35]!==j||e[36]!==N?(_=a.jsxs(ke,{children:[j,N]}),e[35]=j,e[36]=N,e[37]=_):_=e[37];let C;e[38]!==i||e[39]!==_?(C=a.jsx(Ie,{open:i,onOpenChange:r,children:_}),e[38]=i,e[39]=_,e[40]=C):C=e[40];let w;return e[41]!==C||e[42]!==u?(w=a.jsxs(a.Fragment,{children:[u,C]}),e[41]=C,e[42]=u,e[43]=w):w=e[43],w}function Ye(t){const e=P.c(36),{integration:l}=t,s=M(),n=ie(),i=Me(!0);let r,o;e[0]!==i.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(i.data??[]).map(Ze),o=l.boardId?r.find(y=>y.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=i.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const c=o;let d;e[5]!==s?(d=s("settings.jira.boardLabel"),e[5]=s,e[6]=d):d=e[6];let f;e[7]!==s?(f=s("settings.jira.boardDescription"),e[7]=s,e[8]=f):f=e[8];const m=l.boardId??"";let u;e[9]!==s?(u=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=u):u=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]!==i.isPending||e[14]!==s?(p=i.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=i.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==c||e[17]!==s?(b=()=>a.jsxs(U,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:c??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=c,e[17]=s,e[18]=b):b=e[18];let h;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==n?(h=y=>{!y||y===l.boardId||n.mutate({boardId:y,boardName:r.find(v=>v.value===y)?.primary??null},{onError:v=>q.error(Z(v,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=n,e[23]=h):h=e[23];let j;e[24]!==r||e[25]!==m||e[26]!==u||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==h?(j=a.jsx(Oe,{options:r,value:m,width:"w-72",triggerClassName:"shrink-0",placeholder:u,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:Xe,onChange:h}),e[24]=r,e[25]=m,e[26]=u,e[27]=g,e[28]=p,e[29]=b,e[30]=h,e[31]=j):j=e[31];let x;return e[32]!==j||e[33]!==d||e[34]!==f?(x=a.jsx(Q,{title:d,description:f,action:j}),e[32]=j,e[33]=d,e[34]=f,e[35]=x):x=e[35],x}function Xe(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 Ze(t){const{primary:e,secondary:l}=de(t);return{value:String(t.id),label:Fe(t),primary:e,secondary:l}}function et(t){const e=P.c(16),{integration:l}=t,s=M(),n=ie();let i;e[0]!==s?(i=s("settings.jira.enabledLabel"),e[0]=s,e[1]=i):i=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]!==l.boardId||e[5]!==s||e[6]!==n?(o=f=>{if(f&&!l.boardId){q.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:f},{onError:m=>q.error(Z(m,s("settings.jira.saveFailed")))})},e[4]=l.boardId,e[5]=s,e[6]=n,e[7]=o):o=e[7];let c;e[8]!==l.enabled||e[9]!==o||e[10]!==n.isPending?(c=a.jsx(ve,{checked:l.enabled,disabled:n.isPending,onCheckedChange:o}),e[8]=l.enabled,e[9]=o,e[10]=n.isPending,e[11]=c):c=e[11];let d;return e[12]!==i||e[13]!==r||e[14]!==c?(d=a.jsx(Q,{title:i,description:r,action:c}),e[12]=i,e[13]=r,e[14]=c,e[15]=d):d=e[15],d}function tt(t){const e=P.c(24),{integration:l}=t,s=M(),n=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let i;e[0]!==s?(i=s("settings.jira.webhookTitle"),e[0]=s,e[1]=i):i=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]!==n?(o=a.jsx(X,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let c;e[6]!==s||e[7]!==n?(c=()=>{navigator.clipboard.writeText(n),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=c):c=e[8];let d;e[9]!==s?(d=s("settings.jira.webhookCopy"),e[9]=s,e[10]=d):d=e[10];let f;e[11]!==c||e[12]!==d?(f=a.jsx(U,{variant:"outline",size:"sm",className:"shrink-0",onClick:c,children:d}),e[11]=c,e[12]=d,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[o,f]}),e[14]=o,e[15]=f,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Qe,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=u):u=e[17];let g;e[18]!==m?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[m,u]}),e[18]=m,e[19]=g):g=e[19];let p;return e[20]!==i||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:i,description:r,children:g}),e[20]=i,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function st(){const t=P.c(11),e=M(),l=Le();if(l.isPending){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Y,{children:a.jsx("div",{className:"p-4",children:a.jsx(ae,{className:"h-40 w-full"})})}),t[0]=i):i=t[0],i}if(!l.data){let i;t[1]!==e?(i=e("settings.jira.connectTitle"),t[1]=e,t[2]=i):i=t[2];let r;t[3]!==e?(r=e("settings.jira.connectDescription"),t[3]=e,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(We,{}),t[5]=o):o=t[5];let c;return t[6]!==i||t[7]!==r?(c=a.jsx(Y,{children:a.jsx(Q,{title:i,description:r,children:o})}),t[6]=i,t[7]=r,t[8]=c):c=t[8],c}const s=l.data;let n;return t[9]!==s?(n=a.jsxs(Y,{children:[a.jsx(Ve,{integration:s}),a.jsx(Ye,{integration:s}),a.jsx(et,{integration:s}),a.jsx(tt,{integration:s})]}),t[9]=s,t[10]=n):n=t[10],n}function it(){const t=P.c(18),e=M();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(V.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let n,i,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Ae,{}),i=a.jsx(Ge,{}),r=a.jsx(Re,{}),t[4]=n,t[5]=i,t[6]=r):(n=t[4],i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Be,{size:18}),t[7]=o):o=t[7];let c;t[8]!==e?(c=e("settings.jira.sectionTitle"),t[8]=e,t[9]=c):c=t[9];let d;t[10]!==c?(d=a.jsxs("span",{className:"flex items-center gap-2",children:[o,c]}),t[10]=c,t[11]=d):d=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(st,{}),t[12]=f):f=t[12];let m;t[13]!==d?(m=a.jsx(re,{title:d,children:f}),t[13]=d,t[14]=m):m=t[14];let u;return t[15]!==s||t[16]!==m?(u=a.jsx(V,{children:a.jsx(V.Content,{children:a.jsx(V.Body,{children:a.jsxs(fe,{children:[s,n,i,r,m]})})})}),t[15]=s,t[16]=m,t[17]=u):u=t[17],u}function Ct(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx($e,{capability:"org:manage",area:"settings",children:a.jsx(it,{})}),t[0]=e):e=t[0],e}export{Ct as default};
1
+ import{c as P,r as z,j as a,l as W,B as U,W as J,a7 as G,K as H,m as ee,n as te,e as se,b as M,b6 as ae,t as q,dr as Y,ds as Q,dq as re,P as V,dt as fe,p as me}from"./index-Ciqhx4Es.js";import{I as X}from"./input-HiBvv-tS.js";import{i as oe}from"./Check-DiuzOTdo.js";import{i as ce}from"./ChevronSelectorVertical-C0Fdqi9U.js";import{a as ue,c as ge,d as pe,e as he,b as je,C as xe}from"./command-aq94pylP.js";import{a as be,P as ye,b as Se}from"./popover-CRkM20y5.js";import{S as ve}from"./switch-U7uzAFmD.js";import{c as Pe,d as Te,b as Ne,f as Ce,g as we,e as _e,a as ke,A as Ie}from"./alert-dialog-DN6vGwKb.js";import{R as Ae,A as Re}from"./review-settings-DHtFpGrU.js";import{T as Ee}from"./textarea-bCfy8lu-.js";import{f as De}from"./task-board-DWHUF-M8.js";import{R as $e}from"./require-capability-B6bbEttD.js";import"./index-BOJEwmSU.js";import"./dialog-BVuXhd_n.js";import"./SearchMd-MV7l96VN.js";import"./UserSquare-CDP0762p.js";import"./GitBranch01-4HvT92Fb.js";import"./use-organization-settings-Bj_N-FZ1.js";import"./constants-DNuUCxmW.js";import"./schema-BSi9J6XG.js";import"./access-gate-B8SIJFr7.js";import"./capability-load-error-CpA6LOWl.js";function Oe(t){const e=P.c(41),{options:l,value:s,onChange:n,placeholder:i,triggerClassName:r,contentClassName:o,width:c,renderTrigger:d,renderItem:f,emptyMessage:m,searchPlaceholder:u,filter:g}=t,p=i===void 0?"Select...":i,b=c===void 0?"w-[200px]":c,h=m===void 0?"No results found.":m,j=u===void 0?"Search...":u;let x;e[0]!==s?(x=K=>K.value===s,e[0]=s,e[1]=x):x=e[1];const y=l.find(x),[v,S]=z.useState(!1),T=ye,N=be,_=!0,C=d?a.jsx("div",{className:W("cursor-pointer",r),children:d(y)}):a.jsxs(U,{variant:"outline",role:"combobox",className:W("justify-between",b,r),children:[y?y.label:p,a.jsx(ce,{className:"opacity-50"})]});let w;e[2]!==N||e[3]!==C?(w=a.jsx(N,{asChild:_,children:C}),e[2]=N,e[3]=C,e[4]=w):w=e[4];let k;e[5]!==o?(k=W("p-0",o),e[5]=o,e[6]=k):k=e[6];let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O={width:"var(--radix-popover-trigger-width)"},e[7]=O):O=e[7];let B;e[8]!==j?(B=a.jsx(ue,{placeholder:j,className:"h-9"}),e[8]=j,e[9]=B):B=e[9];let A;e[10]!==h?(A=a.jsx(ge,{children:h}),e[10]=h,e[11]=A):A=e[11];let R;if(e[12]!==n||e[13]!==l||e[14]!==f||e[15]!==S||e[16]!==s){let K;e[18]!==n||e[19]!==f||e[20]!==S||e[21]!==s?(K=I=>{const le=s===I.value;return a.jsx(pe,{value:I.label,onSelect:()=>{n(I.value===s?"":I.value),S(!1)},children:f?f(I,le):a.jsxs(a.Fragment,{children:[I.label,a.jsx(oe,{className:W("ml-auto",le?"opacity-100":"opacity-0")})]})},I.value)},e[18]=n,e[19]=f,e[20]=S,e[21]=s,e[22]=K):K=e[22],R=l.map(K),e[12]=n,e[13]=l,e[14]=f,e[15]=S,e[16]=s,e[17]=R}else R=e[17];let E;e[23]!==R?(E=a.jsx(he,{children:R}),e[23]=R,e[24]=E):E=e[24];let L;e[25]!==A||e[26]!==E?(L=a.jsxs(je,{children:[A,E]}),e[25]=A,e[26]=E,e[27]=L):L=e[27];let D;e[28]!==g||e[29]!==B||e[30]!==L?(D=a.jsxs(xe,{filter:g,children:[B,L]}),e[28]=g,e[29]=B,e[30]=L,e[31]=D):D=e[31];let $;e[32]!==D||e[33]!==k?($=a.jsx(Se,{className:k,style:O,children:D}),e[32]=D,e[33]=k,e[34]=$):$=e[34];let F;return e[35]!==T||e[36]!==v||e[37]!==S||e[38]!==$||e[39]!==w?(F=a.jsxs(T,{open:v,onOpenChange:S,children:[w,$]}),e[35]=T,e[36]=v,e[37]=S,e[38]=$,e[39]=w,e[40]=F):F=e[40],F}function Be(t){const e=P.c(4),{size:l,className:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=e[0];let i;return e[1]!==s||e[2]!==l?(i=a.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"#2684FF","aria-hidden":"true",className:s,children:n}),e[1]=s,e[2]=l,e[3]=i):i=e[3],i}function de(t){const e=t.projectName?.replace(/\s+/g," ").trim(),l=t.name.trim();return e?{primary:e,secondary:[l,t.projectKey].filter(Boolean).join(" · ")}:{primary:l,secondary:t.projectKey??""}}function Fe(t){const{primary:e,secondary:l}=de(t);return[e,l,`#${t.id}`].filter(Boolean).join(" ")}function ne(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase()}function Ke(t,e){const l=ne(e).trim();if(!l)return 1;const s=ne(t);return l.split(/\s+/).every(n=>s.includes(n))?1:0}function Le(){const t=P.c(7),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.jiraIntegration(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("JIRA_INTEGRATION_GET",{})).integration,t[2]=l,t[3]=n):n=t[3];let i;return t[4]!==s||t[5]!==n?(i={queryKey:s,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6],ee(i)}function ie(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>(await l.call("JIRA_INTEGRATION_UPSERT",o)).integration,t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function qe(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=()=>l.call("JIRA_INTEGRATION_DELETE",{}),t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.jiraIntegration(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Me(t){const e=P.c(8),{org:l}=J(),s=G();let n;e[0]!==l.id?(n=H.jiraBoards(l.id),e[0]=l.id,e[1]=n):n=e[1];let i;e[2]!==s?(i=async()=>(await s.call("JIRA_BOARDS_LIST",{})).boards,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==t||e[5]!==n||e[6]!==i?(r={queryKey:n,enabled:t,staleTime:6e4,queryFn:i},e[4]=t,e[5]=n,e[6]=i,e[7]=r):r=e[7],ee(r)}function ze(){const t=P.c(12),{org:e}=J(),l=G();let s;t[0]!==e.id?(s=H.taskBoardPrompts(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==l?(n=async()=>(await l.call("TASK_BOARD_PROMPT_LIST",{})).prompts,t[2]=l,t[3]=n):n=t[3];let i;t[4]!==s||t[5]!==n?(i={queryKey:s,staleTime:6e4,queryFn:n},t[4]=s,t[5]=n,t[6]=i):i=t[6];const r=ee(i);let o;t[7]!==r.data?(o=r.data?.find(Ue)?.prompt??"",t[7]=r.data,t[8]=o):o=t[8];let c;return t[9]!==r.isPending||t[10]!==o?(c={prompt:o,isPending:r.isPending},t[9]=r.isPending,t[10]=o,t[11]=c):c=t[11],c}function Ue(t){return t.columnKey===null}function Je(){const t=P.c(8),{org:e}=J(),l=G(),s=te();let n;t[0]!==l?(n=async o=>{const c=o.trim();if(!c){await l.call("TASK_BOARD_PROMPT_DELETE",{});return}await l.call("TASK_BOARD_PROMPT_UPSERT",{prompt:c})},t[0]=l,t[1]=n):n=t[1];let i;t[2]!==e||t[3]!==s?(i=()=>s.invalidateQueries({queryKey:H.taskBoardPrompts(e.id)}),t[2]=e,t[3]=s,t[4]=i):i=t[4];let r;return t[5]!==n||t[6]!==i?(r={mutationFn:n,onSettled:i},t[5]=n,t[6]=i,t[7]=r):r=t[7],se(r)}function Ge(){const t=P.c(16),e=M(),{prompt:l,isPending:s}=ze(),n=Je(),[i,r]=z.useState(l),[o,c]=z.useState(l);o!==l&&(c(l),r(l));let d;t[0]!==e?(d=e("settings.taskPrompt.title"),t[0]=e,t[1]=d):d=t[1];let f;t[2]!==e?(f=e("settings.taskPrompt.fieldLabel"),t[2]=e,t[3]=f):f=t[3];let m;t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==n||t[8]!==e?(m=s?a.jsx(ae,{className:"h-44 w-full"}):a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx(Ee,{value:i,rows:10,maxLength:De,placeholder:e("settings.taskPrompt.placeholder"),onChange:p=>r(p.target.value)}),a.jsx(U,{size:"sm",disabled:i===l||n.isPending,onClick:()=>n.mutate(i,{onSuccess:()=>q.success(e("settings.taskPrompt.saved")),onError:()=>q.error(e("settings.taskPrompt.failed"))}),children:e("settings.taskPrompt.save")})]}),t[4]=i,t[5]=s,t[6]=l,t[7]=n,t[8]=e,t[9]=m):m=t[9];let u;t[10]!==f||t[11]!==m?(u=a.jsx(Y,{children:a.jsx(Q,{title:f,children:m})}),t[10]=f,t[11]=m,t[12]=u):u=t[12];let g;return t[13]!==d||t[14]!==u?(g=a.jsx(re,{title:d,children:u}),t[13]=d,t[14]=u,t[15]=g):g=t[15],g}function Z(t,e){return t instanceof Error?t.message:e}const He="https://id.atlassian.com/manage-profile/security/api-tokens";function Qe(t){const e=P.c(7),{stepKeys:l}=t,s=M();let n;if(e[0]!==l||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],n=l.map(r),e[0]=l,e[1]=s,e[2]=n}else n=e[2];let i;return e[5]!==n?(i=a.jsx("ol",{className:"list-decimal pl-5 flex flex-col gap-1 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=i):i=e[6],i}function We(){const t=P.c(69),e=M(),l=ie(),[s,n]=z.useState(""),[i,r]=z.useState(""),[o,c]=z.useState("");let d;t[0]!==o||t[1]!==i||t[2]!==s?(d=s.trim()!==""&&i.trim()!==""&&o.trim()!=="",t[0]=o,t[1]=i,t[2]=s,t[3]=d):d=t[3];const f=d;let m;t[4]!==e?(m=e("settings.jira.siteLabel"),t[4]=e,t[5]=m):m=t[5];let u;t[6]!==m?(u=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:m}),t[6]=m,t[7]=u):u=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=I=>n(I.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(X,{value:s,onChange:g,placeholder:p,autoComplete:"off"}),t[11]=s,t[12]=p,t[13]=b):b=t[13];let h;t[14]!==u||t[15]!==b?(h=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[u,b]}),t[14]=u,t[15]=b,t[16]=h):h=t[16];let j;t[17]!==e?(j=e("settings.jira.emailLabel"),t[17]=e,t[18]=j):j=t[18];let x;t[19]!==j?(x=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:j}),t[19]=j,t[20]=x):x=t[20];let y;t[21]===Symbol.for("react.memo_cache_sentinel")?(y=I=>r(I.target.value),t[21]=y):y=t[21];let v;t[22]!==e?(v=e("settings.jira.emailPlaceholder"),t[22]=e,t[23]=v):v=t[23];let S;t[24]!==i||t[25]!==v?(S=a.jsx(X,{value:i,onChange:y,placeholder:v,autoComplete:"off"}),t[24]=i,t[25]=v,t[26]=S):S=t[26];let T;t[27]!==S||t[28]!==x?(T=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[x,S]}),t[27]=S,t[28]=x,t[29]=T):T=t[29];let N;t[30]!==e?(N=e("settings.jira.tokenLabel"),t[30]=e,t[31]=N):N=t[31];let _;t[32]!==N?(_=a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:N}),t[32]=N,t[33]=_):_=t[33];let C;t[34]!==e?(C=e("settings.jira.createTokenLink"),t[34]=e,t[35]=C):C=t[35];let w;t[36]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(me,{size:12}),t[36]=w):w=t[36];let k;t[37]!==C?(k=a.jsxs("a",{href:He,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-xs text-foreground hover:underline",children:[C,w]}),t[37]=C,t[38]=k):k=t[38];let O;t[39]!==_||t[40]!==k?(O=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_,k]}),t[39]=_,t[40]=k,t[41]=O):O=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=I=>c(I.target.value),t[42]=B):B=t[42];let A;t[43]!==e?(A=e("settings.jira.tokenPlaceholder"),t[43]=e,t[44]=A):A=t[44];let R;t[45]!==o||t[46]!==A?(R=a.jsx(X,{type:"password",value:o,onChange:B,placeholder:A,autoComplete:"off"}),t[45]=o,t[46]=A,t[47]=R):R=t[47];let E;t[48]!==O||t[49]!==R?(E=a.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,R]}),t[48]=O,t[49]=R,t[50]=E):E=t[50];const L=!f||l.isPending;let D;t[51]!==o||t[52]!==i||t[53]!==s||t[54]!==e||t[55]!==l?(D=()=>l.mutate({siteUrl:s.trim(),email:i.trim(),apiToken:o.trim()},{onSuccess:()=>q.success(e("settings.jira.connected")),onError:I=>q.error(Z(I,e("settings.jira.connectFailed")))}),t[51]=o,t[52]=i,t[53]=s,t[54]=e,t[55]=l,t[56]=D):D=t[56];let $;t[57]!==e||t[58]!==l.isPending?($=l.isPending?e("settings.jira.connecting"):e("settings.jira.connect"),t[57]=e,t[58]=l.isPending,t[59]=$):$=t[59];let F;t[60]!==L||t[61]!==D||t[62]!==$?(F=a.jsx(U,{size:"sm",className:"w-fit",disabled:L,onClick:D,children:$}),t[60]=L,t[61]=D,t[62]=$,t[63]=F):F=t[63];let K;return t[64]!==T||t[65]!==E||t[66]!==F||t[67]!==h?(K=a.jsxs("div",{className:"flex flex-col gap-4 mt-3 max-w-md",children:[h,T,E,F]}),t[64]=T,t[65]=E,t[66]=F,t[67]=h,t[68]=K):K=t[68],K}function Ve(t){const e=P.c(44),{integration:l}=t,s=M(),n=qe(),[i,r]=z.useState(!1),o=l.siteUrl,c=l.email;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>r(!0),e[0]=d):d=e[0];let f;e[1]!==s?(f=s("settings.jira.disconnect"),e[1]=s,e[2]=f):f=e[2];let m;e[3]!==f?(m=a.jsx(U,{variant:"outline",size:"sm",onClick:d,children:f}),e[3]=f,e[4]=m):m=e[4];let u;e[5]!==l.email||e[6]!==l.siteUrl||e[7]!==m?(u=a.jsx(Q,{title:o,description:c,action:m}),e[5]=l.email,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=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(Pe,{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 h;e[15]!==b?(h=a.jsx(Te,{children:b}),e[15]=b,e[16]=h):h=e[16];let j;e[17]!==h||e[18]!==p?(j=a.jsxs(Ne,{children:[p,h]}),e[17]=h,e[18]=p,e[19]=j):j=e[19];let x;e[20]!==s?(x=s("settings.jira.cancel"),e[20]=s,e[21]=x):x=e[21];let y;e[22]!==x?(y=a.jsx(Ce,{children:x}),e[22]=x,e[23]=y):y=e[23];let v;e[24]!==n||e[25]!==s?(v=()=>n.mutate(void 0,{onSuccess:()=>q.success(s("settings.jira.disconnected")),onError:k=>q.error(Z(k,s("settings.jira.saveFailed")))}),e[24]=n,e[25]=s,e[26]=v):v=e[26];let S;e[27]!==s?(S=s("settings.jira.disconnect"),e[27]=s,e[28]=S):S=e[28];let T;e[29]!==v||e[30]!==S?(T=a.jsx(we,{onClick:v,children:S}),e[29]=v,e[30]=S,e[31]=T):T=e[31];let N;e[32]!==y||e[33]!==T?(N=a.jsxs(_e,{children:[y,T]}),e[32]=y,e[33]=T,e[34]=N):N=e[34];let _;e[35]!==j||e[36]!==N?(_=a.jsxs(ke,{children:[j,N]}),e[35]=j,e[36]=N,e[37]=_):_=e[37];let C;e[38]!==i||e[39]!==_?(C=a.jsx(Ie,{open:i,onOpenChange:r,children:_}),e[38]=i,e[39]=_,e[40]=C):C=e[40];let w;return e[41]!==C||e[42]!==u?(w=a.jsxs(a.Fragment,{children:[u,C]}),e[41]=C,e[42]=u,e[43]=w):w=e[43],w}function Ye(t){const e=P.c(36),{integration:l}=t,s=M(),n=ie(),i=Me(!0);let r,o;e[0]!==i.data||e[1]!==l.boardId||e[2]!==l.boardName?(r=(i.data??[]).map(Ze),o=l.boardId?r.find(y=>y.value===l.boardId)?.primary??l.boardName??l.boardId:null,e[0]=i.data,e[1]=l.boardId,e[2]=l.boardName,e[3]=r,e[4]=o):(r=e[3],o=e[4]);const c=o;let d;e[5]!==s?(d=s("settings.jira.boardLabel"),e[5]=s,e[6]=d):d=e[6];let f;e[7]!==s?(f=s("settings.jira.boardDescription"),e[7]=s,e[8]=f):f=e[8];const m=l.boardId??"";let u;e[9]!==s?(u=s("settings.jira.boardPlaceholder"),e[9]=s,e[10]=u):u=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]!==i.isPending||e[14]!==s?(p=i.isPending?s("settings.jira.loadingBoards"):s("settings.jira.noBoardsMatch"),e[13]=i.isPending,e[14]=s,e[15]=p):p=e[15];let b;e[16]!==c||e[17]!==s?(b=()=>a.jsxs(U,{variant:"outline",role:"combobox",className:"w-72 justify-between font-normal",children:[a.jsx("span",{className:"truncate",children:c??s("settings.jira.boardPlaceholder")}),a.jsx(ce,{className:"opacity-50 shrink-0"})]}),e[16]=c,e[17]=s,e[18]=b):b=e[18];let h;e[19]!==r||e[20]!==l.boardId||e[21]!==s||e[22]!==n?(h=y=>{!y||y===l.boardId||n.mutate({boardId:y,boardName:r.find(v=>v.value===y)?.primary??null},{onError:v=>q.error(Z(v,s("settings.jira.saveFailed")))})},e[19]=r,e[20]=l.boardId,e[21]=s,e[22]=n,e[23]=h):h=e[23];let j;e[24]!==r||e[25]!==m||e[26]!==u||e[27]!==g||e[28]!==p||e[29]!==b||e[30]!==h?(j=a.jsx(Oe,{options:r,value:m,width:"w-72",triggerClassName:"shrink-0",placeholder:u,searchPlaceholder:g,filter:Ke,emptyMessage:p,renderTrigger:b,renderItem:Xe,onChange:h}),e[24]=r,e[25]=m,e[26]=u,e[27]=g,e[28]=p,e[29]=b,e[30]=h,e[31]=j):j=e[31];let x;return e[32]!==j||e[33]!==d||e[34]!==f?(x=a.jsx(Q,{title:d,description:f,action:j}),e[32]=j,e[33]=d,e[34]=f,e[35]=x):x=e[35],x}function Xe(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 Ze(t){const{primary:e,secondary:l}=de(t);return{value:String(t.id),label:Fe(t),primary:e,secondary:l}}function et(t){const e=P.c(16),{integration:l}=t,s=M(),n=ie();let i;e[0]!==s?(i=s("settings.jira.enabledLabel"),e[0]=s,e[1]=i):i=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]!==l.boardId||e[5]!==s||e[6]!==n?(o=f=>{if(f&&!l.boardId){q.error(s("settings.jira.enableRequirements"));return}n.mutate({enabled:f},{onError:m=>q.error(Z(m,s("settings.jira.saveFailed")))})},e[4]=l.boardId,e[5]=s,e[6]=n,e[7]=o):o=e[7];let c;e[8]!==l.enabled||e[9]!==o||e[10]!==n.isPending?(c=a.jsx(ve,{checked:l.enabled,disabled:n.isPending,onCheckedChange:o}),e[8]=l.enabled,e[9]=o,e[10]=n.isPending,e[11]=c):c=e[11];let d;return e[12]!==i||e[13]!==r||e[14]!==c?(d=a.jsx(Q,{title:i,description:r,action:c}),e[12]=i,e[13]=r,e[14]=c,e[15]=d):d=e[15],d}function tt(t){const e=P.c(24),{integration:l}=t,s=M(),n=`${window.location.origin}/api/_jira/webhook/${l.webhookSecret}`;let i;e[0]!==s?(i=s("settings.jira.webhookTitle"),e[0]=s,e[1]=i):i=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]!==n?(o=a.jsx(X,{readOnly:!0,value:n,className:"font-mono text-xs"}),e[4]=n,e[5]=o):o=e[5];let c;e[6]!==s||e[7]!==n?(c=()=>{navigator.clipboard.writeText(n),q.success(s("settings.jira.webhookCopied"))},e[6]=s,e[7]=n,e[8]=c):c=e[8];let d;e[9]!==s?(d=s("settings.jira.webhookCopy"),e[9]=s,e[10]=d):d=e[10];let f;e[11]!==c||e[12]!==d?(f=a.jsx(U,{variant:"outline",size:"sm",className:"shrink-0",onClick:c,children:d}),e[11]=c,e[12]=d,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[o,f]}),e[14]=o,e[15]=f,e[16]=m):m=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Qe,{stepKeys:["settings.jira.webhookStep1","settings.jira.webhookStep2","settings.jira.webhookStep3","settings.jira.webhookStep4","settings.jira.webhookStep5"]}),e[17]=u):u=e[17];let g;e[18]!==m?(g=a.jsxs("div",{className:"flex flex-col gap-3 mt-3",children:[m,u]}),e[18]=m,e[19]=g):g=e[19];let p;return e[20]!==i||e[21]!==r||e[22]!==g?(p=a.jsx(Q,{title:i,description:r,children:g}),e[20]=i,e[21]=r,e[22]=g,e[23]=p):p=e[23],p}function st(){const t=P.c(11),e=M(),l=Le();if(l.isPending){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(Y,{children:a.jsx("div",{className:"p-4",children:a.jsx(ae,{className:"h-40 w-full"})})}),t[0]=i):i=t[0],i}if(!l.data){let i;t[1]!==e?(i=e("settings.jira.connectTitle"),t[1]=e,t[2]=i):i=t[2];let r;t[3]!==e?(r=e("settings.jira.connectDescription"),t[3]=e,t[4]=r):r=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(We,{}),t[5]=o):o=t[5];let c;return t[6]!==i||t[7]!==r?(c=a.jsx(Y,{children:a.jsx(Q,{title:i,description:r,children:o})}),t[6]=i,t[7]=r,t[8]=c):c=t[8],c}const s=l.data;let n;return t[9]!==s?(n=a.jsxs(Y,{children:[a.jsx(Ve,{integration:s}),a.jsx(Ye,{integration:s}),a.jsx(et,{integration:s}),a.jsx(tt,{integration:s})]}),t[9]=s,t[10]=n):n=t[10],n}function it(){const t=P.c(18),e=M();let l;t[0]!==e?(l=e("settings.nav.tasks"),t[0]=e,t[1]=l):l=t[1];let s;t[2]!==l?(s=a.jsx(V.Title,{children:l}),t[2]=l,t[3]=s):s=t[3];let n,i,r;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(Ae,{}),i=a.jsx(Ge,{}),r=a.jsx(Re,{}),t[4]=n,t[5]=i,t[6]=r):(n=t[4],i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Be,{size:18}),t[7]=o):o=t[7];let c;t[8]!==e?(c=e("settings.jira.sectionTitle"),t[8]=e,t[9]=c):c=t[9];let d;t[10]!==c?(d=a.jsxs("span",{className:"flex items-center gap-2",children:[o,c]}),t[10]=c,t[11]=d):d=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(st,{}),t[12]=f):f=t[12];let m;t[13]!==d?(m=a.jsx(re,{title:d,children:f}),t[13]=d,t[14]=m):m=t[14];let u;return t[15]!==s||t[16]!==m?(u=a.jsx(V,{children:a.jsx(V.Content,{children:a.jsx(V.Body,{children:a.jsxs(fe,{children:[s,n,i,r,m]})})})}),t[15]=s,t[16]=m,t[17]=u):u=t[17],u}function Ct(){const t=P.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx($e,{capability:"org:manage",area:"settings",children:a.jsx(it,{})}),t[0]=e):e=t[0],e}export{Ct as default};
@@ -1 +1 @@
1
- import{c as o,l,j as n}from"./index-CW6L2S49.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-Ciqhx4Es.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-CW6L2S49.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-Ciqhx4Es.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-CW6L2S49.js";import{d as J,h as K,c as F,b as G,D as W}from"./dialog-lVg2I_FW.js";import{i as Y}from"./Check-Bu3XsPtR.js";import{a as Q}from"./Copy01-BbXi4FYi.js";import{n as X}from"./Download01-AtmH14NN.js";import{u as M,D as j}from"./use-destination-route-7JP5O6OJ.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.321.3"),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-Ciqhx4Es.js";import{d as J,h as K,c as F,b as G,D as W}from"./dialog-BVuXhd_n.js";import{i as Y}from"./Check-DiuzOTdo.js";import{a as Q}from"./Copy01-CZOGrHZ9.js";import{n as X}from"./Download01-DEU1JkfL.js";import{u as M,D as j}from"./use-destination-route-BbzQn-n1.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.321.4"),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};