decocms 4.182.2 → 4.182.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 (247) hide show
  1. package/dist/client/assets/{AlertCircle-BGrbeDYT.js → AlertCircle-aHUodbMz.js} +1 -1
  2. package/dist/client/assets/{AreaChart-ChjS34cq.js → AreaChart-B5lioxQz.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-B7rh6W_b.js → ArrowUp-B1slVOB0.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-An4hbib7.js → ArrowUpRight--mFpZoD0.js} +1 -1
  5. package/dist/client/assets/{Check-DpoXXYhc.js → Check-Bqqh9z-D.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DI16N69_.js → CheckCircle-2-UJ4CMp.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BbcA24KM.js → ChevronDown-DP1ievFt.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-BamDO5gK.js → ChevronRight-D_oGoarw.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-HIfNhOKS.js → ChevronUp-VBLtmSfp.js} +1 -1
  10. package/dist/client/assets/{Copy01-Bnz3Wx80.js → Copy01-C2PSDvbV.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-BShcbCHO.js → CpuChip01-BKuPfNBn.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-DNJmFfow.js → CreditCard01-C-gNn36M.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-B_iya6B7.js → DotsVertical-CKKotJph.js} +1 -1
  14. package/dist/client/assets/{Eye-BjhopnZD.js → Eye-C4_fUR7p.js} +1 -1
  15. package/dist/client/assets/{FilterLines-H3se16dF.js → FilterLines-1LemGTNy.js} +1 -1
  16. package/dist/client/assets/{HardDrive-Cc0iy42M.js → HardDrive-B3cDKzGK.js} +1 -1
  17. package/dist/client/assets/{Key01-C21diL-t.js → Key01-DW19snbx.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-NGYALHZo.js → LayoutLeft-DT75DZge.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-BIYwVSjD.js → LinkExternal01-Cr_D6AUh.js} +1 -1
  20. package/dist/client/assets/{LogOut01-BYbHv1g4.js → LogOut01-CpinuBoH.js} +1 -1
  21. package/dist/client/assets/{Monitor01-PnI4BWSm.js → Monitor01-DE267NI6.js} +1 -1
  22. package/dist/client/assets/{Palette-DqKGGY7c.js → Palette-CFdqAyvh.js} +1 -1
  23. package/dist/client/assets/{Play-C6pKirQG.js → Play-DQaYqXyr.js} +1 -1
  24. package/dist/client/assets/{Plus-3NJoZ-Rn.js → Plus-CEsq76GY.js} +1 -1
  25. package/dist/client/assets/{SearchLg-DUoOTY_-.js → SearchLg-Ccn7y6_h.js} +1 -1
  26. package/dist/client/assets/{SearchMd-DZC0VFyz.js → SearchMd-Cp5X4j-4.js} +1 -1
  27. package/dist/client/assets/{Settings02-K87UDDa_.js → Settings02-B88nTmbo.js} +1 -1
  28. package/dist/client/assets/{Shield01-Dif9NKxP.js → Shield01-7HxK-TBP.js} +1 -1
  29. package/dist/client/assets/{Star01-BWcFSKod.js → Star01-CmKUJriU.js} +1 -1
  30. package/dist/client/assets/{Stars01-DNjCGctC.js → Stars01-dsVxW0Iw.js} +1 -1
  31. package/dist/client/assets/{Stars02-CF9PavPD.js → Stars02-CbWcKkha.js} +1 -1
  32. package/dist/client/assets/{Sun-D_TMYzXg.js → Sun-Iy-StK2g.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-Boo6w6_t.js → SwitchHorizontal01-BJitQzy2.js} +1 -1
  34. package/dist/client/assets/{Tool01-BjfDVrJb.js → Tool01-2Qll6vRQ.js} +1 -1
  35. package/dist/client/assets/{Tool02-df-j-2i7.js → Tool02-CO5Ts7uk.js} +1 -1
  36. package/dist/client/assets/{Trash01-BfrFYc0O.js → Trash01-CxQJ-T3T.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-Bj5u2ghc.js → TrendUp01-0XOYCeVZ.js} +1 -1
  38. package/dist/client/assets/{Upload01-DGoH2Bw8.js → Upload01-B8X2BCi1.js} +1 -1
  39. package/dist/client/assets/{User01-PHqRfaY2.js → User01-C8SW2dlc.js} +1 -1
  40. package/dist/client/assets/{Users01-CeRMXGJo.js → Users01-Dkku08eU.js} +1 -1
  41. package/dist/client/assets/{Users03-Cwqfteu1.js → Users03-CNHHA2CB.js} +1 -1
  42. package/dist/client/assets/{X-D0lgdZFx.js → X-2mQugttC.js} +1 -1
  43. package/dist/client/assets/{XCircle-BEfRA2Fy.js → XCircle-DcPzz_7R.js} +1 -1
  44. package/dist/client/assets/{XClose-Ca9PFBA7.js → XClose-DFzRbFQt.js} +1 -1
  45. package/dist/client/assets/{Zap-Cd4akcPN.js → Zap-BhuYnrjn.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-2syNvY2F.js → ZapSquare-D8-2DhvZ.js} +1 -1
  47. package/dist/client/assets/{access-gate-BXHarpej.js → access-gate-BsORq1ML.js} +1 -1
  48. package/dist/client/assets/{add-section-modal-BtHF1Suz.js → add-section-modal-BDFcNPjF.js} +1 -1
  49. package/dist/client/assets/{agent-icon-CQRHN6rX.js → agent-icon-CXHCeTMr.js} +1 -1
  50. package/dist/client/assets/{agents-list-CwubhMUP.js → agents-list-B4JOoj6P.js} +1 -1
  51. package/dist/client/assets/ai-providers-DG3Wwjk6.js +1 -0
  52. package/dist/client/assets/{alert-Ig9SrjcF.js → alert-BrapZZ1e.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-CWFjoJjX.js → alert-dialog-Dp0TwMS2.js} +3 -3
  54. package/dist/client/assets/app-editor-C5bR2kuD.js +1 -0
  55. package/dist/client/assets/{auth-av09Sk0f.js → auth-CVRtqdR-.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-DWcWxlY6.js → auth-catchall-C5-vo66l.js} +1 -1
  57. package/dist/client/assets/{auth-entry-DOdCfRAO.js → auth-entry-DevPOjDG.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-CIY4l9vm.js → auth-split-layout-BWhd9bfi.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-CCHy3FzA.js → authenticate-and-persist-oauth-E6sLdro6.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-CYmqpjOL.js → automation-list-row-adG4CPhS.js} +1 -1
  61. package/dist/client/assets/{automation-runs-D9S7Bj8t.js → automation-runs-dow6kHOy.js} +1 -1
  62. package/dist/client/assets/{automations-g7LGm5hd.js → automations-1TSzUOmA.js} +1 -1
  63. package/dist/client/assets/{avatar-I17szs3Q.js → avatar-CgzSFqk_.js} +1 -1
  64. package/dist/client/assets/{badge-1BKF0WjP.js → badge-lMx4Em_d.js} +1 -1
  65. package/dist/client/assets/{billing-EZuyPlZX.js → billing-cg1pMUCL.js} +1 -1
  66. package/dist/client/assets/{block-document-CrI42xhd.js → block-document-DACwj6cq.js} +1 -1
  67. package/dist/client/assets/brand-context-_YEJiMtE.js +1 -0
  68. package/dist/client/assets/{buckets-BjM-OEVV.js → buckets-DDs_bOU6.js} +1 -1
  69. package/dist/client/assets/bulk-category-panel-CZ1xK5ra.js +1 -0
  70. package/dist/client/assets/{calendar-ihm97ng4.js → calendar-CYMp7iB8.js} +1 -1
  71. package/dist/client/assets/{capability-load-error-CdiziQNa.js → capability-load-error-BdQ0RY6o.js} +1 -1
  72. package/dist/client/assets/{card-ZgfbVCh9.js → card-CmIeTTKx.js} +1 -1
  73. package/dist/client/assets/category-editor-tpL-X4Ls.js +1 -0
  74. package/dist/client/assets/chat-context-BLOQKHWz.js +35 -0
  75. package/dist/client/assets/{checkbox-CQ_C4vJL.js → checkbox-CQzjZNLI.js} +1 -1
  76. package/dist/client/assets/{cli-auth-success-SOuYeldg.js → cli-auth-success-B_bJdAXe.js} +1 -1
  77. package/dist/client/assets/collection-detail-BrNskSUP.js +1 -0
  78. package/dist/client/assets/{collection-display-button-sALJ24Pj.js → collection-display-button-DDQfc_4E.js} +1 -1
  79. package/dist/client/assets/{collection-search-Bxz23u0F.js → collection-search-Ck8xQbQY.js} +1 -1
  80. package/dist/client/assets/{collection-table-wrapper-Dl8DuNBG.js → collection-table-wrapper-CPjrFIXF.js} +1 -1
  81. package/dist/client/assets/{collection-tabs-DJww20x9.js → collection-tabs-ChTTyKBp.js} +1 -1
  82. package/dist/client/assets/{command-bMsQFALP.js → command-DVjoIL5Z.js} +1 -1
  83. package/dist/client/assets/commerce-onboarding-XS_jc2I-.js +1 -0
  84. package/dist/client/assets/{companions-core-DYxPDPJ-.js → companions-core-ByyoADu_.js} +1 -1
  85. package/dist/client/assets/{connect-BS6fJ7Zh.js → connect-DcehsLQD.js} +1 -1
  86. package/dist/client/assets/connection-Bkj-nefY.js +1 -0
  87. package/dist/client/assets/{connection-card-Di6_Srf0.js → connection-card-C70gWuc_.js} +1 -1
  88. package/dist/client/assets/connection-detail-Cnm4EZ40.js +1 -0
  89. package/dist/client/assets/connection-form-helpers-BRiQ_rsM.js +1 -0
  90. package/dist/client/assets/connections-CL7Q9BT1.js +1 -0
  91. package/dist/client/assets/{decopilot-sse-pool-CsSaGM07.js → decopilot-sse-pool-BHpOwOnT.js} +1 -1
  92. package/dist/client/assets/{dialog-DFfWjXhn.js → dialog-C4tS6-AJ.js} +1 -1
  93. package/dist/client/assets/{domain-settings-I5C-7sNQ.js → domain-settings-DhQBJJ9v.js} +1 -1
  94. package/dist/client/assets/{drawer-CjxVq45y.js → drawer-DCnsLLwJ.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-DNVNevD7.js → dropdown-menu-qrFjdFOd.js} +1 -1
  96. package/dist/client/assets/{empty-state-BkAQUfnz.js → empty-state-BcHx1F5j.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-D8g8Vhah.js → extract-connection-data-Btyggj3c.js} +1 -1
  98. package/dist/client/assets/file-explorer-DGWuJh1T.js +2 -0
  99. package/dist/client/assets/{form-Cy7Rd3TL.js → form-HuoBuCsb.js} +1 -1
  100. package/dist/client/assets/general-YiXWqla_.js +1 -0
  101. package/dist/client/assets/{github-repo-picker-CKQYOUVF.js → github-repo-picker-DXw_3pye.js} +1 -1
  102. package/dist/client/assets/{hooks-BYQbPRxe.js → hooks-BG8LlYqb.js} +5 -5
  103. package/dist/client/assets/{index-4j84p8Zm.js → index-BC86WZCo.js} +1 -1
  104. package/dist/client/assets/{index-C6AlWcn2.js → index-BPHqkwHC.js} +1 -1
  105. package/dist/client/assets/{index-Dyyz80fH.js → index-BVf7C7ZF.js} +3 -3
  106. package/dist/client/assets/{index-gWiN9Hkl.js → index-B_Bz9U5o.js} +1 -1
  107. package/dist/client/assets/{index-DW2rv6fU.js → index-BmYps6j2.js} +1 -1
  108. package/dist/client/assets/{index-DnUHHdy9.js → index-BsoA0TDj.js} +1 -1
  109. package/dist/client/assets/{index-B1Swgh1Q.js → index-BwZDbDIY.js} +1 -1
  110. package/dist/client/assets/index-CiPtrYhG.js +1 -0
  111. package/dist/client/assets/{index-SVAVudgF.js → index-Cj6tjEF7.js} +1 -1
  112. package/dist/client/assets/{index-y45nRZhN.js → index-CmIo9JPs.js} +36 -36
  113. package/dist/client/assets/{index-geMXTkeP.js → index-D-1YQKmA.js} +6 -6
  114. package/dist/client/assets/{index-BZsTAPza.js → index-D0be3KU_.js} +1 -1
  115. package/dist/client/assets/{index-redirect-tLRs_ohU.js → index-redirect-kUAcNkcZ.js} +1 -1
  116. package/dist/client/assets/{input-i4x2nRXJ.js → input-BJ0a7El5.js} +1 -1
  117. package/dist/client/assets/{integration-icon-G3CkJMl-.js → integration-icon-BolJxA3P.js} +1 -1
  118. package/dist/client/assets/invite-member-dialog-Cwz44-id.js +1 -0
  119. package/dist/client/assets/{label-cSCv6rYO.js → label-B51Cfjcb.js} +1 -1
  120. package/dist/client/assets/{layout-Dc_sBLyQ.js → layout-DNcRGo2s.js} +1 -1
  121. package/dist/client/assets/{login-BiKFzoUX.js → login-z85wGBst.js} +1 -1
  122. package/dist/client/assets/{mcp-oauth-Dv6Uhpr5.js → mcp-oauth-ls-QVFRg.js} +1 -1
  123. package/dist/client/assets/{members-50SkOm91.js → members-DphiZz1R.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-DNmyyJIn.js → monaco-editor-x5D7h3Zd.js} +4 -4
  125. package/dist/client/assets/{monitoring-stats-row-C66zfOZ2.js → monitoring-stats-row-A2TkqHkL.js} +1 -1
  126. package/dist/client/assets/{multi-select-JtlKk2T8.js → multi-select-D-smOS6l.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-BOmgYt-J.js → oauth-callback-F721pquo.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-D-bUKmX5.js → oauth-callback-ai-provider-BwKYVloT.js} +1 -1
  129. package/dist/client/assets/{onboarding-Dd0xJ_jB.js → onboarding-CLbPa2Iw.js} +1 -1
  130. package/dist/client/assets/{org-layout-Cyx2dswG.js → org-layout-efrG08YS.js} +1 -1
  131. package/dist/client/assets/{organization-choice-Dmy0N3Ho.js → organization-choice-DddHH9KP.js} +1 -1
  132. package/dist/client/assets/{orgs-c3mClxSP.js → orgs-DdMwkwNa.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-CT7Q9nSJ.js → page-seo-form-CwTJM4dv.js} +1 -1
  134. package/dist/client/assets/{popover-i4jezHIh.js → popover-D9cBxWQc.js} +1 -1
  135. package/dist/client/assets/post-editor-DnSlIXef.js +1 -0
  136. package/dist/client/assets/{primitives-DONjjQ2v.js → primitives-H5jElIgn.js} +1 -1
  137. package/dist/client/assets/profile-Aobp6psg.js +1 -0
  138. package/dist/client/assets/project-app-view-DjrSQfca.js +1 -0
  139. package/dist/client/assets/record-editor-3OTLDvRE.js +1 -0
  140. package/dist/client/assets/redirect-editor-DpMy0uAy.js +1 -0
  141. package/dist/client/assets/registry-Bso8TzZ7.js +2 -0
  142. package/dist/client/assets/{registry-layout-f4c_WFt1.js → registry-layout-opgZJiz9.js} +1 -1
  143. package/dist/client/assets/{reports-CVDl7DQS.js → reports-D2yxA8fw.js} +1 -1
  144. package/dist/client/assets/{require-capability-6g_AHVvS.js → require-capability-CMySxwCj.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-S0YtLBA5.js → required-auth-layout-Bvo_3wIM.js} +1 -1
  146. package/dist/client/assets/{reset-password-mvh2Bp76.js → reset-password-nv8NwNZo.js} +1 -1
  147. package/dist/client/assets/roles-CYWyfOcz.js +1 -0
  148. package/dist/client/assets/{search-input-B-QuRigZ.js → search-input-CXdhLilB.js} +1 -1
  149. package/dist/client/assets/{secrets-DJdQx2SE.js → secrets-B9PJQSCH.js} +1 -1
  150. package/dist/client/assets/sections-editor-C939paEw.js +2 -0
  151. package/dist/client/assets/{select-D6zOoh5E.js → select-SeQy1Hg5.js} +1 -1
  152. package/dist/client/assets/{select-model-BNaO-ex3.js → select-model-CBQ7sKC3.js} +1 -1
  153. package/dist/client/assets/self-tool-result-BH4oZBIX.js +1 -0
  154. package/dist/client/assets/seo-editor-PXOzj3WZ.js +1 -0
  155. package/dist/client/assets/{settings-layout-DhZgaTMP.js → settings-layout-CHRiIOe2.js} +1 -1
  156. package/dist/client/assets/{settings-section-jz9Avb_j.js → settings-section-CQIkd9Eq.js} +1 -1
  157. package/dist/client/assets/{shell-controls-Cp2LM0mr.js → shell-controls-D3D-t70c.js} +1 -1
  158. package/dist/client/assets/{shell-layout-D82GP0rP.js → shell-layout-DfAyNJEZ.js} +1 -1
  159. package/dist/client/assets/{sidebar-cviY2JKt.js → sidebar-By4K9wDK.js} +1 -1
  160. package/dist/client/assets/{skeleton-BnFORNZa.js → skeleton-D5IMmpmB.js} +1 -1
  161. package/dist/client/assets/{spinner-CkuCAiR1.js → spinner-Cz5qI88w.js} +1 -1
  162. package/dist/client/assets/{sso-De3-zYaW.js → sso-C3F2Mig7.js} +1 -1
  163. package/dist/client/assets/{store-4sYEV7M-.js → store-BP1goh1R.js} +1 -1
  164. package/dist/client/assets/store-registry-0mAT-_6s.js +2 -0
  165. package/dist/client/assets/{studio-tools-DH0-34Hv.js → studio-tools-CBB5NcXK.js} +1 -1
  166. package/dist/client/assets/{switch-D2uF_EAp.js → switch-DoHyUDLY.js} +1 -1
  167. package/dist/client/assets/{tab-id-VDxePu-8.js → tab-id-DbJCnUPm.js} +1 -1
  168. package/dist/client/assets/{table-D5WR7hLa.js → table-CDPtw8xa.js} +1 -1
  169. package/dist/client/assets/{tabs-CqBl7afq.js → tabs-C1G6by-P.js} +1 -1
  170. package/dist/client/assets/{textarea-Bn6hQ_Qz.js → textarea-BwRj3BWK.js} +1 -1
  171. package/dist/client/assets/{toggle-group-D7y3Qsoq.js → toggle-group-GBeHqGC2.js} +1 -1
  172. package/dist/client/assets/{toolbar-CpuC8NsW.js → toolbar-AgUwum7S.js} +1 -1
  173. package/dist/client/assets/{tooltip-BrF3GD_a.js → tooltip-DD5bQH23.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-CaSDpPjb.js → use-ai-providers-BzQGXce-.js} +1 -1
  175. package/dist/client/assets/{use-automations-mCzD08OY.js → use-automations-09Ukg4ai.js} +1 -1
  176. package/dist/client/assets/{use-autosave-Dys6xriZ.js → use-autosave-Dqz98v7e.js} +1 -1
  177. package/dist/client/assets/{use-capability-Cpe_qvZ_.js → use-capability-B_lZAM70.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-CAblMTwd.js → use-clock-tick-DAnBYTL7.js} +1 -1
  179. package/dist/client/assets/{use-connection-B7cDwiOJ.js → use-connection-BHwQgQE1.js} +1 -1
  180. package/dist/client/assets/{use-copy-r5QxG4Uf.js → use-copy-CaVFAZIo.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-DcGH_7kD.js → use-create-virtual-mcp-6AEcQ_wM.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-9sjmxrz4.js → use-debounced-autosave-B2uo_U0Q.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-LrUb7eiJ.js → use-debounced-value-74quYOmV.js} +1 -1
  184. package/dist/client/assets/use-deco-credits-CBEWHfVh.js +1 -0
  185. package/dist/client/assets/{use-decopilot-events-up5oIRDt.js → use-decopilot-events-BgusMKRg.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-B8yeqLKN.js → use-delete-connection-BiPqYCjC.js} +1 -1
  187. package/dist/client/assets/{use-deployment-admin-nCX9A08B.js → use-deployment-admin-C59XkfKO.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-1vs3YVUZ.js → use-file-configs-DVZ67f8T.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-CNsERN2g.js → use-infinite-scroll-DXBuOc2K.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-6lnToRtO.js → use-join-requests-CBhkIuEv.js} +1 -1
  191. package/dist/client/assets/{use-mcp-client-BBl5zme6.js → use-mcp-client-D2tnZwXX.js} +1 -1
  192. package/dist/client/assets/{use-mcp-tools-BKtLcTYP.js → use-mcp-tools-BSCBM72A.js} +1 -1
  193. package/dist/client/assets/{use-members-stYO4DxP.js → use-members-CbYX7gT8.js} +1 -1
  194. package/dist/client/assets/{use-mobile-DMoYecwn.js → use-mobile-DhY0tiih.js} +1 -1
  195. package/dist/client/assets/{use-navigate-to-agent-ABFR-14c.js → use-navigate-to-agent-3K4zONOl.js} +1 -1
  196. package/dist/client/assets/{use-open-billing-url-DU9jxy0C.js → use-open-billing-url-BYrh3DXJ.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-DoX1JG5g.js → use-org-auth-client-DnAPExjB.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-BVhPMS3K.js → use-org-sso-CxMNrp--.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-A2d2BvKK.js → use-organization-roles-D_3ZeAWB.js} +1 -1
  200. package/dist/client/assets/{use-organization-settings-DhcL4nY9.js → use-organization-settings-BqeF7AUq.js} +1 -1
  201. package/dist/client/assets/{use-registry-connections-BoF5es5w.js → use-registry-connections-9U302Lpg.js} +1 -1
  202. package/dist/client/assets/{use-secrets-BmzIH3vm.js → use-secrets-B1ccTxVT.js} +1 -1
  203. package/dist/client/assets/{use-status-sounds-DCcIH0HO.js → use-status-sounds-DDz5PHrU.js} +1 -1
  204. package/dist/client/assets/{use-tags-B8ASGI2M.js → use-tags-CFQKPVS-.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-xB_4AhUq.js → use-view-mode-DnH7I6ms.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-CEV_ngrf.js → use-virtual-mcp-DsypThsI.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-lNJCiHAb.js +1 -0
  208. package/dist/client/assets/{useRouterState-CZMj98pk.js → useRouterState-57-5hG_a.js} +1 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-PjgDS9n5.js +1 -0
  210. package/dist/client/assets/{users-CONOx6T6.js → users-C806VJZs.js} +1 -1
  211. package/dist/client/assets/{variant-calendar-E6f23yio.js → variant-calendar-RlCZewyQ.js} +1 -1
  212. package/dist/client/assets/{view-mode-toggle-DM6n_Ydg.js → view-mode-toggle-CCjGdqzA.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/server/cli.js +2 -2
  215. package/dist/server/server.js +2 -2
  216. package/package.json +1 -1
  217. package/dist/client/assets/ai-providers-BpVENL06.js +0 -1
  218. package/dist/client/assets/app-editor-B5H5-F8S.js +0 -1
  219. package/dist/client/assets/brand-context-DVPmwhF3.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-USUYO_mP.js +0 -1
  221. package/dist/client/assets/category-editor-DQSbFl5w.js +0 -1
  222. package/dist/client/assets/chat-context-Duovvv_d.js +0 -35
  223. package/dist/client/assets/collection-detail-Fz2npTpx.js +0 -1
  224. package/dist/client/assets/commerce-onboarding-orMZD5VK.js +0 -1
  225. package/dist/client/assets/connection-CSUNWBHY.js +0 -1
  226. package/dist/client/assets/connection-detail-XkeoVAsF.js +0 -1
  227. package/dist/client/assets/connection-form-helpers-Dl1KTkNE.js +0 -1
  228. package/dist/client/assets/connections-3_b1sdLg.js +0 -1
  229. package/dist/client/assets/file-explorer-DjVkaNg4.js +0 -2
  230. package/dist/client/assets/general-CWjnB8Qn.js +0 -1
  231. package/dist/client/assets/index-a5f43C0l.js +0 -1
  232. package/dist/client/assets/invite-member-dialog-Bp5nMnrA.js +0 -1
  233. package/dist/client/assets/post-editor-ITfNNH8c.js +0 -1
  234. package/dist/client/assets/profile-CJ18mI2I.js +0 -1
  235. package/dist/client/assets/project-app-view-BEATiNjk.js +0 -1
  236. package/dist/client/assets/record-editor-CxzRU1Mb.js +0 -1
  237. package/dist/client/assets/redirect-editor-DmlZU7UI.js +0 -1
  238. package/dist/client/assets/registry-DHRSWQvL.js +0 -2
  239. package/dist/client/assets/roles-BDap8m-X.js +0 -1
  240. package/dist/client/assets/sections-editor-W06wfa9f.js +0 -2
  241. package/dist/client/assets/self-tool-result-Bjd_Fo-p.js +0 -1
  242. package/dist/client/assets/seo-editor-DKX2y5cI.js +0 -1
  243. package/dist/client/assets/store-registry-BKTzIEg1.js +0 -2
  244. package/dist/client/assets/use-deco-credits-Dp43HFr7.js +0 -1
  245. package/dist/client/assets/useInfiniteQuery-BI-Ge-Y8.js +0 -1
  246. package/dist/client/assets/useQueries-d_0_L-iH.js +0 -1
  247. package/dist/client/assets/useSuspenseInfiniteQuery-9ztDghoj.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.182.2",
3
+ "version": "4.182.4",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{Y as X,Z as K,a3 as Ae,a5 as Ke,a6 as ne,a4 as Be,b8 as Oe,c as Z,b as le,_ as ze,$ as Le,r as W,j as s,a7 as nt,t as ee,aw as Ve,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,p as Qe,v as at,E as ct}from"./index-geMXTkeP.js";import{i as dt}from"./AlertCircle-BGrbeDYT.js";import{P as Ne}from"./index-B1Swgh1Q.js";import{S as Ee}from"./skeleton-BnFORNZa.js";import{b as Ge,a as Me,S as Te,c as mt}from"./settings-section-jz9Avb_j.js";import{u as We,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Ye}from"./use-ai-providers-CaSDpPjb.js";import{i as ht}from"./CheckCircle-DI16N69_.js";import{b as xt,j as vt}from"./use-organization-settings-DhcL4nY9.js";import{c as bt,d as Je,P as yt,C as $e}from"./select-model-BNaO-ex3.js";import{u as jt}from"./use-debounced-autosave-9sjmxrz4.js";import{I as Ce}from"./input-i4x2nRXJ.js";import{T as qe,a as St}from"./toggle-group-D7y3Qsoq.js";import{A as Ze,a as Xe,b as et,c as tt,d as st,e as it,f as lt,g as ot}from"./alert-dialog-CWFjoJjX.js";import{u as ce}from"./studio-tools-DH0-34Hv.js";import{s as Ct}from"./Plus-3NJoZ-Rn.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-BjfDVrJb.js";import{s as It}from"./Trash01-BfrFYc0O.js";import{A as Nt}from"./avatar-I17szs3Q.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-K87UDDa_.js";import{s as Kt}from"./Eye-BjhopnZD.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-DFfWjXhn.js";import{S as Ft}from"./spinner-CkuCAiR1.js";import{R as Ot}from"./require-capability-6g_AHVvS.js";import"./sidebar-cviY2JKt.js";import"./LayoutLeft-NGYALHZo.js";import"./use-mobile-DMoYecwn.js";import"./X-D0lgdZFx.js";import"./tooltip-BrF3GD_a.js";import"./card-ZgfbVCh9.js";import"./ArrowUpRight-An4hbib7.js";import"./use-mcp-client-BBl5zme6.js";import"./auth-av09Sk0f.js";import"./drawer-CjxVq45y.js";import"./chat-context-Duovvv_d.js";import"./tab-id-VDxePu-8.js";import"./Check-DpoXXYhc.js";import"./Copy01-Bnz3Wx80.js";import"./hooks-BYQbPRxe.js";import"./decopilot-sse-pool-CsSaGM07.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CEV_ngrf.js";import"./use-decopilot-events-up5oIRDt.js";import"./checkbox-CQ_C4vJL.js";import"./select-D6zOoh5E.js";import"./ChevronDown-BbcA24KM.js";import"./ChevronUp-HIfNhOKS.js";import"./Key01-C21diL-t.js";import"./SearchMd-DZC0VFyz.js";import"./Monitor01-PnI4BWSm.js";import"./ChevronRight-BamDO5gK.js";import"./Stars01-DNjCGctC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-PHqRfaY2.js";import"./use-capability-Cpe_qvZ_.js";import"./access-gate-BXHarpej.js";import"./capability-load-error-CdiziQNa.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const re=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();Be(["fast","smart","thinking","image","web_search","deep_research"]);Be(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:re,smart:re,thinking:re,image:re,web_search:re,deep_research:re})});X({tiers:X({fast:re.optional(),smart:re.optional(),thinking:re.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:l,filterModels:a,defaultKeyId:n}=e,c=We(),r=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[v,I]=W.useState(r??n);let _,o;t[0]!==r?(_=()=>{r&&I(r)},o=[r],t[0]=r,t[1]=_,t[2]=o):(_=t[1],o=t[2]),W.useEffect(_,o);let d;t[3]!==c||t[4]!==n||t[5]!==v?(d=c.some(C=>C.id===v)?v:n,t[3]=c,t[4]=n,t[5]=v,t[6]=d):d=t[6];const m=d;let u;t[7]!==m||t[8]!==c?(u=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=u):u=t[9];const b=u,{models:x,isLoading:y}=we(a?m??void 0:void 0),f=a?y||x.some(a):!0;let j;t[10]!==i||t[11]!==b?.providerId||t[12]!==r?(j=i&&r?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:b?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=b?.providerId,t[12]=r,t[13]=j):j=t[13];const N=j,g=le();if(a&&!f){let C;t[14]!==g?(C=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let k;t[18]!==g?(k=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=k):k=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=C=>I(C),t[20]=p):p=t[20];let h;t[21]!==m||t[22]!==l?(h=C=>{const w=C.keyId??m??"";I(w),l({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=l,t[23]=h):h=t[23];let S;return t[24]!==m||t[25]!==a||t[26]!==N||t[27]!==k||t[28]!==h?(S=s.jsx(bt,{variant:"bordered",placeholder:k,model:N,credentialId:m,filterModels:a,onCredentialChange:p,onModelChange:h}),t[24]=m,t[25]=a,t[26]=N,t[27]=k,t[28]=h,t[29]=S):S=t[29],S}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,a=le();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=c):c=t[2];let r;return t[3]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=r):r=t[4],r}if(l){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{size:12}),t[5]=n):n=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=c):c=t[7];let r;return t[8]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=r):r=t[9],r}return null}function Vt(){const e=Z.c(58),t=le(),i=We(),l=xt(),a=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=ze(Ut),e[0]=n):n=e[0];let c;e[1]!==l?(c={resolver:n,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const r=Le(c),{mutate:v,isPending:I,isSuccess:_}=vt(),o=r.formState.isDirty;let d;e[3]!==r||e[4]!==l||e[5]!==t||e[6]!==v?(d={delayMs:250,save:async()=>{const P=r.getValues();v(P,{onSuccess:()=>r.reset(P,{keepValues:!0}),onError:F=>{r.reset(l),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=r,e[4]=l,e[5]=t,e[6]=v,e[7]=d):d=e[7];const{schedule:m}=jt(d),u=i[0],b=i[1],x=i[2],{models:y}=we(u?.id),{models:f}=we(b?.id),{models:j}=we(x?.id);let N,g;e[8]!==r||e[9]!==a?(N=()=>{a||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[a,r],e[8]=r,e[9]=a,e[10]=N,e[11]=g):(N=e[10],g=e[11]),W.useEffect(N,g);let k;e[12]!==i||e[13]!==r||e[14]!==u||e[15]!==b||e[16]!==x||e[17]!==y||e[18]!==f||e[19]!==j?(k=()=>{const P=r.getValues(),F=new Set(i.map(Qt)),O={};u?.id&&(O[u.id]=y),b?.id&&(O[b.id]=f),x?.id&&(O[x.id]=j);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(P.tiers.fast)?null:P.tiers.fast,smart:T(P.tiers.smart)?null:P.tiers.smart,thinking:T(P.tiers.thinking)?null:P.tiers.thinking,image:T(P.tiers.image)?null:P.tiers.image,web_search:T(P.tiers.web_search)?null:P.tiers.web_search,deep_research:T(P.tiers.deep_research)?null:P.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===P.tiers.fast&&D.smart===P.tiers.smart&&D.thinking===P.tiers.thinking&&D.image===P.tiers.image&&D.web_search===P.tiers.web_search&&D.deep_research===P.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);r.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=r,e[14]=u,e[15]=b,e[16]=x,e[17]=y,e[18]=f,e[19]=j,e[20]=k):k=e[20];const p=u?.id,h=b?.id,S=x?.id;let C;e[21]!==i||e[22]!==r||e[23]!==y||e[24]!==f||e[25]!==j||e[26]!==p||e[27]!==h||e[28]!==S?(C=[r,i,y,f,j,p,h,S],e[21]=i,e[22]=r,e[23]=y,e[24]=f,e[25]=j,e[26]=p,e[27]=h,e[28]=S,e[29]=C):C=e[29],W.useEffect(k,C);let w;e[30]!==t?(w=P=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[P]||P,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=P=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[P]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=_&&!o;let $;e[40]!==I||e[41]!==Q?($=s.jsx(Lt,{isPending:I,showSaved:Q}),e[40]=I,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==r.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(P=>s.jsx(nt,{control:r.control,name:`tiers.${P.key}`,render:F=>{const{field:O}=F;return s.jsx(Ge,{title:R(P.key),description:E(P.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:P.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},P.key)),e[46]=i[0]?.id,e[47]=r.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=le(),i=ce(),[l,a]=W.useState(!1);let n;e[0]!==t?(n=p=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=n):n=e[1];const{mutate:c,isPending:r}=ae({mutationFn:async p=>{const{url:h}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:d});return h},onSuccess:Yt,onError:n}),[v,I]=W.useState(""),[_,o]=W.useState("usd"),d=_,m=parseFloat(v),u=!isNaN(m)&&m>=1,b=d==="brl"?"R$":"$";let x;e[2]!==o?(x=p=>{p&&o(p)},e[2]=o,e[3]=x):x=e[3];let y,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(qe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),f=s.jsx(qe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=y,e[5]=f):(y=e[4],f=e[5]);let j;e[6]!==d||e[7]!==x?(j=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:d,onValueChange:x,children:[y,f]}),e[6]=d,e[7]=x,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==b||e[11]!==l||e[12]!==r||e[13]!==t||e[14]!==c?(N=!l&&s.jsxs(s.Fragment,{children:[Gt[d].map(p=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:r,onClick:()=>c(p*100),children:[b,p]},p)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:r,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=b,e[11]=l,e[12]=r,e[13]=t,e[14]=c,e[15]=N):N=e[15];let g;e[16]!==b||e[17]!==v||e[18]!==m||e[19]!==l||e[20]!==u||e[21]!==r||e[22]!==I||e[23]!==t||e[24]!==c?(g=l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:b}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:v,onChange:p=>I(p.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!u||r,onClick:()=>c(Math.round(m*100)),children:r?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),I("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=b,e[17]=v,e[18]=m,e[19]=l,e[20]=u,e[21]=r,e[22]=I,e[23]=t,e[24]=c,e[25]=g):g=e[25];let k;return e[26]!==j||e[27]!==N||e[28]!==g?(k=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,g]})}),e[26]=j,e[27]=N,e[28]=g,e[29]=k):k=e[29],k}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=le(),{org:i}=_e(),l=ce(),a=ke(),n=Fe();let c;e[0]!==n?(c=n.find(Xt),e[0]=n,e[1]=c):c=e[1];const r=c,[v,I]=W.useState(!1);let _;e[2]!==r||e[3]!==l?(_=async()=>{r&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=l,e[4]=_):_=e[4];let o;e[5]!==i.id||e[6]!==a||e[7]!==t?(o=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),I(!1)},e[5]=i.id,e[6]=a,e[7]=t,e[8]=o):o=e[8];let d;e[9]!==t?(d=rt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:rt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==_||e[12]!==o||e[13]!==d?(m={mutationFn:_,onSuccess:o,onError:d},e[11]=_,e[12]=o,e[13]=d,e[14]=m):m=e[14];const{mutate:u,isPending:b}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const y=!!r;let f;e[17]!==l?(f=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=f):f=e[18];let j;e[19]!==x||e[20]!==y||e[21]!==f?(j={queryKey:x,enabled:y,staleTime:6e4,queryFn:f},e[19]=x,e[20]=y,e[21]=f,e[22]=j):j=e[22];const{data:N,isLoading:g,refetch:k,isFetching:p}=Re(j);if(!r)return null;const h=N?.balanceCents!=null?N.balanceCents/100:null;let S;e[23]!==h?(S=h!=null?`$${h.toFixed(2)}`:"—",e[23]=h,e[24]=S):S=e[24];const C=S;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>I(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==b||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:b,children:Q}),e[41]=b,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Ze,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let P;e[53]!==V?(P=s.jsx(Xe,{children:V}),e[53]=V,e[54]=P):P=e[54];let F;e[55]!==B||e[56]!==P?(F=s.jsxs(et,{children:[B,P]}),e[55]=B,e[56]=P,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(tt,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(st,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(it,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(lt,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==v||e[76]!==G?(oe=s.jsx(ot,{open:v,onOpenChange:I,children:G}),e[75]=v,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==h||e[79]!==C||e[80]!==p||e[81]!==g?(te=g||p?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",h!=null&&Jt(h)),children:C}),e[78]=h,e[79]=C,e[80]=p,e[81]=g,e[82]=te):te=e[82];let de;e[83]!==k?(de=()=>k(),e[83]=k,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=p&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Ve,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==p||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:p,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=p,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ie;return e[118]!==w||e[119]!==Se?(Ie=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ie):Ie=e[120],Ie}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(8),{org:t}=_e(),i=ce(),l=ke();let a;e[0]!==i?(a=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=a):a=e[1];let n;e[2]!==t||e[3]!==l?(n=()=>{Qe("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=n):n=e[4];let c;return e[5]!==a||e[6]!==n?(c={mutationFn:a,onSuccess:n,onError:ts},e[5]=a,e[6]=n,e[7]=c):c=e[7],ae(c)}function ts(e){Qe("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ee.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=Z.c(37),t=le(),{mutate:i,isPending:l}=es();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=n):n=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let r;e[4]!==c?(r=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=r):r=e[5];let v;e[6]!==t?(v=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=v):v=e[7];let I;e[8]!==v?(I=s.jsx("p",{className:"text-base font-semibold",children:v}),e[8]=v,e[9]=I):I=e[9];let _;e[10]!==t?(_=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=_):_=e[11];let o;e[12]!==_?(o=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:_}),e[12]=_,e[13]=o):o=e[13];let d;e[14]!==I||e[15]!==o?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[I,o]}),e[14]=I,e[15]=o,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let b;e[21]!==u||e[22]!==d?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[21]=u,e[22]=d,e[23]=b):b=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let y;e[26]!==l||e[27]!==t?(y=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=y):y=e[28];let f;e[29]!==l||e[30]!==x||e[31]!==y?(f=s.jsx(se,{variant:"outline",disabled:l,onClick:x,children:y}),e[29]=l,e[30]=x,e[31]=y,e[32]=f):f=e[32];let j;return e[33]!==b||e[34]!==f||e[35]!==r?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[n,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[r,b,f]})]}),e[33]=b,e[34]=f,e[35]=r,e[36]=j):j=e[36],j}const is=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function ls({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function os({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:a,currentBaseUrl:n,onCancel:c,onSuccess:r}){const{org:v}=_e(),I=ce(),_=ke(),o=le(),[d,m]=W.useState(!1),u=t.id==="openai-compatible",b=t.supportedMethods.includes("api-key"),x=is(o),{register:y,handleSubmit:f,watch:j,setError:N,formState:{errors:g}}=Le({resolver:ze(x),defaultValues:{label:a,apiKey:"",baseUrl:n??""}}),k=j("apiKey")??"",{mutate:p,isPending:h}=ae({mutationFn:async S=>{let C;S.apiKey&&(u?C=JSON.stringify({baseUrl:S.baseUrl||n||"",apiKey:S.apiKey}):C=S.apiKey),await I.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:S.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{_.invalidateQueries({queryKey:ie.aiProviderKeys(v.id)}),_.invalidateQueries({queryKey:ie.aiProviders(v.id)}),ee.success(o("settings.editProviderDialog.providerUpdated")),r()},onError:S=>ee.error(o("settings.editProviderDialog.failedToUpdate",{error:S.message}))});return s.jsxs("form",{onSubmit:f(S=>{if(ls({isOpenAICompatible:u,baseUrl:S.baseUrl,currentBaseUrl:n,apiKey:S.apiKey})){N("apiKey",{message:o("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}p(S)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:o("settings.editProviderDialog.labelPlaceholder"),...y("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??o("settings.editProviderDialog.baseUrlPlaceholder"),...y("baseUrl"),className:"h-8 text-sm"})]}),b&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[o("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",o("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:d&&k?"text":"password",placeholder:l,...y("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":o(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:h,children:o("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:h,children:o(h?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function rs(e){const t=Z.c(31),{providerKey:i,provider:l,open:a,onOpenChange:n}=e,c=le(),r=ce(),v=l.id==="openai-compatible"&&i.presetId?Je(i.presetId):void 0,I=v?.name??l.name;let _;t[0]!==i.id?(_=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=_):_=t[1];let o;t[2]!==i.id||t[3]!==r?(o=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=r,t[4]=o):o=t[4];let d;t[5]!==a||t[6]!==_||t[7]!==o?(d={queryKey:_,queryFn:o,enabled:a,staleTime:0},t[5]=a,t[6]=_,t[7]=o,t[8]=d):d=t[8];const{data:m,isLoading:u}=Re(d),b=Mt,x=Et,y="sm:max-w-md",f=Rt,j=At,N=c("settings.editProviderDialog.editTitle",{name:I});let g;t[9]!==j||t[10]!==N?(g=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=g):g=t[11];let k;t[12]!==f||t[13]!==g?(k=s.jsx(f,{children:g}),t[12]=f,t[13]=g,t[14]=k):k=t[14];let p;t[15]!==u||t[16]!==n||t[17]!==v||t[18]!==m||t[19]!==l||t[20]!==i?(p=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(os,{providerKey:i,provider:l,preset:v,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>n(!1),onSuccess:()=>n(!1)}),t[15]=u,t[16]=n,t[17]=v,t[18]=m,t[19]=l,t[20]=i,t[21]=p):p=t[21];let h;t[22]!==x||t[23]!==k||t[24]!==p?(h=s.jsxs(x,{className:y,children:[k,p]}),t[22]=x,t[23]=k,t[24]=p,t[25]=h):h=t[25];let S;return t[26]!==b||t[27]!==n||t[28]!==a||t[29]!==h?(S=s.jsx(b,{open:a,onOpenChange:n,children:h}),t[26]=b,t[27]=n,t[28]=a,t[29]=h,t[30]=S):S=t[30],S}function ns(e){const t=Z.c(86),{providerKey:i,provider:l}=e,{org:a}=_e(),n=ce(),c=ke(),[r,v]=W.useState(!1),[I,_]=W.useState(!1),o=le(),[d]=at(),m=d.language==="pt-BR"?_t:void 0,u=l?.id==="openai-compatible";let b;t[0]!==u||t[1]!==i.presetId?(b=u&&i.presetId?Je(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=b):b=t[2];const x=b;let y;t[3]!==u||t[4]!==x||t[5]!==l?.name||t[6]!==i.providerId||t[7]!==o?(y=x?x.name:u?o("settings.aiProviders.customOpenAiCompatible"):l?.name??(i.providerId==="claude-code"?o("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?o("settings.providerKeyRow.codex"):i.providerId),t[3]=u,t[4]=x,t[5]=l?.name,t[6]=i.providerId,t[7]=o,t[8]=y):y=t[8];const f=y,j=x?.logo??l?.logo??wt[i.providerId];let N;e:{if(u){N=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==o?(te=o("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=o,t[13]=te):te=t[13],N=te}const g=N;let k;t[14]!==i.id||t[15]!==n?(k=async()=>{await n.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=n,t[16]=k):k=t[16];let p;t[17]!==a||t[18]!==i.id||t[19]!==c||t[20]!==o?(p=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(a.id)}),c.invalidateQueries({queryKey:ie.aiProviders(a.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(a.id,i.id)}),ee.success(o("settings.providerKeyRow.keyDeleted")),v(!1)},t[17]=a,t[18]=i.id,t[19]=c,t[20]=o,t[21]=p):p=t[21];let h;t[22]!==o?(h=te=>ee.error(o("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=o,t[23]=h):h=t[23];let S;t[24]!==k||t[25]!==p||t[26]!==h?(S={mutationFn:k,onSuccess:p,onError:h},t[24]=k,t[25]=p,t[26]=h,t[27]=S):S=t[27];const{mutate:C,isPending:w}=ae(S);let R;t[28]!==f||t[29]!==j?(R=j?s.jsx("img",{src:j,alt:f,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:f.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=f,t[29]=j,t[30]=R):R=t[30];let A;t[31]!==l||t[32]!==o?(A=l?s.jsx(se,{variant:"ghost",size:"icon","aria-label":o("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>_(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=l,t[32]=o,t[33]=A):A=t[33];let E;t[34]!==o?(E=o("settings.providerKeyRow.deleteProviderKey"),t[34]=o,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>v(!0),U=s.jsx(It,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==g||t[45]!==f||t[46]!==Q||t[47]!==R?($=s.jsx(Ge,{icon:R,title:f,description:g,action:Q}),t[44]=g,t[45]=f,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==I||t[50]!==l||t[51]!==i?(q=l?s.jsx(rs,{providerKey:i,provider:l,open:I,onOpenChange:_}):null,t[49]=I,t[50]=l,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==o?(H=o("settings.providerKeyRow.deleteApiKey"),t[53]=o,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Ze,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(Xe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let P;t[59]!==B||t[60]!==V?(P=s.jsxs(et,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=P):P=t[61];let F;t[62]!==o?(F=o("settings.providerKeyRow.cancel"),t[62]=o,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(tt,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==o?(D=o("settings.providerKeyRow.delete"),t[68]=o,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(st,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(it,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==P||t[77]!==J?(z=s.jsxs(lt,{children:[P,J]}),t[76]=P,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==r||t[80]!==z?(G=s.jsx(ot,{open:r,onOpenChange:v,children:z}),t[79]=r,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function as(e){const t=e.filter(i=>gt(i.providerId));return{hasInventory:e.length>0,hasHostedProvider:t.length>0,hasDeco:t.some(i=>i.providerId==="deco")}}function cs(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(l=>l.id===i.providerId)??null}))}function He(e){const t=Z.c(13),{onConnectClick:i}=e,l=le(),a=Fe(),n=Ye();let c;if(t[0]!==n?.providers||t[1]!==a||t[2]!==i||t[3]!==l){const r=n?.providers??[],v=cs(a,r);let I;t[5]!==l?(I=l("settings.connectedProvidersSection.sectionTitle"),t[5]=l,t[6]=I):I=t[6];let _;t[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ct,{size:14}),t[7]=_):_=t[7];let o;t[8]!==l?(o=l("settings.connectedProvidersSection.connectButton"),t[8]=l,t[9]=o):o=t[9];let d;t[10]!==i||t[11]!==o?(d=s.jsxs(se,{size:"sm",onClick:i,children:[_,o]}),t[10]=i,t[11]=o,t[12]=d):d=t[12],c=s.jsx(Te,{title:I,headerClassName:"px-0",actions:d,children:v.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:v.map(ds)})}),t[0]=n?.providers,t[1]=a,t[2]=i,t[3]=l,t[4]=c}else c=t[4];return c}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(){const e=Z.c(55),t=le(),{org:i}=_e(),l=ce(),a=ke(),[n,c]=W.useState("");let r;e[0]!==i.id?(r=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=r):r=e[1];let v;e[2]!==l?(v=()=>l.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=l,e[3]=v):v=e[3];let I;e[4]!==r||e[5]!==v?(I={queryKey:r,queryFn:v},e[4]=r,e[5]=v,e[6]=I):I=e[6];const _=Re(I);let o;e[7]!==i.id||e[8]!==a?(o=()=>a.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=a,e[9]=o):o=e[9];const d=o;let m;e[10]!==l||e[11]!==n?(m=()=>l.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:n}),e[10]=l,e[11]=n,e[12]=m):m=e[12];let u;e[13]!==d||e[14]!==t?(u=async()=>{c(""),await d(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=d,e[14]=t,e[15]=u):u=e[15];let b;e[16]!==m||e[17]!==u?(b={mutationFn:m,onSuccess:u,onError:ps},e[16]=m,e[17]=u,e[18]=b):b=e[18];const x=ae(b);let y;e[19]!==l?(y=()=>l.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=l,e[20]=y):y=e[20];let f;e[21]!==d||e[22]!==t?(f=async()=>{await d(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=d,e[22]=t,e[23]=f):f=e[23];let j;e[24]!==y||e[25]!==f?(j={mutationFn:y,onSuccess:f,onError:us},e[24]=y,e[25]=f,e[26]=j):j=e[26];const N=ae(j),g=_.data?.connected===!0,k=!g&&!!_.data?.linkedAt;let p;e[27]!==t?(p=t("settings.claudeSubscription.title"),e[27]=t,e[28]=p):p=e[28];let h;e[29]!==p?(h=s.jsx("p",{className:"text-base font-semibold",children:p}),e[29]=p,e[30]=h):h=e[30];let S;e[31]!==g||e[32]!==k||e[33]!==t?(S=t(g?"settings.claudeSubscription.active":k?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=g,e[32]=k,e[33]=t,e[34]=S):S=e[34];let C;e[35]!==S?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[35]=S,e[36]=C):C=e[36];let w;e[37]!==h||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,C]}),e[37]=h,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==g||e[41]!==N||e[42]!==t?(R=g?s.jsx(se,{variant:"outline",disabled:N.isPending,onClick:()=>N.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=g,e[41]=N,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==g||e[49]!==t||e[50]!==n?(E=g?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:n,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:n.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=g,e[49]=t,e[50]=n,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function us(e){return ee.error(e.message)}function ps(e){return ee.error(e.message)}function fs(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(dt,{size:16}),t[0]=l):l=t[0];let a;return t[1]!==i.message?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=a):a=t[2],a}function gs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:l,hasHostedProvider:a,hasDeco:n}=i,[c,r]=W.useState(!1),[v,I]=W.useState(null),_=Ye();let o;e[2]!==_?.providers?(o=_?.providers??[],e[2]=_?.providers,e[3]=o):o=e[3];const d=o;if(!a){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let N;e[5]!==d?(N=s.jsx(yt,{providers:d,onSelect:I,onShowAll:j}),e[5]=d,e[6]=N):N=e[6];const g=v!==null||c;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=w=>{w||(I(null),r(!1))},e[7]=k):k=e[7];const p=v??void 0;let h;e[8]!==g||e[9]!==p?(h=s.jsx($e,{open:g,onOpenChange:k,initialProvider:p}),e[8]=g,e[9]=p,e[10]=h):h=e[10];let S;e[11]!==l?(S=l?s.jsx(He,{onConnectClick:()=>r(!0)}):null,e[11]=l,e[12]=S):S=e[12];let C;return e[13]!==N||e[14]!==h||e[15]!==S?(C=s.jsxs(s.Fragment,{children:[N,h,S]}),e[13]=N,e[14]=h,e[15]=S,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let u;e[18]!==n?(u=n?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=n,e[19]=u):u=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ms,{}),e[20]=b):b=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(He,{onConnectClick:()=>r(!0)}),e[21]=x):x=e[21];let y;e[22]!==c?(y=s.jsx($e,{open:c,onOpenChange:r}),e[22]=c,e[23]=y):y=e[23];let f;return e[24]!==u||e[25]!==y?(f=s.jsxs(s.Fragment,{children:[m,u,b,x,y]}),e[24]=u,e[25]=y,e[26]=f):f=e[26],f}function hs(){const e=Z.c(7),t=le();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ct,{fallback:xs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(gs,{})})}),e[4]=a):a=e[4];let n;return e[5]!==l?(n=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(mt,{children:[l,a]})})})}),e[5]=l,e[6]=n):n=e[6],n}function xs(e){const{error:t}=e;return s.jsx(fs,{error:t??new Error("Failed to load AI providers")})}function _i(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(hs,{})}),e[0]=t):t=e[0],t}export{_i as default};
@@ -1 +0,0 @@
1
- import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-geMXTkeP.js";import{i as jt}from"./ChevronRight-BamDO5gK.js";import{l as Bt}from"./automation-runs-D9S7Bj8t.js";import{A as At}from"./add-section-modal-BtHF1Suz.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-y45nRZhN.js";import"./select-D6zOoh5E.js";import"./tooltip-BrF3GD_a.js";import"./Check-DpoXXYhc.js";import"./ChevronDown-BbcA24KM.js";import"./ChevronUp-HIfNhOKS.js";import"./useInfiniteQuery-BI-Ge-Y8.js";import"./use-infinite-scroll-CNsERN2g.js";import"./use-connection-B7cDwiOJ.js";import"./use-mcp-client-BBl5zme6.js";import"./auth-av09Sk0f.js";import"./use-virtual-mcp-CEV_ngrf.js";import"./card-ZgfbVCh9.js";import"./sidebar-cviY2JKt.js";import"./LayoutLeft-NGYALHZo.js";import"./use-mobile-DMoYecwn.js";import"./X-D0lgdZFx.js";import"./table-D5WR7hLa.js";import"./empty-state-BkAQUfnz.js";import"./use-members-stYO4DxP.js";import"./use-org-auth-client-DoX1JG5g.js";import"./use-clock-tick-CAblMTwd.js";import"./AlertCircle-BGrbeDYT.js";import"./CheckCircle-DI16N69_.js";import"./DotsVertical-B_iya6B7.js";import"./agent-icon-CQRHN6rX.js";import"./Tool01-BjfDVrJb.js";import"./ArrowUp-B7rh6W_b.js";import"./Settings02-K87UDDa_.js";import"./Tool02-df-j-2i7.js";import"./XCircle-BEfRA2Fy.js";import"./ArrowUpRight-An4hbib7.js";import"./TrendUp01-Bj5u2ghc.js";import"./ZapSquare-2syNvY2F.js";import"./Users03-Cwqfteu1.js";import"./Stars02-CF9PavPD.js";import"./Copy01-Bnz3Wx80.js";import"./CpuChip01-BShcbCHO.js";import"./CreditCard01-DNJmFfow.js";import"./Eye-BjhopnZD.js";import"./FilterLines-H3se16dF.js";import"./Star01-BWcFSKod.js";import"./Palette-DqKGGY7c.js";import"./SwitchHorizontal01-Boo6w6_t.js";import"./HardDrive-Cc0iy42M.js";import"./Key01-C21diL-t.js";import"./LinkExternal01-BIYwVSjD.js";import"./LogOut01-BYbHv1g4.js";import"./Monitor01-PnI4BWSm.js";import"./Sun-D_TMYzXg.js";import"./Play-C6pKirQG.js";import"./Plus-3NJoZ-Rn.js";import"./SearchLg-DUoOTY_-.js";import"./SearchMd-DZC0VFyz.js";import"./Shield01-Dif9NKxP.js";import"./Stars01-DNjCGctC.js";import"./Trash01-BfrFYc0O.js";import"./Upload01-DGoH2Bw8.js";import"./User01-PHqRfaY2.js";import"./Users01-CeRMXGJo.js";import"./XClose-Ca9PFBA7.js";import"./Zap-Cd4akcPN.js";import"./use-automations-mCzD08OY.js";import"./studio-tools-DH0-34Hv.js";import"./useSuspenseInfiniteQuery-9ztDghoj.js";import"./avatar-I17szs3Q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-r5QxG4Uf.js";import"./calendar-ihm97ng4.js";import"./dialog-DFfWjXhn.js";import"./tab-id-VDxePu-8.js";import"./hooks-BYQbPRxe.js";import"./decopilot-sse-pool-CsSaGM07.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-Duovvv_d.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CaSDpPjb.js";import"./use-decopilot-events-up5oIRDt.js";import"./use-organization-settings-DhcL4nY9.js";import"./monaco-editor-DNmyyJIn.js";import"./spinner-CkuCAiR1.js";import"./index-SVAVudgF.js";import"./shell-layout-D82GP0rP.js";import"./required-auth-layout-S0YtLBA5.js";import"./use-org-sso-BVhPMS3K.js";import"./integration-icon-G3CkJMl-.js";import"./use-navigate-to-agent-ABFR-14c.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-ChjS34cq.js";import"./form-Cy7Rd3TL.js";import"./label-cSCv6rYO.js";import"./input-i4x2nRXJ.js";import"./drawer-CjxVq45y.js";import"./collection-search-Bxz23u0F.js";import"./index-Dyyz80fH.js";import"./get-initials-D-f_fDFw.js";import"./popover-i4jezHIh.js";import"./dropdown-menu-DNVNevD7.js";import"./github-repo-picker-CKQYOUVF.js";import"./use-debounced-value-LrUb7eiJ.js";import"./authenticate-and-persist-oauth-CCHy3FzA.js";import"./mcp-oauth-Dv6Uhpr5.js";import"./use-mcp-tools-BKtLcTYP.js";import"./extract-connection-data-D8g8Vhah.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-tags-B8ASGI2M.js";import"./skeleton-BnFORNZa.js";import"./command-bMsQFALP.js";import"./index-BZsTAPza.js";import"./use-open-billing-url-DU9jxy0C.js";import"./companions-core-DYxPDPJ-.js";import"./tabs-CqBl7afq.js";import"./toggle-group-D7y3Qsoq.js";import"./use-deco-credits-Dp43HFr7.js";import"./alert-dialog-CWFjoJjX.js";import"./toolbar-CpuC8NsW.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Di6_Srf0.js";import"./use-registry-connections-BoF5es5w.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Bn6hQ_Qz.js";import"./connection-form-helpers-Dl1KTkNE.js";import"./collection-tabs-DJww20x9.js";import"./badge-1BKF0WjP.js";import"./select-model-BNaO-ex3.js";import"./checkbox-CQ_C4vJL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-jz9Avb_j.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DCcIH0HO.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-Cpe_qvZ_.js";import"./pt-BR-CLy76QW2.js";import"./switch-D2uF_EAp.js";import"./use-debounced-autosave-9sjmxrz4.js";import"./index-B1Swgh1Q.js";import"./search-input-B-QuRigZ.js";import"./index-DnUHHdy9.js";import"./use-secrets-BmzIH3vm.js";import"./useQueries-d_0_L-iH.js";import"./use-file-configs-1vs3YVUZ.js";import"./automation-list-row-CYmqpjOL.js";function Pt(c,t){const i=(c.title||c.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),a=/^[A-Za-z]/.test(i)&&i.length>0?i:"Section",s=wt(t,a);return{blockKey:s,data:{__resolveType:c.resolveType,name:s}}}function Er(c){const t=gt.c(83),{orgSlug:i,virtualMcpId:a,branch:s,blockKey:m,block:d,meta:p,decofile:f,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=c,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,l=yt(),b=typeof d?.__resolveType=="string"?d.__resolveType:"";let R;t[0]!==G||t[1]!==p||t[2]!==b?(R=Et(b,p,G),t[0]=G,t[1]=p,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==d||t[7]!==m||t[8]!==p||t[9]!==Z?(K=Z??(d?Nt(m,d,p):m),t[6]=d,t[7]=m,t[8]=p,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==s||t[12]!==i||t[13]!==a?(T={orgSlug:i,virtualMcpId:a,branch:s},t[11]=s,t[12]=i,t[13]=a,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==s||t[16]!==i||t[17]!==a?(F={orgSlug:i,virtualMcpId:a,branch:s},t[15]=s,t[16]=i,t[17]=a,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(m),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[n,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==m&&(bt(m),dt(null),ft(zt),ut([]));let z;t[22]!==d?(z=d??{},t[22]=d,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==m||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(m,{...r,__resolveType:b})},t[29]=m,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==f||t[35]!==W||t[36]!==Y||t[37]!==l?(L=async(e,r)=>{try{const{blockKey:u,data:N}=Pt(e,f);await Y.mutateAsync({blockKey:u,data:N}),xt.success(l("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),W()}catch(u){const N=u,St=N instanceof Error?N.message:l("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=f,t[35]=W,t[36]=Y,t[37]=l,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,u=>{r(u),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==n||t[43]!==v?(H=n.length>0?[v,...n]:[],t[42]=n,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==n||t[46]!==E||t[47]!==l||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":l("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const u=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(n,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=n,t[46]=E,t[47]=l,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==m||t[56]!==s||t[57]!==n||t[58]!==f||t[59]!==st||t[60]!==ot||t[61]!==y||t[62]!==pt||t[63]!==Q||t[64]!==p||t[65]!==i||t[66]!==x||t[67]!==tt||t[68]!==h||t[69]!==J||t[70]!==l||t[71]!==a?(B=o.jsx(Bt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:n,onBreadcrumbChange:at,decofile:f,meta:p,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt,sandbox:{orgSlug:i,virtualMcpId:a,branch:s}},`${m}:${ot}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),l("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:l("sandbox.appEditor.noEditableSchema")})})})}),t[55]=m,t[56]=s,t[57]=n,t[58]=f,t[59]=st,t[60]=ot,t[61]=y,t[62]=pt,t[63]=Q,t[64]=p,t[65]=i,t[66]=x,t[67]=tt,t[68]=h,t[69]=J,t[70]=l,t[71]=a,t[72]=B):B=t[72];let A;t[73]!==rt||t[74]!==f||t[75]!==lt||t[76]!==p||t[77]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:p,decofile:f,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[73]=rt,t[74]=f,t[75]=lt,t[76]=p,t[77]=x,t[78]=A):A=t[78];let M;return t[79]!==j||t[80]!==B||t[81]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[79]=j,t[80]=B,t[81]=A,t[82]=M):M=t[82],M}function Ot(c){return c+1}function zt(c){return c+1}export{Er as AppEditor};
@@ -1 +0,0 @@
1
- import{c as W,b as te,r as Xe,j as n,B as qe,a7 as ke,m as Le,aI as Ye,F as Ge,o as We,K as He,n as Je,e as Ee,p as se,t as G,$ as Ze}from"./index-geMXTkeP.js";import{t as et}from"./ChevronDown-BbcA24KM.js";import{i as tt}from"./ChevronRight-BamDO5gK.js";import{s as Me}from"./Plus-3NJoZ-Rn.js";import{s as st,t as nt}from"./Star01-BWcFSKod.js";import{s as lt}from"./Trash01-BfrFYc0O.js";import{A as ot,a as rt,b as it,c as at,d as ct,e as dt,f as ft,g as mt}from"./alert-dialog-CWFjoJjX.js";import{P as Ke}from"./index-B1Swgh1Q.js";import{u as Ve}from"./studio-tools-DH0-34Hv.js";import{u as ut}from"./use-debounced-autosave-9sjmxrz4.js";import{n as xt}from"./LinkExternal01-BIYwVSjD.js";import{i as gt}from"./Zap-Cd4akcPN.js";import{I as we}from"./input-i4x2nRXJ.js";import{T as bt}from"./textarea-Bn6hQ_Qz.js";import{R as ht}from"./require-capability-6g_AHVvS.js";import"./sidebar-cviY2JKt.js";import"./LayoutLeft-NGYALHZo.js";import"./use-mobile-DMoYecwn.js";import"./X-D0lgdZFx.js";import"./tooltip-BrF3GD_a.js";import"./use-capability-Cpe_qvZ_.js";import"./access-gate-BXHarpej.js";import"./capability-load-error-CdiziQNa.js";function Ie(t){const e=W.c(8),{title:s,children:r,className:l}=t;let o;e[0]!==l?(o=Le("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==r||e[5]!==o||e[6]!==i?(a=n.jsxs("div",{className:o,children:[i,r]}),e[4]=r,e[5]=o,e[6]=i,e[7]=a):a=e[7],a}function pt(t){const e=W.c(41),{onExtract:s,isExtracting:r}=t,l=te(),[o,i]=Xe.useState("");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(gt,{size:18,className:"text-primary"})}),e[0]=a):a=e[0];let c;e[1]!==l?(c=l("settings.brandFormSections.autoExtractTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==c?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:c}),e[3]=c,e[4]=d):d=e[4];let j;e[5]!==l?(j=l("settings.brandFormSections.autoExtractDescription"),e[5]=l,e[6]=j):j=e[6];let b;e[7]!==j?(b=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:j}),e[7]=j,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("settings.brandFormSections.domainPlaceholder"),e[9]=l,e[10]=x):x=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=_=>i(_.target.value),e[11]=f):f=e[11];let u;e[12]!==o||e[13]!==r||e[14]!==s?(u=_=>{_.key==="Enter"&&o.trim()&&!r&&s(o.trim())},e[12]=o,e[13]=r,e[14]=s,e[15]=u):u=e[15];let h;e[16]!==o||e[17]!==x||e[18]!==u?(h=n.jsx(we,{placeholder:x,value:o,onChange:f,className:"max-w-xs",onKeyDown:u}),e[16]=o,e[17]=x,e[18]=u,e[19]=h):h=e[19];let m;e[20]!==o||e[21]!==r?(m=!o.trim()||r,e[20]=o,e[21]=r,e[22]=m):m=e[22];let g;e[23]!==o||e[24]!==s?(g=()=>s(o.trim()),e[23]=o,e[24]=s,e[25]=g):g=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(st,{size:14}),e[26]=N):N=e[26];let p;e[27]!==r||e[28]!==l?(p=l(r?"settings.brandFormSections.extracting":"settings.brandFormSections.extract"),e[27]=r,e[28]=l,e[29]=p):p=e[29];let C;e[30]!==m||e[31]!==g||e[32]!==p?(C=n.jsxs(qe,{variant:"outline",disabled:m,onClick:g,children:[N,p]}),e[30]=m,e[31]=g,e[32]=p,e[33]=C):C=e[33];let y;e[34]!==C||e[35]!==h?(y=n.jsxs("div",{className:"mt-3 flex gap-2",children:[h,C]}),e[34]=C,e[35]=h,e[36]=y):y=e[36];let B;return e[37]!==y||e[38]!==d||e[39]!==b?(B=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[a,n.jsxs("div",{className:"flex-1",children:[d,b,y]})]})}),e[37]=y,e[38]=d,e[39]=b,e[40]=B):B=e[40],B}function jt(t){const e=W.c(61),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==s?(i=s.watch("domain"),e[0]=s,e[1]=i):i=e[1];const a=i;let c;e[2]!==o?(c=o("settings.brandFormSections.companyOverviewTitle"),e[2]=o,e[3]=c):c=e[3];let d;e[4]!==o?(d=o("settings.brandFormSections.companyNameLabel"),e[4]=o,e[5]=d):d=e[5];let j;e[6]!==d?(j=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:d}),e[6]=d,e[7]=j):j=e[7];let b;e[8]!==r||e[9]!==l||e[10]!==o?(b=O=>{const{field:F}=O;return n.jsx(we,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.companyNamePlaceholder")})},e[8]=r,e[9]=l,e[10]=o,e[11]=b):b=e[11];let x;e[12]!==s.control||e[13]!==b?(x=n.jsx(ke,{control:s.control,name:"name",render:b}),e[12]=s.control,e[13]=b,e[14]=x):x=e[14];let f;e[15]!==j||e[16]!==x?(f=n.jsxs("div",{children:[j,x]}),e[15]=j,e[16]=x,e[17]=f):f=e[17];let u;e[18]!==o?(u=o("settings.brandFormSections.domainLabel"),e[18]=o,e[19]=u):u=e[19];let h;e[20]!==u?(h=n.jsx("span",{children:u}),e[20]=u,e[21]=h):h=e[21];let m;e[22]!==a||e[23]!==o?(m=a&&n.jsxs("a",{href:`https://${a}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(xt,{size:10}),o("settings.brandFormSections.openLink")]}),e[22]=a,e[23]=o,e[24]=m):m=e[24];let g;e[25]!==m||e[26]!==h?(g=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[h,m]}),e[25]=m,e[26]=h,e[27]=g):g=e[27];let N;e[28]!==r||e[29]!==l||e[30]!==o?(N=O=>{const{field:F}=O;return n.jsx(we,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.domainInputPlaceholder")})},e[28]=r,e[29]=l,e[30]=o,e[31]=N):N=e[31];let p;e[32]!==s.control||e[33]!==N?(p=n.jsx(ke,{control:s.control,name:"domain",render:N}),e[32]=s.control,e[33]=N,e[34]=p):p=e[34];let C;e[35]!==g||e[36]!==p?(C=n.jsxs("div",{children:[g,p]}),e[35]=g,e[36]=p,e[37]=C):C=e[37];let y;e[38]!==C||e[39]!==f?(y=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[f,C]}),e[38]=C,e[39]=f,e[40]=y):y=e[40];let B;e[41]!==o?(B=o("settings.brandFormSections.overviewLabel"),e[41]=o,e[42]=B):B=e[42];let _;e[43]!==B?(_=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:B}),e[43]=B,e[44]=_):_=e[44];let T;e[45]!==r||e[46]!==l||e[47]!==o?(T=O=>{const{field:F}=O;return n.jsx(bt,{...F,onChange:A=>{F.onChange(A),r()},onBlur:()=>{F.onBlur(),l()},placeholder:o("settings.brandFormSections.overviewPlaceholder"),rows:3})},e[45]=r,e[46]=l,e[47]=o,e[48]=T):T=e[48];let k;e[49]!==s.control||e[50]!==T?(k=n.jsx(ke,{control:s.control,name:"overview",render:T}),e[49]=s.control,e[50]=T,e[51]=k):k=e[51];let w;e[52]!==_||e[53]!==k?(w=n.jsxs("div",{children:[_,k]}),e[52]=_,e[53]=k,e[54]=w):w=e[54];let E;e[55]!==y||e[56]!==w?(E=n.jsxs("div",{className:"space-y-3",children:[y,w]}),e[55]=y,e[56]=w,e[57]=E):E=e[57];let R;return e[58]!==c||e[59]!==E?(R=n.jsx(Ie,{title:c,children:E}),e[58]=c,e[59]=E,e[60]=R):R=e[60],R}const Ct={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ue(t){const e=W.c(24),{form:s,name:r,label:l,imgClassName:o,onFieldChange:i,onFieldCommit:a}=t,c=o===void 0?"h-full w-full object-contain p-3":o,d=te();let j;e[0]!==s||e[1]!==r?(j=s.watch(r),e[0]=s,e[1]=r,e[2]=j):j=e[2];const b=j;let x;e[3]!==c||e[4]!==l||e[5]!==d||e[6]!==b?(x=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:Ct,children:b?n.jsx("img",{src:b,alt:l,className:c,loading:"lazy"}):n.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:d("settings.brandFormSections.noImageLabel",{label:l.toLowerCase()})})}),e[3]=c,e[4]=l,e[5]=d,e[6]=b,e[7]=x):x=e[7];let f;e[8]!==l?(f=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[8]=l,e[9]=f):f=e[9];let u;e[10]!==i||e[11]!==a||e[12]!==d?(u=N=>{const{field:p}=N;return n.jsx(we,{...p,onChange:C=>{p.onChange(C),i()},onBlur:()=>{p.onBlur(),a()},placeholder:d("settings.brandFormSections.urlPlaceholder")})},e[10]=i,e[11]=a,e[12]=d,e[13]=u):u=e[13];let h;e[14]!==s.control||e[15]!==r||e[16]!==u?(h=n.jsx(ke,{control:s.control,name:r,render:u}),e[14]=s.control,e[15]=r,e[16]=u,e[17]=h):h=e[17];let m;e[18]!==f||e[19]!==h?(m=n.jsxs("div",{className:"flex-1",children:[f,h]}),e[18]=f,e[19]=h,e[20]=m):m=e[20];let g;return e[21]!==x||e[22]!==m?(g=n.jsxs("div",{className:"flex items-start gap-3",children:[x,m]}),e[21]=x,e[22]=m,e[23]=g):g=e[23],g}function yt(t){const e=W.c(30),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.logosImagesTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("settings.brandFormSections.logoLabel"),e[2]=o,e[3]=a):a=e[3];let c;e[4]!==s||e[5]!==r||e[6]!==l||e[7]!==a?(c=n.jsx(Ue,{form:s,name:"logo",label:a,onFieldChange:r,onFieldCommit:l}),e[4]=s,e[5]=r,e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]!==o?(d=o("settings.brandFormSections.faviconLabel"),e[9]=o,e[10]=d):d=e[10];let j;e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==d?(j=n.jsx(Ue,{form:s,name:"favicon",label:d,imgClassName:"h-12 w-12 object-contain",onFieldChange:r,onFieldCommit:l}),e[11]=s,e[12]=r,e[13]=l,e[14]=d,e[15]=j):j=e[15];let b;e[16]!==o?(b=o("settings.brandFormSections.ogImageLabel"),e[16]=o,e[17]=b):b=e[17];let x;e[18]!==s||e[19]!==r||e[20]!==l||e[21]!==b?(x=n.jsx(Ue,{form:s,name:"ogImage",label:b,imgClassName:"h-full w-full object-contain",onFieldChange:r,onFieldCommit:l}),e[18]=s,e[19]=r,e[20]=l,e[21]=b,e[22]=x):x=e[22];let f;e[23]!==c||e[24]!==j||e[25]!==x?(f=n.jsxs("div",{className:"space-y-3",children:[c,j,x]}),e[23]=c,e[24]=j,e[25]=x,e[26]=f):f=e[26];let u;return e[27]!==i||e[28]!==f?(u=n.jsx(Ie,{title:i,children:f}),e[27]=i,e[28]=f,e[29]=u):u=e[29],u}const vt=[{key:"heading",labelKey:"settings.brandFormSections.fontRoleHeading"},{key:"body",labelKey:"settings.brandFormSections.fontRoleBody"},{key:"code",labelKey:"settings.brandFormSections.fontRoleCode"}];function Nt(t){const e=W.c(12),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.fontsTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r||e[4]!==l||e[5]!==o?(a=vt.map(j=>{const{key:b,labelKey:x}=j,f=`fonts.${b}`,u=s.watch(f),h=o(x);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:h}),u&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:u},children:u})]}),n.jsx(ke,{control:s.control,name:f,render:m=>{const{field:g}=m;return n.jsx(we,{...g,value:g.value??"",onChange:N=>{g.onChange(N),r()},onBlur:()=>{g.onBlur(),l()},placeholder:o("settings.brandFormSections.fontFamilyPlaceholder",{role:h.toLowerCase()})})}})]},b)}),e[2]=s,e[3]=r,e[4]=l,e[5]=o,e[6]=a):a=e[6];let c;e[7]!==a?(c=n.jsx("div",{className:"space-y-2",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==c?(d=n.jsx(Ie,{title:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}const Bt=[{key:"primary",labelKey:"settings.brandFormSections.colorRolePrimary"},{key:"secondary",labelKey:"settings.brandFormSections.colorRoleSecondary"},{key:"accent",labelKey:"settings.brandFormSections.colorRoleAccent"},{key:"background",labelKey:"settings.brandFormSections.colorRoleBackground"},{key:"foreground",labelKey:"settings.brandFormSections.colorRoleForeground"}];function Ft(t){const e=W.c(12),{form:s,onFieldChange:r,onFieldCommit:l}=t,o=te();let i;e[0]!==o?(i=o("settings.brandFormSections.colorsTitle"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s||e[3]!==r||e[4]!==l||e[5]!==o?(a=Bt.map(j=>{const{key:b,labelKey:x}=j,f=`colors.${b}`,u=o(x);return n.jsx(ke,{control:s.control,name:f,render:h=>{const{field:m}=h;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:m.value??"#000000",onChange:g=>{m.onChange(g.target.value),r()},onBlur:()=>{m.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(we,{value:m.value??"",onChange:g=>{m.onChange(g.target.value),r()},onBlur:()=>{m.onBlur(),l()},placeholder:o("settings.brandFormSections.colorPlaceholder"),className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:u})]})}},b)}),e[2]=s,e[3]=r,e[4]=l,e[5]=o,e[6]=a):a=e[6];let c;e[7]!==a?(c=n.jsx("div",{className:"space-y-2",children:a}),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==i||e[10]!==c?(d=n.jsx(Ie,{title:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}function St(t){const e=W.c(168),{brand:s,onChanged:r}=t,l=te(),o=Ve(),[i,a]=Xe.useState(s.isDefault??!1),[c,d]=Xe.useState(!1),j=s.name??"",b=s.domain??"",x=s.overview??"",f=s.logo??"",u=s.favicon??"",h=s.ogImage??"";let m;e[0]!==s.fonts?(m=s.fonts??{},e[0]=s.fonts,e[1]=m):m=e[1];let g;e[2]!==s.colors?(g=s.colors??{},e[2]=s.colors,e[3]=g):g=e[3];let N;e[4]!==j||e[5]!==b||e[6]!==x||e[7]!==f||e[8]!==u||e[9]!==h||e[10]!==m||e[11]!==g?(N={values:{name:j,domain:b,overview:x,logo:f,favicon:u,ogImage:h,fonts:m,colors:g}},e[4]=j,e[5]=b,e[6]=x,e[7]=f,e[8]=u,e[9]=h,e[10]=m,e[11]=g,e[12]=N):N=e[12];const p=Ze(N);let C;e[13]!==s.id||e[14]!==o?(C=async v=>{const Pe=Object.values(v.fonts).some(Tt),$e=Object.values(v.colors).some(At);await o.call("BRAND_CONTEXT_UPDATE",{id:s.id,name:v.name,domain:v.domain,overview:v.overview,logo:v.logo||null,favicon:v.favicon||null,ogImage:v.ogImage||null,fonts:Pe?v.fonts:null,colors:$e?v.colors:null})},e[13]=s.id,e[14]=o,e[15]=C):C=e[15];let y;e[16]!==l?(y=()=>G.error(l("settings.orgBrandContext.failedSaveBrandContext")),e[16]=l,e[17]=y):y=e[17];let B;e[18]!==C||e[19]!==y?(B={mutationFn:C,onError:y},e[18]=C,e[19]=y,e[20]=B):B=e[20];const _=Ee(B);let T;e[21]!==s.id||e[22]!==p||e[23]!==r||e[24]!==l||e[25]!==_?(T={delayMs:500,save:async()=>{const v=p.control._formState.dirtyFields,Pe=Object.keys(v);if(Pe.length===0)return;const $e=p.getValues(),Qe=p.control._defaultValues;p.reset($e,{keepValues:!0});try{await _.mutateAsync($e),se("brand_updated",{brand_id:s.id,fields:Pe}),G.success(l("settings.orgBrandContext.brandContextUpdated")),r()}catch{p.reset(Qe,{keepValues:!0})}}},e[21]=s.id,e[22]=p,e[23]=r,e[24]=l,e[25]=_,e[26]=T):T=e[26];const{schedule:k,flush:w}=ut(T);let E;e[27]!==s.id||e[28]!==o?(E=async()=>{await o.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[27]=s.id,e[28]=o,e[29]=E):E=e[29];let R;e[30]!==s.id||e[31]!==r||e[32]!==l?(R=()=>{se("brand_deleted",{brand_id:s.id}),d(!1),r(),G.success(l("settings.orgBrandContext.brandDeleted"))},e[30]=s.id,e[31]=r,e[32]=l,e[33]=R):R=e[33];let O;e[34]!==l?(O=()=>G.error(l("settings.orgBrandContext.failedDeleteBrand")),e[34]=l,e[35]=O):O=e[35];let F;e[36]!==E||e[37]!==R||e[38]!==O?(F={mutationFn:E,onSuccess:R,onError:O},e[36]=E,e[37]=R,e[38]=O,e[39]=F):F=e[39];const{mutate:A,isPending:D}=Ee(F);let P;e[40]!==s.id||e[41]!==s.isDefault||e[42]!==o?(P=async()=>{await o.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[40]=s.id,e[41]=s.isDefault,e[42]=o,e[43]=P):P=e[43];let $;e[44]!==s.id||e[45]!==s.isDefault||e[46]!==r||e[47]!==l?($=()=>{se(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),r(),G.success(s.isDefault?l("settings.orgBrandContext.removedAsDefaultBrand"):l("settings.orgBrandContext.setAsDefaultBrand"))},e[44]=s.id,e[45]=s.isDefault,e[46]=r,e[47]=l,e[48]=$):$=e[48];let K;e[49]!==l?(K=()=>G.error(l("settings.orgBrandContext.failedUpdateDefaultBrand")),e[49]=l,e[50]=K):K=e[50];let J;e[51]!==P||e[52]!==$||e[53]!==K?(J={mutationFn:P,onSuccess:$,onError:K},e[51]=P,e[52]=$,e[53]=K,e[54]=J):J=e[54];const{mutate:H}=Ee(J),V=s.isDefault?"border-primary/30":"border-border/60";let L;e[55]!==V?(L=Le("rounded-2xl border bg-background",V),e[55]=V,e[56]=L):L=e[56];let I;e[57]!==i?(I=()=>a(!i),e[57]=i,e[58]=I):I=e[58];let Q;e[59]!==i?(Q=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:i?n.jsx(et,{size:14}):n.jsx(tt,{size:14})}),e[59]=i,e[60]=Q):Q=e[60];let Z;e[61]!==s.logo||e[62]!==s.name?(Z=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:Et})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[61]=s.logo,e[62]=s.name,e[63]=Z):Z=e[63];let M;e[64]!==s.name||e[65]!==l?(M=s.name||l("settings.orgBrandContext.untitledBrand"),e[64]=s.name,e[65]=l,e[66]=M):M=e[66];let Y;e[67]!==M?(Y=n.jsx("span",{className:"text-sm font-medium text-foreground",children:M}),e[67]=M,e[68]=Y):Y=e[68];let z;e[69]!==s.domain?(z=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[69]=s.domain,e[70]=z):z=e[70];let U;e[71]!==Y||e[72]!==z?(U=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[Y,z]}),e[71]=Y,e[72]=z,e[73]=U):U=e[73];let X;e[74]!==s.colors||e[75]!==i?(X=!i&&s.colors&&Object.values(s.colors).some(wt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(kt).map(Dt)}),e[74]=s.colors,e[75]=i,e[76]=X):X=e[76];let q;e[77]!==s.fonts||e[78]!==i?(q=!i&&s.fonts&&Object.values(s.fonts).some(_t)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[77]=s.fonts,e[78]=i,e[79]=q):q=e[79];const ee=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let S;e[80]!==ee?(S=Le("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",ee),e[80]=ee,e[81]=S):S=e[81];let ne,le;e[82]!==H?(ne=v=>{v.stopPropagation(),H()},le=v=>{v.key==="Enter"&&(v.stopPropagation(),H())},e[82]=H,e[83]=ne,e[84]=le):(ne=e[83],le=e[84]);let oe;e[85]!==s.isDefault||e[86]!==l?(oe=s.isDefault?l("settings.orgBrandContext.unsetAsDefault"):l("settings.orgBrandContext.setAsDefault"),e[85]=s.isDefault,e[86]=l,e[87]=oe):oe=e[87];const ze=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let re;e[88]!==ze?(re=Le(ze),e[88]=ze,e[89]=re):re=e[89];let ie;e[90]!==re?(ie=n.jsx(nt,{size:13,className:re}),e[90]=re,e[91]=ie):ie=e[91];let ae;e[92]!==S||e[93]!==ne||e[94]!==le||e[95]!==oe||e[96]!==ie?(ae=n.jsx("span",{role:"button",tabIndex:0,className:S,onClick:ne,onKeyDown:le,title:oe,children:ie}),e[92]=S,e[93]=ne,e[94]=le,e[95]=oe,e[96]=ie,e[97]=ae):ae=e[97];let Ae,Te;e[98]===Symbol.for("react.memo_cache_sentinel")?(Ae=v=>{v.stopPropagation(),d(!0)},Te=v=>{v.key==="Enter"&&(v.stopPropagation(),d(!0))},e[98]=Ae,e[99]=Te):(Ae=e[98],Te=e[99]);let ce;e[100]!==l?(ce=l("settings.orgBrandContext.deleteBrand"),e[100]=l,e[101]=ce):ce=e[101];let Re;e[102]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(lt,{size:13,className:"text-muted-foreground"}),e[102]=Re):Re=e[102];let de;e[103]!==ce?(de=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:Ae,onKeyDown:Te,title:ce,children:Re}),e[103]=ce,e[104]=de):de=e[104];let fe;e[105]!==I||e[106]!==Q||e[107]!==Z||e[108]!==U||e[109]!==X||e[110]!==q||e[111]!==ae||e[112]!==de?(fe=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:I,children:[Q,Z,U,X,q,ae,de]}),e[105]=I,e[106]=Q,e[107]=Z,e[108]=U,e[109]=X,e[110]=q,e[111]=ae,e[112]=de,e[113]=fe):fe=e[113];let me;e[114]!==i||e[115]!==w||e[116]!==p||e[117]!==k?(me=i&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(jt,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsx(yt,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(Ft,{form:p,onFieldChange:k,onFieldCommit:w}),n.jsx(Nt,{form:p,onFieldChange:k,onFieldCommit:w})]})]}),e[114]=i,e[115]=w,e[116]=p,e[117]=k,e[118]=me):me=e[118];let ue;e[119]!==D?(ue=v=>{!v&&!D&&d(!1)},e[119]=D,e[120]=ue):ue=e[120];let xe;e[121]!==l?(xe=l("settings.orgBrandContext.deleteBrandTitle"),e[121]=l,e[122]=xe):xe=e[122];let ge;e[123]!==xe?(ge=n.jsx(ot,{children:xe}),e[123]=xe,e[124]=ge):ge=e[124];let be;e[125]!==s.name||e[126]!==l?(be=l("settings.orgBrandContext.deleteConfirmMessage",{name:s.name||l("settings.orgBrandContext.thisBrand")}),e[125]=s.name,e[126]=l,e[127]=be):be=e[127];let he;e[128]!==be?(he=n.jsx("p",{children:be}),e[128]=be,e[129]=he):he=e[129];let pe;e[130]!==s.isDefault||e[131]!==l?(pe=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsxs("span",{className:"font-medium",children:[l("settings.orgBrandContext.headsUp"),":"]})," ",l("settings.orgBrandContext.deleteDefaultBrandWarning")]}),e[130]=s.isDefault,e[131]=l,e[132]=pe):pe=e[132];let je;e[133]!==he||e[134]!==pe?(je=n.jsx(rt,{asChild:!0,children:n.jsxs("div",{children:[he,pe]})}),e[133]=he,e[134]=pe,e[135]=je):je=e[135];let Ce;e[136]!==ge||e[137]!==je?(Ce=n.jsxs(it,{children:[ge,je]}),e[136]=ge,e[137]=je,e[138]=Ce):Ce=e[138];let ye;e[139]!==l?(ye=l("settings.orgBrandContext.cancel"),e[139]=l,e[140]=ye):ye=e[140];let ve;e[141]!==D||e[142]!==ye?(ve=n.jsx(at,{disabled:D,children:ye}),e[141]=D,e[142]=ye,e[143]=ve):ve=e[143];let Ne;e[144]!==A?(Ne=v=>{v.preventDefault(),A()},e[144]=A,e[145]=Ne):Ne=e[145];let Be;e[146]!==D||e[147]!==l?(Be=l(D?"settings.orgBrandContext.deleting":"settings.orgBrandContext.delete"),e[146]=D,e[147]=l,e[148]=Be):Be=e[148];let Fe;e[149]!==D||e[150]!==Ne||e[151]!==Be?(Fe=n.jsx(ct,{onClick:Ne,disabled:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Be}),e[149]=D,e[150]=Ne,e[151]=Be,e[152]=Fe):Fe=e[152];let Se;e[153]!==ve||e[154]!==Fe?(Se=n.jsxs(dt,{children:[ve,Fe]}),e[153]=ve,e[154]=Fe,e[155]=Se):Se=e[155];let _e;e[156]!==Ce||e[157]!==Se?(_e=n.jsxs(ft,{children:[Ce,Se]}),e[156]=Ce,e[157]=Se,e[158]=_e):_e=e[158];let De;e[159]!==c||e[160]!==ue||e[161]!==_e?(De=n.jsx(mt,{open:c,onOpenChange:ue,children:_e}),e[159]=c,e[160]=ue,e[161]=_e,e[162]=De):De=e[162];let Oe;return e[163]!==L||e[164]!==fe||e[165]!==me||e[166]!==De?(Oe=n.jsxs("div",{className:L,children:[fe,me,De]}),e[163]=L,e[164]=fe,e[165]=me,e[166]=De,e[167]=Oe):Oe=e[167],Oe}function _t(t){return t}function Dt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function kt(t){const[,e]=t;return e}function wt(t){return t}function Et(t){t.target.style.display="none"}function At(t){return t?.trim()}function Tt(t){return t?.trim()}function Rt(){const t=W.c(77),e=te(),{brandExtractEnabled:s}=Ye(),{org:r}=Ge(),l=Ve(),o=We();let i;t[0]!==r.id?(i=He.brandContext(r.id),t[0]=r.id,t[1]=i):i=t[1];let a;t[2]!==l?(a=async()=>{const{items:S}=await l.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return S},t[2]=l,t[3]=a):a=t[3];let c;t[4]!==i||t[5]!==a?(c={queryKey:i,queryFn:a},t[4]=i,t[5]=a,t[6]=c):c=t[6];const{data:d}=Je(c),b=(d===void 0?[]:d).filter(Ot);let x;t[7]!==r.id||t[8]!==o?(x=()=>o.invalidateQueries({queryKey:He.brandContext(r.id),refetchType:"all"}),t[7]=r.id,t[8]=o,t[9]=x):x=t[9];const f=x;let u;t[10]!==l?(u=async()=>{await l.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=l,t[11]=u):u=t[11];let h;t[12]!==f||t[13]!==e?(h=()=>{se("brand_created"),f(),G.success(e("settings.orgBrandContext.brandCreated"))},t[12]=f,t[13]=e,t[14]=h):h=t[14];let m;t[15]!==e?(m=()=>G.error(e("settings.orgBrandContext.failedCreateBrand")),t[15]=e,t[16]=m):m=t[16];let g;t[17]!==u||t[18]!==h||t[19]!==m?(g={mutationFn:u,onSuccess:h,onError:m},t[17]=u,t[18]=h,t[19]=m,t[20]=g):g=t[20];const{mutate:N,isPending:p}=Ee(g);let C;t[21]!==l?(C=async S=>{se("brand_extract_started",{domain:S}),await l.call("BRAND_CONTEXT_EXTRACT",{domain:S})},t[21]=l,t[22]=C):C=t[22];let y;t[23]!==f||t[24]!==e?(y=()=>{se("brand_extract_succeeded"),f(),G.success(e("settings.orgBrandContext.brandExtractedSuccessfully"))},t[23]=f,t[24]=e,t[25]=y):y=t[25];let B;t[26]!==e?(B=S=>{se("brand_extract_failed",{error:S instanceof Error?S.message:"unknown"}),G.error(S instanceof Error?S.message:e("settings.orgBrandContext.failedExtractBrand"))},t[26]=e,t[27]=B):B=t[27];let _;t[28]!==y||t[29]!==B||t[30]!==C?(_={mutationFn:C,onSuccess:y,onError:B},t[28]=y,t[29]=B,t[30]=C,t[31]=_):_=t[31];const{mutate:T,isPending:k}=Ee(_),w=Ke,E=Ke,R=Ke,O="flex flex-col gap-6";let F;t[32]!==e?(F=e("settings.orgBrandContext.brandContext"),t[32]=e,t[33]=F):F=t[33];let A;t[34]!==F?(A=n.jsx(Ke.Title,{children:F}),t[34]=F,t[35]=A):A=t[35];let D;t[36]!==e?(D=e("settings.orgBrandContext.brandContextDescription"),t[36]=e,t[37]=D):D=t[37];let P;t[38]!==D?(P=n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:D}),t[38]=D,t[39]=P):P=t[39];let $;t[40]!==A||t[41]!==P?($=n.jsxs("div",{children:[A,P]}),t[40]=A,t[41]=P,t[42]=$):$=t[42];let K;t[43]!==N?(K=()=>N(),t[43]=N,t[44]=K):K=t[44];let J;t[45]===Symbol.for("react.memo_cache_sentinel")?(J=n.jsx(Me,{size:14}),t[45]=J):J=t[45];let H;t[46]!==e?(H=e("settings.orgBrandContext.addBrand"),t[46]=e,t[47]=H):H=t[47];let V;t[48]!==p||t[49]!==K||t[50]!==H?(V=n.jsxs(qe,{variant:"outline",onClick:K,disabled:p,children:[J,H]}),t[48]=p,t[49]=K,t[50]=H,t[51]=V):V=t[51];let L;t[52]!==$||t[53]!==V?(L=n.jsxs("div",{className:"flex items-center justify-between",children:[$,V]}),t[52]=$,t[53]=V,t[54]=L):L=t[54];let I;t[55]!==s||t[56]!==T||t[57]!==k?(I=s&&n.jsx(pt,{onExtract:S=>T(S),isExtracting:k}),t[55]=s,t[56]=T,t[57]=k,t[58]=I):I=t[58];const Q=b.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:e("settings.orgBrandContext.noBrandsConfigured")}),n.jsxs(qe,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>N(),disabled:p,children:[n.jsx(Me,{size:14}),e("settings.orgBrandContext.addYourFirstBrand")]})]}),Z="group space-y-3";let M;t[59]!==f?(M=S=>n.jsx(St,{brand:S,onChanged:f},S.id),t[59]=f,t[60]=M):M=t[60];const Y=b.map(M);let z;t[61]!==Y?(z=n.jsx("div",{className:Z,children:Y}),t[61]=Y,t[62]=z):z=t[62];let U;t[63]!==L||t[64]!==I||t[65]!==Q||t[66]!==z?(U=n.jsxs("div",{className:O,children:[L,I,Q,z]}),t[63]=L,t[64]=I,t[65]=Q,t[66]=z,t[67]=U):U=t[67];let X;t[68]!==R.Body||t[69]!==U?(X=n.jsx(R.Body,{children:U}),t[68]=R.Body,t[69]=U,t[70]=X):X=t[70];let q;t[71]!==E.Content||t[72]!==X?(q=n.jsx(E.Content,{children:X}),t[71]=E.Content,t[72]=X,t[73]=q):q=t[73];let ee;return t[74]!==w||t[75]!==q?(ee=n.jsx(w,{children:q}),t[74]=w,t[75]=q,t[76]=ee):ee=t[76],ee}function Ot(t){return!t.archivedAt}function os(){const t=W.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ht,{capability:"org:manage",area:"brand context",children:n.jsx(Rt,{})}),t[0]=e):e=t[0],e}export{os as default};
@@ -1 +0,0 @@
1
- import{c as he,b as je,r as de,j as t,k as ye,B as ne}from"./index-geMXTkeP.js";import{B as ue}from"./agent-icon-CQRHN6rX.js";import{i as Ne}from"./X-D0lgdZFx.js";import{L as ce}from"./label-cSCv6rYO.js";import{a4 as xe,a5 as ke}from"./index-y45nRZhN.js";import{S as Ce,a as Pe,b as Se,c as ve,d as _e}from"./select-D6zOoh5E.js";import{T as Te,a as we,c as Be}from"./tooltip-BrF3GD_a.js";import"./AlertCircle-BGrbeDYT.js";import"./Tool01-BjfDVrJb.js";import"./ArrowUp-B7rh6W_b.js";import"./Settings02-K87UDDa_.js";import"./Tool02-df-j-2i7.js";import"./XCircle-BEfRA2Fy.js";import"./ArrowUpRight-An4hbib7.js";import"./TrendUp01-Bj5u2ghc.js";import"./ZapSquare-2syNvY2F.js";import"./Users03-Cwqfteu1.js";import"./CheckCircle-DI16N69_.js";import"./Check-DpoXXYhc.js";import"./ChevronDown-BbcA24KM.js";import"./ChevronRight-BamDO5gK.js";import"./ChevronUp-HIfNhOKS.js";import"./DotsVertical-B_iya6B7.js";import"./Stars02-CF9PavPD.js";import"./Copy01-Bnz3Wx80.js";import"./CpuChip01-BShcbCHO.js";import"./CreditCard01-DNJmFfow.js";import"./Eye-BjhopnZD.js";import"./FilterLines-H3se16dF.js";import"./Star01-BWcFSKod.js";import"./Palette-DqKGGY7c.js";import"./SwitchHorizontal01-Boo6w6_t.js";import"./HardDrive-Cc0iy42M.js";import"./Key01-C21diL-t.js";import"./LayoutLeft-NGYALHZo.js";import"./LinkExternal01-BIYwVSjD.js";import"./LogOut01-BYbHv1g4.js";import"./Monitor01-PnI4BWSm.js";import"./Sun-D_TMYzXg.js";import"./Play-C6pKirQG.js";import"./Plus-3NJoZ-Rn.js";import"./SearchLg-DUoOTY_-.js";import"./SearchMd-DZC0VFyz.js";import"./Shield01-Dif9NKxP.js";import"./Stars01-DNjCGctC.js";import"./Trash01-BfrFYc0O.js";import"./Upload01-DGoH2Bw8.js";import"./User01-PHqRfaY2.js";import"./Users01-CeRMXGJo.js";import"./XClose-Ca9PFBA7.js";import"./Zap-Cd4akcPN.js";import"./chat-context-Duovvv_d.js";import"./tab-id-VDxePu-8.js";import"./dialog-DFfWjXhn.js";import"./hooks-BYQbPRxe.js";import"./use-mcp-client-BBl5zme6.js";import"./auth-av09Sk0f.js";import"./decopilot-sse-pool-CsSaGM07.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CEV_ngrf.js";import"./use-ai-providers-CaSDpPjb.js";import"./studio-tools-DH0-34Hv.js";import"./use-decopilot-events-up5oIRDt.js";import"./use-organization-settings-DhcL4nY9.js";import"./automation-runs-D9S7Bj8t.js";import"./useInfiniteQuery-BI-Ge-Y8.js";import"./use-infinite-scroll-CNsERN2g.js";import"./use-connection-B7cDwiOJ.js";import"./card-ZgfbVCh9.js";import"./sidebar-cviY2JKt.js";import"./use-mobile-DMoYecwn.js";import"./table-D5WR7hLa.js";import"./empty-state-BkAQUfnz.js";import"./use-members-stYO4DxP.js";import"./use-org-auth-client-DoX1JG5g.js";import"./use-clock-tick-CAblMTwd.js";import"./use-automations-mCzD08OY.js";import"./useSuspenseInfiniteQuery-9ztDghoj.js";import"./avatar-I17szs3Q.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-r5QxG4Uf.js";import"./calendar-ihm97ng4.js";import"./monaco-editor-DNmyyJIn.js";import"./spinner-CkuCAiR1.js";import"./index-SVAVudgF.js";import"./shell-layout-D82GP0rP.js";import"./required-auth-layout-S0YtLBA5.js";import"./use-org-sso-BVhPMS3K.js";import"./integration-icon-G3CkJMl-.js";import"./use-navigate-to-agent-ABFR-14c.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-ChjS34cq.js";import"./form-Cy7Rd3TL.js";import"./input-i4x2nRXJ.js";import"./drawer-CjxVq45y.js";import"./collection-search-Bxz23u0F.js";import"./index-Dyyz80fH.js";import"./get-initials-D-f_fDFw.js";import"./popover-i4jezHIh.js";import"./dropdown-menu-DNVNevD7.js";import"./github-repo-picker-CKQYOUVF.js";import"./use-debounced-value-LrUb7eiJ.js";import"./authenticate-and-persist-oauth-CCHy3FzA.js";import"./mcp-oauth-Dv6Uhpr5.js";import"./use-mcp-tools-BKtLcTYP.js";import"./extract-connection-data-D8g8Vhah.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-tags-B8ASGI2M.js";import"./skeleton-BnFORNZa.js";import"./command-bMsQFALP.js";import"./index-BZsTAPza.js";import"./use-open-billing-url-DU9jxy0C.js";import"./companions-core-DYxPDPJ-.js";import"./tabs-CqBl7afq.js";import"./toggle-group-D7y3Qsoq.js";import"./use-deco-credits-Dp43HFr7.js";import"./alert-dialog-CWFjoJjX.js";import"./toolbar-CpuC8NsW.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Di6_Srf0.js";import"./use-registry-connections-BoF5es5w.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Bn6hQ_Qz.js";import"./connection-form-helpers-Dl1KTkNE.js";import"./collection-tabs-DJww20x9.js";import"./badge-1BKF0WjP.js";import"./select-model-BNaO-ex3.js";import"./checkbox-CQ_C4vJL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-jz9Avb_j.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DCcIH0HO.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-Cpe_qvZ_.js";import"./pt-BR-CLy76QW2.js";import"./switch-D2uF_EAp.js";import"./use-debounced-autosave-9sjmxrz4.js";import"./index-B1Swgh1Q.js";import"./search-input-B-QuRigZ.js";import"./index-DnUHHdy9.js";import"./use-secrets-BmzIH3vm.js";import"./useQueries-d_0_L-iH.js";import"./use-file-configs-1vs3YVUZ.js";import"./automation-list-row-CYmqpjOL.js";function Ni(i){const e=he.c(121),{posts:X,categories:l,initialSlug:re,isPending:s,onApply:le,onClose:p}=i,o=je(),[m,fe]=de.useState(re&&l.some(a=>a.slug===re)?re:l[0]?.slug??""),[n,ge]=de.useState("add");let Y;if(e[0]!==l||e[1]!==m){let a;e[3]!==m?(a=be=>be.slug===m,e[3]=m,e[4]=a):a=e[4],Y=l.find(a),e[0]=l,e[1]=m,e[2]=Y}else Y=e[2];const c=Y,r=X.length,me=String(r);let d;e[5]!==o||e[6]!==me?(d=o("sandbox.bulkCategoryPanel.selectedCount",{count:me}),e[5]=o,e[6]=me,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("span",{className:"truncate text-sm font-medium",children:d}),e[8]=d,e[9]=x):x=e[9];let u;e[10]!==o?(u=o("sandbox.bulkCategoryPanel.exitSelection"),e[10]=o,e[11]=u):u=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(Ne,{size:14}),e[12]=Z):Z=e[12];let f;e[13]!==s||e[14]!==p||e[15]!==u?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",disabled:s,onClick:p,"aria-label":u,children:Z})}),e[13]=s,e[14]=p,e[15]=u,e[16]=f):f=e[16];let g;e[17]!==o?(g=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=g):g=e[18];let b;e[19]!==g?(b=t.jsx(we,{side:"bottom",children:g}),e[19]=g,e[20]=b):b=e[20];let h;e[21]!==f||e[22]!==b?(h=t.jsxs(Be,{children:[f,b]}),e[21]=f,e[22]=b,e[23]=h):h=e[23];let j;e[24]!==h||e[25]!==x?(j=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[x,h]}),e[24]=h,e[25]=x,e[26]=j):j=e[26];let y;e[27]!==o?(y=o("sandbox.bulkCategoryPanel.title"),e[27]=o,e[28]=y):y=e[28];let N;e[29]!==y?(N=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y}),e[29]=y,e[30]=N):N=e[30];let k;e[31]!==r||e[32]!==o?(k=r===0?o("sandbox.bulkCategoryPanel.descriptionEmpty"):o("sandbox.bulkCategoryPanel.descriptionWithCount",{count:String(r)}),e[31]=r,e[32]=o,e[33]=k):k=e[33];let C;e[34]!==k?(C=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:k}),e[34]=k,e[35]=C):C=e[35];let P;e[36]!==o?(P=o("sandbox.bulkCategoryPanel.categoryLabel"),e[36]=o,e[37]=P):P=e[37];let S;e[38]!==P?(S=t.jsx(ce,{children:P}),e[38]=P,e[39]=S):S=e[39];let v;e[40]!==l||e[41]!==m||e[42]!==o?(v=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noCategoriesMessage")}):t.jsxs(Ce,{value:m,onValueChange:fe,children:[t.jsx(Pe,{className:"w-full",children:t.jsx(Se,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(ve,{children:l.map(ze)})]}),e[40]=l,e[41]=m,e[42]=o,e[43]=v):v=e[43];let _;e[44]!==S||e[45]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[S,v]}),e[44]=S,e[45]=v,e[46]=_):_=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=a=>ge(a),e[47]=ee):ee=e[47];let te;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(xe,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[48]=te):te=e[48];let T;e[49]!==o?(T=o("sandbox.bulkCategoryPanel.modeAddTitle"),e[49]=o,e[50]=T):T=e[50];let w;e[51]!==T?(w=t.jsx("span",{className:"block text-sm font-medium",children:T}),e[51]=T,e[52]=w):w=e[52];let B;e[53]!==o?(B=o("sandbox.bulkCategoryPanel.modeAddDescription"),e[53]=o,e[54]=B):B=e[54];let R;e[55]!==B?(R=t.jsx("span",{className:"block text-xs text-muted-foreground",children:B}),e[55]=B,e[56]=R):R=e[56];let z;e[57]!==w||e[58]!==R?(z=t.jsxs(ce,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[te,t.jsxs("span",{className:"space-y-0.5",children:[w,R]})]}),e[57]=w,e[58]=R,e[59]=z):z=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(xe,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[60]=oe):oe=e[60];let E;e[61]!==o?(E=o("sandbox.bulkCategoryPanel.modeReplaceTitle"),e[61]=o,e[62]=E):E=e[62];let L;e[63]!==E?(L=t.jsx("span",{className:"block text-sm font-medium",children:E}),e[63]=E,e[64]=L):L=e[64];let A;e[65]!==o?(A=o("sandbox.bulkCategoryPanel.modeReplaceDescription"),e[65]=o,e[66]=A):A=e[66];let F;e[67]!==A?(F=t.jsx("span",{className:"block text-xs text-muted-foreground",children:A}),e[67]=A,e[68]=F):F=e[68];let M;e[69]!==L||e[70]!==F?(M=t.jsxs(ce,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[oe,t.jsxs("span",{className:"space-y-0.5",children:[L,F]})]}),e[69]=L,e[70]=F,e[71]=M):M=e[71];let V;e[72]!==n||e[73]!==z||e[74]!==M?(V=t.jsxs(ke,{value:n,onValueChange:ee,className:"gap-2",children:[z,M]}),e[72]=n,e[73]=z,e[74]=M,e[75]=V):V=e[75];let $;e[76]!==o?($=o("sandbox.bulkCategoryPanel.cancelButton"),e[76]=o,e[77]=$):$=e[77];let D;e[78]!==s||e[79]!==p||e[80]!==$?(D=t.jsx(ne,{type:"button",variant:"outline",onClick:p,disabled:s,children:$}),e[78]=s,e[79]=p,e[80]=$,e[81]=D):D=e[81];const ae=!c||s||r===0;let G;e[82]!==n||e[83]!==le||e[84]!==c?(G=()=>c&&le(n,{name:c.name,slug:c.slug}),e[82]=n,e[83]=le,e[84]=c,e[85]=G):G=e[85];let I;e[86]!==s||e[87]!==o?(I=s?t.jsxs(t.Fragment,{children:[t.jsx(ye,{size:14,className:"animate-spin"}),o("sandbox.bulkCategoryPanel.updatingButton")]}):o("sandbox.bulkCategoryPanel.applyButton"),e[86]=s,e[87]=o,e[88]=I):I=e[88];let W;e[89]!==ae||e[90]!==G||e[91]!==I?(W=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=W):W=e[92];let q;e[93]!==D||e[94]!==W?(q=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,W]}),e[93]=D,e[94]=W,e[95]=q):q=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==q?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,q]}),e[96]=_,e[97]=V,e[98]=q,e[99]=H):H=e[99];let ie;e[100]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ue,{size:16,className:"shrink-0 text-muted-foreground"}),e[100]=ie):ie=e[100];const pe=String(r);let J;e[101]!==o||e[102]!==pe?(J=o("sandbox.bulkCategoryPanel.selectedPostsLabel",{count:pe}),e[101]=o,e[102]=pe,e[103]=J):J=e[103];let K;e[104]!==J?(K=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[ie,t.jsx("span",{className:"text-sm",children:J})]}),e[104]=J,e[105]=K):K=e[105];let O;e[106]!==r||e[107]!==X||e[108]!==o?(O=r===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noPostsSelectedMessage")}):t.jsx("ul",{className:"divide-y border-t bg-background",children:X.map(Re)}),e[106]=r,e[107]=X,e[108]=o,e[109]=O):O=e[109];let Q;e[110]!==K||e[111]!==O?(Q=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[K,O]}),e[110]=K,e[111]=O,e[112]=Q):Q=e[112];let U;e[113]!==N||e[114]!==C||e[115]!==H||e[116]!==Q?(U=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[N,C,H,Q]})}),e[113]=N,e[114]=C,e[115]=H,e[116]=Q,e[117]=U):U=e[117];let se;return e[118]!==j||e[119]!==U?(se=t.jsxs("div",{className:"flex h-full flex-col",children:[j,U]}),e[118]=j,e[119]=U,e[120]=se):se=e[120],se}function Re(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(ue,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function ze(i){return t.jsx(_e,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{Ni as BulkCategoryPanel};
@@ -1 +0,0 @@
1
- import{c as J,r as k,m as V,j as t,b as X,B as I,k as Y,t as $}from"./index-geMXTkeP.js";import{i as Z}from"./XCircle-BEfRA2Fy.js";import{b1 as _,B as U}from"./agent-icon-CQRHN6rX.js";import{n as K}from"./LinkExternal01-BIYwVSjD.js";import{g as tt,f as ot,b as et,A as rt,a as it,e as st,c as at,d as nt}from"./alert-dialog-CWFjoJjX.js";import{I as W}from"./input-i4x2nRXJ.js";import{L as H}from"./label-cSCv6rYO.js";import{P as mt,O as lt,Q as pt,a2 as ct,I as dt,T as D,W as gt,a3 as ut,U as xt}from"./index-y45nRZhN.js";import{c as ft,B as ht,a as yt}from"./block-document-CrI42xhd.js";import{u as bt}from"./use-autosave-Dys6xriZ.js";import{t as jt}from"./ChevronDown-BbcA24KM.js";import{o as vt,p as Et,n as Nt}from"./automation-runs-D9S7Bj8t.js";import{s as b,E as Ct}from"./primitives-DONjjQ2v.js";import"./AlertCircle-BGrbeDYT.js";import"./Tool01-BjfDVrJb.js";import"./ArrowUp-B7rh6W_b.js";import"./Settings02-K87UDDa_.js";import"./Tool02-df-j-2i7.js";import"./ArrowUpRight-An4hbib7.js";import"./TrendUp01-Bj5u2ghc.js";import"./ZapSquare-2syNvY2F.js";import"./Users03-Cwqfteu1.js";import"./CheckCircle-DI16N69_.js";import"./Check-DpoXXYhc.js";import"./ChevronRight-BamDO5gK.js";import"./ChevronUp-HIfNhOKS.js";import"./DotsVertical-B_iya6B7.js";import"./Stars02-CF9PavPD.js";import"./Copy01-Bnz3Wx80.js";import"./CpuChip01-BShcbCHO.js";import"./CreditCard01-DNJmFfow.js";import"./Eye-BjhopnZD.js";import"./FilterLines-H3se16dF.js";import"./Star01-BWcFSKod.js";import"./Palette-DqKGGY7c.js";import"./SwitchHorizontal01-Boo6w6_t.js";import"./HardDrive-Cc0iy42M.js";import"./Key01-C21diL-t.js";import"./LayoutLeft-NGYALHZo.js";import"./LogOut01-BYbHv1g4.js";import"./Monitor01-PnI4BWSm.js";import"./Sun-D_TMYzXg.js";import"./Play-C6pKirQG.js";import"./Plus-3NJoZ-Rn.js";import"./SearchLg-DUoOTY_-.js";import"./SearchMd-DZC0VFyz.js";import"./Shield01-Dif9NKxP.js";import"./Stars01-DNjCGctC.js";import"./Trash01-BfrFYc0O.js";import"./Upload01-DGoH2Bw8.js";import"./User01-PHqRfaY2.js";import"./Users01-CeRMXGJo.js";import"./XClose-Ca9PFBA7.js";import"./X-D0lgdZFx.js";import"./Zap-Cd4akcPN.js";import"./chat-context-Duovvv_d.js";import"./tab-id-VDxePu-8.js";import"./dialog-DFfWjXhn.js";import"./hooks-BYQbPRxe.js";import"./use-mcp-client-BBl5zme6.js";import"./auth-av09Sk0f.js";import"./decopilot-sse-pool-CsSaGM07.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CEV_ngrf.js";import"./use-ai-providers-CaSDpPjb.js";import"./studio-tools-DH0-34Hv.js";import"./use-decopilot-events-up5oIRDt.js";import"./use-organization-settings-DhcL4nY9.js";import"./spinner-CkuCAiR1.js";import"./tooltip-BrF3GD_a.js";import"./drawer-CjxVq45y.js";import"./collection-search-Bxz23u0F.js";import"./use-mobile-DMoYecwn.js";import"./AreaChart-ChjS34cq.js";import"./index-SVAVudgF.js";import"./calendar-ihm97ng4.js";import"./index-Dyyz80fH.js";import"./get-initials-D-f_fDFw.js";import"./avatar-I17szs3Q.js";import"./popover-i4jezHIh.js";import"./dropdown-menu-DNVNevD7.js";import"./github-repo-picker-CKQYOUVF.js";import"./use-debounced-value-LrUb7eiJ.js";import"./use-connection-B7cDwiOJ.js";import"./authenticate-and-persist-oauth-CCHy3FzA.js";import"./mcp-oauth-Dv6Uhpr5.js";import"./use-mcp-tools-BKtLcTYP.js";import"./extract-connection-data-D8g8Vhah.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-ABFR-14c.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-members-stYO4DxP.js";import"./use-org-auth-client-DoX1JG5g.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-tags-B8ASGI2M.js";import"./skeleton-BnFORNZa.js";import"./use-copy-r5QxG4Uf.js";import"./command-bMsQFALP.js";import"./index-BZsTAPza.js";import"./use-open-billing-url-DU9jxy0C.js";import"./companions-core-DYxPDPJ-.js";import"./shell-layout-D82GP0rP.js";import"./required-auth-layout-S0YtLBA5.js";import"./use-org-sso-BVhPMS3K.js";import"./form-Cy7Rd3TL.js";import"./select-D6zOoh5E.js";import"./tabs-CqBl7afq.js";import"./toggle-group-D7y3Qsoq.js";import"./use-deco-credits-Dp43HFr7.js";import"./sidebar-cviY2JKt.js";import"./toolbar-CpuC8NsW.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Di6_Srf0.js";import"./use-registry-connections-BoF5es5w.js";import"./useInfiniteQuery-BI-Ge-Y8.js";import"./use-infinite-scroll-CNsERN2g.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-ZgfbVCh9.js";import"./integration-icon-G3CkJMl-.js";import"./textarea-Bn6hQ_Qz.js";import"./connection-form-helpers-Dl1KTkNE.js";import"./collection-tabs-DJww20x9.js";import"./badge-1BKF0WjP.js";import"./useSuspenseInfiniteQuery-9ztDghoj.js";import"./select-model-BNaO-ex3.js";import"./checkbox-CQ_C4vJL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-jz9Avb_j.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DCcIH0HO.js";import"./empty-state-BkAQUfnz.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-Cpe_qvZ_.js";import"./monaco-editor-DNmyyJIn.js";import"./pt-BR-CLy76QW2.js";import"./switch-D2uF_EAp.js";import"./use-debounced-autosave-9sjmxrz4.js";import"./index-B1Swgh1Q.js";import"./search-input-B-QuRigZ.js";import"./index-DnUHHdy9.js";import"./use-secrets-BmzIH3vm.js";import"./useQueries-d_0_L-iH.js";import"./use-file-configs-1vs3YVUZ.js";import"./use-automations-mCzD08OY.js";import"./automation-list-row-CYmqpjOL.js";import"./table-D5WR7hLa.js";import"./use-clock-tick-CAblMTwd.js";function St(j){const o=J.c(18),{icon:x,title:m,defaultOpen:v,children:u}=j,w=v===void 0?!1:v,[f,P]=k.useState(w);let l;o[0]!==x?(l=t.jsx(x,{size:15}),o[0]=x,o[1]=l):l=o[1];let r;o[2]!==m?(r=t.jsx("span",{className:"flex-1 text-left",children:m}),o[2]=m,o[3]=r):r=o[3];const a=f&&"rotate-180";let p;o[4]!==a?(p=V("transition-transform",a),o[4]=a,o[5]=p):p=o[5];let i;o[6]!==p?(i=t.jsx(jt,{size:15,className:p}),o[6]=p,o[7]=i):i=o[7];let c;o[8]!==l||o[9]!==r||o[10]!==i?(c=t.jsx(vt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,r,i]})}),o[8]=l,o[9]=r,o[10]=i,o[11]=c):c=o[11];let d;o[12]!==u?(d=t.jsx(Et,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=d):d=o[13];let n;return o[14]!==f||o[15]!==c||o[16]!==d?(n=t.jsxs(Nt,{open:f,onOpenChange:P,className:"mt-4",children:[c,d]}),o[14]=f,o[15]=c,o[16]=d,o[17]=n):n=o[17],n}function hr({orgSlug:j,virtualMcpId:o,branch:x,blockKey:m,block:v,decofile:u,meta:w,onManagePosts:f,onOpenPost:P,previewBaseUrl:l}){const r=X(),a=mt({orgSlug:j,virtualMcpId:o,branch:x,packagePath:lt(o)}),p=pt(v,"categories"),[i,c,d]=bt(p,e=>{a.mutate({blockKey:m,data:D(m,"categories",e)})}),n=(e,S)=>c({...i,[e]:S}),A=ft({decofile:u,category:i,previewBaseUrl:l}),s=b(i.slug),[B,y]=k.useState(s),[g,E]=k.useState(null),[N,T]=k.useState(!1),z=s?ct(u).filter(e=>e.categorySlugs.includes(s)):[],C=z.length,M=e=>n("slug",e),Q=async(e,S)=>{const G=b(i.name);T(!0);try{let h=0;for(const{key:O,payload:R}of gt(u,"posts")){const L=ut(R,e,{name:G,slug:S});L!==R&&(await a.mutateAsync({blockKey:O,data:D(O,"posts",xt(L))}),h+=1)}const F={...i,slug:S};await a.mutateAsync({blockKey:m,data:D(m,"categories",F)}),d(F),$.success(h>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(h)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),E(null)}catch(h){y(e),E(null),$.error(h instanceof Error?h.message:r("sandbox.categoryEditor.renameFailed"))}finally{T(!1)}},q=()=>{const e=B.trim();if(e===s){B!==e&&y(e);return}if(!e){y(s);return}if(C===0){M(e);return}E({oldSlug:s,newSlug:e,count:C})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:b(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(dt,{isPending:a.isPending,isError:a.isError}),A&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(A,"_blank","noopener,noreferrer"),children:[t.jsx(K,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(Ct,{value:b(i.name),onChange:e=>n("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(W,{id:"category-slug",value:B,onChange:e=>y(e.target.value),onBlur:q,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(W,{id:"category-description",value:b(i.description),onChange:e=>n("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(St,{icon:_,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(ht,{value:yt(i.sections),onChange:e=>n("sections",e),meta:w,sandboxRef:{orgSlug:j,virtualMcpId:o,branch:x},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(U,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(C)})})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!s,title:r(s?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>f(s),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(Z,{size:14})]})]}),C>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>P(e.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(U,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(tt,{open:!!g,onOpenChange:e=>{e||N||(y(s),E(null))},children:t.jsxs(ot,{children:[t.jsxs(et,{children:[t.jsx(rt,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(it,{children:g?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:g.oldSlug,newSlug:g.newSlug,count:String(g.count)}):null})]}),t.jsxs(st,{children:[t.jsx(at,{disabled:N,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(nt,{onClick:e=>{e.preventDefault(),g&&Q(g.oldSlug,g.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{hr as CategoryEditor};
@@ -1,35 +0,0 @@
1
- import{Y as S,a3 as C,a6 as J,Z as i,a4 as ue,a5 as Ie,aH as Ce,cw as wt,bj as qe,b8 as ct,c as ie,J as dt,u as He,o as Be,F as ee,K as de,t as ce,I as be,G as ge,d as ut,f as It,r as v,n as Mt,e as Tt,j as Me,b as De,a as Ct,v as At,aa as Pt,p as _t}from"./index-geMXTkeP.js";import{d as Rt,s as Et,A as pt,t as Dt,u as $t,o as Ut,w as Ot}from"./tab-id-VDxePu-8.js";import{S as Lt,s as Nt,u as Ft,f as qt,i as jt,b as Vt}from"./hooks-BYQbPRxe.js";import{u as Ht}from"./use-is-desktop-app-BNujXJc_.js";import{a as Bt,u as Kt,S as Qt}from"./use-mcp-client-BBl5zme6.js";import{u as Wt}from"./use-virtual-mcp-CEV_ngrf.js";import{u as ht,p as zt,b as xe,i as Gt,c as Xt}from"./use-ai-providers-CaSDpPjb.js";import{u as Zt}from"./use-decopilot-events-up5oIRDt.js";import{u as Yt,c as Jt}from"./studio-tools-DH0-34Hv.js";import{b as en}from"./use-organization-settings-DhcL4nY9.js";const we=S({connection_id:i().describe("Connection ID"),selected_tools:C(i()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:C(i()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:C(i()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),mt=we.extend({selected_tools:we.shape.selected_tools.optional(),selected_resources:we.shape.selected_resources.optional(),selected_prompts:we.shape.selected_prompts.optional()}),tn=S({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),nn=S({id:i().describe("Stable id; used as React key and ?tab= value"),title:i().describe("Tab label"),icon:i().optional().describe("Optional lucide icon name"),view:S({type:qe("ext-app"),appId:i(),args:Ie(i(),ct()).optional()})}),sn=S({defaultMainView:S({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:J().nullable().optional(),cmsDefaultOpen:J().nullable().optional(),tabs:C(nn).optional()}),st=S({tileId:i().optional(),connectionId:i().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:i().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:i().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Ie(i(),ct()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:Ce().int().positive().optional(),maxHeight:Ce().int().positive().optional()}),Ke=S({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:C(tn).nullable().optional(),layout:sn.nullable().optional(),homeTile:st.nullable().optional(),homeTiles:C(st).nullable().optional(),homePrompts:C(i()).nullable().optional()});function ms(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const n=t?.homeTile;return n?[n]:[]}const on=/^[A-Za-z_][A-Za-z0-9_]*$/,ot=i().min(1).regex(on,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),an=wt("kind",[S({key:ot,kind:qe("literal"),value:i()}),S({key:ot,kind:qe("secret"),secretId:i().min(1)})]),rn=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,ln=S({host:i().min(1).regex(rn).describe("Submodule host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:i().min(1).describe("Vault secret id holding the PAT used to fetch this host.")}),Qe=S({selected:i().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:i().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:i().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:C(an).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config."),submoduleCredentials:C(ln).nullable().optional().describe("Git submodule credentials injected on every SANDBOX_START. Each entry maps a host to a vault secret (PAT) that Studio resolves before posting /_sandbox/config; the daemon uses it to authenticate `git submodule update` for submodules on that host.")}),We=S({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:Ce().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:i().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),cn=ue(["agent-sandbox","user-desktop"]),dn=ue(["agent-sandbox","user-desktop","cluster"]);function ze(t){return t==="cluster"?"agent-sandbox":t}const ft={sandboxHandle:i().describe("Provider-specific handle"),previewUrl:i().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:i().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:cn.optional(),createdAt:Ce().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:S({packageManager:i().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:i().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:i().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},bt=S(ft),un=S({...ft,sandboxProviderKind:dn.optional()});function pn(t){const e=un.parse(t);return bt.parse({...e,sandboxProviderKind:e.sandboxProviderKind?ze(e.sandboxProviderKind):void 0})}function fs(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e=t,n={};for(const[s,o]of Object.entries(e)){if(!o||typeof o!="object"||s!=="cluster"&&s!=="agent-sandbox"&&s!=="user-desktop")continue;const a=ze(s);try{if(s==="cluster"&&n[a])continue;n[a]=pn(o)}catch{}}return n}const Ge=Ie(i().describe("userId"),Ie(i().describe("branch"),Ie(i().describe("sandboxProviderKind"),bt))),hn=S({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:ue(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:i().describe("Org filesystem (Library) volume the file lives in"),path:i().describe("Path within the volume"),url:i().describe("Same-origin URL to read the file (display/download)"),contentType:i().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:Ce().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),Xe=C(hn).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),mn=ue(["smart","code-review","open"]),Ze=mn.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),Ye=J().nullable().optional().describe("Enable Fast Preview: render the draft instantly on productionUrl's own page via a ?__draft pointer while the sandbox boots. Requires productionUrl to be set to take effect."),bs=S({id:i().describe("Unique identifier"),title:i().describe("Human-readable name"),description:i().nullable().describe("Description"),icon:i().nullable().describe("Icon URL"),created_at:i().describe("Creation timestamp"),updated_at:i().describe("Last update timestamp"),created_by:i().describe("User ID who created this item"),updated_by:i().optional().describe("User ID who last updated this item"),organization_id:i().describe("Organization ID this item belongs to"),status:ue(["active","inactive"]).describe("Current status"),pinned:J().describe("Whether this space is pinned to the sidebar"),metadata:S({instructions:i().nullable().describe("Instructions also used as system prompt"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Ke.nullable().optional().describe("UI customization settings"),githubRepo:We.nullable().optional().describe("Linked GitHub repository"),runtime:Qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ge.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Xe,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Ze,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking."),fieldDescriptionTooltips:J().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Ye}).loose().describe("Metadata"),connections:C(we).describe("Connections with their selected tools, resources, and prompts")}),gt=S({title:i().min(1).max(120).describe("Short label shown on the chip"),description:i().max(280).optional().describe("One-line subtitle shown under the title"),text:i().min(1).describe("The message sent to the agent when the prompt is clicked")});S({title:i().min(1).max(255).describe("Name for the virtual MCP"),description:i().nullable().optional().describe("Optional description"),icon:i().nullish().describe("Optional icon URL"),status:ue(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:J().optional().default(!1).describe("Pin to sidebar"),metadata:S({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Ke.nullable().optional().describe("UI customization settings"),githubRepo:We.nullable().optional().describe("Linked GitHub repository"),runtime:Qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ge.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Xe,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Ze,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking."),fieldDescriptionTooltips:J().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Ye}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(mt).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:C(gt).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});S({title:i().min(1).max(255).optional().describe("New name"),description:i().nullable().optional().describe("New description (null to clear)"),icon:i().nullish().describe("New icon URL"),status:ue(["active","inactive"]).optional().describe("New status"),pinned:J().optional().describe("Pin/unpin from sidebar"),metadata:S({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Ke.nullable().optional().describe("UI customization settings"),githubRepo:We.nullable().optional().describe("Linked GitHub repository"),runtime:Qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ge.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Xe,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Ze,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking."),fieldDescriptionTooltips:J().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Ye}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(mt).optional().describe("New connections (replaces existing)"),prompts:C(gt).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});function fn(t,e=[]){return t==="stop"?"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const je={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"},"opencode-desktop":{harness:"opencode",sandbox:"user-desktop"}};function bn(t,e){if(!t)return null;const n=e?ze(e):null;if(t==="decopilot"&&(n===null||n==="user-desktop"))return"decopilot";for(const[s,o]of Object.entries(je))if(o.harness===t&&o.sandbox===n)return s;return null}function gn({pendingOption:t,lockedHarness:e}){return e==="claude-code"?"claude-code-desktop":e==="codex"?"codex-desktop":e==="opencode"?"opencode-desktop":t==="claude-code-desktop"||t==="codex-desktop"||t==="opencode-desktop"?t:null}function yn(t){return t.thread?.harness_id!=null?{}:{harnessId:"decopilot",sandboxProviderKind:"agent-sandbox",branch:t.globals.branch??null}}const vn="home",Sn=new Set(["output","upload","public","home"]),kn=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function gs(t){return Sn.has(t)||!kn.test(t)?"home":t}function xn(t){const e=t?t.split("/").filter(Boolean):[],n=e[0]==="public",s=n?e[1]??null:null,o=n?s?`public-${s}`:null:e[0]??null,a=(n?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:a,isPublic:n,publicSet:s,readOnly:n,isHomeRoot:o===vn&&a===""}}function ys(t){return t==="public"?"skills":t}function vs(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const at="public-";function yt(t){return t.startsWith(at)?t.slice(at.length):null}function Ss(t,e){const n=yt(t);return n?`public/${n}/${e}`:`${t}/${e}`}function wn(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function In(t){const{volume:e,dirPath:n}=xn(t);if(!e)return null;let s;if(e==="home")s="org/home";else if(e==="outputs")s="org/.outputs";else if(e==="uploads")s="org/.uploads";else{const o=yt(e);s=o?`org/public/${o}`:`org/${e}`}return n?`${s}/${n}`:s}function Mn(t){const e=ie.c(21);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=dt(n);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const a=He(o);let l;e[2]!==a.brand||e[3]!==a.main||e[4]!==a.preview||e[5]!==a.skill?(l=(typeof a.main=="string"?Rt(a.main)?.path:void 0)??a.preview??a.skill??a.brand??null,e[2]=a.brand,e[3]=a.main,e[4]=a.preview,e[5]=a.skill,e[6]=l):l=e[6];const c=l;let h;if(e[7]!==s?.params.appSlug||e[8]!==s?.params.collectionName||e[9]!==s?.params.itemId||e[10]!==c||e[11]!==t){if(h=[],t&&h.push(`### Selected Agent
2
- - ID: ${t}`),c){let f;e[13]!==c?(f=In(c),e[13]=c,e[14]=f):f=e[14];const k=f;let M;e[15]!==c?(M=wn(c),e[15]=c,e[16]=M):M=e[16],h.push(`### Currently Open File
3
- The user has this file open in the Library and is most likely referring to it:
4
- - Name: ${M}
5
- - Library path: ${c}${k?`
6
- - Read/edit it with your file tools at: \`${k}\``:""}
7
-
8
- When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let m;e[17]!==s?.params.appSlug||e[18]!==s?.params.collectionName||e[19]!==s?.params.itemId?(m=[],s?.params.appSlug&&m.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&m.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&m.push(`- Item ID: ${s?.params.itemId}`),e[17]=s?.params.appSlug,e[18]=s?.params.collectionName,e[19]=s?.params.itemId,e[20]=m):m=e[20],m.length>0&&h.push(`### Current Resource
9
- The user is viewing the following resource:
10
- ${m.join(`
11
- `)}
12
-
13
- Help the user understand and work with this resource.`),e[7]=s?.params.appSlug,e[8]=s?.params.collectionName,e[9]=s?.params.itemId,e[10]=c,e[11]=t,e[12]=h}else h=e[12];return h.join(`
14
-
15
- `)}function Tn(){const t=ie.c(5),e=Be(),{org:n}=ee();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=dt(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=l=>{const h=l.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!h||!h[1])return;const m=h[1],f=o?.params.appSlug;if(!f)return;e.invalidateQueries({queryKey:de.collection(n.slug,f,m)});const k=m.toLowerCase().replace(/_/g," ");ce.success(`${k} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Cn(){const t=ie.c(4),{org:e,project:n}=ee(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=ge.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=be(o,An);let l;return t[2]!==a?(l={markTaskRead:h=>{a(m=>({...m,[h]:new Date().toISOString()}))}},t[2]=a,t[3]=l):l=t[3],l}function An(t){return t??{}}function vt(){const t=ut(),{org:e}=ee(),n=He({strict:!1}),s=It({strict:!1}),o=n.virtualmcpid??Bt(e.id).id,a=(h,m)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:h},search:f=>{const k={},M=m?.virtualMcpId??f.virtualmcpid;M&&(k.virtualmcpid=M);const p=f.main;return p&&typeof p=="string"&&!Et(p)&&(k.main=p),(f.sidepanel==="chat"||f.sidepanel===0)&&(k.sidepanel=f.sidepanel),m?.autosend&&(k.autosend=pt),k}})},l=v.useRef(crypto.randomUUID()),c=s.taskId??l.current;return{virtualMcpId:o,taskId:c,navigateToTask:a}}function Pn(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
16
- ${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function it(t,e){const n=[];for(const s of t)!s||typeof s!="object"||("text"in s&&s.text?n.push({type:"text",text:`[${e}]
17
- ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)}));return n}function _n(t,e){const n=(t.files??[]).filter(l=>l.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const o=n.map(l=>`<skill-file path="${l.relPath}">
18
- ${l.content.trim()}
19
- </skill-file>`).join(`
20
-
21
- `),a=s.length>0?`
22
-
23
- Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",text:`[${e}]
24
- ${o}${a}`}]}function Rn(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const o=Array.isArray(s.content)?s.content:[s.content];for(const a of o)switch(a.type){case"text":{const l=a.text?.trim();if(!l)continue;n.push({type:"text",text:`[${e}]
25
- ${l}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;n.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const l=a.resource;if(!l||!l.mimeType)continue;l&&("text"in l&&l.text?n.push({type:"text",text:`[${e}]
26
- ${l.text}`}):"blob"in l&&l.blob&&l.mimeType&&n.push({type:"file",url:`data:${l.mimeType};base64,${l.blob}`,filename:String(l.uri),mediaType:String(l.mimeType)}));break}}}return n}function St(t){if(!t)return[];const e=[];let n="";const s=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const a=o.attrs.char??"/",l=`${a}${o.attrs.name}`;if(o.attrs.kind==="task"){const c=o.attrs.metadata,h=c?.title??o.attrs.name??"",m=c?.context?.trim()||[h,c?.description?.trim()].filter(Boolean).join(`
27
-
28
- `);m&&e.push({type:"text",text:m});return}if(n+=l,a==="@"){const c=o.attrs.metadata;c&&typeof c=="object"&&!Array.isArray(c)&&"agentId"in c?e.push({type:"text",text:`[DELEGATE TO AGENT: ${c.title??o.attrs.name} (agent_id: ${c.agentId})]
29
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...it(c,l))}else if(o.attrs.kind==="skill"){const c=o.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(..._n(c,l))}else{const c=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(c)&&c.length>0&&typeof c[0]=="object"&&c[0]!==null&&"role"in c[0]?e.push(...Rn(c,l)):Array.isArray(c)&&e.push(...it(c,l))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,l=`[file:://${encodeURIComponent(a.name)}]`;n+=l,e.push(...Pn(a,l))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function ks(t){const e=St(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function xs(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function En(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function ws(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Dn(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function $n(t,e){return t.filter(n=>n.messageId!==e)}const ye=new Map,Un=200;function On(t){if(ye.size<Un||ye.has(t))return;const e=ye.keys().next().value;if(e!==void 0){ye.delete(e),$e.delete(e);for(const n of ve.keys())n.startsWith(`${e}:`)&&ve.delete(n)}}const $e=new Set;function Ln(t){$e.add(t)}function Nn(t){return $e.has(t)}function Fn(t){$e.delete(t)}function Ae(t){let e=ye.get(t);return e||(On(t),e=new Lt([]),ye.set(t,e)),e}function kt(t,e){Ae(t).update(n=>Dn(n,e))}function Ve(t,e){Ae(t).update(n=>$n(n,e))}function qn(t,e){Ae(t).set(e)}const ve=new Map;function jn(t,e){ve.set(`${t}:${e.id}`,e)}function Vn(t,e){const n=`${t}:${e}`,s=ve.get(n);return ve.delete(n),s}function rt(t,e){ve.delete(`${t}:${e}`)}async function ae(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();qn(e,s.items??[])}catch{}}function Is(t){const e=ie.c(2);let n;e[0]!==t?(n=Ae(t),e[0]=t,e[1]=n):n=e[1];const s=n;return v.useSyncExternalStore(s.subscribe,s.get,s.get)}function Hn(){const{org:t}=ee();return{enqueue:kt,refresh:e=>ae(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;Ve(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ce.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await ae(t.slug,e)}}}}function Ee(t,e){return t.find(n=>n!=null&&e.has(n.keyId))??null}function Bn(t,e,n){const s=o=>Ee([o],n);return{tiers:{fast:Ee([e.tiers.fast,t.tiers.fast],n),smart:Ee([e.tiers.smart,t.tiers.smart],n),thinking:Ee([e.tiers.thinking,t.tiers.thinking],n),image:s(t.tiers.image),web_search:s(t.tiers.web_search),deep_research:s(t.tiers.deep_research)}}}const Te={tiers:{}};function Kn(){const t=ie.c(7),{org:e}=ee();let n;t[0]!==e.id?(n=de.userModelPreferences(e.id),t[0]=e.id,t[1]=n):n=t[1];let s;t[2]!==e.slug?(s=async()=>{const a=await Jt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return a?.tiers?a:Te},t[2]=e.slug,t[3]=s):s=t[3];let o;return t[4]!==n||t[5]!==s?(o={queryKey:n,queryFn:s,staleTime:6e4},t[4]=n,t[5]=s,t[6]=o):o=t[6],Mt(o)}function Qn(){return Kn().data??Te}function Ms(){const t=ie.c(19),{org:e}=ee(),n=Yt(),s=Be();let o;t[0]!==e.id?(o=de.userModelPreferences(e.id),t[0]=e.id,t[1]=o):o=t[1];const a=o;let l;t[2]!==a||t[3]!==s||t[4]!==n?(l=async M=>{const p=s.getQueryData(a)??Te;return await n.call("USER_MODEL_PREFERENCES_UPDATE",p)??p},t[2]=a,t[3]=s,t[4]=n,t[5]=l):l=t[5];let c,h,m,f;t[6]!==a||t[7]!==s?(c=M=>{const{tier:p,slot:A}=M,F=s.getQueryData(a),q=F??Te;return s.setQueryData(a,{tiers:{...q.tiers,[p]:A}}),{prev:F}},h=(M,p,A)=>{s.setQueryData(a,A?.prev??Te)},m=M=>{s.setQueryData(a,M)},f=()=>{s.isMutating({mutationKey:a})===1&&s.invalidateQueries({queryKey:a})},t[6]=a,t[7]=s,t[8]=c,t[9]=h,t[10]=m,t[11]=f):(c=t[8],h=t[9],m=t[10],f=t[11]);let k;return t[12]!==a||t[13]!==l||t[14]!==c||t[15]!==h||t[16]!==m||t[17]!==f?(k={mutationKey:a,mutationFn:l,onMutate:c,onError:h,onSuccess:m,onSettled:f},t[12]=a,t[13]=l,t[14]=c,t[15]=h,t[16]=m,t[17]=f,t[18]=k):k=t[18],Tt(k)}function Wn(){const t=ie.c(4),e=en(),n=Qn(),s=ht();let o;return t[0]!==s||t[1]!==e||t[2]!==n?(o=Bn(e,n,new Set(s.map(zn))),t[0]=s,t[1]=e,t[2]=n,t[3]=o):o=t[3],o}function zn(t){return t.id}function le(t,e,n,s){if(!t)return null;const o=e.find(l=>l.id===t.keyId);if(!o)return null;const a=n.find(l=>l.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Gn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Xn(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(h=>h.id===n);if(!o)return null;const a=zt([o],{[n]:s}),l=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!l)return null;const c=s.find(h=>h.modelId===l.modelId);return c?{...c,keyId:n}:null}const lt=new Set,oe=new Set;function fe(t){return v.useSyncExternalStore(t.subscribe,t.get,t.get)}function Zn(t){return t.kind==="loading"?"ready":t.kind}const Yn=1e4,Jn=10,Je=v.createContext(null),et=v.createContext(null),tt=v.createContext(null),xt=v.createContext(null);function es({children:t}){const{locator:e}=ee(),{virtualMcpId:n}=vt(),[s,o]=be(ge.chatSelectedImageModel(e),null),[a,l]=be(ge.chatSelectedWebSearchModel(e),null),[c,h]=be(ge.chatSelectedDeepResearchModel(e),null),[m,f]=v.useState(null),[k,M]=v.useState("default"),p=Wn(),[A,F]=be(ge.chatSimpleModeTier(e),null),q=Gn(A),x=ht(),T=p.tiers[q],j=x.some(r=>r.id===T?.keyId)?T?.keyId:void 0,W=m&&x.some(r=>r.id===m)?m:j??x[0]?.id??null,{models:V,isLoading:_}=xe(W??void 0),{models:G}=xe(j),$=x.some(r=>r.id===p.tiers.image?.keyId)?p.tiers.image?.keyId:void 0,{models:te}=xe($),H=x.some(r=>r.id===p.tiers.web_search?.keyId)?p.tiers.web_search?.keyId:void 0,{models:B}=xe(H),ne=x.some(r=>r.id===p.tiers.deep_research?.keyId)?p.tiers.deep_research?.keyId:void 0,{models:K}=xe(ne),z=le(T,x,G,T?.title)??Xn(q,x,W,V),se=_,X=V.filter(r=>r.capabilities?.includes("image")),b=le(s,x,X),E=le(p.tiers.image,x,te,p.tiers.image?.title)??b??X[0]??null,L=V.filter(Gt),P=le(a,x,L),Q=L.find(r=>r.modelId==="perplexity/sonar")??L[0]??null,pe=le(p.tiers.web_search,x,B,p.tiers.web_search?.title)??P??Q,Z=V.filter(Xt),N=le(c,x,Z),Se=Z.find(r=>r.modelId==="perplexity/deep-research")??Z.find(r=>r.asyncResearch===!0)??Z[0]??null,Ue=le(p.tiers.deep_research,x,K,p.tiers.deep_research?.title)??N??Se,Le=Wt(n)??{id:n,title:"",description:null,icon:null},[Pe,ke]=v.useState({}),_e=(r,g)=>{const O=[];for(const I of g.content??[])I.type==="text"&&I.text?.trim()&&O.push(I.text.trim());const R=O.join(`
30
- `);if(!R){re(r);return}new TextEncoder().encode(R).length>Yn||ke(I=>Object.keys(I).length>=Jn&&!(r in I)?I:{...I,[r]:R})},re=r=>{ke(g=>{const{[r]:O,...R}=g;return R})},[Ne,Fe]=be(ge.chatLastAgentOption(e),r=>r&&r in je?r:null),Y=ss(),nt=Y?.isThreadLocked&&Y.lockedHarness!=null?bn(Y.lockedHarness,Y.lockedSandbox):null;gn({pendingOption:Ne,lockedHarness:Y?.isThreadLocked?Y.lockedHarness:null});const he=Y?.isThreadLocked?nt:"decopilot",Re=he?je[he]:null,d=Re?.harness??null,u=Re?.sandbox??null,[D,U]=v.useState(void 0),y=v.useRef(D);y.current=D;const w={selectedModel:z,setModel:()=>{},credentialId:W,setCredentialId:f,allModelsConnections:x,isModelsLoading:se,selectedVirtualMcp:Le,imageModel:E,setImageModel:r=>{o(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},webSearchModel:pe,setWebSearchModel:r=>{l(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},deepResearchModel:Ue,setDeepResearchModel:r=>{h(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},chatMode:k,setChatMode:M,appContexts:Pe,setAppContext:_e,clearAppContext:re,tiptapDoc:D,setTiptapDoc:U,tiptapDocRef:y,resetInteraction:()=>{},simpleModeTier:q,setSimpleModeTier:r=>F(r),pendingAgentOption:he,setPendingAgentOption:Fe,pendingHarnessId:d,pendingSandboxProviderKind:u};return Me.jsx(tt.Provider,{value:w,children:t})}function Ts(t){const e=ie.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=ee(),{data:l}=Ct.useSession(),c=l?.user??null,{taskId:h,virtualMcpId:m,navigateToTask:f}=vt(),[k]=At(),{markTaskRead:M}=Cn(),p=Vt(),A=h,F=m,q=Mn(F);let x;e[0]!==M||e[1]!==f?(x=(P,Q)=>{M(P),f(P,{virtualMcpId:Q?.virtualMcpId,autosend:Q?.autosend})},e[0]=M,e[1]=f,e[2]=x):x=e[2];const T=x,j=A&&s?.id===A?s:null,W=j?.harness_id??null,V=j?.sandbox_provider_kind??null,_=j?.branch??null,G=W!=null,$=_;let te;e[3]!==$||e[4]!==T||e[5]!==p||e[6]!==n?(te=()=>{const P=crypto.randomUUID();return p.create({id:P,virtual_mcp_id:n,...$?{branch:$}:{}}).then(()=>T(P)).catch(()=>{T(P)}),P},e[3]=$,e[4]=T,e[5]=p,e[6]=n,e[7]=te):te=e[7];const H=te;let B;e[8]!==$||e[9]!==a||e[10]!==T||e[11]!==p||e[12]!==n?(B=P=>{const Q=crypto.randomUUID(),pe=P.virtualMcpId??n,Z=pe===n?$:null;Ot(sessionStorage,a,Q,P.message),p.create({id:Q,virtual_mcp_id:pe,...Z?{branch:Z}:{}}).then(()=>T(Q,{virtualMcpId:P.virtualMcpId,autosend:!0})).catch(()=>{T(Q,{virtualMcpId:P.virtualMcpId,autosend:!0})})},e[8]=$,e[9]=a,e[10]=T,e[11]=p,e[12]=n,e[13]=B):B=e[13];const ne=B;let K;e[14]!==A||e[15]!==p?(K=P=>{A&&p.setBranch(A,P)},e[14]=A,e[15]=p,e[16]=K):K=e[16];let z;e[17]!==j||e[18]!==H||e[19]!==ne||e[20]!==$||e[21]!==A||e[22]!==F||e[23]!==G||e[24]!==_||e[25]!==W||e[26]!==V||e[27]!==T||e[28]!==K?(z={virtualMcpId:F,taskId:A,openTask:T,createTask:H,createTaskWithMessage:ne,activeTask:j,isThreadLocked:G,lockedHarness:W,lockedSandbox:V,lockedBranch:_,currentBranch:$,setCurrentTaskBranch:K},e[17]=j,e[18]=H,e[19]=ne,e[20]=$,e[21]=A,e[22]=F,e[23]=G,e[24]=_,e[25]=W,e[26]=V,e[27]=T,e[28]=K,e[29]=z):z=e[29];const se=z;let X;e[30]!==q||e[31]!==k||e[32]!==f||e[33]!==c?(X={user:c,contextPrompt:q,preferences:k,rawNavigateToTask:f},e[30]=q,e[31]=k,e[32]=f,e[33]=c,e[34]=X):X=e[34];const b=X;let E;e[35]!==o||e[36]!==b?(E=Me.jsx(es,{children:Me.jsx(xt.Provider,{value:b,children:o})}),e[35]=o,e[36]=b,e[37]=E):E=e[37];let L;return e[38]!==E||e[39]!==se?(L=Me.jsx(et.Provider,{value:se,children:E}),e[38]=E,e[39]=se,e[40]=L):L=e[40],L}function Cs({taskId:t,children:e}){const n=De(),s=Ht(),{virtualMcpId:o,activeTask:a,currentBranch:l}=ts(),c=Nt({isDesktopApp:s,harnessId:a?.harness_id,sandboxProviderKind:a?.sandbox_provider_kind}),h=n("chat.input.codingAgentRequiresDesktop");t&&!lt.has(t)&&(lt.add(t),_t("chat_opened",{thread_id:t}));const{imageModel:m,webSearchModel:f,deepResearchModel:k,chatMode:M,setChatMode:p,appContexts:A,setTiptapDoc:F,simpleModeTier:q}=ns(),x=v.useContext(xt);if(!x)throw new Error(n("chat.chatContext.activeTaskProviderMissingContext"));const{user:T,contextPrompt:j,preferences:W,rawNavigateToTask:V}=x,{org:_,locator:G}=ee(),$=Hn(),[te,H]=v.useState(null),B=()=>{H(new Error(h))},ne=Tn(),K=Be(),z=Ft(),se=ut(),X=Kt({connectionId:Qt,orgId:_.id,orgSlug:_.slug}),b=qt(_.slug,t,{client:X,batch:jt(a?.harness_id)});v.use(b.ready);const E=fe(b.messages),L=fe(b.status),P=fe(b.finishReason),Q=fe(b.runStatusStage),pe=fe(b.hasMoreOlder),Z=fe(b.isFetchingOlder),N=v.useRef({onToolCall:ne,queryClient:K,rawNavigateToTask:V,taskId:t,manager:z,navigate:se,orgId:_.id,orgSlug:_.slug});N.current={onToolCall:ne,queryClient:K,rawNavigateToTask:V,taskId:t,manager:z,navigate:se,orgId:_.id,orgSlug:_.slug},Zt({orgSlug:_.slug,taskId:t,onTaskStatus:d=>{const u=N.current,D=d.data.message_id;if(d.data.status==="in_progress"&&D){Ve(u.taskId,D);const U=Vn(u.taskId,D);U&&b.applyLocalMessage(U),ae(u.orgSlug,u.taskId)}Nn(u.taskId)&&(async()=>(await ae(u.orgSlug,u.taskId),await b.reconcileFromServer()&&Ae(u.taskId).get().length===0&&Fn(u.taskId)))()}}),v.useEffect(()=>{const d={onData:y=>{if(y.type==="data-thread-title"){const w=y.data;if(!w?.title)return;const r=N.current;if(!r.taskId)return;r.manager.patchThread({id:r.taskId,title:w.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const w=y.data;if(!w?.path)return;const r=w.path,g=N.current;g.queryClient.invalidateQueries({queryKey:de.orgFsStat(g.orgId,"home",r)}),g.queryClient.invalidateQueries({queryKey:de.orgFsRecent(g.orgId)}),g.navigate({to:".",search:O=>({...O,main:Ut(r)}),replace:!0});return}if(y.type==="data-open-preview"){const w=y.data,r=N.current,g=r.taskId;if(g){const O=r.manager.threads.get().find(R=>R.id===g);r.manager.patchThread({id:g,...w?.branch?{branch:w.branch}:{},...w?.sandboxProviderKind?{sandbox_provider_kind:w.sandboxProviderKind}:{},metadata:{...O?.metadata??{},...w?.githubRepo?{githubRepo:w.githubRepo}:{},...w?.sandboxMap?{sandboxMap:w.sandboxMap}:{}}})}r.navigate({to:".",search:O=>({...O,main:"preview"}),replace:!0});return}},onFinish:(y,w,r)=>{const g=N.current;g.taskId&&ae(g.orgSlug,g.taskId),g.taskId&&g.manager.patchThread({id:g.taskId,status:fn(r,y.parts),updated_at:new Date().toISOString()});const O=y.parts?.some(I=>{const me=I;return(me.type==="tool-share_with_user"||me.type==="tool-bash"||me.type==="tool-write")&&me.state==="output-available"});if(g.taskId&&O){const I=de.threadOutputs(g.taskId);for(const me of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{g.queryClient.invalidateQueries({queryKey:I})},me)}g.queryClient.invalidateQueries({queryKey:de.homeNextActions(g.orgSlug)});const R=y.metadata?.thread_id;R&&R!==g.taskId&&g.rawNavigateToTask(R)},onError:y=>{H(y),console.error("[chat] Error",y)},onToolCall:y=>N.current.onToolCall(y)};b.observer=d,ae(N.current.orgSlug,N.current.taskId);const u=y=>y==="submitted"||y==="streaming";let D=u(b.status.get().kind);const U=b.status.subscribe(()=>{const y=u(b.status.get().kind);if(y===D)return;D=y;const w=N.current;ae(w.orgSlug,w.taskId)});return()=>{b.observer===d&&(b.observer=null),U()}},[b]);const Se=L.kind==="submitted"||L.kind==="streaming",Ue=E.length===0,Oe=E.at(-1),Le=!Se&&Oe?.role==="assistant"&&Oe.parts.some(d=>"state"in d&&d.state==="approval-requested"),Pe=a,ke=(Pe?.status==="in_progress"||Pe?.status==="expired")&&L.kind==="ready"&&E.length>0;async function _e(d){const u=t,D=o;if(c)return B(),oe.delete(u),!1;const U=Object.entries(A),y=U.length>0?U.map(([R,I])=>`### App Context: ${R}
31
- ${I}`).join(`
32
-
33
- `):"",w=[j,y].filter(Boolean).join(`
34
-
35
- `);let r=M;r==="gen-image"&&!m&&(r="default"),r==="web-search"&&!f&&(r="default"),r==="deep-research"&&!k&&(r="default"),(r==="web-search"||r==="deep-research")&&p("default");const g=yn({thread:a?{harness_id:a.harness_id??null,sandbox_provider_kind:a.sandbox_provider_kind??null,branch:a.branch??null}:null,globals:{branch:l}});a?.harness_id||z.patchThread({id:u,harness_id:g.harnessId??"decopilot",updated_at:new Date().toISOString()});const O={tier:q,mode:r,toolApprovalLevel:W.toolApprovalLevel??Pt(),system:w||void 0,agent:{id:D},thread_id:u,...g};try{if(Se||ke){let R=!0;try{jn(u,d),await b.enqueue(d,O),kt(u,{workflowId:`thread-run:${u}:${d.id}`,messageId:d.id,text:En(d.parts),hasAttachments:d.parts.some(I=>I.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Ln(u)}catch(I){R=!1,rt(u,d.id),Ve(u,d.id),H(I instanceof Error?I:new Error(String(I))),ce.error(I instanceof Error?I.message:n("chat.chatContext.failedToQueueMessage"))}return ae(_.slug,u),R}return await b.submit({kind:"message",message:d},O),!0}finally{oe.delete(u)}}async function re(d){const u=d.parts??St(d.tiptapDoc);if(u.length===0||oe.has(t))return;oe.add(t),H(null),F(void 0);const D={tiptapDoc:d.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:T?.image??void 0,name:T?.name??"you"}},U={id:crypto.randomUUID(),role:"user",parts:u,metadata:D};await _e(U)}async function Ne(d,u){if(c)return B(),!1;if(oe.has(t))return ce.info(n("chat.chatContext.stillSendingPreviousMessage")),!1;if(oe.add(t),!await $.cancel(t,d))return oe.delete(t),ce.error(n("chat.chatContext.couldNotRemoveOriginalMessage")),!1;rt(t,d),b.removeLocalMessage(d);const U={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:T?.image??void 0,name:T?.name??"you"}}};try{return await _e(U)}catch(y){return ce.error(y instanceof Error?y.message:n("chat.chatContext.failedToSendEditedMessage")),!1}}const Fe=async()=>{b.stop();try{const d=await fetch(`/api/${_.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(d.status===404)return;if(!d.ok){const u=await d.json().catch(()=>({}));throw new Error(u.message??n("chat.chatContext.cancelFailedStatus",{status:d.status}))}}catch(d){const u=d instanceof Error?d.message:n("chat.chatContext.failedToCancel");ce.error(u),console.error("[chat] cancelRun",d)}},Y=d=>d&&typeof d=="object"&&"type"in d?re({tiptapDoc:d}):re(d),he=He({strict:!1}).autosend===pt;v.useEffect(()=>{if(!he||E.length>0||c)return;const d=Dt(sessionStorage,G,t);d&&re(d.message).then(()=>{$t(sessionStorage,G,t)})},[he,E.length,c,G,t,re]);const Re={messages:E,status:Zn(L),sendMessage:Y,editQueuedMessage:Ne,stop:()=>{if(c){B();return}Fe()},submit:async(d,u)=>{if(c){B();return}await b.submit(d,u)},removeLocalMessage:d=>b.removeLocalMessage(d),isSendInFlight:()=>oe.has(t),error:te,clearError:()=>H(null),finishReason:P,runStatusStage:Q,clearFinishReason:()=>b.finishReason.set(null),isStreaming:Se,isChatEmpty:Ue,isWaitingForApprovals:Le??!1,isRunInProgress:ke,hasMoreOlder:pe,isFetchingOlder:Z,fetchOlderMessages:b.fetchOlderMessages.bind(b)};return Me.jsx(Je.Provider,{value:Re,children:e})}function As(){const t=De(),e=v.useContext(Je);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function Ps(){return v.useContext(Je)}function ts(){const t=De(),e=v.useContext(et);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function ns(){const t=De(),e=v.useContext(tt);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function _s(){return v.useContext(tt)}function ss(){return v.useContext(et)}export{Cs as A,vt as B,es as C,_s as D,on as E,vn as H,rn as S,bs as V,As as a,ts as b,Is as c,Hn as d,rt as e,Ee as f,Kn as g,Ms as h,Wn as i,Ps as j,ss as k,Ts as l,xs as m,ms as n,St as o,fs as p,xn as q,wn as r,ws as s,ks as t,ns as u,ys as v,gs as w,vs as x,yt as y,Ss as z};
@@ -1 +0,0 @@
1
- import{c as k,j as t,B as K,k as oe,Y as Ze,Z as re,b as Q,E as Ee,r as E,F as fe,bc as Ge,bd as Oe,$ as Xe,m as W,be as et,u as tt,L as te,t as st,f as he,b3 as Re}from"./index-geMXTkeP.js";import{E as Fe}from"./empty-state-BkAQUfnz.js";import{u as ge}from"./use-mcp-client-BBl5zme6.js";import{F as ae,a as lt,b as ce,d as de}from"./form-Cy7Rd3TL.js";import{I as pe}from"./input-i4x2nRXJ.js";import{T as xe}from"./textarea-Bn6hQ_Qz.js";import{a as ot,b as nt,V as je,O as it,M as rt}from"./index-DW2rv6fU.js";import{aK as at,V as ct,aL as dt,a1 as mt,ad as ut,aM as pt,a6 as ye}from"./agent-icon-CQRHN6rX.js";import{g as xt,M as ft,a as we}from"./index-SVAVudgF.js";import{A as ht,a as gt,b as jt}from"./alert-Ig9SrjcF.js";import{S as Ce,a as Ie,b as $e,c as Te,d as me}from"./select-D6zOoh5E.js";import{b as bt,c as Pe,T as ke,a as Ae}from"./tooltip-BrF3GD_a.js";import{i as Nt}from"./AlertCircle-BGrbeDYT.js";import{s as vt}from"./Stars02-CF9PavPD.js";import{a as St}from"./Copy01-Bnz3Wx80.js";import{i as yt}from"./Play-C6pKirQG.js";import{i as wt}from"./ChevronRight-BamDO5gK.js";import{g as Ct}from"./connection-slug-eyAPH6o3.js";import{u as It,T as $t}from"./index-DnUHHdy9.js";import{a as Me,u as ze}from"./use-connection-B7cDwiOJ.js";import{a as Tt}from"./use-mcp-tools-BKtLcTYP.js";import{M as Pt,c as kt}from"./monaco-editor-DNmyyJIn.js";import{I as De}from"./integration-icon-G3CkJMl-.js";import{j as At,D as Dt}from"./chat-context-Duovvv_d.js";import{u as Et}from"./shell-layout-D82GP0rP.js";import{a as Ot}from"./Tool02-df-j-2i7.js";import"./auth-av09Sk0f.js";import"./label-cSCv6rYO.js";import"./index-B1Swgh1Q.js";import"./sidebar-cviY2JKt.js";import"./LayoutLeft-NGYALHZo.js";import"./use-mobile-DMoYecwn.js";import"./X-D0lgdZFx.js";import"./Key01-C21diL-t.js";import"./extract-connection-data-D8g8Vhah.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-BoF5es5w.js";import"./use-organization-settings-DhcL4nY9.js";import"./studio-tools-DH0-34Hv.js";import"./Plus-3NJoZ-Rn.js";import"./index-BZsTAPza.js";import"./popover-i4jezHIh.js";import"./use-virtual-mcp-CEV_ngrf.js";import"./Check-DpoXXYhc.js";import"./SearchMd-DZC0VFyz.js";import"./Users03-Cwqfteu1.js";import"./use-create-virtual-mcp-DcGH_7kD.js";import"./use-navigate-to-agent-ABFR-14c.js";import"./hooks-BYQbPRxe.js";import"./decopilot-sse-pool-CsSaGM07.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-BjfDVrJb.js";import"./ArrowUp-B7rh6W_b.js";import"./Settings02-K87UDDa_.js";import"./XCircle-BEfRA2Fy.js";import"./ArrowUpRight-An4hbib7.js";import"./TrendUp01-Bj5u2ghc.js";import"./ZapSquare-2syNvY2F.js";import"./CheckCircle-DI16N69_.js";import"./ChevronDown-BbcA24KM.js";import"./ChevronUp-HIfNhOKS.js";import"./DotsVertical-B_iya6B7.js";import"./CpuChip01-BShcbCHO.js";import"./CreditCard01-DNJmFfow.js";import"./Eye-BjhopnZD.js";import"./FilterLines-H3se16dF.js";import"./Star01-BWcFSKod.js";import"./Palette-DqKGGY7c.js";import"./SwitchHorizontal01-Boo6w6_t.js";import"./HardDrive-Cc0iy42M.js";import"./LinkExternal01-BIYwVSjD.js";import"./LogOut01-BYbHv1g4.js";import"./Monitor01-PnI4BWSm.js";import"./Sun-D_TMYzXg.js";import"./SearchLg-DUoOTY_-.js";import"./Shield01-Dif9NKxP.js";import"./Stars01-DNjCGctC.js";import"./Trash01-BfrFYc0O.js";import"./Upload01-DGoH2Bw8.js";import"./User01-PHqRfaY2.js";import"./Users01-CeRMXGJo.js";import"./XClose-Ca9PFBA7.js";import"./Zap-Cd4akcPN.js";import"./badge-1BKF0WjP.js";import"./mcp-oauth-Dv6Uhpr5.js";import"./spinner-CkuCAiR1.js";import"./tab-id-VDxePu-8.js";import"./dialog-DFfWjXhn.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CaSDpPjb.js";import"./use-decopilot-events-up5oIRDt.js";import"./avatar-I17szs3Q.js";import"./required-auth-layout-S0YtLBA5.js";import"./use-org-sso-BVhPMS3K.js";function Rt(s){const e=k.c(15),{onSave:n,onUndo:l,isDirty:o,isSaving:i,saveLabel:r,undoLabel:c}=s,d=r===void 0?"Save":r,a=c===void 0?"Undo":c;if(!o)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(at,{size:14}),e[0]=x):x=e[0];let h;e[1]!==i||e[2]!==l||e[3]!==a?(h=t.jsxs(K,{variant:"outline",size:"sm",onClick:l,disabled:i,"aria-label":a,children:[x,a]}),e[1]=i,e[2]=l,e[3]=a,e[4]=h):h=e[4];let m;e[5]!==i?(m=i?t.jsx(oe,{size:14,className:"animate-spin"}):t.jsx(ct,{size:14}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==n||e[9]!==d||e[10]!==m?(f=t.jsxs(K,{variant:"default",size:"sm",onClick:n,disabled:i,"aria-label":d,children:[m,d]}),e[7]=i,e[8]=n,e[9]=d,e[10]=m,e[11]=f):f=e[11];let p;return e[12]!==h||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[h,f]}),e[12]=h,e[13]=f,e[14]=p):p=e[14],p}Ze({title:re().min(1),description:re().nullable(),body:re()});function ue(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ft(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(l=>l==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Mt(s){const e=k.c(43),{form:n}=s,l=Q();let o;e[0]!==l?(o=l("details.prompt.details"),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==o?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==l?(r=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.title")}),t.jsx(de,{children:t.jsx(pe,{...N,placeholder:l("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=l,e[5]=r):r=e[5];let c;e[6]!==n.control||e[7]!==r?(c=t.jsx(ae,{control:n.control,name:"title",render:r}),e[6]=n.control,e[7]=r,e[8]=c):c=e[8];let d;e[9]!==l?(d=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.description")}),t.jsx(de,{children:t.jsx(pe,{...N,value:N.value??"",placeholder:l("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=l,e[10]=d):d=e[10];let a;e[11]!==n.control||e[12]!==d?(a=t.jsx(ae,{control:n.control,name:"description",render:d}),e[11]=n.control,e[12]=d,e[13]=a):a=e[13];let x;e[14]!==c||e[15]!==a?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c,a]}),e[14]=c,e[15]=a,e[16]=x):x=e[16];let h;e[17]!==i||e[18]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-4",children:[i,x]}),e[17]=i,e[18]=x,e[19]=h):h=e[19];let m;e[20]!==l?(m=l("details.prompt.message"),e[20]=l,e[21]=m):m=e[21];let f;e[22]!==m?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:m}),e[22]=m,e[23]=f):f=e[23];let p;e[24]!==l?(p=l("details.prompt.messageDescription"),e[24]=l,e[25]=p):p=e[25];let g;e[26]!==p?(g=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=g):g=e[27];let b;e[28]!==l?(b=w=>{const{field:N}=w;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(xe,{...N,value:N.value??"",placeholder:l("details.prompt.bodyPlaceholder"),className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})},e[28]=l,e[29]=b):b=e[29];let S;e[30]!==n.control||e[31]!==b?(S=t.jsx(ae,{control:n.control,name:"body",render:b}),e[30]=n.control,e[31]=b,e[32]=S):S=e[32];let T;e[33]!==f||e[34]!==g||e[35]!==S?(T=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,g,S]}),e[33]=f,e[34]=g,e[35]=S,e[36]=T):T=e[36];let y;e[37]!==T||e[38]!==h?(y=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[h,T]}),e[37]=T,e[38]=h,e[39]=y):y=e[39];let P;return e[40]!==n||e[41]!==y?(P=t.jsx(lt,{...n,children:y}),e[40]=n,e[41]=y,e[42]=P):P=e[42],P}function zt(s){const e=k.c(42),{providerId:n,promptId:l}=s,o=Q(),{org:i}=fe(),r=n||null;let c;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(c={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=c):c=e[3];const d=ge(c),a=Ge(n,"PROMPT",l,d),x=Oe(n,"PROMPT",d),h=x.update.isPending;let m;e[4]!==a?(m=a?{title:a.title,description:a.description??null,body:ue(a)}:void 0,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==m?(f={values:m},e[6]=m,e[7]=f):f=e[7];const p=Xe(f);let g;e[8]!==p||e[9]!==a?(g=()=>{a&&p.reset({title:a.title,description:a.description??null,body:ue(a)})},e[8]=p,e[9]=a,e[10]=g):g=e[10];const b=g;let S;e[11]!==x.update||e[12]!==p||e[13]!==l?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:l,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:ue(I)})}),e[11]=x.update,e[12]=p,e[13]=l,e[14]=S):S=e[14];const T=S;if(!a){let C;e[15]!==o?(C=o("details.prompt.notFoundTitle"),e[15]=o,e[16]=C):C=e[16];let I;e[17]!==o?(I=o("details.prompt.notFoundDescription"),e[17]=o,e[18]=I):I=e[18];let R;return e[19]!==C||e[20]!==I?(R=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=R):R=e[21],R}let y;e[22]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[22]=a.title,e[23]=y):y=e[23];let P;e[24]!==a.description?(P=a.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[24]=a.description,e[25]=P):P=e[25];let w;e[26]!==y||e[27]!==P?(w=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[26]=y,e[27]=P,e[28]=w):w=e[28];let N;e[29]!==T?(N=()=>{T()},e[29]=T,e[30]=N):N=e[30];let A;e[31]!==p.formState.isDirty||e[32]!==h||e[33]!==b||e[34]!==N?(A=t.jsx(ot,{children:t.jsx(Rt,{onSave:N,onUndo:b,isDirty:p.formState.isDirty,isSaving:h})}),e[31]=p.formState.isDirty,e[32]=h,e[33]=b,e[34]=N,e[35]=A):A=e[35];let D;e[36]!==p?(D=t.jsx("div",{className:"h-full",children:t.jsx(Mt,{form:p})}),e[36]=p,e[37]=D):D=e[37];let O;return e[38]!==A||e[39]!==D||e[40]!==w?(O=t.jsxs(je,{children:[w,A,D]}),e[38]=A,e[39]=D,e[40]=w,e[41]=O):O=e[41],O}function Lt(s){const e=k.c(10),{itemId:n}=s,l=Q();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ft(),e[0]=o):o=e[0];const i=o;if(!i){let c;e[1]!==l?(c=l("details.prompt.notFoundTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==l?(d=l("details.prompt.missingConnectionDescription"),e[3]=l,e[4]=d):d=e[4];let a;return e[5]!==c||e[6]!==d?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:c,description:d})}),e[5]=c,e[6]=d,e[7]=a):a=e[7],a}let r;return e[8]!==n?(r=t.jsx(Ee,{children:t.jsx(E.Suspense,{fallback:null,children:t.jsx(zt,{providerId:i,promptId:n})})}),e[8]=n,e[9]=r):r=e[9],r}function Le(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=W("min-w-0 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function Be(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=W("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function Z(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=W("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function se(s){const e=k.c(10);let n,l,o;e[0]!==s?({asChild:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);const i=n?et:"a";let r;e[4]!==l?(r=W("hover:text-foreground transition-colors truncate",l),e[4]=l,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==o||e[8]!==r?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:r,...o}),e[6]=i,e[7]=o,e[8]=r,e[9]=c):c=e[9],c}function Ue(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=W("text-foreground font-medium truncate",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function le(s){const e=k.c(12);let n,l,o;e[0]!==s?({children:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);let i;e[4]!==l?(i=W("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",l),e[4]=l,e[5]=i):i=e[5];let r;e[6]!==n?(r=n??t.jsx(wt,{}),e[6]=n,e[7]=r):r=e[7];let c;return e[8]!==o||e[9]!==i||e[10]!==r?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...o,children:r}),e[8]=o,e[9]=i,e[10]=r,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=k.c(12),{toolName:n,connectionId:l,siblings:o,onSelectInstance:i,onBack:r}=s,c=Q();let d;e[0]!==l?(d={connectionId:l},e[0]=l,e[1]=d):d=e[1];const a=It(d);if(!a.isAuthenticated){let m;return e[2]!==a.supportsOAuth||e[3]!==r||e[4]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(it,{onAuthenticate:()=>r(),buttonText:c("details.tool.goBackToAuthenticate")}):t.jsx(rt,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=r,e[4]=c,e[5]=m):m=e[5],m}const x=`${l}:${n}`;let h;return e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==x||e[10]!==n?(h=t.jsx(Vt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:i},x),e[6]=l,e[7]=i,e[8]=o,e[9]=x,e[10]=n,e[11]=h):h=e[11],h}function Vt({toolName:s,connectionId:e,siblings:n,onSelectInstance:l}){const o=Q(),{replayId:i}=tt({strict:!1}),r=(()=>{if(!i)return null;const u=`replay-${i}`,j=sessionStorage.getItem(u);if(!j)return null;sessionStorage.removeItem(u);try{return JSON.parse(j)}catch{return null}})(),c=(()=>{if(!r)return null;const u={};for(const[j,$]of Object.entries(r))$!==null&&typeof $=="object"?u[j]=JSON.stringify($,null,2):u[j]=$;return u})(),[d,a]=E.useState(c??{}),[x,h]=E.useState(r?JSON.stringify(r,null,2):"{}"),[m,f]=E.useState(null),[p,g]=E.useState(null),[b,S]=E.useState(null),[T,y]=E.useState(null),[P,w]=E.useState(!1),[N,A]=E.useState(null),{org:D}=fe(),O=Me(e),C=At(),I=Dt(),{openSidePanel:R}=Et(),U=`${e}:${s}`,M=ge({connectionId:e,orgId:D.id,orgSlug:D.slug}),V=Tt({client:M}),v=V.data?.tools?.find(u=>u.name===s),F=xt(v?._meta),J=u=>{if(!C)return;const j=kt(u.content);j.content.length>0&&(R("chat"),C.sendMessage({tiptapDoc:j}))},[z,L]=E.useState("json"),[q,Y]=E.useState(!1);F&&!q&&(L("ui"),Y(!0));const _=v?.inputSchema?.properties,be=_?Object.keys(_):[],G=be.length>0,X={};if(G&&v?.inputSchema?.properties)for(const u of be)X[u]=v.inputSchema.required?.includes(u)?"":void 0;const ne=u=>Object.prototype.hasOwnProperty.call(d,u),Ve=async()=>{w(!0),y(null),f(null),g(null),S(null),A(null);const u=performance.now();try{if(!M)throw new Error("MCP client is not available");const j=G?{...X,...d}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();G&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof j[B]=="string")try{j[B]=JSON.parse(j[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof j[B]=="string"&&j[B]!==""){const Se=Number(j[B]);Number.isNaN(Se)||(j[B]=Se)}});const $=await M.callTool({name:s,arguments:j}),ee=$.structuredContent??$,We=performance.now(),Qe=Math.round(We-u);f(ee),g($),S(j);const Ye=JSON.stringify(ee),ve=new TextEncoder().encode(Ye).length;A({duration:`${Qe}ms`,bytes:`${ve} bytes`,tokens:`~${Math.ceil(ve/4)} tokens`,cost:"$0.0000"})}catch(j){const $=j instanceof Error?j.message:String(j);y($||"Unknown error occurred");const ee=performance.now();A({duration:`${Math.round(ee-u)}ms`})}finally{w(!1)}},ie=(u,j)=>{a($=>({...$,[u]:j}))},_e=()=>{f(null),g(null),S(null),y(null),A(null)},Je=v?.name??Bt(s),qe=t.jsx(Le,{children:t.jsxs(Be,{children:[t.jsx(Z,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:D.slug},children:o("details.tool.connections")})})}),t.jsx(le,{}),O&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:D.slug,appSlug:Ct(O)},search:{tab:"tools"},children:O.title})})}),t.jsx(le,{})]}),t.jsx(Z,{children:t.jsx(Ue,{children:Je})})]})}),Ne=n.length>1&&t.jsxs(Ce,{value:e,onValueChange:l,children:[t.jsx(Ie,{className:"h-8 w-auto min-w-[200px]",children:t.jsx($e,{})}),t.jsx(Te,{children:n.map(u=>t.jsx(me,{value:u.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(De,{icon:u.icon,name:u.title,size:"xs",className:"shrink-0"}),u.title]})},u.id))})]}),He=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:o("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",o("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:G&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([u,j])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[u,v.inputSchema?.required?.includes(u)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:j.type})]}),j.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.description}),j.type==="object"||j.type==="array"?t.jsx(xe,{className:"font-mono text-xs",value:ne(u)?d[u]??"":X[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enterAsJson",{key:u}),rows:3}):j.type==="boolean"?t.jsxs(Ce,{value:ne(u)?String(d[u]??""):"",onValueChange:$=>ie(u,$==="true"),children:[t.jsx(Ie,{children:t.jsx($e,{placeholder:o("details.tool.selectTrueOrFalse")})}),t.jsxs(Te,{children:[t.jsx(me,{value:"true",children:"true"}),t.jsx(me,{value:"false",children:"false"})]})]}):t.jsx(pe,{value:ne(u)?d[u]??"":X[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enter",{key:u})})]},u)):v?.inputSchema&&!G?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:o("details.tool.rawJsonInput")}),t.jsx(xe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:u=>h(u.target.value),placeholder:o("details.tool.rawJsonExample")})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:P?t.jsxs(K,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:_e,children:[t.jsx(dt,{className:"h-3.5 w-3.5"}),o("details.tool.cancel")]}):t.jsxs(K,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(yt,{className:"h-3.5 w-3.5 fill-current"}),o("details.tool.executeTool")]})})]}),Ke=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:o("details.tool.result")}),t.jsxs("div",{className:"flex items-center gap-3",children:[N&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(vt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.duration})]}),N.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(mt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.tokens})]}),N.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.bytes})]}),N.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:N.cost})})]}),F&&t.jsx(bt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Pe,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(K,{size:"icon",variant:z==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("ui"),children:t.jsx(pt,{size:14})})}),t.jsx(Ae,{children:o("details.tool.interactiveView")})]}),t.jsxs(Pe,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(K,{size:"icon",variant:z==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("json"),children:t.jsx(ye,{size:14})})}),t.jsx(Ae,{children:o("details.tool.jsonView")})]})]})})]})]}),T&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ht,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Nt,{className:"h-4 w-4"}),t.jsx(gt,{className:"mb-0",children:o("details.tool.executionFailed")})]}),t.jsx(jt,{className:"text-xs text-destructive",children:T})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:F&&z==="ui"&&M?t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:o("details.tool.loadingApp")})]})}),children:t.jsx(ft,{resourceURI:F,toolInfo:v?{tool:v}:void 0,toolInput:b??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:we.view.minHeight,maxHeight:we.view.maxHeight,client:M,onMessage:J,onUpdateModelContext:u=>I?.setAppContext(U,u),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(K,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),st.success(o("details.tool.copiedToClipboard"))},children:t.jsx(St,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(ye,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:o("details.tool.runToolToSeeResults")})]})})]});return t.jsx(je,{breadcrumb:qe,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(De,{icon:O?.icon||null,name:O?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(oe,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx($t,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:Ne})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),n.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:o("details.tool.instance")}),Ne]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:He}),Ke]})})]})})}function _t(s){const e=k.c(20),{itemId:n,siblings:l,onBack:o}=s,i=Q(),[r,c]=E.useState(l[0]?.id??"");let d;e[0]!==r||e[1]!==l?(d=l.find(f=>f.id===r)?.id??l[0]?.id??"",e[0]=r,e[1]=l,e[2]=d):d=e[2];const a=d;if(!Me(a||void 0)||!a){let f;e[3]!==i?(f=i("details.tool.connectionNotFound"),e[3]=i,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let g;e[7]!==i?(g=i("details.tool.connectionNotFoundMessage"),e[7]=i,e[8]=g):g=e[8];let b;e[9]!==g?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[9]=g,e[10]=b):b=e[10];let S;return e[11]!==p||e[12]!==b?(S=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p,b]})}),e[11]=p,e[12]=b,e[13]=S):S=e[13],S}let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[14]=h):h=e[14];let m;return e[15]!==a||e[16]!==o||e[17]!==l||e[18]!==n?(m=t.jsx(E.Suspense,{fallback:h,children:t.jsx(Ut,{toolName:n,connectionId:a,siblings:l,onSelectInstance:c,onBack:o})}),e[15]=a,e[16]=o,e[17]=l,e[18]=n,e[19]=m):m=e[19],m}function Jt(s){const e=k.c(21),{icon:n,illustration:l,title:o,description:i,buttonProps:r,buttonComponent:c,className:d,children:a}=s;let x;e[0]!==d?(x=W("flex flex-col items-center justify-center py-16 text-center",d),e[0]=d,e[1]=x):x=e[1];let h;e[2]!==n||e[3]!==l?(h=l?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:l}):n?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:n}):null,e[2]=n,e[3]=l,e[4]=h):h=e[4];let m;e[5]!==o?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==c||e[13]!==r?(g=(c??r)&&t.jsx("div",{className:"mt-4",children:c??(r&&t.jsx(K,{size:"sm",className:W(r?.className),...r}))}),e[12]=c,e[13]=r,e[14]=g):g=e[14];let b;return e[15]!==a||e[16]!==x||e[17]!==h||e[18]!==p||e[19]!==g?(b=t.jsxs("div",{className:x,children:[h,p,g,a]}),e[15]=a,e[16]=x,e[17]=h,e[18]=p,e[19]=g,e[20]=b):b=e[20],b}const qt={prompt:Lt};function Ht(){const s=k.c(9),e=Re();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=decodeURIComponent(l.itemId);let i;s[1]!==l.appSlug?(i={slug:l.appSlug},s[1]=l.appSlug,s[2]=i):i=s[2];const r=ze(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const d=c,a=Kt;let x;return s[5]!==d||s[6]!==o||s[7]!==r?(x=t.jsx(_t,{itemId:o,siblings:r,onBack:d,onUpdate:a}),s[5]=d,s[6]=o,s[7]=r,s[8]=x):x=s[8],x}async function Kt(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=k.c(52),e=Re();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=Q(),i=decodeURIComponent(l.collectionName),r=decodeURIComponent(l.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:a}=fe();let x;s[3]!==l.appSlug?(x={slug:l.appSlug},s[3]=l.appSlug,s[4]=x):x=s[4];const m=ze(x)[0]??null,f=m?.id??"",p=f||"no-connection",g=f??null;let b;s[5]!==a.id||s[6]!==a.slug||s[7]!==g?(b={connectionId:g,orgId:a.id,orgSlug:a.slug},s[5]=a.id,s[6]=a.slug,s[7]=g,s[8]=b):b=s[8];const S=ge(b),T=Oe(p,i,S);let y;s[9]!==T||s[10]!==r?(y=async _=>{r&&await T.update.mutateAsync({id:r,data:_})},s[9]=T,s[10]=r,s[11]=y):y=s[11];const P=y;let w;s[12]!==i?(w=i?.toLowerCase(),s[12]=i,s[13]=w):w=s[13];const N=w,A=N&&qt[N];let D;s[14]!==i?(D=Wt(i),s[14]=i,s[15]=D):D=s[15];const O=D;let C;s[16]!==a.slug?(C=t.jsx(Z,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[16]=a.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(le,{}),s[18]=I):I=s[18];let R;s[19]!==i||s[20]!==m||s[21]!==a.slug||s[22]!==l.appSlug?(R=m&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:l.appSlug},search:{tab:i},children:m.title})})}),t.jsx(le,{})]}),s[19]=i,s[20]=m,s[21]=a.slug,s[22]=l.appSlug,s[23]=R):R=s[23];let U;s[24]!==O?(U=t.jsx(Z,{children:t.jsx(Ue,{children:O})}),s[24]=O,s[25]=U):U=s[25];let M;s[26]!==R||s[27]!==U||s[28]!==C?(M=t.jsx(Le,{children:t.jsxs(Be,{children:[C,I,R,U]})}),s[26]=R,s[27]=U,s[28]=C,s[29]=M):M=s[29];const V=M;if(A){let _;return s[30]!==A||s[31]!==d||s[32]!==P||s[33]!==r?(_=t.jsx(A,{itemId:r,onBack:d,onUpdate:P}),s[30]=A,s[31]=d,s[32]=P,s[33]=r,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ot,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let F;s[36]!==o?(F=o("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=o,s[37]=F):F=s[37];let J;s[38]!==o?(J=o("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=o,s[39]=J):J=s[39];let z;s[40]!==o?(z=o("orgs.collectionDetail.goBackButton"),s[40]=o,s[41]=z):z=s[41];let L;s[42]!==d||s[43]!==z?(L={onClick:d,children:z},s[42]=d,s[43]=z,s[44]=L):L=s[44];let q;s[45]!==F||s[46]!==J||s[47]!==L?(q=t.jsx(Jt,{icon:v,title:F,description:J,buttonProps:L}),s[45]=F,s[46]=J,s[47]=L,s[48]=q):q=s[48];let Y;return s[49]!==V||s[50]!==q?(Y=t.jsx(je,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=Y):Y=s[51],Y}function Yt(){const s=k.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const n=he(e);if(decodeURIComponent(n.collectionName)==="tools"){let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ht,{}),s[1]=r):r=s[1],r}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{}),s[2]=i):i=s[2],i}function Ll(){const s=k.c(7),e=Q();let n;s[0]!==e?(n=e("orgs.collectionDetail.loadingAriaLabel"),s[0]=e,s[1]=n):n=s[1];let l;s[2]!==n?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground","aria-label":n})}),s[2]=n,s[3]=l):l=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Yt,{}),s[4]=o):o=s[4];let i;return s[5]!==l?(i=t.jsx(Ee,{children:t.jsx(E.Suspense,{fallback:l,children:o})}),s[5]=l,s[6]=i):i=s[6],i}export{Ll as default};