decocms 2.304.0 → 2.304.2

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 (343) hide show
  1. package/dist/client/assets/{AlertCircle-BeiDn4Fp.js → AlertCircle-9O6VvAfH.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-hulNygQd.js → ArrowNarrowLeft-CG2ODQbf.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-lTwxwkJA.js → ArrowUpRight-C7hCAEbW.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-3TB25Bcb.js → CheckCircle-BbvAf9Bo.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-_b59faTm.js → ChevronDown-DTujp_Ze.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DEybByBs.js → ChevronRight-DmfKIycz.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-B_td_jK6.js → ChevronUp-k_xkdO-G.js} +1 -1
  8. package/dist/client/assets/{Container-d8d36LPk.js → Container-Dwj81gCC.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-9AuPT8gf.js → DotsVertical-BSgCnoHf.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-BMrJcbl6.js → LinkExternal01-DceZ2oEY.js} +1 -1
  11. package/dist/client/assets/{Lock01-C5rgxGgu.js → Lock01-NMXz4ptn.js} +1 -1
  12. package/dist/client/assets/{Palette-DfnmIo6d.js → Palette-dLUnn7-k.js} +1 -1
  13. package/dist/client/assets/{Play-BGW505UY.js → Play-DBJO09gj.js} +1 -1
  14. package/dist/client/assets/{Plus-DlISHBLe.js → Plus-D5DLeNpq.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-Dbq2QLAC.js → RefreshCcw01-B6WkaYVq.js} +1 -1
  16. package/dist/client/assets/{SearchMd-C8WDOhfc.js → SearchMd-CCDT-gCm.js} +1 -1
  17. package/dist/client/assets/{Settings02-BIpL5e3f.js → Settings02-CnaVYpiu.js} +1 -1
  18. package/dist/client/assets/{Shield01-DCoI7_zY.js → Shield01-Bqcf2bTH.js} +1 -1
  19. package/dist/client/assets/{Star01-Chns_B29.js → Star01-SeWnXAup.js} +1 -1
  20. package/dist/client/assets/{Sun-CgSsJ8OX.js → Sun-0NoCfqDs.js} +1 -1
  21. package/dist/client/assets/{Tool01-B8RjIhe4.js → Tool01-CNtQXBy4.js} +1 -1
  22. package/dist/client/assets/{Trash01-CFncShuD.js → Trash01-UTo49HDl.js} +1 -1
  23. package/dist/client/assets/{User01-Bq8r53VC.js → User01-CVlz7odd.js} +1 -1
  24. package/dist/client/assets/{Users03-qD8JWxak.js → Users03-X35A5ADD.js} +1 -1
  25. package/dist/client/assets/{X-BNOerUAB.js → X-CeTLIvc6.js} +1 -1
  26. package/dist/client/assets/{XCircle-B-JS14_e.js → XCircle-DtPL7zg0.js} +1 -1
  27. package/dist/client/assets/{XClose-vOlmnMjZ.js → XClose-C2Cy4nwy.js} +1 -1
  28. package/dist/client/assets/{Zap-BPHOFmqu.js → Zap-D1n1nJno.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-CX9zqrxv.js → ZapSquare-Wt7N_ZY-.js} +1 -1
  30. package/dist/client/assets/{accordion-DIyksd99.js → accordion-DPxobU6V.js} +1 -1
  31. package/dist/client/assets/{agent-icon-CLQAOsUE.js → agent-icon-rfR6G8ak.js} +1 -1
  32. package/dist/client/assets/{agents-list-D0BQglaf.js → agents-list-CSAgVNG9.js} +1 -1
  33. package/dist/client/assets/ai-providers-BWpsfrqy.js +1 -0
  34. package/dist/client/assets/{alert-dialog-BWduFhy-.js → alert-dialog-FP3uTtqS.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-D-v4q1Qx.js → auth-catchall-x57v3jqK.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-DPkrb87t.js → automation-list-row-DG25MDBi.js} +1 -1
  37. package/dist/client/assets/{automations-BCzY9gmM.js → automations-Dvzmj3cQ.js} +1 -1
  38. package/dist/client/assets/{avatar-C6HNjGDg.js → avatar-jxKfgW3P.js} +1 -1
  39. package/dist/client/assets/{badge-CZCn9Wwi.js → badge-DSbZ2xYh.js} +1 -1
  40. package/dist/client/assets/{brand-context-DcqBJ41j.js → brand-context-BnZBvexH.js} +1 -1
  41. package/dist/client/assets/{card-oNblR0HO.js → card-DxIIO9TM.js} +1 -1
  42. package/dist/client/assets/{chat-context-RcvBJBC7.js → chat-context-BFu5v0t2.js} +1 -1
  43. package/dist/client/assets/{checkbox-JSEUVCMB.js → checkbox-BC2-36Db.js} +1 -1
  44. package/dist/client/assets/{collection-detail-C5pV1mWu.js → collection-detail-CD-QyUWU.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-DQSPcJBz.js → collection-display-button-C_CtGElp.js} +1 -1
  46. package/dist/client/assets/{collection-search-CLoorkFj.js → collection-search-C4byKAjw.js} +1 -1
  47. package/dist/client/assets/{collection-search-DGO6_1o7.js → collection-search-D4u3PzGA.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-P7sXgSq0.js → collection-table-wrapper-C_-94CeK.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-6c5Oz0MD.js → collection-tabs-gMfs6Afq.js} +1 -1
  50. package/dist/client/assets/{collections-CcBlrCx6.js → collections-D7GHHPCg.js} +1 -1
  51. package/dist/client/assets/{command-C666DFpg.js → command-rz34Ys0W.js} +1 -1
  52. package/dist/client/assets/{connection-card-DbGlMaON.js → connection-card-B9DKOCXt.js} +1 -1
  53. package/dist/client/assets/{connection-detail-DOFWK_LZ.js → connection-detail-DsF7Nr0a.js} +1 -1
  54. package/dist/client/assets/{connection-form-helpers-S9iwzj4v.js → connection-form-helpers-Dr9CZ_1s.js} +1 -1
  55. package/dist/client/assets/{connections-DZgnlfnc.js → connections-C8H8V7wn.js} +1 -1
  56. package/dist/client/assets/{constants-B22iOAkD.js → constants-DzBa_pVv.js} +1 -1
  57. package/dist/client/assets/{constants-DRQ2x-Dp.js → constants-ZacFr8c8.js} +1 -1
  58. package/dist/client/assets/{dialog-ReVTOuxu.js → dialog-DJXnl186.js} +1 -1
  59. package/dist/client/assets/{domain-settings-_aY4XST2.js → domain-settings-B6gsJfGm.js} +1 -1
  60. package/dist/client/assets/{drawer-BYHJ-8Om.js → drawer-CKRLj2vr.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-y8iKrNsS.js → dropdown-menu-BxJLGp-F.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-BxzD5223.js → dynamic-plugin-layout-EgA1-G6Q.js} +1 -1
  63. package/dist/client/assets/{empty-state-B4rhh1dc.js → empty-state-DP9kvNKh.js} +1 -1
  64. package/dist/client/assets/{empty-state-ByRM_QUo.js → empty-state-VyFb4d0_.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-CbVt8VgN.js → extract-connection-data-DV87vwuC.js} +1 -1
  66. package/dist/client/assets/{features-BMKDqpeL.js → features-CKG88lyc.js} +1 -1
  67. package/dist/client/assets/{form-D8QDPjk9.js → form-Crn7uG02.js} +1 -1
  68. package/dist/client/assets/{general-WpQ82n-X.js → general-DN5VLZqF.js} +1 -1
  69. package/dist/client/assets/{index-D4IWA9IU.js → index-B3pJqV9Y.js} +2 -2
  70. package/dist/client/assets/{index-CgURykwj.js → index-B6JiqoZb.js} +1 -1
  71. package/dist/client/assets/index-B8vmm8Mh.js +1 -0
  72. package/dist/client/assets/{index-U5YmU8lc.js → index-BAGdGx2X.js} +1 -1
  73. package/dist/client/assets/{index-Bpod-O0_.js → index-BQYge0uD.js} +1 -1
  74. package/dist/client/assets/{index-BuLwXk3-.js → index-BUmhrApd.js} +15 -15
  75. package/dist/client/assets/{index-CPmmcxsi.js → index-Bw6Vawnl.js} +1 -1
  76. package/dist/client/assets/{index-BET8kMZe.js → index-C7apxcAd.js} +1 -1
  77. package/dist/client/assets/{index-CTWz6nN8.js → index-CD0IZENy.js} +1 -1
  78. package/dist/client/assets/{index-Bi-e-UKp.js → index-Cg6ppcFr.js} +1 -1
  79. package/dist/client/assets/{index-D9Q6YnJH.js → index-Crppsl-8.js} +1 -1
  80. package/dist/client/assets/{index-CeC26NPv.js → index-DMLydKBU.js} +1 -1
  81. package/dist/client/assets/{index-Cf5saV1q.js → index-DPV7Oao4.js} +1 -1
  82. package/dist/client/assets/{index-DXXI9MyH.js → index-DkUpgHdS.js} +1 -1
  83. package/dist/client/assets/{index-DBj2qw-o.js → index-Dql_sPLp.js} +1 -1
  84. package/dist/client/assets/{index-D8dvMQZl.js → index-vUSuyfsm.js} +1 -1
  85. package/dist/client/assets/{infiniteQueryObserver-ClYEJj89.js → infiniteQueryObserver-FXpIkCb9.js} +1 -1
  86. package/dist/client/assets/{input-DhXllgVP.js → input-DylFJb_s.js} +1 -1
  87. package/dist/client/assets/{integration-icon-CNQIPioy.js → integration-icon-BrsREj94.js} +1 -1
  88. package/dist/client/assets/{label-BDcPRk17.js → label-BMcf8C3G.js} +1 -1
  89. package/dist/client/assets/{layout-DBK70FJ7.js → layout-Dp2Exmc7.js} +1 -1
  90. package/dist/client/assets/{lean-canvas-recruit-modal-Cosr7uB6.js → lean-canvas-recruit-modal-DrBzPrQ5.js} +1 -1
  91. package/dist/client/assets/{login-uRApKgz7.js → login-B4OITSYv.js} +1 -1
  92. package/dist/client/assets/{members-CgYS1Zxe.js → members-CyDwQ7ZL.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-D34bkcWL.js → monaco-editor-CQLG9APn.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-Rw8mxMr8.js → monitoring-stats-row-Mv3iWLF5.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-DLWU7IjL.js → oauth-callback-D86cP5gF.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-5FDIcGBj.js → oauth-callback-ai-provider-B2xTvzHM.js} +1 -1
  97. package/dist/client/assets/{onboarding-jyaCV8uq.js → onboarding-BVoZJerk.js} +1 -1
  98. package/dist/client/assets/{org-layout-DxW3YApR.js → org-layout-DvQadC0N.js} +1 -1
  99. package/dist/client/assets/{org-plugin-layout-B-uqLn5y.js → org-plugin-layout-CZcCVNv6.js} +1 -1
  100. package/dist/client/assets/{pair-CM7Z5dgt.js → pair-D0CyaFmX.js} +1 -1
  101. package/dist/client/assets/{plugin-empty-state-C-o1hhqY.js → plugin-empty-state-BYazHRIg.js} +1 -1
  102. package/dist/client/assets/{plugin-header-BTFD2Tcj.js → plugin-header-BNYKRXC9.js} +1 -1
  103. package/dist/client/assets/{plugin-layout-BiJEtvKW.js → plugin-layout-BWoK3Wuc.js} +1 -1
  104. package/dist/client/assets/{popover-DQq9bf6V.js → popover-CUnDbgJ2.js} +1 -1
  105. package/dist/client/assets/{profile-PICkTEdT.js → profile-CzybNlff.js} +1 -1
  106. package/dist/client/assets/{project-app-view-B1QcPr4W.js → project-app-view-CJwFT9Ix.js} +1 -1
  107. package/dist/client/assets/registry-Dfum406p.js +2 -0
  108. package/dist/client/assets/{registry-layout-DGmSzwah.js → registry-layout-DRAqgrZS.js} +1 -1
  109. package/dist/client/assets/{required-auth-layout-CfAoaltR.js → required-auth-layout-BqWuvVf2.js} +1 -1
  110. package/dist/client/assets/{reset-password-NMO08kVP.js → reset-password-kytluBmt.js} +1 -1
  111. package/dist/client/assets/{roles-CCaqodZQ.js → roles-Ds1RHbZR.js} +1 -1
  112. package/dist/client/assets/{scroll-area-AhoYMTSF.js → scroll-area-3cZxZboM.js} +1 -1
  113. package/dist/client/assets/{search-input-BSmmjMtR.js → search-input-BmVPc4RV.js} +1 -1
  114. package/dist/client/assets/{select-dTphD0ES.js → select-FyLwzc48.js} +1 -1
  115. package/dist/client/assets/{select-model-D2H_jWcd.js → select-model-67avCsXE.js} +1 -1
  116. package/dist/client/assets/{settings-layout-Bn3d6rRU.js → settings-layout-BqPzbZI_.js} +1 -1
  117. package/dist/client/assets/{settings-section-DkPpouMA.js → settings-section-XEp6UNJA.js} +1 -1
  118. package/dist/client/assets/{shell-layout-DLX5f9iI.js → shell-layout-BiL6-6W9.js} +1 -1
  119. package/dist/client/assets/{skeleton-DCMX-VkN.js → skeleton-BWYBZf7m.js} +1 -1
  120. package/dist/client/assets/{sso-BeQadTWm.js → sso-CuSDTfdG.js} +1 -1
  121. package/dist/client/assets/{store-D-lrayyv.js → store-CHGpyb-m.js} +1 -1
  122. package/dist/client/assets/store-registry-BtOOqHJ7.js +2 -0
  123. package/dist/client/assets/{switch-D9uEYoPa.js → switch-BL_ICveF.js} +1 -1
  124. package/dist/client/assets/{table-BIcJswmk.js → table-Cri7VAeb.js} +1 -1
  125. package/dist/client/assets/{tabs-Bbs5xG17.js → tabs-DGNL4gIl.js} +1 -1
  126. package/dist/client/assets/{task-status-1zFON5T4.js → task-status-BsVHYvla.js} +1 -1
  127. package/dist/client/assets/{textarea-BMU9fnHG.js → textarea-B1YgZKSW.js} +1 -1
  128. package/dist/client/assets/{toggle-group-juphd3c4.js → toggle-group-cD20__YI.js} +1 -1
  129. package/dist/client/assets/{tools-list-BP78dRI3.js → tools-list-B1QLvdRl.js} +1 -1
  130. package/dist/client/assets/{tooltip-B5FrLY14.js → tooltip-DZIo6YZX.js} +1 -1
  131. package/dist/client/assets/{types-DmM_J5U9.js → types-PzC3rVhv.js} +1 -1
  132. package/dist/client/assets/{use-ai-providers-CVAGId9e.js → use-ai-providers-Dsmx4U8L.js} +1 -1
  133. package/dist/client/assets/{use-collections-DKWG5Tun.js → use-collections-DcamXjGg.js} +1 -1
  134. package/dist/client/assets/{use-connection-Dy5vq_5j.js → use-connection-CesZaYzK.js} +1 -1
  135. package/dist/client/assets/{use-copy-BSYEct5q.js → use-copy-Chq89Uhn.js} +1 -1
  136. package/dist/client/assets/{use-create-virtual-mcp-ifW0Pllw.js → use-create-virtual-mcp-B0T0urBu.js} +1 -1
  137. package/dist/client/assets/{use-decopilot-events-DVXCv4R8.js → use-decopilot-events-BCUB3DhH.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-CRe3MUPe.js → use-delete-connection-CqpWV7PJ.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-4DQHfv5o.js → use-infinite-scroll-D6FvdXof.js} +1 -1
  140. package/dist/client/assets/{use-list-state-CihFBhY3.js → use-list-state-D_NiaDpI.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-Bog3rGRX.js → use-mcp-tools-oIEGFyCT.js} +1 -1
  142. package/dist/client/assets/{use-members-eWVl2b1I.js → use-members-C3jq0flu.js} +1 -1
  143. package/dist/client/assets/{use-navigate-to-agent--7ajKHhy.js → use-navigate-to-agent-DNFfIi8H.js} +1 -1
  144. package/dist/client/assets/{use-org-auth-client-C-BGwXKo.js → use-org-auth-client-BniQTMze.js} +1 -1
  145. package/dist/client/assets/{use-org-sso-2mlDJ8c4.js → use-org-sso-SjyAvOWA.js} +1 -1
  146. package/dist/client/assets/{use-organization-roles-PByiiFjp.js → use-organization-roles-CLHZHSel.js} +1 -1
  147. package/dist/client/assets/{use-organization-settings-DngIHmBy.js → use-organization-settings-C8pMgrh-.js} +1 -1
  148. package/dist/client/assets/{use-registry-connections-CDM-gpri.js → use-registry-connections-CPKTZHrX.js} +1 -1
  149. package/dist/client/assets/{use-status-sounds-BzXaoVC8.js → use-status-sounds-BYyaVEdO.js} +1 -1
  150. package/dist/client/assets/{use-tasks-M1RmMNT7.js → use-tasks-D-yLjF43.js} +1 -1
  151. package/dist/client/assets/{use-view-mode-DRDlksJe.js → use-view-mode-C06qcP9p.js} +1 -1
  152. package/dist/client/assets/{use-virtual-mcp-CDCK02Yj.js → use-virtual-mcp-CEUQCho1.js} +1 -1
  153. package/dist/client/assets/useInfiniteQuery-ANrroW8x.js +1 -0
  154. package/dist/client/assets/useSuspenseInfiniteQuery-CgFHp-eh.js +1 -0
  155. package/dist/client/assets/{user-WYGHhGxH.js → user-DlFqYjZ6.js} +1 -1
  156. package/dist/client/assets/{view-mode-toggle-CK1VLDTo.js → view-mode-toggle-CiYPbOW7.js} +1 -1
  157. package/dist/client/assets/{workflow-DkcKupEW.js → workflow-CYF9ayPN.js} +1 -1
  158. package/dist/client/assets/workflow-detail-DVsv_zWc.js +1 -0
  159. package/dist/client/index.html +1 -1
  160. package/dist/server/cli.js +387 -387
  161. package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
  162. package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
  163. package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
  164. package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
  165. package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
  166. package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
  167. package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
  168. package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
  169. package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
  170. package/dist/server/node_modules/{slice-ansi → is-unicode-supported}/license +0 -1
  171. package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
  172. package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
  173. package/dist/server/node_modules/pg/README.md +95 -0
  174. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  175. package/dist/server/node_modules/pg/lib/client.js +743 -0
  176. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  177. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  178. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  179. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  180. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  181. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  182. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  183. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  184. package/dist/server/node_modules/pg/lib/index.js +73 -0
  185. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  186. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  187. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  188. package/dist/server/node_modules/pg/lib/query.js +252 -0
  189. package/dist/server/node_modules/pg/lib/result.js +109 -0
  190. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  191. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  192. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  193. package/dist/server/node_modules/pg/package.json +76 -0
  194. package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
  195. package/dist/server/node_modules/restore-cursor/index.js +11 -0
  196. package/dist/server/node_modules/restore-cursor/license +9 -0
  197. package/dist/server/node_modules/restore-cursor/package.json +55 -0
  198. package/dist/server/node_modules/restore-cursor/readme.md +31 -0
  199. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  200. package/dist/server/node_modules/string-width/index.js +82 -0
  201. package/dist/server/node_modules/string-width/license +9 -0
  202. package/dist/server/node_modules/string-width/package.json +64 -0
  203. package/dist/server/node_modules/string-width/readme.md +66 -0
  204. package/dist/server/node_modules/strip-ansi/index.d.ts +15 -0
  205. package/dist/server/node_modules/strip-ansi/index.js +19 -0
  206. package/dist/server/node_modules/strip-ansi/license +9 -0
  207. package/dist/server/node_modules/{ansi-regex → strip-ansi}/package.json +18 -20
  208. package/dist/server/node_modules/strip-ansi/readme.md +37 -0
  209. package/package.json +1 -1
  210. package/dist/client/assets/ai-providers-BnclkXxt.js +0 -1
  211. package/dist/client/assets/index-BB2bR64l.js +0 -1
  212. package/dist/client/assets/registry-Dr9Q687k.js +0 -2
  213. package/dist/client/assets/store-registry-dKQp57q_.js +0 -2
  214. package/dist/client/assets/useInfiniteQuery-DtJBa4_2.js +0 -1
  215. package/dist/client/assets/useSuspenseInfiniteQuery-G-zitmER.js +0 -1
  216. package/dist/client/assets/workflow-detail-BtHvU2Pd.js +0 -1
  217. package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
  218. package/dist/server/node_modules/ansi-regex/index.js +0 -14
  219. package/dist/server/node_modules/ansi-regex/readme.md +0 -66
  220. package/dist/server/node_modules/convert-to-spaces/dist/index.d.ts +0 -2
  221. package/dist/server/node_modules/convert-to-spaces/dist/index.js +0 -4
  222. package/dist/server/node_modules/convert-to-spaces/license +0 -21
  223. package/dist/server/node_modules/convert-to-spaces/package.json +0 -40
  224. package/dist/server/node_modules/convert-to-spaces/readme.md +0 -39
  225. package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  226. package/dist/server/node_modules/emoji-regex/README.md +0 -107
  227. package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
  228. package/dist/server/node_modules/emoji-regex/index.js +0 -4
  229. package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
  230. package/dist/server/node_modules/emoji-regex/package.json +0 -45
  231. package/dist/server/node_modules/pg-cloudflare/README.md +0 -112
  232. package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +0 -2
  233. package/dist/server/node_modules/pg-cloudflare/dist/empty.js +0 -6
  234. package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +0 -1
  235. package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +0 -31
  236. package/dist/server/node_modules/pg-cloudflare/dist/index.js +0 -152
  237. package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +0 -1
  238. package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +0 -3
  239. package/dist/server/node_modules/pg-cloudflare/package.json +0 -39
  240. package/dist/server/node_modules/pg-cloudflare/src/empty.ts +0 -3
  241. package/dist/server/node_modules/pg-cloudflare/src/index.ts +0 -166
  242. package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +0 -25
  243. package/dist/server/node_modules/pg-connection-string/LICENSE +0 -21
  244. package/dist/server/node_modules/pg-connection-string/README.md +0 -105
  245. package/dist/server/node_modules/pg-connection-string/esm/index.mjs +0 -8
  246. package/dist/server/node_modules/pg-connection-string/index.d.ts +0 -36
  247. package/dist/server/node_modules/pg-connection-string/index.js +0 -231
  248. package/dist/server/node_modules/pg-connection-string/package.json +0 -52
  249. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  250. package/dist/server/node_modules/pg-int8/README.md +0 -16
  251. package/dist/server/node_modules/pg-int8/index.js +0 -100
  252. package/dist/server/node_modules/pg-int8/package.json +0 -24
  253. package/dist/server/node_modules/pg-protocol/LICENSE +0 -21
  254. package/dist/server/node_modules/pg-protocol/README.md +0 -3
  255. package/dist/server/node_modules/pg-protocol/dist/b.d.ts +0 -1
  256. package/dist/server/node_modules/pg-protocol/dist/b.js +0 -23
  257. package/dist/server/node_modules/pg-protocol/dist/b.js.map +0 -1
  258. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +0 -15
  259. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +0 -55
  260. package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +0 -1
  261. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +0 -16
  262. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +0 -81
  263. package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +0 -1
  264. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +0 -1
  265. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +0 -530
  266. package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +0 -1
  267. package/dist/server/node_modules/pg-protocol/dist/index.d.ts +0 -6
  268. package/dist/server/node_modules/pg-protocol/dist/index.js +0 -15
  269. package/dist/server/node_modules/pg-protocol/dist/index.js.map +0 -1
  270. package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +0 -162
  271. package/dist/server/node_modules/pg-protocol/dist/messages.js +0 -160
  272. package/dist/server/node_modules/pg-protocol/dist/messages.js.map +0 -1
  273. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +0 -1
  274. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +0 -252
  275. package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +0 -1
  276. package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +0 -24
  277. package/dist/server/node_modules/pg-protocol/dist/parser.js +0 -324
  278. package/dist/server/node_modules/pg-protocol/dist/parser.js.map +0 -1
  279. package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +0 -42
  280. package/dist/server/node_modules/pg-protocol/dist/serializer.js +0 -189
  281. package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +0 -1
  282. package/dist/server/node_modules/pg-protocol/esm/index.js +0 -11
  283. package/dist/server/node_modules/pg-protocol/package.json +0 -45
  284. package/dist/server/node_modules/pg-protocol/src/b.ts +0 -25
  285. package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +0 -58
  286. package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +0 -85
  287. package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +0 -575
  288. package/dist/server/node_modules/pg-protocol/src/index.ts +0 -11
  289. package/dist/server/node_modules/pg-protocol/src/messages.ts +0 -262
  290. package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +0 -276
  291. package/dist/server/node_modules/pg-protocol/src/parser.ts +0 -413
  292. package/dist/server/node_modules/pg-protocol/src/serializer.ts +0 -274
  293. package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +0 -67
  294. package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +0 -166
  295. package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +0 -1
  296. package/dist/server/node_modules/pg-types/.travis.yml +0 -7
  297. package/dist/server/node_modules/pg-types/Makefile +0 -14
  298. package/dist/server/node_modules/pg-types/README.md +0 -75
  299. package/dist/server/node_modules/pg-types/index.d.ts +0 -137
  300. package/dist/server/node_modules/pg-types/index.js +0 -47
  301. package/dist/server/node_modules/pg-types/index.test-d.ts +0 -21
  302. package/dist/server/node_modules/pg-types/lib/arrayParser.js +0 -11
  303. package/dist/server/node_modules/pg-types/lib/binaryParsers.js +0 -257
  304. package/dist/server/node_modules/pg-types/lib/builtins.js +0 -73
  305. package/dist/server/node_modules/pg-types/lib/textParsers.js +0 -215
  306. package/dist/server/node_modules/pg-types/package.json +0 -42
  307. package/dist/server/node_modules/pg-types/test/index.js +0 -24
  308. package/dist/server/node_modules/pg-types/test/types.js +0 -597
  309. package/dist/server/node_modules/pgpass/README.md +0 -74
  310. package/dist/server/node_modules/pgpass/lib/helper.js +0 -233
  311. package/dist/server/node_modules/pgpass/lib/index.js +0 -23
  312. package/dist/server/node_modules/pgpass/package.json +0 -41
  313. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  314. package/dist/server/node_modules/postgres-array/index.js +0 -97
  315. package/dist/server/node_modules/postgres-array/license +0 -21
  316. package/dist/server/node_modules/postgres-array/package.json +0 -35
  317. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  318. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  319. package/dist/server/node_modules/postgres-bytea/license +0 -21
  320. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  321. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  322. package/dist/server/node_modules/postgres-date/index.js +0 -116
  323. package/dist/server/node_modules/postgres-date/license +0 -21
  324. package/dist/server/node_modules/postgres-date/package.json +0 -33
  325. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  326. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  327. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  328. package/dist/server/node_modules/postgres-interval/license +0 -21
  329. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  330. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  331. package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
  332. package/dist/server/node_modules/slice-ansi/index.js +0 -260
  333. package/dist/server/node_modules/slice-ansi/package.json +0 -59
  334. package/dist/server/node_modules/slice-ansi/readme.md +0 -54
  335. package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
  336. package/dist/server/node_modules/split2/LICENSE +0 -13
  337. package/dist/server/node_modules/split2/README.md +0 -85
  338. package/dist/server/node_modules/split2/bench.js +0 -27
  339. package/dist/server/node_modules/split2/index.js +0 -141
  340. package/dist/server/node_modules/split2/package.json +0 -39
  341. package/dist/server/node_modules/split2/test.js +0 -409
  342. /package/dist/server/node_modules/{ansi-regex → get-east-asian-width}/license +0 -0
  343. /package/dist/server/node_modules/{pg-cloudflare → pg}/LICENSE +0 -0
