decocms 4.22.2 → 4.22.3

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 (223) hide show
  1. package/dist/client/assets/{AlertCircle-BWfyWgiw.js → AlertCircle-CS_9RDbg.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-h5-lNOU3.js → ArrowUpRight-DvbKSlUB.js} +1 -1
  3. package/dist/client/assets/{Check-B2t3_u8j.js → Check-CUUu6fuS.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Cd9sCPj_.js → CheckCircle-2nPR7mAJ.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CJGVvA9G.js → ChevronDown-SbVNxwJa.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-SxNLyRA0.js → ChevronRight-CcT_Yai8.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cfv8kwOP.js → ChevronUp-DvAb8S9K.js} +1 -1
  8. package/dist/client/assets/{Circle-CmWJQsR2.js → Circle-Bk2OeGHv.js} +1 -1
  9. package/dist/client/assets/{Copy01-C_1mrR9P.js → Copy01-DvnmgpBw.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DQ-r-KXk.js → DotsVertical-BdQp-tpJ.js} +1 -1
  11. package/dist/client/assets/{Eye-Jd91Hda4.js → Eye-_b_nmYda.js} +1 -1
  12. package/dist/client/assets/{FilterLines-C7Zdp7-q.js → FilterLines-Dgm9Ju0X.js} +1 -1
  13. package/dist/client/assets/{Globe01-4bI1LBPk.js → Globe01-BWEVPBr8.js} +1 -1
  14. package/dist/client/assets/{Globe04-CPnbhr3e.js → Globe04-wcXsSWcH.js} +1 -1
  15. package/dist/client/assets/{HardDrive-WT4IA8YF.js → HardDrive-CCq9xvHa.js} +1 -1
  16. package/dist/client/assets/{Key01-_0kmrESm.js → Key01-BXrc6Emy.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-D_5UU_fl.js → LayoutLeft-BStzo30s.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CYx_LjKe.js → LinkExternal01-BuzymGhb.js} +1 -1
  19. package/dist/client/assets/{List-5nWMXvgZ.js → List-BFtSkA22.js} +1 -1
  20. package/dist/client/assets/{Loading02-D5Q9o2ML.js → Loading02-Cc_XPeVS.js} +1 -1
  21. package/dist/client/assets/{Monitor01-EVfMwGgl.js → Monitor01-BJSW7YEH.js} +1 -1
  22. package/dist/client/assets/{Palette-Cg2Il5Mo.js → Palette-BudWH9og.js} +1 -1
  23. package/dist/client/assets/{Play-C4pBBuTc.js → Play-tpQoZZ7-.js} +1 -1
  24. package/dist/client/assets/{Plus-Cj9kK9tN.js → Plus-6nUvzb_a.js} +1 -1
  25. package/dist/client/assets/{SearchLg-JSkDDvk4.js → SearchLg-uOXEhZpb.js} +1 -1
  26. package/dist/client/assets/{SearchMd-CP9WApAb.js → SearchMd-CxCfJ-k7.js} +1 -1
  27. package/dist/client/assets/{Settings02-Bs74lw7T.js → Settings02-C4te5XIh.js} +1 -1
  28. package/dist/client/assets/{Shield01-DMFwBOtF.js → Shield01-DL0nLXwm.js} +1 -1
  29. package/dist/client/assets/{Star01-CC3gyOop.js → Star01-BMo746nc.js} +1 -1
  30. package/dist/client/assets/{Stars01-DKD-uu49.js → Stars01-CeLaUJek.js} +1 -1
  31. package/dist/client/assets/{Stars02-DGriyPK-.js → Stars02-CbNiaecd.js} +1 -1
  32. package/dist/client/assets/{Sun-DszeKWvN.js → Sun-DdZgJrCs.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-a_i15cCW.js → SwitchHorizontal01-BmduH4aR.js} +1 -1
  34. package/dist/client/assets/{Tool01-iIXzQIf6.js → Tool01-TTGB3OaR.js} +1 -1
  35. package/dist/client/assets/{Trash01-D_xTnQtW.js → Trash01-D7DoI-Sm.js} +1 -1
  36. package/dist/client/assets/{Upload01-COCQSA6j.js → Upload01-DK0nNkQH.js} +1 -1
  37. package/dist/client/assets/{User01-DBHhpCM7.js → User01-zyFcbX02.js} +1 -1
  38. package/dist/client/assets/{Users01-BymojQtX.js → Users01-DD6y7ZFy.js} +1 -1
  39. package/dist/client/assets/{Users03-Dnn-6pZq.js → Users03-CbmB3ag4.js} +1 -1
  40. package/dist/client/assets/{X-DY9hR308.js → X-qcmmBu7s.js} +1 -1
  41. package/dist/client/assets/{XCircle-DofnF94J.js → XCircle-Bn7fkWKh.js} +1 -1
  42. package/dist/client/assets/{XClose-CmiCfuv_.js → XClose-aB151tNh.js} +1 -1
  43. package/dist/client/assets/{Zap-BwbZR_TW.js → Zap-CKOdamGS.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-B7pUKk1h.js → ZapSquare-BWJNUjCu.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-B3kimgA9.js → ZoomOut-TFjut-PL.js} +1 -1
  46. package/dist/client/assets/{access-gate-BOS773UI.js → access-gate-BrC4x4bH.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-Z7yIxDfk.js → add-section-modal-CMgGjfQy.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-DRUNyKs6.js → agent-capabilities-B_99zpHP.js} +1 -1
  49. package/dist/client/assets/{agent-icon-K57A0DzY.js → agent-icon-CPQk4YwJ.js} +1 -1
  50. package/dist/client/assets/{agents-list-DdfrpJA4.js → agents-list-nbmqgS_E.js} +1 -1
  51. package/dist/client/assets/{ai-providers-ZlX0S41Y.js → ai-providers-D0wJFLuS.js} +1 -1
  52. package/dist/client/assets/{alert-D12iE_jh.js → alert-CIXXRGUS.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BuY0O9iQ.js → alert-dialog-DmHjxQGj.js} +1 -1
  54. package/dist/client/assets/{app-editor-B6oORsVZ.js → app-editor-BsolX872.js} +1 -1
  55. package/dist/client/assets/{auth-D1xUzxIp.js → auth-D0kIsFu2.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-BTjXPhNI.js → auth-catchall-DqYoQiw7.js} +1 -1
  57. package/dist/client/assets/{auth-entry-Bg2Xb6tT.js → auth-entry-D3jHJu3A.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-CzHLXrwa.js → auth-split-layout-CX7sxZli.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-CbQ04gTK.js → authenticate-and-persist-oauth-DkNbTtTB.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-3xTUT0sz.js → automation-list-row-F_XkFIpJ.js} +1 -1
  61. package/dist/client/assets/{automation-runs-B5QugYRM.js → automation-runs-fA1ChIGW.js} +1 -1
  62. package/dist/client/assets/{automations-DpLONqEv.js → automations-mTaCH83G.js} +1 -1
  63. package/dist/client/assets/{avatar-b6IKYKQs.js → avatar-B8x-LJ3L.js} +1 -1
  64. package/dist/client/assets/{badge-DGFEVFje.js → badge-Du0UNTzb.js} +1 -1
  65. package/dist/client/assets/{block-document-CLPFDPat.js → block-document-iNfCDN2P.js} +1 -1
  66. package/dist/client/assets/{brand-context-Ba-On5d-.js → brand-context-E2Z3Pmiz.js} +1 -1
  67. package/dist/client/assets/{breadcrumb-8G_CoEun.js → breadcrumb-BShjlVDr.js} +1 -1
  68. package/dist/client/assets/{buckets-pXaevYUV.js → buckets-BT1sWv9w.js} +1 -1
  69. package/dist/client/assets/{bulk-category-panel-OTFFglhS.js → bulk-category-panel-CXG1IXf-.js} +1 -1
  70. package/dist/client/assets/{capability-load-error-CEmXpgFG.js → capability-load-error-DsHvqjTt.js} +1 -1
  71. package/dist/client/assets/{card-dPxA0RCs.js → card-CYX_RwBA.js} +1 -1
  72. package/dist/client/assets/{category-editor-B2KWZmpg.js → category-editor-DjMzIFH_.js} +1 -1
  73. package/dist/client/assets/{chat-context-COllONR2.js → chat-context-Cemyx-UZ.js} +1 -1
  74. package/dist/client/assets/{checkbox-5y5TSI8u.js → checkbox-DZJkrzus.js} +1 -1
  75. package/dist/client/assets/{cli-auth-success-DY-Hf-b0.js → cli-auth-success-DOW9HsKN.js} +1 -1
  76. package/dist/client/assets/{collection-detail-bmPgPvem.js → collection-detail-BMZKhngT.js} +1 -1
  77. package/dist/client/assets/{collection-display-button-B4kpKs3o.js → collection-display-button-BuAgDHrw.js} +1 -1
  78. package/dist/client/assets/{collection-search-SaKzAiAF.js → collection-search-DfgQYgyj.js} +1 -1
  79. package/dist/client/assets/{collection-table-wrapper-CJ-K0eS_.js → collection-table-wrapper-hkqvebTU.js} +1 -1
  80. package/dist/client/assets/{collection-tabs-CZb_AY94.js → collection-tabs-D3XeP_yy.js} +1 -1
  81. package/dist/client/assets/{command-DDwBnk4S.js → command-DN00KTSb.js} +1 -1
  82. package/dist/client/assets/{commerce-onboarding-Cj6KuavN.js → commerce-onboarding-yWSM0PQD.js} +1 -1
  83. package/dist/client/assets/{connect-desktop-dialog-uu1uNLI_.js → connect-desktop-dialog-DnC2R2Wo.js} +1 -1
  84. package/dist/client/assets/{connection-card-BsaY572f.js → connection-card-BoKNDsqu.js} +1 -1
  85. package/dist/client/assets/{connection-detail-CVTulNyz.js → connection-detail-C_252exw.js} +1 -1
  86. package/dist/client/assets/{connection-form-helpers-CHdocTpm.js → connection-form-helpers-DgmmJwTY.js} +1 -1
  87. package/dist/client/assets/{connections-JYGKhfuk.js → connections-BMIC4hHM.js} +1 -1
  88. package/dist/client/assets/{decopilot-B6qg2Op3.js → decopilot-CETHa21a.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-D8tR3MTD.js → decopilot-sse-pool-C82Ujbm_.js} +1 -1
  90. package/dist/client/assets/{dialog-RRPWwqaQ.js → dialog-CEOLT1ZZ.js} +1 -1
  91. package/dist/client/assets/{domain-settings-CtXa1jf3.js → domain-settings-BSIbwctC.js} +1 -1
  92. package/dist/client/assets/{drawer-DJfZ0VmD.js → drawer-B-rufaJn.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-DDhytuEd.js → dropdown-menu-CeNfEKAu.js} +1 -1
  94. package/dist/client/assets/{empty-state-CtsFp5nF.js → empty-state-BXO7rHQu.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-DI_Hy6px.js → extract-connection-data-Db76guDM.js} +1 -1
  96. package/dist/client/assets/{file-explorer-D1P9uacX.js → file-explorer-CLuX6xBf.js} +1 -1
  97. package/dist/client/assets/{file-type-icon-CBM2EyFd.js → file-type-icon-CxAOgcI2.js} +1 -1
  98. package/dist/client/assets/{files-DdTksaS8.js → files-BjIbXeVM.js} +1 -1
  99. package/dist/client/assets/{form-BylSC3lX.js → form-DtFQ7vfL.js} +1 -1
  100. package/dist/client/assets/{general-DGX6oTcl.js → general-DHyqePel.js} +1 -1
  101. package/dist/client/assets/{github-repo-picker-J64_EPEa.js → github-repo-picker-DXC0Oul4.js} +1 -1
  102. package/dist/client/assets/{hooks-B4JA5-D1.js → hooks-DLOVOtDp.js} +1 -1
  103. package/dist/client/assets/{index-DTx-RDv5.js → index-914V2fcS.js} +1 -1
  104. package/dist/client/assets/{index-DEenRZAo.js → index-9ntojBLk.js} +1 -1
  105. package/dist/client/assets/{index-DKXcf6uO.js → index-B1FK7wQH.js} +1 -1
  106. package/dist/client/assets/{index-CZfoQE-0.js → index-BNz3lima.js} +1 -1
  107. package/dist/client/assets/{index-B3JJ62uP.js → index-Blor2-rz.js} +1 -1
  108. package/dist/client/assets/{index-Bxu03H5X.js → index-BlyuLoWx.js} +1 -1
  109. package/dist/client/assets/{index-FLLcVjP1.js → index-Cs6NaxUB.js} +25 -25
  110. package/dist/client/assets/{index-8heN4TLW.js → index-Cwr5cOYK.js} +1 -1
  111. package/dist/client/assets/{index-CC3_vx1n.js → index-D5RT2LDt.js} +1 -1
  112. package/dist/client/assets/{index-jUZDCPpZ.js → index-Ds2zXC-C.js} +1 -1
  113. package/dist/client/assets/{index-DACIolxc.js → index-Um2y51Zg.js} +1 -1
  114. package/dist/client/assets/{index-DHu9eqr8.js → index-g1gbVRQq.js} +1 -1
  115. package/dist/client/assets/{index-redirect-KOsw3DwK.js → index-redirect-D63CT2D1.js} +1 -1
  116. package/dist/client/assets/{index-5AaNNafz.js → index-wvMNjAV0.js} +3 -3
  117. package/dist/client/assets/{index-C7SCPFX7.js → index-yCHQGXJ7.js} +1 -1
  118. package/dist/client/assets/{input-BAz505sI.js → input-CtNQHwPy.js} +1 -1
  119. package/dist/client/assets/{integration-icon-DtLxCtgy.js → integration-icon-DvFXK2MU.js} +1 -1
  120. package/dist/client/assets/{invite-member-dialog-BDVAAQIu.js → invite-member-dialog-CrMqsXT4.js} +1 -1
  121. package/dist/client/assets/{label-BALEyZ3d.js → label-B8KM3R_q.js} +1 -1
  122. package/dist/client/assets/{library-tab-Ds5fpIQF.js → library-tab-DFX3AeS3.js} +1 -1
  123. package/dist/client/assets/{login-DPGDZC34.js → login-DxUhmOqI.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-CXxRaWx9.js → mcp-oauth-DzrEuQr5.js} +1 -1
  125. package/dist/client/assets/{members-Bape-XGh.js → members-CPkTTkE0.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-qr3YxpgD.js → monaco-editor-BgI79QTg.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-DHs40KAy.js → monitoring-stats-row-CUczTxeX.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-DAEXXBSA.js → oauth-callback-DIyFvghE.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-DGzIC1E3.js → oauth-callback-ai-provider-IS3SsI0k.js} +1 -1
  130. package/dist/client/assets/{onboarding-BQNZ1j24.js → onboarding-KfqNRkYy.js} +1 -1
  131. package/dist/client/assets/{org-install-cdxFoHPK.js → org-install-CxT0tsIO.js} +1 -1
  132. package/dist/client/assets/{org-layout-MlmaWu50.js → org-layout-BQzjU6XX.js} +1 -1
  133. package/dist/client/assets/{organization-choice-CCNhBIVu.js → organization-choice-BI1DZkDU.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-B9WRtqtD.js → page-seo-form-D7JF4DTh.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-BzOt7DdS.js +1 -0
  136. package/dist/client/assets/{popover-QpTPPo-c.js → popover-Cvv98a2C.js} +1 -1
  137. package/dist/client/assets/{post-editor-DrsCS-yJ.js → post-editor-6_kkiUtL.js} +1 -1
  138. package/dist/client/assets/{primitives-BjlgEPjn.js → primitives-Bxk9aYw4.js} +1 -1
  139. package/dist/client/assets/{profile-BJ8vtOlo.js → profile-CZas9jg2.js} +1 -1
  140. package/dist/client/assets/project-app-view-xDz9FH-v.js +1 -0
  141. package/dist/client/assets/record-editor-C33gYIwT.js +1 -0
  142. package/dist/client/assets/registry-D8itHQYS.js +2 -0
  143. package/dist/client/assets/{registry-layout-ksLcOWzv.js → registry-layout-8sIvvJ4I.js} +1 -1
  144. package/dist/client/assets/{require-capability-C2pr3gWk.js → require-capability-CSyEuadx.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-BIsgDBTS.js → required-auth-layout-CH2SPOr0.js} +1 -1
  146. package/dist/client/assets/{reset-password-5xoBMew1.js → reset-password-CftvJ30J.js} +1 -1
  147. package/dist/client/assets/{roles-CTVYbrPK.js → roles-b4IJFdUQ.js} +1 -1
  148. package/dist/client/assets/{scroll-area-B7g9A0xO.js → scroll-area-CbuKwozG.js} +1 -1
  149. package/dist/client/assets/{search-input-Cn-k-Sr0.js → search-input-BJJrtkoD.js} +1 -1
  150. package/dist/client/assets/{secrets-01-N-EoG.js → secrets-xEL3iU0h.js} +1 -1
  151. package/dist/client/assets/{sections-editor-FTn-qJ5h.js → sections-editor-I7PrxFXt.js} +1 -1
  152. package/dist/client/assets/{select-DMOL9nTa.js → select-DF6YoK_r.js} +1 -1
  153. package/dist/client/assets/{select-model-DJ7qLHls.js → select-model-nui66-pH.js} +1 -1
  154. package/dist/client/assets/{seo-editor-CJg20m-v.js → seo-editor-BJAI05hX.js} +1 -1
  155. package/dist/client/assets/{settings-layout-C-lnHpnd.js → settings-layout-urJbxzRN.js} +1 -1
  156. package/dist/client/assets/{settings-section-knuBYiSB.js → settings-section-CngINngb.js} +1 -1
  157. package/dist/client/assets/{sheet-B1hdeTXZ.js → sheet-DMc7DeSX.js} +1 -1
  158. package/dist/client/assets/{shell-controls-DGQEgSmu.js → shell-controls-Bkd5dBPA.js} +1 -1
  159. package/dist/client/assets/{shell-layout-BzrEGgvG.js → shell-layout-CoG2R-A7.js} +1 -1
  160. package/dist/client/assets/{sidebar-BZHqZbJ1.js → sidebar-yJWB-4vB.js} +1 -1
  161. package/dist/client/assets/{skeleton-C1g3sLzc.js → skeleton-CEKyj6Ku.js} +1 -1
  162. package/dist/client/assets/{sso-BRP47dTR.js → sso-C_CoNDtw.js} +1 -1
  163. package/dist/client/assets/{store-COqKQ01f.js → store-B3cr8RRQ.js} +1 -1
  164. package/dist/client/assets/store-registry-0mo75fzc.js +2 -0
  165. package/dist/client/assets/{studio-tools-CK3O9apC.js → studio-tools-CEhEjTYq.js} +1 -1
  166. package/dist/client/assets/{switch-CTqoacsA.js → switch-CDv7wzZp.js} +1 -1
  167. package/dist/client/assets/{table-D9O3xZPm.js → table-_yINUqfn.js} +1 -1
  168. package/dist/client/assets/{tabs-OKKf4LAY.js → tabs-Cf3RVJ3Q.js} +1 -1
  169. package/dist/client/assets/{task-row-mk4G9x-_.js → task-row-BVs0CmAg.js} +1 -1
  170. package/dist/client/assets/{task-status-gvDe4NpG.js → task-status-VysJG0vN.js} +1 -1
  171. package/dist/client/assets/{textarea-BwMDBTqD.js → textarea-CDy5MusJ.js} +1 -1
  172. package/dist/client/assets/{toggle-group-CqoGi-AW.js → toggle-group-Dtf2CWD1.js} +1 -1
  173. package/dist/client/assets/{toolbar-Do7hu99P.js → toolbar-DeO3vJmm.js} +1 -1
  174. package/dist/client/assets/{toolbar-icon-button-D8xZWaZ4.js → toolbar-icon-button-C4_ADEJH.js} +1 -1
  175. package/dist/client/assets/{tools-list-D7bHk7AU.js → tools-list-Cn_EK2iQ.js} +1 -1
  176. package/dist/client/assets/{tooltip-jwNiafJz.js → tooltip-DlUY886I.js} +1 -1
  177. package/dist/client/assets/{types-Z9nbiCM2.js → types-CvzpcJR1.js} +1 -1
  178. package/dist/client/assets/{use-ai-providers-CaFOP2gL.js → use-ai-providers-BJKmj4My.js} +1 -1
  179. package/dist/client/assets/{use-automations-BYB1tBxg.js → use-automations-BFGNyCFk.js} +1 -1
  180. package/dist/client/assets/{use-capability-BJgOQ1dM.js → use-capability-DgzJJHkU.js} +1 -1
  181. package/dist/client/assets/{use-clock-tick-DiuTRa3m.js → use-clock-tick-BEBincp5.js} +1 -1
  182. package/dist/client/assets/{use-collections-D9VCe-RD.js → use-collections-CjkVI8cV.js} +1 -1
  183. package/dist/client/assets/{use-connection-BsHhz007.js → use-connection-ChjsmWTh.js} +1 -1
  184. package/dist/client/assets/{use-copy-BhkveYAE.js → use-copy-I4FalMZb.js} +1 -1
  185. package/dist/client/assets/{use-create-virtual-mcp-DL7SpS9p.js → use-create-virtual-mcp-BmL59nAp.js} +1 -1
  186. package/dist/client/assets/{use-debounced-autosave-CP4G_DMm.js → use-debounced-autosave-DhGwNW9j.js} +1 -1
  187. package/dist/client/assets/{use-debounced-value-qurf1YAB.js → use-debounced-value-CLg8LNax.js} +1 -1
  188. package/dist/client/assets/{use-decopilot-events-89JO9cLA.js → use-decopilot-events-uhlm9ZSC.js} +1 -1
  189. package/dist/client/assets/{use-delete-connection-CPcnCL2Y.js → use-delete-connection-CZmgFI8O.js} +1 -1
  190. package/dist/client/assets/{use-file-configs-C37Mzz_w.js → use-file-configs-aZ5m3Qj2.js} +1 -1
  191. package/dist/client/assets/{use-infinite-scroll-Dzaxo4bN.js → use-infinite-scroll-DI0qAEco.js} +1 -1
  192. package/dist/client/assets/{use-join-requests-CPgcKwb5.js → use-join-requests-CIrAIT4T.js} +1 -1
  193. package/dist/client/assets/{use-mcp-client-DAdRU1cY.js → use-mcp-client-dBNHEL6c.js} +1 -1
  194. package/dist/client/assets/{use-mcp-prompts-DbP7dBZf.js → use-mcp-prompts-D2VFS_7Z.js} +1 -1
  195. package/dist/client/assets/{use-mcp-tools-s0H1m2Ok.js → use-mcp-tools-DX5g41Xz.js} +1 -1
  196. package/dist/client/assets/{use-members-BT2wuks0.js → use-members-BeAV3T2H.js} +1 -1
  197. package/dist/client/assets/{use-mobile-CCjACM_-.js → use-mobile-7niVKoti.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-CMFaBfX6.js → use-navigate-to-agent-C1tFWD13.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-BSqoqb51.js → use-org-auth-client-CwSEkcA-.js} +1 -1
  200. package/dist/client/assets/{use-org-sso-CZi5R7ze.js → use-org-sso-CXSE3hAV.js} +1 -1
  201. package/dist/client/assets/{use-organization-roles-amhmG5-6.js → use-organization-roles-C8hy4d4V.js} +1 -1
  202. package/dist/client/assets/{use-organization-settings-DJLfSIHV.js → use-organization-settings-OjpRHnBI.js} +1 -1
  203. package/dist/client/assets/{use-registry-connections-DPtEZCsY.js → use-registry-connections-BiMSB_yO.js} +1 -1
  204. package/dist/client/assets/{use-secrets-CTWIslZA.js → use-secrets-sNifGUNT.js} +1 -1
  205. package/dist/client/assets/{use-status-sounds-Du5pinlF.js → use-status-sounds-BjM7PTwu.js} +1 -1
  206. package/dist/client/assets/{use-view-mode-C9H3mYaP.js → use-view-mode-C6xNmVYR.js} +1 -1
  207. package/dist/client/assets/{use-virtual-mcp-B0Bq3-Jt.js → use-virtual-mcp-Cy-jA6Qm.js} +1 -1
  208. package/dist/client/assets/useInfiniteQuery-CcA0p7if.js +1 -0
  209. package/dist/client/assets/useSuspenseInfiniteQuery-DXVqJ8aq.js +1 -0
  210. package/dist/client/assets/{useSuspenseQueries-BQ3vTQtS.js → useSuspenseQueries-Dg30S2DW.js} +1 -1
  211. package/dist/client/assets/{variant-calendar-DKaaO6xE.js → variant-calendar-DoCnqvSc.js} +1 -1
  212. package/dist/client/assets/{view-mode-toggle-B6q9qYR8.js → view-mode-toggle-BMDNQ_Ex.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/server/cli.js +1 -1
  215. package/dist/server/server.js +1 -1
  216. package/package.json +1 -1
  217. package/dist/client/assets/page-seo-sheet-Da6XfVR0.js +0 -1
  218. package/dist/client/assets/project-app-view-DseQWbDi.js +0 -1
  219. package/dist/client/assets/record-editor-DbGexVfp.js +0 -1
  220. package/dist/client/assets/registry-DeMcmcPG.js +0 -2
  221. package/dist/client/assets/store-registry-DkYzijdd.js +0 -2
  222. package/dist/client/assets/useInfiniteQuery-C7fx2naq.js +0 -1
  223. package/dist/client/assets/useSuspenseInfiniteQuery-DpHAMt5e.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as L,ae as Ye,c as V,j as s,o as Oe,s as re,D as le,m as me,n as Ae,p as Te,d as ce,K as ee,t as J,B as Z,v as Q,z as Xe,l as de,k as Qe,b as Je,E as Ze,W as et}from"./index-5AaNNafz.js";import{C as tt}from"./checkbox-5y5TSI8u.js";import{I as ne}from"./input-BAz505sI.js";import{d as st,S as it,a as nt,b as lt,c as ot}from"./select-DMOL9nTa.js";import{S as H}from"./skeleton-C1g3sLzc.js";import{i as ze,b as Re,c as rt,a as at,s as ct}from"./Settings02-Bs74lw7T.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-iIXzQIf6.js";import{i as ft}from"./Key01-_0kmrESm.js";import{i as Pe}from"./SearchMd-CP9WApAb.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-CaFOP2gL.js";import{S as ge,b as gt}from"./chat-context-COllONR2.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-EVfMwGgl.js";import{i as bt}from"./AlertCircle-BWfyWgiw.js";import{D as Le,e as yt,d as jt,c as St,a as Nt,b as kt}from"./dialog-RRPWwqaQ.js";import{u as ue}from"./studio-tools-CK3O9apC.js";import{i as wt}from"./ChevronRight-SxNLyRA0.js";import{A as _t}from"./avatar-b6IKYKQs.js";import{S as ve,a as be,b as $e}from"./settings-section-knuBYiSB.js";import{s as Fe}from"./Eye-Jd91Hda4.js";import{u as Ct,C as It}from"./connect-desktop-dialog-uu1uNLI_.js";import{t as ye}from"./ChevronDown-CJGVvA9G.js";import{t as Et}from"./Stars01-DKD-uu49.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
1
+ import{r as L,ae as Ye,c as V,j as s,o as Oe,s as re,D as le,m as me,n as Ae,p as Te,d as ce,K as ee,t as J,B as Z,v as Q,z as Xe,l as de,k as Qe,b as Je,E as Ze,W as et}from"./index-wvMNjAV0.js";import{C as tt}from"./checkbox-DZJkrzus.js";import{I as ne}from"./input-CtNQHwPy.js";import{d as st,S as it,a as nt,b as lt,c as ot}from"./select-DF6YoK_r.js";import{S as H}from"./skeleton-CEKyj6Ku.js";import{i as ze,b as Re,c as rt,a as at,s as ct}from"./Settings02-C4te5XIh.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-TTGB3OaR.js";import{i as ft}from"./Key01-BXrc6Emy.js";import{i as Pe}from"./SearchMd-CxCfJ-k7.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-BJKmj4My.js";import{S as ge,b as gt}from"./chat-context-Cemyx-UZ.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-BJSW7YEH.js";import{i as bt}from"./AlertCircle-CS_9RDbg.js";import{D as Le,e as yt,d as jt,c as St,a as Nt,b as kt}from"./dialog-CEOLT1ZZ.js";import{u as ue}from"./studio-tools-CEhEjTYq.js";import{i as wt}from"./ChevronRight-CcT_Yai8.js";import{A as _t}from"./avatar-B8x-LJ3L.js";import{S as ve,a as be,b as $e}from"./settings-section-CngINngb.js";import{s as Fe}from"./Eye-_b_nmYda.js";import{u as Ct,C as It}from"./connect-desktop-dialog-DnC2R2Wo.js";import{t as ye}from"./ChevronDown-SbVNxwJa.js";import{t as Et}from"./Stars01-CeLaUJek.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function je(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Mt=(i,e)=>Math.abs(i-e)<1.01,Ot=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},Se=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},At=i=>i,Tt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},zt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(Se(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){l({width:u.inlineSize,height:u.blockSize});return}}l(Se(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Ne={passive:!0},ke=typeof window>"u"?!0:"onscrollend"in window,Rt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&ke?()=>{}:Ot(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=d=>()=>{const{horizontal:f,isRtl:p}=i.options;l=f?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(l,d)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,Ne);const u=i.options.useScrollendEvent&&ke;return u&&t.addEventListener("scrollend",c,Ne),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",c)}},Pt=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Lt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class $t{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:At,rangeExtractor:Tt,onChange:()=>{},measureElement:Pt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},u)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,d),p=new Array(a).fill(void 0);for(let m=0;m<d;m++){const b=f[m];b&&(p[b.lane]=m)}for(let m=d;m<t;m++){const b=o(m),g=this.laneAssignments.get(m);let y,j;const _=c==="estimate"||u.has(b);if(g!==void 0&&this.options.lanes>1){y=g;const v=p[y],k=v!==void 0?f[v]:void 0;j=k?k.end+this.options.gap:n+l}else{const v=this.options.lanes===1?f[m-1]:this.getFurthestMeasurement(f,m);j=v?v.end+this.options.gap:n+l,y=v?v.lane:m%this.options.lanes,this.options.lanes>1&&_&&this.laneAssignments.set(m,y)}const N=u.get(b),I=typeof N=="number"?N:this.options.estimateSize(m),E=j+I;f[m]={index:m,start:j,size:I,end:E,key:b,lane:y},p[y]=m}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ft({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return je(n[Ke(0,n.length-1,l=>je(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Mt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ke=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ft({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ke(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(d=>d<t+e);){const d=i[a];c[d.lane]=d.end,a++}const u=Array(n).fill(t+e);for(;r>=0&&u.some(d=>d>=t);){const d=i[r];u[d.lane]=d.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const we=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Kt({useFlushSync:i=!0,...e}){const t=L.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Ye.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=L.useState(()=>new $t(n));return l.setOptions(n),we(()=>l._didMount(),[]),we(()=>l._willUpdate()),l}function Dt(i){return Kt({observeElementRect:zt,observeElementOffset:Rt,scrollToFn:Lt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function _e(i){if(i)return ae.find(e=>e.id===i)}const Ce=4;function oe(i){const e=V.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx($e,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function De(i){const e=V.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Ht),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let u;if(e[3]!==n||e[4]!==t){let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=(x,O)=>{const A=c[x.id]??Number.MAX_SAFE_INTEGER,z=c[O.id]??Number.MAX_SAFE_INTEGER;return A-z},e[6]=N):N=e[6];const I=t.filter(Vt).sort(N);let E;e[7]!==t?(E=t.find(Wt),e[7]=t,e[8]=E):E=e[8];const v=E;let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=ae.find(Bt),e[9]=k):k=e[9];const C=k;let w;e[10]!==n?(w=x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"provider",provider:x})},x.id),e[10]=n,e[11]=w):w=e[11];let h,S;e[12]!==n||e[13]!==v?(h=v&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:C})},C.id)]:[],S=v?[...ae.filter(Ut).map(x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:x})},x.id)),s.jsx(oe,{logo:v.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:v,preset:null})},"custom")]:[],e[12]=n,e[13]=v,e[14]=h,e[15]=S):(h=e[14],S=e[15]),u=[...I.map(w),...h,...S],e[3]=n,e[4]=t,e[5]=u}else u=e[5];const d=u,f=d.length-Ce,p=!!l&&f>0;let m;e[16]!==d||e[17]!==p?(m=p?d.slice(0,Ce):d,e[16]=d,e[17]=p,e[18]=m):m=e[18];const b=m;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ve,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(be,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let y;e[22]!==f||e[23]!==l||e[24]!==p?(y=p&&s.jsx($e,{onClick:l,title:`${f} more provider${f===1?"":"s"}`,action:s.jsx(wt,{size:16,className:"text-muted-foreground"})}),e[22]=f,e[23]=l,e[24]=p,e[25]=y):y=e[25];let j;e[26]!==y||e[27]!==b?(j=s.jsx(ve,{children:s.jsxs(be,{children:[b,y]})}),e[26]=y,e[27]=b,e[28]=j):j=e[28];let _;return e[29]!==g||e[30]!==j?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=_):_=e[31],_}function Ut(i){return i.id!=="openai"}function Bt(i){return i.id==="openai"}function Wt(i){return i.id==="openai-compatible"}function Vt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Ht(i){return i.id==="deco"}const qt=Oe({label:re().optional(),apiKey:re().min(1,"API key is required")});function Gt(i){const e=V.c(59),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={resolver:Ae(qt),defaultValues:{label:"",apiKey:""}},e[0]=d):d=e[0];const{register:f,handleSubmit:p,formState:m}=Te(d),{errors:b}=m;let g;e[1]!==t||e[2]!==r?(g=async M=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:M.label||"Personal key",apiKey:M.apiKey})},e[1]=t,e[2]=r,e[3]=g):g=e[3];let y;e[4]!==l||e[5]!==o||e[6]!==a?(y=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Key saved successfully"),l()},e[4]=l,e[5]=o,e[6]=a,e[7]=y):y=e[7];let j;e[8]!==g||e[9]!==y?(j={mutationFn:g,onSuccess:y,onError:Yt},e[8]=g,e[9]=y,e[10]=j):j=e[10];const{mutate:_,isPending:N,error:I}=ce(j);let E;e[11]!==_?(E=M=>_(M),e[11]=_,e[12]=E):E=e[12];let v;e[13]!==p||e[14]!==E?(v=p(E),e[13]=p,e[14]=E,e[15]=v):v=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=k):k=e[16];let C;e[17]!==f?(C=f("label"),e[17]=f,e[18]=C):C=e[18];let w;e[19]!==C?(w=s.jsxs("div",{className:"space-y-1",children:[k,s.jsx(ne,{placeholder:"e.g. Personal key",...C,className:"h-8 text-sm"})]}),e[19]=C,e[20]=w):w=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const S=c?"text":"password";let x;e[22]!==f?(x=f("apiKey"),e[22]=f,e[23]=x):x=e[23];let O;e[24]!==S||e[25]!==x?(O=s.jsx(ne,{type:S,placeholder:"sk-...",...x,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=S,e[25]=x,e[26]=O):O=e[26];let A;e[27]!==c?(A=()=>u(!c),e[27]=c,e[28]=A):A=e[28];let z;e[29]!==c?(z=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[29]=c,e[30]=z):z=e[30];let T;e[31]!==A||e[32]!==z?(T=s.jsx("button",{type:"button",onClick:A,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[31]=A,e[32]=z,e[33]=T):T=e[33];let U;e[34]!==O||e[35]!==T?(U=s.jsxs("div",{className:"relative",children:[O,T]}),e[34]=O,e[35]=T,e[36]=U):U=e[36];let $;e[37]!==b.apiKey?($=b.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[37]=b.apiKey,e[38]=$):$=e[38];let R;e[39]!==U||e[40]!==$?(R=s.jsxs("div",{className:"space-y-1",children:[h,U,$]}),e[39]=U,e[40]=$,e[41]=R):R=e[41];let K;e[42]!==I?(K=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=K):K=e[43];let F;e[44]!==N||e[45]!==n?(F=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:"Cancel"}),e[44]=N,e[45]=n,e[46]=F):F=e[46];const B=N?"Saving...":"Save Key";let D;e[47]!==N||e[48]!==B?(D=s.jsx(Z,{type:"submit",size:"sm",disabled:N,children:B}),e[47]=N,e[48]=B,e[49]=D):D=e[49];let P;e[50]!==F||e[51]!==D?(P=s.jsxs(Le,{children:[F,D]}),e[50]=F,e[51]=D,e[52]=P):P=e[52];let W;return e[53]!==w||e[54]!==R||e[55]!==K||e[56]!==P||e[57]!==v?(W=s.jsxs("form",{onSubmit:v,className:"space-y-3",children:[w,R,K,P]}),e[53]=w,e[54]=R,e[55]=K,e[56]=P,e[57]=v,e[58]=W):W=e[58],W}function Yt(i){J.error(`Failed to save key: ${i.message}`)}const Xt=Oe({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function Qt(i){const e=V.c(70),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=Ae(Xt),e[0]=d):d=e[0];const f=t?.defaultBaseUrl??"";let p;e[1]!==f?(p={resolver:d,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[1]=f,e[2]=p):p=e[2];const{register:m,handleSubmit:b,formState:g}=Te(p),{errors:y}=g;let j;e[3]!==t||e[4]!==r?(j=async se=>{const Ge=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Ge,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let _;e[6]!==l||e[7]!==o||e[8]!==a?(_=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Connection saved successfully"),l()},e[6]=l,e[7]=o,e[8]=a,e[9]=_):_=e[9];let N;e[10]!==j||e[11]!==_?(N={mutationFn:j,onSuccess:_,onError:Jt},e[10]=j,e[11]=_,e[12]=N):N=e[12];const{mutate:I,isPending:E,error:v}=ce(N),k=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",C=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let w;e[13]!==I?(w=se=>I(se),e[13]=I,e[14]=w):w=e[14];let h;e[15]!==b||e[16]!==w?(h=b(w),e[15]=b,e[16]=w,e[17]=h):h=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=S):S=e[18];let x;e[19]!==m?(x=m("label"),e[19]=m,e[20]=x):x=e[20];let O;e[21]!==k||e[22]!==x?(O=s.jsxs("div",{className:"space-y-1",children:[S,s.jsx(ne,{placeholder:k,...x,className:"h-8 text-sm"})]}),e[21]=k,e[22]=x,e[23]=O):O=e[23];let A;e[24]!==C||e[25]!==y||e[26]!==t?.defaultBaseUrl||e[27]!==m?(A=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...m("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:C,...m("baseUrl"),className:"h-8 text-sm"}),y.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:y.baseUrl.message})]}),e[24]=C,e[25]=y,e[26]=t?.defaultBaseUrl,e[27]=m,e[28]=A):A=e[28];const z=t?.apiKeyRecommended?"recommended":"optional";let T;e[29]!==z?(T=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[29]=z,e[30]=T):T=e[30];const U=c?"text":"password";let $;e[31]!==m?($=m("apiKey"),e[31]=m,e[32]=$):$=e[32];let R;e[33]!==U||e[34]!==$?(R=s.jsx(ne,{type:U,placeholder:"sk-...",...$,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=U,e[34]=$,e[35]=R):R=e[35];let K;e[36]!==c?(K=()=>u(!c),e[36]=c,e[37]=K):K=e[37];let F;e[38]!==c?(F=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[38]=c,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F?(B=s.jsx("button",{type:"button",onClick:K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=K,e[41]=F,e[42]=B):B=e[42];let D;e[43]!==R||e[44]!==B?(D=s.jsxs("div",{className:"relative",children:[R,B]}),e[43]=R,e[44]=B,e[45]=D):D=e[45];let P;e[46]!==T||e[47]!==D?(P=s.jsxs("div",{className:"space-y-1",children:[T,D]}),e[46]=T,e[47]=D,e[48]=P):P=e[48];let W;e[49]!==t?(W=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=W):W=e[50];let M;e[51]!==v?(M=v&&s.jsx("p",{className:"text-xs text-destructive",children:v.message}),e[51]=v,e[52]=M):M=e[52];let q;e[53]!==E||e[54]!==n?(q=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:E,children:"Cancel"}),e[53]=E,e[54]=n,e[55]=q):q=e[55];const X=E?"Saving...":"Save Connection";let Y;e[56]!==E||e[57]!==X?(Y=s.jsx(Z,{type:"submit",size:"sm",disabled:E,children:X}),e[56]=E,e[57]=X,e[58]=Y):Y=e[58];let G;e[59]!==q||e[60]!==Y?(G=s.jsxs(Le,{children:[q,Y]}),e[59]=q,e[60]=Y,e[61]=G):G=e[61];let te;return e[62]!==O||e[63]!==A||e[64]!==P||e[65]!==W||e[66]!==M||e[67]!==G||e[68]!==h?(te=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,A,P,W,M,G]}),e[62]=O,e[63]=A,e[64]=P,e[65]=W,e[66]=M,e[67]=G,e[68]=h,e[69]=te):te=e[69],te}function Jt(i){J.error(`Failed to save connection: ${i.message}`)}const Zt={kind:"closed"};function es(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ts(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ss({open:i,onOpenChange:e,initialProvider:t}){const l=he()?.providers??[],{org:o}=le(),r=ue(),a=me(),[c,u]=L.useReducer(es,Zt),d=L.useRef(!1);L.useEffect(()=>{i&&c.kind==="closed"?u({type:"open"}):!i&&c.kind!=="closed"&&u({type:"close"})},[i,c.kind]);const f=()=>{d.current=!1,u({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)})},{mutate:m}=ce({mutationFn:async({providerId:h,code:S,stateToken:x,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:S,stateToken:x,label:O}),h),onSuccess:h=>{Q("ai_provider_oauth_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_oauth_failed",{provider_id:S.providerId,error:h.message}),J.error(`OAuth connection failed: ${h.message}`),u({type:"oauth-failed"})}}),{mutate:b}=ce({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{Q("ai_provider_provision_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_provision_failed",{provider_id:S,error:h.message}),u({type:"provision-error",error:h.message})}}),g=async h=>{const{provider:S}=h,x=h.kind==="openai-compatible"?h.preset?.id??null:null,O=S.supportedMethods.includes("oauth-pkce"),A=S.supportedMethods.includes("api-key");if(S.supportsProvision===!0){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"provision"}),u({type:"select-provision",providerId:S.id}),b(S.id);return}if(O){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"oauth-pkce"});try{const T=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:S.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!T?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");u({type:"select-oauth",providerId:S.id,stateToken:T.stateToken}),window.open(T.url,"AiProviderOAuth","width=600,height=700")}catch(T){J.error(`Failed to start OAuth: ${T instanceof Error?T.message:String(T)}`)}return}A&&(Q("ai_provider_connect_clicked",{provider_id:S.id,...x!==null?{preset_id:x}:{},method:"api-key"}),u({type:"select-form",providerId:S.id,presetId:x}))},y=L.useRef(g);y.current=g;const j=L.useRef(t);j.current=t,L.useEffect(()=>{!j.current||c.kind!=="grid"||d.current||(d.current=!0,y.current(j.current))},[c.kind]);const _=c.kind==="oauth-pending"?c.stateToken:null,N=c.kind==="oauth-pending"?c.providerId:null;L.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const S=c.stateToken,x=c.providerId,O=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:T,stateToken:U}=z.data;if(U!==S){J.error("Security check failed: State token mismatch"),u({type:"oauth-failed"});return}h=!0;const $=l.find(R=>R.id===x);m({providerId:x,code:T,stateToken:S,label:$?.name??x})};window.addEventListener("message",O);const A=setTimeout(()=>{h||(Q("ai_provider_oauth_timeout",{provider_id:x}),u({type:"oauth-failed"}),J.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(A)}},[c.kind,_,N,m]);const I=ts(c),E=I?l.find(h=>h.id===I):null,k=(c.kind==="form"&&c.presetId?ae.find(h=>h.id===c.presetId):null)?.name??E?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",w=()=>{t?f():u({type:"back"})};return s.jsx(yt,{open:c.kind!=="closed",onOpenChange:h=>!h&&f(),children:s.jsxs(jt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(St,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:w,children:s.jsx(Re,{size:16})}),s.jsx(Nt,{children:k})]}),c.kind==="grid"&&!t&&s.jsx(kt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(De,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(Qt,{preset:c.presetId?ae.find(h=>h.id===c.presetId):void 0,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}}):s.jsx(Gt,{providerId:c.providerId,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(bt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{variant:"outline",size:"sm",onClick:()=>u({type:"back"}),children:"Back"}),s.jsx(Z,{size:"sm",onClick:()=>{u({type:"retry-provision"}),b(c.providerId)},children:"Retry"})]})]})]})})}function is(){const i=V.c(7),{org:e}=le(),t=ue();let n;i[0]!==e.id?(n=ee.defaultBrand(e.id),i[0]=e.id,i[1]=n):n=i[1];let l;i[2]!==t?(l=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(ns)??null},i[2]=t,i[3]=l):l=i[3];let o;i[4]!==n||i[5]!==l?(o={queryKey:n,queryFn:l},i[4]=n,i[5]=l,i[6]=o):o=i[6];const{data:r}=Qe(o);return r??null}function ns(i){return i.isDefault&&!i.archivedAt}function ls(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function os(i){const e=V.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Xe(),a=is(),c=Ct(),[u,d]=L.useState(null),[f,p]=L.useState(!1),[m,b]=L.useState(!1),g=he();let y;e[2]!==g?.providers?(y=g?.providers??[],e[2]=g?.providers,e[3]=y):y=e[3];const j=y,_=o.name;let N;e[4]!==a?(N=a?ls(a):null,e[4]=a,e[5]=N):N=e[5];const I=N,E=a?.favicon??a?.logo??null,v=n??(_?`${_} is ready for agents`:"Your agents are almost ready"),k=l??(r?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(E||I);let w;e[6]!==I?(w=I?{backgroundColor:`${I}18`,borderColor:`${I}30`}:void 0,e[6]=I,e[7]=w):w=e[7];const h=w,S=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let x;e[8]!==S||e[9]!==h||e[10]!==E||e[11]!==c||e[12]!==I?(x=E?s.jsx("div",{className:S,style:h,children:s.jsx("img",{src:E,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>b(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:de(S,"cursor-pointer transition-colors hover:bg-accent"),style:h,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(vt,{size:24,style:I?{color:I}:void 0,className:de(!I&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=S,e[9]=h,e[10]=E,e[11]=c,e[12]=I,e[13]=x):x=e[13];let O;e[14]!==v?(O=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:v}),e[14]=v,e[15]=O):O=e[15];let A;e[16]!==k?(A=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:k}),e[16]=k,e[17]=A):A=e[17];let z;e[18]!==O||e[19]!==A?(z=s.jsxs("div",{className:"space-y-2",children:[O,A]}),e[18]=O,e[19]=A,e[20]=z):z=e[20];let T;e[21]!==x||e[22]!==z?(T=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[x,z]}),e[21]=x,e[22]=z,e[23]=T):T=e[23];let U,$;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=M=>d(M),$=()=>p(!0),e[24]=U,e[25]=$):(U=e[24],$=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(De,{providers:j,onSelect:U,onShowAll:$})}),e[26]=j,e[27]=R):R=e[27];const K=u!==null||f;let F;e[28]===Symbol.for("react.memo_cache_sentinel")?(F=M=>{M||(d(null),p(!1))},e[28]=F):F=e[28];const B=u??void 0;let D;e[29]!==K||e[30]!==B?(D=s.jsx(ss,{open:K,onOpenChange:F,initialProvider:B}),e[29]=K,e[30]=B,e[31]=D):D=e[31];let P;e[32]!==m?(P=s.jsx(It,{open:m,onOpenChange:b}),e[32]=m,e[33]=P):P=e[33];let W;return e[34]!==R||e[35]!==D||e[36]!==P||e[37]!==T?(W=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[T,R,D,P]}),e[34]=R,e[35]=D,e[36]=P,e[37]=T,e[38]=W):W=e[38],W}function pe(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function rs(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const as=["bg-destructive","bg-warning","bg-success","bg-success"],cs=["text-success","text-warning","text-warning","text-destructive"];function ds(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function us(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ms={text:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(rt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(dt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(Pe,{className:"size-3.5"}),label:"Web search"}};function hs(i){const e=V.c(5),{capability:t}=i;let n;e[0]!==t?(n=ms[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function fs(i){const e=V.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let v;return e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=v):v=e[0],v}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=pe(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:u}=a;if(l){let v;e[3]!==t.limits?(v=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=v):v=e[4];let k;e[5]!==o?(k=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=k):k=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let w;e[9]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=w):w=e[10];let h;return e[11]!==v||e[12]!==k||e[13]!==C||e[14]!==w?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[v,k,C,w]}),e[11]=v,e[12]=k,e[13]=C,e[14]=w,e[15]=h):h=e[15],h}let d;e[16]!==c?(d=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=d):d=e[17];let f;e[18]!==t.logo||e[19]!==t.title?(f=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=f):f=e[20];let p;e[21]!==u?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:u}),e[21]=u,e[22]=p):p=e[22];let m;e[23]!==f||e[24]!==p?(m=s.jsxs("div",{className:"flex items-center gap-2.5",children:[f,p]}),e[23]=f,e[24]=p,e[25]=m):m=e[25];let b;e[26]!==t.modelId?(b=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=b):b=e[27];let g;e[28]!==d||e[29]!==m||e[30]!==b?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[d,m,b]}),e[28]=d,e[29]=m,e[30]=b,e[31]=g):g=e[31];let y;e[32]!==t.capabilities?(y=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(ps)}),e[32]=t.capabilities,e[33]=y):y=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:v,label:k,description:C}=rs(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(w=>s.jsx("div",{className:de("w-2 h-2 rounded-full",w<=v?as[v-1]:"bg-muted")},w))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let _;e[36]!==t.limits?(_=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ds(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=_):_=e[37];let N;e[38]!==o||e[39]!==r?(N=(o!=null||r!=null)&&(()=>{const{level:v,label:k}=o!=null?us(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:de("text-sm font-bold leading-none",C<=v?cs[v-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=N):N=e[40];let I;e[41]!==j||e[42]!==_||e[43]!==N?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,N]}),e[41]=j,e[42]=_,e[43]=N,e[44]=I):I=e[44];let E;return e[45]!==I||e[46]!==g||e[47]!==y?(E=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,y,I]}),e[45]=I,e[46]=g,e[47]=y,e[48]=E):E=e[48],E}function ps(i){return s.jsx(hs,{capability:i},i)}function ai(i){const e=V.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(H,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(H,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=y):y=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,y]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=pe(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let u;e[8]!==t?(u=fe(t),e[8]=t,e[9]=u):u=e[9];const d=u;let f;e[10]!==t.title||e[11]!==d?(f=s.jsx("img",{src:d,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=d,e[12]=f):f=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=m):m=e[15];let b;return e[16]!==f||e[17]!==p?(b=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[f,p,m]}),e[16]=f,e[17]=p,e[18]=b):b=e[18],b}const xs=["vision","image","file","audio","video"],Ue=["image/png","image/jpeg","image/gif","image/webp"],Be=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function xe(i){const e=i?.capabilities;return e?xs.some(t=>e.includes(t)):!1}function ci(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&Ue.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||xe(e)&&Be.includes(i))}function di(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ue),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),xe(i)&&t.push(...Be),t.join(",")}function ui(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),xe(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const We=["smarter","faster","cheaper"],Ve={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},gs=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],vs=gs.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),bs="google/gemini-2.5-pro",Ie=new Map;function ys(i){const e=Ie.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:n,prefix:l}of vs)if(i.startsWith(l)){if(l===bs&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue}t=n;break}return Ie.set(i,t),t}function Ee(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=ys(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const He="mesh:model-shortlist:",js=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Ss(i){try{const e=localStorage.getItem(He+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ns(i,e){localStorage.setItem(He+i,JSON.stringify([...e]))}function ks(i){const e=V.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=pe(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=fe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let u;e[4]!==t||e[5]!==n?(u=()=>n(t),e[4]=t,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==t.title||e[8]!==c?(d=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=d):d=e[9];let f;e[10]!==o?(f=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=f):f=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let m;e[14]!==f||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,p]}),e[14]=f,e[15]=p,e[16]=m):m=e[16];let b;return e[17]!==u||e[18]!==d||e[19]!==m?(b=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[d,m]}),e[17]=u,e[18]=d,e[19]=m,e[20]=b):b=e[20],b}function ws(i){const e=V.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(et,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ct,{className:"size-3.5"}),e[4]=c):c=e[4];let u;e[5]!==n?(u=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(Z,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==u?(d=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,u]}),e[7]=a,e[8]=u,e[9]=d):d=e[9],d}function _s(){const i=V.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Cs)}),i[0]=e):e=i[0],e}function Cs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Me(i){const e=V.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let u;e[6]!==o||e[7]!==l?(u=d=>s.jsx("div",{onClick:()=>l(d),className:"cursor-pointer",children:s.jsx(ks,{model:d,onHover:o})},d.modelId),e[6]=o,e[7]=l,e[8]=u):u=e[8],a=n.map(u),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Is(i){const e=V.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=L.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=fe(t),e[0]=t,e[1]=c):c=e[1];const u=c;let d;e[2]!==t||e[3]!==o?(d=()=>o(t),e[2]=t,e[3]=o,e[4]=d):d=e[4];let f;e[5]!==t.modelId||e[6]!==l?(f=()=>{a(Es),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=f):f=e[7];let p;e[8]!==r||e[9]!==f?(p=s.jsx(tt,{checked:r,onCheckedChange:f}),e[8]=r,e[9]=f,e[10]=p):p=e[10];let m;e[11]!==u||e[12]!==t.title?(m=s.jsx("img",{src:u,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=u,e[12]=t.title,e[13]=m):m=e[13];let b;e[14]!==t.title?(b=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=b):b=e[15];let g;return e[16]!==d||e[17]!==p||e[18]!==m||e[19]!==b?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[p,m,b]}),e[16]=d,e[17]=p,e[18]=m,e[19]=b,e[20]=g):g=e[20],g}function Es(i){return!i}function Ms(i){const e=[];for(const t of We)if(i[t].length>0){e.push({type:"header",label:Ve[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Os({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=L.useRef(null),o=Dt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Is,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function As(i){const e=V.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:u}=xt(t),d=c?u.filter(c):u.filter(Ts);let f;e[0]!==t?(f=()=>(t?Ss(t):null)??js,e[0]=t,e[1]=f):f=e[1];const[p,m]=L.useState(f),[,b]=L.useTransition();let g;e[2]!==t||e[3]!==b?(g=h=>{t&&b(()=>{m(S=>{const x=new Set(S);return x.has(h)?x.delete(h):x.add(h),Ns(t,x),x})})},e[2]=t,e[3]=b,e[4]=g):g=e[4];const y=g,j=n.toLowerCase().trim(),_=h=>j?h.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):h;if(r){const h=Ee(_(d)),S=Ms(h);let x;e[5]!==p?(x=T=>p.has(T.modelId),e[5]=p,e[6]=x):x=e[6];const O=d.filter(x).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Re,{size:14}),e[7]=A):A=e[7];let z;return e[8]!==a?(z=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,"Back"]}),e[8]=a,e[9]=z):z=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Os,{items:S,shortlistSet:p,onToggle:y,onHover:l})]})}let N;e[10]!==p?(N=h=>p.has(h.modelId),e[10]=p,e[11]=N):N=e[11];const I=d.filter(N),E=I.length>0?I:d,v=Ee(_(E));let k;e[12]!==v||e[13]!==l||e[14]!==o?(k=We.map(h=>s.jsx(Me,{label:Ve[h],models:v[h],onSelect:o,onHover:l},h)),e[12]=v,e[13]=l,e[14]=o,e[15]=k):k=e[15];let C;e[16]!==v.other||e[17]!==l||e[18]!==o?(C=s.jsx(Me,{label:"Other",models:v.other,onSelect:o,onHover:l}),e[16]=v.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let w;return e[20]!==k||e[21]!==C?(w=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,C]}),e[20]=k,e[21]=C,e[22]=w):w=e[22],w}function Ts(i){return i.asyncResearch!==!0}function mi(){const i=V.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(H,{className:"size-4 shrink-0"}),s.jsx(H,{className:"flex-1 h-6"}),s.jsx(H,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(zs)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(H,{className:"size-6 shrink-0"}),s.jsx(H,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{className:"h-6 w-20 rounded-md"}),s.jsx(H,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(H,{className:"h-4 w-24"}),s.jsx(H,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(H,{className:"h-4 w-16"}),s.jsx(H,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function zs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function qe(i){const e=V.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,u]=L.useState(null),[d,f]=L.useState(""),[p,m]=L.useState(!1),b=L.useRef(null),g=he(),y=pt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ls)),e[0]=g?.providers,e[1]=j):j=e[1];const _=j,N=Je(),{org:I}=le();let E;e[2]!==l?(E=M=>{l(M),u(null)},e[2]=l,e[3]=E):E=e[3];const v=E;let k;e[4]!==n||e[5]!==t||e[6]!==r?(k=M=>{n&&(r(M),f(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=k):k=e[7];const C=k;if(y.length===0){let M;return e[8]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(os,{})}),e[8]=M):M=e[8],M}let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=w):w=e[9];const h=p?"Search all models...":"Search for a model...";let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=M=>f(M.target.value),e[10]=S):S=e[10];let x;e[11]!==d||e[12]!==h?(x=s.jsx(ne,{ref:b,type:"text",placeholder:h,value:d,onChange:S,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=d,e[12]=h,e[13]=x):x=e[13];let O;e[14]!==n||e[15]!==v||e[16]!==y||e[17]!==_?(O=y.length>0&&s.jsxs(st,{value:n??"",onValueChange:v,children:[s.jsxs(it,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ps,children:[s.jsx(nt,{placeholder:"Key",children:(()=>{const M=y.find(te=>te.id===n),q=M?_[M.providerId]:void 0,X=_e(M?.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Y?s.jsx("img",{src:Y,alt:G,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(ht,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(lt,{children:y.map(M=>{const q=_[M.providerId],X=_e(M.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M.providerId;return s.jsx(ot,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Y?s.jsx("img",{src:Y,alt:G,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",M.label]})]})},M.id)})})]}),e[14]=n,e[15]=v,e[16]=y,e[17]=_,e[18]=O):O=e[18];let A;e[19]!==x||e[20]!==O?(A=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[w,x,O]})}),e[19]=x,e[20]=O,e[21]=A):A=e[21];let z;e[22]!==n?(z=M=>{const{error:q,resetError:X}=M;return s.jsx(ws,{error:q,onRetry:X,credentialId:n??void 0})},e[22]=n,e[23]=z):z=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(_s,{}),e[24]=T):T=e[24];const U=n??void 0;let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=()=>m(Rs),e[25]=$):$=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==p||e[29]!==d||e[30]!==U?(R=s.jsx(L.Suspense,{fallback:T,children:s.jsx(As,{keyId:U,searchTerm:d,onHover:u,onModelSelect:C,managing:p,onToggleManage:$,filterModels:a})}),e[26]=a,e[27]=C,e[28]=p,e[29]=d,e[30]=U,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==z||e[34]!==R?(K=s.jsx(Ze,{fallback:z,children:R},n),e[32]=n,e[33]=z,e[34]=R,e[35]=K):K=e[35];let F;e[36]!==p||e[37]!==N||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>L.startTransition(()=>m(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(at,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>N({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(ft,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=N,e[38]=I,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F||e[42]!==A?(B=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[A,K,F]}),e[40]=K,e[41]=F,e[42]=A,e[43]=B):B=e[43];const D=c??o??null;let P;e[44]!==D?(P=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(fs,{model:D})}),e[44]=D,e[45]=P):P=e[45];let W;return e[46]!==B||e[47]!==P?(W=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[B,P]}),e[46]=B,e[47]=P,e[48]=W):W=e[48],W}function Rs(i){return!i}function Ps(i){return i.stopPropagation()}function Ls(i){return[i.id,i]}function $s(i){const e=V.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=gt();let a;e[0]!==l?(a=d=>{Q("chat_credential_changed",{credential_id:d}),l(d)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=d=>{n&&(Q("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:d.modelId,to_model_provider:d.providerId??null,credential_id:n}),r({...d,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let u;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(u=s.jsx(qe,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=u):u=e[11],u}function hi(i){const e=V.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx($s,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function fi(i){const e=V.c(2);let t;return e[0]!==i?(t=s.jsx(qe,{...i}),e[0]=i,e[1]=t):t=e[1],t}export{ss as C,fi as D,mi as M,os as N,ae as O,De as P,ai as S,di as a,hi as b,ui as g,ci as i,xe as m};
@@ -1 +1 @@
1
- import"./index-5AaNNafz.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
1
+ import"./index-wvMNjAV0.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
@@ -1 +1 @@
1
- import{c as n,j as i,cw as u,l as c,bN as m,dk as x,dl as j,cx as N,cy as b,dm as g,dn as D}from"./index-5AaNNafz.js";import{i as h}from"./X-DY9hR308.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,E as a,O as b,R as c,T as d,k as e,z as f,v as g,y as h,w as i};
1
+ import{c as n,j as i,cw as u,l as c,bN as m,dk as x,dl as j,cx as N,cy as b,dm as g,dn as D}from"./index-wvMNjAV0.js";import{i as h}from"./X-qcmmBu7s.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,E as a,O as b,R as c,T as d,k as e,z as f,v as g,y as h,w as i};
@@ -1 +1 @@
1
- import{c as X,D as H,m as U,r as W,K as J,k as ee,d as Z,v as te,t as p,j as i,B as $}from"./index-5AaNNafz.js";import{u as ie}from"./studio-tools-CK3O9apC.js";import{b as se,S as ne,a as oe}from"./settings-section-knuBYiSB.js";import{B as Q}from"./badge-DGFEVFje.js";import{I as ae}from"./input-BAz505sI.js";import{d as re,S as le,a as ce,b as de,c as me}from"./select-DMOL9nTa.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let v;e[10]!==s?(v=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=v):v=e[11];let N;e[12]!==n||e[13]!==t.id?(N=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=N):N=e[14];let P;e[15]!==v||e[16]!==N?(P={mutationFn:v,onSuccess:N,onError:je},e[15]=v,e[16]=N,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let D;e[27]!==n?(D=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=D):D=e[28];let V;e[29]!==_||e[30]!==D?(V={mutationFn:_,onSuccess:D,onError:he},e[29]=_,e[30]=D,e[31]=V):V=e[31];const A=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==A){let o;e[46]!==E||e[47]!==F||e[48]!==A?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>A.mutate(a.id),disabled:A.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(ve,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=A,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=A,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let k;e[59]!==T||e[60]!==C||e[61]!==L?(k=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=k):k=e[62];let w;e[63]!==M||e[64]!==k?(w=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,k]}),e[63]=M,e[64]=k,e[65]=w):w=e[65];let G;return e[66]!==O||e[67]!==w?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,w]})}),e[66]=O,e[67]=w,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function ve(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=Ne;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function Ne(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,D as H,m as U,r as W,K as J,k as ee,d as Z,v as te,t as p,j as i,B as $}from"./index-wvMNjAV0.js";import{u as ie}from"./studio-tools-CEhEjTYq.js";import{b as se,S as ne,a as oe}from"./settings-section-CngINngb.js";import{B as Q}from"./badge-Du0UNTzb.js";import{I as ae}from"./input-CtNQHwPy.js";import{d as re,S as le,a as ce,b as de,c as me}from"./select-DF6YoK_r.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let v;e[10]!==s?(v=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=v):v=e[11];let N;e[12]!==n||e[13]!==t.id?(N=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=N):N=e[14];let P;e[15]!==v||e[16]!==N?(P={mutationFn:v,onSuccess:N,onError:je},e[15]=v,e[16]=N,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let D;e[27]!==n?(D=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=D):D=e[28];let V;e[29]!==_||e[30]!==D?(V={mutationFn:_,onSuccess:D,onError:he},e[29]=_,e[30]=D,e[31]=V):V=e[31];const A=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==A){let o;e[46]!==E||e[47]!==F||e[48]!==A?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>A.mutate(a.id),disabled:A.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(ve,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=A,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=A,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let k;e[59]!==T||e[60]!==C||e[61]!==L?(k=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=k):k=e[62];let w;e[63]!==M||e[64]!==k?(w=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,k]}),e[63]=M,e[64]=k,e[65]=w):w=e[65];let G;return e[66]!==O||e[67]!==w?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,w]})}),e[66]=O,e[67]=w,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function ve(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=Ne;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function Ne(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -1 +1 @@
1
- import{c as d,j as s,co as i,l as c}from"./index-5AaNNafz.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{c as d,j as s,co as i,l as c}from"./index-wvMNjAV0.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{c,j as i,dH as f,dI as m,l as u,dJ as g,dK as x,dL as v,dM as b,dN as h,dO as w,dP as j,dQ as N,dR as z,dS as _,dT as y,dU as p}from"./index-5AaNNafz.js";import{i as $}from"./Check-B2t3_u8j.js";import{i as D}from"./ChevronRight-SxNLyRA0.js";import{i as M}from"./Circle-CmWJQsR2.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function H(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function J(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function K(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{L as D,C as a,T as b,O as c,J as d,K as e,Q as f,U as g,H as h,P as i,G as j,E as k};
1
+ import{c,j as i,dH as f,dI as m,l as u,dJ as g,dK as x,dL as v,dM as b,dN as h,dO as w,dP as j,dQ as N,dR as z,dS as _,dT as y,dU as p}from"./index-wvMNjAV0.js";import{i as $}from"./Check-CUUu6fuS.js";import{i as D}from"./ChevronRight-CcT_Yai8.js";import{i as M}from"./Circle-Bk2OeGHv.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function H(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function J(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function K(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{L as D,C as a,T as b,O as c,J as d,K as e,Q as f,U as g,H as h,P as i,G as j,E as k};
@@ -1 +1 @@
1
- import{c as v,l as N,j as t}from"./index-5AaNNafz.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{c as v,l as N,j as t}from"./index-wvMNjAV0.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import"./index-5AaNNafz.js";import{c as O}from"./use-mcp-client-DAdRU1cY.js";import{W as T}from"./constants-C8_Swa4x.js";function x(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function B(e,t){return H(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[e]??e.toUpperCase():null}function Q(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function X(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,X as c,Q as d,Z as e,J as f,U as g,B as i};
1
+ import"./index-wvMNjAV0.js";import{c as O}from"./use-mcp-client-dBNHEL6c.js";import{W as T}from"./constants-C8_Swa4x.js";function x(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function B(e,t){return H(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[e]??e.toUpperCase():null}function Q(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function X(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,X as c,Q as d,Z as e,J as f,U as g,B as i};
@@ -1,2 +1,2 @@
1
- import{c as Z,r as u,j as r,i as se,B as he,dZ as Mt,a4 as Dt,aa as ie,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bL as Tt,e2 as Ot,e3 as qe,a6 as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,m as Bt,t as W,K as $e}from"./index-5AaNNafz.js";import{F as Vt,l as Ut}from"./index-8heN4TLW.js";import{i as qt,aA as Qt,aB as Ht,aC as ue,aD as Xt,Y as _e}from"./agent-icon-K57A0DzY.js";import{a as Jt}from"./Tool01-iIXzQIf6.js";import{s as Yt}from"./XClose-CmiCfuv_.js";import{S as Zt}from"./scroll-area-B7g9A0xO.js";import{T as ze,a as We,b as Ge}from"./tooltip-jwNiafJz.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-BuY0O9iQ.js";import{u as cn}from"./chat-context-COllONR2.js";import{b as dn}from"./shell-layout-BzrEGgvG.js";import{s as fe,a as Ke,f as un}from"./index-FLLcVjP1.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-RRPWwqaQ.js";import{I as Be}from"./input-BAz505sI.js";import{t as vn}from"./ChevronDown-CJGVvA9G.js";import{i as yn}from"./ChevronRight-SxNLyRA0.js";import{a as Cn}from"./ZoomOut-B3kimgA9.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-CZfoQE-0.js";import"./AlertCircle-BWfyWgiw.js";import"./SwitchHorizontal01-a_i15cCW.js";import"./Settings02-Bs74lw7T.js";import"./XCircle-DofnF94J.js";import"./ArrowUpRight-h5-lNOU3.js";import"./ZapSquare-B7pUKk1h.js";import"./Users03-Dnn-6pZq.js";import"./CheckCircle-Cd9sCPj_.js";import"./Check-B2t3_u8j.js";import"./ChevronUp-Cfv8kwOP.js";import"./Circle-CmWJQsR2.js";import"./Stars02-DGriyPK-.js";import"./Loading02-D5Q9o2ML.js";import"./Copy01-C_1mrR9P.js";import"./DotsVertical-DQ-r-KXk.js";import"./Globe01-4bI1LBPk.js";import"./Eye-Jd91Hda4.js";import"./FilterLines-C7Zdp7-q.js";import"./Star01-CC3gyOop.js";import"./Globe04-CPnbhr3e.js";import"./HardDrive-WT4IA8YF.js";import"./Key01-_0kmrESm.js";import"./LayoutLeft-D_5UU_fl.js";import"./LinkExternal01-CYx_LjKe.js";import"./List-5nWMXvgZ.js";import"./Monitor01-EVfMwGgl.js";import"./Sun-DszeKWvN.js";import"./Palette-Cg2Il5Mo.js";import"./Play-C4pBBuTc.js";import"./Plus-Cj9kK9tN.js";import"./SearchLg-JSkDDvk4.js";import"./SearchMd-CP9WApAb.js";import"./Shield01-DMFwBOtF.js";import"./Stars01-DKD-uu49.js";import"./Trash01-D_xTnQtW.js";import"./Upload01-COCQSA6j.js";import"./User01-DBHhpCM7.js";import"./Users01-BymojQtX.js";import"./X-DY9hR308.js";import"./Zap-BwbZR_TW.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhkveYAE.js";import"./file-type-icon-CBM2EyFd.js";import"./use-mobile-CCjACM_-.js";import"./tab-id-CLpu897Q.js";import"./content-blocks-o63cs2vh.js";import"./types-Z9nbiCM2.js";import"./use-mcp-client-DAdRU1cY.js";import"./constants-C8_Swa4x.js";import"./auth-D1xUzxIp.js";import"./hooks-B4JA5-D1.js";import"./decopilot-sse-pool-D8tR3MTD.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-CK3O9apC.js";import"./use-clock-tick-DiuTRa3m.js";import"./sheet-B1hdeTXZ.js";import"./integration-icon-DtLxCtgy.js";import"./use-virtual-mcp-B0Bq3-Jt.js";import"./use-collections-D9VCe-RD.js";import"./use-navigate-to-agent-CMFaBfX6.js";import"./use-connection-BsHhz007.js";import"./use-mcp-prompts-DbP7dBZf.js";import"./form-BylSC3lX.js";import"./label-BALEyZ3d.js";import"./select-DMOL9nTa.js";import"./use-ai-providers-CaFOP2gL.js";import"./use-decopilot-events-89JO9cLA.js";import"./use-organization-settings-DJLfSIHV.js";import"./avatar-b6IKYKQs.js";import"./required-auth-layout-BIsgDBTS.js";import"./use-org-sso-CZi5R7ze.js";import"./library-tab-Ds5fpIQF.js";import"./drawer-DJfZ0VmD.js";import"./collection-search-SaKzAiAF.js";import"./tabs-OKKf4LAY.js";import"./toggle-group-CqoGi-AW.js";import"./agent-capabilities-DRUNyKs6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BsaY572f.js";import"./use-registry-connections-DPtEZCsY.js";import"./useInfiniteQuery-C7fx2naq.js";import"./use-infinite-scroll-Dzaxo4bN.js";import"./extract-connection-data-DI_Hy6px.js";import"./card-dPxA0RCs.js";import"./collection-tabs-CZb_AY94.js";import"./badge-DGFEVFje.js";import"./textarea-BwMDBTqD.js";import"./connection-form-helpers-CHdocTpm.js";import"./authenticate-and-persist-oauth-CbQ04gTK.js";import"./mcp-oauth-CXxRaWx9.js";import"./useSuspenseInfiniteQuery-DpHAMt5e.js";import"./connect-desktop-dialog-uu1uNLI_.js";import"./decopilot-B6qg2Op3.js";import"./checkbox-5y5TSI8u.js";import"./skeleton-C1g3sLzc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-knuBYiSB.js";import"./popover-QpTPPo-c.js";import"./command-DDwBnk4S.js";import"./index-DHu9eqr8.js";import"./dropdown-menu-DDhytuEd.js";import"./question-004-sINsf4GQ.js";import"./task-row-mk4G9x-_.js";import"./task-status-gvDe4NpG.js";import"./use-status-sounds-Du5pinlF.js";import"./empty-state-CtsFp5nF.js";import"./toolbar-Do7hu99P.js";import"./use-mcp-tools-s0H1m2Ok.js";import"./use-capability-BJgOQ1dM.js";import"./tools-list-D7bHk7AU.js";import"./switch-CTqoacsA.js";import"./use-debounced-autosave-CP4G_DMm.js";import"./index-CC3_vx1n.js";import"./sidebar-BZHqZbJ1.js";import"./search-input-Cn-k-Sr0.js";import"./github-repo-picker-J64_EPEa.js";import"./use-debounced-value-qurf1YAB.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-CTWIslZA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-D8xZWaZ4.js";import"./automation-runs-B5QugYRM.js";import"./table-D9O3xZPm.js";import"./use-members-BT2wuks0.js";import"./use-org-auth-client-BSqoqb51.js";import"./use-automations-BYB1tBxg.js";import"./use-file-configs-C37Mzz_w.js";import"./monaco-editor-qr3YxpgD.js";import"./select-model-DJ7qLHls.js";import"./automation-list-row-3xTUT0sz.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(i),C=Pn[a];i!==B&&(U(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=V(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ns({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
1
+ import{c as Z,r as u,j as r,i as se,B as he,dZ as Mt,a4 as Dt,aa as ie,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bL as Tt,e2 as Ot,e3 as qe,a6 as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,m as Bt,t as W,K as $e}from"./index-wvMNjAV0.js";import{F as Vt,l as Ut}from"./index-Cwr5cOYK.js";import{i as qt,aA as Qt,aB as Ht,aC as ue,aD as Xt,Y as _e}from"./agent-icon-CPQk4YwJ.js";import{a as Jt}from"./Tool01-TTGB3OaR.js";import{s as Yt}from"./XClose-aB151tNh.js";import{S as Zt}from"./scroll-area-CbuKwozG.js";import{T as ze,a as We,b as Ge}from"./tooltip-DlUY886I.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-DmHjxQGj.js";import{u as cn}from"./chat-context-Cemyx-UZ.js";import{b as dn}from"./shell-layout-CoG2R-A7.js";import{s as fe,a as Ke,f as un}from"./index-Cs6NaxUB.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-CEOLT1ZZ.js";import{I as Be}from"./input-CtNQHwPy.js";import{t as vn}from"./ChevronDown-SbVNxwJa.js";import{i as yn}from"./ChevronRight-CcT_Yai8.js";import{a as Cn}from"./ZoomOut-TFjut-PL.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-BNz3lima.js";import"./AlertCircle-CS_9RDbg.js";import"./SwitchHorizontal01-BmduH4aR.js";import"./Settings02-C4te5XIh.js";import"./XCircle-Bn7fkWKh.js";import"./ArrowUpRight-DvbKSlUB.js";import"./ZapSquare-BWJNUjCu.js";import"./Users03-CbmB3ag4.js";import"./CheckCircle-2nPR7mAJ.js";import"./Check-CUUu6fuS.js";import"./ChevronUp-DvAb8S9K.js";import"./Circle-Bk2OeGHv.js";import"./Stars02-CbNiaecd.js";import"./Loading02-Cc_XPeVS.js";import"./Copy01-DvnmgpBw.js";import"./DotsVertical-BdQp-tpJ.js";import"./Globe01-BWEVPBr8.js";import"./Eye-_b_nmYda.js";import"./FilterLines-Dgm9Ju0X.js";import"./Star01-BMo746nc.js";import"./Globe04-wcXsSWcH.js";import"./HardDrive-CCq9xvHa.js";import"./Key01-BXrc6Emy.js";import"./LayoutLeft-BStzo30s.js";import"./LinkExternal01-BuzymGhb.js";import"./List-BFtSkA22.js";import"./Monitor01-BJSW7YEH.js";import"./Sun-DdZgJrCs.js";import"./Palette-BudWH9og.js";import"./Play-tpQoZZ7-.js";import"./Plus-6nUvzb_a.js";import"./SearchLg-uOXEhZpb.js";import"./SearchMd-CxCfJ-k7.js";import"./Shield01-DL0nLXwm.js";import"./Stars01-CeLaUJek.js";import"./Trash01-D7DoI-Sm.js";import"./Upload01-DK0nNkQH.js";import"./User01-zyFcbX02.js";import"./Users01-DD6y7ZFy.js";import"./X-qcmmBu7s.js";import"./Zap-CKOdamGS.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-I4FalMZb.js";import"./file-type-icon-CxAOgcI2.js";import"./use-mobile-7niVKoti.js";import"./tab-id-CLpu897Q.js";import"./content-blocks-o63cs2vh.js";import"./types-CvzpcJR1.js";import"./use-mcp-client-dBNHEL6c.js";import"./constants-C8_Swa4x.js";import"./auth-D0kIsFu2.js";import"./hooks-DLOVOtDp.js";import"./decopilot-sse-pool-C82Ujbm_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-CEhEjTYq.js";import"./use-clock-tick-BEBincp5.js";import"./sheet-DMc7DeSX.js";import"./integration-icon-DvFXK2MU.js";import"./use-virtual-mcp-Cy-jA6Qm.js";import"./use-collections-CjkVI8cV.js";import"./use-navigate-to-agent-C1tFWD13.js";import"./use-connection-ChjsmWTh.js";import"./use-mcp-prompts-D2VFS_7Z.js";import"./form-DtFQ7vfL.js";import"./label-B8KM3R_q.js";import"./select-DF6YoK_r.js";import"./use-ai-providers-BJKmj4My.js";import"./use-decopilot-events-uhlm9ZSC.js";import"./use-organization-settings-OjpRHnBI.js";import"./avatar-B8x-LJ3L.js";import"./required-auth-layout-CH2SPOr0.js";import"./use-org-sso-CXSE3hAV.js";import"./library-tab-DFX3AeS3.js";import"./drawer-B-rufaJn.js";import"./collection-search-DfgQYgyj.js";import"./tabs-Cf3RVJ3Q.js";import"./toggle-group-Dtf2CWD1.js";import"./agent-capabilities-B_99zpHP.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BoKNDsqu.js";import"./use-registry-connections-BiMSB_yO.js";import"./useInfiniteQuery-CcA0p7if.js";import"./use-infinite-scroll-DI0qAEco.js";import"./extract-connection-data-Db76guDM.js";import"./card-CYX_RwBA.js";import"./collection-tabs-D3XeP_yy.js";import"./badge-Du0UNTzb.js";import"./textarea-CDy5MusJ.js";import"./connection-form-helpers-DgmmJwTY.js";import"./authenticate-and-persist-oauth-DkNbTtTB.js";import"./mcp-oauth-DzrEuQr5.js";import"./useSuspenseInfiniteQuery-DXVqJ8aq.js";import"./connect-desktop-dialog-DnC2R2Wo.js";import"./decopilot-CETHa21a.js";import"./checkbox-DZJkrzus.js";import"./skeleton-CEKyj6Ku.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CngINngb.js";import"./popover-Cvv98a2C.js";import"./command-DN00KTSb.js";import"./index-g1gbVRQq.js";import"./dropdown-menu-CeNfEKAu.js";import"./question-004-sINsf4GQ.js";import"./task-row-BVs0CmAg.js";import"./task-status-VysJG0vN.js";import"./use-status-sounds-BjM7PTwu.js";import"./empty-state-BXO7rHQu.js";import"./toolbar-DeO3vJmm.js";import"./use-mcp-tools-DX5g41Xz.js";import"./use-capability-DgzJJHkU.js";import"./tools-list-Cn_EK2iQ.js";import"./switch-CDv7wzZp.js";import"./use-debounced-autosave-DhGwNW9j.js";import"./index-D5RT2LDt.js";import"./sidebar-yJWB-4vB.js";import"./search-input-BJJrtkoD.js";import"./github-repo-picker-DXC0Oul4.js";import"./use-debounced-value-CLg8LNax.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sNifGUNT.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-C4_ADEJH.js";import"./automation-runs-fA1ChIGW.js";import"./table-_yINUqfn.js";import"./use-members-BeAV3T2H.js";import"./use-org-auth-client-CwSEkcA-.js";import"./use-automations-BFGNyCFk.js";import"./use-file-configs-aZ5m3Qj2.js";import"./monaco-editor-BgI79QTg.js";import"./select-model-nui66-pH.js";import"./automation-list-row-F_XkFIpJ.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(i),C=Pn[a];i!==B&&(U(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=V(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ns({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{ns as FileExplorer};