decocms 4.386.0 → 4.387.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/dist/client/assets/{AlertCircle-Cwl0Vup2.js → AlertCircle-Da3tM0gY.js} +1 -1
  2. package/dist/client/assets/{AreaChart-B4QXNZyj.js → AreaChart-8pK8iMto.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BS1ddrpm.js → ArrowLeft-EJr-YqTg.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CCNkzW9Y.js → ArrowRight-CdK41xWy.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-rfVFZ40K.js → ArrowUp-Cr0h1eUU.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-CDsQOuRz.js → CartesianChart-Dk_Nu3H0.js} +1 -1
  7. package/dist/client/assets/{Check-Chl3DDqT.js → Check-BgFwywFf.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-5QB6sfVV.js → CheckCircle-5We5Va5L.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BuAMP7GQ.js → ChevronUp-dgPQkcdv.js} +1 -1
  10. package/dist/client/assets/{Copy01-BwsqBYnE.js → Copy01-CMHlAzgS.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-BPHmR5OY.js → CreditCard01-DCgVn3oV.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Bv4-YScE.js → DotsVertical-C9TkkMfe.js} +1 -1
  13. package/dist/client/assets/{Download01-DyVswBhh.js → Download01-ChBwr6yr.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-L3hqxsjo.js → ErrorBarContext-Dx5toaO_.js} +1 -1
  15. package/dist/client/assets/{Eye-BGOdKOA7.js → Eye-D5VumA7M.js} +1 -1
  16. package/dist/client/assets/{Globe04-BkqSUJiA.js → Globe04-ClJkKQrs.js} +1 -1
  17. package/dist/client/assets/{Image01-DXUl1blo.js → Image01-BOrVV_OY.js} +1 -1
  18. package/dist/client/assets/{Key01-CTlB38YG.js → Key01-CyjVKKuN.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-BIWXERKW.js → LayoutLeft-C-Lx98x9.js} +1 -1
  20. package/dist/client/assets/{Line-zqIQ0PvH.js → Line-DESYdkiK.js} +1 -1
  21. package/dist/client/assets/{Link01-7UJLIg0N.js → Link01-C5bvI0ok.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DsBKvM3k.js → LinkExternal01-7ZLNL_9s.js} +1 -1
  23. package/dist/client/assets/{Monitor01-D3pXjo5b.js → Monitor01-CTvO6He0.js} +1 -1
  24. package/dist/client/assets/{Package-ImRUZcy3.js → Package-zC5cSGJD.js} +1 -1
  25. package/dist/client/assets/{Palette-B0nQwQuz.js → Palette-Hb6mROVB.js} +1 -1
  26. package/dist/client/assets/{Plus-DxM0fEC4.js → Plus-C6g4VoC2.js} +1 -1
  27. package/dist/client/assets/{SearchLg-DCjPeF5h.js → SearchLg-CF0JjYPh.js} +1 -1
  28. package/dist/client/assets/{SearchMd-tkECPV7l.js → SearchMd-BboWc_8K.js} +1 -1
  29. package/dist/client/assets/{Sector-BqmE_gpQ.js → Sector-C-8narGG.js} +1 -1
  30. package/dist/client/assets/{Share07-fkd7xmY6.js → Share07-CbepO2bZ.js} +1 -1
  31. package/dist/client/assets/{Stars01-BoztdLAd.js → Stars01-BSCYhMLo.js} +1 -1
  32. package/dist/client/assets/{Sun-CTx2w4hs.js → Sun--XqnAA9t.js} +1 -1
  33. package/dist/client/assets/{Tool01-DUJdCnDK.js → Tool01-CwUt8jvw.js} +1 -1
  34. package/dist/client/assets/{Trash01-B-_Oqcf7.js → Trash01-bzV9Pa75.js} +1 -1
  35. package/dist/client/assets/{Upload01-alz3omvs.js → Upload01-DKLqc8wc.js} +1 -1
  36. package/dist/client/assets/{User01-DwcV_kyF.js → User01-5UPFm-U6.js} +1 -1
  37. package/dist/client/assets/{UserSquare-CsgvAwaQ.js → UserSquare-C_2Z4y9_.js} +1 -1
  38. package/dist/client/assets/{Users01-DAeXmo2u.js → Users01-CBoZFJLg.js} +1 -1
  39. package/dist/client/assets/{X-BEAR-IcH.js → X-i7IpcK8C.js} +1 -1
  40. package/dist/client/assets/{XCircle-BBqXvE8C.js → XCircle-ClHynDO9.js} +1 -1
  41. package/dist/client/assets/{XClose-Ca9S5aZc.js → XClose-XZQSLHM2.js} +1 -1
  42. package/dist/client/assets/{Zap-thqSL15H.js → Zap-13Bw0A-o.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-DnIqLBGF.js → ZoomOut-BJTVjnBu.js} +1 -1
  44. package/dist/client/assets/{access-gate-5gX8wxGV.js → access-gate-ZcxGf-TD.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-BdL2dPAr.js → add-connection-dialog-BB4K9AtD.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-BIxeEB_F.js → agent-analytics-Ba_H9uKD.js} +1 -1
  47. package/dist/client/assets/agent-app-B0yYw2Kn.js +1 -0
  48. package/dist/client/assets/{agent-assets-DdAbXfi1.js → agent-assets-CHstkwVO.js} +1 -1
  49. package/dist/client/assets/{agent-automation-Bef81mY6.js → agent-automation-fLrgKvmb.js} +1 -1
  50. package/dist/client/assets/{agent-automations-1PVmd792.js → agent-automations-x2k3Xyf9.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-BisHTH6n.js → agent-connect-sources-CqfI5UWv.js} +1 -1
  52. package/dist/client/assets/agent-deck-BsRl1MeW.js +1 -0
  53. package/dist/client/assets/{agent-e2e-DTfzR2qE.js → agent-e2e-CXJJJ6Gw.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-BHDRViXO.js → agent-experiments-BAAdxVE4.js} +1 -1
  55. package/dist/client/assets/agent-file-BPpuqCrP.js +1 -0
  56. package/dist/client/assets/{agent-git-DHxCuZd4.js → agent-git-CMvu2d7w.js} +1 -1
  57. package/dist/client/assets/{agent-hosting-Ckq3R_8_.js → agent-hosting-CvDl_6mC.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CP0I3VVA.js → agent-icon-4F7jSNEB.js} +1 -1
  59. package/dist/client/assets/agent-library-file-WGFNhYmG.js +1 -0
  60. package/dist/client/assets/{agent-monitor-CYjn5ov-.js → agent-monitor-BkoB5cnN.js} +1 -1
  61. package/dist/client/assets/{agent-overview-CQfoY9eA.js → agent-overview-Ce_1EsV_.js} +1 -1
  62. package/dist/client/assets/agent-settings-DvcVBQPF.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-CmVIWUTI.js → agent-site-editor-4I6oPW-3.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-P4w-qKSF.js +2 -0
  65. package/dist/client/assets/{agent-site-editor-content-q6dSRjGp.js → agent-site-editor-content-DCyPeHZN.js} +2 -2
  66. package/dist/client/assets/{agent-site-editor-preview-CYdEZwyJ.js → agent-site-editor-preview-CMlz0qAL.js} +3 -3
  67. package/dist/client/assets/agent-view-Cm9nHUf9.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-DClgQS_E.js → agent-view-guard-DRtIvPWQ.js} +1 -1
  69. package/dist/client/assets/{agents-list-x9nDr_UM.js → agents-list-D460o79D.js} +1 -1
  70. package/dist/client/assets/{ai-providers-BLLOHjvZ.js → ai-providers-BP9IRbNu.js} +1 -1
  71. package/dist/client/assets/{alert-DWLTyUNd.js → alert-Dk_6vTVk.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-BCnbMjLm.js → alert-dialog-DAmr19x7.js} +1 -1
  73. package/dist/client/assets/api-keys-BEQ_tuCQ.js +1 -0
  74. package/dist/client/assets/{api-keys-C8x1m95I.js → api-keys-bKyXvobb.js} +1 -1
  75. package/dist/client/assets/app-editor-BC02Q4FF.js +1 -0
  76. package/dist/client/assets/{asset-utils-CxMWm-Q0.js → asset-utils-DtY2LEWI.js} +1 -1
  77. package/dist/client/assets/{auth-fkwwQuGR.js → auth-BJh0XKDc.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-zbWwf6nX.js → auth-catchall-BYXjG1QL.js} +1 -1
  79. package/dist/client/assets/{auth-entry-BnSKshlv.js → auth-entry-DVCgvwZe.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-DAvJosau.js → auth-split-layout-CXC2GWWn.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-BogPKDev.js → authenticate-and-persist-oauth-DwKiV4n5.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-BHuKh4jN.js → automation-list-row-CTdbLZEd.js} +1 -1
  83. package/dist/client/assets/{automation-runs-Cg4f9PTn.js → automation-runs-CnJ5aGhK.js} +1 -1
  84. package/dist/client/assets/{automations-Bly1_hA4.js → automations-Br3Jz1gr.js} +1 -1
  85. package/dist/client/assets/{autosend-Du7-oKR0.js → autosend-BhoAi_fW.js} +1 -1
  86. package/dist/client/assets/{avatar-DvLLRJ7_.js → avatar-SVBTSz6-.js} +1 -1
  87. package/dist/client/assets/{badge-jSVR8IKO.js → badge-Tw_0Gnfk.js} +1 -1
  88. package/dist/client/assets/{block-document-DDK0W4Gk.js → block-document-GOrRnpK9.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-wIvRUegF.js → blocks-preview-workspace-context-EH6speMF.js} +1 -1
  90. package/dist/client/assets/{breadcrumb-BcN7LEPN.js → breadcrumb-D4Wt1N2M.js} +1 -1
  91. package/dist/client/assets/{buckets-Cws0X-ao.js → buckets-tP0hGMmZ.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-CIZv76q4.js → build-improve-prompt-doc-DiHbbOvk.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel--mTH44nT.js → bulk-category-panel-BZ9sB0IZ.js} +1 -1
  94. package/dist/client/assets/{calendar-DL1g-R6I.js → calendar-PjjlUwcV.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-O16y38Ak.js → capability-load-error-R2VQLYeI.js} +1 -1
  96. package/dist/client/assets/{category-editor-DeXj55lm.js → category-editor-CxqI2r6D.js} +1 -1
  97. package/dist/client/assets/{chart-XotQAjm8.js → chart-D8AtS0yx.js} +1 -1
  98. package/dist/client/assets/{chat-context-bQBeY2t1.js → chat-context-DUFRp2o5.js} +1 -1
  99. package/dist/client/assets/{chat-draft-Dw5lkxkv.js → chat-draft-NKFUt1rK.js} +1 -1
  100. package/dist/client/assets/{checkbox-C70qRnxL.js → checkbox-D0AAAikP.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Bz0n65rr.js → choose-editor-B000DboW.js} +1 -1
  102. package/dist/client/assets/{cli-auth-success-B6YdLpZk.js → cli-auth-success-AUJoXJI_.js} +1 -1
  103. package/dist/client/assets/{client-icons-Cz9Mab30.js → client-icons-DCYyFEeJ.js} +1 -1
  104. package/dist/client/assets/{collapsible-CBOJskaw.js → collapsible-BQcY6rPc.js} +1 -1
  105. package/dist/client/assets/{collection-detail-BcWKItse.js → collection-detail-DzOJuwuX.js} +1 -1
  106. package/dist/client/assets/{collection-display-button-D4M61Icm.js → collection-display-button-TL4JNINs.js} +1 -1
  107. package/dist/client/assets/{collection-search-CKFQt3zo.js → collection-search-Dz6UsoEM.js} +1 -1
  108. package/dist/client/assets/{collection-table-wrapper-nOJd7tk7.js → collection-table-wrapper-Dvc9tAft.js} +1 -1
  109. package/dist/client/assets/{collection-tabs-nLUzyG3L.js → collection-tabs-CstWw66H.js} +1 -1
  110. package/dist/client/assets/{combobox-D4piYhGL.js → combobox-Bt8qlvBP.js} +1 -1
  111. package/dist/client/assets/{command-SQ6iukKb.js → command-BMFq9nQJ.js} +1 -1
  112. package/dist/client/assets/{companion-mcps-section-YzjKtKLp.js → companion-mcps-section-D1qbqBsw.js} +1 -1
  113. package/dist/client/assets/{connect-layout-CrrPleYY.js → connect-layout-ChbbJuCS.js} +1 -1
  114. package/dist/client/assets/{connect-BxPVUdhh.js → connect-uHFLnX_o.js} +1 -1
  115. package/dist/client/assets/{connection-DdQElG6t.js → connection-Bu_kYZuh.js} +1 -1
  116. package/dist/client/assets/{connection-card-BS_OpxON.js → connection-card-BR0rWuUi.js} +1 -1
  117. package/dist/client/assets/{connection-detail-DCDkcs1Y.js → connection-detail-CuqAdmCe.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-DZC7DBzw.js → connection-form-helpers-glicOBfm.js} +1 -1
  119. package/dist/client/assets/{connections-DF9tLWxn.js → connections-DE0s5wKI.js} +1 -1
  120. package/dist/client/assets/{create-organization-dialog-BuDkvaJX.js → create-organization-dialog-Btvjtxwc.js} +1 -1
  121. package/dist/client/assets/{decofile-api-DyGAd2r4.js → decofile-api-DgTLnV1u.js} +1 -1
  122. package/dist/client/assets/{decopilot-CYIi3WEs.js → decopilot-tLRiBCr4.js} +1 -1
  123. package/dist/client/assets/{dialog-RGKICG4s.js → dialog-MzmGuLy9.js} +1 -1
  124. package/dist/client/assets/{discover-DQgdsihh.js → discover-Vh8ajle8.js} +1 -1
  125. package/dist/client/assets/{domain-settings-DcP3rGWU.js → domain-settings-B0_s17em.js} +1 -1
  126. package/dist/client/assets/{download-app-dialog-DPWfpRBg.js → download-app-dialog-CDDWmfdP.js} +1 -1
  127. package/dist/client/assets/{drawer-B4Z-ExBx.js → drawer-Cv924bvf.js} +1 -1
  128. package/dist/client/assets/{editor-Do7ruOhn.js → editor-zW3jvuax.js} +1 -1
  129. package/dist/client/assets/{empty-state-B7gXx_Yh.js → empty-state-BptHyu85.js} +1 -1
  130. package/dist/client/assets/{empty-state-BmmdOg75.js → empty-state-DTUS3HtE.js} +1 -1
  131. package/dist/client/assets/{extract-connection-data-BZ3x_jRc.js → extract-connection-data-DNxvULAk.js} +1 -1
  132. package/dist/client/assets/{feature-gate-nddpwuFB.js → feature-gate-B9rqGCJb.js} +1 -1
  133. package/dist/client/assets/{feature-paywall-D-5vciMm.js → feature-paywall-CftG_N1J.js} +1 -1
  134. package/dist/client/assets/{file-explorer-CkwFRkGO.js → file-explorer-DpIL2rDI.js} +1 -1
  135. package/dist/client/assets/{file-preview-DOetwKct.js → file-preview-D8URAIQ-.js} +1 -1
  136. package/dist/client/assets/{file-share-button-D0sR8ZJX.js → file-share-button-CahJYVQ3.js} +1 -1
  137. package/dist/client/assets/{file-type-icon-DdSZ0ia4.js → file-type-icon-D1D8leoE.js} +1 -1
  138. package/dist/client/assets/{folder-icon-CKLDN3FF.js → folder-icon-BU_WAjfX.js} +1 -1
  139. package/dist/client/assets/{form-CNnZbB2s.js → form-C4j126KK.js} +1 -1
  140. package/dist/client/assets/{gateway-client-Bn4ALbwj.js → gateway-client-3gBYEcvM.js} +1 -1
  141. package/dist/client/assets/{general-CQLFQc2y.js → general-CJkAPcsm.js} +1 -1
  142. package/dist/client/assets/{github-icon-ZhItaKRN.js → github-icon-l7M1zEUL.js} +1 -1
  143. package/dist/client/assets/{home-BbJ11nz4.js → home-CsHK1Vud.js} +1 -1
  144. package/dist/client/assets/{hooks-CdPo1Znu.js → hooks-B23Jg659.js} +1 -1
  145. package/dist/client/assets/{hooks-DEf7SAIB.js → hooks-D2YeBh8J.js} +1 -1
  146. package/dist/client/assets/{icon-button-BBfdKkxm.js → icon-button-Du-P1XdE.js} +1 -1
  147. package/dist/client/assets/{index-Dbhl3fMQ.js → index-B9AVbFn1.js} +1 -1
  148. package/dist/client/assets/{index-0l2SUkGD.js → index-CAYWsHcv.js} +1 -1
  149. package/dist/client/assets/{index-B2xKtish.js → index-CHLOyz8f.js} +1 -1
  150. package/dist/client/assets/{index-DVjR6OZ0.js → index-CllSFgmg.js} +1 -1
  151. package/dist/client/assets/{index-B-yd3uye.js → index-Clt0_ml3.js} +1 -1
  152. package/dist/client/assets/{index-CFyHGgGO.js → index-Cm-Yn4q_.js} +2 -2
  153. package/dist/client/assets/{index-CJazvqGq.js → index-D4cAPfDs.js} +1 -1
  154. package/dist/client/assets/{index-Dk3gb-bB.js → index-D9u292hz.js} +1 -1
  155. package/dist/client/assets/{index-BkqcEh_k.js → index-DDt-mfSn.js} +1 -1
  156. package/dist/client/assets/{index-DrGKKl-C.js → index-DORz3VsI.js} +1 -1
  157. package/dist/client/assets/{index-CUVOFMQ0.js → index-Dd7WwYBf.js} +1 -1
  158. package/dist/client/assets/{index-CeM0-Jf1.js → index-Ddaygbdd.js} +1 -1
  159. package/dist/client/assets/{index-mOfnLvd1.js → index-DiJK2wHU.js} +1 -1
  160. package/dist/client/assets/{index-Dv6121Hz.js → index-G_4wgESR.js} +1 -1
  161. package/dist/client/assets/{index-redirect-BuCFkWnW.js → index-redirect-CSA_uYqe.js} +1 -1
  162. package/dist/client/assets/{infiniteQueryObserver-B4v_iRrA.js → infiniteQueryObserver-kZQR6QZi.js} +1 -1
  163. package/dist/client/assets/{infra-billing-B4de5HCu.js → infra-billing-CzqGCEh_.js} +1 -1
  164. package/dist/client/assets/{input-Cx-TB157.js → input-8i6Bk9mS.js} +1 -1
  165. package/dist/client/assets/{input-BXe2-JP2.js → input-BqjhD7MF.js} +1 -1
  166. package/dist/client/assets/{input-DWLaMaA_.js → input-IyrqyofH.js} +1 -1
  167. package/dist/client/assets/{integration-icon-DRK9pjva.js → integration-icon-BPXGYcG_.js} +1 -1
  168. package/dist/client/assets/{label-BKtkcOfE.js → label-Cq0XOqve.js} +1 -1
  169. package/dist/client/assets/{last-preview-page-Bg8E-AYl.js → last-preview-page-BiAM4n_B.js} +1 -1
  170. package/dist/client/assets/{layout-DZRZAwg6.js → layout-CE21QG_N.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-BdEkG-e3.js → legacy-agents-deep-B_QAQTHc.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-C-Ov90Nk.js → legacy-main-redirect-BKBPh_b_.js} +1 -1
  173. package/dist/client/assets/{library-B03FDNrJ.js → library-CCtDJiGL.js} +1 -1
  174. package/dist/client/assets/{login-Cfe6-PZw.js → login-TjjJ7hBC.js} +1 -1
  175. package/dist/client/assets/{markdown-B9hrSGqM.js → markdown-BXZJduYq.js} +1 -1
  176. package/dist/client/assets/{mcp-app-renderer-hpUMUqH2.js → mcp-app-renderer-znNhYyyo.js} +1 -1
  177. package/dist/client/assets/{mcp-oauth-wOINJv40.js → mcp-oauth-DpctXbyl.js} +1 -1
  178. package/dist/client/assets/{members-B06BrVk5.js → members-C22vh0zf.js} +1 -1
  179. package/dist/client/assets/{message-templates-DU9l-F4Q.js → message-templates-CJsxM1Aj.js} +1 -1
  180. package/dist/client/assets/{mini-report-page-rgtxxMJ3.js → mini-report-page-EjA-mPMg.js} +1 -1
  181. package/dist/client/assets/{mock-board-CKOC8D-U.js → mock-board-C7y8-NQY.js} +3 -3
  182. package/dist/client/assets/{monaco-editor-EmJk9YYb.js → monaco-editor-D1EuV3RH.js} +1 -1
  183. package/dist/client/assets/{monitoring-stats-row-D7CBnFwq.js → monitoring-stats-row-CtceWj8b.js} +1 -1
  184. package/dist/client/assets/{multi-select-C-ELmy86.js → multi-select-YAftz-Zw.js} +1 -1
  185. package/dist/client/assets/{mustache-DAjB40dp.js → mustache-LQdueZ7J.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-BWXvJmGd.js → oauth-callback-CMV31h-n.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider-BqevP8FM.js → oauth-callback-ai-provider-De2DItw8.js} +1 -1
  188. package/dist/client/assets/{onboarding-DJrrwT4H.js → onboarding-eH-IPrp7.js} +1 -1
  189. package/dist/client/assets/{optimistic-project-sidebar-views-CwNqyPwJ.js → optimistic-project-sidebar-views-InMvM441.js} +1 -1
  190. package/dist/client/assets/{org-file-open-context-CmQ30gJ0.js → org-file-open-context-lYlEwrS6.js} +1 -1
  191. package/dist/client/assets/{organization-choice-BGgXGTHR.js → organization-choice-FGe4nTR_.js} +1 -1
  192. package/dist/client/assets/{orgs-BU7FeLyY.js → orgs-DiYo2OSV.js} +1 -1
  193. package/dist/client/assets/{page-seo-form-DEYu0i8V.js → page-seo-form-Dwe3nGYW.js} +1 -1
  194. package/dist/client/assets/{pair-Cj72V51B.js → pair-BEtEaRoT.js} +1 -1
  195. package/dist/client/assets/{plan-ladder-D66BgqbO.js → plan-ladder-CuzeFHa4.js} +1 -1
  196. package/dist/client/assets/{popover-DcrAVb5K.js → popover-0yOMUN9V.js} +1 -1
  197. package/dist/client/assets/{post-calendar-DQJqqdYQ.js → post-calendar-BWXIOp26.js} +1 -1
  198. package/dist/client/assets/{post-editor-CnuSsn5o.js → post-editor--ZAMVoRu.js} +1 -1
  199. package/dist/client/assets/{preview-content-BkDU3n_6.js → preview-content-DryeENmS.js} +1 -1
  200. package/dist/client/assets/{preview-dialog-BEV5NAsU.js → preview-dialog-DA5gB4Zx.js} +1 -1
  201. package/dist/client/assets/{primitives-BKiteFSN.js → primitives-D1Uh-Z46.js} +1 -1
  202. package/dist/client/assets/{profile-DNhI3M1I.js → profile-CWTJPNwM.js} +1 -1
  203. package/dist/client/assets/{project-app-view-yhcKhzKq.js → project-app-view-BTrwboPy.js} +1 -1
  204. package/dist/client/assets/{project-feed-N5qYzpK3.js → project-feed-DwPbuz1r.js} +1 -1
  205. package/dist/client/assets/{project-icon-Bqg6xA8a.js → project-icon-7mHVCrAj.js} +1 -1
  206. package/dist/client/assets/project-reports-DOvb8BA4.js +1 -0
  207. package/dist/client/assets/project-tasks-C4121Jp_.js +1 -0
  208. package/dist/client/assets/{prompts-BHzDLPr-.js → prompts-JpOZz60E.js} +1 -1
  209. package/dist/client/assets/record-editor-DcMeB_oO.js +1 -0
  210. package/dist/client/assets/{redirect-editor-C3yLM9GS.js → redirect-editor-Dm1Lv4vd.js} +1 -1
  211. package/dist/client/assets/{reports-CZ22PHjO.js → reports-DKNNx4qg.js} +1 -1
  212. package/dist/client/assets/reports-JVS2p_sy.js +1 -0
  213. package/dist/client/assets/{reports-onboarding-O5OWivlS.js → reports-onboarding-B2DiJAba.js} +1 -1
  214. package/dist/client/assets/{reports-tab-D06j41C-.js → reports-tab-b7qGy0mk.js} +2 -2
  215. package/dist/client/assets/{repositories-DNHhpOIv.js → repositories-DD6Ukhrw.js} +1 -1
  216. package/dist/client/assets/{repository-import-picker-C-ngL2qG.js → repository-import-picker-fxShIRss.js} +1 -1
  217. package/dist/client/assets/{repository-picker-B8J8aCKh.js → repository-picker-df_kLebP.js} +1 -1
  218. package/dist/client/assets/{require-capability-B_Hqq5xX.js → require-capability-C5sz4l9u.js} +1 -1
  219. package/dist/client/assets/{required-auth-layout-kiGhn0Fl.js → required-auth-layout-Dx8h2y43.js} +1 -1
  220. package/dist/client/assets/{reset-password-CYenWslr.js → reset-password-Dee2FaRd.js} +1 -1
  221. package/dist/client/assets/{resizable-Bz43PogG.js → resizable-CKKKCPOb.js} +1 -1
  222. package/dist/client/assets/{review-settings-BH7SICgo.js → review-settings-AoqfsyyE.js} +1 -1
  223. package/dist/client/assets/{rich-text-link-control-BLDmy_gB.js → rich-text-link-control-B3amDY-g.js} +1 -1
  224. package/dist/client/assets/{roles-CwOV4v2C.js → roles-C_pvm_A3.js} +1 -1
  225. package/dist/client/assets/{route--7-PGBU_.js → route-B5aRnclN.js} +1 -1
  226. package/dist/client/assets/{route-CQHOnOna.js → route-BebMWENX.js} +1 -1
  227. package/dist/client/assets/{route-D0YaB0fj.js → route-DhqILjJn.js} +1 -1
  228. package/dist/client/assets/{route-page-header-BuGOTt8l.js → route-page-header-wQvHg13u.js} +1 -1
  229. package/dist/client/assets/{runnable-block-editor-CW2Atb2y.js → runnable-block-editor-CTtbEokq.js} +1 -1
  230. package/dist/client/assets/{sandbox-lifecycle-context-B1H1oa0w.js → sandbox-lifecycle-context-BfjBaS4k.js} +1 -1
  231. package/dist/client/assets/{schema-GryfzY0i.js → schema-CfWSVtg9.js} +1 -1
  232. package/dist/client/assets/{scroll-area-DzZiCQPZ.js → scroll-area-D5XoGWja.js} +1 -1
  233. package/dist/client/assets/{search-input-SHiTlnCE.js → search-input-oOSx8rAu.js} +1 -1
  234. package/dist/client/assets/{search-toggle-D4N3AzPW.js → search-toggle-CgpfZR25.js} +1 -1
  235. package/dist/client/assets/{secrets-Ctzc3HXv.js → secrets-C0jZB_x3.js} +1 -1
  236. package/dist/client/assets/{sections-editor-DXtafrXa.js → sections-editor-ILck9TBW.js} +1 -1
  237. package/dist/client/assets/{select-rL7p93dx.js → select-Dyq1d0JF.js} +1 -1
  238. package/dist/client/assets/{select-model-DHG0nuQY.js → select-model-BmMrWwNd.js} +1 -1
  239. package/dist/client/assets/{seo-editor-B7c6S06X.js → seo-editor-CzWbhfG4.js} +1 -1
  240. package/dist/client/assets/{separator-D8sL6zYz.js → separator-CeLCsnF4.js} +1 -1
  241. package/dist/client/assets/{settings-tab-Cn070EFz.js → settings-tab-D6snhK7R.js} +1 -1
  242. package/dist/client/assets/{sheet-Dq_EWs2W.js → sheet-4N_7bh_n.js} +1 -1
  243. package/dist/client/assets/{shell-layout-D1F8kHl9.js → shell-layout-mxurnlT8.js} +1 -1
  244. package/dist/client/assets/{sidebar-D43DhIwE.js → sidebar-C9HUL4Zk.js} +1 -1
  245. package/dist/client/assets/{skill-preview-B97-mTZP.js → skill-preview-uy28GPTb.js} +1 -1
  246. package/dist/client/assets/{skills-Cx3kWc9A.js → skills-BFXrBkuz.js} +1 -1
  247. package/dist/client/assets/{sso-BnGi7SX9.js → sso-BthNdlgS.js} +1 -1
  248. package/dist/client/assets/{switch-DLx_1rQF.js → switch-BJbkn4iq.js} +1 -1
  249. package/dist/client/assets/{synced-repos-B4EDqgTE.js → synced-repos-Bn3taHAf.js} +1 -1
  250. package/dist/client/assets/{table-wc_V6Osx.js → table-Cqt3fFs7.js} +1 -1
  251. package/dist/client/assets/{tabs-CQkW3bOH.js → tabs-DfTLJ-n_.js} +1 -1
  252. package/dist/client/assets/{task-board-BjqJ_zE6.js → task-board-D_YhOLZh.js} +1 -1
  253. package/dist/client/assets/{task-route-b5zDQpw0.js → task-route-CCsvGOiX.js} +1 -1
  254. package/dist/client/assets/{task-status-B7fE_9za.js → task-status-DpEZTwHj.js} +1 -1
  255. package/dist/client/assets/{taskboard-analytics-K9sDH74m.js → taskboard-analytics-ewF7fNbV.js} +1 -1
  256. package/dist/client/assets/tasks-BiwI0Nwu.js +1 -0
  257. package/dist/client/assets/{tasks-B1yh0s0B.js → tasks-DH8JVPEr.js} +1 -1
  258. package/dist/client/assets/{textarea-BaPpC4Bd.js → textarea-DwEKjGZF.js} +1 -1
  259. package/dist/client/assets/{thread-button-Ch4zKk0N.js → thread-button-C_b8KN5j.js} +1 -1
  260. package/dist/client/assets/{thread-intent-XcHSP8zW.js → thread-intent-EyHIlLf5.js} +1 -1
  261. package/dist/client/assets/{thread-route-CGP_k3DO.js → thread-route-D8to8sA5.js} +1 -1
  262. package/dist/client/assets/{thread-route-C-J8Dvgz.js → thread-route-RnLVS5MF.js} +1 -1
  263. package/dist/client/assets/{thread-sheet-body-D8_23FE-.js → thread-sheet-body-CeCoa5Lv.js} +1 -1
  264. package/dist/client/assets/{toggle-group-D9KWjWLm.js → toggle-group-CHLe_ngX.js} +1 -1
  265. package/dist/client/assets/{toolbar-icon-button-BB2_W4d6.js → toolbar-icon-button-CAkp1a-v.js} +1 -1
  266. package/dist/client/assets/{tooltip-DRlnzIQm.js → tooltip-Bja45eMa.js} +1 -1
  267. package/dist/client/assets/{track-CXrvs8hW.js → track-BKTYoAt0.js} +1 -1
  268. package/dist/client/assets/{types-D4W-t3kf.js → types-imD2hCXv.js} +1 -1
  269. package/dist/client/assets/{usage-stats-Fyuoa0E1.js → usage-stats-DL6Mxcqj.js} +1 -1
  270. package/dist/client/assets/{use-ai-providers-C4dXO9Yz.js → use-ai-providers-VJDsVUMj.js} +1 -1
  271. package/dist/client/assets/{use-automations-9dsFC6Pt.js → use-automations-YsQ3mp7f.js} +1 -1
  272. package/dist/client/assets/{use-autosave-CriUkKcO.js → use-autosave-B4Sy5dKm.js} +1 -1
  273. package/dist/client/assets/{use-connect-companion-DE-jLyCh.js → use-connect-companion-BaKonimr.js} +1 -1
  274. package/dist/client/assets/{use-connection-By40b12N.js → use-connection-BNw2MaMd.js} +1 -1
  275. package/dist/client/assets/{use-copy-BLJCJFHS.js → use-copy-CeHMXkmI.js} +1 -1
  276. package/dist/client/assets/{use-create-virtual-mcp-D0AahD2t.js → use-create-virtual-mcp-DYSVpRcW.js} +1 -1
  277. package/dist/client/assets/{use-date-fns-locale-CNRPcj9k.js → use-date-fns-locale-CRSpZTHr.js} +1 -1
  278. package/dist/client/assets/{use-debounced-autosave-BzX7iQl5.js → use-debounced-autosave-Bkd-RMtF.js} +1 -1
  279. package/dist/client/assets/{use-debounced-value-DQiu0Px1.js → use-debounced-value-CBSXKHwV.js} +1 -1
  280. package/dist/client/assets/{use-deco-credits-1r5nuYBd.js → use-deco-credits-C6itQLFB.js} +1 -1
  281. package/dist/client/assets/{use-decopilot-events-DwM9-jMb.js → use-decopilot-events-EQT-Ff7p.js} +1 -1
  282. package/dist/client/assets/{use-delete-connection-huvoW3MI.js → use-delete-connection-DpRl8Clh.js} +1 -1
  283. package/dist/client/assets/{use-deployment-admin-BZm5KCvv.js → use-deployment-admin-2vhBPVeg.js} +1 -1
  284. package/dist/client/assets/{use-entitlements-Bvz6_GHn.js → use-entitlements-CfU3YoB8.js} +1 -1
  285. package/dist/client/assets/{use-fast-preview-draft-url-ITLFeGjr.js → use-fast-preview-draft-url-3apT4hX9.js} +1 -1
  286. package/dist/client/assets/{use-file-configs-Dc750_n6.js → use-file-configs-DV2TLqWx.js} +1 -1
  287. package/dist/client/assets/{use-in-settings-Nr5h58Dc.js → use-in-settings-CYLMPJdc.js} +1 -1
  288. package/dist/client/assets/{use-infinite-scroll-5IN_AQUC.js → use-infinite-scroll-CcnUJvw1.js} +1 -1
  289. package/dist/client/assets/{use-join-requests-BUruBjE6.js → use-join-requests-CAJnDyFH.js} +1 -1
  290. package/dist/client/assets/{use-main-panel-tabs-CE7T9zOX.js → use-main-panel-tabs-T0Kvslcy.js} +1 -1
  291. package/dist/client/assets/{use-mcp-auth-status-DQ1IMcVT.js → use-mcp-auth-status-dN9WL_Cj.js} +1 -1
  292. package/dist/client/assets/{use-mcp-client-Cgrjx403.js → use-mcp-client-DAbHG4oK.js} +1 -1
  293. package/dist/client/assets/{use-mcp-prompts-PD_QSplo.js → use-mcp-prompts-Dqrno6f9.js} +1 -1
  294. package/dist/client/assets/{use-mcp-tools-CbiwxQvl.js → use-mcp-tools-B9HxU8OQ.js} +1 -1
  295. package/dist/client/assets/{use-members-DXD-dNoi.js → use-members-CX4Ep53P.js} +1 -1
  296. package/dist/client/assets/{use-mobile-B90d5ZlF.js → use-mobile-BlhybxdO.js} +1 -1
  297. package/dist/client/assets/{use-navigate-to-agent-CUne0-cI.js → use-navigate-to-agent-UrDQ1j_Y.js} +1 -1
  298. package/dist/client/assets/{use-open-billing-url-nDZTfkQK.js → use-open-billing-url-Clbiqv9s.js} +1 -1
  299. package/dist/client/assets/{use-org-auth-client-PQEXc1yD.js → use-org-auth-client-0lE24BYR.js} +1 -1
  300. package/dist/client/assets/{use-org-fs-DeO5Vs7G.js → use-org-fs-Dm0MOI2N.js} +1 -1
  301. package/dist/client/assets/{use-org-repo-syncs-DF_-QyL3.js → use-org-repo-syncs-DtP2qP0h.js} +1 -1
  302. package/dist/client/assets/{use-org-sso-DXBbBboL.js → use-org-sso-CaeEbX_L.js} +1 -1
  303. package/dist/client/assets/{use-organization-roles-CFSRd1jc.js → use-organization-roles-DoF8H4qR.js} +1 -1
  304. package/dist/client/assets/{use-organization-settings-ALMIpIdG.js → use-organization-settings-aVVw0VfM.js} +1 -1
  305. package/dist/client/assets/{use-panel-navigate-BHrQSu9h.js → use-panel-navigate-BZ20L_1u.js} +1 -1
  306. package/dist/client/assets/{use-project-native-view-presence-Y2wkBJMs.js → use-project-native-view-presence-B8m71d1U.js} +1 -1
  307. package/dist/client/assets/{use-project-scope-FsdoI9gD.js → use-project-scope-DNhflWSF.js} +1 -1
  308. package/dist/client/assets/{use-releases-xo3RYWEP.js → use-releases-DGcFLhQX.js} +1 -1
  309. package/dist/client/assets/{use-reports-diagnostic-CtQFcqBI.js → use-reports-diagnostic-BFhpAlDR.js} +1 -1
  310. package/dist/client/assets/{use-route-default-main-BqmVu7AG.js → use-route-default-main-Cpujna-F.js} +1 -1
  311. package/dist/client/assets/{use-secrets-DxDq4D6_.js → use-secrets-BuzOki6X.js} +1 -1
  312. package/dist/client/assets/{use-section-preview-base-DaZur2dM.js → use-section-preview-base-DOg0m0Oe.js} +1 -1
  313. package/dist/client/assets/{use-session-runtime-C4wBDVOy.js → use-session-runtime-ttdCX595.js} +1 -1
  314. package/dist/client/assets/{use-tags-c1eddqqE.js → use-tags-COwpPGb0.js} +1 -1
  315. package/dist/client/assets/{use-task-board-analytics-DJ3wBWjU.js → use-task-board-analytics-Dfcytd4V.js} +1 -1
  316. package/dist/client/assets/{use-task-metadata-Bf-ipBBx.js → use-task-metadata-CIrvVpnI.js} +1 -1
  317. package/dist/client/assets/{use-thread-outputs-B5BUO9_U.js → use-thread-outputs-DFHmpQbO.js} +1 -1
  318. package/dist/client/assets/{use-virtual-mcp-DbjQS13M.js → use-virtual-mcp-joDFMrl3.js} +1 -1
  319. package/dist/client/assets/useInfiniteQuery-ApIt4V4o.js +1 -0
  320. package/dist/client/assets/{useQueries-QDBruPdh.js → useQueries-BoM9aW6V.js} +1 -1
  321. package/dist/client/assets/useSuspenseInfiniteQuery-Vryw3RBz.js +1 -0
  322. package/dist/client/assets/{users-CvddDmkv.js → users-i9Zh69o3.js} +1 -1
  323. package/dist/client/assets/{utils-Do-NKG3l.js → utils-DjeQFU_k.js} +1 -1
  324. package/dist/client/assets/{variant-calendar-BkV-nx_1.js → variant-calendar-CmLSEJPW.js} +1 -1
  325. package/dist/client/assets/{variant-matcher-override-DGI26buK.js → variant-matcher-override-mXWxdv2F.js} +1 -1
  326. package/dist/client/assets/{view-mode-toggle-DsUGHBIV.js → view-mode-toggle-B2-sm_tc.js} +1 -1
  327. package/dist/client/assets/{virtual-mcp-CPXCNlcx.js → virtual-mcp-C5gMOVS_.js} +1 -1
  328. package/dist/client/index.html +1 -1
  329. package/dist/server/cli.js +529 -529
  330. package/dist/server/server.js +367 -367
  331. package/package.json +1 -1
  332. package/dist/client/assets/agent-app-GfCF7MBj.js +0 -1
  333. package/dist/client/assets/agent-deck-DbiPFNhm.js +0 -1
  334. package/dist/client/assets/agent-file-BW6-wgKu.js +0 -1
  335. package/dist/client/assets/agent-library-file-ByVGh_GJ.js +0 -1
  336. package/dist/client/assets/agent-settings-alMz04MP.js +0 -1
  337. package/dist/client/assets/agent-site-editor-code-D_3n5lRh.js +0 -2
  338. package/dist/client/assets/agent-view-B0WlAVRK.js +0 -1
  339. package/dist/client/assets/api-keys-BSvKgDby.js +0 -1
  340. package/dist/client/assets/app-editor-D0xnTpyR.js +0 -1
  341. package/dist/client/assets/project-reports-DWBu_Poi.js +0 -1
  342. package/dist/client/assets/project-tasks-C9ZL-q35.js +0 -1
  343. package/dist/client/assets/record-editor-3Mx7odY3.js +0 -1
  344. package/dist/client/assets/reports-9-hk10-8.js +0 -1
  345. package/dist/client/assets/tasks-DLhzd-p7.js +0 -1
  346. package/dist/client/assets/useInfiniteQuery-C9Zty0xS.js +0 -1
  347. package/dist/client/assets/useSuspenseInfiniteQuery-CaUQs7Ct.js +0 -1