@@ -1,4 +1,4 @@
1
- import{r as R,ao as At,H as se,J as D,aK as Ce,aI as we,a_ as Ie,aJ as Le,e as B,j as l,E as Xe,s as ie,o as be,a as le,K as G,n as Je,c as oe,z as ke,C as Ee,x as Y,D as _e,t as J,B as te,M as Ze,u as Ot,f as Tt,y as Pt}from"./index-D4IWA9IU.js";import{C as Rt}from"./checkbox-JSEUVCMB.js";import{I as ne}from"./input-DhXllgVP.js";import{b as Me,a as Ae,c as et,d as Oe,e as tt,D as st,h as Lt}from"./dialog-ReVTOuxu.js";import{g as zt,D as Ft,a as Dt,b as Kt}from"./drawer-BYHJ-8Om.js";import{u as $t}from"./tooltip-B5FrLY14.js";import{S as Ut,a as Bt,b as Vt,c as Wt,d as qt}from"./select-dTphD0ES.js";import{S as Q}from"./skeleton-DCMX-VkN.js";import{i as Ht,t as Qt,b as Yt,a as Gt,c as Xt}from"./Tool01-B8RjIhe4.js";import{b as lt,s as it,c as Jt,a as Zt,i as es}from"./RefreshCcw01-Dbq2QLAC.js";import{t as ze}from"./ChevronDown-_b59faTm.js";import{a as nt,i as ot}from"./SearchMd-C8WDOhfc.js";import{a as ts}from"./Settings02-BIpL5e3f.js";import{u as he,b as rt,a as ge}from"./use-ai-providers-CVAGId9e.js";import{p as Fe,b as at}from"./chat-context-RcvBJBC7.js";import{g as Te}from"./ai-providers-logos-DD3qZ33J.js";import{i as ss}from"./Zap-BPHOFmqu.js";import{i as ls}from"./AlertCircle-BeiDn4Fp.js";import{i as is}from"./CheckCircle-3TB25Bcb.js";import{s as ns}from"./Trash01-CFncShuD.js";import{P as ye}from"./index-BET8kMZe.js";import{d as os,S as je,a as Se,b as fe}from"./settings-section-DkPpouMA.js";import{S as rs}from"./switch-D9uEYoPa.js";import{a as De,T as as}from"./toggle-group-juphd3c4.js";import{A as ct}from"./avatar-C6HNjGDg.js";import{c as dt,b as mt,d as ut,f as ft,e as ht,g as pt,a as xt,A as gt}from"./alert-dialog-BWduFhy-.js";import{S as re,u as ae}from"./constants-B22iOAkD.js";import{e as cs,f as ds}from"./use-organization-settings-DngIHmBy.js";import{f as ms}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as us}from"./unwrap-tool-result-BYXdCQMg.js";function ue(t,e,s){let i=s.initialDeps??[],n,o=!0;function r(){var a,u,d;let m;s.key&&((a=s.debug)!=null&&a.call(s))&&(m=Date.now());const f=t();if(!(f.length!==i.length||f.some((S,b)=>i[b]!==S)))return n;i=f;let h;if(s.key&&((u=s.debug)!=null&&u.call(s))&&(h=Date.now()),n=e(...f),s.key&&((d=s.debug)!=null&&d.call(s))){const S=Math.round((Date.now()-m)*100)/100,b=Math.round((Date.now()-h)*100)/100,C=b/16,_=(p,j)=>{for(p=String(p);p.length<j;)p=" "+p;return p};console.info(`%c⏱ ${_(b,5)} /${_(S,5)} ms`,`
1
+ import{r as R,ao as At,H as se,J as D,aK as Ce,aI as we,a_ as Ie,aJ as Le,e as B,j as l,E as Xe,s as ie,o as be,a as le,K as G,n as Je,c as oe,z as ke,C as Ee,x as Y,D as _e,t as J,B as te,M as Ze,u as Ot,f as Tt,y as Pt}from"./index-B3pJqV9Y.js";import{C as Rt}from"./checkbox-BC2-36Db.js";import{I as ne}from"./input-DylFJb_s.js";import{b as Me,a as Ae,c as et,d as Oe,e as tt,D as st,h as Lt}from"./dialog-DJXnl186.js";import{g as zt,D as Ft,a as Dt,b as Kt}from"./drawer-CKRLj2vr.js";import{u as $t}from"./tooltip-DZIo6YZX.js";import{S as Ut,a as Bt,b as Vt,c as Wt,d as qt}from"./select-FyLwzc48.js";import{S as Q}from"./skeleton-BWYBZf7m.js";import{i as Ht,t as Qt,b as Yt,a as Gt,c as Xt}from"./Tool01-CNtQXBy4.js";import{b as lt,s as it,c as Jt,a as Zt,i as es}from"./RefreshCcw01-B6WkaYVq.js";import{t as ze}from"./ChevronDown-DTujp_Ze.js";import{a as nt,i as ot}from"./SearchMd-CCDT-gCm.js";import{a as ts}from"./Settings02-CnaVYpiu.js";import{u as he,b as rt,a as ge}from"./use-ai-providers-Dsmx4U8L.js";import{p as Fe,b as at}from"./chat-context-BFu5v0t2.js";import{g as Te}from"./ai-providers-logos-DD3qZ33J.js";import{i as ss}from"./Zap-D1n1nJno.js";import{i as ls}from"./AlertCircle-9O6VvAfH.js";import{i as is}from"./CheckCircle-BbvAf9Bo.js";import{s as ns}from"./Trash01-UTo49HDl.js";import{P as ye}from"./index-C7apxcAd.js";import{d as os,S as je,a as Se,b as fe}from"./settings-section-XEp6UNJA.js";import{S as rs}from"./switch-BL_ICveF.js";import{a as De,T as as}from"./toggle-group-cD20__YI.js";import{A as ct}from"./avatar-jxKfgW3P.js";import{c as dt,b as mt,d as ut,f as ft,e as ht,g as pt,a as xt,A as gt}from"./alert-dialog-FP3uTtqS.js";import{S as re,u as ae}from"./constants-DzBa_pVv.js";import{e as cs,f as ds}from"./use-organization-settings-C8pMgrh-.js";import{f as ms}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as us}from"./unwrap-tool-result-BYXdCQMg.js";function ue(t,e,s){let i=s.initialDeps??[],n,o=!0;function r(){var a,u,d;let m;s.key&&((a=s.debug)!=null&&a.call(s))&&(m=Date.now());const f=t();if(!(f.length!==i.length||f.some((S,b)=>i[b]!==S)))return n;i=f;let h;if(s.key&&((u=s.debug)!=null&&u.call(s))&&(h=Date.now()),n=e(...f),s.key&&((d=s.debug)!=null&&d.call(s))){const S=Math.round((Date.now()-m)*100)/100,b=Math.round((Date.now()-h)*100)/100,C=b/16,_=(p,j)=>{for(p=String(p);p.length<j;)p=" "+p;return p};console.info(`%c⏱ ${_(b,5)} /${_(S,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,s?.key)}return s?.onChange&&!(o&&s.skipInitialOnChange)&&s.onChange(n),o=!1,n}return r.updateDeps=a=>{i=a},r}function Ke(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const fs=(t,e)=>Math.abs(t-e)<1.01,hs=(t,e,s)=>{let i;return function(...n){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,n),s)}},$e=t=>{const{offsetWidth:e,offsetHeight:s}=t;return{width:e,height:s}},ps=t=>t,xs=t=>{const e=Math.max(t.startIndex-t.overscan,0),s=Math.min(t.endIndex+t.overscan,t.count-1),i=[];for(let n=e;n<=s;n++)i.push(n);return i},gs=(t,e)=>{const s=t.scrollElement;if(!s)return;const i=t.targetWindow;if(!i)return;const n=r=>{const{width:a,height:u}=r;e({width:Math.round(a),height:Math.round(u)})};if(n($e(s)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(r=>{const a=()=>{const u=r[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n($e(s))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(s,{box:"border-box"}),()=>{o.unobserve(s)}},Ue={passive:!0},Be=typeof window>"u"?!0:"onscrollend"in window,bs=(t,e)=>{const s=t.scrollElement;if(!s)return;const i=t.targetWindow;if(!i)return;let n=0;const o=t.options.useScrollendEvent&&Be?()=>{}:hs(i,()=>{e(n,!1)},t.options.isScrollingResetDelay),r=m=>()=>{const{horizontal:f,isRtl:c}=t.options;n=f?s.scrollLeft*(c&&-1||1):s.scrollTop,o(),e(n,m)},a=r(!0),u=r(!1);s.addEventListener("scroll",a,Ue);const d=t.options.useScrollendEvent&&Be;return d&&s.addEventListener("scrollend",u,Ue),()=>{s.removeEventListener("scroll",a),d&&s.removeEventListener("scrollend",u)}},vs=(t,e,s)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[s.options.horizontal?"inlineSize":"blockSize"])}return t[s.options.horizontal?"offsetWidth":"offsetHeight"]},ys=(t,{adjustments:e=0,behavior:s},i)=>{var n,o;const r=t+e;(o=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[i.options.horizontal?"left":"top"]:r,behavior:s})};class js{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 s,i,n;return((n=(i=(s=this.targetWindow)==null?void 0:s.performance)==null?void 0:i.now)==null?void 0:n.call(i))??Date.now()},this.observer=(()=>{let s=null;const i=()=>s||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:s=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const a=o.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),s=null},observe:n=>{var o;return(o=i())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=i())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=s=>{Object.entries(s).forEach(([i,n])=>{typeof n>"u"&&delete s[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ps,rangeExtractor:xs,onChange:()=>{},measureElement:vs,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",...s}},this.notify=s=>{var i,n;(n=(i=this.options).onChange)==null||n.call(i,this,s)},this.maybeNotify=ue(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),s=>{this.notify(s)},{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(s=>s()),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 s;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((s=this.scrollElement)==null?void 0:s.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,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=(s,i)=>{const n=new Map,o=new Map;for(let r=i-1;r>=0;r--){const a=s[r];if(n.has(a.lane))continue;const u=o.get(a.lane);if(u==null||a.end>u.end?o.set(a.lane,a):a.end<u.end&&n.set(a.lane,!0),n.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=ue(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(s,i,n,o,r,a,u)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:s,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:u}),{key:!1}),this.getMeasurements=ue(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:s,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:u},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>s)for(const h of this.laneAssignments.keys())h>=s&&this.laneAssignments.delete(h);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(h=>{this.itemSizeCache.set(h.key,h.size)}));const m=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===s&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,m),c=new Array(a).fill(void 0);for(let h=0;h<m;h++){const S=f[h];S&&(c[S.lane]=h)}for(let h=m;h<s;h++){const S=o(h),b=this.laneAssignments.get(h);let C,_;const p=u==="estimate"||d.has(S);if(b!==void 0&&this.options.lanes>1){C=b;const g=c[C],v=g!==void 0?f[g]:void 0;_=v?v.end+this.options.gap:i+n}else{const g=this.options.lanes===1?f[h-1]:this.getFurthestMeasurement(f,h);_=g?g.end+this.options.gap:i+n,C=g?g.lane:h%this.options.lanes,this.options.lanes>1&&p&&this.laneAssignments.set(h,C)}const j=d.get(S),x=typeof j=="number"?j:this.options.estimateSize(h),N=_+x;f[h]={index:h,start:_,size:x,end:N,key:S,lane:C},c[C]=h}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ue(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(s,i,n,o)=>this.range=s.length>0&&i>0?Ss({measurements:s,outerSize:i,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ue(()=>{let s=null,i=null;const n=this.calculateRange();return n&&(s=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,s,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,s,i]},(s,i,n,o,r)=>o===null||r===null?[]:s({startIndex:o,endIndex:r,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=s=>{const i=this.options.indexAttribute,n=s.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=s=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),a=Math.min(this.options.count-1,n+o);return s>=r&&s<=a}return!0},this.measureElement=s=>{if(!s){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const i=this.indexFromElement(s),n=this.options.getItemKey(i),o=this.elementsCache.get(n);o!==s&&(o&&this.observer.unobserve(o),this.observer.observe(s),this.elementsCache.set(n,s)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(s,void 0,this))},this.resizeItem=(s,i)=>{var n;const o=this.measurementsCache[s];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=i-r;a!==0&&(((n=this.scrollState)==null?void 0:n.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,i)),this.notify(!1))},this.getVirtualItems=ue(()=>[this.getVirtualIndexes(),this.getMeasurements()],(s,i)=>{const n=[];for(let o=0,r=s.length;o<r;o++){const a=s[o],u=i[a];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=s=>{const i=this.getMeasurements();if(i.length!==0)return Ke(i[bt(0,i.length-1,n=>Ke(i[n]).start,s)])},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 s=this.scrollElement.document.documentElement;return this.options.horizontal?s.scrollWidth-this.scrollElement.innerWidth:s.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(s,i,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();i==="auto"&&(i=s>=r+o?"end":"start"),i==="center"?s+=(n-o)/2:i==="end"&&(s-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,s),0)},this.getOffsetForIndex=(s,i="auto")=>{s=Math.max(0,Math.min(s,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[s];if(!r)return;if(i==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)i="end";else if(r.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&s===this.options.count-1)return[this.getMaxScrollOffset(),i];const a=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,i,r.size),i]},this.scrollToOffset=(s,{align:i="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(s,i),r=this.now();this.scrollState={index:null,align:i,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(s,{align:i="auto",behavior:n="auto"}={})=>{s=Math.max(0,Math.min(s,this.options.count-1));const o=this.getOffsetForIndex(s,i);if(!o)return;const[r,a]=o,u=this.now();this.scrollState={index:s,align:a,behavior:n,startedAt:u,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(s,{behavior:i="auto"}={})=>{const n=this.getScrollOffset()+s,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var s;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((s=i[i.length-1])==null?void 0:s.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=i.length-1;for(;r>=0&&o.some(a=>a===null);){const a=i[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(s,{adjustments:i,behavior:n})=>{this.options.scrollToFn(s,{behavior:n,adjustments:i},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 i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=i?i[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&fs(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const bt=(t,e,s,i)=>{for(;t<=e;){const n=(t+e)/2|0,o=s(n);if(o<i)t=n+1;else if(o>i)e=n-1;else return n}return t>0?t-1:0};function Ss({measurements:t,outerSize:e,scrollOffset:s,lanes:i}){const n=t.length-1,o=u=>t[u].start;if(t.length<=i)return{startIndex:0,endIndex:n};let r=bt(0,n,o,s),a=r;if(i===1)for(;a<n&&t[a].end<s+e;)a++;else if(i>1){const u=Array(i).fill(0);for(;a<n&&u.some(m=>m<s+e);){const m=t[a];u[m.lane]=m.end,a++}const d=Array(i).fill(s+e);for(;r>=0&&d.some(m=>m>=s);){const m=t[r];d[m.lane]=m.start,r--}r=Math.max(0,r-r%i),a=Math.min(n,a+(i-1-a%i))}return{startIndex:r,endIndex:a}}const Ve=typeof document<"u"?R.useLayoutEffect:R.useEffect;function _s({useFlushSync:t=!0,...e}){const s=R.useReducer(()=>({}),{})[1],i={...e,onChange:(o,r)=>{var a;t&&r?At.flushSync(s):s(),(a=e.onChange)==null||a.call(e,o,r)}},[n]=R.useState(()=>new js(i));return n.setOptions(i),Ve(()=>n._didMount(),[]),Ve(()=>n._willUpdate()),n}function Ns(t){return _s({observeElementRect:gs,observeElementOffset:bs,scrollToFn:ys,...t})}const vt=[{id:"litellm",name:"LiteLLM",description:"Connect a LiteLLM proxy as an OpenAI-compatible endpoint",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 local models via Ollama's OpenAI-compatible API",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:"Local models served by 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:"High-throughput inference server with OpenAI-compatible API",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function We(t){if(t)return vt.find(e=>e.id===t)}se({title:D(),url:D(),icon:D()});se({registries:we(D(),se({enabled:Ie()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ce(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const xe=se({keyId:D(),modelId:D(),title:D().optional()}).nullable(),ws=se({enabled:Ie(),chat:se({fast:xe,smart:xe,thinking:xe}),image:xe,webResearch:xe});se({ids:Ce(D()).describe("Ordered list of agent ids to show on the home view. Mix of well-known template ids and custom virtual MCP ids.")});se({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:se({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:se({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ce(we(D(),Le())).nullable().optional().describe("Brand images"),metadata:we(D(),Le()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ie().optional().describe("Whether this is the default brand for the organization")});function Cs(t){const e=B.c(3),{error:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(ls,{size:16}),e[0]=i):i=e[0];let n;return e[1]!==s.message?(n=l.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,l.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",s.message]})]}),e[1]=s.message,e[2]=n):n=e[2],n}function yt(t){const e=B.c(27),{keys:s,onDelete:i,isDeleting:n}=t,[o,r]=R.useState(null);let a;if(e[0]!==o||e[1]!==s){let x;e[3]!==o?(x=N=>N.id===o,e[3]=o,e[4]=x):x=e[4],a=s.find(x),e[0]=o,e[1]=s,e[2]=a}else a=e[2];const u=a;let d;if(e[5]!==n||e[6]!==s){let x;e[8]!==n?(x=N=>l.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted/50 text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[l.jsx(nt,{size:14,className:"text-muted-foreground shrink-0"}),l.jsx("span",{className:"font-medium truncate",children:N.label}),l.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["added ",ms(new Date(N.createdAt))," ago"]})]}),l.jsx("div",{onClick:ks,children:l.jsx(te,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",disabled:n,onClick:()=>r(N.id),children:l.jsx(ns,{size:14})})})]},N.id),e[8]=n,e[9]=x):x=e[9],d=s.map(x),e[5]=n,e[6]=s,e[7]=d}else d=e[7];const m=!!o;let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=x=>!x&&r(null),e[10]=f):f=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(dt,{children:"Delete API Key"}),e[11]=c):c=e[11];const h=u?.label;let S;e[12]!==h?(S=l.jsxs(mt,{children:[c,l.jsxs(ut,{children:["This action cannot be undone. This will permanently delete"," ",l.jsx("span",{className:"font-medium text-foreground",children:h}),"."]})]}),e[12]=h,e[13]=S):S=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(ft,{children:"Cancel"}),e[14]=b):b=e[14];let C;e[15]!==o||e[16]!==i?(C=l.jsxs(ht,{children:[b,l.jsx(pt,{onClick:()=>{o&&(i(o),r(null))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[15]=o,e[16]=i,e[17]=C):C=e[17];let _;e[18]!==S||e[19]!==C?(_=l.jsxs(xt,{onClick:Is,children:[S,C]}),e[18]=S,e[19]=C,e[20]=_):_=e[20];let p;e[21]!==_||e[22]!==m?(p=l.jsx(gt,{open:m,onOpenChange:f,children:_}),e[21]=_,e[22]=m,e[23]=p):p=e[23];let j;return e[24]!==p||e[25]!==d?(j=l.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[d,p]}),e[24]=p,e[25]=d,e[26]=j):j=e[26],j}function Is(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}const Es=se({label:D().optional(),apiKey:D().min(1,"API key is required")});function Ms(t){const e=B.c(62),{providerId:s,onCancel:i,onSuccess:n}=t,{org:o}=ie();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:re,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=ae(r),u=be(),[d,m]=R.useState(!1);let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={resolver:Ee(Es),defaultValues:{label:"",apiKey:""}},e[3]=f):f=e[3];const{register:c,handleSubmit:h,formState:S}=ke(f),{errors:b}=S;let C;e[4]!==a||e[5]!==s?(C=async H=>{await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:s,label:H.label||"Personal key",apiKey:H.apiKey}})},e[4]=a,e[5]=s,e[6]=C):C=e[6];let _;e[7]!==n||e[8]!==o.id||e[9]!==u?(_=()=>{u.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),u.invalidateQueries({queryKey:G.aiProviders(o.id)}),Y.success("Key saved successfully"),n()},e[7]=n,e[8]=o.id,e[9]=u,e[10]=_):_=e[10];let p;e[11]!==C||e[12]!==_?(p={mutationFn:C,onSuccess:_,onError:As},e[11]=C,e[12]=_,e[13]=p):p=e[13];const{mutate:j,isPending:x,error:N}=le(p);let g;e[14]!==j?(g=H=>j(H),e[14]=j,e[15]=g):g=e[15];let v;e[16]!==h||e[17]!==g?(v=h(g),e[16]=h,e[17]=g,e[18]=v):v=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=w):w=e[19];let I;e[20]!==c?(I=c("label"),e[20]=c,e[21]=I):I=e[21];let k;e[22]!==I?(k=l.jsxs("div",{className:"space-y-1",children:[w,l.jsx(ne,{placeholder:"e.g. Personal key",...I,className:"h-8 text-sm"})]}),e[22]=I,e[23]=k):k=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=y):y=e[24];const E=d?"text":"password";let P;e[25]!==c?(P=c("apiKey"),e[25]=c,e[26]=P):P=e[26];let M;e[27]!==E||e[28]!==P?(M=l.jsx(ne,{type:E,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=E,e[28]=P,e[29]=M):M=e[29];let A;e[30]!==d?(A=()=>m(!d),e[30]=d,e[31]=A):A=e[31];let O;e[32]!==d?(O=d?l.jsx(lt,{size:14}):l.jsx(it,{size:14}),e[32]=d,e[33]=O):O=e[33];let L;e[34]!==A||e[35]!==O?(L=l.jsx("button",{type:"button",onClick:A,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:O}),e[34]=A,e[35]=O,e[36]=L):L=e[36];let V;e[37]!==M||e[38]!==L?(V=l.jsxs("div",{className:"relative",children:[M,L]}),e[37]=M,e[38]=L,e[39]=V):V=e[39];let K;e[40]!==b.apiKey?(K=b.apiKey&&l.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[40]=b.apiKey,e[41]=K):K=e[41];let $;e[42]!==V||e[43]!==K?($=l.jsxs("div",{className:"space-y-1",children:[y,V,K]}),e[42]=V,e[43]=K,e[44]=$):$=e[44];let z;e[45]!==N?(z=N&&l.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[45]=N,e[46]=z):z=e[46];let F;e[47]!==x||e[48]!==i?(F=l.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:x,children:"Cancel"}),e[47]=x,e[48]=i,e[49]=F):F=e[49];const U=x?"Saving...":"Save Key";let W;e[50]!==x||e[51]!==U?(W=l.jsx(te,{type:"submit",size:"sm",disabled:x,children:U}),e[50]=x,e[51]=U,e[52]=W):W=e[52];let q;e[53]!==F||e[54]!==W?(q=l.jsxs(st,{children:[F,W]}),e[53]=F,e[54]=W,e[55]=q):q=e[55];let T;return e[56]!==k||e[57]!==$||e[58]!==z||e[59]!==q||e[60]!==v?(T=l.jsxs("form",{onSubmit:v,className:"space-y-3",children:[k,$,z,q]}),e[56]=k,e[57]=$,e[58]=z,e[59]=q,e[60]=v,e[61]=T):T=e[61],T}function As(t){Y.error(`Failed to save key: ${t.message}`)}const Os=se({label:D().optional(),baseUrl:D().min(1,"Base URL is required"),apiKey:D().optional()});function jt(t){const e=B.c(77),{preset:s,onCancel:i,onSuccess:n}=t,{org:o}=ie();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:re,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=ae(r),u=be(),[d,m]=R.useState(!1);let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={resolver:Ee(Os),defaultValues:{label:"",baseUrl:"",apiKey:""}},e[3]=f):f=e[3];const{register:c,handleSubmit:h,formState:S}=ke(f),{errors:b}=S;let C;e[4]!==a||e[5]!==s?(C=async me=>{const Mt=JSON.stringify({baseUrl:me.baseUrl,apiKey:me.apiKey||""});await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:me.label||s?.name||me.baseUrl,apiKey:Mt,...s?{presetId:s.id}:{}}})},e[4]=a,e[5]=s,e[6]=C):C=e[6];let _;e[7]!==n||e[8]!==o.id||e[9]!==u?(_=()=>{u.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),u.invalidateQueries({queryKey:G.aiProviders(o.id)}),Y.success("Connection saved successfully"),n()},e[7]=n,e[8]=o.id,e[9]=u,e[10]=_):_=e[10];let p;e[11]!==C||e[12]!==_?(p={mutationFn:C,onSuccess:_,onError:Ts},e[11]=C,e[12]=_,e[13]=p):p=e[13];const{mutate:j,isPending:x,error:N}=le(p),g=s?`e.g. ${s.name} prod, ${s.name} dev`:"e.g. My OpenAI-compatible server",v=s?.baseUrlPlaceholder??"http://localhost:4000/v1";let w;e[14]!==j?(w=me=>j(me),e[14]=j,e[15]=w):w=e[15];let I;e[16]!==h||e[17]!==w?(I=h(w),e[16]=h,e[17]=w,e[18]=I):I=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=k):k=e[19];let y;e[20]!==c?(y=c("label"),e[20]=c,e[21]=y):y=e[21];let E;e[22]!==g||e[23]!==y?(E=l.jsxs("div",{className:"space-y-1",children:[k,l.jsx(ne,{placeholder:g,...y,className:"h-8 text-sm"})]}),e[22]=g,e[23]=y,e[24]=E):E=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),e[25]=P):P=e[25];let M;e[26]!==c?(M=c("baseUrl"),e[26]=c,e[27]=M):M=e[27];let A;e[28]!==v||e[29]!==M?(A=l.jsx(ne,{type:"url",placeholder:v,...M,className:"h-8 text-sm"}),e[28]=v,e[29]=M,e[30]=A):A=e[30];let O;e[31]!==b.baseUrl?(O=b.baseUrl&&l.jsx("p",{className:"text-xs text-destructive",children:b.baseUrl.message}),e[31]=b.baseUrl,e[32]=O):O=e[32];let L;e[33]!==A||e[34]!==O?(L=l.jsxs("div",{className:"space-y-1",children:[P,A,O]}),e[33]=A,e[34]=O,e[35]=L):L=e[35];const V=s?.apiKeyRecommended?"recommended":"optional";let K;e[36]!==V?(K=l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",l.jsxs("span",{className:"text-muted-foreground/60",children:["(",V,")"]})]}),e[36]=V,e[37]=K):K=e[37];const $=d?"text":"password";let z;e[38]!==c?(z=c("apiKey"),e[38]=c,e[39]=z):z=e[39];let F;e[40]!==$||e[41]!==z?(F=l.jsx(ne,{type:$,placeholder:"sk-...",...z,className:"ph-no-capture h-8 text-sm pr-8"}),e[40]=$,e[41]=z,e[42]=F):F=e[42];let U;e[43]!==d?(U=()=>m(!d),e[43]=d,e[44]=U):U=e[44];let W;e[45]!==d?(W=d?l.jsx(lt,{size:14}):l.jsx(it,{size:14}),e[45]=d,e[46]=W):W=e[46];let q;e[47]!==U||e[48]!==W?(q=l.jsx("button",{type:"button",onClick:U,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:W}),e[47]=U,e[48]=W,e[49]=q):q=e[49];let T;e[50]!==F||e[51]!==q?(T=l.jsxs("div",{className:"relative",children:[F,q]}),e[50]=F,e[51]=q,e[52]=T):T=e[52];let H;e[53]!==K||e[54]!==T?(H=l.jsxs("div",{className:"space-y-1",children:[K,T]}),e[53]=K,e[54]=T,e[55]=H):H=e[55];let X;e[56]!==s?(X=s?.helpText&&l.jsx("p",{className:"text-xs text-muted-foreground",children:s.helpText}),e[56]=s,e[57]=X):X=e[57];let ee;e[58]!==N?(ee=N&&l.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[58]=N,e[59]=ee):ee=e[59];let Z;e[60]!==x||e[61]!==i?(Z=l.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:x,children:"Cancel"}),e[60]=x,e[61]=i,e[62]=Z):Z=e[62];const pe=x?"Saving...":"Save Connection";let ce;e[63]!==x||e[64]!==pe?(ce=l.jsx(te,{type:"submit",size:"sm",disabled:x,children:pe}),e[63]=x,e[64]=pe,e[65]=ce):ce=e[65];let de;e[66]!==Z||e[67]!==ce?(de=l.jsxs(st,{children:[Z,ce]}),e[66]=Z,e[67]=ce,e[68]=de):de=e[68];let ve;return e[69]!==E||e[70]!==L||e[71]!==H||e[72]!==X||e[73]!==ee||e[74]!==de||e[75]!==I?(ve=l.jsxs("form",{onSubmit:I,className:"space-y-3",children:[E,L,H,X,ee,de]}),e[69]=E,e[70]=L,e[71]=H,e[72]=X,e[73]=ee,e[74]=de,e[75]=I,e[76]=ve):ve=e[76],ve}function Ts(t){Y.error(`Failed to save connection: ${t.message}`)}function qe({provider:t,keys:e}){const{org:s}=ie(),i=ae({connectionId:re,orgId:s.id,orgSlug:s.slug}),n=be(),[o,r]=R.useState(!1),[a,u]=R.useState(!1),[d,m]=R.useState(null),f=t.supportedMethods.includes("cli-activate"),c=e.length>0,{mutate:h,isPending:S}=le({mutationFn:async y=>(await i.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:y}}),y),onSuccess:y=>{n.invalidateQueries({queryKey:G.aiProviderKeys(s.id)}),n.invalidateQueries({queryKey:G.aiProviders(s.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(s.id,y)}),Y.success("Key deleted")},onError:y=>{Y.error(`Failed to delete key: ${y.message}`)}}),{mutate:b}=le({mutationFn:async({code:y,stateToken:E})=>{const P=await i.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:t.id,code:y,stateToken:E,label:"Connected via OAuth"}});if(P?.isError){const M=P.content?.[0]?.text??"OAuth exchange failed";throw new Error(M)}},onSuccess:()=>{J("ai_provider_oauth_succeeded",{provider_id:t.id}),n.invalidateQueries({queryKey:G.aiProviderKeys(s.id)}),n.invalidateQueries({queryKey:G.aiProviders(s.id)}),Y.success(`${t.name} connected successfully`),u(!1),m(null)},onError:y=>{J("ai_provider_oauth_failed",{provider_id:t.id,error:y.message}),Y.error(`OAuth connection failed: ${y.message}`),u(!1),m(null)}}),{mutate:C,isPending:_}=le({mutationFn:async()=>{const y=await i.callTool({name:"AI_PROVIDER_CLI_ACTIVATE",arguments:{providerId:t.id}});if(y?.isError)throw new Error(y.content?.[0]?.text??"CLI activation failed");return y.structuredContent},onSuccess:y=>{if(!y?.activated){J("ai_provider_cli_activate_failed",{provider_id:t.id,error:y?.error??"unknown"}),Y.error(y?.error??"CLI activation failed");return}J("ai_provider_cli_activated",{provider_id:t.id}),n.invalidateQueries({queryKey:G.aiProviderKeys(s.id)}),n.invalidateQueries({queryKey:G.aiProviders(s.id)}),Y.success(`${t.name} activated`)},onError:y=>{J("ai_provider_cli_activate_failed",{provider_id:t.id,error:y.message}),Y.error(y.message)}}),{mutate:p,isPending:j}=le({mutationFn:async()=>{const y=await i.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:t.id}});if(y?.isError){const E=y.content?.[0]?.text??"Key provisioning failed";throw new Error(E)}},onSuccess:()=>{J("ai_provider_provision_succeeded",{provider_id:t.id}),n.invalidateQueries({queryKey:G.aiProviderKeys(s.id)}),n.invalidateQueries({queryKey:G.aiProviders(s.id)}),Y.success(`${t.name} connected successfully`)},onError:y=>{J("ai_provider_provision_failed",{provider_id:t.id,error:y.message}),Y.error(`Failed to connect ${t.name}: ${y.message}`)}});R.useEffect(()=>{if(!a||!d)return;let y=!1;const E=M=>{if(M.origin===window.location.origin&&M.data?.type==="AI_PROVIDER_OAUTH_CALLBACK"){const{code:A,stateToken:O}=M.data;O===d?(y=!0,b({code:A,stateToken:O})):(console.error("State token mismatch"),Y.error("Security check failed: State token mismatch"),u(!1),m(null))}};window.addEventListener("message",E);const P=setTimeout(()=>{y||(J("ai_provider_oauth_timeout",{provider_id:t.id}),u(!1),m(null),Y.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(P)}},[a,d,b,t.id]);const x=!!t.supportsProvision,N=t.supportedMethods.includes("oauth-pkce"),g=t.supportedMethods.includes("api-key"),v=()=>{if(!(o||a||_||j)){if(f){c||(J("ai_provider_connect_clicked",{provider_id:t.id,method:"cli-activate"}),C());return}x?(J("ai_provider_connect_clicked",{provider_id:t.id,method:"provision"}),p()):N?(J("ai_provider_connect_clicked",{provider_id:t.id,method:"oauth-pkce"}),w()):g&&(J("ai_provider_connect_clicked",{provider_id:t.id,method:"api-key"}),r(!0))}},w=async()=>{try{u(!0);const y=await i.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:t.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(y.structuredContent)m(y.structuredContent.stateToken),window.open(y.structuredContent.url,"AiProviderOAuth","width=600,height=700");else throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL")}catch(y){u(!1),Y.error(`Failed to start OAuth: ${y instanceof Error?y.message:String(y)}`)}},I=_?"Checking CLI...":j?"Connecting...":a?"Authorizing...":null,k=I??(c&&f?`Authenticated via ${t.name} CLI`:t.description);return l.jsxs(l.Fragment,{children:[l.jsx(fe,{icon:t.logo?l.jsx("img",{src:t.logo,alt:t.name,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):l.jsx(ct,{fallback:t.name.charAt(0),className:"size-8 bg-primary/10 text-primary"}),title:l.jsxs("span",{className:"flex items-center gap-2",children:[t.name,c&&!f&&!I&&l.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:[e.length," key",e.length!==1?"s":""," configured",t.supportsCredits?" · Managed above":""]})]}),description:k,onClick:!a&&!_&&!j?v:void 0,className:oe((a||_||j)&&"cursor-wait"),action:l.jsx("div",{className:"flex items-center gap-2",children:c&&l.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 shrink-0"})}),children:c&&!f&&l.jsx(yt,{keys:e,onDelete:h,isDeleting:S})}),l.jsx(Me,{open:o,onOpenChange:y=>{y||r(!1)},children:l.jsxs(Ae,{children:[l.jsxs(et,{children:[l.jsxs(Oe,{children:["Connect ",t.name]}),l.jsx(tt,{children:t.id==="openai-compatible"?"Enter the base URL and optional API key for your OpenAI-compatible endpoint.":`Add an API key to connect your ${t.name} account.`})]}),t.id==="openai-compatible"?l.jsx(jt,{onCancel:()=>r(!1),onSuccess:()=>r(!1)}):l.jsx(Ms,{providerId:t.id,onCancel:()=>r(!1),onSuccess:()=>r(!1)})]})})]})}function He(t){const e=B.c(58),{preset:s,keys:i,fallbackLogo:n}=t,{org:o}=ie();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:re,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=ae(r),u=be(),[d,m]=R.useState(!1),f=i.length>0,c=s?.name??"Custom OpenAI Compatible",h=s?.description??"Connect any OpenAI-compatible endpoint by URL",S=s?.logo??n;let b;e[3]!==a?(b=async U=>(await a.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:U}}),U),e[3]=a,e[4]=b):b=e[4];let C;e[5]!==o.id||e[6]!==u?(C=U=>{u.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),u.invalidateQueries({queryKey:G.aiProviders(o.id)}),u.invalidateQueries({queryKey:G.aiProviderModels(o.id,U)}),Y.success("Connection deleted")},e[5]=o.id,e[6]=u,e[7]=C):C=e[7];let _;e[8]!==b||e[9]!==C?(_={mutationFn:b,onSuccess:C,onError:Ps},e[8]=b,e[9]=C,e[10]=_):_=e[10];const{mutate:p,isPending:j}=le(_);let x;e[11]!==c||e[12]!==S?(x=S?l.jsx("img",{src:S,alt:c,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):l.jsx(ct,{fallback:c.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[11]=c,e[12]=S,e[13]=x):x=e[13];let N;e[14]!==f||e[15]!==i.length?(N=f&&l.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:[i.length," connection",i.length!==1?"s":""," ","configured"]}),e[14]=f,e[15]=i.length,e[16]=N):N=e[16];let g;e[17]!==c||e[18]!==N?(g=l.jsxs("span",{className:"flex items-center gap-2",children:[c,N]}),e[17]=c,e[18]=N,e[19]=g):g=e[19];let v;e[20]!==d||e[21]!==s?.id?(v=()=>{d||(J("ai_provider_connect_clicked",{provider_id:"openai-compatible",preset_id:s?.id??null,method:"api-key"}),m(!0))},e[20]=d,e[21]=s?.id,e[22]=v):v=e[22];let w;e[23]!==f?(w=f?l.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 shrink-0"}):void 0,e[23]=f,e[24]=w):w=e[24];let I;e[25]!==p||e[26]!==f||e[27]!==j||e[28]!==i?(I=f&&l.jsx(yt,{keys:i,onDelete:p,isDeleting:j}),e[25]=p,e[26]=f,e[27]=j,e[28]=i,e[29]=I):I=e[29];let k;e[30]!==h||e[31]!==I||e[32]!==x||e[33]!==g||e[34]!==v||e[35]!==w?(k=l.jsx(fe,{icon:x,title:g,description:h,onClick:v,action:w,children:I}),e[30]=h,e[31]=I,e[32]=x,e[33]=g,e[34]=v,e[35]=w,e[36]=k):k=e[36];let y;e[37]===Symbol.for("react.memo_cache_sentinel")?(y=U=>{U||m(!1)},e[37]=y):y=e[37];let E;e[38]!==c?(E=l.jsxs(Oe,{children:["Connect ",c]}),e[38]=c,e[39]=E):E=e[39];const P=s?`Add a ${s.name} connection. Multiple connections of the same kind are supported.`:"Enter the base URL and optional API key for any OpenAI-compatible endpoint.";let M;e[40]!==P?(M=l.jsx(tt,{children:P}),e[40]=P,e[41]=M):M=e[41];let A;e[42]!==E||e[43]!==M?(A=l.jsxs(et,{children:[E,M]}),e[42]=E,e[43]=M,e[44]=A):A=e[44];const O=s??void 0;let L,V;e[45]===Symbol.for("react.memo_cache_sentinel")?(L=()=>m(!1),V=()=>m(!1),e[45]=L,e[46]=V):(L=e[45],V=e[46]);let K;e[47]!==O?(K=l.jsx(jt,{preset:O,onCancel:L,onSuccess:V}),e[47]=O,e[48]=K):K=e[48];let $;e[49]!==A||e[50]!==K?($=l.jsxs(Ae,{children:[A,K]}),e[49]=A,e[50]=K,e[51]=$):$=e[51];let z;e[52]!==d||e[53]!==$?(z=l.jsx(Me,{open:d,onOpenChange:y,children:$}),e[52]=d,e[53]=$,e[54]=z):z=e[54];let F;return e[55]!==k||e[56]!==z?(F=l.jsxs(l.Fragment,{children:[k,z]}),e[55]=k,e[56]=z,e[57]=F):F=e[57],F}function Ps(t){Y.error(`Failed to delete connection: ${t.message}`)}function St(t){const e=B.c(28);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{hideProviderId:i}=s,n=rt(),o=he();let r,a,u,d,m;if(e[2]!==n?.providers||e[3]!==o||e[4]!==i){let S;e[10]!==i?(S=w=>w.id!==i,e[10]=i,e[11]=S):S=e[11];const b=(n?.providers??[]).filter(S),C=b.filter(Ds),_=b.filter(Fs),p=o.filter(zs),j=i!=="openai-compatible";let x;e[12]!==n?.providers?(x=n?.providers??[],e[12]=n?.providers,e[13]=x):x=e[13];let N;e[14]!==x?(N=x.find(Ls),e[14]=x,e[15]=N):N=e[15];const g=N;d="flex flex-col gap-6 w-full",m=C.length>0&&l.jsx(je,{children:l.jsxs("div",{className:"relative rounded-xl border border-lime-400/30 bg-gradient-to-br from-lime-50/50 via-transparent to-yellow-50/30 dark:from-lime-950/20 dark:to-yellow-950/10 p-4",children:[l.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-lime-400/5 to-yellow-400/5 pointer-events-none"}),l.jsx("p",{className:"text-xs font-medium text-lime-700 dark:text-lime-400 mb-3 relative",children:"Local models — use your existing AI provider"}),l.jsx(Se,{className:"relative",children:C.map(w=>l.jsx(qe,{provider:w,keys:o.filter(I=>I.providerId===w.id)},w.id))})]})}),a=je,r=Se;let v;e[16]!==o?(v=w=>l.jsx(qe,{provider:w,keys:o.filter(I=>I.providerId===w.id)},w.id),e[16]=o,e[17]=v):v=e[17],u=[..._.map(v),...j?[...vt.map(w=>l.jsx(He,{preset:w,keys:p.filter(I=>I.presetId===w.id)},w.id)),l.jsx(He,{preset:null,keys:p.filter(Rs),fallbackLogo:g?.logo},"custom")]:[]],e[2]=n?.providers,e[3]=o,e[4]=i,e[5]=r,e[6]=a,e[7]=u,e[8]=d,e[9]=m}else r=e[5],a=e[6],u=e[7],d=e[8],m=e[9];let f;e[18]!==r||e[19]!==u?(f=l.jsx(r,{children:u}),e[18]=r,e[19]=u,e[20]=f):f=e[20];let c;e[21]!==a||e[22]!==f?(c=l.jsx(a,{children:f}),e[21]=a,e[22]=f,e[23]=c):c=e[23];let h;return e[24]!==d||e[25]!==m||e[26]!==c?(h=l.jsxs("div",{className:d,children:[m,c]}),e[24]=d,e[25]=m,e[26]=c,e[27]=h):h=e[27],h}function Rs(t){return!t.presetId}function Ls(t){return t.id==="openai-compatible"}function zs(t){return t.providerId==="openai-compatible"}function Fs(t){return!t.supportedMethods.includes("cli-activate")&&t.id!=="openai-compatible"}function Ds(t){return t.supportedMethods.includes("cli-activate")}const Ks={usd:[10,20,100],brl:[50,100,500]};function $s(){const t=B.c(29),{org:e}=ie();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:re,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const i=ae(s),[n,o]=R.useState(!1),{mutate:r,isPending:a}=le({mutationFn:async v=>{const w=await i.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:v,currency:c}});if(w?.isError)throw new Error(w.content?.[0]?.text??"Failed to get top-up URL");return w.structuredContent?.url},onSuccess:Bs,onError:Us}),[u,d]=R.useState(""),[m,f]=R.useState("usd"),c=m,h=parseFloat(u),S=!isNaN(h)&&h>=1,b=c==="brl"?"R$":"$";let C;t[3]!==f?(C=v=>{v&&f(v)},t[3]=f,t[4]=C):C=t[4];let _,p;t[5]===Symbol.for("react.memo_cache_sentinel")?(_=l.jsx(De,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),p=l.jsx(De,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),t[5]=_,t[6]=p):(_=t[5],p=t[6]);let j;t[7]!==c||t[8]!==C?(j=l.jsxs(as,{type:"single",variant:"outline",size:"default",value:c,onValueChange:C,children:[_,p]}),t[7]=c,t[8]=C,t[9]=j):j=t[9];let x;t[10]!==c||t[11]!==b||t[12]!==n||t[13]!==a||t[14]!==r?(x=!n&&l.jsxs(l.Fragment,{children:[Ks[c].map(v=>l.jsxs(te,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:a,onClick:()=>r(v*100),children:[b,v]},v)),l.jsx(te,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>o(!0),disabled:a,children:"Custom"})]}),t[10]=c,t[11]=b,t[12]=n,t[13]=a,t[14]=r,t[15]=x):x=t[15];let N;t[16]!==b||t[17]!==u||t[18]!==h||t[19]!==n||t[20]!==S||t[21]!==a||t[22]!==d||t[23]!==r?(N=n&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative max-w-[140px]",children:[l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:b}),l.jsx(ne,{type:"number",min:"1",step:"1",placeholder:"50",value:u,onChange:v=>d(v.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),l.jsx(te,{className:"h-10",disabled:!S||a,onClick:()=>r(Math.round(h*100)),children:a?"...":"Add"}),l.jsx(te,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{o(!1),d("")},children:"Cancel"})]}),t[16]=b,t[17]=u,t[18]=h,t[19]=n,t[20]=S,t[21]=a,t[22]=d,t[23]=r,t[24]=N):N=t[24];let g;return t[25]!==j||t[26]!==x||t[27]!==N?(g=l.jsx("div",{className:"flex flex-col gap-2.5",children:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,x,N]})}),t[25]=j,t[26]=x,t[27]=N,t[28]=g):g=t[28],g}function Us(t){Y.error(`Top-up failed: ${t.message}`)}function Bs(t){t&&window.open(t,"_blank","noopener,noreferrer")}function Vs(t){return t<=0?"text-destructive":t<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function Ws(){const t=B.c(61),{org:e}=ie();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:re,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const i=ae(s),n=be(),o=he();let r;t[3]!==o?(r=o.find(Hs),t[3]=o,t[4]=r):r=t[4];const a=r,[u,d]=R.useState(!1);let m;t[5]!==i||t[6]!==a?(m=async()=>{a&&await i.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:a.id}})},t[5]=i,t[6]=a,t[7]=m):m=t[7];let f;t[8]!==e.id||t[9]!==n?(f=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(e.id)}),n.invalidateQueries({queryKey:G.aiProviders(e.id)}),Y.success("Deco AI Gateway disconnected"),d(!1)},t[8]=e.id,t[9]=n,t[10]=f):f=t[10];let c;t[11]!==m||t[12]!==f?(c={mutationFn:m,onSuccess:f,onError:qs},t[11]=m,t[12]=f,t[13]=c):c=t[13];const{mutate:h,isPending:S}=le(c);let b;t[14]!==e.id?(b=G.aiProviderCredits(e.id,"deco"),t[14]=e.id,t[15]=b):b=t[15];const C=!!a;let _;t[16]!==i?(_=async()=>{const X=await i.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return X?.isError?null:X.structuredContent??null},t[16]=i,t[17]=_):_=t[17];let p;t[18]!==b||t[19]!==C||t[20]!==_?(p={queryKey:b,enabled:C,staleTime:6e4,queryFn:_},t[18]=b,t[19]=C,t[20]=_,t[21]=p):p=t[21];const{data:j,isLoading:x,refetch:N,isFetching:g}=Je(p);if(!a)return null;const v=j?.balanceCents!=null?j.balanceCents/100:null;let w;t[22]!==v?(w=v!=null?`$${v.toFixed(2)}`:"—",t[22]=v,t[23]=w):w=t[23];const I=w;let k;t[24]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),l.jsx("div",{children:l.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),t[24]=k):k=t[24];let y;t[25]===Symbol.for("react.memo_cache_sentinel")?(y=()=>d(!0),t[25]=y):y=t[25];let E;t[26]!==S?(E=l.jsxs("div",{className:"flex items-center justify-between",children:[k,l.jsx(te,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:y,disabled:S,children:"Disconnect"})]}),t[26]=S,t[27]=E):E=t[27];let P;t[28]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsxs(mt,{children:[l.jsx(dt,{children:"Disconnect Deco AI Gateway"}),l.jsx(ut,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),t[28]=P):P=t[28];let M;t[29]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsx(ft,{children:"Cancel"}),t[29]=M):M=t[29];let A;t[30]!==h?(A=l.jsxs(xt,{children:[P,l.jsxs(ht,{children:[M,l.jsx(pt,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),t[30]=h,t[31]=A):A=t[31];let O;t[32]!==u||t[33]!==A?(O=l.jsx(gt,{open:u,onOpenChange:d,children:A}),t[32]=u,t[33]=A,t[34]=O):O=t[34];let L;t[35]!==v||t[36]!==I||t[37]!==g||t[38]!==x?(L=x||g?l.jsx(Q,{className:"h-9 w-24"}):l.jsx("span",{className:oe("text-3xl font-semibold tabular-nums tracking-tight",v!=null&&Vs(v)),children:I}),t[35]=v,t[36]=I,t[37]=g,t[38]=x,t[39]=L):L=t[39];let V;t[40]!==N?(V=()=>N(),t[40]=N,t[41]=V):V=t[41];const K=g&&"animate-spin";let $;t[42]!==K?($=oe(K),t[42]=K,t[43]=$):$=t[43];let z;t[44]!==$?(z=l.jsx(Ze,{size:14,className:$}),t[44]=$,t[45]=z):z=t[45];let F;t[46]!==g||t[47]!==V||t[48]!==z?(F=l.jsx("button",{type:"button",onClick:V,disabled:g,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:z}),t[46]=g,t[47]=V,t[48]=z,t[49]=F):F=t[49];let U;t[50]!==L||t[51]!==F?(U=l.jsxs("div",{className:"flex items-baseline gap-2",children:[L,F]}),t[50]=L,t[51]=F,t[52]=U):U=t[52];let W;t[53]===Symbol.for("react.memo_cache_sentinel")?(W=l.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),t[53]=W):W=t[53];let q;t[54]!==U?(q=l.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[U,W]}),t[54]=U,t[55]=q):q=t[55];let T;t[56]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsxs("div",{className:"pt-4 border-t border-border/60",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),l.jsx($s,{})]}),t[56]=T):T=t[56];let H;return t[57]!==E||t[58]!==O||t[59]!==q?(H=l.jsx(je,{title:"Deco AI Gateway",children:l.jsx(Se,{children:l.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[E,O,q,T]})})}),t[57]=E,t[58]=O,t[59]=q,t[60]=H):H=t[60],H}function qs(t){Y.error(`Failed to disconnect: ${t.message}`)}function Hs(t){return t.providerId==="deco"}const Qs=t=>t.capabilities?.includes("image")===!0,Ys=t=>{if(t.asyncResearch===!0)return!0;const e=t.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return e.includes("sonar")||e.includes("deepresearch")},Gs={fast:"Fast",smart:"Smart",thinking:"Thinking"},Xs={fast:"Fastest responses, best for quick tasks",smart:"Balanced speed and capability",thinking:"Most capable, best for complex tasks"};function Ne(t){const e=B.c(20),{slot:s,onSlotChange:i,filterModels:n,defaultKeyId:o}=t,r=he(),[a,u]=R.useState(s?.keyId??o);let d;e[0]!==s?(d=()=>{s?.keyId&&u(s.keyId)},e[0]=s,e[1]=d):d=e[1];const m=s?.keyId;let f;e[2]!==m?(f=[m],e[2]=m,e[3]=f):f=e[3],R.useEffect(d,f);const c=a??o;let h;e[4]!==c||e[5]!==r?(h=c?r.find(v=>v.id===c):null,e[4]=c,e[5]=r,e[6]=h):h=e[6];const S=h,{models:b,isLoading:C}=ge(n?c??void 0:void 0),_=n?C||b.some(n):!0;let p;e[7]!==s||e[8]!==S?.providerId?(p=s?{modelId:s.modelId,title:s.title??s.modelId,keyId:s.keyId,providerId:S?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[7]=s,e[8]=S?.providerId,e[9]=p):p=e[9];const j=p;if(n&&!_){let v;return e[10]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),e[10]=v):v=e[10],v}let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=v=>u(v),e[11]=x):x=e[11];let N;e[12]!==c||e[13]!==i?(N=v=>{const w=v.keyId??c??"";u(w),i({keyId:w,modelId:v.modelId,title:v.title})},e[12]=c,e[13]=i,e[14]=N):N=e[14];let g;return e[15]!==c||e[16]!==n||e[17]!==j||e[18]!==N?(g=l.jsx(Kl,{variant:"bordered",placeholder:"Pick model",model:j,credentialId:c,filterModels:n,onCredentialChange:x,onModelChange:N}),e[15]=c,e[16]=n,e[17]=j,e[18]=N,e[19]=g):g=e[19],g}function Js(t){const e=B.c(2),{isPending:s,showSaved:i}=t;if(s){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx(Ze,{size:12,className:"animate-spin"}),"Saving…"]}),e[0]=n):n=e[0],n}if(i){let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx(is,{size:12}),"Saved"]}),e[1]=n):n=e[1],n}return null}function Zs(){const t=he(),e=cs(),s=t.length>0,i=ke({resolver:Ee(ws),values:e,mode:"onChange"}),{mutate:n,isPending:o,isSuccess:r}=ds(),a=i.watch(),u=i.formState.isDirty;R.useEffect(()=>{if(!u)return;const p=setTimeout(()=>{n(a,{onSuccess:()=>i.reset(a,{keepValues:!0}),onError:j=>{i.reset(e),Y.error(`Failed to save: ${j.message}`)}})},250);return()=>clearTimeout(p)},[a,u,n,i,e]);const d=t[0],m=t[1],f=t[2],{models:c}=ge(d?.id),{models:h}=ge(m?.id),{models:S}=ge(f?.id),b=p=>{const j=i.getValues("chat");if(p&&!j.fast&&!j.smart&&!j.thinking){const x={};d?.id&&(x[d.id]=c),m?.id&&(x[m.id]=h),f?.id&&(x[f.id]=S);const N=Fe(t,x);i.reset({enabled:!0,chat:N.chat,image:N.image,webResearch:N.webResearch},{keepDirty:!0})}else i.setValue("enabled",p,{shouldDirty:!0})};R.useEffect(()=>{s||i.reset({enabled:!1,chat:{fast:null,smart:null,thinking:null},image:null,webResearch:null})},[s,i]),R.useEffect(()=>{const p=i.getValues();if(!p.enabled)return;const j=new Set(t.map(E=>E.id)),x={};d?.id&&(x[d.id]=c),m?.id&&(x[m.id]=h),f?.id&&(x[f.id]=S);const N=E=>E!=null&&!j.has(E.keyId),g={fast:N(p.chat.fast)?null:p.chat.fast,smart:N(p.chat.smart)?null:p.chat.smart,thinking:N(p.chat.thinking)?null:p.chat.thinking},v=N(p.image)?null:p.image,w=N(p.webResearch)?null:p.webResearch,I=!g.fast||!g.smart||!g.thinking||!v||!w,k=g.fast===p.chat.fast&&g.smart===p.chat.smart&&g.thinking===p.chat.thinking;if(!I&&k)return;const y=Fe(t,x);i.reset({...p,chat:{fast:g.fast??y.chat.fast,smart:g.smart??y.chat.smart,thinking:g.thinking??y.chat.thinking},image:v??y.image,webResearch:w??y.webResearch},{keepDirty:!0})},[i,t,c,h,S,d?.id,m?.id,f?.id]);const _=i.watch("enabled")&&s;return l.jsx(je,{title:"Simple model mode",children:l.jsxs(Se,{children:[l.jsx(fe,{title:"Enable simple model mode",description:s?"Replace the model picker with a Fast / Smart / Thinking toggle for all members of this org.":"Connect an AI provider above to enable this feature.",action:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Js,{isPending:o,showSaved:r&&!u}),l.jsx(rs,{checked:_,onCheckedChange:b,disabled:o||!s})]})}),_&&l.jsxs(l.Fragment,{children:[["fast","smart","thinking"].map(p=>l.jsx(_e,{control:i.control,name:`chat.${p}`,render:({field:j})=>l.jsx(fe,{title:Gs[p],description:Xs[p],action:l.jsx(Ne,{slot:j.value,defaultKeyId:t[0]?.id??null,onSlotChange:x=>j.onChange(x)})})},p)),l.jsx("div",{className:"h-px bg-border mx-5"}),l.jsx(_e,{control:i.control,name:"image",render:({field:p})=>l.jsx(fe,{title:"Image",action:l.jsx(Ne,{slot:p.value,defaultKeyId:t[0]?.id??null,filterModels:Qs,onSlotChange:j=>p.onChange(j)})})}),l.jsx(_e,{control:i.control,name:"webResearch",render:({field:p})=>l.jsx(fe,{title:"Web research",action:l.jsx(Ne,{slot:p.value,defaultKeyId:t[0]?.id??null,filterModels:Ys,onSlotChange:j=>p.onChange(j)})})})]})]})})}function el(){const t=B.c(6),s=he().some(tl);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(Ws,{}),t[0]=i):i=t[0];const n=s?"deco":void 0;let o;t[1]!==n?(o=l.jsx(St,{hideProviderId:n}),t[1]=n,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx(R.Suspense,{fallback:l.jsx(Q,{className:"h-16 w-full"}),children:l.jsx(Zs,{})}),t[3]=r):r=t[3];let a;return t[4]!==o?(a=l.jsxs(l.Fragment,{children:[i,o,r]}),t[4]=o,t[5]=a):a=t[5],a}function tl(t){return t.providerId==="deco"}function vi(){const t=B.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(ye.Title,{children:"AI Providers"}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(ye,{children:l.jsx(ye.Content,{children:l.jsx(ye.Body,{children:l.jsxs(os,{children:[e,l.jsx(Xe,{fallback:sl,children:l.jsx(R.Suspense,{fallback:l.jsx(Q,{className:"h-64 w-full"}),children:l.jsx(el,{})})})]})})})}),t[1]=s):s=t[1],s}function sl(t){const{error:e}=t;return l.jsx(Cs,{error:e??new Error("Failed to load AI providers")})}function ll(){const t=B.c(10),{org:e}=ie();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:re,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const i=ae(s);let n;t[3]!==e.id?(n=G.defaultBrand(e.id),t[3]=e.id,t[4]=n):n=t[4];let o;t[5]!==i?(o=async()=>{const u=await i.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),d=us(u);return(Array.isArray(d?.items)?d.items:[]).find(il)??null},t[5]=i,t[6]=o):o=t[6];let r;t[7]!==n||t[8]!==o?(r={queryKey:n,queryFn:o},t[7]=n,t[8]=o,t[9]=r):r=t[9];const{data:a}=Je(r);return a??null}function il(t){return t.isDefault&&!t.archivedAt}function nl(t){const e=t.colors;if(!e)return null;if(Array.isArray(e)){const s=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),i=s?s.value:e[0]?.value;return typeof i=="string"?i:null}if(typeof e=="object"){const s=e;return s.primary??Object.values(s)[0]??null}return null}function ol(t){const e=B.c(31);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{title:i,description:n}=s,{org:o}=ie(),{localMode:r}=Ot(),a=ll(),u=o.name;let d;e[2]!==a?(d=a?nl(a):null,e[2]=a,e[3]=d):d=e[3];const m=d,f=a?.favicon??a?.logo??null,c=i??(u?`${u} is ready for agents`:"Your agents are almost ready"),h=n??"Choose how to power your AI team.",S=!!(f||m);let b;e[4]!==m?(b=m?{backgroundColor:`${m}18`,borderColor:`${m}30`}:void 0,e[4]=m,e[5]=b):b=e[5];const C=b,_=S?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-gradient-to-br from-lime-100 to-yellow-50 dark:from-lime-900/30 dark:to-yellow-900/20 border border-lime-300/40 dark:border-lime-700/30";let p;e[6]!==f||e[7]!==m?(p=f?l.jsx("img",{src:f,alt:"",className:"size-7 rounded object-contain"}):l.jsx(ss,{size:24,style:m?{color:m}:void 0,className:oe(!m&&"text-lime-600 dark:text-lime-400")}),e[6]=f,e[7]=m,e[8]=p):p=e[8];let j;e[9]!==_||e[10]!==C||e[11]!==p?(j=l.jsx("div",{className:_,style:C,children:p}),e[9]=_,e[10]=C,e[11]=p,e[12]=j):j=e[12];let x;e[13]!==c?(x=l.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:c}),e[13]=c,e[14]=x):x=e[14];let N;e[15]!==h?(N=l.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:h}),e[15]=h,e[16]=N):N=e[16];let g;e[17]!==x||e[18]!==N?(g=l.jsxs("div",{className:"space-y-2",children:[x,N]}),e[17]=x,e[18]=N,e[19]=g):g=e[19];let v;e[20]!==j||e[21]!==g?(v=l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[j,g]}),e[20]=j,e[21]=g,e[22]=v):v=e[22];let w;e[23]!==r?(w=r&&l.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Local models + use your existing AI provider"}),e[23]=r,e[24]=w):w=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(R.Suspense,{fallback:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 w-full",children:[l.jsx(Q,{className:"h-32 w-full rounded-lg"}),l.jsx(Q,{className:"h-32 w-full rounded-lg"})]}),children:l.jsx(St,{})}),e[25]=I):I=e[25];let k;e[26]!==w?(k=l.jsxs("div",{className:"w-full space-y-3",children:[w,I]}),e[26]=w,e[27]=k):k=e[27];let y;return e[28]!==k||e[29]!==v?(y=l.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-2xl px-4",children:[v,k]}),e[28]=k,e[29]=v,e[30]=y):y=e[30],y}function Pe(t){const e=t.title.includes(": ");return{provider:e?t.title.split(": ")[0]??"":t.modelId.split("/")[0]??"",displayName:e?t.title.split(": ").slice(1).join(": "):t.title}}const _t=["smarter","faster","cheaper"],Nt={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},rl=[{tier:"smarter",prefixes:["claude-code:opus","anthropic/claude-opus-4.7","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","codex:gpt-5.4","codex:gpt-5.4-mini","codex:gpt-5.3-codex","codex:gpt-5.2-codex","codex:gpt-5.1-codex-max","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["claude-code:sonnet","anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","codex: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:["claude-code:haiku","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"]}],al=rl.flatMap(({tier:t,prefixes:e})=>e.map(s=>({tier:t,prefix:s}))).sort((t,e)=>e.prefix.length-t.prefix.length),cl=new Set(["google/gemini-2.5-pro"]),Qe=new Map;function dl(t){const e=Qe.get(t);if(e!==void 0)return e;let s=null;if(t.endsWith(":free"))s="cheaper";else e:for(const{tier:i,prefix:n}of al)if(t.startsWith(n)){if(cl.has(n)&&t.length>n.length&&t[n.length]==="-"){const r=t[n.length+1];if(!r||!/\d/.test(r))continue e}s=i;break}return Qe.set(t,s),s}function Ye(t){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const s of t){const i=dl(s.modelId);e[i??"other"].push(s)}for(const s of Object.keys(e))e[s].sort((i,n)=>i.title.localeCompare(n.title));return e}const wt="mesh:model-shortlist:",ml=new Set(["anthropic/claude-opus-4.7","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 ul(t){try{const e=localStorage.getItem(wt+t);return e?new Set(JSON.parse(e)):null}catch{return null}}function fl(t,e){localStorage.setItem(wt+t,JSON.stringify([...e]))}function hl(t){return t<32e3?{level:1,label:"Small",description:"Short conversations"}:t<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:t<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const pl=["bg-destructive","bg-warning","bg-success","bg-success"],xl=["text-success","text-warning","text-warning","text-destructive"];function gl(t){const e=Math.round(t*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(t*.75)} words`}function bl(t){return t<1?{level:1,label:"Cheap"}:t<5?{level:2,label:"Moderate"}:t<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const vl={text:{icon:l.jsx(Xt,{className:"size-3.5"}),label:"Text"},vision:{icon:l.jsx(Gt,{className:"size-3.5"}),label:"Vision"},image:{icon:l.jsx(Jt,{className:"size-3.5"}),label:"Image"},tools:{icon:l.jsx(Yt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:l.jsx(Qt,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:l.jsx(ot,{className:"size-3.5"}),label:"Web search"}};function yl(t){const e=B.c(5),{capability:s}=t;let i;e[0]!==s?(i=vl[s]??{icon:null,label:s.charAt(0).toUpperCase()+s.slice(1)},e[0]=s,e[1]=i):i=e[1];const n=i;let o;return e[2]!==n.icon||e[3]!==n.label?(o=l.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[n.icon,n.label]}),e[2]=n.icon,e[3]=n.label,e[4]=o):o=e[4],o}function jl(t){const e=B.c(49),{model:s,compact:i}=t,n=i===void 0?!1:i;if(!s){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=g):g=e[0],g}const o=s.costs?.input!=null?s.costs.input*1e6:null,r=s.costs?.output!=null?s.costs.output*1e6:null;let a;e[1]!==s?(a=Pe(s),e[1]=s,e[2]=a):a=e[2];const{provider:u,displayName:d}=a;if(n){let g;e[3]!==s.limits?(g=s.limits?.contextWindow&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Context"}),l.jsxs("span",{className:"text-foreground font-medium",children:[s.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=s.limits,e[4]=g):g=e[4];let v;e[5]!==o?(v=o!=null&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Input"}),l.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=v):v=e[6];let w;e[7]!==r?(w=r!=null&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Output"}),l.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=w):w=e[8];let I;e[9]!==s.limits?(I=s.limits?.maxOutputTokens&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),l.jsxs("span",{className:"text-foreground font-medium",children:[s.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=s.limits,e[10]=I):I=e[10];let k;return e[11]!==g||e[12]!==v||e[13]!==w||e[14]!==I?(k=l.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[g,v,w,I]}),e[11]=g,e[12]=v,e[13]=w,e[14]=I,e[15]=k):k=e[15],k}let m;e[16]!==u?(m=l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:u}),e[16]=u,e[17]=m):m=e[17];let f;e[18]!==s.logo||e[19]!==s.title?(f=s.logo&&l.jsx("img",{src:s.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[18]=s.logo,e[19]=s.title,e[20]=f):f=e[20];let c;e[21]!==d?(c=l.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=c):c=e[22];let h;e[23]!==f||e[24]!==c?(h=l.jsxs("div",{className:"flex items-center gap-2.5",children:[f,c]}),e[23]=f,e[24]=c,e[25]=h):h=e[25];let S;e[26]!==s.modelId?(S=l.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:s.modelId}),e[26]=s.modelId,e[27]=S):S=e[27];let b;e[28]!==m||e[29]!==h||e[30]!==S?(b=l.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[m,h,S]}),e[28]=m,e[29]=h,e[30]=S,e[31]=b):b=e[31];let C;e[32]!==s.capabilities?(C=s.capabilities&&s.capabilities.length>0&&l.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(s.capabilities)].map(Sl)}),e[32]=s.capabilities,e[33]=C):C=e[33];let _;e[34]!==s.limits?(_=s.limits?.contextWindow&&(()=>{const{level:g,label:v,description:w}=hl(s.limits.contextWindow);return l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(I=>l.jsx("div",{className:oe("w-2 h-2 rounded-full",I<=g?pl[g-1]:"bg-muted")},I))}),l.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:v}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",w]})]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=s.limits,e[35]=_):_=e[35];let p;e[36]!==s.limits?(p=s.limits?.maxOutputTokens&&l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsxs("span",{className:"text-sm text-foreground",children:[s.limits.maxOutputTokens.toLocaleString()," tokens"]}),l.jsx("span",{className:"text-sm text-muted-foreground",children:gl(s.limits.maxOutputTokens)})]})]}),e[36]=s.limits,e[37]=p):p=e[37];let j;e[38]!==o||e[39]!==r?(j=(o!=null||r!=null)&&(()=>{const{level:g,label:v}=o!=null?bl(o):{level:0,label:""};return l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(w=>l.jsx("span",{className:oe("text-sm font-bold leading-none",w<=g?xl[g-1]:"text-muted-foreground/20"),children:"$"},w))}),l.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:v})]}),l.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),l.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),l.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=j):j=e[40];let x;e[41]!==_||e[42]!==p||e[43]!==j?(x=l.jsxs("div",{className:"flex flex-col gap-6",children:[_,p,j]}),e[41]=_,e[42]=p,e[43]=j,e[44]=x):x=e[44];let N;return e[45]!==x||e[46]!==b||e[47]!==C?(N=l.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[b,C,x]}),e[45]=x,e[46]=b,e[47]=C,e[48]=N):N=e[48],N}function Sl(t){return l.jsx(yl,{capability:t},t)}function _l(t){const e=B.c(21),{model:s,onHover:i}=t;let n;e[0]!==s?(n=Pe(s),e[0]=s,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let a;e[2]!==s?(a=Te(s),e[2]=s,e[3]=a):a=e[3];const u=a;let d;e[4]!==s||e[5]!==i?(d=()=>i(s),e[4]=s,e[5]=i,e[6]=d):d=e[6];let m;e[7]!==s.title||e[8]!==u?(m=l.jsx("img",{src:u,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[7]=s.title,e[8]=u,e[9]=m):m=e[9];let f;e[10]!==o?(f=l.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=f):f=e[11];let c;e[12]!==r?(c=l.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=c):c=e[13];let h;e[14]!==f||e[15]!==c?(h=l.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,c]}),e[14]=f,e[15]=c,e[16]=h):h=e[16];let S;return e[17]!==d||e[18]!==m||e[19]!==h?(S=l.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[m,h]}),e[17]=d,e[18]=m,e[19]=h,e[20]=S):S=e[20],S}function Nl(t){const e=B.c(10),{error:s,onRetry:i}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:l.jsx(Pt,{className:"size-5 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=s?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=l.jsxs("div",{className:"flex flex-col gap-1",children:[o,l.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 u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(Zt,{className:"size-3.5"}),e[4]=u):u=e[4];let d;e[5]!==i?(d=l.jsx("div",{className:"flex items-center gap-2",children:l.jsxs(te,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[u,"Retry"]})}),e[5]=i,e[6]=d):d=e[6];let m;return e[7]!==a||e[8]!==d?(m=l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,d]}),e[7]=a,e[8]=d,e[9]=m):m=e[9],m}function wl(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Cl)}),t[0]=e):e=t[0],e}function Cl(t,e){return l.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[l.jsx(Q,{className:"size-5 shrink-0 rounded-sm"}),l.jsx(Q,{className:"flex-1 h-4"}),l.jsx(Q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ge(t){const e=B.c(12),{label:s,models:i,onSelect:n,onHover:o}=t;if(i.length===0)return null;let r;e[0]!==s?(r=l.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:s}),e[0]=s,e[1]=r):r=e[1];let a;if(e[2]!==i||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=m=>l.jsx("div",{onClick:()=>n(m),className:"cursor-pointer",children:l.jsx(_l,{model:m,onHover:o})},m.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],a=i.map(d),e[2]=i,e[3]=o,e[4]=n,e[5]=a}else a=e[5];let u;return e[9]!==r||e[10]!==a?(u=l.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=u):u=e[11],u}function Il(t){const e=B.c(21),{model:s,isChecked:i,onToggle:n,onHover:o}=t,[r,a]=R.useState(i);r!==i&&a(i);let u;e[0]!==s?(u=Te(s),e[0]=s,e[1]=u):u=e[1];const d=u;let m;e[2]!==s||e[3]!==o?(m=()=>o(s),e[2]=s,e[3]=o,e[4]=m):m=e[4];let f;e[5]!==s.modelId||e[6]!==n?(f=()=>{a(kl),n(s.modelId)},e[5]=s.modelId,e[6]=n,e[7]=f):f=e[7];let c;e[8]!==r||e[9]!==f?(c=l.jsx(Rt,{checked:r,onCheckedChange:f}),e[8]=r,e[9]=f,e[10]=c):c=e[10];let h;e[11]!==d||e[12]!==s.title?(h=l.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[11]=d,e[12]=s.title,e[13]=h):h=e[13];let S;e[14]!==s.title?(S=l.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:s.title}),e[14]=s.title,e[15]=S):S=e[15];let b;return e[16]!==m||e[17]!==c||e[18]!==h||e[19]!==S?(b=l.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:m,children:[c,h,S]}),e[16]=m,e[17]=c,e[18]=h,e[19]=S,e[20]=b):b=e[20],b}function kl(t){return!t}function El(t){const e=[];for(const s of _t)if(t[s].length>0){e.push({type:"header",label:Nt[s]});for(const i of t[s])e.push({type:"model",model:i})}if(t.other.length>0){e.push({type:"header",label:"Other"});for(const s of t.other)e.push({type:"model",model:s})}return e}function Ml({items:t,shortlistSet:e,onToggle:s,onHover:i}){const n=R.useRef(null),o=Ns({count:t.length,getScrollElement:()=>n.current,estimateSize:r=>t[r]?.type==="header"?36:44,overscan:6});return l.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:l.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=t[r.index];return a?l.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"?l.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):l.jsx(Il,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:s,onHover:i})},r.key):null})})})}function Al(t){const e=B.c(23),{keyId:s,searchTerm:i,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:u}=t,{models:d}=ge(s),m=u?d.filter(u):d.filter(Ol);let f;e[0]!==s?(f=()=>(s?ul(s):null)??ml,e[0]=s,e[1]=f):f=e[1];const[c,h]=R.useState(f),[,S]=R.useTransition();let b;e[2]!==s||e[3]!==S?(b=k=>{s&&S(()=>{h(y=>{const E=new Set(y);return E.has(k)?E.delete(k):E.add(k),fl(s,E),E})})},e[2]=s,e[3]=S,e[4]=b):b=e[4];const C=b,_=i.toLowerCase().trim(),p=k=>_?k.filter(y=>y.title.toLowerCase().includes(_)||y.modelId.toLowerCase().includes(_)):k;if(r){const k=Ye(p(m)),y=El(k);let E;e[5]!==c?(E=O=>c.has(O.modelId),e[5]=c,e[6]=E):E=e[6];const P=m.filter(E).length;let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsx(es,{size:14}),e[7]=M):M=e[7];let A;return e[8]!==a?(A=l.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[M,"Back"]}),e[8]=a,e[9]=A):A=e[9],l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[A,l.jsxs("span",{className:"text-xs text-muted-foreground",children:[P," selected"]})]}),l.jsx(Ml,{items:y,shortlistSet:c,onToggle:C,onHover:n})]})}let j;e[10]!==c?(j=k=>c.has(k.modelId),e[10]=c,e[11]=j):j=e[11];const x=m.filter(j),N=x.length>0?x:m,g=Ye(p(N));let v;e[12]!==g||e[13]!==n||e[14]!==o?(v=_t.map(k=>l.jsx(Ge,{label:Nt[k],models:g[k],onSelect:o,onHover:n},k)),e[12]=g,e[13]=n,e[14]=o,e[15]=v):v=e[15];let w;e[16]!==g.other||e[17]!==n||e[18]!==o?(w=l.jsx(Ge,{label:"Other",models:g.other,onSelect:o,onHover:n}),e[16]=g.other,e[17]=n,e[18]=o,e[19]=w):w=e[19];let I;return e[20]!==v||e[21]!==w?(I=l.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[v,w]}),e[20]=v,e[21]=w,e[22]=I):I=e[22],I}function Ol(t){return t.asyncResearch!==!0}function Ct(t){const e=B.c(19),{model:s,placeholder:i,isLoading:n}=t,o=i===void 0?"Select model":i;if(n===void 0?!1:n){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Q,{className:"w-5 h-5 rounded-sm shrink-0"}),l.jsx(Q,{className:"w-16 h-3 hidden md:block"})]}),e[0]=b):b=e[0],b}if(!s){let b;e[1]!==o?(b=l.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=b):b=e[2];let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(ze,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=C):C=e[3];let _;return e[4]!==b?(_=l.jsxs("div",{className:"flex items-center gap-1.5",children:[b,C]}),e[4]=b,e[5]=_):_=e[5],_}let a;e[6]!==s?(a=Pe(s),e[6]=s,e[7]=a):a=e[7];const{displayName:u}=a;let d;e[8]!==s?(d=Te(s),e[8]=s,e[9]=d):d=e[9];const m=d;let f;e[10]!==s.title||e[11]!==m?(f=l.jsx("img",{src:m,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[10]=s.title,e[11]=m,e[12]=f):f=e[12];let c;e[13]!==u?(c=l.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:u}),e[13]=u,e[14]=c):c=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(ze,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=h):h=e[15];let S;return e[16]!==f||e[17]!==c?(S=l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[f,c,h]}),e[16]=f,e[17]=c,e[18]=S):S=e[18],S}const Tl=["vision","image","file","audio","video"],It=["image/png","image/jpeg","image/gif","image/webp"],kt=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function Re(t){const e=t?.capabilities;return e?Tl.some(s=>e.includes(s)):!1}function yi(t,e){if(!t)return!1;if(t.startsWith("text/"))return!0;const s=e?.capabilities??[],i=s.includes("vision")||s.includes("image"),n=s.includes("file"),o=s.includes("audio"),r=s.includes("video");return!!(i&&It.includes(t)||n&&t==="application/pdf"||o&&t.startsWith("audio/")||r&&t.startsWith("video/")||Re(e)&&kt.includes(t))}function ji(t){const e=t?.capabilities??[],s=["text/*"];return(e.includes("vision")||e.includes("image"))&&s.push(...It),e.includes("file")&&s.push("application/pdf"),e.includes("audio")&&s.push("audio/*"),e.includes("video")&&s.push("video/*"),Re(t)&&s.push(...kt),s.join(",")}function Si(t){const e=t?.capabilities??[],s=[];return(e.includes("vision")||e.includes("image"))&&s.push("images"),e.includes("file")&&s.push("PDFs"),e.includes("audio")&&s.push("audio"),e.includes("video")&&s.push("video"),Re(t)&&s.push("Office files"),s.length===0?"text only":s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s.at(-1)}`}function Pl(){const t=B.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:l.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[l.jsx(Q,{className:"size-4 shrink-0"}),l.jsx(Q,{className:"flex-1 h-6"}),l.jsx(Q,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.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,l.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Rl)})]}),t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx(Q,{className:"size-6 shrink-0"}),l.jsx(Q,{className:"h-6 w-32"})]}),t[2]=i):i=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[i,l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Q,{className:"h-6 w-20 rounded-md"}),l.jsx(Q,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=n):n=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(Q,{className:"h-4 w-24"}),l.jsx(Q,{className:"h-4 w-32"})]}),t[4]=o):o=t[4];let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[s,l.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:l.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,l.jsxs("div",{className:"flex flex-col gap-4",children:[o,l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(Q,{className:"h-4 w-16"}),l.jsx(Q,{className:"h-4 w-40"})]})]})]})})]}),t[5]=r):r=t[5],r}function Rl(t,e){return l.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[l.jsx(Q,{className:"size-5 shrink-0 rounded-sm"}),l.jsx(Q,{className:"flex-1 h-4"}),l.jsx(Q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Et(t){const e=B.c(49),{onClose:s,credentialId:i,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=t,[u,d]=R.useState(null),[m,f]=R.useState(""),[c,h]=R.useState(!1),S=R.useRef(null),b=rt(),C=he();let _;e[0]!==b?.providers?(_=Object.fromEntries((b?.providers??[]).map(Fl)),e[0]=b?.providers,e[1]=_):_=e[1];const p=_,j=Tt(),{org:x}=ie();let N;e[2]!==n?(N=T=>{n(T),d(null)},e[2]=n,e[3]=N):N=e[3];const g=N;let v;e[4]!==i||e[5]!==s||e[6]!==r?(v=T=>{i&&(r(T),f(""),s())},e[4]=i,e[5]=s,e[6]=r,e[7]=v):v=e[7];const w=v;if(C.length===0){let T;return e[8]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:l.jsx(ol,{})}),e[8]=T):T=e[8],T}let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(ot,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=I):I=e[9];const k=c?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=T=>f(T.target.value),e[10]=y):y=e[10];let E;e[11]!==m||e[12]!==k?(E=l.jsx(ne,{ref:S,type:"text",placeholder:k,value:m,onChange:y,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]=m,e[12]=k,e[13]=E):E=e[13];let P;e[14]!==i||e[15]!==g||e[16]!==C||e[17]!==p?(P=C.length>0&&l.jsxs(Ut,{value:i??"",onValueChange:g,children:[l.jsxs(Bt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:zl,children:[l.jsx(Vt,{placeholder:"Key",children:(()=>{const T=C.find(pe=>pe.id===i),H=T?p[T.providerId]:void 0,X=We(T?.presetId),ee=X?.logo??H?.logo,Z=X?.name??H?.name??T?.providerId??"Key";return l.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[ee?l.jsx("img",{src:ee,alt:Z,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):l.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:Z.slice(0,1).toUpperCase()}),l.jsx("span",{className:"text-xs truncate",children:Z})]})})()}),l.jsx(Ht,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),l.jsx(Wt,{children:C.map(T=>{const H=p[T.providerId],X=We(T.presetId),ee=X?.logo??H?.logo,Z=X?.name??H?.name??T.providerId;return l.jsx(qt,{value:T.id,children:l.jsxs("div",{className:"flex items-center gap-2",children:[ee?l.jsx("img",{src:ee,alt:Z,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):l.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Z.slice(0,1).toUpperCase()}),l.jsxs("span",{children:[Z," — ",T.label]})]})},T.id)})})]}),e[14]=i,e[15]=g,e[16]=C,e[17]=p,e[18]=P):P=e[18];let M;e[19]!==E||e[20]!==P?(M=l.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:l.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[I,E,P]})}),e[19]=E,e[20]=P,e[21]=M):M=e[21];let A;e[22]!==i?(A=T=>{const{error:H,resetError:X}=T;return l.jsx(Nl,{error:H,onRetry:X,credentialId:i??void 0})},e[22]=i,e[23]=A):A=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=l.jsx(wl,{}),e[24]=O):O=e[24];const L=i??void 0;let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=()=>h(Ll),e[25]=V):V=e[25];let K;e[26]!==a||e[27]!==w||e[28]!==c||e[29]!==m||e[30]!==L?(K=l.jsx(R.Suspense,{fallback:O,children:l.jsx(Al,{keyId:L,searchTerm:m,onHover:d,onModelSelect:w,managing:c,onToggleManage:V,filterModels:a})}),e[26]=a,e[27]=w,e[28]=c,e[29]=m,e[30]=L,e[31]=K):K=e[31];let $;e[32]!==i||e[33]!==A||e[34]!==K?($=l.jsx(Xe,{fallback:A,children:K},i),e[32]=i,e[33]=A,e[34]=K,e[35]=$):$=e[35];let z;e[36]!==c||e[37]!==j||e[38]!==x?(z=!c&&l.jsxs("div",{className:"border-t border-border flex",children:[l.jsxs("button",{type:"button",onClick:()=>R.startTransition(()=>h(!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:[l.jsx(ts,{className:"size-3.5 shrink-0"}),"Manage models"]}),l.jsx("div",{className:"w-px bg-border shrink-0"}),l.jsxs("button",{type:"button",onClick:()=>j({to:"/$org/settings/ai-providers",params:{org:x.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:[l.jsx(nt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=c,e[37]=j,e[38]=x,e[39]=z):z=e[39];let F;e[40]!==$||e[41]!==z||e[42]!==M?(F=l.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[M,$,z]}),e[40]=$,e[41]=z,e[42]=M,e[43]=F):F=e[43];const U=u??o??null;let W;e[44]!==U?(W=l.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:l.jsx(jl,{model:U})}),e[44]=U,e[45]=W):W=e[45];let q;return e[46]!==F||e[47]!==W?(q=l.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[F,W]}),e[46]=F,e[47]=W,e[48]=q):q=e[48],q}function Ll(t){return!t}function zl(t){return t.stopPropagation()}function Fl(t){return[t.id,t]}function Dl(t){const e=B.c(12),{onClose:s}=t,{credentialId:i,setCredentialId:n,selectedModel:o,setModel:r}=at();let a;e[0]!==n?(a=m=>{J("chat_credential_changed",{credential_id:m}),n(m)},e[0]=n,e[1]=a):a=e[1];let u;e[2]!==i||e[3]!==o?.modelId||e[4]!==r?(u=m=>{i&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:m.modelId,to_model_provider:m.providerId??null,credential_id:i}),r({...m,keyId:i}))},e[2]=i,e[3]=o?.modelId,e[4]=r,e[5]=u):u=e[5];let d;return e[6]!==i||e[7]!==s||e[8]!==o||e[9]!==a||e[10]!==u?(d=l.jsx(Et,{onClose:s,credentialId:i,onCredentialChange:a,selectedModel:o,onModelChange:u}),e[6]=i,e[7]=s,e[8]=o,e[9]=a,e[10]=u,e[11]=d):d=e[11],d}function Kl(t){const e=B.c(38),{variant:s,className:i,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:u,onModelChange:d,filterModels:m}=t,f=s===void 0?"borderless":s,c=n===void 0?"Select model":n,[h,S]=R.useState(!1),b=d!==void 0,C=$t(),_=f==="borderless"?"ghost":"outline",p=f==="borderless"&&"md:border-none";let j;e[0]!==i||e[1]!==p?(j=oe("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",p,i),e[0]=i,e[1]=p,e[2]=j):j=e[2];let x;e[3]!==r||e[4]!==o||e[5]!==c||e[6]!==b?(x=b?l.jsx(Ct,{model:o??null,placeholder:c,isLoading:r}):l.jsx(Ul,{placeholder:c}),e[3]=r,e[4]=o,e[5]=c,e[6]=b,e[7]=x):x=e[7];let N;e[8]!==_||e[9]!==j||e[10]!==x?(N=l.jsx(te,{variant:_,size:"sm",className:j,children:x}),e[8]=_,e[9]=j,e[10]=x,e[11]=N):N=e[11];const g=N;let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Pl,{}),e[12]=v):v=e[12];let w;e[13]!==a||e[14]!==m||e[15]!==o||e[16]!==u||e[17]!==d||e[18]!==b?(w=l.jsx(R.Suspense,{fallback:v,children:b?l.jsx(Et,{onClose:()=>S(!1),credentialId:a??null,onCredentialChange:u??$l,selectedModel:o??null,onModelChange:d,filterModels:m}):l.jsx(Dl,{onClose:()=>S(!1)})}),e[13]=a,e[14]=m,e[15]=o,e[16]=u,e[17]=d,e[18]=b,e[19]=w):w=e[19];const I=w;if(C){let M;e[20]!==g?(M=l.jsx(zt,{asChild:!0,children:g}),e[20]=g,e[21]=M):M=e[21];let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(Ft,{className:"sr-only",children:"Select model"}),e[22]=A):A=e[22];let O;e[23]!==I?(O=l.jsxs(Dt,{className:"p-0 flex flex-col max-h-[95vh]",children:[A,l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:I})]}),e[23]=I,e[24]=O):O=e[24];let L;return e[25]!==h||e[26]!==M||e[27]!==O?(L=l.jsxs(Kt,{open:h,onOpenChange:S,children:[M,O]}),e[25]=h,e[26]=M,e[27]=O,e[28]=L):L=e[28],L}let k;e[29]!==g?(k=l.jsx(Lt,{asChild:!0,children:g}),e[29]=g,e[30]=k):k=e[30];let y;e[31]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(Oe,{className:"sr-only",children:"Select model"}),e[31]=y):y=e[31];let E;e[32]!==I?(E=l.jsxs(Ae,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[y,I]}),e[32]=I,e[33]=E):E=e[33];let P;return e[34]!==h||e[35]!==k||e[36]!==E?(P=l.jsxs(Me,{open:h,onOpenChange:S,children:[k,E]}),e[34]=h,e[35]=k,e[36]=E,e[37]=P):P=e[37],P}function $l(){}function Ul(t){const e=B.c(4),{placeholder:s}=t,{selectedModel:i,isModelsLoading:n}=at();let o;return e[0]!==n||e[1]!==i||e[2]!==s?(o=l.jsx(Ct,{model:i,placeholder:s,isLoading:n}),e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3],o}export{Kl as M,ol as N,vi as O,Si as a,ji as g,yi as i,Re as m};
@@ -1 +1 @@
1
- import{e as k,g as E,U as L,j as s,s as R,aG as D,c as $,L as z,t as T,b as W,O as I,l as H,r as J}from"./index-D4IWA9IU.js";import{S as K,a as Q,b as V,u as X,f as w,g as C,h as O,k as P,j as M,m as Y,n as Z,q as A,c as ee,d as se,e as te}from"./index-BET8kMZe.js";import{i as q}from"./ArrowNarrowLeft-hulNygQd.js";import{c as le,d as ne,b as re,e as ie,f as oe,i as F,n as ae,a as ce}from"./ZapSquare-CX9zqrxv.js";import{t as me,a as G}from"./Users03-qD8JWxak.js";import{i as de}from"./ChevronRight-DEybByBs.js";import{i as fe}from"./Lock01-C5rgxGgu.js";import{i as xe}from"./Shield01-DCoI7_zY.js";import{s as be}from"./User01-Bq8r53VC.js";import{i as B}from"./Zap-BPHOFmqu.js";import{u as he}from"./tooltip-B5FrLY14.js";import{u as ue}from"./use-status-sounds-BzXaoVC8.js";import"./X-BNOerUAB.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-DVXCv4R8.js";import"./create-sse-subscription-CxkOgzKf.js";function U(){const e=k.c(29),t=R().project;let n;e[0]!==t.enabledPlugins?(n=t.enabledPlugins??[],e[0]=t.enabledPlugins,e[1]=n):n=e[1];const l=n;let r,i,c,m,o;if(e[2]!==l){const b=D.filter(N=>l.includes(N.pluginId)).map(pe);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={key:"general",label:"General",icon:s.jsx(me,{size:14}),to:"/$org/settings/general"},e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={key:"brand-context",label:"Brand Context",icon:s.jsx(le,{size:14}),to:"/$org/settings/brand-context"},e[9]=g):g=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(c={label:"Organization",items:[x,g,{key:"ai-providers",label:"AI Providers",icon:s.jsx(ne,{size:14}),to:"/$org/settings/ai-providers"}]},e[10]=c):c=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y={key:"connections",label:"Connections",icon:s.jsx(re,{size:14}),to:"/$org/settings/connections"},e[11]=y):y=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j={key:"agents",label:"Agents",icon:s.jsx(G,{size:14}),to:"/$org/settings/agents"},e[12]=j):j=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={key:"automations",label:"Automations",icon:s.jsx(B,{size:14}),to:"/$org/settings/automations"},e[13]=_):_=e[13],e[14]===Symbol.for("react.memo_cache_sentinel")?(m={label:"Build",items:[y,j,_,{key:"store",label:"Store",icon:s.jsx(ie,{size:14}),to:"/$org/settings/store"}]},e[14]=m):m=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p={key:"monitor",label:"Monitor",icon:s.jsx(oe,{size:14}),to:"/$org/settings/monitor"},e[15]=p):p=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={key:"members",label:"Members",icon:s.jsx(G,{size:14}),to:"/$org/settings/members"},e[16]=S):S=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={key:"roles",label:"Roles",icon:s.jsx(xe,{size:14}),to:"/$org/settings/roles"},e[17]=u):u=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(o={label:"Manage",items:[p,S,u,{key:"sso",label:"Security",icon:s.jsx(fe,{size:14}),to:"/$org/settings/sso"}]},e[18]=o):o=e[18],r="Extensions";let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v={key:"features",label:"Plugins",icon:s.jsx(B,{size:14}),to:"/$org/settings/features"},e[19]=v):v=e[19],i=[v,...b],e[2]=l,e[3]=r,e[4]=i,e[5]=c,e[6]=m,e[7]=o}else r=e[3],i=e[4],c=e[5],m=e[6],o=e[7];let a;e[20]!==r||e[21]!==i?(a={label:r,items:i},e[20]=r,e[21]=i,e[22]=a):a=e[22];let d;e[23]===Symbol.for("react.memo_cache_sentinel")?(d={label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:s.jsx(be,{size:14}),to:"/$org/settings/profile"}]},e[23]=d):d=e[23];let f;return e[24]!==c||e[25]!==m||e[26]!==o||e[27]!==a?(f=[c,m,o,a,d],e[24]=c,e[25]=m,e[26]=o,e[27]=a,e[28]=f):f=e[28],f}function pe(e){const{key:t,label:n,icon:l,to:r}=e;return{key:t,label:n,icon:l,to:r}}function ge(){const e=k.c(26),t=U();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:l}=E(n);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={select:_e},e[1]=r):r=e[1];const i=L(r);let c;e[2]!==l||e[3]!==i?(c=_=>{const p=_.replace("$org",l);return i.startsWith(p)},e[2]=l,e[3]=i,e[4]=c):c=e[4];const m=c;let o;e[5]!==l?(o={org:l},e[5]=l,e[6]=o):o=e[6];let a,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{size:14}),d=s.jsx("span",{children:"Settings"}),e[7]=a,e[8]=d):(a=e[7],d=e[8]);let f;e[9]!==o?(f=s.jsx(w,{className:"pt-0 pr-0 pb-3 md:pb-3 pl-0",children:s.jsx(C,{children:s.jsx(O,{className:"gap-1.5",children:s.jsx(P,{children:s.jsx(M,{asChild:!0,children:s.jsxs(z,{to:"/$org",params:o,className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a,d]})})})})})}),e[9]=o,e[10]=f):f=e[10];let h;if(e[11]!==t||e[12]!==m||e[13]!==l){let _;e[15]!==m||e[16]!==l?(_=(p,S)=>s.jsxs(w,{className:"pt-0 pr-0 pb-0 pl-0",children:[p.label&&s.jsx("p",{className:$("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",S>0&&"mt-3"),children:p.label}),s.jsx(C,{children:s.jsx(O,{className:"gap-0.5",children:p.items.map(u=>s.jsx(P,{children:s.jsx(M,{asChild:!0,isActive:m(u.to),children:s.jsxs(z,{to:u.to,params:{org:l},onClick:()=>T("settings_nav_clicked",{section_key:u.key,section_label:u.label,group_label:p.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:u.icon}),s.jsx("span",{className:"truncate",children:u.label})]})})},u.key))})})]},`${p.label}-${S}`),e[15]=m,e[16]=l,e[17]=_):_=e[17],h=t.map(_),e[11]=t,e[12]=m,e[13]=l,e[14]=h}else h=e[14];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[18]=b):b=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(w,{className:"pt-0 pr-0 pb-0 pl-0",children:[b,s.jsx(C,{children:s.jsx(O,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(M,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[19]=x):x=e[19];let g;e[20]!==f||e[21]!==h?(g=s.jsxs(Y,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0",children:[f,h,x]}),e[20]=f,e[21]=h,e[22]=g):g=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.304.0"]})}),e[23]=y):y=e[23];let j;return e[24]!==g?(j=s.jsxs(Z,{variant:"sidebar",children:[g,y]}),e[24]=g,e[25]=j):j=e[25],j}function je(){T("signed_out",{source:"settings_sidebar"}),W.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=k.c(29),{onClose:n}=e,l=U();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org"},t[0]=r):r=t[0];const{org:i}=E(r);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c={select:ve},t[1]=c):c=t[1];const m=L(c);let o;t[2]!==i||t[3]!==m?(o=S=>{const u=S.replace("$org",i);return m.startsWith(u)},t[2]=i,t[3]=m,t[4]=o):o=t[4];const a=o;let d;t[5]!==i?(d={org:i},t[5]=i,t[6]=d):d=t[6];let f,h;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(q,{size:16,className:"shrink-0"}),h=s.jsx("span",{children:"Settings"}),t[7]=f,t[8]=h):(f=t[7],h=t[8]);let b;t[9]!==n||t[10]!==d?(b=s.jsx("div",{className:"flex items-center h-14 px-4 shrink-0 border-b border-border/50",children:s.jsxs(z,{to:"/$org",params:d,onClick:n,className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[f,h]})}),t[9]=n,t[10]=d,t[11]=b):b=t[11];let x;if(t[12]!==l||t[13]!==a||t[14]!==n||t[15]!==i){let S;t[17]!==a||t[18]!==n||t[19]!==i?(S=(u,v)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.label&&s.jsx("p",{className:$("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",v>0&&"mt-3"),children:u.label}),u.items.map(N=>s.jsxs(z,{to:N.to,params:{org:i},onClick:n,className:$("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",a(N.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsx("span",{className:"shrink-0",children:N.icon}),s.jsx("span",{className:"truncate",children:N.label})]},N.key))]},`${u.label}-${v}`),t[17]=a,t[18]=n,t[19]=i,t[20]=S):S=t[20],x=l.map(S),t[12]=l,t[13]=a,t[14]=n,t[15]=i,t[16]=x}else x=t[16];let g;t[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[21]=g):g=t[21];let y;t[22]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[g,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[22]=y):y=t[22];let j;t[23]!==x?(j=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[x,y]}),t[23]=x,t[24]=j):j=t[24];let _;t[25]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.304.0"]})}),t[25]=_):_=t[25];let p;return t[26]!==j||t[27]!==b?(p=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[b,j,_]}),t[26]=j,t[27]=b,t[28]=p):p=t[28],p}function Se(){return W.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=k.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("button",{type:"button",onClick:$e,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:s.jsx(ae,{size:16})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"shrink-0 flex items-center justify-between pl-1 pr-2 h-10",children:s.jsxs("div",{className:"flex items-center gap-0.5 min-w-0",children:[t,s.jsx("button",{type:"button",onClick:ke,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:s.jsx(de,{size:16})})]})}),e[1]=n):n=e[1],n}function ke(){return window.history.forward()}function $e(){return window.history.back()}function ze(e){const t=k.c(3),{onOpenSidebar:n}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ce,{size:20}),t[0]=l):l=t[0];let r;return t[1]!==n?(r=s.jsx("div",{className:"shrink-0 flex items-center justify-between px-3 h-12 bg-background border-b border-border",children:s.jsx("button",{type:"button",onClick:n,className:"flex size-8 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:l})}),t[1]=n,t[2]=r):r=t[2],r}function we(){const e=k.c(17),t=he(),{org:n}=R();ue(n.slug);const{setOpenMobile:l,openMobile:r}=X();if(t){let a;e[0]!==l?(a=s.jsx(ze,{onOpenSidebar:()=>l(!0)}),e[0]=l,e[1]=a):a=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(A,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(I,{})})})}),e[2]=d):d=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ee,{className:"sr-only",children:"Navigation"}),e[3]=f):f=e[3];let h;e[4]!==l?(h=s.jsxs(se,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[f,s.jsx(ye,{onClose:()=>l(!1)})]}),e[4]=l,e[5]=h):h=e[5];let b;e[6]!==r||e[7]!==l||e[8]!==h?(b=s.jsx(te,{open:r,onOpenChange:l,children:h}),e[6]=r,e[7]=l,e[8]=h,e[9]=b):b=e[9];let x;return e[10]!==a||e[11]!==b?(x=s.jsxs("div",{className:"flex flex-col flex-1 bg-background min-h-0",children:[a,d,b]}),e[10]=a,e[11]=b,e[12]=x):x=e[12],x}let i;e[13]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ne,{}),e[13]=i):i=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=$("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),e[14]=c):c=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(H,{size:20,className:"animate-spin text-muted-foreground"})}),e[15]=m):m=e[15];let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(s.Fragment,{children:[i,s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:c,children:s.jsx(J.Suspense,{fallback:m,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(A,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(I,{})})})})})})})]}),e[16]=o):o=e[16],o}function De(){const e=k.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={"--sidebar-width-icon":"3.5rem"},e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ge,{}),e[1]=n):n=e[1];let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{defaultOpen:!0,children:s.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:s.jsxs(Q,{className:"flex-1 bg-sidebar",style:t,children:[n,s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(we,{})})]})})}),e[2]=l):l=e[2],l}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,De as default};
1
+ import{e as k,g as E,U as L,j as s,s as R,aG as D,c as $,L as z,t as T,b as W,O as I,l as H,r as J}from"./index-B3pJqV9Y.js";import{S as K,a as Q,b as V,u as X,f as w,g as C,h as O,k as P,j as M,m as Y,n as Z,q as A,c as ee,d as se,e as te}from"./index-C7apxcAd.js";import{i as q}from"./ArrowNarrowLeft-CG2ODQbf.js";import{c as le,d as ne,b as re,e as ie,f as oe,i as F,n as ae,a as ce}from"./ZapSquare-Wt7N_ZY-.js";import{t as me,a as G}from"./Users03-X35A5ADD.js";import{i as de}from"./ChevronRight-DmfKIycz.js";import{i as fe}from"./Lock01-NMXz4ptn.js";import{i as xe}from"./Shield01-Bqcf2bTH.js";import{s as be}from"./User01-CVlz7odd.js";import{i as B}from"./Zap-D1n1nJno.js";import{u as he}from"./tooltip-DZIo6YZX.js";import{u as ue}from"./use-status-sounds-BYyaVEdO.js";import"./X-CeTLIvc6.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-BCUB3DhH.js";import"./create-sse-subscription-CxkOgzKf.js";function U(){const e=k.c(29),t=R().project;let n;e[0]!==t.enabledPlugins?(n=t.enabledPlugins??[],e[0]=t.enabledPlugins,e[1]=n):n=e[1];const l=n;let r,i,c,m,o;if(e[2]!==l){const b=D.filter(N=>l.includes(N.pluginId)).map(pe);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={key:"general",label:"General",icon:s.jsx(me,{size:14}),to:"/$org/settings/general"},e[8]=x):x=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={key:"brand-context",label:"Brand Context",icon:s.jsx(le,{size:14}),to:"/$org/settings/brand-context"},e[9]=g):g=e[9],e[10]===Symbol.for("react.memo_cache_sentinel")?(c={label:"Organization",items:[x,g,{key:"ai-providers",label:"AI Providers",icon:s.jsx(ne,{size:14}),to:"/$org/settings/ai-providers"}]},e[10]=c):c=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y={key:"connections",label:"Connections",icon:s.jsx(re,{size:14}),to:"/$org/settings/connections"},e[11]=y):y=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j={key:"agents",label:"Agents",icon:s.jsx(G,{size:14}),to:"/$org/settings/agents"},e[12]=j):j=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={key:"automations",label:"Automations",icon:s.jsx(B,{size:14}),to:"/$org/settings/automations"},e[13]=_):_=e[13],e[14]===Symbol.for("react.memo_cache_sentinel")?(m={label:"Build",items:[y,j,_,{key:"store",label:"Store",icon:s.jsx(ie,{size:14}),to:"/$org/settings/store"}]},e[14]=m):m=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p={key:"monitor",label:"Monitor",icon:s.jsx(oe,{size:14}),to:"/$org/settings/monitor"},e[15]=p):p=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={key:"members",label:"Members",icon:s.jsx(G,{size:14}),to:"/$org/settings/members"},e[16]=S):S=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={key:"roles",label:"Roles",icon:s.jsx(xe,{size:14}),to:"/$org/settings/roles"},e[17]=u):u=e[17],e[18]===Symbol.for("react.memo_cache_sentinel")?(o={label:"Manage",items:[p,S,u,{key:"sso",label:"Security",icon:s.jsx(fe,{size:14}),to:"/$org/settings/sso"}]},e[18]=o):o=e[18],r="Extensions";let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v={key:"features",label:"Plugins",icon:s.jsx(B,{size:14}),to:"/$org/settings/features"},e[19]=v):v=e[19],i=[v,...b],e[2]=l,e[3]=r,e[4]=i,e[5]=c,e[6]=m,e[7]=o}else r=e[3],i=e[4],c=e[5],m=e[6],o=e[7];let a;e[20]!==r||e[21]!==i?(a={label:r,items:i},e[20]=r,e[21]=i,e[22]=a):a=e[22];let d;e[23]===Symbol.for("react.memo_cache_sentinel")?(d={label:"Account",items:[{key:"profile",label:"Profile & Preferences",icon:s.jsx(be,{size:14}),to:"/$org/settings/profile"}]},e[23]=d):d=e[23];let f;return e[24]!==c||e[25]!==m||e[26]!==o||e[27]!==a?(f=[c,m,o,a,d],e[24]=c,e[25]=m,e[26]=o,e[27]=a,e[28]=f):f=e[28],f}function pe(e){const{key:t,label:n,icon:l,to:r}=e;return{key:t,label:n,icon:l,to:r}}function ge(){const e=k.c(26),t=U();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org"},e[0]=n):n=e[0];const{org:l}=E(n);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={select:_e},e[1]=r):r=e[1];const i=L(r);let c;e[2]!==l||e[3]!==i?(c=_=>{const p=_.replace("$org",l);return i.startsWith(p)},e[2]=l,e[3]=i,e[4]=c):c=e[4];const m=c;let o;e[5]!==l?(o={org:l},e[5]=l,e[6]=o):o=e[6];let a,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(q,{size:14}),d=s.jsx("span",{children:"Settings"}),e[7]=a,e[8]=d):(a=e[7],d=e[8]);let f;e[9]!==o?(f=s.jsx(w,{className:"pt-0 pr-0 pb-3 md:pb-3 pl-0",children:s.jsx(C,{children:s.jsx(O,{className:"gap-1.5",children:s.jsx(P,{children:s.jsx(M,{asChild:!0,children:s.jsxs(z,{to:"/$org",params:o,className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a,d]})})})})})}),e[9]=o,e[10]=f):f=e[10];let h;if(e[11]!==t||e[12]!==m||e[13]!==l){let _;e[15]!==m||e[16]!==l?(_=(p,S)=>s.jsxs(w,{className:"pt-0 pr-0 pb-0 pl-0",children:[p.label&&s.jsx("p",{className:$("px-2 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",S>0&&"mt-3"),children:p.label}),s.jsx(C,{children:s.jsx(O,{className:"gap-0.5",children:p.items.map(u=>s.jsx(P,{children:s.jsx(M,{asChild:!0,isActive:m(u.to),children:s.jsxs(z,{to:u.to,params:{org:l},onClick:()=>T("settings_nav_clicked",{section_key:u.key,section_label:u.label,group_label:p.label||"main"}),className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:u.icon}),s.jsx("span",{className:"truncate",children:u.label})]})})},u.key))})})]},`${p.label}-${S}`),e[15]=m,e[16]=l,e[17]=_):_=e[17],h=t.map(_),e[11]=t,e[12]=m,e[13]=l,e[14]=h}else h=e[14];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),e[18]=b):b=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(w,{className:"pt-0 pr-0 pb-0 pl-0",children:[b,s.jsx(C,{children:s.jsx(O,{className:"gap-0.5",children:s.jsx(P,{children:s.jsxs(M,{onClick:je,className:"flex items-center gap-2.5 text-sm",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})})})})]}),e[19]=x):x=e[19];let g;e[20]!==f||e[21]!==h?(g=s.jsxs(Y,{className:"flex flex-col flex-1 mt-2 px-2 pb-2 gap-0",children:[f,h,x]}),e[20]=f,e[21]=h,e[22]=g):g=e[22];let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.304.2"]})}),e[23]=y):y=e[23];let j;return e[24]!==g?(j=s.jsxs(Z,{variant:"sidebar",children:[g,y]}),e[24]=g,e[25]=j):j=e[25],j}function je(){T("signed_out",{source:"settings_sidebar"}),W.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=k.c(29),{onClose:n}=e,l=U();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org"},t[0]=r):r=t[0];const{org:i}=E(r);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c={select:ve},t[1]=c):c=t[1];const m=L(c);let o;t[2]!==i||t[3]!==m?(o=S=>{const u=S.replace("$org",i);return m.startsWith(u)},t[2]=i,t[3]=m,t[4]=o):o=t[4];const a=o;let d;t[5]!==i?(d={org:i},t[5]=i,t[6]=d):d=t[6];let f,h;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(q,{size:16,className:"shrink-0"}),h=s.jsx("span",{children:"Settings"}),t[7]=f,t[8]=h):(f=t[7],h=t[8]);let b;t[9]!==n||t[10]!==d?(b=s.jsx("div",{className:"flex items-center h-14 px-4 shrink-0 border-b border-border/50",children:s.jsxs(z,{to:"/$org",params:d,onClick:n,className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[f,h]})}),t[9]=n,t[10]=d,t[11]=b):b=t[11];let x;if(t[12]!==l||t[13]!==a||t[14]!==n||t[15]!==i){let S;t[17]!==a||t[18]!==n||t[19]!==i?(S=(u,v)=>s.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.label&&s.jsx("p",{className:$("px-3 pt-1.5 pb-0.5 text-xs font-medium text-muted-foreground/60",v>0&&"mt-3"),children:u.label}),u.items.map(N=>s.jsxs(z,{to:N.to,params:{org:i},onClick:n,className:$("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm",a(N.to)?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground"),children:[s.jsx("span",{className:"shrink-0",children:N.icon}),s.jsx("span",{className:"truncate",children:N.label})]},N.key))]},`${u.label}-${v}`),t[17]=a,t[18]=n,t[19]=i,t[20]=S):S=t[20],x=l.map(S),t[12]=l,t[13]=a,t[14]=n,t[15]=i,t[16]=x}else x=t[16];let g;t[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-px bg-border/50 my-2"}),t[21]=g):g=t[21];let y;t[22]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[g,s.jsxs("button",{type:"button",onClick:Se,className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("span",{className:"shrink-0",children:s.jsx(F,{size:14})}),s.jsx("span",{className:"truncate",children:"Sign Out"})]})]}),t[22]=y):y=t[22];let j;t[23]!==x?(j=s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto px-2 py-2 gap-0.5",children:[x,y]}),t[23]=x,t[24]=j):j=t[24];let _;t[25]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-border/50",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.304.2"]})}),t[25]=_):_=t[25];let p;return t[26]!==j||t[27]!==b?(p=s.jsxs("div",{className:"flex flex-col h-full bg-sidebar",children:[b,j,_]}),t[26]=j,t[27]=b,t[28]=p):p=t[28],p}function Se(){return W.signOut()}function ve(e){return e.location.pathname}function Ne(){const e=k.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("button",{type:"button",onClick:$e,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:s.jsx(ae,{size:16})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"shrink-0 flex items-center justify-between pl-1 pr-2 h-10",children:s.jsxs("div",{className:"flex items-center gap-0.5 min-w-0",children:[t,s.jsx("button",{type:"button",onClick:ke,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:s.jsx(de,{size:16})})]})}),e[1]=n):n=e[1],n}function ke(){return window.history.forward()}function $e(){return window.history.back()}function ze(e){const t=k.c(3),{onOpenSidebar:n}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ce,{size:20}),t[0]=l):l=t[0];let r;return t[1]!==n?(r=s.jsx("div",{className:"shrink-0 flex items-center justify-between px-3 h-12 bg-background border-b border-border",children:s.jsx("button",{type:"button",onClick:n,className:"flex size-8 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:l})}),t[1]=n,t[2]=r):r=t[2],r}function we(){const e=k.c(17),t=he(),{org:n}=R();ue(n.slug);const{setOpenMobile:l,openMobile:r}=X();if(t){let a;e[0]!==l?(a=s.jsx(ze,{onOpenSidebar:()=>l(!0)}),e[0]=l,e[1]=a):a=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(A,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(I,{})})})}),e[2]=d):d=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ee,{className:"sr-only",children:"Navigation"}),e[3]=f):f=e[3];let h;e[4]!==l?(h=s.jsxs(se,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[f,s.jsx(ye,{onClose:()=>l(!1)})]}),e[4]=l,e[5]=h):h=e[5];let b;e[6]!==r||e[7]!==l||e[8]!==h?(b=s.jsx(te,{open:r,onOpenChange:l,children:h}),e[6]=r,e[7]=l,e[8]=h,e[9]=b):b=e[9];let x;return e[10]!==a||e[11]!==b?(x=s.jsxs("div",{className:"flex flex-col flex-1 bg-background min-h-0",children:[a,d,b]}),e[10]=a,e[11]=b,e[12]=x):x=e[12],x}let i;e[13]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ne,{}),e[13]=i):i=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=$("flex flex-col h-full min-h-0 bg-background overflow-hidden","card-shadow","rounded-[0.75rem]"),e[14]=c):c=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(H,{size:20,className:"animate-spin text-muted-foreground"})}),e[15]=m):m=e[15];let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(s.Fragment,{children:[i,s.jsx("div",{className:"flex-1 min-h-0 p-1",children:s.jsx("div",{className:c,children:s.jsx(J.Suspense,{fallback:m,children:s.jsx("div",{className:"flex flex-1 items-center overflow-hidden rounded-[inherit]",children:s.jsx(A,{value:"p-0",children:s.jsx("div",{className:"flex-1 min-w-0 overflow-hidden h-full",children:s.jsx(I,{})})})})})})})]}),e[16]=o):o=e[16],o}function De(){const e=k.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={"--sidebar-width-icon":"3.5rem"},e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ge,{}),e[1]=n):n=e[1];let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{defaultOpen:!0,children:s.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:s.jsxs(Q,{className:"flex-1 bg-sidebar",style:t,children:[n,s.jsx(V,{className:"flex flex-col",style:{background:"transparent",containerType:"inline-size"},children:s.jsx(we,{})})]})})}),e[2]=l):l=e[2],l}export{ge as SettingsSidebar,ye as SettingsSidebarMobile,De as default};
@@ -1 +1 @@
1
- import{e as N,c as v,r as S,j as r}from"./index-D4IWA9IU.js";import{C as w}from"./card-oNblR0HO.js";import{i as E}from"./ArrowUpRight-lTwxwkJA.js";function I(c){const e=N.c(11),{title:i,description:l,docsHref:t,actions:s,className:n,children:o}=c;let a;e[0]!==n?(a=v("flex flex-col gap-3",n),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==i?(d=(i||l||t||s)&&r.jsxs("div",{className:"flex items-center justify-between gap-3 px-4",children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=i,e[6]=d):d=e[6];let m;return e[7]!==o||e[8]!==a||e[9]!==d?(m=r.jsxs("section",{className:a,children:[d,o]}),e[7]=o,e[8]=a,e[9]=d,e[10]=m):m=e[10],m}function P(c){const e=N.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const a=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=v("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=a.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let o;return e[7]!==t||e[8]!==s||e[9]!==n?(o=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=o):o=e[10],o}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=N.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:o,children:a}=c,d=a?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",m=n&&"hover:bg-muted/50 cursor-pointer";let f;e[0]!==o||e[1]!==d||e[2]!==m?(f=v(d,m,o),e[0]=o,e[1]=d,e[2]=m,e[3]=f):f=e[3];const b=n?"button":void 0,k=n?0:void 0;let x;e[4]!==n?(x=n?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==a||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,a]}),e[12]=a,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==k||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:f,onClick:n,role:b,tabIndex:k,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=f,e[22]=b,e[23]=k,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=N.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=v("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=N.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=v("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,H as c,K as d};
1
+ import{e as N,c as v,r as S,j as r}from"./index-B3pJqV9Y.js";import{C as w}from"./card-DxIIO9TM.js";import{i as E}from"./ArrowUpRight-C7hCAEbW.js";function I(c){const e=N.c(11),{title:i,description:l,docsHref:t,actions:s,className:n,children:o}=c;let a;e[0]!==n?(a=v("flex flex-col gap-3",n),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==i?(d=(i||l||t||s)&&r.jsxs("div",{className:"flex items-center justify-between gap-3 px-4",children:[r.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i&&r.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:i}),(l||t)&&r.jsxs("p",{className:"text-sm text-muted-foreground leading-snug",children:[l,t&&r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 ml-1 text-foreground hover:underline",children:["Docs ",r.jsx(E,{size:12})]})]})]}),s&&r.jsx("div",{className:"shrink-0",children:s})]}),e[2]=s,e[3]=l,e[4]=t,e[5]=i,e[6]=d):d=e[6];let m;return e[7]!==o||e[8]!==a||e[9]!==d?(m=r.jsxs("section",{className:a,children:[d,o]}),e[7]=o,e[8]=a,e[9]=d,e[10]=m):m=e[10],m}function P(c){const e=N.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const a=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=v("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=a.map($),e[0]=l,e[1]=i,e[2]=t,e[3]=s,e[4]=n}else t=e[2],s=e[3],n=e[4];let o;return e[7]!==t||e[8]!==s||e[9]!==n?(o=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=o):o=e[10],o}function $(c,e){return r.jsxs("div",{children:[e>0&&r.jsx("div",{className:"h-px bg-border mx-5"}),c]},e)}function R(c){const e=N.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:o,children:a}=c,d=a?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",m=n&&"hover:bg-muted/50 cursor-pointer";let f;e[0]!==o||e[1]!==d||e[2]!==m?(f=v(d,m,o),e[0]=o,e[1]=d,e[2]=m,e[3]=f):f=e[3];const b=n?"button":void 0,k=n?0:void 0;let x;e[4]!==n?(x=n?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),n())}:void 0,e[4]=n,e[5]=x):x=e[5];let p;e[6]!==i?(p=i&&r.jsx("div",{className:"size-8 shrink-0 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:i}),e[6]=i,e[7]=p):p=e[7];let u;e[8]!==l?(u=r.jsx("div",{className:"text-sm font-medium",children:l}),e[8]=l,e[9]=u):u=e[9];let h;e[10]!==t?(h=t&&r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t}),e[10]=t,e[11]=h):h=e[11];let g;e[12]!==a||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,a]}),e[12]=a,e[13]=u,e[14]=h,e[15]=g):g=e[15];let j;e[16]!==s?(j=s&&r.jsx("div",{className:"shrink-0",onClick:D,children:s}),e[16]=s,e[17]=j):j=e[17];let y;return e[18]!==n||e[19]!==g||e[20]!==j||e[21]!==f||e[22]!==b||e[23]!==k||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:f,onClick:n,role:b,tabIndex:k,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=f,e[22]=b,e[23]=k,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=N.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=v("flex items-center justify-end gap-2 px-4 py-4",l),e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==i||e[3]!==t?(s=r.jsx("div",{className:t,children:i}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}function K(c){const e=N.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=v("flex flex-col gap-10",i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==l||e[3]!==t?(s=r.jsx("div",{className:t,children:l}),e[2]=l,e[3]=t,e[4]=s):s=e[4],s}export{I as S,P as a,R as b,H as c,K as d};
@@ -1 +1 @@
1
- import{e as w,j as s,bj as P,K as C,B as N,f as K,o as E,s as M,g as R,d as I,a1 as L,r as T,w as q,b as A,R as $,S as z,O as F,bk as U}from"./index-D4IWA9IU.js";import{a as G,c as B,d as H,b as Q}from"./dialog-ReVTOuxu.js";import{R as Y}from"./required-auth-layout-CfAoaltR.js";import{u as W}from"./use-tasks-M1RmMNT7.js";import{b as V}from"./use-organization-settings-DngIHmBy.js";import{u as J}from"./use-org-sso-2mlDJ8c4.js";import{i as X}from"./Lock01-C5rgxGgu.js";const D=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),O=D?"⌘":"Ctrl",b={keyboardShortcuts:{keys:[O,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[O,"L"],description:"Focus chat input"},saveAndFormat:{keys:[O,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[O,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[O,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",O,"S"],description:"New task"},toggleDaemon:{keys:[O,"D"],description:"Toggle daemon logs"}},Z=[{label:"General",shortcuts:[b.keyboardShortcuts,b.newTask,b.toggleDaemon]},{label:"Editor",shortcuts:[b.saveAndFormat]},{label:"Chat",shortcuts:[b.focusChatInput,b.togglePlanMode,b.sendMessage,b.newLine]},{label:"Questions",shortcuts:[b.selectOption]},{label:"Monitoring",shortcuts:[b.applyFilter]}];function ee(e){return D?e.metaKey:e.ctrlKey}function te(e){const t=w.c(5),{open:o,onOpenChange:i}=e;let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(B,{children:s.jsx(H,{children:"Keyboard Shortcuts"})}),t[0]=d):d=t[0];let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(G,{className:"sm:max-w-md",children:[d,s.jsx("div",{className:"flex flex-col gap-4",children:Z.map(se)})]}),t[1]=c):c=t[1];let l;return t[2]!==i||t[3]!==o?(l=s.jsx(Q,{open:o,onOpenChange:i,children:c}),t[2]=i,t[3]=o,t[4]=l):l=t[4],l}function se(e){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:e.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:e.shortcuts.map(ne)})]},e.label)}function ne(e){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:e.description}),s.jsx("div",{className:"flex items-center gap-1",children:e.keys.map(oe)})]},e.description)}function oe(e){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:e},e)}function ae({activeOrg:e}){return e&&P(e.id,{name:e.name??void 0,slug:e.slug??void 0}),null}function ie(e,t,o){if(!o)return null;const i=e.getQueriesData({queryKey:C.tasksPrefix(t)});for(const[,d]of i){const c=d?.items?.find(l=>l.id===o);if(c?.branch)return c.branch}return null}function re(e){const t=w.c(17),{orgSlug:o,orgName:i,domain:d}=e;let c;t[0]!==o?(c=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},t[0]=o,t[1]=c):c=t[1];const l=c,h=le;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(X,{className:"h-6 w-6 text-primary"})}),t[2]=u):u=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),t[3]=f):f=t[3];let p;t[4]!==d||t[5]!==i?(p=i?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:i})," requires SSO authentication",d?` via ${d}`:"","."]}):"This organization requires SSO authentication to access.",t[4]=d,t[5]=i,t[6]=p):p=t[6];let n;t[7]!==p?(n=s.jsxs("div",{className:"space-y-2",children:[f,s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]}),t[7]=p,t[8]=n):n=t[8];let y;t[9]!==l?(y=s.jsx(N,{onClick:l,children:"Sign in with SSO"}),t[9]=l,t[10]=y):y=t[10];let k;t[11]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(N,{variant:"ghost",onClick:h,children:"Go back"}),t[11]=k):k=t[11];let x;t[12]!==y?(x=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[y,k]}),t[12]=y,t[13]=x):x=t[13];let j;return t[14]!==n||t[15]!==x?(j=s.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:s.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[u,n,x]})}),t[14]=n,t[15]=x,t[16]=j):j=t[16],j}function le(){window.location.href="/"}function ce(e){const t=w.c(8),{org:o,children:i}=e,c=V(o.id,o.slug)?.enabled_plugins??null;let l;t[0]!==o.id||t[1]!==o.name||t[2]!==c?(l={id:o.id,organizationId:o.id,slug:"_org",name:o.name,enabledPlugins:c,ui:null},t[0]=o.id,t[1]=o.name,t[2]=c,t[3]=l):l=t[3];const h=l;let u;return t[4]!==i||t[5]!==o||t[6]!==h?(u=s.jsx(U,{org:o,project:h,children:i}),t[4]=i,t[5]=o,t[6]=h,t[7]=u):u=t[7],u}function ue(){const e=K(),t=E(),o=W(),{locator:i}=M(),d=R({strict:!1}),c=I({strict:!1}),l=d.org??"",h=d.taskId??"",u=(a,r,m=!0)=>e({to:"/$org/$taskId",params:{org:l,taskId:a},search:r,replace:m}),f=(a,r=!0)=>u(h,a,r),p=a=>f(r=>({...r,chat:a?1:0})),n=a=>f(r=>({...r,tasks:a?1:0})),y=(a,r)=>u(a,m=>{const S={chat:1};return r?S.virtualmcpid=r:m.virtualmcpid&&(S.virtualmcpid=m.virtualmcpid),m.tasks&&(S.tasks=m.tasks),m.main&&(S.main=m.main),S},!1);return{setChatOpen:p,setTasksOpen:n,setTaskId:y,createNewTask:async()=>{const a=crypto.randomUUID(),r=ie(t,i,h),m=c.virtualmcpid;try{await o.create.mutateAsync({id:a,...m?{virtual_mcp_id:m}:{},...r?{branch:r}:{}})}catch{}y(a)},openTab:a=>u(h||crypto.randomUUID(),r=>({...r,main:a})),toggleMain:()=>f(a=>{if(a.main!==void 0&&a.main!=="0")return{...a,main:"0"};const m={...a};return delete m.main,m})}}function de(){const e=w.c(28);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org",shouldThrow:!1},e[0]=t):t=e[0];const i=L(t)?.params.org,[d,c]=T.useState(!1);let l,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const g=v=>{ee(v)&&v.code==="KeyK"&&(v.preventDefault(),c(!0))};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},h=[],e[1]=l,e[2]=h):(l=e[1],h=e[2]),T.useEffect(l,h);let u;e[3]!==i?(u=C.activeOrganization(i),e[3]=i,e[4]=u):u=e[4];let f;e[5]!==i?(f=async()=>{if(!i)return null;const{data:g}=await A.organization.getFullOrganization({query:{organizationSlug:i}});return g&&localStorage.setItem($.lastOrgSlug(),i),g},e[5]=i,e[6]=f):f=e[6];let p;e[7]!==u||e[8]!==f?(p={queryKey:u,queryFn:f,gcTime:1/0,refetchOnWindowFocus:!1},e[7]=u,e[8]=f,e[9]=p):p=e[9];const{data:n}=q(p),y=n?.id,k=n?.slug,{data:x}=J(y,k);if(!n){let g;return e[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(z,{}),e[10]=g):g=e[10],g}if(x?.ssoRequired&&!x.authenticated){let g;return e[11]!==n.id||e[12]!==n.name||e[13]!==n.slug||e[14]!==x.domain?(g=s.jsx(re,{orgId:n.id,orgSlug:n.slug,orgName:n.name,domain:x.domain}),e[11]=n.id,e[12]=n.name,e[13]=n.slug,e[14]=x.domain,e[15]=g):g=e[15],g}const j=n.logo??null;let a;e[16]!==n||e[17]!==j?(a={...n,logo:j},e[16]=n,e[17]=j,e[18]=a):a=e[18];let r;e[19]!==n?(r=s.jsx(ae,{activeOrg:n}),e[19]=n,e[20]=r):r=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(F,{}),e[21]=m):m=e[21];let S;e[22]!==d?(S=s.jsx(te,{open:d,onOpenChange:c}),e[22]=d,e[23]=S):S=e[23];let _;return e[24]!==S||e[25]!==a||e[26]!==r?(_=s.jsxs(ce,{org:a,children:[r,m,S]}),e[24]=S,e[25]=a,e[26]=r,e[27]=_):_=e[27],_}function me(){const e=w.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Y,{children:s.jsx(de,{})}),e[0]=t):t=e[0],t}const be=Object.freeze(Object.defineProperty({__proto__:null,default:me,usePanelActions:ue},Symbol.toStringTag,{value:"Module"}));export{ee as i,ie as r,be as s,ue as u};
1
+ import{e as w,j as s,bj as P,K as C,B as N,f as K,o as E,s as M,g as R,d as I,a1 as L,r as T,w as q,b as A,R as $,S as z,O as F,bk as U}from"./index-B3pJqV9Y.js";import{a as G,c as B,d as H,b as Q}from"./dialog-DJXnl186.js";import{R as Y}from"./required-auth-layout-BqWuvVf2.js";import{u as W}from"./use-tasks-D-yLjF43.js";import{b as V}from"./use-organization-settings-C8pMgrh-.js";import{u as J}from"./use-org-sso-SjyAvOWA.js";import{i as X}from"./Lock01-NMXz4ptn.js";const D=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),O=D?"⌘":"Ctrl",b={keyboardShortcuts:{keys:[O,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[O,"L"],description:"Focus chat input"},saveAndFormat:{keys:[O,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[O,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[O,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",O,"S"],description:"New task"},toggleDaemon:{keys:[O,"D"],description:"Toggle daemon logs"}},Z=[{label:"General",shortcuts:[b.keyboardShortcuts,b.newTask,b.toggleDaemon]},{label:"Editor",shortcuts:[b.saveAndFormat]},{label:"Chat",shortcuts:[b.focusChatInput,b.togglePlanMode,b.sendMessage,b.newLine]},{label:"Questions",shortcuts:[b.selectOption]},{label:"Monitoring",shortcuts:[b.applyFilter]}];function ee(e){return D?e.metaKey:e.ctrlKey}function te(e){const t=w.c(5),{open:o,onOpenChange:i}=e;let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(B,{children:s.jsx(H,{children:"Keyboard Shortcuts"})}),t[0]=d):d=t[0];let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(G,{className:"sm:max-w-md",children:[d,s.jsx("div",{className:"flex flex-col gap-4",children:Z.map(se)})]}),t[1]=c):c=t[1];let l;return t[2]!==i||t[3]!==o?(l=s.jsx(Q,{open:o,onOpenChange:i,children:c}),t[2]=i,t[3]=o,t[4]=l):l=t[4],l}function se(e){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:e.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:e.shortcuts.map(ne)})]},e.label)}function ne(e){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:e.description}),s.jsx("div",{className:"flex items-center gap-1",children:e.keys.map(oe)})]},e.description)}function oe(e){return s.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:e},e)}function ae({activeOrg:e}){return e&&P(e.id,{name:e.name??void 0,slug:e.slug??void 0}),null}function ie(e,t,o){if(!o)return null;const i=e.getQueriesData({queryKey:C.tasksPrefix(t)});for(const[,d]of i){const c=d?.items?.find(l=>l.id===o);if(c?.branch)return c.branch}return null}function re(e){const t=w.c(17),{orgSlug:o,orgName:i,domain:d}=e;let c;t[0]!==o?(c=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},t[0]=o,t[1]=c):c=t[1];const l=c,h=le;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(X,{className:"h-6 w-6 text-primary"})}),t[2]=u):u=t[2];let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),t[3]=f):f=t[3];let p;t[4]!==d||t[5]!==i?(p=i?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:i})," requires SSO authentication",d?` via ${d}`:"","."]}):"This organization requires SSO authentication to access.",t[4]=d,t[5]=i,t[6]=p):p=t[6];let n;t[7]!==p?(n=s.jsxs("div",{className:"space-y-2",children:[f,s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]}),t[7]=p,t[8]=n):n=t[8];let y;t[9]!==l?(y=s.jsx(N,{onClick:l,children:"Sign in with SSO"}),t[9]=l,t[10]=y):y=t[10];let k;t[11]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(N,{variant:"ghost",onClick:h,children:"Go back"}),t[11]=k):k=t[11];let x;t[12]!==y?(x=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[y,k]}),t[12]=y,t[13]=x):x=t[13];let j;return t[14]!==n||t[15]!==x?(j=s.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:s.jsxs("div",{className:"flex flex-col items-center text-center space-y-4 max-w-sm px-6",children:[u,n,x]})}),t[14]=n,t[15]=x,t[16]=j):j=t[16],j}function le(){window.location.href="/"}function ce(e){const t=w.c(8),{org:o,children:i}=e,c=V(o.id,o.slug)?.enabled_plugins??null;let l;t[0]!==o.id||t[1]!==o.name||t[2]!==c?(l={id:o.id,organizationId:o.id,slug:"_org",name:o.name,enabledPlugins:c,ui:null},t[0]=o.id,t[1]=o.name,t[2]=c,t[3]=l):l=t[3];const h=l;let u;return t[4]!==i||t[5]!==o||t[6]!==h?(u=s.jsx(U,{org:o,project:h,children:i}),t[4]=i,t[5]=o,t[6]=h,t[7]=u):u=t[7],u}function ue(){const e=K(),t=E(),o=W(),{locator:i}=M(),d=R({strict:!1}),c=I({strict:!1}),l=d.org??"",h=d.taskId??"",u=(a,r,m=!0)=>e({to:"/$org/$taskId",params:{org:l,taskId:a},search:r,replace:m}),f=(a,r=!0)=>u(h,a,r),p=a=>f(r=>({...r,chat:a?1:0})),n=a=>f(r=>({...r,tasks:a?1:0})),y=(a,r)=>u(a,m=>{const S={chat:1};return r?S.virtualmcpid=r:m.virtualmcpid&&(S.virtualmcpid=m.virtualmcpid),m.tasks&&(S.tasks=m.tasks),m.main&&(S.main=m.main),S},!1);return{setChatOpen:p,setTasksOpen:n,setTaskId:y,createNewTask:async()=>{const a=crypto.randomUUID(),r=ie(t,i,h),m=c.virtualmcpid;try{await o.create.mutateAsync({id:a,...m?{virtual_mcp_id:m}:{},...r?{branch:r}:{}})}catch{}y(a)},openTab:a=>u(h||crypto.randomUUID(),r=>({...r,main:a})),toggleMain:()=>f(a=>{if(a.main!==void 0&&a.main!=="0")return{...a,main:"0"};const m={...a};return delete m.main,m})}}function de(){const e=w.c(28);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org",shouldThrow:!1},e[0]=t):t=e[0];const i=L(t)?.params.org,[d,c]=T.useState(!1);let l,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const g=v=>{ee(v)&&v.code==="KeyK"&&(v.preventDefault(),c(!0))};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},h=[],e[1]=l,e[2]=h):(l=e[1],h=e[2]),T.useEffect(l,h);let u;e[3]!==i?(u=C.activeOrganization(i),e[3]=i,e[4]=u):u=e[4];let f;e[5]!==i?(f=async()=>{if(!i)return null;const{data:g}=await A.organization.getFullOrganization({query:{organizationSlug:i}});return g&&localStorage.setItem($.lastOrgSlug(),i),g},e[5]=i,e[6]=f):f=e[6];let p;e[7]!==u||e[8]!==f?(p={queryKey:u,queryFn:f,gcTime:1/0,refetchOnWindowFocus:!1},e[7]=u,e[8]=f,e[9]=p):p=e[9];const{data:n}=q(p),y=n?.id,k=n?.slug,{data:x}=J(y,k);if(!n){let g;return e[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(z,{}),e[10]=g):g=e[10],g}if(x?.ssoRequired&&!x.authenticated){let g;return e[11]!==n.id||e[12]!==n.name||e[13]!==n.slug||e[14]!==x.domain?(g=s.jsx(re,{orgId:n.id,orgSlug:n.slug,orgName:n.name,domain:x.domain}),e[11]=n.id,e[12]=n.name,e[13]=n.slug,e[14]=x.domain,e[15]=g):g=e[15],g}const j=n.logo??null;let a;e[16]!==n||e[17]!==j?(a={...n,logo:j},e[16]=n,e[17]=j,e[18]=a):a=e[18];let r;e[19]!==n?(r=s.jsx(ae,{activeOrg:n}),e[19]=n,e[20]=r):r=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(F,{}),e[21]=m):m=e[21];let S;e[22]!==d?(S=s.jsx(te,{open:d,onOpenChange:c}),e[22]=d,e[23]=S):S=e[23];let _;return e[24]!==S||e[25]!==a||e[26]!==r?(_=s.jsxs(ce,{org:a,children:[r,m,S]}),e[24]=S,e[25]=a,e[26]=r,e[27]=_):_=e[27],_}function me(){const e=w.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Y,{children:s.jsx(de,{})}),e[0]=t):t=e[0],t}const be=Object.freeze(Object.defineProperty({__proto__:null,default:me,usePanelActions:ue},Symbol.toStringTag,{value:"Module"}));export{ee as i,ie as r,be as s,ue as u};
@@ -1 +1 @@
1
- import{e as n,c,j as i}from"./index-D4IWA9IU.js";function m(o){const e=n.c(8);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=c("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=l):l=e[4];let a;return e[5]!==t||e[6]!==l?(a=i.jsx("div",{"data-slot":"skeleton",className:l,...t}),e[5]=t,e[6]=l,e[7]=a):a=e[7],a}export{m as S};
1
+ import{e as n,c,j as i}from"./index-B3pJqV9Y.js";function m(o){const e=n.c(8);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=c("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=l):l=e[4];let a;return e[5]!==t||e[6]!==l?(a=i.jsx("div",{"data-slot":"skeleton",className:l,...t}),e[5]=t,e[6]=l,e[7]=a):a=e[7],a}export{m as S};
@@ -1 +1 @@
1
- import{s as N,r as j,j as e,B as g,t as S,x as c,e as b}from"./index-D4IWA9IU.js";import{D as k}from"./domain-settings-_aY4XST2.js";import{P as x}from"./index-BET8kMZe.js";import{I as l}from"./input-DhXllgVP.js";import{S as z}from"./switch-D9uEYoPa.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-2mlDJ8c4.js";import{d as F,S as y,a as C,b as a,c as O}from"./settings-section-DkPpouMA.js";import{s as L}from"./Trash01-CFncShuD.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./constants-B22iOAkD.js";import"./tooltip-B5FrLY14.js";import"./X-BNOerUAB.js";import"./card-oNblR0HO.js";import"./ArrowUpRight-lTwxwkJA.js";function B(){const{org:t}=N(),{data:r,isLoading:E}=P(t.id,t.slug),f=R(t.id,t.slug),h=A(t.id,t.slug),v=T(t.id,t.slug),[s,d]=j.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[m,p]=j.useState(!1),u=r?.configured&&r.config,o=r?.config,I=()=>{o&&d({issuer:o.issuer,clientId:o.clientId,clientSecret:"",discoveryEndpoint:o.discoveryEndpoint??"",domain:o.domain,scopes:o.scopes.join(" ")}),p(!0)},w=async()=>{if(!s.issuer||!s.clientId||!s.domain){c.error("Issuer, Client ID, and Domain are required");return}if(!u&&!s.clientSecret){c.error("Client Secret is required for initial setup");return}try{await f.mutateAsync({issuer:s.issuer,clientId:s.clientId,clientSecret:s.clientSecret,discoveryEndpoint:s.discoveryEndpoint||void 0,scopes:s.scopes.split(/\s+/).filter(Boolean),domain:s.domain,enforced:o?.enforced??!1}),S(u?"sso_config_updated":"sso_configured",{organization_id:t.id,email_domain:s.domain}),c.success("SSO configuration saved"),p(!1)}catch(i){c.error(i instanceof Error?i.message:"Failed to save SSO config")}},_=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await h.mutateAsync(),S("sso_config_removed",{organization_id:t.id}),c.success("SSO configuration removed"),p(!1)}catch{c.error("Failed to remove SSO config")}},D=async i=>{try{await v.mutateAsync(i),S("sso_enforcement_toggled",{organization_id:t.id,enforced:i}),c.success(i?"SSO enforcement enabled":"SSO enforcement disabled")}catch{c.error("Failed to toggle SSO enforcement")}};return e.jsx(x,{children:e.jsx(x.Content,{children:e.jsx(x.Body,{children:e.jsxs(F,{children:[e.jsx(x.Title,{children:"Security"}),e.jsx(k,{}),E?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[u&&!m&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(a,{title:"Provider",action:e.jsx("span",{className:"font-medium",children:o.issuer})}),e.jsx(a,{title:"Client ID",action:e.jsx("span",{className:"font-mono text-xs",children:o.clientId})}),e.jsx(a,{title:"Domain",action:e.jsx("span",{className:"font-medium",children:o.domain})}),e.jsx(a,{title:"Scopes",action:e.jsx("span",{className:"font-mono text-xs",children:o.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:"Enforce SSO",description:"Require all members to authenticate via SSO",action:e.jsx(z,{checked:o.enforced,onCheckedChange:D,disabled:v.isPending})}),e.jsxs(O,{children:[e.jsxs(g,{variant:"ghost",size:"sm",onClick:_,disabled:h.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(L,{size:14}),"Remove"]}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${t.slug}/sso/authorize`,"_blank")},children:"Test SSO"}),e.jsx(g,{variant:"outline",size:"sm",onClick:I,children:"Edit configuration"})]})]})}),(!u||m)&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(a,{title:"Issuer URL",description:"The OIDC issuer URL of your identity provider.",action:e.jsx(l,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:s.issuer,onChange:i=>d(n=>({...n,issuer:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Client ID",action:e.jsx(l,{id:"sso-client-id",placeholder:"your-client-id",value:s.clientId,onChange:i=>d(n=>({...n,clientId:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Client Secret",description:m&&u?"Leave empty to keep current":void 0,action:e.jsx(l,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:s.clientSecret,onChange:i=>d(n=>({...n,clientSecret:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Email Domain",description:"The email domain this SSO provider covers.",action:e.jsx(l,{id:"sso-domain",placeholder:"company.com",value:s.domain,onChange:i=>d(n=>({...n,domain:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Scopes",action:e.jsx(l,{id:"sso-scopes",placeholder:"openid email profile",value:s.scopes,onChange:i=>d(n=>({...n,scopes:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Discovery Endpoint",description:"Optional — auto-detected from issuer if omitted.",action:e.jsx(l,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:s.discoveryEndpoint,onChange:i=>d(n=>({...n,discoveryEndpoint:i.target.value})),className:"w-[280px]"})}),e.jsxs(O,{children:[m&&e.jsx(g,{variant:"outline",size:"sm",onClick:()=>p(!1),children:"Cancel"}),e.jsx(g,{onClick:w,disabled:f.isPending,size:"sm",children:f.isPending?"Saving...":m?"Update":"Configure SSO"})]})]})})]})]})})})})}function ee(){const t=b.c(1);let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(B,{}),t[0]=r):r=t[0],r}export{ee as default};
1
+ import{s as N,r as j,j as e,B as g,t as S,x as c,e as b}from"./index-B3pJqV9Y.js";import{D as k}from"./domain-settings-B6gsJfGm.js";import{P as x}from"./index-C7apxcAd.js";import{I as l}from"./input-DylFJb_s.js";import{S as z}from"./switch-BL_ICveF.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-SjyAvOWA.js";import{d as F,S as y,a as C,b as a,c as O}from"./settings-section-XEp6UNJA.js";import{s as L}from"./Trash01-UTo49HDl.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./constants-DzBa_pVv.js";import"./tooltip-DZIo6YZX.js";import"./X-CeTLIvc6.js";import"./card-DxIIO9TM.js";import"./ArrowUpRight-C7hCAEbW.js";function B(){const{org:t}=N(),{data:r,isLoading:E}=P(t.id,t.slug),f=R(t.id,t.slug),h=A(t.id,t.slug),v=T(t.id,t.slug),[s,d]=j.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[m,p]=j.useState(!1),u=r?.configured&&r.config,o=r?.config,I=()=>{o&&d({issuer:o.issuer,clientId:o.clientId,clientSecret:"",discoveryEndpoint:o.discoveryEndpoint??"",domain:o.domain,scopes:o.scopes.join(" ")}),p(!0)},w=async()=>{if(!s.issuer||!s.clientId||!s.domain){c.error("Issuer, Client ID, and Domain are required");return}if(!u&&!s.clientSecret){c.error("Client Secret is required for initial setup");return}try{await f.mutateAsync({issuer:s.issuer,clientId:s.clientId,clientSecret:s.clientSecret,discoveryEndpoint:s.discoveryEndpoint||void 0,scopes:s.scopes.split(/\s+/).filter(Boolean),domain:s.domain,enforced:o?.enforced??!1}),S(u?"sso_config_updated":"sso_configured",{organization_id:t.id,email_domain:s.domain}),c.success("SSO configuration saved"),p(!1)}catch(i){c.error(i instanceof Error?i.message:"Failed to save SSO config")}},_=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await h.mutateAsync(),S("sso_config_removed",{organization_id:t.id}),c.success("SSO configuration removed"),p(!1)}catch{c.error("Failed to remove SSO config")}},D=async i=>{try{await v.mutateAsync(i),S("sso_enforcement_toggled",{organization_id:t.id,enforced:i}),c.success(i?"SSO enforcement enabled":"SSO enforcement disabled")}catch{c.error("Failed to toggle SSO enforcement")}};return e.jsx(x,{children:e.jsx(x.Content,{children:e.jsx(x.Body,{children:e.jsxs(F,{children:[e.jsx(x.Title,{children:"Security"}),e.jsx(k,{}),E?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[u&&!m&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(a,{title:"Provider",action:e.jsx("span",{className:"font-medium",children:o.issuer})}),e.jsx(a,{title:"Client ID",action:e.jsx("span",{className:"font-mono text-xs",children:o.clientId})}),e.jsx(a,{title:"Domain",action:e.jsx("span",{className:"font-medium",children:o.domain})}),e.jsx(a,{title:"Scopes",action:e.jsx("span",{className:"font-mono text-xs",children:o.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:"Enforce SSO",description:"Require all members to authenticate via SSO",action:e.jsx(z,{checked:o.enforced,onCheckedChange:D,disabled:v.isPending})}),e.jsxs(O,{children:[e.jsxs(g,{variant:"ghost",size:"sm",onClick:_,disabled:h.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(L,{size:14}),"Remove"]}),e.jsx(g,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${t.slug}/sso/authorize`,"_blank")},children:"Test SSO"}),e.jsx(g,{variant:"outline",size:"sm",onClick:I,children:"Edit configuration"})]})]})}),(!u||m)&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(a,{title:"Issuer URL",description:"The OIDC issuer URL of your identity provider.",action:e.jsx(l,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:s.issuer,onChange:i=>d(n=>({...n,issuer:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Client ID",action:e.jsx(l,{id:"sso-client-id",placeholder:"your-client-id",value:s.clientId,onChange:i=>d(n=>({...n,clientId:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Client Secret",description:m&&u?"Leave empty to keep current":void 0,action:e.jsx(l,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:s.clientSecret,onChange:i=>d(n=>({...n,clientSecret:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Email Domain",description:"The email domain this SSO provider covers.",action:e.jsx(l,{id:"sso-domain",placeholder:"company.com",value:s.domain,onChange:i=>d(n=>({...n,domain:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Scopes",action:e.jsx(l,{id:"sso-scopes",placeholder:"openid email profile",value:s.scopes,onChange:i=>d(n=>({...n,scopes:i.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:"Discovery Endpoint",description:"Optional — auto-detected from issuer if omitted.",action:e.jsx(l,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:s.discoveryEndpoint,onChange:i=>d(n=>({...n,discoveryEndpoint:i.target.value})),className:"w-[280px]"})}),e.jsxs(O,{children:[m&&e.jsx(g,{variant:"outline",size:"sm",onClick:()=>p(!1),children:"Cancel"}),e.jsx(g,{onClick:w,disabled:f.isPending,size:"sm",children:f.isPending?"Saving...":m?"Update":"Configure SSO"})]})]})})]})]})})})})}function ee(){const t=b.c(1);let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(B,{}),t[0]=r):r=t[0],r}export{ee as default};
@@ -1 +1 @@
1
- import{e as D,j as s,E as le,r as K,s as ae,o as ce,f as de,g as me,B as Y,t as te,K as fe,a as ge,x as ie}from"./index-D4IWA9IU.js";import{i as ue}from"./AlertCircle-BeiDn4Fp.js";import{i as pe}from"./ChevronRight-DEybByBs.js";import{s as xe}from"./Plus-DlISHBLe.js";import{s as he}from"./Trash01-CFncShuD.js";import{I as X}from"./input-DhXllgVP.js";import{S as ne}from"./switch-D9uEYoPa.js";import{S as ye}from"./skeleton-DCMX-VkN.js";import{A as oe}from"./avatar-C6HNjGDg.js";import{b as je,P as Ce,a as Se}from"./popover-DQq9bf6V.js";import{b as re}from"./use-connection-Dy5vq_5j.js";import{d as Z}from"./constants-B22iOAkD.js";import{P as G}from"./index-BET8kMZe.js";import{u as ve}from"./use-registry-connections-CDM-gpri.js";import{g as _e,h as be}from"./use-organization-settings-DngIHmBy.js";import{d as Pe,b as I,S as ee,a as Q}from"./settings-section-DkPpouMA.js";import"./User01-Bq8r53VC.js";import"./use-collections-DKWG5Tun.js";import"./tooltip-B5FrLY14.js";import"./X-BNOerUAB.js";import"./card-oNblR0HO.js";import"./ArrowUpRight-lTwxwkJA.js";function Re(t){const e=D.c(3),{error:n}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let o;return e[1]!==n.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",n.message]})]}),e[1]=n.message,e[2]=o):o=e[2],o}function ke(t){const e=D.c(36),{onCancel:n,onSuccess:m}=t,o=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==o||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await o.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=o,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:we},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==n?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:n,disabled:d,children:"Cancel"}),e[19]=d,e[20]=n,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function we(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:n,description:m,icon:o,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==o||e[8]!==n?(c=o?s.jsx("img",{src:o,alt:n,className:"size-8 rounded-md object-contain"}):s.jsx(oe,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=o,e[8]=n,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Ae,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(ne,{checked:r,onClick:Ne,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==n||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:n,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=n,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ne(t){return t.stopPropagation()}function Ae(t){return t.stopPropagation()}function Me(){const t=D.c(59),{org:e}=ae(),n=ve(),m=re(),o=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==o||t[4]!==n||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!o)return i===p;const w=o.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=n.find(i=>i.id===p),k=n.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=n.filter(i=>!B.has(i.id));let R;t[13]!==o||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=o??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=o,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const H=C;let U;t[20]!==o||t[21]!==r?(U=async i=>{S(!1);const w=o??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=o,t[21]=r,t[22]=U):U=t[22];const W=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==W||t[28]!==a?(T=a&&s.jsx(ke,{onCancel:()=>S(!1),onSuccess:W}),t[27]=W,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let q;t[37]!==H||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>H(i.id)},i.id),t[37]=H,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(oe,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(ne,{checked:!1,disabled:!0,onCheckedChange:Te})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=o,t[4]=n,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function Te(){}function ze(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(le,{fallback:Ee,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Me,{})]})})})})})}),t[1]=n):n=t[1],n}function Ee(t){const{error:e}=t;return s.jsx(Re,{error:e??new Error("Failed to load store settings")})}function it(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ze,{}),t[0]=e):e=t[0],e}export{it as default};
1
+ import{e as D,j as s,E as le,r as K,s as ae,o as ce,f as de,g as me,B as Y,t as te,K as fe,a as ge,x as ie}from"./index-B3pJqV9Y.js";import{i as ue}from"./AlertCircle-9O6VvAfH.js";import{i as pe}from"./ChevronRight-DmfKIycz.js";import{s as xe}from"./Plus-D5DLeNpq.js";import{s as he}from"./Trash01-UTo49HDl.js";import{I as X}from"./input-DylFJb_s.js";import{S as ne}from"./switch-BL_ICveF.js";import{S as ye}from"./skeleton-BWYBZf7m.js";import{A as oe}from"./avatar-jxKfgW3P.js";import{b as je,P as Ce,a as Se}from"./popover-CUnDbgJ2.js";import{b as re}from"./use-connection-CesZaYzK.js";import{d as Z}from"./constants-DzBa_pVv.js";import{P as G}from"./index-C7apxcAd.js";import{u as ve}from"./use-registry-connections-CPKTZHrX.js";import{g as _e,h as be}from"./use-organization-settings-C8pMgrh-.js";import{d as Pe,b as I,S as ee,a as Q}from"./settings-section-XEp6UNJA.js";import"./User01-CVlz7odd.js";import"./use-collections-DcamXjGg.js";import"./tooltip-DZIo6YZX.js";import"./X-CeTLIvc6.js";import"./card-DxIIO9TM.js";import"./ArrowUpRight-C7hCAEbW.js";function Re(t){const e=D.c(3),{error:n}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let o;return e[1]!==n.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",n.message]})]}),e[1]=n.message,e[2]=o):o=e[2],o}function ke(t){const e=D.c(36),{onCancel:n,onSuccess:m}=t,o=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==o||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await o.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=o,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:we},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==n?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:n,disabled:d,children:"Cancel"}),e[19]=d,e[20]=n,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function we(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:n,description:m,icon:o,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==o||e[8]!==n?(c=o?s.jsx("img",{src:o,alt:n,className:"size-8 rounded-md object-contain"}):s.jsx(oe,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=o,e[8]=n,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Ae,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(ne,{checked:r,onClick:Ne,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==n||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:n,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=n,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ne(t){return t.stopPropagation()}function Ae(t){return t.stopPropagation()}function Me(){const t=D.c(59),{org:e}=ae(),n=ve(),m=re(),o=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==o||t[4]!==n||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!o)return i===p;const w=o.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=n.find(i=>i.id===p),k=n.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=n.filter(i=>!B.has(i.id));let R;t[13]!==o||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=o??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=o,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const H=C;let U;t[20]!==o||t[21]!==r?(U=async i=>{S(!1);const w=o??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=o,t[21]=r,t[22]=U):U=t[22];const W=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==W||t[28]!==a?(T=a&&s.jsx(ke,{onCancel:()=>S(!1),onSuccess:W}),t[27]=W,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let q;t[37]!==H||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>H(i.id)},i.id),t[37]=H,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(oe,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(ne,{checked:!1,disabled:!0,onCheckedChange:Te})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=o,t[4]=n,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function Te(){}function ze(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(le,{fallback:Ee,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Me,{})]})})})})})}),t[1]=n):n=t[1],n}function Ee(t){const{error:e}=t;return s.jsx(Re,{error:e??new Error("Failed to load store settings")})}function it(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ze,{}),t[0]=e):e=t[0],e}export{it as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-DRAqgrZS.js","assets/index-B3pJqV9Y.js","assets/index-DXHNyf1g.css","assets/ArrowNarrowLeft-CG2ODQbf.js","assets/CheckCircle-BbvAf9Bo.js","assets/Container-Dwj81gCC.js","assets/Settings02-CnaVYpiu.js","assets/XCircle-DtPL7zg0.js","assets/constants-DzBa_pVv.js","assets/useInfiniteQuery-ANrroW8x.js","assets/infiniteQueryObserver-FXpIkCb9.js","assets/badge-DSbZ2xYh.js","assets/input-DylFJb_s.js","assets/dropdown-menu-BxJLGp-F.js","assets/ChevronDown-DTujp_Ze.js","assets/ChevronRight-DmfKIycz.js","assets/DotsVertical-BSgCnoHf.js","assets/table-Cri7VAeb.js","assets/toggle-group-cD20__YI.js","assets/use-view-mode-C06qcP9p.js","assets/tooltip-DZIo6YZX.js","assets/SearchMd-CCDT-gCm.js","assets/dialog-DJXnl186.js","assets/X-CeTLIvc6.js","assets/AlertCircle-9O6VvAfH.js","assets/alert-dialog-FP3uTtqS.js","assets/card-DxIIO9TM.js","assets/Trash01-UTo49HDl.js","assets/label-BMcf8C3G.js","assets/select-FyLwzc48.js","assets/ChevronUp-k_xkdO-G.js","assets/switch-BL_ICveF.js","assets/textarea-B1YgZKSW.js","assets/RefreshCcw01-B6WkaYVq.js","assets/checkbox-BC2-36Db.js","assets/LinkExternal01-DceZ2oEY.js","assets/use-copy-Chq89Uhn.js","assets/Plus-D5DLeNpq.js","assets/Play-DBJO09gj.js"])))=>i.map(i=>d[i]);
2
+ import{e as n,f as c,g as m,j as r,l as f,r as l,_ as u}from"./index-B3pJqV9Y.js";const _=l.lazy(()=>u(()=>import("./registry-layout-DRAqgrZS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])));function x(){const e=n.c(5),o=c();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/shell/$org"},e[0]=t):t=e[0];const{org:i}=m(t);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=s):s=e[1];let a;return e[2]!==o||e[3]!==i?(a=r.jsx(l.Suspense,{fallback:s,children:r.jsx(_,{onBack:()=>o({to:"/$org/settings/store",params:{org:i}})})}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}export{x as default};
@@ -1 +1 @@
1
- import{r as c,j as i,a7 as C,b6 as y,aT as B,a8 as I,b7 as M,b8 as H,ae as z,e as A,c as g}from"./index-D4IWA9IU.js";var m="Switch",[U]=z(m),[q,L]=U(m),E=c.forwardRef((r,e)=>{const{__scopeSwitch:t,name:s,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=r,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=B({prop:a,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(r.onClick,b=>{N(T=>!T),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((r,e)=>{const{__scopeSwitch:t,...s}=r,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:s=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(v)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(r){return r?"checked":"unchecked"}var $=E,D=R;function W(r){const e=A.c(9);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...s,children:n}),e[6]=s,e[7]=a,e[8]=o):o=e[8],o}export{W as S};
1
+ import{r as c,j as i,a7 as C,b6 as y,aT as B,a8 as I,b7 as M,b8 as H,ae as z,e as A,c as g}from"./index-B3pJqV9Y.js";var m="Switch",[U]=z(m),[q,L]=U(m),E=c.forwardRef((r,e)=>{const{__scopeSwitch:t,name:s,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=r,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=B({prop:a,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(r.onClick,b=>{N(T=>!T),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((r,e)=>{const{__scopeSwitch:t,...s}=r,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:r,control:e,checked:t,bubbles:s=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(v)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(r){return r?"checked":"unchecked"}var $=E,D=R;function W(r){const e=A.c(9);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...s,children:n}),e[6]=s,e[7]=a,e[8]=o):o=e[8],o}export{W as S};
@@ -1 +1 @@
1
- import{e as c,c as i,j as r}from"./index-D4IWA9IU.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-card rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function x(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{x as T,p as a,b,d as c,f as d,m as e};
1
+ import{e as c,c as i,j as r}from"./index-B3pJqV9Y.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-card rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function x(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{x as T,p as a,b,d as c,f as d,m as e};
@@ -1 +1 @@
1
- import{e as b,n as A,w as F,aO as k,aP as V,r as f,j as d,aQ as L,a7 as m,a8 as y,aR as h,ae as q,aS as D,aT as K,aU as G,aV as O,aW as Q,c as g}from"./index-D4IWA9IU.js";import{K as w}from"./constants-B22iOAkD.js";async function C(s){if(!s.getServerCapabilities()?.prompts)return{prompts:[]};try{return await s.listPrompts()}catch(t){if(t instanceof k&&t.code===V.MethodNotFound)return{prompts:[]};throw t}}async function Z(s,e,t){if(!s.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await s.getPrompt({name:e,arguments:t??{}})}function ee(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],F(i)}function te(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],A(i)}var x="Tabs",[z]=q(x,[h]),P=h(),[B,T]=z(x),N=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,onValueChange:r,defaultValue:o,orientation:n="horizontal",dir:i,activationMode:l="automatic",...v}=s,u=D(i),[c,p]=K({prop:a,onChange:r,defaultProp:o??"",caller:x});return d.jsx(B,{scope:t,baseId:G(),value:c,onValueChange:p,orientation:n,dir:u,activationMode:l,children:d.jsx(m.div,{dir:u,"data-orientation":n,...v,ref:e})})});N.displayName=x;var j="TabsList",E=f.forwardRef((s,e)=>{const{__scopeTabs:t,loop:a=!0,...r}=s,o=T(j,t),n=P(t);return d.jsx(O,{asChild:!0,...n,orientation:o.orientation,dir:o.dir,loop:a,children:d.jsx(m.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});E.displayName=j;var I="TabsTrigger",_=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,disabled:r=!1,...o}=s,n=T(I,t),i=P(t),l=M(n.baseId,a),v=$(n.baseId,a),u=a===n.value;return d.jsx(L,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":v,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:e,onMouseDown:y(s.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?n.onValueChange(a):c.preventDefault()}),onKeyDown:y(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&n.onValueChange(a)}),onFocus:y(s.onFocus,()=>{const c=n.activationMode!=="manual";!u&&!r&&c&&n.onValueChange(a)})})})});_.displayName=I;var R="TabsContent",S=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,forceMount:r,children:o,...n}=s,i=T(R,t),l=M(i.baseId,a),v=$(i.baseId,a),u=a===i.value,c=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(Q,{present:r||u,children:({present:p})=>d.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:v,tabIndex:0,...n,ref:e,style:{...s.style,animationDuration:c.current?"0s":void 0},children:p&&o})})});S.displayName=R;function M(s,e){return`${s}-trigger-${e}`}function $(s,e){return`${s}-content-${e}`}var H=N,U=E,W=_,Y=S;function ae(s){const e=b.c(10);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r===void 0?"pill":r;let n;e[4]!==t?(n=g("flex flex-col gap-2",t),e[4]=t,e[5]=n):n=e[5];let i;return e[6]!==a||e[7]!==n||e[8]!==o?(i=d.jsx(H,{"data-slot":"tabs","data-variant":o,className:n,...a}),e[6]=a,e[7]=n,e[8]=o,e[9]=i):i=e[9],i}function re(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex h-[52px] items-center border-b border-border":o==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(U,{"data-slot":"tabs-list","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function se(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":o==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(W,{"data-slot":"tabs-trigger","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function oe(s){const e=b.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=g("flex-1 outline-none h-full",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=d.jsx(Y,{"data-slot":"tabs-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{se as T,ae as a,re as b,oe as c,te as d,Z as g,C as l,ee as u};
1
+ import{e as b,n as A,w as F,aO as k,aP as V,r as f,j as d,aQ as L,a7 as m,a8 as y,aR as h,ae as q,aS as D,aT as K,aU as G,aV as O,aW as Q,c as g}from"./index-B3pJqV9Y.js";import{K as w}from"./constants-DzBa_pVv.js";async function C(s){if(!s.getServerCapabilities()?.prompts)return{prompts:[]};try{return await s.listPrompts()}catch(t){if(t instanceof k&&t.code===V.MethodNotFound)return{prompts:[]};throw t}}async function Z(s,e,t){if(!s.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await s.getPrompt({name:e,arguments:t??{}})}function ee(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],F(i)}function te(s){const e=b.c(12);let t,a;e[0]!==s?({client:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=w.mcpPromptsList(t),e[3]=t,e[4]=r):r=e[4];let o;e[5]!==t?(o=()=>C(t),e[5]=t,e[6]=o):o=e[6];const n=a.staleTime??3e4;let i;return e[7]!==a||e[8]!==r||e[9]!==o||e[10]!==n?(i={...a,queryKey:r,queryFn:o,staleTime:n,retry:!1},e[7]=a,e[8]=r,e[9]=o,e[10]=n,e[11]=i):i=e[11],A(i)}var x="Tabs",[z]=q(x,[h]),P=h(),[B,T]=z(x),N=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,onValueChange:r,defaultValue:o,orientation:n="horizontal",dir:i,activationMode:l="automatic",...v}=s,u=D(i),[c,p]=K({prop:a,onChange:r,defaultProp:o??"",caller:x});return d.jsx(B,{scope:t,baseId:G(),value:c,onValueChange:p,orientation:n,dir:u,activationMode:l,children:d.jsx(m.div,{dir:u,"data-orientation":n,...v,ref:e})})});N.displayName=x;var j="TabsList",E=f.forwardRef((s,e)=>{const{__scopeTabs:t,loop:a=!0,...r}=s,o=T(j,t),n=P(t);return d.jsx(O,{asChild:!0,...n,orientation:o.orientation,dir:o.dir,loop:a,children:d.jsx(m.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:e})})});E.displayName=j;var I="TabsTrigger",_=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,disabled:r=!1,...o}=s,n=T(I,t),i=P(t),l=M(n.baseId,a),v=$(n.baseId,a),u=a===n.value;return d.jsx(L,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":v,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:e,onMouseDown:y(s.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?n.onValueChange(a):c.preventDefault()}),onKeyDown:y(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&n.onValueChange(a)}),onFocus:y(s.onFocus,()=>{const c=n.activationMode!=="manual";!u&&!r&&c&&n.onValueChange(a)})})})});_.displayName=I;var R="TabsContent",S=f.forwardRef((s,e)=>{const{__scopeTabs:t,value:a,forceMount:r,children:o,...n}=s,i=T(R,t),l=M(i.baseId,a),v=$(i.baseId,a),u=a===i.value,c=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(Q,{present:r||u,children:({present:p})=>d.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:v,tabIndex:0,...n,ref:e,style:{...s.style,animationDuration:c.current?"0s":void 0},children:p&&o})})});S.displayName=R;function M(s,e){return`${s}-trigger-${e}`}function $(s,e){return`${s}-content-${e}`}var H=N,U=E,W=_,Y=S;function ae(s){const e=b.c(10);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r===void 0?"pill":r;let n;e[4]!==t?(n=g("flex flex-col gap-2",t),e[4]=t,e[5]=n):n=e[5];let i;return e[6]!==a||e[7]!==n||e[8]!==o?(i=d.jsx(H,{"data-slot":"tabs","data-variant":o,className:n,...a}),e[6]=a,e[7]=n,e[8]=o,e[9]=i):i=e[9],i}function re(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex h-[52px] items-center border-b border-border":o==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(U,{"data-slot":"tabs-list","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function se(s){const e=b.c(11);let t,a,r;e[0]!==s?({className:t,variant:r,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);const o=r||"pill",n=o==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":o==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==t||e[5]!==n?(i=g(n,t),e[4]=t,e[5]=n,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==i?(l=d.jsx(W,{"data-slot":"tabs-trigger","data-variant":o,className:i,...a}),e[7]=o,e[8]=a,e[9]=i,e[10]=l):l=e[10],l}function oe(s){const e=b.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=g("flex-1 outline-none h-full",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=d.jsx(Y,{"data-slot":"tabs-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{se as T,ae as a,re as b,oe as c,te as d,Z as g,C as l,ee as u};
@@ -1 +1 @@
1
- import{i as o}from"./AlertCircle-BeiDn4Fp.js";import{i as t}from"./CheckCircle-3TB25Bcb.js";import{a as r}from"./DotsVertical-9AuPT8gf.js";import{_ as a}from"./agent-icon-CLQAOsUE.js";import{l}from"./index-D4IWA9IU.js";import{i as n}from"./XCircle-B-JS14_e.js";const i={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:o,iconClassName:"text-orange-500",labelColor:"text-orange-600 dark:text-orange-400"},failed:{label:"Failed",verb:"Something went wrong",icon:n,iconClassName:"text-red-500",labelColor:"text-red-600 dark:text-red-400"},expired:{label:"Timed out",verb:"Stopped responding",icon:a,iconClassName:"text-amber-500",labelColor:"text-amber-600 dark:text-amber-400"},in_progress:{label:"Running",verb:"Agent is working",icon:l,iconClassName:"text-blue-500",labelColor:"text-blue-600 dark:text-blue-400"},completed:{label:"Done",verb:"Completed",icon:t,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},m={label:"Unknown",verb:"Unknown status",icon:r,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function x(e){return i[e??"completed"]??m}export{i as S,x as g};
1
+ import{i as o}from"./AlertCircle-9O6VvAfH.js";import{i as t}from"./CheckCircle-BbvAf9Bo.js";import{a as r}from"./DotsVertical-BSgCnoHf.js";import{_ as a}from"./agent-icon-rfR6G8ak.js";import{l}from"./index-B3pJqV9Y.js";import{i as n}from"./XCircle-DtPL7zg0.js";const i={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:o,iconClassName:"text-orange-500",labelColor:"text-orange-600 dark:text-orange-400"},failed:{label:"Failed",verb:"Something went wrong",icon:n,iconClassName:"text-red-500",labelColor:"text-red-600 dark:text-red-400"},expired:{label:"Timed out",verb:"Stopped responding",icon:a,iconClassName:"text-amber-500",labelColor:"text-amber-600 dark:text-amber-400"},in_progress:{label:"Running",verb:"Agent is working",icon:l,iconClassName:"text-blue-500",labelColor:"text-blue-600 dark:text-blue-400"},completed:{label:"Done",verb:"Completed",icon:t,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},m={label:"Unknown",verb:"Unknown status",icon:r,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function x(e){return i[e??"completed"]??m}export{i as S,x as g};