decocms 4.417.2 → 4.417.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 (348) hide show
  1. package/dist/client/assets/{AlertCircle-D9i2E7F3.js → AlertCircle-D-RDeHL_.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BMj2qUCa.js → AreaChart-Du9fIZyN.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-u4YtETq6.js → ArrowLeft-DVpME15-.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-C4cldeMa.js → ArrowRight-CSNzIA9B.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B7hrL_y6.js → ArrowUp-BzLrItni.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-Ddk7a6Sg.js → CartesianChart-CWzZG7vp.js} +1 -1
  7. package/dist/client/assets/{Check-DqhJRaRV.js → Check-w1vYw5Rn.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-D8vl4TSp.js → CheckCircle-Do4HhdGQ.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DluVhiDY.js → ChevronUp-BWOObG8Z.js} +1 -1
  10. package/dist/client/assets/{Copy01-B9W9lwCV.js → Copy01-uPL40TdR.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-9sMQt6FN.js → CreditCard01-DaYOLDOz.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Dem42mI9.js → DotsVertical-vTwE8lBm.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-B9bEH1bq.js → ErrorBarContext-DtWLLN0s.js} +1 -1
  14. package/dist/client/assets/{Image01-BWtqkynf.js → Image01-BObY5rn9.js} +1 -1
  15. package/dist/client/assets/{Key01-DZ2hPAde.js → Key01-nM1-kqhR.js} +1 -1
  16. package/dist/client/assets/{Line-DyNxtrof.js → Line-ByBYLmfl.js} +1 -1
  17. package/dist/client/assets/{Link01-p2T3eBYS.js → Link01-BS-vCNzQ.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-IH_7eB5z.js → LinkExternal01-DNLGj9_-.js} +1 -1
  19. package/dist/client/assets/{Monitor01-CMoavpTH.js → Monitor01-Csp3CK4O.js} +1 -1
  20. package/dist/client/assets/{Palette-BOu3DUls.js → Palette-tJixmc7V.js} +1 -1
  21. package/dist/client/assets/{Plus-C8_7wQVY.js → Plus-BvjmhLnx.js} +1 -1
  22. package/dist/client/assets/{SearchMd-DAeSqGzA.js → SearchMd-Btx9xhJc.js} +1 -1
  23. package/dist/client/assets/{Sector-CPZGxSVz.js → Sector-BuEtMqWH.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-CotBP4xM.js → ShoppingBag01-DQq21IAe.js} +1 -1
  25. package/dist/client/assets/{Sun-z_ISlCfq.js → Sun-BxhQc-kG.js} +1 -1
  26. package/dist/client/assets/{Tool01-DqqLglaA.js → Tool01-Booc4u0n.js} +1 -1
  27. package/dist/client/assets/{Trash01-HIeO4K0u.js → Trash01-D0KW49wY.js} +1 -1
  28. package/dist/client/assets/{Upload01-D8px3BRb.js → Upload01-B58Org46.js} +1 -1
  29. package/dist/client/assets/{User01-DPMM5VZN.js → User01-BMX3cjtL.js} +1 -1
  30. package/dist/client/assets/{UserSquare-Di4b5Jsn.js → UserSquare-CaMR-kX2.js} +1 -1
  31. package/dist/client/assets/{Users01-DHetvQx6.js → Users01-Cpn2NFdA.js} +1 -1
  32. package/dist/client/assets/{X-Sz3H1SE9.js → X-GZ5ISsIL.js} +1 -1
  33. package/dist/client/assets/{XAxis-BK59NvEV.js → XAxis-ClV1N0er.js} +1 -1
  34. package/dist/client/assets/{XClose-DCiqvNA0.js → XClose-uQDj2qbC.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-Cb1MSdsR.js → ZoomOut-DRn8fB1h.js} +1 -1
  36. package/dist/client/assets/{access-gate-BaQyXFkA.js → access-gate-BYsqfzIM.js} +1 -1
  37. package/dist/client/assets/{add-connection-dialog-BQ-RcQt0.js → add-connection-dialog-CRBSt35d.js} +1 -1
  38. package/dist/client/assets/{agent-analytics-DTyzg7we.js → agent-analytics-DaefJyfz.js} +1 -1
  39. package/dist/client/assets/agent-app-B3k6lFW4.js +1 -0
  40. package/dist/client/assets/{agent-assets-PjrN6Ztr.js → agent-assets-CueXx4F5.js} +1 -1
  41. package/dist/client/assets/{agent-automation-DyHjSt2B.js → agent-automation-DkBdrrfU.js} +1 -1
  42. package/dist/client/assets/{agent-automations-DLUAvmEb.js → agent-automations-C6RRWwz6.js} +1 -1
  43. package/dist/client/assets/{agent-connect-sources-BUYi51Ts.js → agent-connect-sources-DhDB3N4T.js} +1 -1
  44. package/dist/client/assets/agent-deck-CJsgkjs4.js +1 -0
  45. package/dist/client/assets/{agent-e2e-0UYiHquf.js → agent-e2e-Dp4u7w2g.js} +1 -1
  46. package/dist/client/assets/{agent-experiments-B02lAIE9.js → agent-experiments-DRMTNA2U.js} +1 -1
  47. package/dist/client/assets/{agent-file-BZsgSV9q.js → agent-file-CT66eS5w.js} +1 -1
  48. package/dist/client/assets/{agent-git-sWjMQ5vG.js → agent-git-nSsJj1u6.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-BQWSs8Uh.js → agent-hosting-B6fNoXpD.js} +1 -1
  50. package/dist/client/assets/{agent-icon-D7av-7g5.js → agent-icon-DEau6pQP.js} +1 -1
  51. package/dist/client/assets/agent-library-auzWKmtl.js +1 -0
  52. package/dist/client/assets/agent-library-file-C4Bz5yNQ.js +1 -0
  53. package/dist/client/assets/{agent-monitor-BLaKHBlf.js → agent-monitor-BDRaIywC.js} +1 -1
  54. package/dist/client/assets/{agent-overview-ClQZznKn.js → agent-overview-DFVO6q9A.js} +1 -1
  55. package/dist/client/assets/agent-settings-CFSoK3Dt.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-VXHiUt_U.js → agent-site-editor-BMW5L6IV.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-CvT5A6hL.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-BBxDwQTH.js → agent-site-editor-content-CSCyfyeX.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-Crvr593a.js → agent-site-editor-preview-DKOg_i1D.js} +3 -3
  60. package/dist/client/assets/agent-view-BVit-PUC.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-D8TCMMMQ.js → agent-view-guard-BIe92p9j.js} +1 -1
  62. package/dist/client/assets/{agents-list-rMXE3Q2P.js → agents-list-CSqqNnUO.js} +1 -1
  63. package/dist/client/assets/{ai-providers-B7LxKOjd.js → ai-providers-BFQ1D-GY.js} +1 -1
  64. package/dist/client/assets/{alert-Dz9yDJ1U.js → alert-RMwgFEjl.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-jP-5jm3B.js → alert-dialog-CfArYE_c.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-DEXqPCPM.js → analytics-sections-D-1nlDAW.js} +1 -1
  67. package/dist/client/assets/{api-keys-BmAQFNN3.js → api-keys-Bhmt-cmg.js} +1 -1
  68. package/dist/client/assets/api-keys-DHQBKkcj.js +1 -0
  69. package/dist/client/assets/app-editor-DHGSsQUp.js +1 -0
  70. package/dist/client/assets/{asset-utils-OG8_DRbi.js → asset-utils-Bqr4qIJe.js} +1 -1
  71. package/dist/client/assets/{auth-sg-w8oEV.js → auth-CQNA1z0f.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-BZUatXpB.js → auth-catchall-BxFOppl4.js} +1 -1
  73. package/dist/client/assets/{auth-entry-oZIfzUzD.js → auth-entry-Bbaisicp.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-NT0znxKf.js → auth-split-layout-49oocHo-.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-BSxl3jgh.js → authenticate-and-persist-oauth-BJFQcd7o.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-D2ajEGs1.js → automation-list-row-C0famSR9.js} +1 -1
  77. package/dist/client/assets/{automation-runs-CQbKq2yj.js → automation-runs-BPy4kIqD.js} +1 -1
  78. package/dist/client/assets/{automations-DbRLsvYR.js → automations-BFP3Ke2a.js} +1 -1
  79. package/dist/client/assets/{autosend-D06niWhv.js → autosend-CbvWggSc.js} +1 -1
  80. package/dist/client/assets/{avatar-BSQm92_6.js → avatar-Dc1WJG2B.js} +1 -1
  81. package/dist/client/assets/{badge-UT8CIPlI.js → badge-BdVhPCHH.js} +1 -1
  82. package/dist/client/assets/{block-document-Hjh6XA10.js → block-document-CVYCq_wv.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-BjaFN4Px.js → blocks-preview-workspace-context-DdWA6c6d.js} +1 -1
  84. package/dist/client/assets/{buckets-BmznLg9I.js → buckets-OMAyuLV_.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-eFUmBuqz.js → build-improve-prompt-doc-B8BBh3al.js} +1 -1
  86. package/dist/client/assets/{calendar-C4e0bPx1.js → calendar-B8FWjklL.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-2wQFIn_O.js → capability-load-error-Cq6dc5Ct.js} +1 -1
  88. package/dist/client/assets/{category-editor-Cx2zaVgE.js → category-editor-DxRePoxi.js} +1 -1
  89. package/dist/client/assets/{chart-W13k7qQO.js → chart-BPvWMbLQ.js} +1 -1
  90. package/dist/client/assets/{chat-context-W4FU8MtG.js → chat-context-C7aSqPqa.js} +1 -1
  91. package/dist/client/assets/{chat-draft-C1Z2usHD.js → chat-draft-BVrhHV88.js} +1 -1
  92. package/dist/client/assets/{checkbox-DS24sqZF.js → checkbox-BO8tS4tV.js} +1 -1
  93. package/dist/client/assets/{choose-editor-BzlpNLJL.js → choose-editor-lrXJ4SHf.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-CWTqDckW.js → claim-phase-copy-BvrYBprI.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-D1vqEnS8.js → cli-auth-success-D_cyN7MO.js} +1 -1
  96. package/dist/client/assets/{client-icons-T-kCXcoJ.js → client-icons-CAEha1kZ.js} +1 -1
  97. package/dist/client/assets/{collapsible-DYHztcmQ.js → collapsible-DwKDkmXC.js} +1 -1
  98. package/dist/client/assets/{collection-detail-Cc4M587F.js → collection-detail-DA3LzFXF.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-DsLsxLrY.js → collection-display-button-lO-CMmO5.js} +1 -1
  100. package/dist/client/assets/{collection-search-BKPlHOv5.js → collection-search-GlDfWrQl.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-Bb4Km21W.js → collection-table-wrapper-DusEosLO.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-6aixyobS.js → collection-tabs-YP0c1ElX.js} +1 -1
  103. package/dist/client/assets/{combobox-D0IZx9PH.js → combobox-BQ871r-h.js} +1 -1
  104. package/dist/client/assets/{command-B1IBdA6E.js → command-CyoopJ8K.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section--tMCfhuT.js → companion-mcps-section-C2Vb43e4.js} +1 -1
  106. package/dist/client/assets/{config-SZnQcuyZ.js → config-DZCXJYIW.js} +1 -1
  107. package/dist/client/assets/{connect-layout-BbE8aanc.js → connect-layout-B1jMPAeE.js} +1 -1
  108. package/dist/client/assets/{connect-dMEYAUgD.js → connect-qnqLIzRh.js} +1 -1
  109. package/dist/client/assets/{connection-DJ3l8W0U.js → connection-Rri6yxlM.js} +1 -1
  110. package/dist/client/assets/{connection-card-B7FNddNF.js → connection-card-8TfEtWEH.js} +1 -1
  111. package/dist/client/assets/{connection-detail-CGg2ted5.js → connection-detail-DBirmZxK.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-5EJj7jiQ.js → connection-form-helpers-CWZFrP0F.js} +1 -1
  113. package/dist/client/assets/{connections-CWl7LfNE.js → connections-D3VDo8nr.js} +1 -1
  114. package/dist/client/assets/{context-BfhoJ9bd.js → context-D3uLAblj.js} +1 -1
  115. package/dist/client/assets/{create-organization-dialog-BZt6WazE.js → create-organization-dialog-CndqvoVa.js} +1 -1
  116. package/dist/client/assets/{decopilot-HlYS-QdU.js → decopilot-Ch9InHOw.js} +1 -1
  117. package/dist/client/assets/{dialog-BAdncaXR.js → dialog-xO6pvTgy.js} +1 -1
  118. package/dist/client/assets/{discover-ktg_80Ck.js → discover-Cznqo0l3.js} +1 -1
  119. package/dist/client/assets/{domain-settings-CsIgAKy_.js → domain-settings-rqOBcY7I.js} +1 -1
  120. package/dist/client/assets/{download-app-dialog-DGdj2CNQ.js → download-app-dialog-CkAPyUJk.js} +1 -1
  121. package/dist/client/assets/{drawer-zM2wJmT-.js → drawer-COUS-RMw.js} +1 -1
  122. package/dist/client/assets/{editor-G2b4JEg0.js → editor-BtyNln47.js} +1 -1
  123. package/dist/client/assets/{empty-state-BNUJszzA.js → empty-state-DFwLZdoG.js} +1 -1
  124. package/dist/client/assets/{empty-state-Bgakk4zf.js → empty-state-Ya1bFNQl.js} +1 -1
  125. package/dist/client/assets/{extract-connection-data-PBAB1zbf.js → extract-connection-data-CIQbUcLs.js} +1 -1
  126. package/dist/client/assets/{feature-gate-BfcMsYyO.js → feature-gate-CqOYZzVW.js} +1 -1
  127. package/dist/client/assets/{feature-paywall-BIe070wa.js → feature-paywall-BbGJmd8V.js} +1 -1
  128. package/dist/client/assets/{file-explorer-C1_yY2ss.js → file-explorer-DhprT-fW.js} +1 -1
  129. package/dist/client/assets/{file-preview-BVIQNwsF.js → file-preview-vkQ_3IRk.js} +1 -1
  130. package/dist/client/assets/{file-share-button-B9WbHN-Z.js → file-share-button-KyN_ryLY.js} +1 -1
  131. package/dist/client/assets/{file-type-icon-Bq6mw2Ps.js → file-type-icon-DnOhlq0D.js} +1 -1
  132. package/dist/client/assets/flat-project-BpJyiSII.js +1 -0
  133. package/dist/client/assets/{folder-icon-B3im8_vL.js → folder-icon-OrJJEPYu.js} +1 -1
  134. package/dist/client/assets/{form-CZCyqosr.js → form-DQ9-jmhe.js} +1 -1
  135. package/dist/client/assets/{gateway-client-Ca84PQdv.js → gateway-client-BuRwuqbN.js} +1 -1
  136. package/dist/client/assets/{general-nljSUmbf.js → general-CGXMPZVk.js} +1 -1
  137. package/dist/client/assets/{home-DxVx9rU8.js → home-D_MaaqNX.js} +1 -1
  138. package/dist/client/assets/{index-B8CBDCZ3.js → index-B8nxEgaa.js} +1 -1
  139. package/dist/client/assets/{index-DCedGlDL.js → index-BQaeRUfV.js} +3 -3
  140. package/dist/client/assets/{index-BNMHslbt.js → index-CM1GEUnU.js} +1 -1
  141. package/dist/client/assets/{index-D5telvBY.js → index-CgypgZBb.js} +1 -1
  142. package/dist/client/assets/{index-CyII4Hy-.js → index-Cif-NWVp.js} +2 -2
  143. package/dist/client/assets/{index-sxmoOQpx.js → index-CkLwsc_p.js} +1 -1
  144. package/dist/client/assets/{index-DevjUFnV.js → index-Ct7m_fV2.js} +1 -1
  145. package/dist/client/assets/{index-Oi10_0kD.js → index-CucpNGrt.js} +1 -1
  146. package/dist/client/assets/{index-BsSqoVQb.js → index-D-ZSPXmz.js} +1 -1
  147. package/dist/client/assets/{index-DiWaLypw.js → index-D5o3MLAb.js} +1 -1
  148. package/dist/client/assets/{index-jxGovGZE.js → index-DEVMcvUD.js} +1 -1
  149. package/dist/client/assets/{index-le88JcEE.js → index-DQP_XHzw.js} +1 -1
  150. package/dist/client/assets/{index-CBgMqgGr.js → index-D_S3Goue.js} +1 -1
  151. package/dist/client/assets/{index-P5RrPnBn.js → index-Dh9Stq8K.js} +1 -1
  152. package/dist/client/assets/{index-CJtSyk8L.js → index-DoNiXMF0.js} +1 -1
  153. package/dist/client/assets/{index-redirect-BuwZJMF3.js → index-redirect-Cm2cYJFl.js} +1 -1
  154. package/dist/client/assets/{infiniteQueryObserver-Bho6cXmS.js → infiniteQueryObserver-D0QSVh54.js} +1 -1
  155. package/dist/client/assets/{infra-billing-B-66d0gZ.js → infra-billing-Cb-HjBhK.js} +1 -1
  156. package/dist/client/assets/{input-COz__3we.js → input-D4o2a2Ep.js} +1 -1
  157. package/dist/client/assets/{input-C4S7xqGw.js → input-DbFNrmyy.js} +1 -1
  158. package/dist/client/assets/{input-BBwMBvzR.js → input-yDOZz3Y8.js} +1 -1
  159. package/dist/client/assets/{integration-icon-Dm2HH7L6.js → integration-icon--ugXTzBB.js} +1 -1
  160. package/dist/client/assets/{label-BECnr8LH.js → label-BpW4-JRS.js} +1 -1
  161. package/dist/client/assets/{last-preview-page-Bsty7_ZE.js → last-preview-page-a8RsgdMb.js} +1 -1
  162. package/dist/client/assets/{layout-y_WfIaY_.js → layout-DY7R9ACY.js} +1 -1
  163. package/dist/client/assets/{legacy-agents-deep-Cw98tckT.js → legacy-agents-deep-BclzkLc2.js} +1 -1
  164. package/dist/client/assets/{legacy-main-redirect-BAof5X15.js → legacy-main-redirect-BNn-8HmE.js} +1 -1
  165. package/dist/client/assets/library-B8Gbh-yN.js +1 -0
  166. package/dist/client/assets/{library-tab-DfKpL79j.js → library-tab-BzjBKwRW.js} +1 -1
  167. package/dist/client/assets/{login-DPRT1Su0.js → login-Cq-Mw7Ax.js} +1 -1
  168. package/dist/client/assets/{markdown-Due1h4mi.js → markdown-C6J9WB-u.js} +1 -1
  169. package/dist/client/assets/{mcp-app-renderer-B3VIzrTv.js → mcp-app-renderer-Cx5zXS7D.js} +1 -1
  170. package/dist/client/assets/{mcp-oauth-DAVs1HXT.js → mcp-oauth-Mdi9G_nm.js} +1 -1
  171. package/dist/client/assets/{members-D0YNl54m.js → members-MhRU-q21.js} +1 -1
  172. package/dist/client/assets/{message-templates-BIkD2e9c.js → message-templates-iONRjWU5.js} +1 -1
  173. package/dist/client/assets/{mini-report-page-DQzi3qty.js → mini-report-page-C-96hM-o.js} +1 -1
  174. package/dist/client/assets/{mock-board-BZ0Yancx.js → mock-board-B5JSRgZV.js} +1 -1
  175. package/dist/client/assets/{monaco-editor-CqKDIDRs.js → monaco-editor-BfRzXiyl.js} +1 -1
  176. package/dist/client/assets/{monitoring-stats-row-Cb3kPhnI.js → monitoring-stats-row-DCNb-RE6.js} +1 -1
  177. package/dist/client/assets/{multi-select-BNMDqhbK.js → multi-select-BV4-qb8I.js} +1 -1
  178. package/dist/client/assets/{mustache-DG5EH2Gv.js → mustache-B2_LszoY.js} +1 -1
  179. package/dist/client/assets/{new-project-dialog-BglGMy73.js → new-project-dialog-aG1LmqNx.js} +1 -1
  180. package/dist/client/assets/{oauth-callback-BlTZ6AJ1.js → oauth-callback-BZEF6Vem.js} +1 -1
  181. package/dist/client/assets/{oauth-callback-ai-provider-B1ag7pBO.js → oauth-callback-ai-provider-DlkslXGA.js} +1 -1
  182. package/dist/client/assets/{onboarding-Ca2ifhdE.js → onboarding-yk8kTMoW.js} +1 -1
  183. package/dist/client/assets/{optimistic-project-sidebar-views-C5sN6Rj3.js → optimistic-project-sidebar-views-BMOYZ8tf.js} +1 -1
  184. package/dist/client/assets/{org-file-open-context-CdICBbAH.js → org-file-open-context-Dl3qgap2.js} +1 -1
  185. package/dist/client/assets/{organization-choice-Bv6t1UwJ.js → organization-choice-COhn6ce6.js} +1 -1
  186. package/dist/client/assets/{orgs-B6eY4gFh.js → orgs-DeRm5jIN.js} +1 -1
  187. package/dist/client/assets/{page-seo-form-B38d40sz.js → page-seo-form-DO9uunbk.js} +1 -1
  188. package/dist/client/assets/{pair-0TdjiLVI.js → pair-CdNhWiUR.js} +1 -1
  189. package/dist/client/assets/{plan-ladder-DwLy6PTi.js → plan-ladder-CuLZkgBu.js} +1 -1
  190. package/dist/client/assets/{popover-BRE8ILKE.js → popover-Cj-r--VT.js} +1 -1
  191. package/dist/client/assets/{post-calendar-DGt_ndX4.js → post-calendar-_LPiIrzc.js} +1 -1
  192. package/dist/client/assets/{post-editor-D0eRaxXC.js → post-editor-c1Rw9FQt.js} +1 -1
  193. package/dist/client/assets/{preview-content-Dn7hR4M-.js → preview-content-kIsMY8Nc.js} +1 -1
  194. package/dist/client/assets/{preview-dialog-Cn4XaU4a.js → preview-dialog-BHY_2jiF.js} +1 -1
  195. package/dist/client/assets/{profile-BY5KyFaz.js → profile-CzLV9KrB.js} +1 -1
  196. package/dist/client/assets/{project-app-view-BUmCHgox.js → project-app-view-NADLDtxK.js} +1 -1
  197. package/dist/client/assets/{project-feed-D1bPqPqK.js → project-feed-IoR6hXa8.js} +1 -1
  198. package/dist/client/assets/{project-icon-Do6Rnqu9.js → project-icon-Ch4KDtlO.js} +1 -1
  199. package/dist/client/assets/project-reports-C4_AtKq5.js +1 -0
  200. package/dist/client/assets/project-tasks-sJ3gMJ8p.js +1 -0
  201. package/dist/client/assets/{projects-CftQwpQj.js → projects-DDu44jkE.js} +1 -1
  202. package/dist/client/assets/{projects-empty-state-5PDc_5Mv.js → projects-empty-state-0uyJsqSZ.js} +1 -1
  203. package/dist/client/assets/{prompts-HX5a-Vhy.js → prompts-B_03RJAd.js} +1 -1
  204. package/dist/client/assets/record-editor-DwYny4Hc.js +1 -0
  205. package/dist/client/assets/{redirect-editor-QBPKQg9S.js → redirect-editor-CS_TZTOh.js} +1 -1
  206. package/dist/client/assets/reports-Df5KS3eS.js +1 -0
  207. package/dist/client/assets/{reports-hSNu0AMI.js → reports-UV35Nnxa.js} +1 -1
  208. package/dist/client/assets/{reports-onboarding-CpiJUIbl.js → reports-onboarding-DaFczo_9.js} +1 -1
  209. package/dist/client/assets/{reports-tab-DsX7UTDx.js → reports-tab-yhT8u52F.js} +2 -2
  210. package/dist/client/assets/{repositories-xKmWatiY.js → repositories-Xv0E_Jwm.js} +1 -1
  211. package/dist/client/assets/{repository-binding-IbB3w4K1.js → repository-binding-DSb755tD.js} +1 -1
  212. package/dist/client/assets/{repository-import-picker-nfveC9uu.js → repository-import-picker-DWKmc173.js} +1 -1
  213. package/dist/client/assets/{repository-picker-BdcBJaAa.js → repository-picker-DTSlP9FP.js} +1 -1
  214. package/dist/client/assets/{require-capability-0QQu-PXm.js → require-capability-Ds_HoNQH.js} +1 -1
  215. package/dist/client/assets/{required-auth-layout-EBGqXDef.js → required-auth-layout-BvMcqF9O.js} +1 -1
  216. package/dist/client/assets/{reset-password-DQdWhQZ_.js → reset-password-C6aAd7Al.js} +1 -1
  217. package/dist/client/assets/{resizable-COGq4QgQ.js → resizable-DXDqTm9t.js} +1 -1
  218. package/dist/client/assets/{resolve-tab-icon-Bf_8f9iv.js → resolve-tab-icon-DQSu_41c.js} +1 -1
  219. package/dist/client/assets/{review-settings-JcaAi2m2.js → review-settings-DAqIZhW5.js} +1 -1
  220. package/dist/client/assets/{rich-text-link-control-AkFJ9YLs.js → rich-text-link-control-CP22_7Wf.js} +1 -1
  221. package/dist/client/assets/{roles-DIaQUcS5.js → roles-aPjfAf7m.js} +1 -1
  222. package/dist/client/assets/route-9tgTBitD.js +1 -0
  223. package/dist/client/assets/{route-Com2R5M0.js → route-CprvV6pD.js} +1 -1
  224. package/dist/client/assets/{route-BfQseO66.js → route-D2tFYskN.js} +1 -1
  225. package/dist/client/assets/{runnable-block-editor-BguM-kty.js → runnable-block-editor-D1k-NHHE.js} +1 -1
  226. package/dist/client/assets/{sandbox-lifecycle-context-CFoOqCj0.js → sandbox-lifecycle-context-Dy4CSxxD.js} +1 -1
  227. package/dist/client/assets/{schema-G9rWtgSi.js → schema-Dlgkjiv1.js} +1 -1
  228. package/dist/client/assets/{scroll-area-B0xiZfJx.js → scroll-area-DKF0wIhg.js} +1 -1
  229. package/dist/client/assets/{search-input-DTbSmfbu.js → search-input-D_Dm2H8K.js} +1 -1
  230. package/dist/client/assets/{search-toggle-BIaj-qey.js → search-toggle-P_agAdHY.js} +1 -1
  231. package/dist/client/assets/{secret-picker-By2xsSYR.js → secret-picker-DlRxgG2v.js} +1 -1
  232. package/dist/client/assets/{secrets-Bd-ICDic.js → secrets-51Ea1npI.js} +1 -1
  233. package/dist/client/assets/{sections-editor-PfznHdXP.js → sections-editor-Du3vUpgs.js} +1 -1
  234. package/dist/client/assets/{select-B-7TWojP.js → select-Do8VXC56.js} +1 -1
  235. package/dist/client/assets/{select-model-CSB-yZOt.js → select-model-bKw7YzNa.js} +1 -1
  236. package/dist/client/assets/{seo-editor-Ba23nS22.js → seo-editor-BT4GPyca.js} +1 -1
  237. package/dist/client/assets/{separator-By-AoWOK.js → separator-CRZXlLTM.js} +1 -1
  238. package/dist/client/assets/{settings-tab-BXwt3t3Z.js → settings-tab-HRB7SJ4_.js} +1 -1
  239. package/dist/client/assets/{sheet-tV1MwOuF.js → sheet-Da9g_BHH.js} +1 -1
  240. package/dist/client/assets/{shell-layout-D9Y783sH.js → shell-layout-2lFwLRyB.js} +1 -1
  241. package/dist/client/assets/{skills-ChXRlY6J.js → skills-DwgxN1Xl.js} +1 -1
  242. package/dist/client/assets/{sso-s8xDc0Rb.js → sso-BWJiOC7W.js} +1 -1
  243. package/dist/client/assets/{suggestion-DYUHap8V.js → suggestion-CAkZpnvu.js} +1 -1
  244. package/dist/client/assets/{switch-DVAJLCdX.js → switch-eabuBncZ.js} +1 -1
  245. package/dist/client/assets/{synced-repos-lAzCds6k.js → synced-repos-DzoT266W.js} +1 -1
  246. package/dist/client/assets/{tab-icon-glyph-hVsVWg43.js → tab-icon-glyph-BVKulhrq.js} +1 -1
  247. package/dist/client/assets/{table-Df8QoO5m.js → table-Ci0flHqR.js} +1 -1
  248. package/dist/client/assets/{tabs-BXwDZNIq.js → tabs-oRlU6S30.js} +1 -1
  249. package/dist/client/assets/{task-board-D1I247i1.js → task-board-DIALSeie.js} +1 -1
  250. package/dist/client/assets/{task-route-Cu5whi95.js → task-route-CIBFVNSC.js} +1 -1
  251. package/dist/client/assets/{task-status-D7GC4smL.js → task-status-cZ16StYI.js} +1 -1
  252. package/dist/client/assets/{taskboard-analytics-IPfFZM-y.js → taskboard-analytics-LqYaRFlI.js} +1 -1
  253. package/dist/client/assets/{tasks-Cf1kCtGA.js → tasks-CphA3EYZ.js} +1 -1
  254. package/dist/client/assets/tasks-DPN3qyXp.js +1 -0
  255. package/dist/client/assets/{textarea-CRla2I1O.js → textarea--vnsHs3x.js} +1 -1
  256. package/dist/client/assets/{thread-analytics-ClJ-onVD.js → thread-analytics-DKUlf3RY.js} +1 -1
  257. package/dist/client/assets/{thread-button-B_r_n7Hb.js → thread-button-CsxctT-G.js} +1 -1
  258. package/dist/client/assets/{thread-intent-D4_GmX4s.js → thread-intent-kYQuJDvD.js} +1 -1
  259. package/dist/client/assets/{thread-route-C-ixgfYh.js → thread-route-B3GsxAze.js} +1 -1
  260. package/dist/client/assets/{thread-route-CkyNBEQh.js → thread-route-De8K_tz3.js} +1 -1
  261. package/dist/client/assets/{thread-sheet-body-DFBbwGnF.js → thread-sheet-body-C0FrNJ9T.js} +1 -1
  262. package/dist/client/assets/{toggle-group-Dpg_xjST.js → toggle-group-CvgNphfI.js} +1 -1
  263. package/dist/client/assets/{toolbar-icon-button-C-zNG8m8.js → toolbar-icon-button-EcMyctyQ.js} +1 -1
  264. package/dist/client/assets/{tooltip-DLtvNdpW.js → tooltip-CnfGv3UJ.js} +1 -1
  265. package/dist/client/assets/{track-6Zj0SWSe.js → track-RhLhrXxZ.js} +1 -1
  266. package/dist/client/assets/{types-CLudYYhK.js → types-oO8sHi9E.js} +1 -1
  267. package/dist/client/assets/{usage-stats-ggbnrdm_.js → usage-stats-DErvibLB.js} +1 -1
  268. package/dist/client/assets/{use-ai-providers-DXh7LZcb.js → use-ai-providers-DOIgUjwL.js} +1 -1
  269. package/dist/client/assets/{use-automations-CDpb1P6B.js → use-automations-uekcK0KY.js} +1 -1
  270. package/dist/client/assets/{use-autosave-CpQ7YUL9.js → use-autosave-CbOez7Yq.js} +1 -1
  271. package/dist/client/assets/{use-chat-layout-state-1gL-qD2O.js → use-chat-layout-state-yrmi1Gwb.js} +1 -1
  272. package/dist/client/assets/{use-connect-companion-CMUydgJv.js → use-connect-companion-C_uGVXYr.js} +1 -1
  273. package/dist/client/assets/{use-connection-CZRSPnC8.js → use-connection-DU4h1ZQw.js} +1 -1
  274. package/dist/client/assets/{use-copy-XwRnnX9O.js → use-copy-C5kztOhC.js} +1 -1
  275. package/dist/client/assets/{use-create-virtual-mcp-DwigodL9.js → use-create-virtual-mcp-Dkbt_aoq.js} +1 -1
  276. package/dist/client/assets/{use-date-fns-locale-C6EVhunm.js → use-date-fns-locale-Hm__LN1k.js} +1 -1
  277. package/dist/client/assets/{use-debounced-autosave-BtWCE5ml.js → use-debounced-autosave-xpZ8auzw.js} +1 -1
  278. package/dist/client/assets/{use-debounced-value-Df5XXiWC.js → use-debounced-value-DLVRUtOm.js} +1 -1
  279. package/dist/client/assets/{use-deco-credits-BrV-RGWx.js → use-deco-credits-DgLSuY0L.js} +1 -1
  280. package/dist/client/assets/{use-decopilot-events-pau4MIxW.js → use-decopilot-events-CxBOYWC8.js} +1 -1
  281. package/dist/client/assets/{use-delete-connection-B9igQK3R.js → use-delete-connection-Do3hyh3j.js} +1 -1
  282. package/dist/client/assets/{use-deployment-admin-Cpp8znxx.js → use-deployment-admin-DbqZpA_r.js} +1 -1
  283. package/dist/client/assets/{use-fast-preview-draft-url-Bb4W0G6S.js → use-fast-preview-draft-url-CsVZwjau.js} +1 -1
  284. package/dist/client/assets/{use-file-configs-bflKgUQZ.js → use-file-configs-BRJeov5H.js} +1 -1
  285. package/dist/client/assets/{use-infinite-scroll-uKPv2aM8.js → use-infinite-scroll-DGoD9GUl.js} +1 -1
  286. package/dist/client/assets/{use-join-requests-Cv1tcNNO.js → use-join-requests-C_jjKXlE.js} +1 -1
  287. package/dist/client/assets/{use-main-panel-tabs-Cms_GSXB.js → use-main-panel-tabs-Bc3MZBCb.js} +1 -1
  288. package/dist/client/assets/{use-mcp-auth-status-CbS3n7ZO.js → use-mcp-auth-status-CBn_Xzmb.js} +1 -1
  289. package/dist/client/assets/{use-mcp-client-GJ7Avhzh.js → use-mcp-client-DOo0zS-A.js} +1 -1
  290. package/dist/client/assets/{use-mcp-prompts-CZeaf3zb.js → use-mcp-prompts-DUcez8YA.js} +1 -1
  291. package/dist/client/assets/{use-mcp-tools-B36LuHKI.js → use-mcp-tools-CWcvYRA-.js} +1 -1
  292. package/dist/client/assets/{use-members-BsM8EAty.js → use-members-_nsnfGaz.js} +1 -1
  293. package/dist/client/assets/{use-mobile-X-W7raUh.js → use-mobile-DvZ73KtH.js} +1 -1
  294. package/dist/client/assets/{use-navigate-to-agent-S6T2X5iC.js → use-navigate-to-agent-0EY97I37.js} +1 -1
  295. package/dist/client/assets/use-new-blocks-editor-sTUO1Dvp.js +1 -0
  296. package/dist/client/assets/{use-open-billing-url-BrPfG0rC.js → use-open-billing-url-pGoiHk39.js} +1 -1
  297. package/dist/client/assets/{use-org-auth-client-DpJKNoPr.js → use-org-auth-client-BlteiQR1.js} +1 -1
  298. package/dist/client/assets/{use-org-fs-Db_U65fA.js → use-org-fs-BKiHrfqD.js} +1 -1
  299. package/dist/client/assets/{use-org-repo-syncs-CNnHLgIG.js → use-org-repo-syncs-9Jptl7NX.js} +1 -1
  300. package/dist/client/assets/{use-org-sso-Bzr9C2H6.js → use-org-sso-JZsx5RfJ.js} +1 -1
  301. package/dist/client/assets/{use-organization-roles-DadVtHMn.js → use-organization-roles-coC16fOX.js} +1 -1
  302. package/dist/client/assets/{use-organization-settings-DpQArW0s.js → use-organization-settings--iPsUcy7.js} +1 -1
  303. package/dist/client/assets/{use-panel-navigate-DPS2Zvaj.js → use-panel-navigate-m1jpn2Q1.js} +1 -1
  304. package/dist/client/assets/{use-project-native-view-presence-YyFw7Uvc.js → use-project-native-view-presence-Ggsme35p.js} +1 -1
  305. package/dist/client/assets/{use-project-scope-_m4cLdEj.js → use-project-scope-BB82FCa8.js} +1 -1
  306. package/dist/client/assets/{use-releases-BuSodOwV.js → use-releases-7cBYcQ4J.js} +1 -1
  307. package/dist/client/assets/{use-reports-diagnostic-peSDEyuH.js → use-reports-diagnostic-CtsjKgVP.js} +1 -1
  308. package/dist/client/assets/{use-secrets-CBaJAXrY.js → use-secrets-CLR0Et3T.js} +1 -1
  309. package/dist/client/assets/{use-section-preview-base-Bw0Xcs8d.js → use-section-preview-base-CBvq-UlV.js} +1 -1
  310. package/dist/client/assets/{use-session-runtime-CN6BtDG2.js → use-session-runtime-6x58C-tT.js} +1 -1
  311. package/dist/client/assets/{use-tags-DickAZMZ.js → use-tags-CDjPhJiP.js} +1 -1
  312. package/dist/client/assets/{use-task-board-analytics-CGiK88Op.js → use-task-board-analytics-BKbzkTQP.js} +1 -1
  313. package/dist/client/assets/{use-task-metadata-5QbFJsYe.js → use-task-metadata-CrJp6is8.js} +1 -1
  314. package/dist/client/assets/{use-thread-analytics-m34CmWcR.js → use-thread-analytics-1m69hvFD.js} +1 -1
  315. package/dist/client/assets/{use-thread-outputs-Cbd1AH6z.js → use-thread-outputs-CTBrB0Pz.js} +1 -1
  316. package/dist/client/assets/useInfiniteQuery-Bvl72KSW.js +1 -0
  317. package/dist/client/assets/{useQueries-fdUgbPnN.js → useQueries-B5hFaZ0x.js} +1 -1
  318. package/dist/client/assets/useSuspenseInfiniteQuery-Cf-lJprJ.js +1 -0
  319. package/dist/client/assets/{users-Bi6DBewt.js → users-DEkYKXng.js} +1 -1
  320. package/dist/client/assets/{utils-huVSNvIG.js → utils-Bqsc15Zx.js} +1 -1
  321. package/dist/client/assets/{variant-calendar-BkRUPUkt.js → variant-calendar-45aD1dj3.js} +1 -1
  322. package/dist/client/assets/{variant-matcher-override-DhCYxx3t.js → variant-matcher-override-CAjUtJno.js} +1 -1
  323. package/dist/client/assets/{view-mode-toggle-CKEEP_Fz.js → view-mode-toggle-DrC_ZP4l.js} +1 -1
  324. package/dist/client/assets/{virtual-mcp-DCz5YKSi.js → virtual-mcp-BH-EbPmd.js} +1 -1
  325. package/dist/client/index.html +1 -1
  326. package/dist/server/cli.js +1 -1
  327. package/dist/server/server.js +1 -1
  328. package/package.json +1 -1
  329. package/dist/client/assets/agent-app-Bdibz-mC.js +0 -1
  330. package/dist/client/assets/agent-deck-D3B9ilYm.js +0 -1
  331. package/dist/client/assets/agent-library-Cj5vCdvo.js +0 -1
  332. package/dist/client/assets/agent-library-file-BKVVCmrm.js +0 -1
  333. package/dist/client/assets/agent-settings-BSYJzowv.js +0 -1
  334. package/dist/client/assets/agent-site-editor-code-DlzJnPjz.js +0 -2
  335. package/dist/client/assets/agent-view-DZHcKf-S.js +0 -1
  336. package/dist/client/assets/api-keys-BKfddA8i.js +0 -1
  337. package/dist/client/assets/app-editor-LKAeoVT1.js +0 -1
  338. package/dist/client/assets/flat-project-DfK9v9Di.js +0 -1
  339. package/dist/client/assets/library-SL2axwY3.js +0 -1
  340. package/dist/client/assets/project-reports-CFGttV6o.js +0 -1
  341. package/dist/client/assets/project-tasks-uhDI57uo.js +0 -1
  342. package/dist/client/assets/record-editor-Bhs8b2Go.js +0 -1
  343. package/dist/client/assets/reports-h-fJboau.js +0 -1
  344. package/dist/client/assets/route-YvCVw4s8.js +0 -1
  345. package/dist/client/assets/tasks-EQ6aeNd8.js +0 -1
  346. package/dist/client/assets/use-new-blocks-editor-C_ucb5sc.js +0 -1
  347. package/dist/client/assets/useInfiniteQuery-CSJHUxLB.js +0 -1
  348. package/dist/client/assets/useSuspenseInfiniteQuery-DW4u_6CR.js +0 -1