@@ -1 +1 @@
1
- import{c as fe,b as he,j as o,G as de,p as Fe,ai as Ee,H as we,af as ke,F as ve,B as ue,I as Se,eL as Pe,a0 as xe,a6 as Ge,K as be,m as Ne,a as _e,o as Ae,r as O,dj as Oe,z as Me,e as Re,q as Q,t as Ce,l as Ue,Z as ze,ae as $e,n as ge}from"./index-CFyHGgGO.js";import{b as Ve,c as He,g as Be}from"./use-virtual-mcp-DbjQS13M.js";import{i as qe}from"./DotsVertical-Bv4-YScE.js";import{a as Ke}from"./Tool01-DUJdCnDK.js";import{s as Qe}from"./Trash01-B-_Oqcf7.js";import{A as Ye,bl as Je}from"./agent-icon-CP0I3VVA.js";import{u as We,f as De}from"./use-date-fns-locale-CNRPcj9k.js";import{u as Ie}from"./use-navigate-to-agent-CUne0-cI.js";import{j as Ze}from"./use-organization-settings-ALMIpIdG.js";import{E as Xe}from"./empty-state-B7gXx_Yh.js";import{u as et}from"./use-create-virtual-mcp-D0AahD2t.js";import{b as tt,u as ot}from"./use-connection-By40b12N.js";import{u as ye}from"./use-mcp-client-Cgrjx403.js";import{a as st}from"./authenticate-and-persist-oauth-BogPKDev.js";import{e as it}from"./extract-connection-data-BZ3x_jRc.js";import{f as nt,g as rt}from"./thread-intent-XcHSP8zW.js";import{a as lt}from"./github-repo-scope-C8GSbvaz.js";import{f as at,a as ct,G as mt,p as dt}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as ut,b as pt,c as gt,d as ft,e as ht}from"./dialog-RGKICG4s.js";import{i as xt}from"./ArrowLeft-BS1ddrpm.js";import{C as jt}from"./collection-search-CKFQt3zo.js";import{G as bt}from"./github-icon-ZhItaKRN.js";import{A as Ct,a as Dt,b as yt,c as wt,g as vt,d as St,e as Nt,f as _t}from"./alert-dialog-BCnbMjLm.js";import{S as At}from"./search-input-SHiTlnCE.js";import{s as It}from"./Plus-DxM0fEC4.js";import{R as Tt}from"./repository-import-picker-C-ngL2qG.js";import{u as Lt}from"./use-debounced-value-DQiu0Px1.js";import"./AlertCircle-Cwl0Vup2.js";import"./ArrowUp-rfVFZ40K.js";import"./ArrowRight-CCNkzW9Y.js";import"./XCircle-BBqXvE8C.js";import"./ZoomOut-DnIqLBGF.js";import"./Globe04-BkqSUJiA.js";import"./CheckCircle-5QB6sfVV.js";import"./Check-Chl3DDqT.js";import"./ChevronUp-BuAMP7GQ.js";import"./UserSquare-CsgvAwaQ.js";import"./Copy01-BwsqBYnE.js";import"./CreditCard01-BPHmR5OY.js";import"./Download01-DyVswBhh.js";import"./Eye-BGOdKOA7.js";import"./Share07-fkd7xmY6.js";import"./XClose-Ca9S5aZc.js";import"./Image01-DXUl1blo.js";import"./Key01-CTlB38YG.js";import"./LayoutLeft-BIWXERKW.js";import"./Link01-7UJLIg0N.js";import"./LinkExternal01-DsBKvM3k.js";import"./Monitor01-D3pXjo5b.js";import"./Sun-CTx2w4hs.js";import"./Package-ImRUZcy3.js";import"./Palette-B0nQwQuz.js";import"./SearchLg-DCjPeF5h.js";import"./SearchMd-tkECPV7l.js";import"./Stars01-BoztdLAd.js";import"./Upload01-alz3omvs.js";import"./User01-DwcV_kyF.js";import"./Users01-DAeXmo2u.js";import"./X-BEAR-IcH.js";import"./Zap-thqSL15H.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-DEf7SAIB.js";import"./backoff-8mStPHYB.js";import"./task-board-BjqJ_zE6.js";import"./schema-GryfzY0i.js";import"./github-repo-BknN0SVI.js";import"./auth-fkwwQuGR.js";import"./mcp-oauth-wOINJv40.js";import"./metadata-D72DunRR.js";import"./connection-DdQElG6t.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-B8J8aCKh.js";import"./tooltip-DRlnzIQm.js";import"./index-Dv6121Hz.js";import"./input-BXe2-JP2.js";import"./label-BKtkcOfE.js";import"./useInfiniteQuery-C9Zty0xS.js";import"./infiniteQueryObserver-B4v_iRrA.js";import"./avatar-DvLLRJ7_.js";function Ft(e){const t=fe.c(26),{onCreateFromScratch:s,onImportGitHub:i,onImportDeco:r,isCreating:g,align:d,side:j,showBetaBadge:f,showDecoImport:y}=e,w=d===void 0?"end":d,u=he();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Fe,{size:14}),t[0]=x):x=t[0];let m;t[1]!==u?(m=u("common.createAgentDropdown.createFromScratch"),t[1]=u,t[2]=m):m=t[2];let h;t[3]!==g||t[4]!==s||t[5]!==m?(h=o.jsxs(de,{disabled:g,onClick:s,children:[x,m]}),t[3]=g,t[4]=s,t[5]=m,t[6]=h):h=t[6];let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ee,{className:"size-3.5"}),t[7]=b):b=t[7];let c;t[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),t[8]=u,t[9]=c):c=t[9];let l;t[10]!==f?(l=f&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),t[10]=f,t[11]=l):l=t[11];let p;t[12]!==i||t[13]!==c||t[14]!==l?(p=o.jsxs(de,{onClick:i,children:[b,c,l]}),t[12]=i,t[13]=c,t[14]=l,t[15]=p):p=t[15];let a;t[16]!==r||t[17]!==y||t[18]!==u?(a=y&&o.jsxs(de,{onClick:r,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),t[16]=r,t[17]=y,t[18]=u,t[19]=a):a=t[19];let C;return t[20]!==w||t[21]!==j||t[22]!==h||t[23]!==p||t[24]!==a?(C=o.jsxs(we,{side:j,align:w,className:"w-48",children:[h,p,a]}),t[20]=w,t[21]=j,t[22]=h,t[23]=p,t[24]=a,t[25]=C):C=t[25],C}function Et(e){const t=fe.c(50),{project:s,lastUsedAt:i,onDeleteClick:r}=e,g=Ie(),d=he(),j=We(),f=s.metadata?.ui?.layout;let y;t[0]!==f?(y=ke(f),t[0]=f,t[1]=y):y=t[1];const w=y;let u;t[2]!==w||t[3]!==g||t[4]!==s.id?(u=()=>g(s.id,{panel:w}),t[2]=w,t[3]=g,t[4]=s.id,t[5]=u):u=t[5];let x;t[6]!==s.title||t[7]!==u?(x=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),t[6]=s.title,t[7]=u,t[8]=x):x=t[8];let m;t[9]!==s.icon||t[10]!==s.title?(m=o.jsx(Ye,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),t[9]=s.icon,t[10]=s.title,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ve,{asChild:!0,children:o.jsx(ue,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(qe,{size:20})})}),t[12]=h):h=t[12];let b;t[13]!==g||t[14]!==s.id?(b=()=>g(s.id,{panel:"settings"}),t[13]=g,t[14]=s.id,t[15]=b):b=t[15];let c;t[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ke,{size:16}),t[16]=c):c=t[16];let l;t[17]!==b?(l=o.jsxs(de,{onClick:b,children:[c,"Settings"]}),t[17]=b,t[18]=l):l=t[18];let p;t[19]!==r?(p=r&&o.jsxs(de,{variant:"destructive",onClick:n=>{n.stopPropagation(),r(n)},children:[o.jsx(Qe,{size:16}),"Delete"]}),t[19]=r,t[20]=p):p=t[20];let a;t[21]!==p||t[22]!==l?(a=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(Se,{children:[h,o.jsxs(we,{align:"end",children:[l,p]})]})}),t[21]=p,t[22]=l,t[23]=a):a=t[23];let C;t[24]!==a||t[25]!==m?(C=o.jsxs("div",{className:"flex items-start justify-between",children:[m,a]}),t[24]=a,t[25]=m,t[26]=C):C=t[26];let D;t[27]!==s.title?(D=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),t[27]=s.title,t[28]=D):D=t[28];const M=s.description||"No description";let F;t[29]!==M?(F=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:M}),t[29]=M,t[30]=F):F=t[30];let E;t[31]!==D||t[32]!==F?(E=o.jsxs("div",{className:"flex flex-col gap-1",children:[D,F]}),t[31]=D,t[32]=F,t[33]=E):E=t[33];let S;t[34]!==C||t[35]!==E?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[C,E]}),t[34]=C,t[35]=E,t[36]=S):S=t[36];let N;t[37]!==i||t[38]!==j||t[39]!==s.updated_at||t[40]!==d?(N=i?d("home.projectCard.lastUsed",{time:De(new Date(i),{addSuffix:!0,locale:j})}):d("home.projectCard.updated",{time:De(new Date(s.updated_at),{addSuffix:!0,locale:j})}),t[37]=i,t[38]=j,t[39]=s.updated_at,t[40]=d,t[41]=N):N=t[41];let A;t[42]!==N?(A=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:N})})}),t[42]=N,t[43]=A):A=t[43];let P;t[44]!==S||t[45]!==A?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,A]}),t[44]=S,t[45]=A,t[46]=P):P=t[46];let k;return t[47]!==P||t[48]!==x?(k=o.jsxs(Pe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[x,P]}),t[47]=P,t[48]=x,t[49]=k):k=t[49],k}function kt(e,t){const s=fe.c(10),{org:i}=xe(),r=Ge();let g;s[0]!==e||s[1]!==i.id?(g=be.registryApp(i.id,e),s[0]=e,s[1]=i.id,s[2]=g):g=s[2];let d;s[3]!==e||s[4]!==r?(d=()=>r.call("COLLECTION_REGISTRY_APP_GET",{name:e}),s[3]=e,s[4]=r,s[5]=d):d=s[5];const j=t?.enabled??!0;let f;return s[6]!==g||s[7]!==d||s[8]!==j?(f={queryKey:g,queryFn:d,select:Pt,enabled:j,staleTime:3e5},s[6]=g,s[7]=d,s[8]=j,s[9]=f):f=s[9],Ne(f)}function Pt(e){return e.item}const Gt="deco/github-mcp";function Ot(e){const{org:t}=xe(),{data:s}=_e.useSession(),i=tt(),r=Ae(),[g,d]=O.useState("idle"),[j,f]=O.useState(null),[y,w]=O.useState(null),{data:u,isLoading:x}=kt(Gt,{enabled:e.enabled}),m=O.useRef(!1);e.enabled&&u&&!x&&!m.current&&s?.user?.id&&g==="idle"&&(m.current=!0,h());async function h(){if(!(!u||!s?.user?.id||!t))try{d("installing"),f(null);const c=it(u,t.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:p}=await i.create.mutateAsync(c);d("authenticating");const a=await st({connectionId:p,orgId:t.id,orgSlug:t.slug,persistFallback:C=>i.update.mutateAsync({id:p,data:{connection_token:C}}).then(()=>{})});if(a.ran&&!a.ok){try{await i.delete.mutateAsync(p)}catch{}throw new Error(a.error&&a.error!=="no token received"?a.error:"No token received from GitHub")}Oe(r,t.id),w(c),d("ready")}catch(c){f(c instanceof Error?c.message:String(c)),d("error")}}function b(){d("idle"),f(null),w(null),m.current=!1}return e.enabled&&x&&g==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:g,error:j,connection:y,retry:b}}const Mt="deco-sites";function Rt(e){if(!e||typeof e!="object")return null;const t=e.github;if(!t||typeof t!="object")return null;const s=t.owner,i=t.repo;return typeof s!="string"||typeof i!="string"||s.length===0||i.length===0?null:{owner:s,repo:i}}function Ut(e,t){const s=t?Rt(t):null,i=s?.owner??Mt,r=s?.repo??e;return{owner:i,name:r,url:`https://github.com/${i}/${r}`}}function zt(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Te(e,t,s){const i=await fetch(e,t),r=await i.json().catch(()=>({}));if(!i.ok)throw new Error(r.error??`${s} (${i.status})`);return r}function $t(e){return Te(`/api/${e}/deco-sites`,void 0,"Failed to load sites")}function Vt({open:e,onOpenChange:t,onBack:s}){const i=he(),{org:r}=xe(),g=Ie(),d=Ae(),{data:j}=_e.useSession(),[f,y]=O.useState(null),[w,u]=O.useState(null),[x,m]=O.useState(""),h=ye({connectionId:Me,orgId:r.id,orgSlug:r.slug}),b=ot({slug:"mcp-github"}),c=lt(b),l=Ot({enabled:e&&c.length===0}),p=c.length===1?c[0]??null:w,a=c.length>1&&!p,C=ye({connectionId:p?.id??"",orgId:r.id,orgSlug:r.slug}),D=e&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:M,isLoading:F,error:E}=Ne({queryKey:be.decoSites(j?.user?.email),queryFn:()=>$t(r.slug),enabled:e&&!!j?.user?.email,staleTime:6e4,retry:!1}),S=M?.sites??[],N=n=>{n||(y(null),u(null),m("")),t(n)},A=S.filter(n=>n.name.toLowerCase().includes(x.toLowerCase())||(n.domains?.[0]?.domain?.toLowerCase().includes(x.toLowerCase())??!1)),P=!f||A.some(n=>n.name===f),k=Re({mutationFn:async n=>{if(!p)throw new Error(i("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:n});const{installations:G}=await at(L=>h.callTool(L),p.id),I=S.find(L=>L.name===n);if(!I)throw new Error(i("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Ut(n,I.metadata),T=ct(G,v.owner);if(!T)throw new Error(i("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:mt}));let H=null,R=null;const ce=async()=>{R&&await h.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),H&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:H,force:!0}}).catch(()=>{})};try{const L=await Te(`/api/${r.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:n})},i("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:me}=await dt({orgSlug:r.slug,sourceConnection:p,installationId:T.installationId,owner:v.owner,repo:v.name,githubCallTool:K=>C.callTool(K),selfCallTool:K=>h.callTool(K)});H=me?null:U;const Y=L.icon??null,z=zt(n),B=n.toLowerCase(),$=nt(n),V=await h.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n,description:"Imported from deco.cx",pinned:!1,icon:Y??null,metadata:{instructions:null,siteSlug:B,previewServerUrl:$,productionUrl:$,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:T.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:Y,themeColor:"#22C55E",slug:z,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),q=V.structuredContent??V;if(!q.item?.id)throw new Error(i("common.importFromDecoDialog.failedToCreateAgent"));return R=q.item.id,{slug:z,virtualMcpId:q.item.id,item:q.item}}catch(L){throw await ce(),L}},onSuccess:({slug:n,virtualMcpId:G,item:I})=>{Q("deco_site_import_succeeded",{site_name:I.title,virtual_mcp_id:G,slug:n}),d.setQueryData(be.collectionItem(h,r.id,"","VIRTUAL_MCP",G),{item:I}),d.invalidateQueries({predicate:v=>{const T=v.queryKey;return T[1]===r.id&&T[3]==="collection"&&T[4]==="VIRTUAL_MCP"}}),Ce.success(i("common.importFromDecoDialog.importSuccess",{slug:n})),N(!1),g(G)},onError:n=>{Q("deco_site_import_failed",{error:n instanceof Error?n.message:"Unknown error"}),Ce.error(i("common.importFromDecoDialog.importFailed",{error:(n instanceof Error?n.message:i("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ut,{open:e,onOpenChange:N,children:o.jsxs(pt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(gt,{className:"sr-only",children:o.jsx(ft,{children:i("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":i("common.importFromDecoDialog.goBack"),children:o.jsx(xt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:i("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(jt,{value:x,onChange:m,placeholder:i("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:n=>{n.key==="Escape"&&m("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??i("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ue,{variant:"outline",size:"sm",onClick:l.retry,children:i("common.importFromDecoDialog.retryGithubSetup")})]}),D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.settingUpGithub")}),a&&!D&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:i("common.importFromDecoDialog.selectGithubConnection")})}),c.map(n=>o.jsxs("button",{type:"button",onClick:()=>u(n),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?o.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(bt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}),F&&!D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.loadingSites")}),!F&&!D&&!a&&l.status!=="error"&&!E&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.noSitesFound")}),!F&&!D&&!a&&l.status!=="error"&&S.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[A.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:i("common.importFromDecoDialog.noSitesMatch",{search:x})}),A.map(n=>{const G=rt(n.domains),I=f===n.name;return o.jsxs("button",{type:"button",onClick:()=>y(n.name),className:Ue("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",I?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:n.thumb_url?o.jsx("img",{src:n.thumb_url,alt:n.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.name}),G&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},n.name)})]})]}),o.jsxs(ht,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ue,{variant:"outline",onClick:()=>N(!1),disabled:k.isPending,children:i("common.importFromDecoDialog.cancel")}),o.jsx(ue,{disabled:!f||!P||k.isPending||F||D||a||!p||l.status==="error",onClick:()=>f&&k.mutate(f),children:k.isPending?i("common.importFromDecoDialog.importing"):i("common.importFromDecoDialog.import")})]})]})})}function xs(){const e=fe.c(83),t=ze(),s=he(),{org:i}=xe(),[r,g]=O.useState(""),d=Lt(r,300);let j;e[0]!==d?(j={searchTerm:d},e[0]=d,e[1]=j):j=e[1];const f=Ve(j),y=He();let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={navigateOnCreate:!0},e[2]=w):w=e[2];const{createVirtualMCP:u,isCreating:x}=et(w),[m,h]=O.useState(null),[b,c]=O.useState(!1),[l,p]=O.useState(!1),{granted:a}=$e("agents:manage"),C=Ze();let D;e[3]!==i?(D=_=>_.id!==i.id,e[3]=i,e[4]=D):D=e[4];const M=f.filter(D),{data:F}=Be(M.map(Ht));let E;e[5]!==y||e[6]!==m||e[7]!==s?(E=async()=>{if(!m)return;const{id:_,title:Le}=m;h(null);try{await y.delete.mutateAsync(_),Q("agent_deleted",{agent_id:_,source:"agents_list"}),Ce.success(s("routes.agentsList.deletedAgent",{title:Le}))}catch{}},e[5]=y,e[6]=m,e[7]=s,e[8]=E):E=e[8];const S=E;let N;e[9]!==a||e[10]!==u||e[11]!==x||e[12]!==C||e[13]!==s?(N=a&&o.jsxs(Se,{children:[o.jsx(ve,{asChild:!0,children:o.jsxs(ue,{size:"sm",children:[o.jsx(It,{size:14}),s("routes.agentsList.createAgent")]})}),o.jsx(Ft,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),u()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),p(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),c(!0)},isCreating:x,align:"end",showDecoImport:C})]}),e[9]=a,e[10]=u,e[11]=x,e[12]=C,e[13]=s,e[14]=N):N=e[14];const A=N,P=ge,k=ge,n=ge,G=t&&A;let I;e[15]!==s?(I=s("routes.agentsList.title"),e[15]=s,e[16]=I):I=e[16];let v;e[17]!==G||e[18]!==I?(v=o.jsx(ge.Title,{actions:G,children:I}),e[17]=G,e[18]=I,e[19]=v):v=e[19];let T;e[20]!==s?(T=s("routes.agentsList.searchPlaceholder"),e[20]=s,e[21]=T):T=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=_=>{_.key==="Escape"&&(g(""),_.target.blur())},e[22]=H):H=e[22];let R;e[23]!==r||e[24]!==T?(R=o.jsx(At,{value:r,onChange:g,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:H}),e[23]=r,e[24]=T,e[25]=R):R=e[25];const ce=!t&&A;let L;e[26]!==R||e[27]!==ce?(L=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[R,ce]}),e[26]=R,e[27]=ce,e[28]=L):L=e[28];let U;e[29]!==L||e[30]!==v?(U=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,L]}),e[29]=L,e[30]=v,e[31]=U):U=e[31];const me=M.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Xe,{actions:!t&&!r&&A,image:o.jsx(Je,{size:48,className:"text-muted-foreground"}),title:s(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?s("routes.agentsList.noAgentsMatchSearch",{search:r}):s(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),Y=M.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:s("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:M.map(_=>o.jsx(Et,{project:_,lastUsedAt:F?.get(_.id)?.last_used_at,onDeleteClick:a?()=>h({id:_.id,title:_.title}):void 0},_.id))})]});let z;e[32]!==U||e[33]!==me||e[34]!==Y||e[35]!==n.Container?(z=o.jsxs(n.Container,{children:[U,me,Y]}),e[32]=U,e[33]=me,e[34]=Y,e[35]=n.Container,e[36]=z):z=e[36];let B;e[37]!==z||e[38]!==k.Content?(B=o.jsx(k.Content,{children:z}),e[37]=z,e[38]=k.Content,e[39]=B):B=e[39];let $;e[40]!==l?($=o.jsx(Tt,{open:l,onOpenChange:p}),e[40]=l,e[41]=$):$=e[41];let V;e[42]!==b?(V=o.jsx(Vt,{open:b,onOpenChange:c}),e[42]=b,e[43]=V):V=e[43];const q=!!m;let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=_=>!_&&h(null),e[44]=K):K=e[44];let J;e[45]!==s?(J=s("routes.agentsList.deleteAgentTitle"),e[45]=s,e[46]=J):J=e[46];let W;e[47]!==J?(W=o.jsx(Ct,{children:J}),e[47]=J,e[48]=W):W=e[48];let Z;e[49]!==s?(Z=s("routes.agentsList.deleteAgentDescription"),e[49]=s,e[50]=Z):Z=e[50];const je=m?.title;let X;e[51]!==je?(X=o.jsx("span",{className:"font-medium text-foreground",children:je}),e[51]=je,e[52]=X):X=e[52];let ee;e[53]!==Z||e[54]!==X?(ee=o.jsxs(Dt,{children:[Z," ",X,"."]}),e[53]=Z,e[54]=X,e[55]=ee):ee=e[55];let te;e[56]!==W||e[57]!==ee?(te=o.jsxs(yt,{children:[W,ee]}),e[56]=W,e[57]=ee,e[58]=te):te=e[58];let oe;e[59]!==s?(oe=s("routes.agentsList.cancelButton"),e[59]=s,e[60]=oe):oe=e[60];let se;e[61]!==oe?(se=o.jsx(wt,{children:oe}),e[61]=oe,e[62]=se):se=e[62];let ie;e[63]!==s?(ie=s("routes.agentsList.deleteButton"),e[63]=s,e[64]=ie):ie=e[64];let ne;e[65]!==S||e[66]!==ie?(ne=o.jsx(vt,{onClick:S,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ie}),e[65]=S,e[66]=ie,e[67]=ne):ne=e[67];let re;e[68]!==se||e[69]!==ne?(re=o.jsxs(St,{children:[se,ne]}),e[68]=se,e[69]=ne,e[70]=re):re=e[70];let le;e[71]!==te||e[72]!==re?(le=o.jsxs(Nt,{children:[te,re]}),e[71]=te,e[72]=re,e[73]=le):le=e[73];let ae;e[74]!==q||e[75]!==le?(ae=o.jsx(_t,{open:q,onOpenChange:K,children:le}),e[74]=q,e[75]=le,e[76]=ae):ae=e[76];let pe;return e[77]!==P||e[78]!==B||e[79]!==$||e[80]!==V||e[81]!==ae?(pe=o.jsxs(P,{children:[B,$,V,ae]}),e[77]=P,e[78]=B,e[79]=$,e[80]=V,e[81]=ae,e[82]=pe):pe=e[82],pe}function Ht(e){return e.id}export{xs as default};
1
+ import{c as fe,b as he,j as o,G as de,p as Fe,ai as Ee,H as we,af as ke,F as ve,B as ue,I as Se,eL as Pe,a0 as xe,a6 as Ge,K as be,m as Ne,a as _e,o as Ae,r as O,dj as Oe,z as Me,e as Re,q as Q,t as Ce,l as Ue,Z as ze,ae as $e,n as ge}from"./index-Cm-Yn4q_.js";import{b as Ve,c as He,g as Be}from"./use-virtual-mcp-joDFMrl3.js";import{i as qe}from"./DotsVertical-C9TkkMfe.js";import{a as Ke}from"./Tool01-CwUt8jvw.js";import{s as Qe}from"./Trash01-bzV9Pa75.js";import{A as Ye,bl as Je}from"./agent-icon-4F7jSNEB.js";import{u as We,f as De}from"./use-date-fns-locale-CRSpZTHr.js";import{u as Ie}from"./use-navigate-to-agent-UrDQ1j_Y.js";import{j as Ze}from"./use-organization-settings-aVVw0VfM.js";import{E as Xe}from"./empty-state-BptHyu85.js";import{u as et}from"./use-create-virtual-mcp-DYSVpRcW.js";import{b as tt,u as ot}from"./use-connection-BNw2MaMd.js";import{u as ye}from"./use-mcp-client-DAbHG4oK.js";import{a as st}from"./authenticate-and-persist-oauth-DwKiV4n5.js";import{e as it}from"./extract-connection-data-DNxvULAk.js";import{f as nt,g as rt}from"./thread-intent-EyHIlLf5.js";import{a as lt}from"./github-repo-scope-C8GSbvaz.js";import{f as at,a as ct,G as mt,p as dt}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as ut,b as pt,c as gt,d as ft,e as ht}from"./dialog-MzmGuLy9.js";import{i as xt}from"./ArrowLeft-EJr-YqTg.js";import{C as jt}from"./collection-search-Dz6UsoEM.js";import{G as bt}from"./github-icon-l7M1zEUL.js";import{A as Ct,a as Dt,b as yt,c as wt,g as vt,d as St,e as Nt,f as _t}from"./alert-dialog-DAmr19x7.js";import{S as At}from"./search-input-oOSx8rAu.js";import{s as It}from"./Plus-C6g4VoC2.js";import{R as Tt}from"./repository-import-picker-fxShIRss.js";import{u as Lt}from"./use-debounced-value-CBSXKHwV.js";import"./AlertCircle-Da3tM0gY.js";import"./ArrowUp-Cr0h1eUU.js";import"./ArrowRight-CdK41xWy.js";import"./XCircle-ClHynDO9.js";import"./ZoomOut-BJTVjnBu.js";import"./Globe04-ClJkKQrs.js";import"./CheckCircle-5We5Va5L.js";import"./Check-BgFwywFf.js";import"./ChevronUp-dgPQkcdv.js";import"./UserSquare-C_2Z4y9_.js";import"./Copy01-CMHlAzgS.js";import"./CreditCard01-DCgVn3oV.js";import"./Download01-ChBwr6yr.js";import"./Eye-D5VumA7M.js";import"./Share07-CbepO2bZ.js";import"./XClose-XZQSLHM2.js";import"./Image01-BOrVV_OY.js";import"./Key01-CyjVKKuN.js";import"./LayoutLeft-C-Lx98x9.js";import"./Link01-C5bvI0ok.js";import"./LinkExternal01-7ZLNL_9s.js";import"./Monitor01-CTvO6He0.js";import"./Sun--XqnAA9t.js";import"./Package-zC5cSGJD.js";import"./Palette-Hb6mROVB.js";import"./SearchLg-CF0JjYPh.js";import"./SearchMd-BboWc_8K.js";import"./Stars01-BSCYhMLo.js";import"./Upload01-DKLqc8wc.js";import"./User01-5UPFm-U6.js";import"./Users01-CBoZFJLg.js";import"./X-i7IpcK8C.js";import"./Zap-13Bw0A-o.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-D2YeBh8J.js";import"./backoff-8mStPHYB.js";import"./task-board-D_YhOLZh.js";import"./schema-CfWSVtg9.js";import"./github-repo-BknN0SVI.js";import"./auth-BJh0XKDc.js";import"./mcp-oauth-DpctXbyl.js";import"./metadata-D72DunRR.js";import"./connection-Bu_kYZuh.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-df_kLebP.js";import"./tooltip-Bja45eMa.js";import"./index-G_4wgESR.js";import"./input-BqjhD7MF.js";import"./label-Cq0XOqve.js";import"./useInfiniteQuery-ApIt4V4o.js";import"./infiniteQueryObserver-kZQR6QZi.js";import"./avatar-SVBTSz6-.js";function Ft(e){const t=fe.c(26),{onCreateFromScratch:s,onImportGitHub:i,onImportDeco:r,isCreating:g,align:d,side:j,showBetaBadge:f,showDecoImport:y}=e,w=d===void 0?"end":d,u=he();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Fe,{size:14}),t[0]=x):x=t[0];let m;t[1]!==u?(m=u("common.createAgentDropdown.createFromScratch"),t[1]=u,t[2]=m):m=t[2];let h;t[3]!==g||t[4]!==s||t[5]!==m?(h=o.jsxs(de,{disabled:g,onClick:s,children:[x,m]}),t[3]=g,t[4]=s,t[5]=m,t[6]=h):h=t[6];let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ee,{className:"size-3.5"}),t[7]=b):b=t[7];let c;t[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),t[8]=u,t[9]=c):c=t[9];let l;t[10]!==f?(l=f&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),t[10]=f,t[11]=l):l=t[11];let p;t[12]!==i||t[13]!==c||t[14]!==l?(p=o.jsxs(de,{onClick:i,children:[b,c,l]}),t[12]=i,t[13]=c,t[14]=l,t[15]=p):p=t[15];let a;t[16]!==r||t[17]!==y||t[18]!==u?(a=y&&o.jsxs(de,{onClick:r,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),t[16]=r,t[17]=y,t[18]=u,t[19]=a):a=t[19];let C;return t[20]!==w||t[21]!==j||t[22]!==h||t[23]!==p||t[24]!==a?(C=o.jsxs(we,{side:j,align:w,className:"w-48",children:[h,p,a]}),t[20]=w,t[21]=j,t[22]=h,t[23]=p,t[24]=a,t[25]=C):C=t[25],C}function Et(e){const t=fe.c(50),{project:s,lastUsedAt:i,onDeleteClick:r}=e,g=Ie(),d=he(),j=We(),f=s.metadata?.ui?.layout;let y;t[0]!==f?(y=ke(f),t[0]=f,t[1]=y):y=t[1];const w=y;let u;t[2]!==w||t[3]!==g||t[4]!==s.id?(u=()=>g(s.id,{panel:w}),t[2]=w,t[3]=g,t[4]=s.id,t[5]=u):u=t[5];let x;t[6]!==s.title||t[7]!==u?(x=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),t[6]=s.title,t[7]=u,t[8]=x):x=t[8];let m;t[9]!==s.icon||t[10]!==s.title?(m=o.jsx(Ye,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),t[9]=s.icon,t[10]=s.title,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ve,{asChild:!0,children:o.jsx(ue,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(qe,{size:20})})}),t[12]=h):h=t[12];let b;t[13]!==g||t[14]!==s.id?(b=()=>g(s.id,{panel:"settings"}),t[13]=g,t[14]=s.id,t[15]=b):b=t[15];let c;t[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ke,{size:16}),t[16]=c):c=t[16];let l;t[17]!==b?(l=o.jsxs(de,{onClick:b,children:[c,"Settings"]}),t[17]=b,t[18]=l):l=t[18];let p;t[19]!==r?(p=r&&o.jsxs(de,{variant:"destructive",onClick:n=>{n.stopPropagation(),r(n)},children:[o.jsx(Qe,{size:16}),"Delete"]}),t[19]=r,t[20]=p):p=t[20];let a;t[21]!==p||t[22]!==l?(a=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(Se,{children:[h,o.jsxs(we,{align:"end",children:[l,p]})]})}),t[21]=p,t[22]=l,t[23]=a):a=t[23];let C;t[24]!==a||t[25]!==m?(C=o.jsxs("div",{className:"flex items-start justify-between",children:[m,a]}),t[24]=a,t[25]=m,t[26]=C):C=t[26];let D;t[27]!==s.title?(D=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),t[27]=s.title,t[28]=D):D=t[28];const M=s.description||"No description";let F;t[29]!==M?(F=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:M}),t[29]=M,t[30]=F):F=t[30];let E;t[31]!==D||t[32]!==F?(E=o.jsxs("div",{className:"flex flex-col gap-1",children:[D,F]}),t[31]=D,t[32]=F,t[33]=E):E=t[33];let S;t[34]!==C||t[35]!==E?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[C,E]}),t[34]=C,t[35]=E,t[36]=S):S=t[36];let N;t[37]!==i||t[38]!==j||t[39]!==s.updated_at||t[40]!==d?(N=i?d("home.projectCard.lastUsed",{time:De(new Date(i),{addSuffix:!0,locale:j})}):d("home.projectCard.updated",{time:De(new Date(s.updated_at),{addSuffix:!0,locale:j})}),t[37]=i,t[38]=j,t[39]=s.updated_at,t[40]=d,t[41]=N):N=t[41];let A;t[42]!==N?(A=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:N})})}),t[42]=N,t[43]=A):A=t[43];let P;t[44]!==S||t[45]!==A?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,A]}),t[44]=S,t[45]=A,t[46]=P):P=t[46];let k;return t[47]!==P||t[48]!==x?(k=o.jsxs(Pe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[x,P]}),t[47]=P,t[48]=x,t[49]=k):k=t[49],k}function kt(e,t){const s=fe.c(10),{org:i}=xe(),r=Ge();let g;s[0]!==e||s[1]!==i.id?(g=be.registryApp(i.id,e),s[0]=e,s[1]=i.id,s[2]=g):g=s[2];let d;s[3]!==e||s[4]!==r?(d=()=>r.call("COLLECTION_REGISTRY_APP_GET",{name:e}),s[3]=e,s[4]=r,s[5]=d):d=s[5];const j=t?.enabled??!0;let f;return s[6]!==g||s[7]!==d||s[8]!==j?(f={queryKey:g,queryFn:d,select:Pt,enabled:j,staleTime:3e5},s[6]=g,s[7]=d,s[8]=j,s[9]=f):f=s[9],Ne(f)}function Pt(e){return e.item}const Gt="deco/github-mcp";function Ot(e){const{org:t}=xe(),{data:s}=_e.useSession(),i=tt(),r=Ae(),[g,d]=O.useState("idle"),[j,f]=O.useState(null),[y,w]=O.useState(null),{data:u,isLoading:x}=kt(Gt,{enabled:e.enabled}),m=O.useRef(!1);e.enabled&&u&&!x&&!m.current&&s?.user?.id&&g==="idle"&&(m.current=!0,h());async function h(){if(!(!u||!s?.user?.id||!t))try{d("installing"),f(null);const c=it(u,t.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:p}=await i.create.mutateAsync(c);d("authenticating");const a=await st({connectionId:p,orgId:t.id,orgSlug:t.slug,persistFallback:C=>i.update.mutateAsync({id:p,data:{connection_token:C}}).then(()=>{})});if(a.ran&&!a.ok){try{await i.delete.mutateAsync(p)}catch{}throw new Error(a.error&&a.error!=="no token received"?a.error:"No token received from GitHub")}Oe(r,t.id),w(c),d("ready")}catch(c){f(c instanceof Error?c.message:String(c)),d("error")}}function b(){d("idle"),f(null),w(null),m.current=!1}return e.enabled&&x&&g==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:g,error:j,connection:y,retry:b}}const Mt="deco-sites";function Rt(e){if(!e||typeof e!="object")return null;const t=e.github;if(!t||typeof t!="object")return null;const s=t.owner,i=t.repo;return typeof s!="string"||typeof i!="string"||s.length===0||i.length===0?null:{owner:s,repo:i}}function Ut(e,t){const s=t?Rt(t):null,i=s?.owner??Mt,r=s?.repo??e;return{owner:i,name:r,url:`https://github.com/${i}/${r}`}}function zt(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Te(e,t,s){const i=await fetch(e,t),r=await i.json().catch(()=>({}));if(!i.ok)throw new Error(r.error??`${s} (${i.status})`);return r}function $t(e){return Te(`/api/${e}/deco-sites`,void 0,"Failed to load sites")}function Vt({open:e,onOpenChange:t,onBack:s}){const i=he(),{org:r}=xe(),g=Ie(),d=Ae(),{data:j}=_e.useSession(),[f,y]=O.useState(null),[w,u]=O.useState(null),[x,m]=O.useState(""),h=ye({connectionId:Me,orgId:r.id,orgSlug:r.slug}),b=ot({slug:"mcp-github"}),c=lt(b),l=Ot({enabled:e&&c.length===0}),p=c.length===1?c[0]??null:w,a=c.length>1&&!p,C=ye({connectionId:p?.id??"",orgId:r.id,orgSlug:r.slug}),D=e&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:M,isLoading:F,error:E}=Ne({queryKey:be.decoSites(j?.user?.email),queryFn:()=>$t(r.slug),enabled:e&&!!j?.user?.email,staleTime:6e4,retry:!1}),S=M?.sites??[],N=n=>{n||(y(null),u(null),m("")),t(n)},A=S.filter(n=>n.name.toLowerCase().includes(x.toLowerCase())||(n.domains?.[0]?.domain?.toLowerCase().includes(x.toLowerCase())??!1)),P=!f||A.some(n=>n.name===f),k=Re({mutationFn:async n=>{if(!p)throw new Error(i("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:n});const{installations:G}=await at(L=>h.callTool(L),p.id),I=S.find(L=>L.name===n);if(!I)throw new Error(i("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Ut(n,I.metadata),T=ct(G,v.owner);if(!T)throw new Error(i("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:mt}));let H=null,R=null;const ce=async()=>{R&&await h.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),H&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:H,force:!0}}).catch(()=>{})};try{const L=await Te(`/api/${r.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:n})},i("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:me}=await dt({orgSlug:r.slug,sourceConnection:p,installationId:T.installationId,owner:v.owner,repo:v.name,githubCallTool:K=>C.callTool(K),selfCallTool:K=>h.callTool(K)});H=me?null:U;const Y=L.icon??null,z=zt(n),B=n.toLowerCase(),$=nt(n),V=await h.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n,description:"Imported from deco.cx",pinned:!1,icon:Y??null,metadata:{instructions:null,siteSlug:B,previewServerUrl:$,productionUrl:$,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:T.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:Y,themeColor:"#22C55E",slug:z,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),q=V.structuredContent??V;if(!q.item?.id)throw new Error(i("common.importFromDecoDialog.failedToCreateAgent"));return R=q.item.id,{slug:z,virtualMcpId:q.item.id,item:q.item}}catch(L){throw await ce(),L}},onSuccess:({slug:n,virtualMcpId:G,item:I})=>{Q("deco_site_import_succeeded",{site_name:I.title,virtual_mcp_id:G,slug:n}),d.setQueryData(be.collectionItem(h,r.id,"","VIRTUAL_MCP",G),{item:I}),d.invalidateQueries({predicate:v=>{const T=v.queryKey;return T[1]===r.id&&T[3]==="collection"&&T[4]==="VIRTUAL_MCP"}}),Ce.success(i("common.importFromDecoDialog.importSuccess",{slug:n})),N(!1),g(G)},onError:n=>{Q("deco_site_import_failed",{error:n instanceof Error?n.message:"Unknown error"}),Ce.error(i("common.importFromDecoDialog.importFailed",{error:(n instanceof Error?n.message:i("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ut,{open:e,onOpenChange:N,children:o.jsxs(pt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(gt,{className:"sr-only",children:o.jsx(ft,{children:i("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":i("common.importFromDecoDialog.goBack"),children:o.jsx(xt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:i("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(jt,{value:x,onChange:m,placeholder:i("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:n=>{n.key==="Escape"&&m("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??i("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ue,{variant:"outline",size:"sm",onClick:l.retry,children:i("common.importFromDecoDialog.retryGithubSetup")})]}),D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.settingUpGithub")}),a&&!D&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:i("common.importFromDecoDialog.selectGithubConnection")})}),c.map(n=>o.jsxs("button",{type:"button",onClick:()=>u(n),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?o.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(bt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}),F&&!D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.loadingSites")}),!F&&!D&&!a&&l.status!=="error"&&!E&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.noSitesFound")}),!F&&!D&&!a&&l.status!=="error"&&S.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[A.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:i("common.importFromDecoDialog.noSitesMatch",{search:x})}),A.map(n=>{const G=rt(n.domains),I=f===n.name;return o.jsxs("button",{type:"button",onClick:()=>y(n.name),className:Ue("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",I?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:n.thumb_url?o.jsx("img",{src:n.thumb_url,alt:n.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.name}),G&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},n.name)})]})]}),o.jsxs(ht,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ue,{variant:"outline",onClick:()=>N(!1),disabled:k.isPending,children:i("common.importFromDecoDialog.cancel")}),o.jsx(ue,{disabled:!f||!P||k.isPending||F||D||a||!p||l.status==="error",onClick:()=>f&&k.mutate(f),children:k.isPending?i("common.importFromDecoDialog.importing"):i("common.importFromDecoDialog.import")})]})]})})}function xs(){const e=fe.c(83),t=ze(),s=he(),{org:i}=xe(),[r,g]=O.useState(""),d=Lt(r,300);let j;e[0]!==d?(j={searchTerm:d},e[0]=d,e[1]=j):j=e[1];const f=Ve(j),y=He();let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={navigateOnCreate:!0},e[2]=w):w=e[2];const{createVirtualMCP:u,isCreating:x}=et(w),[m,h]=O.useState(null),[b,c]=O.useState(!1),[l,p]=O.useState(!1),{granted:a}=$e("agents:manage"),C=Ze();let D;e[3]!==i?(D=_=>_.id!==i.id,e[3]=i,e[4]=D):D=e[4];const M=f.filter(D),{data:F}=Be(M.map(Ht));let E;e[5]!==y||e[6]!==m||e[7]!==s?(E=async()=>{if(!m)return;const{id:_,title:Le}=m;h(null);try{await y.delete.mutateAsync(_),Q("agent_deleted",{agent_id:_,source:"agents_list"}),Ce.success(s("routes.agentsList.deletedAgent",{title:Le}))}catch{}},e[5]=y,e[6]=m,e[7]=s,e[8]=E):E=e[8];const S=E;let N;e[9]!==a||e[10]!==u||e[11]!==x||e[12]!==C||e[13]!==s?(N=a&&o.jsxs(Se,{children:[o.jsx(ve,{asChild:!0,children:o.jsxs(ue,{size:"sm",children:[o.jsx(It,{size:14}),s("routes.agentsList.createAgent")]})}),o.jsx(Ft,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),u()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),p(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),c(!0)},isCreating:x,align:"end",showDecoImport:C})]}),e[9]=a,e[10]=u,e[11]=x,e[12]=C,e[13]=s,e[14]=N):N=e[14];const A=N,P=ge,k=ge,n=ge,G=t&&A;let I;e[15]!==s?(I=s("routes.agentsList.title"),e[15]=s,e[16]=I):I=e[16];let v;e[17]!==G||e[18]!==I?(v=o.jsx(ge.Title,{actions:G,children:I}),e[17]=G,e[18]=I,e[19]=v):v=e[19];let T;e[20]!==s?(T=s("routes.agentsList.searchPlaceholder"),e[20]=s,e[21]=T):T=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=_=>{_.key==="Escape"&&(g(""),_.target.blur())},e[22]=H):H=e[22];let R;e[23]!==r||e[24]!==T?(R=o.jsx(At,{value:r,onChange:g,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:H}),e[23]=r,e[24]=T,e[25]=R):R=e[25];const ce=!t&&A;let L;e[26]!==R||e[27]!==ce?(L=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[R,ce]}),e[26]=R,e[27]=ce,e[28]=L):L=e[28];let U;e[29]!==L||e[30]!==v?(U=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,L]}),e[29]=L,e[30]=v,e[31]=U):U=e[31];const me=M.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Xe,{actions:!t&&!r&&A,image:o.jsx(Je,{size:48,className:"text-muted-foreground"}),title:s(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?s("routes.agentsList.noAgentsMatchSearch",{search:r}):s(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),Y=M.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:s("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:M.map(_=>o.jsx(Et,{project:_,lastUsedAt:F?.get(_.id)?.last_used_at,onDeleteClick:a?()=>h({id:_.id,title:_.title}):void 0},_.id))})]});let z;e[32]!==U||e[33]!==me||e[34]!==Y||e[35]!==n.Container?(z=o.jsxs(n.Container,{children:[U,me,Y]}),e[32]=U,e[33]=me,e[34]=Y,e[35]=n.Container,e[36]=z):z=e[36];let B;e[37]!==z||e[38]!==k.Content?(B=o.jsx(k.Content,{children:z}),e[37]=z,e[38]=k.Content,e[39]=B):B=e[39];let $;e[40]!==l?($=o.jsx(Tt,{open:l,onOpenChange:p}),e[40]=l,e[41]=$):$=e[41];let V;e[42]!==b?(V=o.jsx(Vt,{open:b,onOpenChange:c}),e[42]=b,e[43]=V):V=e[43];const q=!!m;let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=_=>!_&&h(null),e[44]=K):K=e[44];let J;e[45]!==s?(J=s("routes.agentsList.deleteAgentTitle"),e[45]=s,e[46]=J):J=e[46];let W;e[47]!==J?(W=o.jsx(Ct,{children:J}),e[47]=J,e[48]=W):W=e[48];let Z;e[49]!==s?(Z=s("routes.agentsList.deleteAgentDescription"),e[49]=s,e[50]=Z):Z=e[50];const je=m?.title;let X;e[51]!==je?(X=o.jsx("span",{className:"font-medium text-foreground",children:je}),e[51]=je,e[52]=X):X=e[52];let ee;e[53]!==Z||e[54]!==X?(ee=o.jsxs(Dt,{children:[Z," ",X,"."]}),e[53]=Z,e[54]=X,e[55]=ee):ee=e[55];let te;e[56]!==W||e[57]!==ee?(te=o.jsxs(yt,{children:[W,ee]}),e[56]=W,e[57]=ee,e[58]=te):te=e[58];let oe;e[59]!==s?(oe=s("routes.agentsList.cancelButton"),e[59]=s,e[60]=oe):oe=e[60];let se;e[61]!==oe?(se=o.jsx(wt,{children:oe}),e[61]=oe,e[62]=se):se=e[62];let ie;e[63]!==s?(ie=s("routes.agentsList.deleteButton"),e[63]=s,e[64]=ie):ie=e[64];let ne;e[65]!==S||e[66]!==ie?(ne=o.jsx(vt,{onClick:S,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ie}),e[65]=S,e[66]=ie,e[67]=ne):ne=e[67];let re;e[68]!==se||e[69]!==ne?(re=o.jsxs(St,{children:[se,ne]}),e[68]=se,e[69]=ne,e[70]=re):re=e[70];let le;e[71]!==te||e[72]!==re?(le=o.jsxs(Nt,{children:[te,re]}),e[71]=te,e[72]=re,e[73]=le):le=e[73];let ae;e[74]!==q||e[75]!==le?(ae=o.jsx(_t,{open:q,onOpenChange:K,children:le}),e[74]=q,e[75]=le,e[76]=ae):ae=e[76];let pe;return e[77]!==P||e[78]!==B||e[79]!==$||e[80]!==V||e[81]!==ae?(pe=o.jsxs(P,{children:[B,$,V,ae]}),e[77]=P,e[78]=B,e[79]=$,e[80]=V,e[81]=ae,e[82]=pe):pe=e[82],pe}function Ht(e){return e.id}export{xs as default};
@@ -1,4 +1,4 @@
1
- import{c as V,b as Q,ap as Oe,aq as Fe,r as G,j as s,aU as st,dZ as Le,t as Z,dY as de,dX as ae,aG as qe,a0 as se,a6 as te,o as oe,e as ie,x as he,B as W,K as X,m as pe,aP as ue,l as re,da as Be,fs as it,eL as ve,ae as lt,am as rt,L as nt,q as Ke,h as at,an as ot,ao as xe,fr as ct}from"./index-CFyHGgGO.js";import{i as dt}from"./AlertCircle-Cwl0Vup2.js";import{u as He,a as me,i as ut,b as mt,p as ft,f as be,g as pt,d as ze}from"./use-ai-providers-C4dXO9Yz.js";import{i as gt}from"./CheckCircle-5QB6sfVV.js";import{c as xt,i as ht}from"./use-organization-settings-ALMIpIdG.js";import{S as vt}from"./schema-GryfzY0i.js";import{M as bt}from"./select-model-DHG0nuQY.js";import{u as yt}from"./use-debounced-autosave-BzX7iQl5.js";import{I as ce}from"./input-BXe2-JP2.js";import{T as Ae,a as jt}from"./toggle-group-D9KWjWLm.js";import{A as ye,a as je,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-BCnbMjLm.js";import{u as ge,d as we,a as Ve,e as Nt}from"./use-entitlements-Bvz6_GHn.js";import{u as Ge}from"./use-open-billing-url-nDZTfkQK.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-D66BgqbO.js";import{i as It}from"./Check-Chl3DDqT.js";import{c as wt,e as kt,b as Dt}from"./Tool01-DUJdCnDK.js";import{s as Kt}from"./Plus-DxM0fEC4.js";import{s as At}from"./Trash01-B-_Oqcf7.js";import{A as Et}from"./avatar-DvLLRJ7_.js";import{u as Tt,f as Rt}from"./use-date-fns-locale-CNRPcj9k.js";import{c as We,P as Ut,C as Ee}from"./decopilot-CYIi3WEs.js";import{P as Mt}from"./ai-providers-logos-DD3qZ33J.js";import{s as $t}from"./Eye-BGOdKOA7.js";import{d as Ot,c as Ft,b as Lt,D as qt,e as Bt}from"./dialog-RGKICG4s.js";import{R as Ht}from"./require-capability-B_Hqq5xX.js";import"./task-board-BjqJ_zE6.js";import"./drawer-B4Z-ExBx.js";import"./use-mobile-B90d5ZlF.js";import"./chat-context-bQBeY2t1.js";import"./use-panel-navigate-BHrQSu9h.js";import"./thread-route-C-J8Dvgz.js";import"./use-project-scope-FsdoI9gD.js";import"./use-virtual-mcp-DbjQS13M.js";import"./use-mcp-client-Cgrjx403.js";import"./auth-fkwwQuGR.js";import"./github-repo-BknN0SVI.js";import"./autosend-Du7-oKR0.js";import"./thread-intent-XcHSP8zW.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DEf7SAIB.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DwM9-jMb.js";import"./index-BkqcEh_k.js";import"./User01-DwcV_kyF.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-C70qRnxL.js";import"./select-rL7p93dx.js";import"./index-Dv6121Hz.js";import"./ChevronUp-BuAMP7GQ.js";import"./ArrowLeft-BS1ddrpm.js";import"./Key01-CTlB38YG.js";import"./SearchMd-tkECPV7l.js";import"./Monitor01-D3pXjo5b.js";import"./download-app-dialog-DPWfpRBg.js";import"./Copy01-BwsqBYnE.js";import"./Download01-DyVswBhh.js";import"./Image01-DXUl1blo.js";import"./Stars01-BoztdLAd.js";import"./X-BEAR-IcH.js";import"./access-gate-5gX8wxGV.js";import"./capability-load-error-O16y38Ak.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>ut(e),Gt=e=>mt(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(27),{slot:i,onSlotChange:r,filterModels:a,defaultKeyId:n}=e,c=He(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??n),[f,o]=G.useState(l);f!==l&&(o(l),l&&g(l));let x;t[0]!==c||t[1]!==n||t[2]!==d?(x=c.some(I=>I.id===d)?d:n,t[0]=c,t[1]=n,t[2]=d,t[3]=x):x=t[3];const u=x;let v;t[4]!==u||t[5]!==c?(v=u?c.find(I=>I.id===u):null,t[4]=u,t[5]=c,t[6]=v):v=t[6];const C=v,{models:j,isLoading:h}=me(a?u??void 0:void 0),y=a?h||j.some(a):!0;let N;t[7]!==i||t[8]!==C?.providerId||t[9]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=C?.providerId,t[9]=l,t[10]=N):N=t[10];const w=N,m=Q();if(a&&!y){let I;t[11]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=m,t[12]=I):I=t[12];let k;return t[13]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[13]=I,t[14]=k):k=t[14],k}let b;t[15]!==m?(b=m("settings.simpleModeSection.pickModel"),t[15]=m,t[16]=b):b=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[17]=S):S=t[17];let p;t[18]!==u||t[19]!==r?(p=I=>{const k=I.keyId??u??"";g(k),r({keyId:k,modelId:I.modelId,title:I.title})},t[18]=u,t[19]=r,t[20]=p):p=t[20];let P;return t[21]!==u||t[22]!==a||t[23]!==w||t[24]!==b||t[25]!==p?(P=s.jsx(bt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:a,onCredentialChange:S,onModelChange:p}),t[21]=u,t[22]=a,t[23]=w,t[24]=b,t[25]=p,t[26]=P):P=t[26],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:r}=e,a=Q();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(qe,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gt,{size:12}),t[5]=n):n=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=He(),r=xt(),a=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Oe(vt),e[0]=n):n=e[0];let c;e[1]!==r?(c={resolver:n,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=ht(),o=l.formState.isDirty;let x;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(r),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=yt(x),v=i[0],C=i[1],j=i[2],{models:h}=me(v?.id),{models:y}=me(C?.id),{models:N}=me(j?.id);let w,m;e[8]!==l||e[9]!==a?(w=()=>{a||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[a,l],e[8]=l,e[9]=a,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==j||e[17]!==h||e[18]!==y||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),B={};v?.id&&(B[v.id]=h),C?.id&&(B[C.id]=y),j?.id&&(B[j.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=ft(i,B);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=j,e[17]=h,e[18]=y,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=j?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==y||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,y,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=y,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[_]||_,e[30]=t,e[31]=k):k=e[31];const T=k;let A;e[32]!==t?(A=_=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let R;e[36]!==t?(R=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=R):R=e[37];let $;e[38]!==R?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e[38]=R,e[39]=$):$=e[39];const q=f&&!o;let O;e[40]!==g||e[41]!==q?(O=s.jsx(Wt,{isPending:g,showSaved:q}),e[40]=g,e[41]=q,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==T||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:B}=M;return s.jsx(Le,{title:T(_.key),description:U(_.key),action:s.jsx(Yt,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=T,e[50]=u,e[51]=L):L=e[51];let H;e[52]!==L?(H=s.jsx(de,{children:L}),e[52]=L,e[53]=H):H=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==H?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,H]}),e[54]=E,e[55]=F,e[56]=H,e[57]=D):D=e[57],D}function Xt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Ze(){const e=V.c(30),t=Q(),i=te(),[r]=he(),[a,n]=G.useState(!1);let c;e[0]!==t?(c=p=>{Z.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[o,x]=G.useState(r.language==="pt-BR"?"brl":"usd"),u=o,v=parseFloat(g),C=!isNaN(v)&&v>=1,j=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let y,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=N):(y=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[y,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==j||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==l?(m=!a&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[j,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>n(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=j,e[11]=a,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==j||e[17]!==g||e[18]!==v||e[19]!==a||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:j}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{n(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=j,e[17]=g,e[18]=v,e[19]=a,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,r=Q(),{org:a}=se(),n=te();let c;t[0]!==a.id?(c=X.aiProviderCredits(a.id,"deco"),t[0]=a.id,t[1]=c):c=t[1];let l;t[2]!==n?(l=async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=n,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:o,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let j;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(j=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:re("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=j):j=t[14];let h;t[15]!==o?(h=()=>o(),t[15]=o,t[16]=h):h=t[16];let y;t[17]!==r?(y=r("settings.decoCreditsHero.refreshBalance"),t[17]=r,t[18]=y):y=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=re(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(qe,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==y?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 classic:rounded-md compact:rounded-lg hover:bg-muted/50","aria-label":y,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==j?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[j,b]}),t[28]=b,t[29]=j,t[30]=S):S=t[30];let p;t[31]!==r?(p=r("settings.decoCreditsHero.availableBalance"),t[31]=r,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),r=te(),a=oe(),n=be();let c;e[0]!==n?(c=n.find(ls),e[0]=n,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,o]=G.useState(!1);let x;e[2]!==l||e[3]!==r?(x=async()=>{l&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=r,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==a||e[7]!==t?(u=()=>{a.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),o(!1)},e[5]=i,e[6]=a,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{Z.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:j,isPending:h}=ie(C);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>o(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(ye,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let T;e[36]!==k?(T=s.jsx(je,{children:k}),e[36]=k,e[37]=T):T=e[37];let A;e[38]!==I||e[39]!==T?(A=s.jsxs(Ne,{children:[I,T]}),e[38]=I,e[39]=T,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let R;e[45]!==j?(R=()=>j(),e[45]=j,e[46]=R):R=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let q;e[49]!==R||e[50]!==$?(q=s.jsx(Ce,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=R,e[50]=$,e[51]=q):q=e[51];let O;e[52]!==E||e[53]!==q?(O=s.jsxs(Pe,{children:[E,q]}),e[52]=E,e[53]=q,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:o,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const H=!d;let D;e[61]!==H?(D=s.jsx(ss,{enabled:H}),e[61]=H,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(Ze,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let B;return e[71]!==M||e[72]!==y?(B=s.jsx(ae,{title:y,children:M}),e[71]=M,e[72]=y,e[73]=B):B=e[73],B}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[rs]=it(ke),[ns,as]=rs(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:a,getValueLabel:n=os,...c}=e;(a||a===0)&&!Te(a)&&console.error(cs(`${a}`,"Progress"));const l=Te(a)?a:De;r!==null&&!Re(r,l)&&console.error(ds(`${r}`,"Progress"));const d=Re(r,l)?r:null,g=fe(d)?n(d,l):void 0;return s.jsx(ns,{scope:i,value:d,max:l,children:s.jsx(Be.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Xe.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,a=as(Je,i);return s.jsx(Be.div,{"data-state":tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Te(e){return fe(e)&&!isNaN(e)&&e>0}function Re(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
1
+ import{c as V,b as Q,ap as Oe,aq as Fe,r as G,j as s,aU as st,dZ as Le,t as Z,dY as de,dX as ae,aG as qe,a0 as se,a6 as te,o as oe,e as ie,x as he,B as W,K as X,m as pe,aP as ue,l as re,da as Be,fs as it,eL as ve,ae as lt,am as rt,L as nt,q as Ke,h as at,an as ot,ao as xe,fr as ct}from"./index-Cm-Yn4q_.js";import{i as dt}from"./AlertCircle-Da3tM0gY.js";import{u as He,a as me,i as ut,b as mt,p as ft,f as be,g as pt,d as ze}from"./use-ai-providers-VJDsVUMj.js";import{i as gt}from"./CheckCircle-5We5Va5L.js";import{c as xt,i as ht}from"./use-organization-settings-aVVw0VfM.js";import{S as vt}from"./schema-CfWSVtg9.js";import{M as bt}from"./select-model-BmMrWwNd.js";import{u as yt}from"./use-debounced-autosave-Bkd-RMtF.js";import{I as ce}from"./input-BqjhD7MF.js";import{T as Ae,a as jt}from"./toggle-group-CHLe_ngX.js";import{A as ye,a as je,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-DAmr19x7.js";import{u as ge,d as we,a as Ve,e as Nt}from"./use-entitlements-CfU3YoB8.js";import{u as Ge}from"./use-open-billing-url-Clbiqv9s.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-CuzeFHa4.js";import{i as It}from"./Check-BgFwywFf.js";import{c as wt,e as kt,b as Dt}from"./Tool01-CwUt8jvw.js";import{s as Kt}from"./Plus-C6g4VoC2.js";import{s as At}from"./Trash01-bzV9Pa75.js";import{A as Et}from"./avatar-SVBTSz6-.js";import{u as Tt,f as Rt}from"./use-date-fns-locale-CRSpZTHr.js";import{c as We,P as Ut,C as Ee}from"./decopilot-tLRiBCr4.js";import{P as Mt}from"./ai-providers-logos-DD3qZ33J.js";import{s as $t}from"./Eye-D5VumA7M.js";import{d as Ot,c as Ft,b as Lt,D as qt,e as Bt}from"./dialog-MzmGuLy9.js";import{R as Ht}from"./require-capability-C5sz4l9u.js";import"./task-board-D_YhOLZh.js";import"./drawer-Cv924bvf.js";import"./use-mobile-BlhybxdO.js";import"./chat-context-DUFRp2o5.js";import"./use-panel-navigate-BZ20L_1u.js";import"./thread-route-RnLVS5MF.js";import"./use-project-scope-DNhflWSF.js";import"./use-virtual-mcp-joDFMrl3.js";import"./use-mcp-client-DAbHG4oK.js";import"./auth-BJh0XKDc.js";import"./github-repo-BknN0SVI.js";import"./autosend-BhoAi_fW.js";import"./thread-intent-EyHIlLf5.js";import"./slugify-CEUa2lfQ.js";import"./hooks-D2YeBh8J.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-EQT-Ff7p.js";import"./index-DDt-mfSn.js";import"./User01-5UPFm-U6.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-D0AAAikP.js";import"./select-Dyq1d0JF.js";import"./index-G_4wgESR.js";import"./ChevronUp-dgPQkcdv.js";import"./ArrowLeft-EJr-YqTg.js";import"./Key01-CyjVKKuN.js";import"./SearchMd-BboWc_8K.js";import"./Monitor01-CTvO6He0.js";import"./download-app-dialog-CDDWmfdP.js";import"./Copy01-CMHlAzgS.js";import"./Download01-ChBwr6yr.js";import"./Image01-BOrVV_OY.js";import"./Stars01-BSCYhMLo.js";import"./X-i7IpcK8C.js";import"./access-gate-ZcxGf-TD.js";import"./capability-load-error-R2VQLYeI.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>ut(e),Gt=e=>mt(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(27),{slot:i,onSlotChange:r,filterModels:a,defaultKeyId:n}=e,c=He(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??n),[f,o]=G.useState(l);f!==l&&(o(l),l&&g(l));let x;t[0]!==c||t[1]!==n||t[2]!==d?(x=c.some(I=>I.id===d)?d:n,t[0]=c,t[1]=n,t[2]=d,t[3]=x):x=t[3];const u=x;let v;t[4]!==u||t[5]!==c?(v=u?c.find(I=>I.id===u):null,t[4]=u,t[5]=c,t[6]=v):v=t[6];const C=v,{models:j,isLoading:h}=me(a?u??void 0:void 0),y=a?h||j.some(a):!0;let N;t[7]!==i||t[8]!==C?.providerId||t[9]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=C?.providerId,t[9]=l,t[10]=N):N=t[10];const w=N,m=Q();if(a&&!y){let I;t[11]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=m,t[12]=I):I=t[12];let k;return t[13]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[13]=I,t[14]=k):k=t[14],k}let b;t[15]!==m?(b=m("settings.simpleModeSection.pickModel"),t[15]=m,t[16]=b):b=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[17]=S):S=t[17];let p;t[18]!==u||t[19]!==r?(p=I=>{const k=I.keyId??u??"";g(k),r({keyId:k,modelId:I.modelId,title:I.title})},t[18]=u,t[19]=r,t[20]=p):p=t[20];let P;return t[21]!==u||t[22]!==a||t[23]!==w||t[24]!==b||t[25]!==p?(P=s.jsx(bt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:a,onCredentialChange:S,onModelChange:p}),t[21]=u,t[22]=a,t[23]=w,t[24]=b,t[25]=p,t[26]=P):P=t[26],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:r}=e,a=Q();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(qe,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gt,{size:12}),t[5]=n):n=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=He(),r=xt(),a=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Oe(vt),e[0]=n):n=e[0];let c;e[1]!==r?(c={resolver:n,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=ht(),o=l.formState.isDirty;let x;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(r),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=yt(x),v=i[0],C=i[1],j=i[2],{models:h}=me(v?.id),{models:y}=me(C?.id),{models:N}=me(j?.id);let w,m;e[8]!==l||e[9]!==a?(w=()=>{a||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[a,l],e[8]=l,e[9]=a,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==j||e[17]!==h||e[18]!==y||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),B={};v?.id&&(B[v.id]=h),C?.id&&(B[C.id]=y),j?.id&&(B[j.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=ft(i,B);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=j,e[17]=h,e[18]=y,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=j?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==y||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,y,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=y,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[_]||_,e[30]=t,e[31]=k):k=e[31];const T=k;let A;e[32]!==t?(A=_=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let R;e[36]!==t?(R=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=R):R=e[37];let $;e[38]!==R?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e[38]=R,e[39]=$):$=e[39];const q=f&&!o;let O;e[40]!==g||e[41]!==q?(O=s.jsx(Wt,{isPending:g,showSaved:q}),e[40]=g,e[41]=q,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==T||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:B}=M;return s.jsx(Le,{title:T(_.key),description:U(_.key),action:s.jsx(Yt,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=T,e[50]=u,e[51]=L):L=e[51];let H;e[52]!==L?(H=s.jsx(de,{children:L}),e[52]=L,e[53]=H):H=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==H?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,H]}),e[54]=E,e[55]=F,e[56]=H,e[57]=D):D=e[57],D}function Xt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Ze(){const e=V.c(30),t=Q(),i=te(),[r]=he(),[a,n]=G.useState(!1);let c;e[0]!==t?(c=p=>{Z.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[o,x]=G.useState(r.language==="pt-BR"?"brl":"usd"),u=o,v=parseFloat(g),C=!isNaN(v)&&v>=1,j=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let y,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=N):(y=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[y,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==j||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==l?(m=!a&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[j,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>n(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=j,e[11]=a,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==j||e[17]!==g||e[18]!==v||e[19]!==a||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:j}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{n(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=j,e[17]=g,e[18]=v,e[19]=a,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,r=Q(),{org:a}=se(),n=te();let c;t[0]!==a.id?(c=X.aiProviderCredits(a.id,"deco"),t[0]=a.id,t[1]=c):c=t[1];let l;t[2]!==n?(l=async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=n,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:o,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let j;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(j=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:re("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=j):j=t[14];let h;t[15]!==o?(h=()=>o(),t[15]=o,t[16]=h):h=t[16];let y;t[17]!==r?(y=r("settings.decoCreditsHero.refreshBalance"),t[17]=r,t[18]=y):y=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=re(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(qe,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==y?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 classic:rounded-md compact:rounded-lg hover:bg-muted/50","aria-label":y,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==j?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[j,b]}),t[28]=b,t[29]=j,t[30]=S):S=t[30];let p;t[31]!==r?(p=r("settings.decoCreditsHero.availableBalance"),t[31]=r,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),r=te(),a=oe(),n=be();let c;e[0]!==n?(c=n.find(ls),e[0]=n,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,o]=G.useState(!1);let x;e[2]!==l||e[3]!==r?(x=async()=>{l&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=r,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==a||e[7]!==t?(u=()=>{a.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),o(!1)},e[5]=i,e[6]=a,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{Z.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:j,isPending:h}=ie(C);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>o(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(ye,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let T;e[36]!==k?(T=s.jsx(je,{children:k}),e[36]=k,e[37]=T):T=e[37];let A;e[38]!==I||e[39]!==T?(A=s.jsxs(Ne,{children:[I,T]}),e[38]=I,e[39]=T,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let R;e[45]!==j?(R=()=>j(),e[45]=j,e[46]=R):R=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let q;e[49]!==R||e[50]!==$?(q=s.jsx(Ce,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=R,e[50]=$,e[51]=q):q=e[51];let O;e[52]!==E||e[53]!==q?(O=s.jsxs(Pe,{children:[E,q]}),e[52]=E,e[53]=q,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:o,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const H=!d;let D;e[61]!==H?(D=s.jsx(ss,{enabled:H}),e[61]=H,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(Ze,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let B;return e[71]!==M||e[72]!==y?(B=s.jsx(ae,{title:y,children:M}),e[71]=M,e[72]=y,e[73]=B):B=e[73],B}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[rs]=it(ke),[ns,as]=rs(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:a,getValueLabel:n=os,...c}=e;(a||a===0)&&!Te(a)&&console.error(cs(`${a}`,"Progress"));const l=Te(a)?a:De;r!==null&&!Re(r,l)&&console.error(ds(`${r}`,"Progress"));const d=Re(r,l)?r:null,g=fe(d)?n(d,l):void 0;return s.jsx(ns,{scope:i,value:d,max:l,children:s.jsx(Be.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Xe.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,a=as(Je,i);return s.jsx(Be.div,{"data-state":tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Te(e){return fe(e)&&!isNaN(e)&&e>0}function Re(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${De} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
@@ -1 +1 @@
1
- import{c as n,l as o,j as c,aE as d}from"./index-CFyHGgGO.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{v as A,f as a,x as b};
1
+ import{c as n,l as o,j as c,aE as d}from"./index-Cm-Yn4q_.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{v as A,f as a,x as b};
@@ -1,4 +1,4 @@
1
- import{j as r,bg as w,r as i,bn as m,dc as T,ar as O,bq as M,bh as I,bi as z,bm as A,dd as D,bj as F,de as G,bG as L,bk as k,bl as q,c as n,l as p,au as v}from"./index-CFyHGgGO.js";var x="AlertDialog",[H]=L(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",W=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});W.displayName=V;var Y="AlertDialogPortal",b=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};b.displayName=Y;var B="AlertDialogOverlay",y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});y.displayName=B;var f="AlertDialogContent",[J,K]=H(f),Q=G("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(T,{contentName:f,titleName:_,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var _="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=_;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
1
+ import{j as r,bg as w,r as i,bn as m,dc as T,ar as O,bq as M,bh as I,bi as z,bm as A,dd as D,bj as F,de as G,bG as L,bk as k,bl as q,c as n,l as p,au as v}from"./index-Cm-Yn4q_.js";var x="AlertDialog",[H]=L(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",W=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});W.displayName=V;var Y="AlertDialogPortal",b=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};b.displayName=Y;var B="AlertDialogOverlay",y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});y.displayName=B;var f="AlertDialogContent",[J,K]=H(f),Q=G("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(T,{contentName:f,titleName:_,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var _="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=_;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -0,0 +1 @@
1
+ import{c as o,j as r}from"./index-Cm-Yn4q_.js";import{O as m}from"./api-keys-bKyXvobb.js";import{R as p}from"./require-capability-C5sz4l9u.js";import"./AlertCircle-Da3tM0gY.js";import"./Copy01-CMHlAzgS.js";import"./Key01-CyjVKKuN.js";import"./Plus-C6g4VoC2.js";import"./Trash01-bzV9Pa75.js";import"./alert-dialog-DAmr19x7.js";import"./dialog-MzmGuLy9.js";import"./X-i7IpcK8C.js";import"./input-BqjhD7MF.js";import"./label-Cq0XOqve.js";import"./use-mcp-client-DAbHG4oK.js";import"./auth-BJh0XKDc.js";import"./access-gate-ZcxGf-TD.js";import"./capability-load-error-R2VQLYeI.js";function A(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{A as default};
@@ -1 +1 @@
1
- import{c as A,a0 as Q,z as R,K as Y,m as ce,o as J,e as U,j as i,fr as de,b as F,r as O,dX as me,eL as X,B as v,t as q}from"./index-CFyHGgGO.js";import{i as fe}from"./AlertCircle-Cwl0Vup2.js";import{a as ue}from"./Copy01-BwsqBYnE.js";import{i as V}from"./Key01-CTlB38YG.js";import{s as W}from"./Plus-DxM0fEC4.js";import{s as ge}from"./Trash01-B-_Oqcf7.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-BCnbMjLm.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-RGKICG4s.js";import{I as le}from"./input-BXe2-JP2.js";import{L as De}from"./label-BKtkcOfE.js";import{u as H}from"./use-mcp-client-Cgrjx403.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(V,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(V,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(W,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
1
+ import{c as A,a0 as Q,z as R,K as Y,m as ce,o as J,e as U,j as i,fr as de,b as F,r as O,dX as me,eL as X,B as v,t as q}from"./index-Cm-Yn4q_.js";import{i as fe}from"./AlertCircle-Da3tM0gY.js";import{a as ue}from"./Copy01-CMHlAzgS.js";import{i as V}from"./Key01-CyjVKKuN.js";import{s as W}from"./Plus-C6g4VoC2.js";import{s as ge}from"./Trash01-bzV9Pa75.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-DAmr19x7.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-MzmGuLy9.js";import{I as le}from"./input-BqjhD7MF.js";import{L as De}from"./label-Cq0XOqve.js";import{u as H}from"./use-mcp-client-DAbHG4oK.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(V,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(V,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(W,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
@@ -0,0 +1 @@
1
+ import{c as jt,b as Bt,r as A,j as o,am as wt,l as _t,h as At,t as ht}from"./index-Cm-Yn4q_.js";import{u as Et}from"./chat-context-DUFRp2o5.js";import{S as Nt}from"./scroll-area-D5XoGWja.js";import{u as Rt,A as Tt}from"./use-section-preview-base-DOg0m0Oe.js";import{o as Ct}from"./claim-phase-copy-0btUuJoC.js";import{h as Kt,u as Pt,w as Ft,aO as Ot,x as Ut,d as $t,aP as It}from"./runnable-block-editor-CTtbEokq.js";import{n as zt,r as Lt}from"./agent-site-editor-content-DCyPeHZN.js";import"./use-panel-navigate-BZ20L_1u.js";import"./thread-route-RnLVS5MF.js";import"./use-project-scope-DNhflWSF.js";import"./use-virtual-mcp-joDFMrl3.js";import"./use-mcp-client-DAbHG4oK.js";import"./auth-BJh0XKDc.js";import"./github-repo-BknN0SVI.js";import"./autosend-BhoAi_fW.js";import"./thread-intent-EyHIlLf5.js";import"./slugify-CEUa2lfQ.js";import"./hooks-D2YeBh8J.js";import"./backoff-8mStPHYB.js";import"./task-board-D_YhOLZh.js";import"./schema-CfWSVtg9.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-CfU3YoB8.js";import"./use-ai-providers-VJDsVUMj.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-EQT-Ff7p.js";import"./use-organization-settings-aVVw0VfM.js";import"./select-Dyq1d0JF.js";import"./index-G_4wgESR.js";import"./Check-BgFwywFf.js";import"./ChevronUp-dgPQkcdv.js";import"./UserSquare-C_2Z4y9_.js";import"./agent-icon-4F7jSNEB.js";import"./AlertCircle-Da3tM0gY.js";import"./Tool01-CwUt8jvw.js";import"./ArrowUp-Cr0h1eUU.js";import"./ArrowLeft-EJr-YqTg.js";import"./ArrowRight-CdK41xWy.js";import"./XCircle-ClHynDO9.js";import"./ZoomOut-BJTVjnBu.js";import"./Globe04-ClJkKQrs.js";import"./CheckCircle-5We5Va5L.js";import"./Copy01-CMHlAzgS.js";import"./CreditCard01-DCgVn3oV.js";import"./DotsVertical-C9TkkMfe.js";import"./Download01-ChBwr6yr.js";import"./Eye-D5VumA7M.js";import"./Share07-CbepO2bZ.js";import"./XClose-XZQSLHM2.js";import"./Image01-BOrVV_OY.js";import"./Key01-CyjVKKuN.js";import"./LayoutLeft-C-Lx98x9.js";import"./Link01-C5bvI0ok.js";import"./LinkExternal01-7ZLNL_9s.js";import"./Monitor01-CTvO6He0.js";import"./Sun--XqnAA9t.js";import"./Package-zC5cSGJD.js";import"./Palette-Hb6mROVB.js";import"./Plus-C6g4VoC2.js";import"./SearchLg-CF0JjYPh.js";import"./SearchMd-BboWc_8K.js";import"./Stars01-BSCYhMLo.js";import"./Trash01-bzV9Pa75.js";import"./Upload01-DKLqc8wc.js";import"./User01-5UPFm-U6.js";import"./Users01-CBoZFJLg.js";import"./X-i7IpcK8C.js";import"./Zap-13Bw0A-o.js";import"./dialog-MzmGuLy9.js";import"./input-BqjhD7MF.js";import"./section-preview-url-Csj0_ZDg.js";import"./use-session-runtime-ttdCX595.js";import"./decofile-api-DgTLnV1u.js";import"./utils-DjeQFU_k.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BEtEaRoT.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BQcY6rPc.js";import"./use-copy-CeHMXkmI.js";import"./usage-stats-DL6Mxcqj.js";import"./markdown-BXZJduYq.js";import"./org-file-open-context-lYlEwrS6.js";import"./use-mobile-BlhybxdO.js";import"./tooltip-Bja45eMa.js";import"./shell-layout-mxurnlT8.js";import"./avatar-SVBTSz6-.js";import"./download-app-dialog-CDDWmfdP.js";import"./command-BMFq9nQJ.js";import"./index-D4cAPfDs.js";import"./integration-icon-BPXGYcG_.js";import"./project-icon-7mHVCrAj.js";import"./required-auth-layout-Dx8h2y43.js";import"./use-org-sso-CaeEbX_L.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-znNhYyyo.js";import"./types-imD2hCXv.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-3gBYEcvM.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./sheet-4N_7bh_n.js";import"./use-connection-BNw2MaMd.js";import"./use-navigate-to-agent-UrDQ1j_Y.js";import"./use-mcp-prompts-Dqrno6f9.js";import"./index-Clt0_ml3.js";import"./form-C4j126KK.js";import"./label-Cq0XOqve.js";import"./use-thread-outputs-DFHmpQbO.js";import"./file-type-icon-D1D8leoE.js";import"./popover-0yOMUN9V.js";import"./monaco-editor-D1EuV3RH.js";import"./editor-zW3jvuax.js";import"./calendar-PjjlUwcV.js";import"./textarea-DwEKjGZF.js";import"./rich-text-link-control-B3amDY-g.js";import"./switch-BJbkn4iq.js";import"./search-input-oOSx8rAu.js";import"./tabs-DfTLJ-n_.js";import"./use-debounced-value-CBSXKHwV.js";import"./use-file-configs-DV2TLqWx.js";import"./asset-utils-DtY2LEWI.js";import"./useInfiniteQuery-ApIt4V4o.js";import"./infiniteQueryObserver-kZQR6QZi.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-CHLe_ngX.js";import"./alert-dialog-DAmr19x7.js";import"./sandbox-git-api-B1R0585s.js";import"./agent-view-guard-DRtIvPWQ.js";import"./use-main-panel-tabs-T0Kvslcy.js";import"./use-route-default-main-Cpujna-F.js";import"./use-mcp-tools-B9HxU8OQ.js";import"./index-Dd7WwYBf.js";import"./drawer-Cv924bvf.js";import"./collection-search-Dz6UsoEM.js";import"./input-8i6Bk9mS.js";import"./chat-draft-NKFUt1rK.js";import"./use-deco-credits-C6itQLFB.js";import"./use-open-billing-url-Clbiqv9s.js";import"./decopilot-tLRiBCr4.js";import"./checkbox-D0AAAikP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-DDt-mfSn.js";import"./input-IyrqyofH.js";import"./hooks-B23Jg659.js";import"./use-org-fs-Dm0MOI2N.js";import"./question-004-sINsf4GQ.js";import"./use-members-CX4Ep53P.js";import"./use-org-auth-client-0lE24BYR.js";import"./feature-paywall-CftG_N1J.js";import"./plan-ladder-CuzeFHa4.js";import"./add-connection-dialog-BB4K9AtD.js";import"./extract-connection-data-DNxvULAk.js";import"./metadata-D72DunRR.js";import"./connection-Bu_kYZuh.js";import"./connection-card-BR0rWuUi.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-glicOBfm.js";import"./authenticate-and-persist-oauth-DwKiV4n5.js";import"./mcp-oauth-DpctXbyl.js";import"./collection-tabs-CstWw66H.js";import"./badge-Tw_0Gnfk.js";import"./use-infinite-scroll-CcnUJvw1.js";import"./useSuspenseInfiniteQuery-Vryw3RBz.js";import"./sandbox-lifecycle-context-BfjBaS4k.js";import"./use-task-metadata-CIrvVpnI.js";import"./use-project-native-view-presence-B8m71d1U.js";import"./site-slug-uya6Wp4-.js";import"./virtual-mcp-C5gMOVS_.js";import"./feature-gate-B9rqGCJb.js";import"./mustache-LQdueZ7J.js";import"./empty-state-BptHyu85.js";import"./github-icon-l7M1zEUL.js";import"./repository-import-picker-fxShIRss.js";import"./repository-picker-df_kLebP.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",p=zt(t,i);return{blockKey:p,data:{__resolveType:n.resolveType,name:p}}}function pi(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:p,blockKey:s,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=Et()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Lt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Ct(s,x,a):s);let C;t[9]!==p||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:p},t[9]=p,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Kt(C);let K;t[13]!==p||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:p},t[13]=p,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Pt(K);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(s),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==s&&(St(s),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==s||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(s,{...r,__resolveType:v})},t[27]=s,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const pt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const st=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ft(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(It,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let w;t[47]!==s||t[48]!==p||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==pt||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(w=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ut,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:pt,sandbox:{orgSlug:m,virtualMcpId:i,branch:p,threadId:G}},`${s}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(At,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=s,t[48]=p,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=pt,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=w):w=t[67];let _;t[68]!==ot||t[69]!==l||t[70]!==st||t[71]!==a||t[72]!==h||t[73]!==d?(_=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{st(e)}}),t[68]=ot,t[69]=l,t[70]=st,t[71]=a,t[72]=h,t[73]=d,t[74]=_):_=t[74];let M;return t[75]!==B||t[76]!==w||t[77]!==_?(M=o.jsxs("div",{className:gt,children:[B,w,_]}),t[75]=B,t[76]=w,t[77]=_,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{pi as AppEditor};
@@ -1 +1 @@
1
- import{c as u,a0 as d,e as g,a6 as m,K as I,o as O}from"./index-CFyHGgGO.js";import{u as $}from"./useInfiniteQuery-C9Zty0xS.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
1
+ import{c as u,a0 as d,e as g,a6 as m,K as I,o as O}from"./index-Cm-Yn4q_.js";import{u as $}from"./useInfiniteQuery-ApIt4V4o.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
@@ -1 +1 @@
1
- import{aY as $,aZ as v,a_ as W,a$ as H,b0 as D,b1 as y,b2 as V,b3 as x,b4 as L,b5 as q,b6 as j,b7 as N,b8 as B,b9 as Z,ba as F}from"./index-CFyHGgGO.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await b(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function b(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await b(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function P(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=P(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=P(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,b as a,_e as b,Ue as c,T as d,me as e};
1
+ import{aY as $,aZ as v,a_ as W,a$ as H,b0 as D,b1 as y,b2 as V,b3 as x,b4 as L,b5 as q,b6 as j,b7 as N,b8 as B,b9 as Z,ba as F}from"./index-Cm-Yn4q_.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await b(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return q.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function b(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await b(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function P(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=P(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=P(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,b as a,_e as b,Ue as c,T as d,me as e};
@@ -1 +1 @@
1
- import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-CFyHGgGO.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
1
+ import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-Cm-Yn4q_.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};