@@ -1 +1 @@
1
- import{c as H,r as C,b as G,j as h,t as N,Z as xe,B as ke,o as de,X as ue,K as Z,q as $,e8 as me,c$ as oe,e9 as z,l as we}from"./index-CyII4Hy-.js";import{S as fe,s as be}from"./suggestion-DYUHap8V.js";import{f as Pe,h as _e,j as Ce,i as B,k as Se,P as ie,l as Fe,c as Ie,u as De,n as je,d as ve,e as Me,F as Re,s as Le,b as Ae}from"./index-BNMHslbt.js";import{d as Ee,h as Ne,c as Te,b as Qe,D as $e}from"./dialog-BAdncaXR.js";import{aW as Oe}from"./agent-icon-D7av-7g5.js";import"./chat-context-W4FU8MtG.js";import{m as Ue,i as qe,a as Ke}from"./decopilot-HlYS-QdU.js";import{u as pe}from"./use-mcp-client-GJ7Avhzh.js";import{b as ze}from"./repository-binding-IbB3w4K1.js";import{g as Be}from"./use-project-scope-_m4cLdEj.js";import{g as ne,s as he}from"./gateway-client-Ca84PQdv.js";import{l as ae,g as ge}from"./use-mcp-prompts-CZeaf3zb.js";import{f as He,a as Je}from"./use-org-fs-Db_U65fA.js";async function We(t,e,n,s,i,o){if(!Ue(e)){N.error("Selected model does not support file uploads");return}const c=n.type||"application/octet-stream";if(!qe(c,e)){const p=Ke(e).parts.map(x=>o(x)).join(", "),w=e?.title??"This model";i?i({fileName:n.name,modelName:w,accepted:p}):N.error(`"${n.name}" can't be attached`,{description:`${w} accepts ${p}.`});return}const d=10*1024*1024;if(n.size>d){N.error(`File "${n.name}" exceeds 10MB limit`);return}try{const p=new FileReader,w=new Promise((r,u)=>{p.onload=()=>{const a=p.result;if(typeof a!="string"){u(new Error("Failed to read file as data URL"));return}const k=a.includes(",")?a.split(",")[1]??a:a;r(k)},p.onerror=u});p.readAsDataURL(n);const x=await w,f={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:x};Pe(t,{from:s,to:s},f)}catch(p){console.error("Failed to process file:",p),N.error(`Failed to load file "${n.name}"`)}}function Xe(t){const e=H.c(9),{editor:n,selectedModel:s,onUnsupportedFile:i}=t,o=G(),c=C.useRef(Ye);let d,p;e[0]!==n||e[1]!==i||e[2]!==s||e[3]!==o?(d=()=>{c.current=async(f,r)=>{await We(n,s,f,r,i,o)}},p=[n,s,i,o],e[0]=n,e[1]=i,e[2]=s,e[3]=o,e[4]=d,e[5]=p):(d=e[4],p=e[5]),C.useEffect(d,p);let w,x;return e[6]!==n?(w=()=>{if(n?.isDestroyed)return;const f=new _e("fileDropHandler");n.state.plugins.find(a=>a.spec.key===f)&&n.unregisterPlugin(f);const u=new Ce({key:f,props:{handleDrop:(a,k,F,S)=>{if(S)return!1;const b=k.dataTransfer?.files;if(!b||b.length===0)return!1;k.preventDefault();const j=a.posAtCoords({left:k.clientX,top:k.clientY});if(!j)return!1;const I=Array.from(b);return(async()=>{let M=j.pos;for(const D of I)await c.current?.(D,M),M=a.state.selection.to})(),!0},handlePaste:(a,k)=>{const F=k.clipboardData?.items;if(!F)return!1;const S=Array.from(F).filter(Ve);return S.length===0?!1:(k.preventDefault(),(async()=>{let b=a.state.selection.from;for(const j of S){const I=j.getAsFile();I&&(await c.current?.(I,b),b=a.state.selection.to)}})(),!0)}}});return n.registerPlugin(u),()=>{n?.isDestroyed||n.unregisterPlugin(f)}},x=[n],e[6]=n,e[7]=w,e[8]=x):(w=e[7],x=e[8]),C.useEffect(w,x),null}function Ve(t){return t.kind==="file"}function Ye(){return Promise.resolve()}function Ct(t){const e=H.c(43),{info:n,onClose:s}=t,i=G(),o=n!==null;let c;e[0]!==s?(c=v=>!v&&s(),e[0]=s,e[1]=c):c=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=d):d=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:d.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=p):p=e[3];let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(xe,{size:18})}),e[4]=w):w=e[4];let x;e[5]!==i?(x=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==x?(f=h.jsx(Ee,{className:"text-xl font-semibold tracking-tight",children:x}),e[7]=x,e[8]=f):f=e[8];const r=n?.fileName;let u;e[9]!==r?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",r,"”"]}),e[9]=r,e[10]=u):u=e[10];let a;e[11]!==i?(a=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=a):a=e[12];let k;e[13]!==a||e[14]!==u?(k=h.jsxs(Ne,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",a]}),e[13]=a,e[14]=u,e[15]=k):k=e[15];let F;e[16]!==k||e[17]!==f?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,h.jsxs(Te,{className:"relative gap-4",children:[w,h.jsxs("div",{children:[f,k]})]})]}),e[16]=k,e[17]=f,e[18]=F):F=e[18];const S=n?.modelName??"";let b;e[19]!==i||e[20]!==S?(b=i("chat.uploader.accepts",{modelName:S}),e[19]=i,e[20]=S,e[21]=b):b=e[21];let j;e[22]!==b?(j=h.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:b}),e[22]=b,e[23]=j):j=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Oe,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const M=n?.accepted;let D;e[25]!==M?(D=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,h.jsx("span",{className:"capitalize",children:M})]}),e[25]=M,e[26]=D):D=e[26];let l;e[27]!==j||e[28]!==D?(l=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"rounded-xl border border-border p-4",children:[j,D]})}),e[27]=j,e[28]=D,e[29]=l):l=e[29];let m;e[30]!==i?(m=i("chat.uploader.gotIt"),e[30]=i,e[31]=m):m=e[31];let y;e[32]!==s||e[33]!==m?(y=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(ke,{onClick:s,children:m})}),e[32]=s,e[33]=m,e[34]=y):y=e[34];let _;e[35]!==F||e[36]!==l||e[37]!==y?(_=h.jsxs(Qe,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ze,children:[F,l,y]}),e[35]=F,e[36]=l,e[37]=y,e[38]=_):_=e[38];let R;return e[39]!==o||e[40]!==c||e[41]!==_?(R=h.jsx($e,{open:o,onOpenChange:c,children:_}),e[39]=o,e[40]=c,e[41]=_,e[42]=R):R=e[42],R}function Ze(t){return t.preventDefault()}function St(){const t=H.c(3),[e,n]=C.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>n(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}const Ge=t=>{const e=H.c(53),{editor:n,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),c=de(),{org:d}=ue(),p=ze();let w;e[0]!==p?(w=Be(p),e[0]=p,e[1]=w):w=e[1];const x=w;let f;e[2]!==d.id||e[3]!==d.slug||e[4]!==s?(f={connectionId:s,orgId:d.id,orgSlug:d.slug},e[2]=d.id,e[3]=d.slug,e[4]=s,e[5]=f):f=e[5];const r=pe(f);let u;e[6]!==d.id||e[7]!==s?(u=Z.virtualMcpResources(s,d.id),e[6]=d.id,e[7]=s,e[8]=u):u=e[8];const a=u,[k,F]=C.useState("categories");let S;e[9]!==k?(S=()=>k,e[9]=k,e[10]=S):S=e[10];const b=C.useEffectEvent(S),j=C.useRef(null),I=C.useRef(!1),M=s??"default";let D;e[11]!==k||e[12]!==d.id||e[13]!==M?(D=["at-mention",d.id,M,k],e[11]=k,e[12]=d.id,e[13]=M,e[14]=D):D=e[14];const l=D;let m;e[15]!==o?(m=o("chat.mentionAt.agentsTitle"),e[15]=o,e[16]=m):m=e[16];let y;e[17]!==o?(y=o("chat.mentionAt.agentsDescription"),e[17]=o,e[18]=y):y=e[18];let _;e[19]!==m||e[20]!==y?(_={name:"agents",title:m,description:y,kind:"category",drillable:!0},e[19]=m,e[20]=y,e[21]=_):_=e[21];let R;e[22]!==o?(R=o("chat.mentionAt.resourcesTitle"),e[22]=o,e[23]=R):R=e[23];let v;e[24]!==o?(v=o("chat.mentionAt.resourcesDescription"),e[24]=o,e[25]=v):v=e[25];let T;e[26]!==R||e[27]!==v?(T={name:"resources",title:R,description:v,kind:"category",drillable:!0},e[26]=R,e[27]=v,e[28]=T):T=e[28];let O;e[29]!==T||e[30]!==_?(O=[_,T],e[29]=T,e[30]=_,e[31]=O):O=e[31];const q=O;let g;e[32]!==r||e[33]!==n||e[34]!==o?(g=async U=>{const{item:P,range:K}=U;if($("chat_picker_item_selected",{picker:"@",item_kind:P.kind,item_name:P.name}),P.kind!=="category"&&(I.current=!0),P.kind==="category")return F(P.name==="agents"?"agents":"resources"),!1;if(P.kind==="agent"&&P.agentId){B(n,K,{id:P.agentId,name:P.name,metadata:{agentId:P.agentId,title:P.name},char:"@"}),F("categories");return}if(P.kind==="resource"&&P.uri&&r){try{const Q=await me(r,P.uri);B(n,K,{id:P.uri,name:P.uri,metadata:Q.contents,char:"@"})}catch(Q){console.error("[at-mention] Failed to fetch resource:",Q),N.error(o("chat.mentionAt.failedToLoadResource"))}F("categories");return}},e[32]=r,e[33]=n,e[34]=o,e[35]=g):g=e[35];const ee=g;let J;e[36]!==p||e[37]!==q||e[38]!==r||e[39]!==x||e[40]!==b||e[41]!==c||e[42]!==a||e[43]!==s?(J=async U=>{const{query:P}=U,K=b();if(K==="categories"){if(!P.trim())return q;const A=P.toLowerCase(),L=p.filter(E=>E.status==="active"&&(!E.id||!oe(E.id))&&!x.has(E.id)&&E.id!==s&&(E.title.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A))).map(et),Y=await(async()=>{if(!r)return[];let E=c.getQueryData(a);return E||(E=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4})),(E?.resources??[]).filter(re=>re.uri.toLowerCase().includes(A)||re.name?.toLowerCase().includes(A)||re.description?.toLowerCase().includes(A)).map(tt)})();return[...L,...Y]}if(K==="agents"){let A=p.filter(L=>L.status==="active"&&(!L.id||!oe(L.id))&&!x.has(L.id)&&L.id!==s);if(P.trim()){const L=P.toLowerCase();A=A.filter(Y=>Y.title.toLowerCase().includes(L)||Y.description?.toLowerCase().includes(L))}return A.map(st)}if(!r)return[];let Q=c.getQueryData(a);Q?c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4}).catch(rt):Q=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4});let V=Q?.resources??[];if(P.trim()){const A=P.toLowerCase();V=V.filter(L=>L.uri.toLowerCase().includes(A)||L.name?.toLowerCase().includes(A)||L.description?.toLowerCase().includes(A))}return V.map(nt)},e[36]=p,e[37]=q,e[38]=r,e[39]=x,e[40]=b,e[41]=c,e[42]=a,e[43]=s,e[44]=J):J=e[44];const te=J;let W;e[45]!==i?(W=U=>{if(i&&(i.current=U),U)j.current=Date.now(),I.current=!1,$("chat_picker_opened",{picker:"@"});else{const P=j.current;$("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:P?Date.now()-P:null}),j.current=null,F("categories")}},e[45]=i,e[46]=W):W=e[46];const se=W;let X;return e[47]!==n||e[48]!==te||e[49]!==ee||e[50]!==se||e[51]!==l?(X=h.jsx(fe,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:l,queryFn:te,onSelect:ee,onOpenChange:se}),e[47]=n,e[48]=te,e[49]=ee,e[50]=se,e[51]=l,e[52]=X):X=e[52],X};function et(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function tt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function st(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function rt(){}function nt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function le(t,e,n,s,i,o,c){try{const d=await ge(n,s,o);B(t,e,{id:s,name:he(s,i),metadata:d.messages,char:"/",kind:"prompt",args:o})}catch(d){console.error("[slash] Failed to fetch prompt:",d),N.error(c.t("chat.mentionSlash.failedLoadPrompt"))}}async function ot(t,e,n,s,i){try{const o=await me(n,s);B(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),N.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function it(t,e,n,s,i){try{const{files:o,omittedPaths:c}=await He(n,s.volume,s.path),d={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:c};B(t,e,{id:s.id,name:s.name,metadata:d,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),N.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const at=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const s=G(),i=de(),{org:o}=ue(),c=pe({connectionId:e,orgId:o.id,orgSlug:o.slug}),d=Z.virtualMcpPrompts(e,o.id),p=Z.virtualMcpResources(e,o.id),w=Z.slashSkills(o.id),x=["slash-mention",o.id,e??"default"],[f,r]=C.useState(null),[u,a]=C.useState(null),k=Se(t);k&&(k.onEditChip=async l=>{if(c)try{const y=(await ce(i,d,c)).find(_=>_.name===l.promptId);if(!y?.arguments||y.arguments.length===0)return;a({...l,prompt:y})}catch(m){console.error("[slash] Failed to load prompt for editing:",m),N.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=C.useRef(null),S=C.useRef(!1),b=async({item:l,range:m})=>{if($("chat_picker_item_selected",{picker:"/",item_kind:l.kind,item_name:l.name}),S.current=!0,!!c)if(l.kind==="prompt"){if(l.arguments&&l.arguments.length>0){r({range:m,item:l});return}const y=ne(l._meta);await le(t,m,c,l.name,y,void 0,{t:s})}else l.kind==="skill"?l.skill&&await it(t,m,o.slug,l.skill,{t:s}):l.uri&&await ot(t,m,c,l.uri,{t:s})},j=async l=>{if(!f||!c)return;const{range:m,item:y}=f,_=ne(y._meta);await le(t,m,c,y.name,_,l,{t:s}),r(null)},I=async l=>{if(!(!u||!c)){if(!Fe(t,u.pos,u.promptId)){N.error(s("chat.mentionSlash.failedUpdatePrompt")),a(null);return}try{const m=await ge(c,u.promptId,l),y=ne(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Ie({id:u.promptId,name:he(u.promptId,y),metadata:m.messages,char:"/",kind:"prompt",args:l})).run(),$("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(m){console.error("[slash] Failed to update prompt:",m),N.error(s("chat.mentionSlash.failedUpdatePrompt"))}a(null)}},M=async l=>{const{query:m}=l;if(!c)return[];const[y,_,R]=await Promise.all([ce(i,d,c),ct(i,p,c),lt(i,w,o.slug)]),v=m.trim().toLowerCase(),T=(y??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.title?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.title,description:g.description,kind:"prompt",arguments:g.arguments,_meta:g._meta})),O=(_??[]).filter(g=>!v||g.uri.toLowerCase().includes(v)||g.name?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name??g.uri,title:g.name,description:g.description,kind:"resource",uri:g.uri})),q=(R??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.id.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.name,description:g.description??void 0,kind:"skill",skill:g}));return[...T,...O,...q]},D=f?.item.kind==="prompt"?{name:f.item.name,title:f.item.title,arguments:f.item.arguments,description:f.item.description,_meta:f.item._meta}:null;return h.jsxs(h.Fragment,{children:[h.jsx(fe,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:x,queryFn:M,onSelect:b,onOpenChange:l=>{if(n&&(n.current=l),l)F.current=Date.now(),S.current=!1,$("chat_picker_opened",{picker:"/"});else{const m=F.current;$("chat_picker_closed",{picker:"/",outcome:S.current?"selected":"dismissed",duration_ms:m?Date.now()-m:null}),F.current=null}}}),h.jsx(ie,{prompt:D,setPrompt:()=>r(null),onSubmit:j}),h.jsx(ie,{prompt:u?.prompt??null,setPrompt:()=>a(null),onSubmit:I,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ce(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function lt(t,e,n){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Je(n),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function ct(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ye="Ask anything, / for prompts & skills, @ for agents & resources...";function dt(t){return[Le.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),be.configure({placeholder:()=>t.current??ye,showOnlyWhenEditable:!1}),Me,Re]}function Ft({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:c,children:d}){const p=C.useRef(o),w=C.useRef(e),x=C.useRef(s),f=C.useRef(i),r=De({extensions:dt(f),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ye,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(u,a)=>a.key==="Enter"&&!a.shiftKey&&x.current&&!c?.current?(a.preventDefault(),p.current?.(),!0):!1},onUpdate:({editor:u})=>{w.current(u?.getJSON())}});return C.useEffect(()=>{r?.setEditable(!n)},[r,n]),C.useEffect(()=>{p.current=o},[o]),C.useEffect(()=>{w.current=e},[e]),C.useEffect(()=>{x.current=s},[s]),C.useEffect(()=>{f.current=i},[i]),C.useEffect(()=>{if(!r||r.isDestroyed)return;const u=JSON.stringify(r.getJSON()),a=JSON.stringify(t||{type:"doc",content:[]});u!==a&&r.commands.setContent(t||{type:"doc",content:[]})},[r,t]),h.jsx(je.Provider,{value:{editor:r},children:d})}function It(t){const e=H.c(29),{disabled:n,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:c,suggestionOpenRef:d,ref:p,className:w}=t,x=n===void 0?!1:n,f=i===void 0?!1:i,{editor:r}=ve();let u,a;if(e[0]!==r?(u=()=>({focus:()=>{r?.commands.focus()},clear:()=>{r?.commands.clearContent(!0)},appendText:y=>{if(!r)return;const _=r.state.doc.textContent.trim()==="";r.commands.focus("end"),_||r.commands.insertContent(" "),r.commands.insertContent(y)},syncVoiceText:(y,_)=>{if(r&&(r.commands.setContent(y||{type:"doc",content:[]}),_)){r.commands.focus("end");const R=r.state.doc.textContent.trim().length>0;r.commands.insertContent({type:"text",text:R?" "+_:_})}},restoreContent:y=>{r&&r.commands.setContent(y||{type:"doc",content:[]})}}),a=[r],e[0]=r,e[1]=u,e[2]=a):(u=e[1],a=e[2]),C.useImperativeHandle(p??null,u,a),!r)return null;const k=x&&"cursor-not-allowed opacity-70",F=x&&"[&_.ProseMirror]:cursor-not-allowed";let S;e[3]!==w||e[4]!==k||e[5]!==F?(S=we("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",w,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",k,F),e[3]=w,e[4]=k,e[5]=F,e[6]=S):S=e[6];let b;e[7]!==r||e[8]!==S?(b=h.jsx(Ae,{editor:r,className:S}),e[7]=r,e[8]=S,e[9]=b):b=e[9];const j=s??null;let I;e[10]!==r||e[11]!==d||e[12]!==j?(I=h.jsx(C.Suspense,{fallback:null,children:h.jsx(at,{editor:r,virtualMcpId:j,suggestionOpenRef:d})}),e[10]=r,e[11]=d,e[12]=j,e[13]=I):I=e[13];const M=s??null;let D;e[14]!==r||e[15]!==d||e[16]!==M?(D=h.jsx(C.Suspense,{fallback:null,children:h.jsx(Ge,{editor:r,virtualMcpId:M,suggestionOpenRef:d})}),e[14]=r,e[15]=d,e[16]=M,e[17]=D):D=e[17];let l;e[18]!==x||e[19]!==r||e[20]!==c||e[21]!==o||e[22]!==f?(l=f&&o&&!x?h.jsx(Xe,{editor:r,selectedModel:o,onUnsupportedFile:c}):null,e[18]=x,e[19]=r,e[20]=c,e[21]=o,e[22]=f,e[23]=l):l=e[23];let m;return e[24]!==I||e[25]!==D||e[26]!==l||e[27]!==b?(m=h.jsxs(h.Fragment,{children:[b,I,D,l]}),e[24]=I,e[25]=D,e[26]=l,e[27]=b,e[28]=m):m=e[28],m}export{Ft as T,Ct as U,It as a,We as p,St as u};
1
+ import{c as H,r as C,b as G,j as h,t as N,Z as xe,B as ke,o as de,X as ue,K as Z,q as $,e8 as me,c$ as oe,e9 as z,l as we}from"./index-Cif-NWVp.js";import{S as fe,s as be}from"./suggestion-CAkZpnvu.js";import{f as Pe,h as _e,j as Ce,i as B,k as Se,P as ie,l as Fe,c as Ie,u as De,n as je,d as ve,e as Me,F as Re,s as Le,b as Ae}from"./index-CM1GEUnU.js";import{d as Ee,h as Ne,c as Te,b as Qe,D as $e}from"./dialog-xO6pvTgy.js";import{aW as Oe}from"./agent-icon-DEau6pQP.js";import"./chat-context-C7aSqPqa.js";import{m as Ue,i as qe,a as Ke}from"./decopilot-Ch9InHOw.js";import{u as pe}from"./use-mcp-client-DOo0zS-A.js";import{b as ze}from"./repository-binding-DSb755tD.js";import{g as Be}from"./use-project-scope-BB82FCa8.js";import{g as ne,s as he}from"./gateway-client-BuRwuqbN.js";import{l as ae,g as ge}from"./use-mcp-prompts-DUcez8YA.js";import{f as He,a as Je}from"./use-org-fs-BKiHrfqD.js";async function We(t,e,n,s,i,o){if(!Ue(e)){N.error("Selected model does not support file uploads");return}const c=n.type||"application/octet-stream";if(!qe(c,e)){const p=Ke(e).parts.map(x=>o(x)).join(", "),w=e?.title??"This model";i?i({fileName:n.name,modelName:w,accepted:p}):N.error(`"${n.name}" can't be attached`,{description:`${w} accepts ${p}.`});return}const d=10*1024*1024;if(n.size>d){N.error(`File "${n.name}" exceeds 10MB limit`);return}try{const p=new FileReader,w=new Promise((r,u)=>{p.onload=()=>{const a=p.result;if(typeof a!="string"){u(new Error("Failed to read file as data URL"));return}const k=a.includes(",")?a.split(",")[1]??a:a;r(k)},p.onerror=u});p.readAsDataURL(n);const x=await w,f={id:crypto.randomUUID(),name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,data:x};Pe(t,{from:s,to:s},f)}catch(p){console.error("Failed to process file:",p),N.error(`Failed to load file "${n.name}"`)}}function Xe(t){const e=H.c(9),{editor:n,selectedModel:s,onUnsupportedFile:i}=t,o=G(),c=C.useRef(Ye);let d,p;e[0]!==n||e[1]!==i||e[2]!==s||e[3]!==o?(d=()=>{c.current=async(f,r)=>{await We(n,s,f,r,i,o)}},p=[n,s,i,o],e[0]=n,e[1]=i,e[2]=s,e[3]=o,e[4]=d,e[5]=p):(d=e[4],p=e[5]),C.useEffect(d,p);let w,x;return e[6]!==n?(w=()=>{if(n?.isDestroyed)return;const f=new _e("fileDropHandler");n.state.plugins.find(a=>a.spec.key===f)&&n.unregisterPlugin(f);const u=new Ce({key:f,props:{handleDrop:(a,k,F,S)=>{if(S)return!1;const b=k.dataTransfer?.files;if(!b||b.length===0)return!1;k.preventDefault();const j=a.posAtCoords({left:k.clientX,top:k.clientY});if(!j)return!1;const I=Array.from(b);return(async()=>{let M=j.pos;for(const D of I)await c.current?.(D,M),M=a.state.selection.to})(),!0},handlePaste:(a,k)=>{const F=k.clipboardData?.items;if(!F)return!1;const S=Array.from(F).filter(Ve);return S.length===0?!1:(k.preventDefault(),(async()=>{let b=a.state.selection.from;for(const j of S){const I=j.getAsFile();I&&(await c.current?.(I,b),b=a.state.selection.to)}})(),!0)}}});return n.registerPlugin(u),()=>{n?.isDestroyed||n.unregisterPlugin(f)}},x=[n],e[6]=n,e[7]=w,e[8]=x):(w=e[7],x=e[8]),C.useEffect(w,x),null}function Ve(t){return t.kind==="file"}function Ye(){return Promise.resolve()}function Ct(t){const e=H.c(43),{info:n,onClose:s}=t,i=G(),o=n!==null;let c;e[0]!==s?(c=v=>!v&&s(),e[0]=s,e[1]=c):c=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(251,191,36,0.35) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(244,114,182,0.25) 0%, transparent 100%)"],e[2]=d):d=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=h.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:d.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[3]=p):p=e[3];let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w=h.jsx("div",{className:"flex items-center justify-center size-9 rounded-lg bg-warning/15 text-warning",children:h.jsx(xe,{size:18})}),e[4]=w):w=e[4];let x;e[5]!==i?(x=i("chat.uploader.fileTypeNotSupported"),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==x?(f=h.jsx(Ee,{className:"text-xl font-semibold tracking-tight",children:x}),e[7]=x,e[8]=f):f=e[8];const r=n?.fileName;let u;e[9]!==r?(u=h.jsxs("span",{className:"font-medium text-foreground",children:["“",r,"”"]}),e[9]=r,e[10]=u):u=e[10];let a;e[11]!==i?(a=i("chat.uploader.cantAttachToChat"),e[11]=i,e[12]=a):a=e[12];let k;e[13]!==a||e[14]!==u?(k=h.jsxs(Ne,{className:"mt-1.5 text-sm leading-relaxed",children:[u," ",a]}),e[13]=a,e[14]=u,e[15]=k):k=e[15];let F;e[16]!==k||e[17]!==f?(F=h.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,h.jsxs(Te,{className:"relative gap-4",children:[w,h.jsxs("div",{children:[f,k]})]})]}),e[16]=k,e[17]=f,e[18]=F):F=e[18];const S=n?.modelName??"";let b;e[19]!==i||e[20]!==S?(b=i("chat.uploader.accepts",{modelName:S}),e[19]=i,e[20]=S,e[21]=b):b=e[21];let j;e[22]!==b?(j=h.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground mb-2",children:b}),e[22]=b,e[23]=j):j=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=h.jsx(Oe,{size:14,className:"text-muted-foreground"}),e[24]=I):I=e[24];const M=n?.accepted;let D;e[25]!==M?(D=h.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground",children:[I,h.jsx("span",{className:"capitalize",children:M})]}),e[25]=M,e[26]=D):D=e[26];let l;e[27]!==j||e[28]!==D?(l=h.jsx("div",{className:"px-8 pt-3 pb-6 space-y-3",children:h.jsxs("div",{className:"rounded-xl border border-border p-4",children:[j,D]})}),e[27]=j,e[28]=D,e[29]=l):l=e[29];let m;e[30]!==i?(m=i("chat.uploader.gotIt"),e[30]=i,e[31]=m):m=e[31];let y;e[32]!==s||e[33]!==m?(y=h.jsx("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-end",children:h.jsx(ke,{onClick:s,children:m})}),e[32]=s,e[33]=m,e[34]=y):y=e[34];let _;e[35]!==F||e[36]!==l||e[37]!==y?(_=h.jsxs(Qe,{className:"sm:max-w-[480px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Ze,children:[F,l,y]}),e[35]=F,e[36]=l,e[37]=y,e[38]=_):_=e[38];let R;return e[39]!==o||e[40]!==c||e[41]!==_?(R=h.jsx($e,{open:o,onOpenChange:c,children:_}),e[39]=o,e[40]=c,e[41]=_,e[42]=R):R=e[42],R}function Ze(t){return t.preventDefault()}function St(){const t=H.c(3),[e,n]=C.useState(null);let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>n(null),t[0]=s):s=t[0];let i;return t[1]!==e?(i={unsupportedFile:e,onUnsupportedFile:n,clearUnsupportedFile:s},t[1]=e,t[2]=i):i=t[2],i}const Ge=t=>{const e=H.c(53),{editor:n,virtualMcpId:s,suggestionOpenRef:i}=t,o=G(),c=de(),{org:d}=ue(),p=ze();let w;e[0]!==p?(w=Be(p),e[0]=p,e[1]=w):w=e[1];const x=w;let f;e[2]!==d.id||e[3]!==d.slug||e[4]!==s?(f={connectionId:s,orgId:d.id,orgSlug:d.slug},e[2]=d.id,e[3]=d.slug,e[4]=s,e[5]=f):f=e[5];const r=pe(f);let u;e[6]!==d.id||e[7]!==s?(u=Z.virtualMcpResources(s,d.id),e[6]=d.id,e[7]=s,e[8]=u):u=e[8];const a=u,[k,F]=C.useState("categories");let S;e[9]!==k?(S=()=>k,e[9]=k,e[10]=S):S=e[10];const b=C.useEffectEvent(S),j=C.useRef(null),I=C.useRef(!1),M=s??"default";let D;e[11]!==k||e[12]!==d.id||e[13]!==M?(D=["at-mention",d.id,M,k],e[11]=k,e[12]=d.id,e[13]=M,e[14]=D):D=e[14];const l=D;let m;e[15]!==o?(m=o("chat.mentionAt.agentsTitle"),e[15]=o,e[16]=m):m=e[16];let y;e[17]!==o?(y=o("chat.mentionAt.agentsDescription"),e[17]=o,e[18]=y):y=e[18];let _;e[19]!==m||e[20]!==y?(_={name:"agents",title:m,description:y,kind:"category",drillable:!0},e[19]=m,e[20]=y,e[21]=_):_=e[21];let R;e[22]!==o?(R=o("chat.mentionAt.resourcesTitle"),e[22]=o,e[23]=R):R=e[23];let v;e[24]!==o?(v=o("chat.mentionAt.resourcesDescription"),e[24]=o,e[25]=v):v=e[25];let T;e[26]!==R||e[27]!==v?(T={name:"resources",title:R,description:v,kind:"category",drillable:!0},e[26]=R,e[27]=v,e[28]=T):T=e[28];let O;e[29]!==T||e[30]!==_?(O=[_,T],e[29]=T,e[30]=_,e[31]=O):O=e[31];const q=O;let g;e[32]!==r||e[33]!==n||e[34]!==o?(g=async U=>{const{item:P,range:K}=U;if($("chat_picker_item_selected",{picker:"@",item_kind:P.kind,item_name:P.name}),P.kind!=="category"&&(I.current=!0),P.kind==="category")return F(P.name==="agents"?"agents":"resources"),!1;if(P.kind==="agent"&&P.agentId){B(n,K,{id:P.agentId,name:P.name,metadata:{agentId:P.agentId,title:P.name},char:"@"}),F("categories");return}if(P.kind==="resource"&&P.uri&&r){try{const Q=await me(r,P.uri);B(n,K,{id:P.uri,name:P.uri,metadata:Q.contents,char:"@"})}catch(Q){console.error("[at-mention] Failed to fetch resource:",Q),N.error(o("chat.mentionAt.failedToLoadResource"))}F("categories");return}},e[32]=r,e[33]=n,e[34]=o,e[35]=g):g=e[35];const ee=g;let J;e[36]!==p||e[37]!==q||e[38]!==r||e[39]!==x||e[40]!==b||e[41]!==c||e[42]!==a||e[43]!==s?(J=async U=>{const{query:P}=U,K=b();if(K==="categories"){if(!P.trim())return q;const A=P.toLowerCase(),L=p.filter(E=>E.status==="active"&&(!E.id||!oe(E.id))&&!x.has(E.id)&&E.id!==s&&(E.title.toLowerCase().includes(A)||E.description?.toLowerCase().includes(A))).map(et),Y=await(async()=>{if(!r)return[];let E=c.getQueryData(a);return E||(E=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4})),(E?.resources??[]).filter(re=>re.uri.toLowerCase().includes(A)||re.name?.toLowerCase().includes(A)||re.description?.toLowerCase().includes(A)).map(tt)})();return[...L,...Y]}if(K==="agents"){let A=p.filter(L=>L.status==="active"&&(!L.id||!oe(L.id))&&!x.has(L.id)&&L.id!==s);if(P.trim()){const L=P.toLowerCase();A=A.filter(Y=>Y.title.toLowerCase().includes(L)||Y.description?.toLowerCase().includes(L))}return A.map(st)}if(!r)return[];let Q=c.getQueryData(a);Q?c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4}).catch(rt):Q=await c.fetchQuery({queryKey:a,queryFn:()=>z(r),staleTime:6e4});let V=Q?.resources??[];if(P.trim()){const A=P.toLowerCase();V=V.filter(L=>L.uri.toLowerCase().includes(A)||L.name?.toLowerCase().includes(A)||L.description?.toLowerCase().includes(A))}return V.map(nt)},e[36]=p,e[37]=q,e[38]=r,e[39]=x,e[40]=b,e[41]=c,e[42]=a,e[43]=s,e[44]=J):J=e[44];const te=J;let W;e[45]!==i?(W=U=>{if(i&&(i.current=U),U)j.current=Date.now(),I.current=!1,$("chat_picker_opened",{picker:"@"});else{const P=j.current;$("chat_picker_closed",{picker:"@",outcome:I.current?"selected":"dismissed",duration_ms:P?Date.now()-P:null}),j.current=null,F("categories")}},e[45]=i,e[46]=W):W=e[46];const se=W;let X;return e[47]!==n||e[48]!==te||e[49]!==ee||e[50]!==se||e[51]!==l?(X=h.jsx(fe,{editor:n,char:"@",pluginKey:"atDropdownMenu",queryKey:l,queryFn:te,onSelect:ee,onOpenChange:se}),e[47]=n,e[48]=te,e[49]=ee,e[50]=se,e[51]=l,e[52]=X):X=e[52],X};function et(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function tt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}function st(t){return{name:t.title,title:t.title,description:t.description??void 0,icon:t.icon??null,kind:"agent",agentId:t.id}}function rt(){}function nt(t){return{name:t.name??t.uri,title:t.name,description:t.description,kind:"resource",uri:t.uri}}async function le(t,e,n,s,i,o,c){try{const d=await ge(n,s,o);B(t,e,{id:s,name:he(s,i),metadata:d.messages,char:"/",kind:"prompt",args:o})}catch(d){console.error("[slash] Failed to fetch prompt:",d),N.error(c.t("chat.mentionSlash.failedLoadPrompt"))}}async function ot(t,e,n,s,i){try{const o=await me(n,s);B(t,e,{id:s,name:s,metadata:o.contents,char:"/",kind:"resource"})}catch(o){console.error("[slash] Failed to fetch resource:",o),N.error(i.t("chat.mentionSlash.failedLoadResource"))}}async function it(t,e,n,s,i){try{const{files:o,omittedPaths:c}=await He(n,s.volume,s.path),d={sandboxPath:s.sandboxPath,volume:s.volume,path:s.path,files:o,omittedPaths:c};B(t,e,{id:s.id,name:s.name,metadata:d,char:"/",kind:"skill"})}catch(o){console.error("[slash] Failed to fetch skill:",o),N.error(i.t("chat.mentionSlash.failedLoadSkill"))}}const at=({editor:t,virtualMcpId:e,suggestionOpenRef:n})=>{const s=G(),i=de(),{org:o}=ue(),c=pe({connectionId:e,orgId:o.id,orgSlug:o.slug}),d=Z.virtualMcpPrompts(e,o.id),p=Z.virtualMcpResources(e,o.id),w=Z.slashSkills(o.id),x=["slash-mention",o.id,e??"default"],[f,r]=C.useState(null),[u,a]=C.useState(null),k=Se(t);k&&(k.onEditChip=async l=>{if(c)try{const y=(await ce(i,d,c)).find(_=>_.name===l.promptId);if(!y?.arguments||y.arguments.length===0)return;a({...l,prompt:y})}catch(m){console.error("[slash] Failed to load prompt for editing:",m),N.error(s("chat.mentionSlash.failedLoadPrompt"))}});const F=C.useRef(null),S=C.useRef(!1),b=async({item:l,range:m})=>{if($("chat_picker_item_selected",{picker:"/",item_kind:l.kind,item_name:l.name}),S.current=!0,!!c)if(l.kind==="prompt"){if(l.arguments&&l.arguments.length>0){r({range:m,item:l});return}const y=ne(l._meta);await le(t,m,c,l.name,y,void 0,{t:s})}else l.kind==="skill"?l.skill&&await it(t,m,o.slug,l.skill,{t:s}):l.uri&&await ot(t,m,c,l.uri,{t:s})},j=async l=>{if(!f||!c)return;const{range:m,item:y}=f,_=ne(y._meta);await le(t,m,c,y.name,_,l,{t:s}),r(null)},I=async l=>{if(!(!u||!c)){if(!Fe(t,u.pos,u.promptId)){N.error(s("chat.mentionSlash.failedUpdatePrompt")),a(null);return}try{const m=await ge(c,u.promptId,l),y=ne(u.prompt._meta);t.chain().focus().setNodeSelection(u.pos).deleteSelection().insertContentAt(u.pos,Ie({id:u.promptId,name:he(u.promptId,y),metadata:m.messages,char:"/",kind:"prompt",args:l})).run(),$("chat_picker_item_selected",{picker:"/edit",item_kind:"prompt",item_name:u.promptId})}catch(m){console.error("[slash] Failed to update prompt:",m),N.error(s("chat.mentionSlash.failedUpdatePrompt"))}a(null)}},M=async l=>{const{query:m}=l;if(!c)return[];const[y,_,R]=await Promise.all([ce(i,d,c),ct(i,p,c),lt(i,w,o.slug)]),v=m.trim().toLowerCase(),T=(y??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.title?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.title,description:g.description,kind:"prompt",arguments:g.arguments,_meta:g._meta})),O=(_??[]).filter(g=>!v||g.uri.toLowerCase().includes(v)||g.name?.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name??g.uri,title:g.name,description:g.description,kind:"resource",uri:g.uri})),q=(R??[]).filter(g=>!v||g.name.toLowerCase().includes(v)||g.id.toLowerCase().includes(v)||g.description?.toLowerCase().includes(v)).map(g=>({name:g.name,title:g.name,description:g.description??void 0,kind:"skill",skill:g}));return[...T,...O,...q]},D=f?.item.kind==="prompt"?{name:f.item.name,title:f.item.title,arguments:f.item.arguments,description:f.item.description,_meta:f.item._meta}:null;return h.jsxs(h.Fragment,{children:[h.jsx(fe,{editor:t,char:"/",pluginKey:"slashDropdownMenu",queryKey:x,queryFn:M,onSelect:b,onOpenChange:l=>{if(n&&(n.current=l),l)F.current=Date.now(),S.current=!1,$("chat_picker_opened",{picker:"/"});else{const m=F.current;$("chat_picker_closed",{picker:"/",outcome:S.current?"selected":"dismissed",duration_ms:m?Date.now()-m:null}),F.current=null}}}),h.jsx(ie,{prompt:D,setPrompt:()=>r(null),onSubmit:j}),h.jsx(ie,{prompt:u?.prompt??null,setPrompt:()=>a(null),onSubmit:I,defaultValues:u?.args},u?`edit-${u.promptId}-${u.pos}`:"edit-idle")]})};async function ce(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>ae(n),staleTime:6e4}).catch(()=>{}),s?.prompts??[]}async function lt(t,e,n){const s=t.getQueryData(e),i=()=>t.fetchQuery({queryKey:e,queryFn:()=>Je(n),staleTime:6e4});return s?(i().catch(()=>{}),s):i().catch(()=>[])}async function ct(t,e,n){let s=t.getQueryData(e);return s?t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}):s=await t.fetchQuery({queryKey:e,queryFn:()=>z(n),staleTime:6e4}).catch(()=>{}),s?.resources??[]}const ye="Ask anything, / for prompts & skills, @ for agents & resources...";function dt(t){return[Le.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,dropcursor:!1}),be.configure({placeholder:()=>t.current??ye,showOnlyWhenEditable:!1}),Me,Re]}function Ft({tiptapDoc:t,setTiptapDoc:e,disabled:n=!1,enterToSubmit:s=!1,placeholder:i,onSubmit:o,suggestionOpenRef:c,children:d}){const p=C.useRef(o),w=C.useRef(e),x=C.useRef(s),f=C.useRef(i),r=De({extensions:dt(f),content:t||"",editorProps:{attributes:{"data-chat-input":"true",role:"textbox","aria-multiline":"true","aria-label":i??ye,class:"prose prose-sm max-w-none focus:outline-none w-full h-full text-[15px] p-[18px]"},handleKeyDown:(u,a)=>a.key==="Enter"&&!a.shiftKey&&x.current&&!c?.current?(a.preventDefault(),p.current?.(),!0):!1},onUpdate:({editor:u})=>{w.current(u?.getJSON())}});return C.useEffect(()=>{r?.setEditable(!n)},[r,n]),C.useEffect(()=>{p.current=o},[o]),C.useEffect(()=>{w.current=e},[e]),C.useEffect(()=>{x.current=s},[s]),C.useEffect(()=>{f.current=i},[i]),C.useEffect(()=>{if(!r||r.isDestroyed)return;const u=JSON.stringify(r.getJSON()),a=JSON.stringify(t||{type:"doc",content:[]});u!==a&&r.commands.setContent(t||{type:"doc",content:[]})},[r,t]),h.jsx(je.Provider,{value:{editor:r},children:d})}function It(t){const e=H.c(29),{disabled:n,virtualMcpId:s,showFileUploader:i,selectedModel:o,onUnsupportedFile:c,suggestionOpenRef:d,ref:p,className:w}=t,x=n===void 0?!1:n,f=i===void 0?!1:i,{editor:r}=ve();let u,a;if(e[0]!==r?(u=()=>({focus:()=>{r?.commands.focus()},clear:()=>{r?.commands.clearContent(!0)},appendText:y=>{if(!r)return;const _=r.state.doc.textContent.trim()==="";r.commands.focus("end"),_||r.commands.insertContent(" "),r.commands.insertContent(y)},syncVoiceText:(y,_)=>{if(r&&(r.commands.setContent(y||{type:"doc",content:[]}),_)){r.commands.focus("end");const R=r.state.doc.textContent.trim().length>0;r.commands.insertContent({type:"text",text:R?" "+_:_})}},restoreContent:y=>{r&&r.commands.setContent(y||{type:"doc",content:[]})}}),a=[r],e[0]=r,e[1]=u,e[2]=a):(u=e[1],a=e[2]),C.useImperativeHandle(p??null,u,a),!r)return null;const k=x&&"cursor-not-allowed opacity-70",F=x&&"[&_.ProseMirror]:cursor-not-allowed";let S;e[3]!==w||e[4]!==k||e[5]!==F?(S=we("overflow-y-auto relative flex-1 max-h-[164px] min-h-[20px] w-full flex flex-col",w,"[&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[20px] [&_.ProseMirror]:flex-1","[&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.ProseMirror_p.is-editor-empty:first-child::before]:opacity-50","[&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left","[&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none","[&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0","[&_.ProseMirror_p.is-editor-empty:first-child::before]:w-full","[&_.ProseMirror_p.is-editor-empty:first-child::before]:break-words",k,F),e[3]=w,e[4]=k,e[5]=F,e[6]=S):S=e[6];let b;e[7]!==r||e[8]!==S?(b=h.jsx(Ae,{editor:r,className:S}),e[7]=r,e[8]=S,e[9]=b):b=e[9];const j=s??null;let I;e[10]!==r||e[11]!==d||e[12]!==j?(I=h.jsx(C.Suspense,{fallback:null,children:h.jsx(at,{editor:r,virtualMcpId:j,suggestionOpenRef:d})}),e[10]=r,e[11]=d,e[12]=j,e[13]=I):I=e[13];const M=s??null;let D;e[14]!==r||e[15]!==d||e[16]!==M?(D=h.jsx(C.Suspense,{fallback:null,children:h.jsx(Ge,{editor:r,virtualMcpId:M,suggestionOpenRef:d})}),e[14]=r,e[15]=d,e[16]=M,e[17]=D):D=e[17];let l;e[18]!==x||e[19]!==r||e[20]!==c||e[21]!==o||e[22]!==f?(l=f&&o&&!x?h.jsx(Xe,{editor:r,selectedModel:o,onUnsupportedFile:c}):null,e[18]=x,e[19]=r,e[20]=c,e[21]=o,e[22]=f,e[23]=l):l=e[23];let m;return e[24]!==I||e[25]!==D||e[26]!==l||e[27]!==b?(m=h.jsxs(h.Fragment,{children:[b,I,D,l]}),e[24]=I,e[25]=D,e[26]=l,e[27]=b,e[28]=m):m=e[28],m}export{Ft as T,Ct as U,It as a,We as p,St as u};
@@ -1,4 +1,4 @@
1
- import{aL as Ee,c as D,b as B,r as L,l as U,j as n,ao as he,bM as fs,ap as de,bL as st,B as q,an as ms,am as hs,bN as xs,bK as gs,x as ke,aU as bs,dL as we,dM as ft,a2 as vs,e as As,t as De,q as te,X as Se,d as nt,dJ as ys,Z as js,K as ws,m as ks,I as Ss,F as Cs,H as Ns,G as Ae,aR as mt,aS as ht,aT as xt,h as Ts,aA as Is,az as _s,af as Ms,aF as Rs,aG as Ds,a as Ps,U as Es,V as Ls,as as Xe,a6 as _t,bT as Fs,ay as zs}from"./index-CyII4Hy-.js";import{c as $s,d as Mt,P as Us,i as Os}from"./index-BNMHslbt.js";import{K as Bs,c as Ks}from"./shell-layout-D9Y783sH.js";import{a as Qs}from"./repository-binding-IbB3w4K1.js";import{w as Ys,A as Gs}from"./autosend-D06niWhv.js";import{s as qs,r as gt,i as Hs,c as Ws,w as Js,H as Zs}from"./chat-draft-C1Z2usHD.js";import{u as Xs}from"./use-session-runtime-CN6BtDG2.js";import{i as Rt}from"./ArrowRight-C4cldeMa.js";import{i as Dt}from"./ArrowUp-B7hrL_y6.js";import{n as Pt}from"./ShoppingBag01-CotBP4xM.js";import{i as ot}from"./Check-DqhJRaRV.js";import{t as Qe,aJ as Et,_ as Lt,aK as et,f as rt,ap as en,W as tn,aL as sn,p as Ft,aM as zt,F as nn,aN as on}from"./agent-icon-D7av-7g5.js";import{a as $t}from"./Image01-BWtqkynf.js";import{g as rn}from"./UserSquare-Di4b5Jsn.js";import{i as an}from"./Upload01-D8px3BRb.js";import{i as it}from"./X-Sz3H1SE9.js";import{a as Le,b as Ye,c as Ge,i as ln,k as Vn,l as cn,m as dn,n as un,o as pn,p as fn,q as mn,f as hn,u as xn,s as gn,d as bn}from"./chat-context-W4FU8MtG.js";import{m as vn,z as An,o as yn,c as jn}from"./thread-intent-D4_GmX4s.js";import{i as wn}from"./AlertCircle-D9i2E7F3.js";import{a as kn}from"./Copy01-B9W9lwCV.js";import{a as tt,b as at,d as lt,f as Vt,F as Ut}from"./form-CZCyqosr.js";import{c as Sn,S as Cn,b as Nn,a as Tn,d as In}from"./select-B-7TWojP.js";import{t as Ot}from"./ChevronUp-DluVhiDY.js";import{T as qe,a as He,b as We}from"./tooltip-DLtvNdpW.js";import{i as _n}from"./ArrowLeft-u4YtETq6.js";import{M as Mn,S as Rn}from"./usage-stats-ggbnrdm_.js";import{c as Dn,b as Pn}from"./tabs-BXwDZNIq.js";import{d as En,h as Ln,c as Fn,b as zn,D as $n}from"./dialog-BAdncaXR.js";import{e as Fe,f as Un,c as On,g as Bn}from"./use-decopilot-events-pau4MIxW.js";import{u as Kn}from"./use-deco-credits-BrV-RGWx.js";import{I as Qn}from"./input-BBwMBvzR.js";import{T as bt,a as Yn}from"./toggle-group-Dpg_xjST.js";import{s as Gn}from"./tool-namespace-DmnQIdtF.js";import{t as qn}from"./utils-CVEq3hMx.js";import{u as Hn}from"./use-open-billing-url-BrPfG0rC.js";import{s as Wn}from"./XClose-DCiqvNA0.js";import{M as Jn,m as ct,g as Zn,a as Xn}from"./decopilot-HlYS-QdU.js";import{a as Bt,b as Kt,P as Qt}from"./popover-BRE8ILKE.js";import{c as eo,b as to,a as so,D as no}from"./drawer-zM2wJmT-.js";import{u as Yt}from"./use-mobile-X-W7raUh.js";import{t as oo}from"./Tool01-DqqLglaA.js";import{c as ro,a as io}from"./use-organization-settings-DpQArW0s.js";import{u as Gt,c as ao}from"./use-ai-providers-DXh7LZcb.js";import{M as lo}from"./index-BsSqoVQb.js";import{p as qt,u as Vo,T as co,a as uo,U as po}from"./input-COz__3we.js";import{d as fo,g as vt,s as mo}from"./gateway-client-Ca84PQdv.js";import{u as ho}from"./use-mcp-client-GJ7Avhzh.js";import{l as xo,g as go}from"./use-mcp-prompts-CZeaf3zb.js";import{i as bo}from"./Link01-p2T3eBYS.js";import{s as At}from"./Plus-C8_7wQVY.js";import"./suggestion-DYUHap8V.js";import{p as vo,q as Ao}from"./question-004-sINsf4GQ.js";import{A as yo}from"./avatar-BSQm92_6.js";import{u as jo}from"./use-members-BsM8EAty.js";import{F as yt}from"./feature-paywall-BIe070wa.js";import{A as wo}from"./add-connection-dialog-BQ-RcQt0.js";import{b as ko}from"./use-chat-layout-state-1gL-qD2O.js";import{u as So}from"./use-is-desktop-app-BNujXJc_.js";const Co=Ee("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const No=Ee("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const To=Ee("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Io=Ee("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const _o=Ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Ze="cubic-bezier(0.645, 0.045, 0.355, 1)",Da=44,Mo={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},Ro={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Do={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=D.c(69),{icon:s,label:o,count:i,title:r,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[h,m]=L.useState(d),[x,b]=L.useState(!1);let g;e[0]!==c?(g=()=>{b(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const v=g;if(x)return null;const A=Ro[p],w=Mo[p];let j;e[2]!==A||e[3]!==w?(j=U("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,w),e[2]=A,e[3]=w,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(Po),e[5]=y):y=e[5];const k=h&&"rounded-b-none",C=!h&&"rounded-b-xl";let S;e[6]!==k||e[7]!==C?(S=U("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",k,C),e[6]=k,e[7]=C,e[8]=S):S=e[8];const N=Do[p];let T;e[9]!==N?(T=U("shrink-0",N),e[9]=N,e[10]=T):T=e[10];let M;e[11]!==s||e[12]!==T?(M=n.jsx("span",{className:T,children:s}),e[11]=s,e[12]=T,e[13]=M):M=e[13];let _;e[14]!==o?(_=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=_):_=e[15];let P;e[16]!==i?(P=i?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:i}):null,e[16]=i,e[17]=P):P=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let I;e[18]!==E?(I=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Ot,{size:16,style:{transform:E,transition:`transform 180ms ${Ze}`}})}),e[18]=E,e[19]=I):I=e[19];let F;e[20]!==f?(F=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=F):F=e[21];let $;e[22]!==f?($=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=$):$=e[23];let G,O;e[24]!==v?(G=ie=>{ie.stopPropagation(),v()},O=ie=>{(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),ie.stopPropagation(),v())},e[24]=v,e[25]=G,e[26]=O):(G=e[25],O=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(it,{size:16}),e[27]=z):z=e[27];let Y;e[28]!==F||e[29]!==$||e[30]!==G||e[31]!==O?(Y=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:$,onClick:G,onKeyDown:O,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:z}),e[28]=F,e[29]=$,e[30]=G,e[31]=O,e[32]=Y):Y=e[32];let Z;e[33]!==h||e[34]!==M||e[35]!==_||e[36]!==P||e[37]!==I||e[38]!==Y||e[39]!==S?(Z=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:S,children:[M,_,P,I,Y]}),e[33]=h,e[34]=M,e[35]=_,e[36]=P,e[37]=I,e[38]=Y,e[39]=S,e[40]=Z):Z=e[40];const se=h?"1fr":"0fr";let X;e[41]!==se?(X={display:"grid",gridTemplateRows:se,transition:`grid-template-rows 180ms ${Ze}`},e[41]=se,e[42]=X):X=e[42];let R;e[43]===Symbol.for("react.memo_cache_sentinel")?(R={overflow:"hidden",minHeight:0},e[43]=R):R=e[43];const K=h?1:0;let W;e[44]!==K?(W={opacity:K,transition:`opacity 120ms ${Ze}`,maxHeight:"60vh"},e[44]=K,e[45]=W):W=e[45];let ee;e[46]!==r?(ee=r?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:r})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=r,e[47]=ee):ee=e[47];let J;e[48]!==V||e[49]!==r?(J=V?n.jsx("div",{className:U("pb-4",!r&&"pt-4"),children:V}):null,e[48]=V,e[49]=r,e[50]=J):J=e[50];let re;e[51]!==ee||e[52]!==J?(re=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ee,J]}),e[51]=ee,e[52]=J,e[53]=re):re=e[53];let H;e[54]!==a||e[55]!==l?(H=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=H):H=e[56];let le;e[57]!==W||e[58]!==re||e[59]!==H?(le=n.jsx("div",{style:R,children:n.jsxs("div",{className:"flex flex-col",style:W,children:[re,H]})}),e[57]=W,e[58]=re,e[59]=H,e[60]=le):le=e[60];let oe;e[61]!==X||e[62]!==le?(oe=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:X,children:le}),e[61]=X,e[62]=le,e[63]=oe):oe=e[63];let pe;return e[64]!==Z||e[65]!==oe||e[66]!==j||e[67]!==p?(pe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:j,children:[Z,oe]}),e[64]=Z,e[65]=oe,e[66]=j,e[67]=p,e[68]=pe):pe=e[68],pe}function Po(t){return!t}const Eo=he({content:de().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:st(["pending","in_progress","completed"]),activeForm:de().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Ht=he({todos:fs(Eo)}),Lo="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";vn({description:Lo,inputSchema:An(Ht),execute:async({todos:t})=>({ok:!0,count:t.length})});const Fo="tool-todo_write",zo=new Set(["input-available","output-available"]);function $o(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let i=o.length-1;i>=0;i--){const r=o[i];if(r.type!==Fo||typeof r.state!="string"||!zo.has(r.state))continue;const a=Ht.safeParse(r.input);if(a.success)return a.data.todos}}return[]}function Wt(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:qn(Gn(o)),input:s.input})}return e}function Jt(t){return t.at(-1)}function Zt(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function Uo(t){return t?t.message.startsWith("[CREDITS]"):!1}const Oo={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Bo(t){const{messages:e,error:s,finishReason:o,isStreaming:i,isWaitingForApprovals:r}=t;if(!i&&s&&Uo(s))return{...Oo,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(j=>j.type==="tool-user_ask").filter(j=>j.state!=="output-available").length,c=V.some(j=>j.type==="tool-suggest_task"&&j.state==="input-available"),p=Zt(l),f=Wt(V),h=$o(e),m=i?null:qs(s),x=i?null:yn(s),b=!i&&!!s&&!m&&!x,g=f.length>0||i&&r,v=p.length>0,w=!i&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||g||v||c))&&!b;return{isCreditExhausted:!1,planRefusal:x,subscriptionErrorKind:m,hasTodos:h.length>0,showError:b,showWarning:w,hasApprovals:g,hasPlans:v,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:h}}function Xt(){const t=D.c(6),{messages:e,error:s,finishReason:o,isStreaming:i,isWaitingForApprovals:r}=Le(),a=s??null,l=o??null;let V;return t[0]!==i||t[1]!==r||t[2]!==e||t[3]!==a||t[4]!==l?(V=Bo({messages:e,error:a,finishReason:l,isStreaming:i,isWaitingForApprovals:r}),t[0]=i,t[1]=r,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function Pa(){const t=Xt(),e=Fe("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const jt="start-task",Ko=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
1
+ import{aL as Ee,c as D,b as B,r as L,l as U,j as n,ao as he,bM as fs,ap as de,bL as st,B as q,an as ms,am as hs,bN as xs,bK as gs,x as ke,aU as bs,dL as we,dM as ft,a2 as vs,e as As,t as De,q as te,X as Se,d as nt,dJ as ys,Z as js,K as ws,m as ks,I as Ss,F as Cs,H as Ns,G as Ae,aR as mt,aS as ht,aT as xt,h as Ts,aA as Is,az as _s,af as Ms,aF as Rs,aG as Ds,a as Ps,U as Es,V as Ls,as as Xe,a6 as _t,bT as Fs,ay as zs}from"./index-Cif-NWVp.js";import{c as $s,d as Mt,P as Us,i as Os}from"./index-CM1GEUnU.js";import{K as Bs,c as Ks}from"./shell-layout-2lFwLRyB.js";import{a as Qs}from"./repository-binding-DSb755tD.js";import{w as Ys,A as Gs}from"./autosend-CbvWggSc.js";import{s as qs,r as gt,i as Hs,c as Ws,w as Js,H as Zs}from"./chat-draft-BVrhHV88.js";import{u as Xs}from"./use-session-runtime-6x58C-tT.js";import{i as Rt}from"./ArrowRight-CSNzIA9B.js";import{i as Dt}from"./ArrowUp-BzLrItni.js";import{n as Pt}from"./ShoppingBag01-DQq21IAe.js";import{i as ot}from"./Check-w1vYw5Rn.js";import{t as Qe,aJ as Et,_ as Lt,aK as et,f as rt,ap as en,W as tn,aL as sn,p as Ft,aM as zt,F as nn,aN as on}from"./agent-icon-DEau6pQP.js";import{a as $t}from"./Image01-BObY5rn9.js";import{g as rn}from"./UserSquare-CaMR-kX2.js";import{i as an}from"./Upload01-B58Org46.js";import{i as it}from"./X-GZ5ISsIL.js";import{a as Le,b as Ye,c as Ge,i as ln,k as Vn,l as cn,m as dn,n as un,o as pn,p as fn,q as mn,f as hn,u as xn,s as gn,d as bn}from"./chat-context-C7aSqPqa.js";import{m as vn,z as An,o as yn,c as jn}from"./thread-intent-kYQuJDvD.js";import{i as wn}from"./AlertCircle-D-RDeHL_.js";import{a as kn}from"./Copy01-uPL40TdR.js";import{a as tt,b as at,d as lt,f as Vt,F as Ut}from"./form-DQ9-jmhe.js";import{c as Sn,S as Cn,b as Nn,a as Tn,d as In}from"./select-Do8VXC56.js";import{t as Ot}from"./ChevronUp-BWOObG8Z.js";import{T as qe,a as He,b as We}from"./tooltip-CnfGv3UJ.js";import{i as _n}from"./ArrowLeft-DVpME15-.js";import{M as Mn,S as Rn}from"./usage-stats-DErvibLB.js";import{c as Dn,b as Pn}from"./tabs-oRlU6S30.js";import{d as En,h as Ln,c as Fn,b as zn,D as $n}from"./dialog-xO6pvTgy.js";import{e as Fe,f as Un,c as On,g as Bn}from"./use-decopilot-events-CxBOYWC8.js";import{u as Kn}from"./use-deco-credits-DgLSuY0L.js";import{I as Qn}from"./input-yDOZz3Y8.js";import{T as bt,a as Yn}from"./toggle-group-CvgNphfI.js";import{s as Gn}from"./tool-namespace-DmnQIdtF.js";import{t as qn}from"./utils-CVEq3hMx.js";import{u as Hn}from"./use-open-billing-url-pGoiHk39.js";import{s as Wn}from"./XClose-uQDj2qbC.js";import{M as Jn,m as ct,g as Zn,a as Xn}from"./decopilot-Ch9InHOw.js";import{a as Bt,b as Kt,P as Qt}from"./popover-Cj-r--VT.js";import{c as eo,b as to,a as so,D as no}from"./drawer-COUS-RMw.js";import{u as Yt}from"./use-mobile-DvZ73KtH.js";import{t as oo}from"./Tool01-Booc4u0n.js";import{c as ro,a as io}from"./use-organization-settings--iPsUcy7.js";import{u as Gt,c as ao}from"./use-ai-providers-DOIgUjwL.js";import{M as lo}from"./index-D-ZSPXmz.js";import{p as qt,u as Vo,T as co,a as uo,U as po}from"./input-D4o2a2Ep.js";import{d as fo,g as vt,s as mo}from"./gateway-client-BuRwuqbN.js";import{u as ho}from"./use-mcp-client-DOo0zS-A.js";import{l as xo,g as go}from"./use-mcp-prompts-DUcez8YA.js";import{i as bo}from"./Link01-BS-vCNzQ.js";import{s as At}from"./Plus-BvjmhLnx.js";import"./suggestion-CAkZpnvu.js";import{p as vo,q as Ao}from"./question-004-sINsf4GQ.js";import{A as yo}from"./avatar-Dc1WJG2B.js";import{u as jo}from"./use-members-_nsnfGaz.js";import{F as yt}from"./feature-paywall-BbGJmd8V.js";import{A as wo}from"./add-connection-dialog-CRBSt35d.js";import{b as ko}from"./use-chat-layout-state-yrmi1Gwb.js";import{u as So}from"./use-is-desktop-app-BNujXJc_.js";const Co=Ee("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const No=Ee("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const To=Ee("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Io=Ee("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const _o=Ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Ze="cubic-bezier(0.645, 0.045, 0.355, 1)",Da=44,Mo={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},Ro={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Do={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=D.c(69),{icon:s,label:o,count:i,title:r,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[h,m]=L.useState(d),[x,b]=L.useState(!1);let g;e[0]!==c?(g=()=>{b(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const v=g;if(x)return null;const A=Ro[p],w=Mo[p];let j;e[2]!==A||e[3]!==w?(j=U("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,w),e[2]=A,e[3]=w,e[4]=j):j=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(Po),e[5]=y):y=e[5];const k=h&&"rounded-b-none",C=!h&&"rounded-b-xl";let S;e[6]!==k||e[7]!==C?(S=U("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",k,C),e[6]=k,e[7]=C,e[8]=S):S=e[8];const N=Do[p];let T;e[9]!==N?(T=U("shrink-0",N),e[9]=N,e[10]=T):T=e[10];let M;e[11]!==s||e[12]!==T?(M=n.jsx("span",{className:T,children:s}),e[11]=s,e[12]=T,e[13]=M):M=e[13];let _;e[14]!==o?(_=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=_):_=e[15];let P;e[16]!==i?(P=i?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:i}):null,e[16]=i,e[17]=P):P=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let I;e[18]!==E?(I=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Ot,{size:16,style:{transform:E,transition:`transform 180ms ${Ze}`}})}),e[18]=E,e[19]=I):I=e[19];let F;e[20]!==f?(F=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=F):F=e[21];let $;e[22]!==f?($=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=$):$=e[23];let G,O;e[24]!==v?(G=ie=>{ie.stopPropagation(),v()},O=ie=>{(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),ie.stopPropagation(),v())},e[24]=v,e[25]=G,e[26]=O):(G=e[25],O=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(it,{size:16}),e[27]=z):z=e[27];let Y;e[28]!==F||e[29]!==$||e[30]!==G||e[31]!==O?(Y=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:$,onClick:G,onKeyDown:O,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:z}),e[28]=F,e[29]=$,e[30]=G,e[31]=O,e[32]=Y):Y=e[32];let Z;e[33]!==h||e[34]!==M||e[35]!==_||e[36]!==P||e[37]!==I||e[38]!==Y||e[39]!==S?(Z=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:S,children:[M,_,P,I,Y]}),e[33]=h,e[34]=M,e[35]=_,e[36]=P,e[37]=I,e[38]=Y,e[39]=S,e[40]=Z):Z=e[40];const se=h?"1fr":"0fr";let X;e[41]!==se?(X={display:"grid",gridTemplateRows:se,transition:`grid-template-rows 180ms ${Ze}`},e[41]=se,e[42]=X):X=e[42];let R;e[43]===Symbol.for("react.memo_cache_sentinel")?(R={overflow:"hidden",minHeight:0},e[43]=R):R=e[43];const K=h?1:0;let W;e[44]!==K?(W={opacity:K,transition:`opacity 120ms ${Ze}`,maxHeight:"60vh"},e[44]=K,e[45]=W):W=e[45];let ee;e[46]!==r?(ee=r?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:r})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=r,e[47]=ee):ee=e[47];let J;e[48]!==V||e[49]!==r?(J=V?n.jsx("div",{className:U("pb-4",!r&&"pt-4"),children:V}):null,e[48]=V,e[49]=r,e[50]=J):J=e[50];let re;e[51]!==ee||e[52]!==J?(re=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ee,J]}),e[51]=ee,e[52]=J,e[53]=re):re=e[53];let H;e[54]!==a||e[55]!==l?(H=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=H):H=e[56];let le;e[57]!==W||e[58]!==re||e[59]!==H?(le=n.jsx("div",{style:R,children:n.jsxs("div",{className:"flex flex-col",style:W,children:[re,H]})}),e[57]=W,e[58]=re,e[59]=H,e[60]=le):le=e[60];let oe;e[61]!==X||e[62]!==le?(oe=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:X,children:le}),e[61]=X,e[62]=le,e[63]=oe):oe=e[63];let pe;return e[64]!==Z||e[65]!==oe||e[66]!==j||e[67]!==p?(pe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:j,children:[Z,oe]}),e[64]=Z,e[65]=oe,e[66]=j,e[67]=p,e[68]=pe):pe=e[68],pe}function Po(t){return!t}const Eo=he({content:de().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:st(["pending","in_progress","completed"]),activeForm:de().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Ht=he({todos:fs(Eo)}),Lo="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";vn({description:Lo,inputSchema:An(Ht),execute:async({todos:t})=>({ok:!0,count:t.length})});const Fo="tool-todo_write",zo=new Set(["input-available","output-available"]);function $o(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let i=o.length-1;i>=0;i--){const r=o[i];if(r.type!==Fo||typeof r.state!="string"||!zo.has(r.state))continue;const a=Ht.safeParse(r.input);if(a.success)return a.data.todos}}return[]}function Wt(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:qn(Gn(o)),input:s.input})}return e}function Jt(t){return t.at(-1)}function Zt(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function Uo(t){return t?t.message.startsWith("[CREDITS]"):!1}const Oo={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function Bo(t){const{messages:e,error:s,finishReason:o,isStreaming:i,isWaitingForApprovals:r}=t;if(!i&&s&&Uo(s))return{...Oo,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(j=>j.type==="tool-user_ask").filter(j=>j.state!=="output-available").length,c=V.some(j=>j.type==="tool-suggest_task"&&j.state==="input-available"),p=Zt(l),f=Wt(V),h=$o(e),m=i?null:qs(s),x=i?null:yn(s),b=!i&&!!s&&!m&&!x,g=f.length>0||i&&r,v=p.length>0,w=!i&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||g||v||c))&&!b;return{isCreditExhausted:!1,planRefusal:x,subscriptionErrorKind:m,hasTodos:h.length>0,showError:b,showWarning:w,hasApprovals:g,hasPlans:v,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:h}}function Xt(){const t=D.c(6),{messages:e,error:s,finishReason:o,isStreaming:i,isWaitingForApprovals:r}=Le(),a=s??null,l=o??null;let V;return t[0]!==i||t[1]!==r||t[2]!==e||t[3]!==a||t[4]!==l?(V=Bo({messages:e,error:a,finishReason:l,isStreaming:i,isWaitingForApprovals:r}),t[0]=i,t[1]=r,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function Pa(){const t=Xt(),e=Fe("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)+Number(t.hasTaskSuggestion)}const jt="start-task",Ko=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
2
2
 
3
3
  1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
4
4
  2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name.
@@ -1 +1 @@
1
- import{c as l,l as a,j as d}from"./index-CyII4Hy-.js";function c(s){const e=l.c(10);let i,r,t;e[0]!==s?({className:i,type:t,...r}=s,e[0]=s,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let o;e[4]!==i?(o=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-[var(--studio-control-height,2.25rem)] w-full min-w-0 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=o):o=e[5];let n;return e[6]!==r||e[7]!==o||e[8]!==t?(n=d.jsx("input",{type:t,"data-slot":"input",className:o,...r}),e[6]=r,e[7]=o,e[8]=t,e[9]=n):n=e[9],n}export{c as I};
1
+ import{c as l,l as a,j as d}from"./index-Cif-NWVp.js";function c(s){const e=l.c(10);let i,r,t;e[0]!==s?({className:i,type:t,...r}=s,e[0]=s,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let o;e[4]!==i?(o=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-[var(--studio-control-height,2.25rem)] w-full min-w-0 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=o):o=e[5];let n;return e[6]!==r||e[7]!==o||e[8]!==t?(n=d.jsx("input",{type:t,"data-slot":"input",className:o,...r}),e[6]=r,e[7]=o,e[8]=t,e[9]=n):n=e[9],n}export{c as I};
@@ -1 +1 @@
1
- import{c as k,j as h,r as C,l as L}from"./index-CyII4Hy-.js";import{A as Z,at as y}from"./agent-icon-D7av-7g5.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function D(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const a=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==a?(l=h.jsx(Z,{icon:e,name:s,size:a,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=a,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),a=!!e&&S,l=M[n],N=R[n];let r;t[0]!==o||t[1]!==l||t[2]!==N?(r=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,N,o),t[0]=o,t[1]=l,t[2]=N,t[3]=r):r=t[3];const p=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!a&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==p||t[11]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=p,t[11]=m,t[12]=d):d=t[12];const z=a&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(y,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==r?(b=h.jsxs("div",{className:r,children:[d,u]}),t[21]=d,t[22]=u,t[23]=r,t[24]=b):b=t[24],b}export{D as I};
1
+ import{c as k,j as h,r as C,l as L}from"./index-Cif-NWVp.js";import{A as Z,at as y}from"./agent-icon-DEau6pQP.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function D(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const a=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==a?(l=h.jsx(Z,{icon:e,name:s,size:a,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=a,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),a=!!e&&S,l=M[n],N=R[n];let r;t[0]!==o||t[1]!==l||t[2]!==N?(r=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,N,o),t[0]=o,t[1]=l,t[2]=N,t[3]=r):r=t[3];const p=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!a&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==p||t[11]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=p,t[11]=m,t[12]=d):d=t[12];const z=a&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(y,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==r?(b=h.jsxs("div",{className:r,children:[d,u]}),t[21]=d,t[22]=u,t[23]=r,t[24]=b):b=t[24],b}export{D as I};
@@ -1 +1 @@
1
- import{c as n,l as r,j as i,be as p}from"./index-CyII4Hy-.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
1
+ import{c as n,l as r,j as i,be as p}from"./index-Cif-NWVp.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
@@ -1 +1 @@
1
- import{r as o,c as f}from"./index-CyII4Hy-.js";import{g as l}from"./sandbox-lifecycle-context-CFoOqCj0.js";import{l as c}from"./claim-phase-copy-CWTqDckW.js";function p(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function m(e,t){const[n,r]=o.useState(e),a=o.useRef(null);return e&&!n&&r(!0),o.useEffect(()=>{if(e){a.current??=Date.now();return}if(!n)return;const s=()=>{a.current=null,r(!1)},i=p(a.current,Date.now(),t);if(i===0){s();return}const u=setTimeout(s,i);return()=>clearTimeout(u)},[e,n,t]),n}const y=500;function K(e,t,n){const r=f.c(6);let a;r[0]!==n||r[1]!==e||r[2]!==t?(a=c(e,t,n),r[0]=n,r[1]=e,r[2]=t,r[3]=a):a=r[3];let s;r[4]!==a?(s={mutationKey:a},r[4]=a,r[5]=s):s=r[5];const i=l(s)>0;return m(i,y)}function d(e,t,n){return`deco:preview:last-page:${e}:${t}:${n}`}function g(e){if(!e)return null;try{const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t)||typeof t.path!="string"||!t.path.startsWith("/"))return null;const n=typeof t.pageKey=="string"?t.pageKey:null,r={};if(t.params&&typeof t.params=="object")for(const[a,s]of Object.entries(t.params))typeof s=="string"&&(r[a]=s);return{path:t.path,pageKey:n,params:r}}catch{return null}}function x(e){try{return g(localStorage.getItem(e))}catch{return null}}function A(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}export{d as l,x as r,K as u,A as w};
1
+ import{r as o,c as f}from"./index-Cif-NWVp.js";import{g as l}from"./sandbox-lifecycle-context-Dy4CSxxD.js";import{l as c}from"./claim-phase-copy-BvrYBprI.js";function p(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function m(e,t){const[n,r]=o.useState(e),a=o.useRef(null);return e&&!n&&r(!0),o.useEffect(()=>{if(e){a.current??=Date.now();return}if(!n)return;const s=()=>{a.current=null,r(!1)},i=p(a.current,Date.now(),t);if(i===0){s();return}const u=setTimeout(s,i);return()=>clearTimeout(u)},[e,n,t]),n}const y=500;function K(e,t,n){const r=f.c(6);let a;r[0]!==n||r[1]!==e||r[2]!==t?(a=c(e,t,n),r[0]=n,r[1]=e,r[2]=t,r[3]=a):a=r[3];let s;r[4]!==a?(s={mutationKey:a},r[4]=a,r[5]=s):s=r[5];const i=l(s)>0;return m(i,y)}function d(e,t,n){return`deco:preview:last-page:${e}:${t}:${n}`}function g(e){if(!e)return null;try{const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t)||typeof t.path!="string"||!t.path.startsWith("/"))return null;const n=typeof t.pageKey=="string"?t.pageKey:null,r={};if(t.params&&typeof t.params=="object")for(const[a,s]of Object.entries(t.params))typeof s=="string"&&(r[a]=s);return{path:t.path,pageKey:n,params:r}}catch{return null}}function x(e){try{return g(localStorage.getItem(e))}catch{return null}}function A(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}export{d as l,x as r,K as u,A as w};
@@ -1 +1 @@
1
- import{c as p,j as s,b as y,P as b,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-CyII4Hy-.js";import{R}from"./required-auth-layout-EBGqXDef.js";import{u as T}from"./use-deployment-admin-Cpp8znxx.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(o=>s.jsx(j,{to:o.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(o.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(o.labelKey)},o.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let n;return e[4]!==t?(n=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=n):n=e[5],n}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=i):i=e[0],i}if(!a){let i;e[1]!==t?(i=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==i||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:i,description:l,action:c}),e[10]=i,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let n;e[14]!==t?(n=t("admin.layout.adminDashboard"),e[14]=t,e[15]=n):n=e[15];let o;e[16]!==n?(o=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:n})}),e[16]=n,e[17]=o):o=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==o?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[o,u,f]}),e[20]=o,e[21]=x):x=e[21],x}function P(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{P as default};
1
+ import{c as p,j as s,b as y,P as b,O as _,h as g,B as S,L as j,i as v,k as A,l as N}from"./index-Cif-NWVp.js";import{R}from"./required-auth-layout-BvMcqF9O.js";import{u as T}from"./use-deployment-admin-DbqZpA_r.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(o=>s.jsx(j,{to:o.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(o.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(o.labelKey)},o.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let n;return e[4]!==t?(n=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=n):n=e[5],n}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=i):i=e[0],i}if(!a){let i;e[1]!==t?(i=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==i||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:i,description:l,action:c}),e[10]=i,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let n;e[14]!==t?(n=t("admin.layout.adminDashboard"),e[14]=t,e[15]=n):n=e[15];let o;e[16]!==n?(o=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:n})}),e[16]=n,e[17]=o):o=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==o?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[o,u,f]}),e[20]=o,e[21]=x):x=e[21],x}function P(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{P as default};
@@ -1 +1 @@
1
- import{c as _,f as h,u as x,X as j,dN as S,as as b,fa as v,j as p,N as d}from"./index-CyII4Hy-.js";import{L}from"./legacy-main-redirect-BAof5X15.js";import"./thread-route-C-ixgfYh.js";function R(){const e=_.c(16);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const g=h(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const s=x(n),{org:t}=j(),f="_splat"in g&&typeof g._splat=="string"?g._splat:"";let c,a;if(e[2]!==t.id||e[3]!==t.slug||e[4]!==s||e[5]!==f){a=Symbol.for("react.early_return_sentinel");e:{const m=f.split("/").find(Boolean);if(!m){let r;e[8]!==t.slug?(r={org:t.slug},e[8]=t.slug,e[9]=r):r=e[9];let u;e[10]!==s||e[11]!==r?(u=p.jsx(d,{to:"/$org/projects",params:r,search:s,hash:!0,replace:!0}),e[10]=s,e[11]=r,e[12]=u):u=e[12],a=u;break e}const y=S({virtualMcpIdSearch:s.virtualmcpid,fallbackAgentId:b(t.id).id});c=v({org:t.slug,agentId:y,panel:m,source:"view-first",search:s})}e[2]=t.id,e[3]=t.slug,e[4]=s,e[5]=f,e[6]=c,e[7]=a}else c=e[6],a=e[7];if(a!==Symbol.for("react.early_return_sentinel"))return a;const l=c;let i;return e[13]!==t.slug||e[14]!==l?(i=l?.kind==="canonical"?p.jsx(L,{target:{route:l.route,search:l.search}}):p.jsx(d,{to:"/$org/home",params:{org:t.slug},replace:!0}),e[13]=t.slug,e[14]=l,e[15]=i):i=e[15],i}export{R as default};
1
+ import{c as _,f as h,u as x,X as j,dN as S,as as b,fa as v,j as p,N as d}from"./index-Cif-NWVp.js";import{L}from"./legacy-main-redirect-BNn-8HmE.js";import"./thread-route-B3GsxAze.js";function R(){const e=_.c(16);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const g=h(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const s=x(n),{org:t}=j(),f="_splat"in g&&typeof g._splat=="string"?g._splat:"";let c,a;if(e[2]!==t.id||e[3]!==t.slug||e[4]!==s||e[5]!==f){a=Symbol.for("react.early_return_sentinel");e:{const m=f.split("/").find(Boolean);if(!m){let r;e[8]!==t.slug?(r={org:t.slug},e[8]=t.slug,e[9]=r):r=e[9];let u;e[10]!==s||e[11]!==r?(u=p.jsx(d,{to:"/$org/projects",params:r,search:s,hash:!0,replace:!0}),e[10]=s,e[11]=r,e[12]=u):u=e[12],a=u;break e}const y=S({virtualMcpIdSearch:s.virtualmcpid,fallbackAgentId:b(t.id).id});c=v({org:t.slug,agentId:y,panel:m,source:"view-first",search:s})}e[2]=t.id,e[3]=t.slug,e[4]=s,e[5]=f,e[6]=c,e[7]=a}else c=e[6],a=e[7];if(a!==Symbol.for("react.early_return_sentinel"))return a;const l=c;let i;return e[13]!==t.slug||e[14]!==l?(i=l?.kind==="canonical"?p.jsx(L,{target:{route:l.route,search:l.search}}):p.jsx(d,{to:"/$org/home",params:{org:t.slug},replace:!0}),e[13]=t.slug,e[14]=l,e[15]=i):i=e[15],i}export{R as default};
@@ -1 +1 @@
1
- import{c as v,J as t,j as p,N as m,a5 as c,f as y,u as I,a4 as E,dN as k,dO as R,dP as S,dQ as b}from"./index-CyII4Hy-.js";import{b as L}from"./thread-route-C-ixgfYh.js";function P(x){const a=v.c(81),{target:h}=x,{route:s,search:r}=h;switch(s.to){case c.home:{let e;return a[0]!==s.params||a[1]!==r?(e=p.jsx(m,{to:c.home,params:s.params,search:r,hash:!0,replace:!0}),a[0]=s.params,a[1]=r,a[2]=e):e=a[2],e}case c.tasks:{let e;return a[3]!==s.params||a[4]!==r?(e=p.jsx(m,{to:c.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[3]=s.params,a[4]=r,a[5]=e):e=a[5],e}case c.reports:{let e;return a[6]!==s.params||a[7]!==r?(e=p.jsx(m,{to:c.reports,params:s.params,search:r,hash:!0,replace:!0}),a[6]=s.params,a[7]=r,a[8]=e):e=a[8],e}case c.discover:{let e;return a[9]!==s.params||a[10]!==r?(e=p.jsx(m,{to:c.discover,params:s.params,search:r,hash:!0,replace:!0}),a[9]=s.params,a[10]=r,a[11]=e):e=a[11],e}case c.library:{let e;return a[12]!==s.params||a[13]!==r?(e=p.jsx(m,{to:c.library,params:s.params,search:r,hash:!0,replace:!0}),a[12]=s.params,a[13]=r,a[14]=e):e=a[14],e}case t.root:{let e;return a[15]!==s.params||a[16]!==r?(e=p.jsx(m,{to:t.root,params:s.params,search:r,hash:!0,replace:!0}),a[15]=s.params,a[16]=r,a[17]=e):e=a[17],e}case t.tasks:{let e;return a[18]!==s.params||a[19]!==r?(e=p.jsx(m,{to:t.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[18]=s.params,a[19]=r,a[20]=e):e=a[20],e}case t.reports:{let e;return a[21]!==s.params||a[22]!==r?(e=p.jsx(m,{to:t.reports,params:s.params,search:r,hash:!0,replace:!0}),a[21]=s.params,a[22]=r,a[23]=e):e=a[23],e}case t.siteEditor:{let e;return a[24]!==s.params||a[25]!==r?(e=p.jsx(m,{to:t.siteEditor,params:s.params,search:r,hash:!0,replace:!0}),a[24]=s.params,a[25]=r,a[26]=e):e=a[26],e}case t.siteEditorContent:{let e;return a[27]!==s.params||a[28]!==r?(e=p.jsx(m,{to:t.siteEditorContent,params:s.params,search:r,hash:!0,replace:!0}),a[27]=s.params,a[28]=r,a[29]=e):e=a[29],e}case t.siteEditorCode:{let e;return a[30]!==s.params||a[31]!==r?(e=p.jsx(m,{to:t.siteEditorCode,params:s.params,search:r,hash:!0,replace:!0}),a[30]=s.params,a[31]=r,a[32]=e):e=a[32],e}case t.settings:{let e;return a[33]!==s.params||a[34]!==r?(e=p.jsx(m,{to:t.settings,params:s.params,search:r,hash:!0,replace:!0}),a[33]=s.params,a[34]=r,a[35]=e):e=a[35],e}case t.assets:{let e;return a[36]!==s.params||a[37]!==r?(e=p.jsx(m,{to:t.assets,params:s.params,search:r,hash:!0,replace:!0}),a[36]=s.params,a[37]=r,a[38]=e):e=a[38],e}case t.git:{let e;return a[39]!==s.params||a[40]!==r?(e=p.jsx(m,{to:t.git,params:s.params,search:r,hash:!0,replace:!0}),a[39]=s.params,a[40]=r,a[41]=e):e=a[41],e}case t.hosting:{let e;return a[42]!==s.params||a[43]!==r?(e=p.jsx(m,{to:t.hosting,params:s.params,search:r,hash:!0,replace:!0}),a[42]=s.params,a[43]=r,a[44]=e):e=a[44],e}case t.e2e:{let e;return a[45]!==s.params||a[46]!==r?(e=p.jsx(m,{to:t.e2e,params:s.params,search:r,hash:!0,replace:!0}),a[45]=s.params,a[46]=r,a[47]=e):e=a[47],e}case t.analytics:{let e;return a[48]!==s.params||a[49]!==r?(e=p.jsx(m,{to:t.analytics,params:s.params,search:r,hash:!0,replace:!0}),a[48]=s.params,a[49]=r,a[50]=e):e=a[50],e}case t.experiments:{let e;return a[51]!==s.params||a[52]!==r?(e=p.jsx(m,{to:t.experiments,params:s.params,search:r,hash:!0,replace:!0}),a[51]=s.params,a[52]=r,a[53]=e):e=a[53],e}case t.monitor:{let e;return a[54]!==s.params||a[55]!==r?(e=p.jsx(m,{to:t.monitor,params:s.params,search:r,hash:!0,replace:!0}),a[54]=s.params,a[55]=r,a[56]=e):e=a[56],e}case t.automations:{let e;return a[57]!==s.params||a[58]!==r?(e=p.jsx(m,{to:t.automations,params:s.params,search:r,hash:!0,replace:!0}),a[57]=s.params,a[58]=r,a[59]=e):e=a[59],e}case t.automation:{let e;return a[60]!==s.params||a[61]!==r?(e=p.jsx(m,{to:t.automation,params:s.params,search:r,hash:!0,replace:!0}),a[60]=s.params,a[61]=r,a[62]=e):e=a[62],e}case t.app:{let e;return a[63]!==s.params||a[64]!==r?(e=p.jsx(m,{to:t.app,params:s.params,search:r,hash:!0,replace:!0}),a[63]=s.params,a[64]=r,a[65]=e):e=a[65],e}case t.view:{let e;return a[66]!==s.params||a[67]!==r?(e=p.jsx(m,{to:t.view,params:s.params,search:r,hash:!0,replace:!0}),a[66]=s.params,a[67]=r,a[68]=e):e=a[68],e}case t.outputFile:{let e;return a[69]!==s.params||a[70]!==r?(e=p.jsx(m,{to:t.outputFile,params:s.params,search:r,hash:!0,replace:!0}),a[69]=s.params,a[70]=r,a[71]=e):e=a[71],e}case t.outputDeck:{let e;return a[72]!==s.params||a[73]!==r?(e=p.jsx(m,{to:t.outputDeck,params:s.params,search:r,hash:!0,replace:!0}),a[72]=s.params,a[73]=r,a[74]=e):e=a[74],e}case t.libraryFile:{let e;return a[75]!==s.params||a[76]!==r?(e=p.jsx(m,{to:t.libraryFile,params:s.params,search:r,hash:!0,replace:!0}),a[75]=s.params,a[76]=r,a[77]=e):e=a[77],e}case t.connectSources:{let e;return a[78]!==s.params||a[79]!==r?(e=p.jsx(m,{to:t.connectSources,params:s.params,search:r,hash:!0,replace:!0}),a[78]=s.params,a[79]=r,a[80]=e):e=a[80],e}}}function N(x){const a=v.c(17),{children:h}=x;let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const r=y(s);let e;a[1]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},a[1]=e):e=a[1];const u=I(e),j=L(),g=E(),i=r.org;if(!i||r.taskId!==void 0||r._splat!==void 0)return h??null;let n,f;a[2]!==j||a[3]!==g||a[4]!==i||a[5]!==r.agentId||a[6]!==u?(n=k({agentIdParam:r.agentId,virtualMcpIdSearch:u.virtualmcpid,fallbackAgentId:j}),f=(u.main!==void 0?R({org:i,agentId:n,main:u.main,search:u}):null)??S({org:i,routePath:g,search:u}),a[2]=j,a[3]=g,a[4]=i,a[5]=r.agentId,a[6]=u,a[7]=n,a[8]=f):(n=a[7],f=a[8]);const o=f;if(o?.kind==="same-route"){let l;return a[9]!==o.search?(l=p.jsx(m,{to:".",search:o.search,hash:!0,replace:!0}),a[9]=o.search,a[10]=l):l=a[10],l}if(o?.kind==="canonical"){let l;return a[11]!==o?(l=p.jsx(P,{target:o}),a[11]=o,a[12]=l):l=a[12],l}if(r.agentId!==void 0&&r.agentId===n&&u.virtualmcpid!==void 0){let l;a[13]!==u?(l=b(u),a[13]=u,a[14]=l):l=a[14];let d;return a[15]!==l?(d=p.jsx(m,{to:".",search:l,hash:!0,replace:!0}),a[15]=l,a[16]=d):d=a[16],d}return h??null}export{P as L,N as a};
1
+ import{c as v,J as t,j as p,N as m,a5 as c,f as y,u as I,a4 as E,dN as k,dO as R,dP as S,dQ as b}from"./index-Cif-NWVp.js";import{b as L}from"./thread-route-B3GsxAze.js";function P(x){const a=v.c(81),{target:h}=x,{route:s,search:r}=h;switch(s.to){case c.home:{let e;return a[0]!==s.params||a[1]!==r?(e=p.jsx(m,{to:c.home,params:s.params,search:r,hash:!0,replace:!0}),a[0]=s.params,a[1]=r,a[2]=e):e=a[2],e}case c.tasks:{let e;return a[3]!==s.params||a[4]!==r?(e=p.jsx(m,{to:c.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[3]=s.params,a[4]=r,a[5]=e):e=a[5],e}case c.reports:{let e;return a[6]!==s.params||a[7]!==r?(e=p.jsx(m,{to:c.reports,params:s.params,search:r,hash:!0,replace:!0}),a[6]=s.params,a[7]=r,a[8]=e):e=a[8],e}case c.discover:{let e;return a[9]!==s.params||a[10]!==r?(e=p.jsx(m,{to:c.discover,params:s.params,search:r,hash:!0,replace:!0}),a[9]=s.params,a[10]=r,a[11]=e):e=a[11],e}case c.library:{let e;return a[12]!==s.params||a[13]!==r?(e=p.jsx(m,{to:c.library,params:s.params,search:r,hash:!0,replace:!0}),a[12]=s.params,a[13]=r,a[14]=e):e=a[14],e}case t.root:{let e;return a[15]!==s.params||a[16]!==r?(e=p.jsx(m,{to:t.root,params:s.params,search:r,hash:!0,replace:!0}),a[15]=s.params,a[16]=r,a[17]=e):e=a[17],e}case t.tasks:{let e;return a[18]!==s.params||a[19]!==r?(e=p.jsx(m,{to:t.tasks,params:s.params,search:r,hash:!0,replace:!0}),a[18]=s.params,a[19]=r,a[20]=e):e=a[20],e}case t.reports:{let e;return a[21]!==s.params||a[22]!==r?(e=p.jsx(m,{to:t.reports,params:s.params,search:r,hash:!0,replace:!0}),a[21]=s.params,a[22]=r,a[23]=e):e=a[23],e}case t.siteEditor:{let e;return a[24]!==s.params||a[25]!==r?(e=p.jsx(m,{to:t.siteEditor,params:s.params,search:r,hash:!0,replace:!0}),a[24]=s.params,a[25]=r,a[26]=e):e=a[26],e}case t.siteEditorContent:{let e;return a[27]!==s.params||a[28]!==r?(e=p.jsx(m,{to:t.siteEditorContent,params:s.params,search:r,hash:!0,replace:!0}),a[27]=s.params,a[28]=r,a[29]=e):e=a[29],e}case t.siteEditorCode:{let e;return a[30]!==s.params||a[31]!==r?(e=p.jsx(m,{to:t.siteEditorCode,params:s.params,search:r,hash:!0,replace:!0}),a[30]=s.params,a[31]=r,a[32]=e):e=a[32],e}case t.settings:{let e;return a[33]!==s.params||a[34]!==r?(e=p.jsx(m,{to:t.settings,params:s.params,search:r,hash:!0,replace:!0}),a[33]=s.params,a[34]=r,a[35]=e):e=a[35],e}case t.assets:{let e;return a[36]!==s.params||a[37]!==r?(e=p.jsx(m,{to:t.assets,params:s.params,search:r,hash:!0,replace:!0}),a[36]=s.params,a[37]=r,a[38]=e):e=a[38],e}case t.git:{let e;return a[39]!==s.params||a[40]!==r?(e=p.jsx(m,{to:t.git,params:s.params,search:r,hash:!0,replace:!0}),a[39]=s.params,a[40]=r,a[41]=e):e=a[41],e}case t.hosting:{let e;return a[42]!==s.params||a[43]!==r?(e=p.jsx(m,{to:t.hosting,params:s.params,search:r,hash:!0,replace:!0}),a[42]=s.params,a[43]=r,a[44]=e):e=a[44],e}case t.e2e:{let e;return a[45]!==s.params||a[46]!==r?(e=p.jsx(m,{to:t.e2e,params:s.params,search:r,hash:!0,replace:!0}),a[45]=s.params,a[46]=r,a[47]=e):e=a[47],e}case t.analytics:{let e;return a[48]!==s.params||a[49]!==r?(e=p.jsx(m,{to:t.analytics,params:s.params,search:r,hash:!0,replace:!0}),a[48]=s.params,a[49]=r,a[50]=e):e=a[50],e}case t.experiments:{let e;return a[51]!==s.params||a[52]!==r?(e=p.jsx(m,{to:t.experiments,params:s.params,search:r,hash:!0,replace:!0}),a[51]=s.params,a[52]=r,a[53]=e):e=a[53],e}case t.monitor:{let e;return a[54]!==s.params||a[55]!==r?(e=p.jsx(m,{to:t.monitor,params:s.params,search:r,hash:!0,replace:!0}),a[54]=s.params,a[55]=r,a[56]=e):e=a[56],e}case t.automations:{let e;return a[57]!==s.params||a[58]!==r?(e=p.jsx(m,{to:t.automations,params:s.params,search:r,hash:!0,replace:!0}),a[57]=s.params,a[58]=r,a[59]=e):e=a[59],e}case t.automation:{let e;return a[60]!==s.params||a[61]!==r?(e=p.jsx(m,{to:t.automation,params:s.params,search:r,hash:!0,replace:!0}),a[60]=s.params,a[61]=r,a[62]=e):e=a[62],e}case t.app:{let e;return a[63]!==s.params||a[64]!==r?(e=p.jsx(m,{to:t.app,params:s.params,search:r,hash:!0,replace:!0}),a[63]=s.params,a[64]=r,a[65]=e):e=a[65],e}case t.view:{let e;return a[66]!==s.params||a[67]!==r?(e=p.jsx(m,{to:t.view,params:s.params,search:r,hash:!0,replace:!0}),a[66]=s.params,a[67]=r,a[68]=e):e=a[68],e}case t.outputFile:{let e;return a[69]!==s.params||a[70]!==r?(e=p.jsx(m,{to:t.outputFile,params:s.params,search:r,hash:!0,replace:!0}),a[69]=s.params,a[70]=r,a[71]=e):e=a[71],e}case t.outputDeck:{let e;return a[72]!==s.params||a[73]!==r?(e=p.jsx(m,{to:t.outputDeck,params:s.params,search:r,hash:!0,replace:!0}),a[72]=s.params,a[73]=r,a[74]=e):e=a[74],e}case t.libraryFile:{let e;return a[75]!==s.params||a[76]!==r?(e=p.jsx(m,{to:t.libraryFile,params:s.params,search:r,hash:!0,replace:!0}),a[75]=s.params,a[76]=r,a[77]=e):e=a[77],e}case t.connectSources:{let e;return a[78]!==s.params||a[79]!==r?(e=p.jsx(m,{to:t.connectSources,params:s.params,search:r,hash:!0,replace:!0}),a[78]=s.params,a[79]=r,a[80]=e):e=a[80],e}}}function N(x){const a=v.c(17),{children:h}=x;let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const r=y(s);let e;a[1]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},a[1]=e):e=a[1];const u=I(e),j=L(),g=E(),i=r.org;if(!i||r.taskId!==void 0||r._splat!==void 0)return h??null;let n,f;a[2]!==j||a[3]!==g||a[4]!==i||a[5]!==r.agentId||a[6]!==u?(n=k({agentIdParam:r.agentId,virtualMcpIdSearch:u.virtualmcpid,fallbackAgentId:j}),f=(u.main!==void 0?R({org:i,agentId:n,main:u.main,search:u}):null)??S({org:i,routePath:g,search:u}),a[2]=j,a[3]=g,a[4]=i,a[5]=r.agentId,a[6]=u,a[7]=n,a[8]=f):(n=a[7],f=a[8]);const o=f;if(o?.kind==="same-route"){let l;return a[9]!==o.search?(l=p.jsx(m,{to:".",search:o.search,hash:!0,replace:!0}),a[9]=o.search,a[10]=l):l=a[10],l}if(o?.kind==="canonical"){let l;return a[11]!==o?(l=p.jsx(P,{target:o}),a[11]=o,a[12]=l):l=a[12],l}if(r.agentId!==void 0&&r.agentId===n&&u.virtualmcpid!==void 0){let l;a[13]!==u?(l=b(u),a[13]=u,a[14]=l):l=a[14];let d;return a[15]!==l?(d=p.jsx(m,{to:".",search:l,hash:!0,replace:!0}),a[15]=l,a[16]=d):d=a[16],d}return h??null}export{P as L,N as a};
@@ -0,0 +1 @@
1
+ import{c as i,j as o}from"./index-Cif-NWVp.js";import{C as m}from"./index-D_S3Goue.js";import{L as p}from"./library-tab-BzjBKwRW.js";import"./use-mobile-DvZ73KtH.js";import"./thread-button-CsxctT-G.js";import"./agent-icon-DEau6pQP.js";import"./AlertCircle-D-RDeHL_.js";import"./Tool01-Booc4u0n.js";import"./ArrowUp-BzLrItni.js";import"./ArrowLeft-DVpME15-.js";import"./ArrowRight-CSNzIA9B.js";import"./ShoppingBag01-DQq21IAe.js";import"./ZoomOut-DRn8fB1h.js";import"./Palette-tJixmc7V.js";import"./CheckCircle-Do4HhdGQ.js";import"./Check-w1vYw5Rn.js";import"./ChevronUp-BWOObG8Z.js";import"./UserSquare-CaMR-kX2.js";import"./Copy01-uPL40TdR.js";import"./CreditCard01-DaYOLDOz.js";import"./DotsVertical-vTwE8lBm.js";import"./Image01-BObY5rn9.js";import"./XClose-uQDj2qbC.js";import"./Key01-nM1-kqhR.js";import"./Link01-BS-vCNzQ.js";import"./LinkExternal01-DNLGj9_-.js";import"./Monitor01-Csp3CK4O.js";import"./Sun-BxhQc-kG.js";import"./Plus-BvjmhLnx.js";import"./SearchMd-Btx9xhJc.js";import"./Trash01-D0KW49wY.js";import"./Upload01-B58Org46.js";import"./User01-BMX3cjtL.js";import"./Users01-Cpn2NFdA.js";import"./X-GZ5ISsIL.js";import"./use-chat-layout-state-yrmi1Gwb.js";import"./thread-route-B3GsxAze.js";import"./use-panel-navigate-m1jpn2Q1.js";import"./use-project-scope-BB82FCa8.js";import"./repository-binding-DSb755tD.js";import"./use-mcp-client-DOo0zS-A.js";import"./auth-CQNA1z0f.js";import"./thread-intent-kYQuJDvD.js";import"./backoff-8mStPHYB.js";import"./task-board-DIALSeie.js";import"./schema-Dlgkjiv1.js";import"./slugify-CEUa2lfQ.js";import"./sheet-Da9g_BHH.js";import"./tooltip-CnfGv3UJ.js";import"./index-Dh9Stq8K.js";import"./toolbar-icon-button-EcMyctyQ.js";import"./shell-layout-2lFwLRyB.js";import"./avatar-Dc1WJG2B.js";import"./download-app-dialog-CkAPyUJk.js";import"./dialog-xO6pvTgy.js";import"./command-CyoopJ8K.js";import"./index-DEVMcvUD.js";import"./integration-icon--ugXTzBB.js";import"./project-icon-Ch4KDtlO.js";import"./new-project-dialog-aG1LmqNx.js";import"./input-yDOZz3Y8.js";import"./label-BpW4-JRS.js";import"./repository-import-picker-DWKmc173.js";import"./use-navigate-to-agent-0EY97I37.js";import"./repository-picker-DTSlP9FP.js";import"./useInfiniteQuery-Bvl72KSW.js";import"./infiniteQueryObserver-D0QSVh54.js";import"./collection-search-GlDfWrQl.js";import"./use-debounced-value-DLVRUtOm.js";import"./use-organization-settings--iPsUcy7.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-BvMcqF9O.js";import"./autosend-CbvWggSc.js";import"./use-org-sso-JZsx5RfJ.js";import"./resizable-DXDqTm9t.js";import"./search-toggle-P_agAdHY.js";import"./alert-dialog-CfArYE_c.js";import"./location-DBePU4bz.js";import"./use-org-fs-BKiHrfqD.js";import"./use-org-repo-syncs-9Jptl7NX.js";import"./textarea--vnsHs3x.js";import"./markdown-C6J9WB-u.js";import"./org-file-open-context-Dl3qgap2.js";import"./file-share-button-KyN_ryLY.js";import"./popover-Cj-r--VT.js";import"./preview-dialog-BHY_2jiF.js";import"./preview-content-kIsMY8Nc.js";import"./file-preview-vkQ_3IRk.js";import"./utils-Bqsc15Zx.js";import"./editor-BtyNln47.js";import"./file-type-icon-DnOhlq0D.js";import"./folder-icon-OrJJEPYu.js";import"./skill-md-ChfVs4uF.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./table-Ci0flHqR.js";function Ut(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(m.Content,{children:o.jsx(p,{})}),r[0]=t):t=r[0],t}export{Ut as default};
@@ -1,4 +1,4 @@
1
- import{c as D,b as q,j as t,aP as pe,X as Me,o as Dt,r as I,B as te,l as J,K as de,t as Y,G as Ue,F as er,H as tr,I as rr,m as sr,ai as nr,d as lr,u as ar,aE as ir,n as Ve,P as or,dR as cr}from"./index-CyII4Hy-.js";import{n as dr,s as ur}from"./Image01-BWtqkynf.js";import{s as fr}from"./Plus-C8_7wQVY.js";import{i as Ke}from"./Upload01-D8px3BRb.js";import{u as mr}from"./use-mobile-X-W7raUh.js";import{I as pr}from"./index-CBgMqgGr.js";import{S as hr}from"./search-toggle-BIaj-qey.js";import{f as br,e as xr,b as gr,A as yr,a as vr,d as jr,c as wr,g as kr}from"./alert-dialog-jP-5jm3B.js";import{b as tt,D as rt,d as st,i as Sr,c as jt,h as wt,e as kt}from"./dialog-BAdncaXR.js";import{I as He}from"./input-BBwMBvzR.js";import{b as W,p as Pt,H as ue,s as Ee,a as we,c as Ot,d as Ft,h as ot,l as Nr}from"./location-DBePU4bz.js";import{u as Cr}from"./use-debounced-value-Df5XXiWC.js";import{c as ge,h as Ye,d as $r,i as nt,j as ct,k as Dr,l as Tt,m as Pr,n as Or}from"./use-org-fs-Db_U65fA.js";import{u as Fr,a as Tr}from"./use-org-repo-syncs-CNnHLgIG.js";import{T as Er}from"./textarea-CRla2I1O.js";import{t as zr,n as Mr}from"./ChevronUp-DluVhiDY.js";import{b as qe}from"./Palette-BOu3DUls.js";import{b5 as Ar,b as Br,l as Et,aZ as Lr,A as _r}from"./agent-icon-D7av-7g5.js";import{i as St}from"./X-Sz3H1SE9.js";import{M as Rr}from"./markdown-Due1h4mi.js";import{S as Vr}from"./file-share-button-B9WbHN-Z.js";import{L as zt}from"./preview-dialog-Cn4XaU4a.js";import{F as Mt,S as At}from"./folder-icon-B3im8_vL.js";import{i as Ir}from"./repository-binding-IbB3w4K1.js";import{i as Ur,c as Kr}from"./XClose-DCiqvNA0.js";import{t as Hr}from"./Tool01-DqqLglaA.js";import{i as dt}from"./ZoomOut-Cb1MSdsR.js";import{i as qr}from"./DotsVertical-Dem42mI9.js";import{i as Qr}from"./Key01-DZ2hPAde.js";import{s as Xr}from"./Trash01-HIeO4K0u.js";import{t as Se}from"./format-time-CjIPQhCN.js";import{F as ze,d as lt}from"./file-type-icon-Bq6mw2Ps.js";import{p as Yr}from"./skill-md-ChfVs4uF.js";import{n as Gr,i as Wr}from"./ArrowUp-B7hrL_y6.js";import{T as De,a as Jr,b as Bt,d as Zr,e as es,c as Pe}from"./table-Df8QoO5m.js";import{s as ts}from"./use-project-scope-_m4cLdEj.js";import{a as rs}from"./use-panel-navigate-DPS2Zvaj.js";function ss(l){return l.kind==="file"?"file":l.hasSkill?"skill":l.hasBrand?"brand":"folder"}function ut(l){return{kind:ss(l),path:l.path,name:W(l.path),updatedAt:l.updatedAt,size:l.size??0,entry:l}}const ns=["name","updated","size"];function Nt(l){return l.kind==="file"?1:0}function Lt(l,e){const r=(n,a)=>n.name.localeCompare(a.name,void 0,{numeric:!0,sensitivity:"base"});return[...l].sort((n,a)=>{const s=Nt(n)-Nt(a);if(s!==0)return s;if(e==="updated"){const i=(a.updatedAt??"").localeCompare(n.updatedAt??"");if(i!==0)return i}if(e==="size"){const i=a.size-n.size;if(i!==0)return i}return r(n,a)})}function ls(l){if(l.kind!=="file")return null;const e=l.size;if(!e)return null;const r=["B","KB","MB","GB","TB"];let n=e,a=0;for(;n>=1024&&a<r.length-1;)n/=1024,a++;return`${n>=10||a===0?Math.round(n):n.toFixed(1)} ${r[a]}`}function as(l,e,r){return e?"color":r?"font":/^--brand-(text|fw|leading|tracking)/i.test(l)?"type":/^--brand-space/i.test(l)?"space":/^--brand-radius/i.test(l)?"radius":/^--brand-shadow/i.test(l)?"shadow":/^--brand-(duration|delay|ease)/i.test(l)?"motion":"other"}const is=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,os=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,cs=["svg","png","jpg","jpeg","webp","avif","gif"];function ds(l){return l.split(".").pop()?.toLowerCase()??""}function us(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fs(l){const e=l.trim();return os.test(e)||is.test(e)}function ms(l){const e=l.trim(),r=e.match(/^#([0-9a-f]{3})$/i);return r?.[1]?`#${[...r[1]].map(n=>n+n).join("")}`:e}function _t(l){const e=[],r=new Map,n=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let a;for(;(a=n.exec(l))!==null;){const s=a[1],i=a[2].trim();r.has(s)||e.push(s),r.set(s,i)}return e.map(s=>{const i=r.get(s),o=fs(i),c=/^--brand-font/i.test(s);return{name:s,value:i,isColor:o,isFont:c,kind:as(s,o,c)}})}const Ct=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ps(l){return l.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??l}function hs(l){const e=[],r=new Map;for(const a of l){if(a.kind!=="color")continue;const s=ps(a.name);r.has(s)||(e.push(s),r.set(s,[])),r.get(s).push(a)}return e.map(a=>{const s=r.get(a);return{family:a,tokens:s,isRamp:s.filter(i=>/-\d+$/.test(i.name)).length>=5}}).sort((a,s)=>{const i=Ct.indexOf(a.family),o=Ct.indexOf(s.family);return i===-1&&o===-1?0:i===-1?1:o===-1?-1:i-o})}function bs(l,e,r){const n=new RegExp(`(${us(e)}\\s*:\\s*)[^;]+(;)`);if(n.test(l))return l.replace(n,(i,o,c)=>`${o}${r}${c}`);const a=l.search(/:root\s*\{/);if(a!==-1){const i=l.indexOf("{",a)+1;return`${l.slice(0,i)}
1
+ import{c as D,b as q,j as t,aP as pe,X as Me,o as Dt,r as I,B as te,l as J,K as de,t as Y,G as Ue,F as er,H as tr,I as rr,m as sr,ai as nr,d as lr,u as ar,aE as ir,n as Ve,P as or,dR as cr}from"./index-Cif-NWVp.js";import{n as dr,s as ur}from"./Image01-BObY5rn9.js";import{s as fr}from"./Plus-BvjmhLnx.js";import{i as Ke}from"./Upload01-B58Org46.js";import{u as mr}from"./use-mobile-DvZ73KtH.js";import{I as pr}from"./index-D_S3Goue.js";import{S as hr}from"./search-toggle-P_agAdHY.js";import{f as br,e as xr,b as gr,A as yr,a as vr,d as jr,c as wr,g as kr}from"./alert-dialog-CfArYE_c.js";import{b as tt,D as rt,d as st,i as Sr,c as jt,h as wt,e as kt}from"./dialog-xO6pvTgy.js";import{I as He}from"./input-yDOZz3Y8.js";import{b as W,p as Pt,H as ue,s as Ee,a as we,c as Ot,d as Ft,h as ot,l as Nr}from"./location-DBePU4bz.js";import{u as Cr}from"./use-debounced-value-DLVRUtOm.js";import{c as ge,h as Ye,d as $r,i as nt,j as ct,k as Dr,l as Tt,m as Pr,n as Or}from"./use-org-fs-BKiHrfqD.js";import{u as Fr,a as Tr}from"./use-org-repo-syncs-9Jptl7NX.js";import{T as Er}from"./textarea--vnsHs3x.js";import{t as zr,n as Mr}from"./ChevronUp-BWOObG8Z.js";import{b as qe}from"./Palette-tJixmc7V.js";import{b5 as Ar,b as Br,l as Et,aZ as Lr,A as _r}from"./agent-icon-DEau6pQP.js";import{i as St}from"./X-GZ5ISsIL.js";import{M as Rr}from"./markdown-C6J9WB-u.js";import{S as Vr}from"./file-share-button-KyN_ryLY.js";import{L as zt}from"./preview-dialog-BHY_2jiF.js";import{F as Mt,S as At}from"./folder-icon-OrJJEPYu.js";import{i as Ir}from"./repository-binding-DSb755tD.js";import{i as Ur,c as Kr}from"./XClose-uQDj2qbC.js";import{t as Hr}from"./Tool01-Booc4u0n.js";import{i as dt}from"./ZoomOut-DRn8fB1h.js";import{i as qr}from"./DotsVertical-vTwE8lBm.js";import{i as Qr}from"./Key01-nM1-kqhR.js";import{s as Xr}from"./Trash01-D0KW49wY.js";import{t as Se}from"./format-time-CjIPQhCN.js";import{F as ze,d as lt}from"./file-type-icon-DnOhlq0D.js";import{p as Yr}from"./skill-md-ChfVs4uF.js";import{n as Gr,i as Wr}from"./ArrowUp-BzLrItni.js";import{T as De,a as Jr,b as Bt,d as Zr,e as es,c as Pe}from"./table-Ci0flHqR.js";import{s as ts}from"./use-project-scope-BB82FCa8.js";import{a as rs}from"./use-panel-navigate-m1jpn2Q1.js";function ss(l){return l.kind==="file"?"file":l.hasSkill?"skill":l.hasBrand?"brand":"folder"}function ut(l){return{kind:ss(l),path:l.path,name:W(l.path),updatedAt:l.updatedAt,size:l.size??0,entry:l}}const ns=["name","updated","size"];function Nt(l){return l.kind==="file"?1:0}function Lt(l,e){const r=(n,a)=>n.name.localeCompare(a.name,void 0,{numeric:!0,sensitivity:"base"});return[...l].sort((n,a)=>{const s=Nt(n)-Nt(a);if(s!==0)return s;if(e==="updated"){const i=(a.updatedAt??"").localeCompare(n.updatedAt??"");if(i!==0)return i}if(e==="size"){const i=a.size-n.size;if(i!==0)return i}return r(n,a)})}function ls(l){if(l.kind!=="file")return null;const e=l.size;if(!e)return null;const r=["B","KB","MB","GB","TB"];let n=e,a=0;for(;n>=1024&&a<r.length-1;)n/=1024,a++;return`${n>=10||a===0?Math.round(n):n.toFixed(1)} ${r[a]}`}function as(l,e,r){return e?"color":r?"font":/^--brand-(text|fw|leading|tracking)/i.test(l)?"type":/^--brand-space/i.test(l)?"space":/^--brand-radius/i.test(l)?"radius":/^--brand-shadow/i.test(l)?"shadow":/^--brand-(duration|delay|ease)/i.test(l)?"motion":"other"}const is=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,os=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,cs=["svg","png","jpg","jpeg","webp","avif","gif"];function ds(l){return l.split(".").pop()?.toLowerCase()??""}function us(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fs(l){const e=l.trim();return os.test(e)||is.test(e)}function ms(l){const e=l.trim(),r=e.match(/^#([0-9a-f]{3})$/i);return r?.[1]?`#${[...r[1]].map(n=>n+n).join("")}`:e}function _t(l){const e=[],r=new Map,n=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let a;for(;(a=n.exec(l))!==null;){const s=a[1],i=a[2].trim();r.has(s)||e.push(s),r.set(s,i)}return e.map(s=>{const i=r.get(s),o=fs(i),c=/^--brand-font/i.test(s);return{name:s,value:i,isColor:o,isFont:c,kind:as(s,o,c)}})}const Ct=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ps(l){return l.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??l}function hs(l){const e=[],r=new Map;for(const a of l){if(a.kind!=="color")continue;const s=ps(a.name);r.has(s)||(e.push(s),r.set(s,[])),r.get(s).push(a)}return e.map(a=>{const s=r.get(a);return{family:a,tokens:s,isRamp:s.filter(i=>/-\d+$/.test(i.name)).length>=5}}).sort((a,s)=>{const i=Ct.indexOf(a.family),o=Ct.indexOf(s.family);return i===-1&&o===-1?0:i===-1?1:o===-1?-1:i-o})}function bs(l,e,r){const n=new RegExp(`(${us(e)}\\s*:\\s*)[^;]+(;)`);if(n.test(l))return l.replace(n,(i,o,c)=>`${o}${r}${c}`);const a=l.search(/:root\s*\{/);if(a!==-1){const i=l.indexOf("{",a)+1;return`${l.slice(0,i)}
2
2
  ${e}: ${r};${l.slice(i)}`}const s=l.length>0&&!l.endsWith(`
3
3
  `)?`
4
4
  `:"";return`${l}${s}:root {
@@ -1 +1 @@
1
- import{c as R,a as x,r as _,u as C,j as u,N as y}from"./index-CyII4Hy-.js";import{u as U,A as j,a as k}from"./auth-entry-oZIfzUzD.js";import{A as N}from"./auth-split-layout-NT0znxKf.js";import"./input-BBwMBvzR.js";import"./use-is-desktop-app-BNujXJc_.js";import"./backoff-8mStPHYB.js";function O(){const e=R.c(5),t=U(),o=x.useSession();_.useRef(null);const i=t.status,c=o.data!=null,r=o.isPending;let n,s;e[0]!==c||e[1]!==r||e[2]!==i?(n=()=>{},s=[i,c,r],e[0]=c,e[1]=r,e[2]=i,e[3]=n,e[4]=s):(n=e[3],s=e[4]),_.useEffect(n,s)}const h="studio_signup_ref",a="studio_signup_src",$=720*60*60,f=128;function g(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function p(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${$}; samesite=lax`}function b(e){e.ref&&e.ref.length<=f&&!g(h)&&p(h,e.ref),e.src&&e.src.length<=f&&!g(a)&&p(a,e.src)}function w(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function v(){const e=x.useSession();O();const t=C({from:"/login"}),{next:o="/",client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:m,code_challenge_method:A,src:S,ref:E}=t;b({src:S,ref:E});const d=o.startsWith("/")&&!o.startsWith("//")?o:"/",l=w({client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:m,code_challenge_method:A});return e.data?l?(window.location.href=l,u.jsx(j,{})):u.jsx(y,{to:d}):u.jsx(N,{children:u.jsx(k,{callbackUrl:d,redirectUrl:l})})}export{v as default};
1
+ import{c as R,a as x,r as _,u as C,j as u,N as y}from"./index-Cif-NWVp.js";import{u as U,A as j,a as k}from"./auth-entry-Bbaisicp.js";import{A as N}from"./auth-split-layout-49oocHo-.js";import"./input-yDOZz3Y8.js";import"./use-is-desktop-app-BNujXJc_.js";import"./backoff-8mStPHYB.js";function O(){const e=R.c(5),t=U(),o=x.useSession();_.useRef(null);const i=t.status,c=o.data!=null,r=o.isPending;let n,s;e[0]!==c||e[1]!==r||e[2]!==i?(n=()=>{},s=[i,c,r],e[0]=c,e[1]=r,e[2]=i,e[3]=n,e[4]=s):(n=e[3],s=e[4]),_.useEffect(n,s)}const h="studio_signup_ref",a="studio_signup_src",$=720*60*60,f=128;function g(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?.[1]?decodeURIComponent(t[1]):null}function p(e,t){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${$}; samesite=lax`}function b(e){e.ref&&e.ref.length<=f&&!g(h)&&p(h,e.ref),e.src&&e.src.length<=f&&!g(a)&&p(a,e.src)}function w(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function v(){const e=x.useSession();O();const t=C({from:"/login"}),{next:o="/",client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:m,code_challenge_method:A,src:S,ref:E}=t;b({src:S,ref:E});const d=o.startsWith("/")&&!o.startsWith("//")?o:"/",l=w({client_id:i,redirect_uri:c,response_type:r,state:n,scope:s,code_challenge:m,code_challenge_method:A});return e.data?l?(window.location.href=l,u.jsx(j,{})):u.jsx(y,{to:d}):u.jsx(N,{children:u.jsx(k,{callbackUrl:d,redirectUrl:l})})}export{v as default};
@@ -1,4 +1,4 @@
1
- import{co as Pl,j as D,e6 as He,eK as Kt,c as Le,b as Lt,r as Ce,aq as oE,l as ph,B as gh}from"./index-CyII4Hy-.js";import{i as fh}from"./Check-DqhJRaRV.js";import{a as mh}from"./Copy01-B9W9lwCV.js";import{D as sE,g as lE,f as uE,d as cE}from"./dialog-BAdncaXR.js";import{n as dE}from"./Image01-BWtqkynf.js";import{d as pE,n as gE}from"./ZoomOut-Cb1MSdsR.js";import{a as hh}from"./org-file-open-context-CdICBbAH.js";function Ul(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tt=Ul();function bh(e){tt=e}var Rt={exec:()=>null};function ee(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(be.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},fE=/^(?:[ \t]*(?:\n|$))+/,mE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bl=/(?:[*+-]|\d{1,9}[.)])/,Eh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yh=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),EE=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$l=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yE=/^[^\n]+/,ql=/(?!\s*\])(?:\\.|[^\[\]\\])+/,SE=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ql).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kE=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bl).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vE=ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zl).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sh=ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),TE=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sh).getRegex(),Gl={blockquote:TE,code:mE,def:SE,fences:hE,heading:bE,hr:Dt,html:vE,lheading:yh,list:kE,newline:fE,paragraph:Sh,table:Rt,text:yE},wu=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),wE={...Gl,lheading:EE,table:wu,paragraph:ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},AE={...Gl,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee($l).replace("hr",Dt).replace("heading",` *#{1,6} *[^
1
+ import{co as Pl,j as D,e6 as He,eK as Kt,c as Le,b as Lt,r as Ce,aq as oE,l as ph,B as gh}from"./index-Cif-NWVp.js";import{i as fh}from"./Check-w1vYw5Rn.js";import{a as mh}from"./Copy01-uPL40TdR.js";import{D as sE,g as lE,f as uE,d as cE}from"./dialog-xO6pvTgy.js";import{n as dE}from"./Image01-BObY5rn9.js";import{d as pE,n as gE}from"./ZoomOut-DRn8fB1h.js";import{a as hh}from"./org-file-open-context-Dl3qgap2.js";function Ul(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tt=Ul();function bh(e){tt=e}var Rt={exec:()=>null};function ee(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(be.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},fE=/^(?:[ \t]*(?:\n|$))+/,mE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bl=/(?:[*+-]|\d{1,9}[.)])/,Eh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yh=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),EE=ee(Eh).replace(/bull/g,Bl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$l=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yE=/^[^\n]+/,ql=/(?!\s*\])(?:\\.|[^\[\]\\])+/,SE=ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ql).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),kE=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bl).getRegex(),rn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vE=ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zl).replace("tag",rn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sh=ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),TE=ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sh).getRegex(),Gl={blockquote:TE,code:mE,def:SE,fences:hE,heading:bE,hr:Dt,html:vE,lheading:yh,list:kE,newline:fE,paragraph:Sh,table:Rt,text:yE},wu=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex(),wE={...Gl,lheading:EE,table:wu,paragraph:ee($l).replace("hr",Dt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rn).getRegex()},AE={...Gl,html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee($l).replace("hr",Dt).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",yh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},RE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_E=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kh=/^( {2,}|\\)\n(?!\s*$)/,IE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,an=/[\p{P}\p{S}]/u,Hl=/[\s\p{P}\p{S}]/u,vh=/[^\s\p{P}\p{S}]/u,xE=ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Hl).getRegex(),Th=/(?!~)[\p{P}\p{S}]/u,NE=/(?!~)[\s\p{P}\p{S}]/u,CE=/(?:[^\s\p{P}\p{S}]|~)/u,OE=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,wh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,LE=ee(wh,"u").replace(/punct/g,an).getRegex(),DE=ee(wh,"u").replace(/punct/g,Th).getRegex(),Ah="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ME=ee(Ah,"gu").replace(/notPunctSpace/g,vh).replace(/punctSpace/g,Hl).replace(/punct/g,an).getRegex(),FE=ee(Ah,"gu").replace(/notPunctSpace/g,CE).replace(/punctSpace/g,NE).replace(/punct/g,Th).getRegex(),PE=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vh).replace(/punctSpace/g,Hl).replace(/punct/g,an).getRegex(),UE=ee(/\\(punct)/,"gu").replace(/punct/g,an).getRegex(),BE=ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$E=ee(zl).replace("(?:-->|$)","-->").getRegex(),qE=ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$E).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zE=ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rh=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Xt).replace("ref",ql).getRegex(),_h=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",ql).getRegex(),GE=ee("reflink|nolink(?!\\()","g").replace("reflink",Rh).replace("nolink",_h).getRegex(),jl={_backpedal:Rt,anyPunctuation:UE,autolink:BE,blockSkip:OE,br:kh,code:_E,del:Rt,emStrongLDelim:LE,emStrongRDelimAst:ME,emStrongRDelimUnd:PE,escape:RE,link:zE,nolink:_h,punctuation:xE,reflink:Rh,reflinkSearch:GE,tag:qE,text:IE,url:Rt},HE={...jl,link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Xt).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xt).getRegex()},El={...jl,emStrongRDelimAst:FE,emStrongLDelim:DE,url:ee(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},jE={...El,br:ee(kh).replace("{2,}","*").getRegex(),text:ee(El.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bt={normal:Gl,gfm:wE,pedantic:AE},St={normal:jl,gfm:El,breaks:jE,pedantic:HE},VE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Au=e=>VE[e];function Fe(e,t){if(t){if(be.escapeTest.test(e))return e.replace(be.escapeReplace,Au)}else if(be.escapeTestNoEncode.test(e))return e.replace(be.escapeReplaceNoEncode,Au);return e}function Ru(e){try{e=encodeURI(e).replace(be.percentDecode,"%")}catch{return null}return e}function _u(e,t){const n=e.replace(be.findPipe,(i,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(be.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(be.slashPipe,"|");return r}function kt(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function WE(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Iu(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function YE(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var Zt=class{options;rules;lexer;constructor(e){this.options=e||tt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:kt(n,`
@@ -1,4 +1,4 @@
1
- import{r as N,c as j,j as d,eL as K,eM as Q,q as X,x as Y,l as B,h as J}from"./index-CyII4Hy-.js";import{D as ee,E as te,C as ne}from"./types-CLudYYhK.js";const z=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function oe(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${ie(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
1
+ import{r as N,c as j,j as d,eL as K,eM as Q,q as X,x as Y,l as B,h as J}from"./index-Cif-NWVp.js";import{D as ee,E as te,C as ne}from"./types-oO8sHi9E.js";const z=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function oe(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${ie(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
2
2
  `+n+o.slice(l)}const r=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,a=o.match(r);if(a){const l=(a.index??0)+a[0].length;return o.slice(0,l)+`
3
3
  <head>
4
4
  `+n+`
@@ -1 +1 @@
1
- import{d as D,a as H,e as z,b as W}from"./auth-sg-w8oEV.js";import{aW as L}from"./index-CyII4Hy-.js";function J(){return window.location.origin}function R(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const P="mcp:oauth:callback:";let O=null;const K=1e3,j=10*6e4,C=15e3;class F{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??O?.redirectUrl??`${J()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function B(e){const t=L(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,i=new URL(n,t),s=new F({serverUrl:i.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const r=new Promise((u,d)=>{const y=e.timeout||j;let m,p,E,f=!1;const $=s.state(),S=`${P}${$}`,h=()=>{window.removeEventListener("message",b),window.removeEventListener("storage",U),clearTimeout(m),clearInterval(p),clearInterval(E);try{localStorage.removeItem(S)}catch{}};o.fn=c=>{f||(f=!0,h(),d(c))};const A=async c=>{if(f)return;if(f=!0,!c.success){h(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:k,state:V}=c;if(!k){h(),d(new Error("Missing authorization code"));return}if(s.getStoredState()!==V){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const M=(await D(i))?.authorization_servers?.[0]||i,I=await H(M),g=s.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const N=s.codeVerifier(),x=await z(M,{metadata:I,clientInformation:g,authorizationCode:k,codeVerifier:N,redirectUri:s.redirectUrl,resource:new URL(i)});h(),u({tokens:x,clientId:g.client_id??null,clientSecret:g.client_secret??null,tokenEndpoint:I?.token_endpoint??null,userinfoEndpoint:I?.userinfo_endpoint??null})}catch(v){h(),d(v)}},b=async c=>{!R()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await A(c.data)},U=async c=>{if(!(c.key!==S||!c.newValue))try{const k=JSON.parse(c.newValue);await A(k)}catch{}};window.addEventListener("message",b),window.addEventListener("storage",U),E=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(S)}catch{return}if(c)try{A(JSON.parse(c))}catch{}},K),m=setTimeout(()=>{f||(f=!0,h(),d(new Error("OAuth authentication timeout")))},y)});if(r.catch(()=>{}),await W(s,{serverUrl:i})==="REDIRECT"){const u=await r;return{token:u.tokens.access_token,tokenInfo:{accessToken:u.tokens.access_token,refreshToken:u.tokens.refresh_token??null,expiresIn:u.tokens.expires_in??null,scope:u.tokens.scope??null,clientId:u.clientId,clientSecret:u.clientSecret,tokenEndpoint:u.tokenEndpoint,userinfoEndpoint:u.userinfoEndpoint,idToken:u.tokens.id_token??null},error:null}}const l=s.tokens(),w=s.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:w?.client_id??null,clientSecret:w?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(r){return o.fn&&o.fn(r instanceof Error?r:new Error(String(r))),{token:null,tokenInfo:null,error:r instanceof Error?r.message:String(r)}}}function T(e,t){if(window.opener&&!window.opener.closed){const n=R()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${P}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function ee(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const i=e.get("error"),s=e.get("error_description");let o=n;if(n)try{const a=atob(n),l=JSON.parse(a);l.clientState&&(o=l.clientState)}catch{}if(i){const a=s||i;return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}if(!t||!n){const a="Missing code or state parameter";return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}return n=o||n,T({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function G(e){try{const t=_(),n=t?new URL(e,t):new URL(e),i=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return i?i[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function Y(e){try{const t=_();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function X(e,t,n){try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,s=n?new URL(i,n).href:i,o=_(),r=!n||new URL(n).origin===o,a=await fetch(s,{credentials:r?"include":"omit"});return a.ok?{hasToken:(await a.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function te({url:e,token:t,orgId:n,studioUrl:i,meshUrl:s}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const r=await fetch(e,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(C)}),a=G(e),l=Y(e),w=_(),u=L({studioUrl:i,meshUrl:s},w?new URL(e,w).origin:new URL(e).origin);if(r.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a&&l?await X(a,l,u):{hasToken:!1}).hasToken};let d;try{const p=await r.json();d=p.error||p.message}catch{}return r.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:d||`HTTP ${r.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!r.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:d||`HTTP ${r.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${C/1e3}s`:o.message}}}export{B as a,ee as h,te as i};
1
+ import{d as D,a as H,e as z,b as W}from"./auth-CQNA1z0f.js";import{aW as L}from"./index-Cif-NWVp.js";function J(){return window.location.origin}function R(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const P="mcp:oauth:callback:";let O=null;const K=1e3,j=10*6e4,C=15e3;class F{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??O?.redirectUrl??`${J()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function B(e){const t=L(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,i=new URL(n,t),s=new F({serverUrl:i.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const r=new Promise((u,d)=>{const y=e.timeout||j;let m,p,E,f=!1;const $=s.state(),S=`${P}${$}`,h=()=>{window.removeEventListener("message",b),window.removeEventListener("storage",U),clearTimeout(m),clearInterval(p),clearInterval(E);try{localStorage.removeItem(S)}catch{}};o.fn=c=>{f||(f=!0,h(),d(c))};const A=async c=>{if(f)return;if(f=!0,!c.success){h(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:k,state:V}=c;if(!k){h(),d(new Error("Missing authorization code"));return}if(s.getStoredState()!==V){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const M=(await D(i))?.authorization_servers?.[0]||i,I=await H(M),g=s.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const N=s.codeVerifier(),x=await z(M,{metadata:I,clientInformation:g,authorizationCode:k,codeVerifier:N,redirectUri:s.redirectUrl,resource:new URL(i)});h(),u({tokens:x,clientId:g.client_id??null,clientSecret:g.client_secret??null,tokenEndpoint:I?.token_endpoint??null,userinfoEndpoint:I?.userinfo_endpoint??null})}catch(v){h(),d(v)}},b=async c=>{!R()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await A(c.data)},U=async c=>{if(!(c.key!==S||!c.newValue))try{const k=JSON.parse(c.newValue);await A(k)}catch{}};window.addEventListener("message",b),window.addEventListener("storage",U),E=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(S)}catch{return}if(c)try{A(JSON.parse(c))}catch{}},K),m=setTimeout(()=>{f||(f=!0,h(),d(new Error("OAuth authentication timeout")))},y)});if(r.catch(()=>{}),await W(s,{serverUrl:i})==="REDIRECT"){const u=await r;return{token:u.tokens.access_token,tokenInfo:{accessToken:u.tokens.access_token,refreshToken:u.tokens.refresh_token??null,expiresIn:u.tokens.expires_in??null,scope:u.tokens.scope??null,clientId:u.clientId,clientSecret:u.clientSecret,tokenEndpoint:u.tokenEndpoint,userinfoEndpoint:u.userinfoEndpoint,idToken:u.tokens.id_token??null},error:null}}const l=s.tokens(),w=s.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:w?.client_id??null,clientSecret:w?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(r){return o.fn&&o.fn(r instanceof Error?r:new Error(String(r))),{token:null,tokenInfo:null,error:r instanceof Error?r.message:String(r)}}}function T(e,t){if(window.opener&&!window.opener.closed){const n=R()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${P}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function ee(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const i=e.get("error"),s=e.get("error_description");let o=n;if(n)try{const a=atob(n),l=JSON.parse(a);l.clientState&&(o=l.clientState)}catch{}if(i){const a=s||i;return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}if(!t||!n){const a="Missing code or state parameter";return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}return n=o||n,T({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function G(e){try{const t=_(),n=t?new URL(e,t):new URL(e),i=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return i?i[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function Y(e){try{const t=_();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function X(e,t,n){try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,s=n?new URL(i,n).href:i,o=_(),r=!n||new URL(n).origin===o,a=await fetch(s,{credentials:r?"include":"omit"});return a.ok?{hasToken:(await a.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function te({url:e,token:t,orgId:n,studioUrl:i,meshUrl:s}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const r=await fetch(e,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(C)}),a=G(e),l=Y(e),w=_(),u=L({studioUrl:i,meshUrl:s},w?new URL(e,w).origin:new URL(e).origin);if(r.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a&&l?await X(a,l,u):{hasToken:!1}).hasToken};let d;try{const p=await r.json();d=p.error||p.message}catch{}return r.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:d||`HTTP ${r.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!r.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:d||`HTTP ${r.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${C/1e3}s`:o.message}}}export{B as a,ee as h,te as i};