decocms 2.306.0 → 2.306.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 (196) hide show
  1. package/dist/client/assets/{AlertCircle-ri2xuBKe.js → AlertCircle-CcUtX5uM.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-yxFeL5-Q.js → ArrowNarrowLeft-IKO0Pdme.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-Bxgj2IVp.js → ArrowUpRight-B9ER_pU4.js} +1 -1
  4. package/dist/client/assets/{Check-C6Fa8-x7.js → Check-DVRpvrTF.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-D7N7MOmw.js → CheckCircle-C1PuOF6d.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-DmrzaACF.js → ChevronDown-BgtmJwU7.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CZ_XAq5W.js → ChevronRight-BxsGpbIW.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-Ds9ufeJd.js → ChevronUp-DvM1tvKw.js} +1 -1
  9. package/dist/client/assets/{Container-BXYDPrF5.js → Container-D_d73BfD.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CYFsY1AY.js → DotsVertical-CFsox5cs.js} +1 -1
  11. package/dist/client/assets/{LinkExternal01-Dvpxn-Ig.js → LinkExternal01-BFJlAOho.js} +1 -1
  12. package/dist/client/assets/{Lock01-63SpB195.js → Lock01-BDVFL4zm.js} +1 -1
  13. package/dist/client/assets/{Palette-D0iAFXNq.js → Palette-C4Za_YQg.js} +1 -1
  14. package/dist/client/assets/{Play-D4xI5B_i.js → Play-CG03drxN.js} +1 -1
  15. package/dist/client/assets/{Plus-CDEOyPu8.js → Plus-BMxmddO-.js} +1 -1
  16. package/dist/client/assets/{RefreshCcw01-B2ZHRQzo.js → RefreshCcw01-B_PJ5f1k.js} +1 -1
  17. package/dist/client/assets/{SearchMd-6IRfjRcX.js → SearchMd-BH72zEYs.js} +1 -1
  18. package/dist/client/assets/{Settings02-3HEuuiVe.js → Settings02-Bvv_nn0Y.js} +1 -1
  19. package/dist/client/assets/{Shield01-BGj8uiOU.js → Shield01-B-3tcngo.js} +1 -1
  20. package/dist/client/assets/{Star01-BSZxz5Wn.js → Star01-Cdw_hElv.js} +1 -1
  21. package/dist/client/assets/{Sun-DdqVKeEA.js → Sun-ja3JE2c9.js} +1 -1
  22. package/dist/client/assets/{Tool01-DMFP0Svb.js → Tool01-DK9-mVZw.js} +1 -1
  23. package/dist/client/assets/{Trash01-Dj5mVOWm.js → Trash01-D676SGAl.js} +1 -1
  24. package/dist/client/assets/{User01-CDDY3fE9.js → User01-DGJlNaMw.js} +1 -1
  25. package/dist/client/assets/{Users03-BbIOB2XC.js → Users03-CRQrY9LZ.js} +1 -1
  26. package/dist/client/assets/{X-yKx8T0mV.js → X-DZI_qdyG.js} +1 -1
  27. package/dist/client/assets/{XCircle-BLtaN_6O.js → XCircle-BI7HQKdL.js} +1 -1
  28. package/dist/client/assets/{XClose-Bk1D4OG4.js → XClose-DQPB9QhN.js} +1 -1
  29. package/dist/client/assets/{Zap-Ctp20y2W.js → Zap-Dd-DoFdM.js} +1 -1
  30. package/dist/client/assets/{ZapSquare-BOPwjpzz.js → ZapSquare-DZh8af5t.js} +1 -1
  31. package/dist/client/assets/{accordion-Cp5pOFIt.js → accordion-BqJi9w98.js} +1 -1
  32. package/dist/client/assets/{agent-icon-6IsHLhhx.js → agent-icon-BpIPT-PU.js} +1 -1
  33. package/dist/client/assets/{agents-list-2IMNAAmL.js → agents-list-C92sGcpj.js} +1 -1
  34. package/dist/client/assets/ai-providers-Bi9o279v.js +1 -0
  35. package/dist/client/assets/{alert-dialog-D-vKhXAM.js → alert-dialog-DZnXWtkc.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-DSDUVS7V.js → auth-catchall-BlSxNcbF.js} +1 -1
  37. package/dist/client/assets/{automation-list-row-DXQ1xbHt.js → automation-list-row-BjkF6IP8.js} +1 -1
  38. package/dist/client/assets/{automations-BKGLmUCl.js → automations-Dk44qwnk.js} +1 -1
  39. package/dist/client/assets/{avatar-DiYo_VFp.js → avatar-EJ4rWeJV.js} +1 -1
  40. package/dist/client/assets/{badge-v1Fnh_-2.js → badge-CMhkMPpc.js} +1 -1
  41. package/dist/client/assets/{brand-context-DWyvnvIk.js → brand-context-DHKafDne.js} +1 -1
  42. package/dist/client/assets/{card-CMatfPs6.js → card-DfBr11OH.js} +1 -1
  43. package/dist/client/assets/{chat-context-BOGVHhEC.js → chat-context-DfNQ7f-M.js} +1 -1
  44. package/dist/client/assets/{checkbox-DgRshC0u.js → checkbox-CsVxpSNu.js} +1 -1
  45. package/dist/client/assets/{collection-detail-D8ViAcbL.js → collection-detail-D3z0bht4.js} +1 -1
  46. package/dist/client/assets/{collection-display-button-BEIthj-o.js → collection-display-button-CijPjsBx.js} +1 -1
  47. package/dist/client/assets/{collection-search-CLwC-feE.js → collection-search-CUzZkask.js} +1 -1
  48. package/dist/client/assets/{collection-search-Dsu0rnLF.js → collection-search-DDXROr4Y.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-Df3XEjUz.js → collection-table-wrapper-BJIOgEuU.js} +1 -1
  50. package/dist/client/assets/{collection-tabs-3zydPpJg.js → collection-tabs-Sh1c6Hp3.js} +1 -1
  51. package/dist/client/assets/{collections-DIZVbUQW.js → collections-B6H9755O.js} +1 -1
  52. package/dist/client/assets/{command-Cb8AzRR0.js → command-CN0wol1M.js} +1 -1
  53. package/dist/client/assets/{connection-card-CN5pQMAi.js → connection-card-t8q3avUo.js} +1 -1
  54. package/dist/client/assets/{connection-detail-DMf-fgcD.js → connection-detail-_U-y0yZK.js} +1 -1
  55. package/dist/client/assets/{connection-form-helpers-0uGtdPq8.js → connection-form-helpers-CDqLkd8a.js} +1 -1
  56. package/dist/client/assets/{connections-oG85p-mQ.js → connections-B7soayai.js} +1 -1
  57. package/dist/client/assets/{constants-hjtpWhr_.js → constants-Hpdlytpy.js} +1 -1
  58. package/dist/client/assets/{constants-BBSLGS7p.js → constants-RvCh42kd.js} +1 -1
  59. package/dist/client/assets/{dialog-CICi1bFC.js → dialog-sB-RNyMu.js} +1 -1
  60. package/dist/client/assets/{domain-settings-CjSKJW17.js → domain-settings-CfN0XeQj.js} +1 -1
  61. package/dist/client/assets/{drawer-CAsvHZha.js → drawer-DdDu6FoS.js} +1 -1
  62. package/dist/client/assets/{dropdown-menu-DVFKsYz3.js → dropdown-menu-Ba10Ub1x.js} +1 -1
  63. package/dist/client/assets/{dynamic-plugin-layout-BTYFB5Vl.js → dynamic-plugin-layout-DXfaFfD-.js} +1 -1
  64. package/dist/client/assets/{empty-state-Dk0gx8oo.js → empty-state-4KQTPzu7.js} +1 -1
  65. package/dist/client/assets/{empty-state-CwHUFi5m.js → empty-state-oHMUpnK0.js} +1 -1
  66. package/dist/client/assets/{extract-connection-data-CvD7TUFj.js → extract-connection-data-CLmSiyTB.js} +1 -1
  67. package/dist/client/assets/{features-vcFr7_NO.js → features-gEXnGXJn.js} +1 -1
  68. package/dist/client/assets/{form-bUi5oN1u.js → form-C8F4itc9.js} +1 -1
  69. package/dist/client/assets/{general-iD0oGniS.js → general-YVhMnlrc.js} +1 -1
  70. package/dist/client/assets/{index-CMnREwkX.js → index-9WMiiDWH.js} +1 -1
  71. package/dist/client/assets/{index-B7e3gTna.js → index-A1kUSxVF.js} +1 -1
  72. package/dist/client/assets/{index-Dg6zk4z0.js → index-B__IE7Zg.js} +1 -1
  73. package/dist/client/assets/{index-k1BGw4YF.js → index-BfH23PIC.js} +1 -1
  74. package/dist/client/assets/{index-C_78kpYQ.js → index-C8Jg2iKl.js} +1 -1
  75. package/dist/client/assets/{index-D9n-W_rO.js → index-CPXgqgtn.js} +2 -2
  76. package/dist/client/assets/{index-BczjQy3M.js → index-CaFhVluQ.js} +1 -1
  77. package/dist/client/assets/{index-CKbPmli4.js → index-Ccbgu0mE.js} +1 -1
  78. package/dist/client/assets/{index-PFIdYUp0.js → index-CsYx-I3w.js} +1 -1
  79. package/dist/client/assets/{index-CBeau-VE.js → index-CzNtdOVE.js} +3 -3
  80. package/dist/client/assets/{index-DM4aujMZ.js → index-DGIpb-N4.js} +1 -1
  81. package/dist/client/assets/{index-BCI_OHNR.js → index-RcpmOMcB.js} +1 -1
  82. package/dist/client/assets/{index-BxSEc3iB.js → index-SKdTLMdd.js} +1 -1
  83. package/dist/client/assets/{index-BOCF3HeX.js → index-Vpu4sPxo.js} +1 -1
  84. package/dist/client/assets/index-s5U-1Asm.js +1 -0
  85. package/dist/client/assets/{index-DWSuPJ_b.js → index-vqBvbw9C.js} +1 -1
  86. package/dist/client/assets/{infiniteQueryObserver-DnwZzogs.js → infiniteQueryObserver-BeoG5sU6.js} +1 -1
  87. package/dist/client/assets/{input-Aj2AxbJX.js → input-BYLqJazY.js} +1 -1
  88. package/dist/client/assets/{integration-icon-CNrz8Wxa.js → integration-icon-Btpdnlb-.js} +1 -1
  89. package/dist/client/assets/{label-CuWuUZ3O.js → label-wqfg1Psv.js} +1 -1
  90. package/dist/client/assets/{layout-zn0Mql8j.js → layout-CSZNypzG.js} +1 -1
  91. package/dist/client/assets/{lean-canvas-recruit-modal-mlOx896G.js → lean-canvas-recruit-modal-aeSS5EN2.js} +1 -1
  92. package/dist/client/assets/{login-BAIGAZLg.js → login-eSx-pmqu.js} +1 -1
  93. package/dist/client/assets/{members--FDE6tuk.js → members-Dp2QRB1E.js} +1 -1
  94. package/dist/client/assets/{monaco-editor-PZYP8jhf.js → monaco-editor-Bp7vt54e.js} +1 -1
  95. package/dist/client/assets/{monitoring-stats-row-BbRUPAD5.js → monitoring-stats-row-CSfdCe-P.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-BaQ7B2Rx.js → oauth-callback-ChiIJvQB.js} +1 -1
  97. package/dist/client/assets/{oauth-callback-ai-provider-DcbaUyEX.js → oauth-callback-ai-provider-Uj96uOps.js} +1 -1
  98. package/dist/client/assets/{onboarding-h88h3klM.js → onboarding-B_0dDnLd.js} +1 -1
  99. package/dist/client/assets/{org-layout-BBR4isCp.js → org-layout-DokAgJ5h.js} +1 -1
  100. package/dist/client/assets/{org-plugin-layout-Dl6QtWDy.js → org-plugin-layout-C98RwuLU.js} +1 -1
  101. package/dist/client/assets/{pair-DST-dVfc.js → pair-DYA5r7ea.js} +1 -1
  102. package/dist/client/assets/{plugin-empty-state-CAfBOmv9.js → plugin-empty-state-j8s8XCj4.js} +1 -1
  103. package/dist/client/assets/{plugin-header-RtXpJdkF.js → plugin-header-BufwzLmI.js} +1 -1
  104. package/dist/client/assets/{plugin-layout-DLTDP8qX.js → plugin-layout-BwLMjrn6.js} +1 -1
  105. package/dist/client/assets/{popover-DFJMwPZz.js → popover-BP8qYbWI.js} +1 -1
  106. package/dist/client/assets/{profile-Bc72ys1m.js → profile-BUq_8Y8L.js} +1 -1
  107. package/dist/client/assets/{project-app-view-k_Cpcixt.js → project-app-view-Xj3yVfXy.js} +1 -1
  108. package/dist/client/assets/registry-BLsA5AO_.js +2 -0
  109. package/dist/client/assets/{registry-layout-Cg78aXMt.js → registry-layout-CZ27EJiP.js} +1 -1
  110. package/dist/client/assets/{required-auth-layout-BRdLiCQS.js → required-auth-layout-DxobDViQ.js} +1 -1
  111. package/dist/client/assets/{reset-password-B6r9t9Oh.js → reset-password-BX31j3AV.js} +1 -1
  112. package/dist/client/assets/{roles-Ee_Uhan9.js → roles-dyH1CsHQ.js} +1 -1
  113. package/dist/client/assets/{scroll-area-D7xTqtD-.js → scroll-area-Bazrt5Q_.js} +1 -1
  114. package/dist/client/assets/{search-input-BYHjVlDa.js → search-input-CagM2rOd.js} +1 -1
  115. package/dist/client/assets/{select-DWMsyC47.js → select-DV6XTbu1.js} +1 -1
  116. package/dist/client/assets/{select-model-p3PkjF3m.js → select-model-q-6_EO7e.js} +1 -1
  117. package/dist/client/assets/{settings-layout-B5lxdePw.js → settings-layout-ydozaX1z.js} +1 -1
  118. package/dist/client/assets/{settings-section-DLmXqm7P.js → settings-section-BSSTyi59.js} +1 -1
  119. package/dist/client/assets/{shell-layout-DDd0qO09.js → shell-layout-CCBbSGMK.js} +1 -1
  120. package/dist/client/assets/{skeleton-fTv1xeu9.js → skeleton-eJ5dvmO1.js} +1 -1
  121. package/dist/client/assets/{sso-DPaJITTm.js → sso-D3B4i8mi.js} +1 -1
  122. package/dist/client/assets/store-registry-BizfzILs.js +2 -0
  123. package/dist/client/assets/{store-CAA-krPV.js → store-tol-TExI.js} +1 -1
  124. package/dist/client/assets/{switch-D664sdCn.js → switch-B9P99cpo.js} +1 -1
  125. package/dist/client/assets/{table-mlNAjytE.js → table-BIJ38639.js} +1 -1
  126. package/dist/client/assets/{tabs-Bakk2hgc.js → tabs-C0vV7-ts.js} +1 -1
  127. package/dist/client/assets/{task-status-B1waCh_f.js → task-status-nAuAdX3m.js} +1 -1
  128. package/dist/client/assets/{textarea-B5ocquNh.js → textarea-Dk5HQM76.js} +1 -1
  129. package/dist/client/assets/{toggle-group-CdL7Wi0S.js → toggle-group-DiN3ciV3.js} +1 -1
  130. package/dist/client/assets/{tools-list-C9TFhRWw.js → tools-list-NaHpnv5w.js} +1 -1
  131. package/dist/client/assets/{tooltip-D3G-75TX.js → tooltip-CCRvyunm.js} +1 -1
  132. package/dist/client/assets/{types-iEh-ujpY.js → types-CsuD99pM.js} +1 -1
  133. package/dist/client/assets/{use-ai-providers-B5bMFCmc.js → use-ai-providers-Dgd0mo29.js} +1 -1
  134. package/dist/client/assets/{use-collections-D6rFCbFs.js → use-collections-Ra-WueHq.js} +1 -1
  135. package/dist/client/assets/{use-connection-ChcOtrff.js → use-connection-D6QJlUO9.js} +1 -1
  136. package/dist/client/assets/{use-copy-m0n_RO3C.js → use-copy-BHjujE3w.js} +1 -1
  137. package/dist/client/assets/{use-create-virtual-mcp-YEubcOB4.js → use-create-virtual-mcp-BxdAiHU1.js} +1 -1
  138. package/dist/client/assets/{use-debounced-autosave-B2P6o2k5.js → use-debounced-autosave-C7GmOCQZ.js} +1 -1
  139. package/dist/client/assets/{use-decopilot-events-2TQ7wYAd.js → use-decopilot-events-DQouP0Xf.js} +1 -1
  140. package/dist/client/assets/{use-delete-connection-D5bnzRUU.js → use-delete-connection-1o_zv9iJ.js} +1 -1
  141. package/dist/client/assets/{use-infinite-scroll-3bbSny2Z.js → use-infinite-scroll-CBiQU4Ab.js} +1 -1
  142. package/dist/client/assets/{use-list-state-wMdeexdh.js → use-list-state-COPr6pvf.js} +1 -1
  143. package/dist/client/assets/{use-mcp-tools-BcOc7oDE.js → use-mcp-tools-DD1IUYEC.js} +1 -1
  144. package/dist/client/assets/{use-members-BNZ3ZVzn.js → use-members-uqCUADFs.js} +1 -1
  145. package/dist/client/assets/{use-navigate-to-agent-BpE3mIlu.js → use-navigate-to-agent-DtcXsTmt.js} +1 -1
  146. package/dist/client/assets/{use-org-auth-client-C94Cx1kj.js → use-org-auth-client-lzEa1Nt5.js} +1 -1
  147. package/dist/client/assets/{use-org-sso-V0U-retN.js → use-org-sso-XYdJdNGD.js} +1 -1
  148. package/dist/client/assets/{use-organization-roles-Byz74Exs.js → use-organization-roles-DaSsDuIz.js} +1 -1
  149. package/dist/client/assets/{use-organization-settings-Crj_HvGT.js → use-organization-settings-DZQEi_vL.js} +1 -1
  150. package/dist/client/assets/{use-registry-connections-BLE97Xkr.js → use-registry-connections-BgfsM9PL.js} +1 -1
  151. package/dist/client/assets/{use-status-sounds-BFxmOR4f.js → use-status-sounds-BnOGH79m.js} +1 -1
  152. package/dist/client/assets/{use-tasks-B1IA46S1.js → use-tasks-CP9EEDgQ.js} +1 -1
  153. package/dist/client/assets/{use-view-mode-DmgZ_4mP.js → use-view-mode-DBMTYwcB.js} +1 -1
  154. package/dist/client/assets/{use-virtual-mcp-DbNBWdfU.js → use-virtual-mcp-BNrt8cOn.js} +1 -1
  155. package/dist/client/assets/useInfiniteQuery-m6hlUQnd.js +1 -0
  156. package/dist/client/assets/useSuspenseInfiniteQuery-BbuXOIpQ.js +1 -0
  157. package/dist/client/assets/{user-BnqvTrf4.js → user-O4Eqd0DY.js} +1 -1
  158. package/dist/client/assets/{view-mode-toggle-CwkAkApt.js → view-mode-toggle-BDOZY65E.js} +1 -1
  159. package/dist/client/assets/{workflow-R3hZyuyQ.js → workflow-BiwnYTIB.js} +1 -1
  160. package/dist/client/assets/workflow-detail-CHrqPsdS.js +1 -0
  161. package/dist/client/index.html +1 -1
  162. package/dist/server/cli.js +2 -2
  163. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  164. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  165. package/dist/server/node_modules/ansi-styles/license +9 -0
  166. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  167. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  168. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  169. package/dist/server/node_modules/postgres-array/index.js +97 -0
  170. package/dist/server/node_modules/postgres-array/license +21 -0
  171. package/dist/server/node_modules/postgres-array/package.json +35 -0
  172. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  173. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  174. package/dist/server/node_modules/postgres-bytea/license +21 -0
  175. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  176. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  177. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  178. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  179. package/dist/server/node_modules/postgres-interval/license +21 -0
  180. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  181. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  182. package/dist/server/node_modules/split2/LICENSE +13 -0
  183. package/dist/server/node_modules/split2/README.md +85 -0
  184. package/dist/server/node_modules/split2/bench.js +27 -0
  185. package/dist/server/node_modules/split2/index.js +141 -0
  186. package/dist/server/node_modules/split2/package.json +39 -0
  187. package/dist/server/node_modules/split2/test.js +409 -0
  188. package/dist/server/server.js +1 -1
  189. package/package.json +1 -1
  190. package/dist/client/assets/ai-providers-DJCkxeza.js +0 -1
  191. package/dist/client/assets/index-C3jp8V-r.js +0 -1
  192. package/dist/client/assets/registry-BsIc5aMc.js +0 -2
  193. package/dist/client/assets/store-registry-ofreyRMo.js +0 -2
  194. package/dist/client/assets/useInfiniteQuery-CkLPMOdO.js +0 -1
  195. package/dist/client/assets/useSuspenseInfiniteQuery-3g8exEkj.js +0 -1
  196. package/dist/client/assets/workflow-detail-BJ1tXzcM.js +0 -1
@@ -1 +1 @@
1
- import{r as i,aS as nt,aT as Pe,j as d,c4 as rt,aU as be,b6 as k,c5 as st,a7 as j,a8 as N,cE as $,c6 as lt,ao as _e,c7 as Ee,b9 as at,b7 as ct,a4 as it,c8 as dt,cb as ut,c9 as pt,cc as ft,cd as mt,ae as ht,ca as vt,ce as gt,cf as xt,e as ee,c as oe}from"./index-D9n-W_rO.js";import{V as St}from"./tooltip-D3G-75TX.js";import{i as wt}from"./Check-C6Fa8-x7.js";import{t as Re}from"./ChevronDown-DmrzaACF.js";import{n as Ct}from"./ChevronUp-Ds9ufeJd.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Ne as e};
1
+ import{r as i,aS as nt,aT as Pe,j as d,c4 as rt,aU as be,b6 as k,c5 as st,a7 as j,a8 as N,cE as $,c6 as lt,ao as _e,c7 as Ee,b9 as at,b7 as ct,a4 as it,c8 as dt,cb as ut,c9 as pt,cc as ft,cd as mt,ae as ht,ca as vt,ce as gt,cf as xt,e as ee,c as oe}from"./index-CPXgqgtn.js";import{V as St}from"./tooltip-CCRvyunm.js";import{i as wt}from"./Check-DVRpvrTF.js";import{t as Re}from"./ChevronDown-BgtmJwU7.js";import{n as Ct}from"./ChevronUp-DvM1tvKw.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Ne as e};
@@ -1,4 +1,4 @@
1
- import{r as U,ao as At,H as se,J as W,aK as Ce,aI as we,a_ as Ie,aJ as Le,e as q,j as l,E as Xe,s as ie,o as he,a as le,K as G,n as Je,c as ae,z as ke,C as Ee,x as Y,D as _e,t as J,B as Z,M as Ze,u as Ot,f as Tt,y as Pt}from"./index-D9n-W_rO.js";import{C as Rt}from"./checkbox-DgRshC0u.js";import{I as re}from"./input-Aj2AxbJX.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-CICi1bFC.js";import{g as zt,D as Ft,a as Dt,b as Kt}from"./drawer-CAsvHZha.js";import{u as $t}from"./tooltip-D3G-75TX.js";import{S as Ut,a as Vt,b as Bt,c as Wt,d as qt}from"./select-DWMsyC47.js";import{S as Q}from"./skeleton-fTv1xeu9.js";import{i as Ht,c as Qt,t as Yt,b as Gt,a as Xt,d as Jt}from"./Tool01-DMFP0Svb.js";import{b as lt,s as it,c as Zt,a as es,i as ts}from"./RefreshCcw01-B2ZHRQzo.js";import{t as ze}from"./ChevronDown-DmrzaACF.js";import{a as nt,i as ot}from"./SearchMd-6IRfjRcX.js";import{a as ss}from"./Settings02-3HEuuiVe.js";import{u as pe,b as rt,a as be}from"./use-ai-providers-B5bMFCmc.js";import{p as Fe,b as at}from"./chat-context-BOGVHhEC.js";import{g as Te}from"./ai-providers-logos-DD3qZ33J.js";import{i as ls}from"./Zap-Ctp20y2W.js";import{u as is}from"./use-debounced-autosave-B2P6o2k5.js";import{i as ns}from"./AlertCircle-ri2xuBKe.js";import{i as os}from"./CheckCircle-D7N7MOmw.js";import{i as rs}from"./Check-C6Fa8-x7.js";import{s as as}from"./Trash01-Dj5mVOWm.js";import{i as cs}from"./X-yKx8T0mV.js";import{P as ye}from"./index-CMnREwkX.js";import{d as ds,S as je,a as Se,b as fe}from"./settings-section-DLmXqm7P.js";import{S as ms}from"./switch-D664sdCn.js";import{a as De,T as us}from"./toggle-group-CdL7Wi0S.js";import{A as ct}from"./avatar-DiYo_VFp.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-D-vKhXAM.js";import{S as ne,u as oe}from"./constants-BBSLGS7p.js";import{e as fs,f as hs}from"./use-organization-settings-Crj_HvGT.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as xs}from"./unwrap-tool-result-BYXdCQMg.js";function ue(t,e,s){let i=s.initialDeps??[],n,o=!0;function r(){var a,u,c;let d;s.key&&((a=s.debug)!=null&&a.call(s))&&(d=Date.now());const f=t();if(!(f.length!==i.length||f.some((N,b)=>i[b]!==N)))return n;i=f;let h;if(s.key&&((u=s.debug)!=null&&u.call(s))&&(h=Date.now()),n=e(...f),s.key&&((c=s.debug)!=null&&c.call(s))){const N=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-h)*100)/100,C=b/16,_=(p,S)=>{for(p=String(p);p.length<S;)p=" "+p;return p};console.info(`%c⏱ ${_(b,5)} /${_(N,5)} ms`,`
1
+ import{r as U,ao as At,H as se,J as W,aK as Ce,aI as we,a_ as Ie,aJ as Le,e as q,j as l,E as Xe,s as ie,o as he,a as le,K as G,n as Je,c as ae,z as ke,C as Ee,x as Y,D as _e,t as J,B as Z,M as Ze,u as Ot,f as Tt,y as Pt}from"./index-CPXgqgtn.js";import{C as Rt}from"./checkbox-CsVxpSNu.js";import{I as re}from"./input-BYLqJazY.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-sB-RNyMu.js";import{g as zt,D as Ft,a as Dt,b as Kt}from"./drawer-DdDu6FoS.js";import{u as $t}from"./tooltip-CCRvyunm.js";import{S as Ut,a as Vt,b as Bt,c as Wt,d as qt}from"./select-DV6XTbu1.js";import{S as Q}from"./skeleton-eJ5dvmO1.js";import{i as Ht,c as Qt,t as Yt,b as Gt,a as Xt,d as Jt}from"./Tool01-DK9-mVZw.js";import{b as lt,s as it,c as Zt,a as es,i as ts}from"./RefreshCcw01-B_PJ5f1k.js";import{t as ze}from"./ChevronDown-BgtmJwU7.js";import{a as nt,i as ot}from"./SearchMd-BH72zEYs.js";import{a as ss}from"./Settings02-Bvv_nn0Y.js";import{u as pe,b as rt,a as be}from"./use-ai-providers-Dgd0mo29.js";import{p as Fe,b as at}from"./chat-context-DfNQ7f-M.js";import{g as Te}from"./ai-providers-logos-DD3qZ33J.js";import{i as ls}from"./Zap-Dd-DoFdM.js";import{u as is}from"./use-debounced-autosave-C7GmOCQZ.js";import{i as ns}from"./AlertCircle-CcUtX5uM.js";import{i as os}from"./CheckCircle-C1PuOF6d.js";import{i as rs}from"./Check-DVRpvrTF.js";import{s as as}from"./Trash01-D676SGAl.js";import{i as cs}from"./X-DZI_qdyG.js";import{P as ye}from"./index-9WMiiDWH.js";import{d as ds,S as je,a as Se,b as fe}from"./settings-section-BSSTyi59.js";import{S as ms}from"./switch-B9P99cpo.js";import{a as De,T as us}from"./toggle-group-DiN3ciV3.js";import{A as ct}from"./avatar-EJ4rWeJV.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-DZnXWtkc.js";import{S as ne,u as oe}from"./constants-RvCh42kd.js";import{e as fs,f as hs}from"./use-organization-settings-DZQEi_vL.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as xs}from"./unwrap-tool-result-BYXdCQMg.js";function ue(t,e,s){let i=s.initialDeps??[],n,o=!0;function r(){var a,u,c;let d;s.key&&((a=s.debug)!=null&&a.call(s))&&(d=Date.now());const f=t();if(!(f.length!==i.length||f.some((N,b)=>i[b]!==N)))return n;i=f;let h;if(s.key&&((u=s.debug)!=null&&u.call(s))&&(h=Date.now()),n=e(...f),s.key&&((c=s.debug)!=null&&c.call(s))){const N=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-h)*100)/100,C=b/16,_=(p,S)=>{for(p=String(p);p.length<S;)p=" "+p;return p};console.info(`%c⏱ ${_(b,5)} /${_(N,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 gs=(t,e)=>Math.abs(t-e)<1.01,bs=(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}},vs=t=>t,ys=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},js=(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 c=u.borderBoxSize[0];if(c){n({width:c.inlineSize,height:c.blockSize});return}}n($e(s))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(s,{box:"border-box"}),()=>{o.unobserve(s)}},Ue={passive:!0},Ve=typeof window>"u"?!0:"onscrollend"in window,Ss=(t,e)=>{const s=t.scrollElement;if(!s)return;const i=t.targetWindow;if(!i)return;let n=0;const o=t.options.useScrollendEvent&&Ve?()=>{}:bs(i,()=>{e(n,!1)},t.options.isScrollingResetDelay),r=d=>()=>{const{horizontal:f,isRtl:m}=t.options;n=f?s.scrollLeft*(m&&-1||1):s.scrollTop,o(),e(n,d)},a=r(!0),u=r(!1);s.addEventListener("scroll",a,Ue);const c=t.options.useScrollendEvent&&Ve;return c&&s.addEventListener("scrollend",u,Ue),()=>{s.removeEventListener("scroll",a),c&&s.removeEventListener("scrollend",u)}},_s=(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"]},Ns=(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 ws{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:vs,rangeExtractor:ys,onChange:()=>{},measureElement:_s,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},c)=>{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 d=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,d),m=new Array(a).fill(void 0);for(let h=0;h<d;h++){const N=f[h];N&&(m[N.lane]=h)}for(let h=d;h<s;h++){const N=o(h),b=this.laneAssignments.get(h);let C,_;const p=u==="estimate"||c.has(N);if(b!==void 0&&this.options.lanes>1){C=b;const x=m[C],g=x!==void 0?f[x]:void 0;_=g?g.end+this.options.gap:i+n}else{const x=this.options.lanes===1?f[h-1]:this.getFurthestMeasurement(f,h);_=x?x.end+this.options.gap:i+n,C=x?x.lane:h%this.options.lanes,this.options.lanes>1&&p&&this.laneAssignments.set(h,C)}const S=c.get(N),y=typeof S=="number"?S:this.options.estimateSize(h),w=_+y;f[h]={index:h,start:_,size:y,end:w,key:N,lane:C},m[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?Cs({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&&gs(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 Cs({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(d=>d<s+e);){const d=t[a];u[d.lane]=d.end,a++}const c=Array(i).fill(s+e);for(;r>=0&&c.some(d=>d>=s);){const d=t[r];c[d.lane]=d.start,r--}r=Math.max(0,r-r%i),a=Math.min(n,a+(i-1-a%i))}return{startIndex:r,endIndex:a}}const Be=typeof document<"u"?U.useLayoutEffect:U.useEffect;function Is({useFlushSync:t=!0,...e}){const s=U.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]=U.useState(()=>new ws(i));return n.setOptions(i),Be(()=>n._didMount(),[]),Be(()=>n._willUpdate()),n}function ks(t){return Is({observeElementRect:js,observeElementOffset:Ss,scrollToFn:Ns,...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:W(),url:W(),icon:W()});se({registries:we(W(),se({enabled:Ie()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ce(W()).describe("List of MCP app_name or app_id values to hide from the store.")});const ge=se({keyId:W(),modelId:W(),title:W().optional()}).nullable(),Es=se({enabled:Ie(),chat:se({fast:ge,smart:ge,thinking:ge}),image:ge,webResearch:ge});se({ids:Ce(W()).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:W().describe("Brand context ID"),name:W().describe("Company name"),domain:W().describe("Company domain (e.g. example.com)"),overview:W().describe("Company overview / description"),logo:W().nullable().optional().describe("Logo URL"),favicon:W().nullable().optional().describe("Favicon URL"),ogImage:W().nullable().optional().describe("OG image URL"),fonts:se({heading:W().optional().describe("Font family for headings"),body:W().optional().describe("Font family for body text"),code:W().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:se({primary:W().optional().describe("Primary brand color (hex)"),secondary:W().optional().describe("Secondary brand color (hex)"),accent:W().optional().describe("Accent / highlight color (hex)"),background:W().optional().describe("Background color (hex)"),foreground:W().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ce(we(W(),Le())).nullable().optional().describe("Brand images"),metadata:we(W(),Le()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:W().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ie().optional().describe("Whether this is the default brand for the organization")});function Ms(t){const e=q.c(3),{error:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(ns,{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=q.c(51),{keys:s,onDelete:i,isDeleting:n}=t,[o,r]=U.useState(null),[a,u]=U.useState(null),[c,d]=U.useState("");let f;if(e[0]!==o||e[1]!==s){let O;e[3]!==o?(O=R=>R.id===o,e[3]=o,e[4]=O):O=e[4],f=s.find(O),e[0]=o,e[1]=s,e[2]=f}else f=e[2];const m=f,{org:h}=ie(),N=he();let b;e[5]!==h.id||e[6]!==h.slug?(b={connectionId:ne,orgId:h.id,orgSlug:h.slug},e[5]=h.id,e[6]=h.slug,e[7]=b):b=e[7];const C=oe(b);let _;e[8]!==C?(_=async O=>{const{keyId:R,label:B}=O;await C.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:R,label:B}})},e[8]=C,e[9]=_):_=e[9];let p;e[10]!==h.id||e[11]!==N?(p=()=>{N.invalidateQueries({queryKey:G.aiProviderKeys(h.id)}),u(null)},e[10]=h.id,e[11]=N,e[12]=p):p=e[12];let S;e[13]!==_||e[14]!==p?(S={mutationFn:_,onSuccess:p,onError:Ts},e[13]=_,e[14]=p,e[15]=S):S=e[15];const{mutate:y,isPending:w}=le(S);let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=O=>{u(O.id),d(O.label)},e[16]=x):x=e[16];const g=x;let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{u(null),d("")},e[17]=j):j=e[17];const I=j;let k;e[18]!==c||e[19]!==y?(k=O=>{const R=c.trim();R&&y({keyId:O,label:R})},e[18]=c,e[19]=y,e[20]=k):k=e[20];const v=k;let E;if(e[21]!==v||e[22]!==c||e[23]!==a||e[24]!==n||e[25]!==w||e[26]!==s){let O;e[28]!==v||e[29]!==c||e[30]!==a||e[31]!==n||e[32]!==w?(O=R=>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 flex-1 min-w-0",children:[l.jsx(nt,{size:14,className:"text-muted-foreground shrink-0"}),a===R.id?l.jsx("input",{autoFocus:!0,className:"font-medium bg-transparent border-b border-border outline-none flex-1 min-w-0",value:c,onChange:B=>d(B.target.value),onKeyDown:B=>{B.key==="Enter"&&v(R.id),B.key==="Escape"&&I()}}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-medium truncate",children:R.label}),l.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["added ",ps(new Date(R.createdAt))," ago"]})]})]}),l.jsx("div",{className:"flex items-center gap-0.5 shrink-0",onClick:Os,children:a===R.id?l.jsxs(l.Fragment,{children:[l.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-foreground",disabled:w||!c.trim(),onClick:()=>v(R.id),children:l.jsx(rs,{size:14})}),l.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-foreground",onClick:I,children:l.jsx(cs,{size:14})})]}):l.jsxs(l.Fragment,{children:[l.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-foreground",onClick:()=>g(R),children:l.jsx(Ht,{size:14})}),l.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",disabled:n,onClick:()=>r(R.id),children:l.jsx(as,{size:14})})]})})]},R.id),e[28]=v,e[29]=c,e[30]=a,e[31]=n,e[32]=w,e[33]=O):O=e[33],E=s.map(O),e[21]=v,e[22]=c,e[23]=a,e[24]=n,e[25]=w,e[26]=s,e[27]=E}else E=e[27];const P=!!o;let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=O=>!O&&r(null),e[34]=M):M=e[34];let A;e[35]===Symbol.for("react.memo_cache_sentinel")?(A=l.jsx(dt,{children:"Delete API Key"}),e[35]=A):A=e[35];const T=m?.label;let L;e[36]!==T?(L=l.jsxs(mt,{children:[A,l.jsxs(ut,{children:["This action cannot be undone. This will permanently delete"," ",l.jsx("span",{className:"font-medium text-foreground",children:T}),"."]})]}),e[36]=T,e[37]=L):L=e[37];let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(ft,{children:"Cancel"}),e[38]=V):V=e[38];let D;e[39]!==o||e[40]!==i?(D=l.jsxs(ht,{children:[V,l.jsx(pt,{onClick:()=>{o&&(i(o),r(null))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[39]=o,e[40]=i,e[41]=D):D=e[41];let K;e[42]!==L||e[43]!==D?(K=l.jsxs(xt,{onClick:As,children:[L,D]}),e[42]=L,e[43]=D,e[44]=K):K=e[44];let z;e[45]!==P||e[46]!==K?(z=l.jsx(gt,{open:P,onOpenChange:M,children:K}),e[45]=P,e[46]=K,e[47]=z):z=e[47];let $;return e[48]!==z||e[49]!==E?($=l.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[E,z]}),e[48]=z,e[49]=E,e[50]=$):$=e[50],$}function As(t){return t.stopPropagation()}function Os(t){return t.stopPropagation()}function Ts(){Y.error("Failed to update key label")}const Ps=se({label:W().optional(),apiKey:W().min(1,"API key is required")});function Rs(t){const e=q.c(62),{providerId:s,onCancel:i,onSuccess:n}=t,{org:o}=ie();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:ne,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=oe(r),u=he(),[c,d]=U.useState(!1);let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={resolver:Ee(Ps),defaultValues:{label:"",apiKey:""}},e[3]=f):f=e[3];const{register:m,handleSubmit:h,formState:N}=ke(f),{errors:b}=N;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:Ls},e[11]=C,e[12]=_,e[13]=p):p=e[13];const{mutate:S,isPending:y,error:w}=le(p);let x;e[14]!==S?(x=H=>S(H),e[14]=S,e[15]=x):x=e[15];let g;e[16]!==h||e[17]!==x?(g=h(x),e[16]=h,e[17]=x,e[18]=g):g=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=j):j=e[19];let I;e[20]!==m?(I=m("label"),e[20]=m,e[21]=I):I=e[21];let k;e[22]!==I?(k=l.jsxs("div",{className:"space-y-1",children:[j,l.jsx(re,{placeholder:"e.g. Personal key",...I,className:"h-8 text-sm"})]}),e[22]=I,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=v):v=e[24];const E=c?"text":"password";let P;e[25]!==m?(P=m("apiKey"),e[25]=m,e[26]=P):P=e[26];let M;e[27]!==E||e[28]!==P?(M=l.jsx(re,{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]!==c?(A=()=>d(!c),e[30]=c,e[31]=A):A=e[31];let T;e[32]!==c?(T=c?l.jsx(lt,{size:14}):l.jsx(it,{size:14}),e[32]=c,e[33]=T):T=e[33];let L;e[34]!==A||e[35]!==T?(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:T}),e[34]=A,e[35]=T,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 D;e[40]!==b.apiKey?(D=b.apiKey&&l.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[40]=b.apiKey,e[41]=D):D=e[41];let K;e[42]!==V||e[43]!==D?(K=l.jsxs("div",{className:"space-y-1",children:[v,V,D]}),e[42]=V,e[43]=D,e[44]=K):K=e[44];let z;e[45]!==w?(z=w&&l.jsx("p",{className:"text-xs text-destructive",children:w.message}),e[45]=w,e[46]=z):z=e[46];let $;e[47]!==y||e[48]!==i?($=l.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:y,children:"Cancel"}),e[47]=y,e[48]=i,e[49]=$):$=e[49];const O=y?"Saving...":"Save Key";let R;e[50]!==y||e[51]!==O?(R=l.jsx(Z,{type:"submit",size:"sm",disabled:y,children:O}),e[50]=y,e[51]=O,e[52]=R):R=e[52];let B;e[53]!==$||e[54]!==R?(B=l.jsxs(st,{children:[$,R]}),e[53]=$,e[54]=R,e[55]=B):B=e[55];let F;return e[56]!==k||e[57]!==K||e[58]!==z||e[59]!==B||e[60]!==g?(F=l.jsxs("form",{onSubmit:g,className:"space-y-3",children:[k,K,z,B]}),e[56]=k,e[57]=K,e[58]=z,e[59]=B,e[60]=g,e[61]=F):F=e[61],F}function Ls(t){Y.error(`Failed to save key: ${t.message}`)}const zs=se({label:W().optional(),baseUrl:W().min(1,"Base URL is required"),apiKey:W().optional()});function jt(t){const e=q.c(77),{preset:s,onCancel:i,onSuccess:n}=t,{org:o}=ie();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:ne,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=oe(r),u=he(),[c,d]=U.useState(!1);let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={resolver:Ee(zs),defaultValues:{label:"",baseUrl:"",apiKey:""}},e[3]=f):f=e[3];const{register:m,handleSubmit:h,formState:N}=ke(f),{errors:b}=N;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:Fs},e[11]=C,e[12]=_,e[13]=p):p=e[13];const{mutate:S,isPending:y,error:w}=le(p),x=s?`e.g. ${s.name} prod, ${s.name} dev`:"e.g. My OpenAI-compatible server",g=s?.baseUrlPlaceholder??"http://localhost:4000/v1";let j;e[14]!==S?(j=me=>S(me),e[14]=S,e[15]=j):j=e[15];let I;e[16]!==h||e[17]!==j?(I=h(j),e[16]=h,e[17]=j,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 v;e[20]!==m?(v=m("label"),e[20]=m,e[21]=v):v=e[21];let E;e[22]!==x||e[23]!==v?(E=l.jsxs("div",{className:"space-y-1",children:[k,l.jsx(re,{placeholder:x,...v,className:"h-8 text-sm"})]}),e[22]=x,e[23]=v,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]!==m?(M=m("baseUrl"),e[26]=m,e[27]=M):M=e[27];let A;e[28]!==g||e[29]!==M?(A=l.jsx(re,{type:"url",placeholder:g,...M,className:"h-8 text-sm"}),e[28]=g,e[29]=M,e[30]=A):A=e[30];let T;e[31]!==b.baseUrl?(T=b.baseUrl&&l.jsx("p",{className:"text-xs text-destructive",children:b.baseUrl.message}),e[31]=b.baseUrl,e[32]=T):T=e[32];let L;e[33]!==A||e[34]!==T?(L=l.jsxs("div",{className:"space-y-1",children:[P,A,T]}),e[33]=A,e[34]=T,e[35]=L):L=e[35];const V=s?.apiKeyRecommended?"recommended":"optional";let D;e[36]!==V?(D=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]=D):D=e[37];const K=c?"text":"password";let z;e[38]!==m?(z=m("apiKey"),e[38]=m,e[39]=z):z=e[39];let $;e[40]!==K||e[41]!==z?($=l.jsx(re,{type:K,placeholder:"sk-...",...z,className:"ph-no-capture h-8 text-sm pr-8"}),e[40]=K,e[41]=z,e[42]=$):$=e[42];let O;e[43]!==c?(O=()=>d(!c),e[43]=c,e[44]=O):O=e[44];let R;e[45]!==c?(R=c?l.jsx(lt,{size:14}):l.jsx(it,{size:14}),e[45]=c,e[46]=R):R=e[46];let B;e[47]!==O||e[48]!==R?(B=l.jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:R}),e[47]=O,e[48]=R,e[49]=B):B=e[49];let F;e[50]!==$||e[51]!==B?(F=l.jsxs("div",{className:"relative",children:[$,B]}),e[50]=$,e[51]=B,e[52]=F):F=e[52];let H;e[53]!==D||e[54]!==F?(H=l.jsxs("div",{className:"space-y-1",children:[D,F]}),e[53]=D,e[54]=F,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 te;e[58]!==w?(te=w&&l.jsx("p",{className:"text-xs text-destructive",children:w.message}),e[58]=w,e[59]=te):te=e[59];let ee;e[60]!==y||e[61]!==i?(ee=l.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:y,children:"Cancel"}),e[60]=y,e[61]=i,e[62]=ee):ee=e[62];const xe=y?"Saving...":"Save Connection";let ce;e[63]!==y||e[64]!==xe?(ce=l.jsx(Z,{type:"submit",size:"sm",disabled:y,children:xe}),e[63]=y,e[64]=xe,e[65]=ce):ce=e[65];let de;e[66]!==ee||e[67]!==ce?(de=l.jsxs(st,{children:[ee,ce]}),e[66]=ee,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]!==te||e[74]!==de||e[75]!==I?(ve=l.jsxs("form",{onSubmit:I,className:"space-y-3",children:[E,L,H,X,te,de]}),e[69]=E,e[70]=L,e[71]=H,e[72]=X,e[73]=te,e[74]=de,e[75]=I,e[76]=ve):ve=e[76],ve}function Fs(t){Y.error(`Failed to save connection: ${t.message}`)}function qe({provider:t,keys:e}){const{org:s}=ie(),i=oe({connectionId:ne,orgId:s.id,orgSlug:s.slug}),n=he(),[o,r]=U.useState(!1),[a,u]=U.useState(!1),[c,d]=U.useState(null),f=t.supportedMethods.includes("cli-activate"),m=e.length>0,{mutate:h,isPending:N}=le({mutationFn:async v=>(await i.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:v}}),v),onSuccess:v=>{n.invalidateQueries({queryKey:G.aiProviderKeys(s.id)}),n.invalidateQueries({queryKey:G.aiProviders(s.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(s.id,v)}),Y.success("Key deleted")},onError:v=>{Y.error(`Failed to delete key: ${v.message}`)}}),{mutate:b}=le({mutationFn:async({code:v,stateToken:E})=>{const P=await i.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:t.id,code:v,stateToken:E,label:t.name}});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),d(null)},onError:v=>{J("ai_provider_oauth_failed",{provider_id:t.id,error:v.message}),Y.error(`OAuth connection failed: ${v.message}`),u(!1),d(null)}}),{mutate:C,isPending:_}=le({mutationFn:async()=>{const v=await i.callTool({name:"AI_PROVIDER_CLI_ACTIVATE",arguments:{providerId:t.id}});if(v?.isError)throw new Error(v.content?.[0]?.text??"CLI activation failed");return v.structuredContent},onSuccess:v=>{if(!v?.activated){J("ai_provider_cli_activate_failed",{provider_id:t.id,error:v?.error??"unknown"}),Y.error(v?.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:v=>{J("ai_provider_cli_activate_failed",{provider_id:t.id,error:v.message}),Y.error(v.message)}}),{mutate:p,isPending:S}=le({mutationFn:async()=>{const v=await i.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:t.id}});if(v?.isError){const E=v.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:v=>{J("ai_provider_provision_failed",{provider_id:t.id,error:v.message}),Y.error(`Failed to connect ${t.name}: ${v.message}`)}});U.useEffect(()=>{if(!a||!c)return;let v=!1;const E=M=>{if(M.origin===window.location.origin&&M.data?.type==="AI_PROVIDER_OAUTH_CALLBACK"){const{code:A,stateToken:T}=M.data;T===c?(v=!0,b({code:A,stateToken:T})):(console.error("State token mismatch"),Y.error("Security check failed: State token mismatch"),u(!1),d(null))}};window.addEventListener("message",E);const P=setTimeout(()=>{v||(J("ai_provider_oauth_timeout",{provider_id:t.id}),u(!1),d(null),Y.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(P)}},[a,c,b,t.id]);const y=!!t.supportsProvision,w=t.supportedMethods.includes("oauth-pkce"),x=t.supportedMethods.includes("api-key"),g=()=>{if(!(o||a||_||S)){if(f){m||(J("ai_provider_connect_clicked",{provider_id:t.id,method:"cli-activate"}),C());return}y?(J("ai_provider_connect_clicked",{provider_id:t.id,method:"provision"}),p()):w?(J("ai_provider_connect_clicked",{provider_id:t.id,method:"oauth-pkce"}),j()):x&&(J("ai_provider_connect_clicked",{provider_id:t.id,method:"api-key"}),r(!0))}},j=async()=>{try{u(!0);const v=await i.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:t.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(v.structuredContent)d(v.structuredContent.stateToken),window.open(v.structuredContent.url,"AiProviderOAuth","width=600,height=700");else throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL")}catch(v){u(!1),Y.error(`Failed to start OAuth: ${v instanceof Error?v.message:String(v)}`)}},I=_?"Checking CLI...":S?"Connecting...":a?"Authorizing...":null,k=I??(m&&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,m&&!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&&!_&&!S?g:void 0,className:ae((a||_||S)&&"cursor-wait"),action:l.jsx("div",{className:"flex items-center gap-2",children:m&&l.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 shrink-0"})}),children:m&&!f&&l.jsx(yt,{keys:e,onDelete:h,isDeleting:N})}),l.jsx(Me,{open:o,onOpenChange:v=>{v||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(Rs,{providerId:t.id,onCancel:()=>r(!1),onSuccess:()=>r(!1)})]})})]})}function He(t){const e=q.c(58),{preset:s,keys:i,fallbackLogo:n}=t,{org:o}=ie();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:ne,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=oe(r),u=he(),[c,d]=U.useState(!1),f=i.length>0,m=s?.name??"Custom OpenAI Compatible",h=s?.description??"Connect any OpenAI-compatible endpoint by URL",N=s?.logo??n;let b;e[3]!==a?(b=async O=>(await a.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:O}}),O),e[3]=a,e[4]=b):b=e[4];let C;e[5]!==o.id||e[6]!==u?(C=O=>{u.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),u.invalidateQueries({queryKey:G.aiProviders(o.id)}),u.invalidateQueries({queryKey:G.aiProviderModels(o.id,O)}),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:Ds},e[8]=b,e[9]=C,e[10]=_):_=e[10];const{mutate:p,isPending:S}=le(_);let y;e[11]!==m||e[12]!==N?(y=N?l.jsx("img",{src:N,alt:m,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):l.jsx(ct,{fallback:m.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[11]=m,e[12]=N,e[13]=y):y=e[13];let w;e[14]!==f||e[15]!==i.length?(w=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]=w):w=e[16];let x;e[17]!==m||e[18]!==w?(x=l.jsxs("span",{className:"flex items-center gap-2",children:[m,w]}),e[17]=m,e[18]=w,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==s?.id?(g=()=>{c||(J("ai_provider_connect_clicked",{provider_id:"openai-compatible",preset_id:s?.id??null,method:"api-key"}),d(!0))},e[20]=c,e[21]=s?.id,e[22]=g):g=e[22];let j;e[23]!==f?(j=f?l.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 shrink-0"}):void 0,e[23]=f,e[24]=j):j=e[24];let I;e[25]!==p||e[26]!==f||e[27]!==S||e[28]!==i?(I=f&&l.jsx(yt,{keys:i,onDelete:p,isDeleting:S}),e[25]=p,e[26]=f,e[27]=S,e[28]=i,e[29]=I):I=e[29];let k;e[30]!==h||e[31]!==I||e[32]!==y||e[33]!==x||e[34]!==g||e[35]!==j?(k=l.jsx(fe,{icon:y,title:x,description:h,onClick:g,action:j,children:I}),e[30]=h,e[31]=I,e[32]=y,e[33]=x,e[34]=g,e[35]=j,e[36]=k):k=e[36];let v;e[37]===Symbol.for("react.memo_cache_sentinel")?(v=O=>{O||d(!1)},e[37]=v):v=e[37];let E;e[38]!==m?(E=l.jsxs(Oe,{children:["Connect ",m]}),e[38]=m,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 T=s??void 0;let L,V;e[45]===Symbol.for("react.memo_cache_sentinel")?(L=()=>d(!1),V=()=>d(!1),e[45]=L,e[46]=V):(L=e[45],V=e[46]);let D;e[47]!==T?(D=l.jsx(jt,{preset:T,onCancel:L,onSuccess:V}),e[47]=T,e[48]=D):D=e[48];let K;e[49]!==A||e[50]!==D?(K=l.jsxs(Ae,{children:[A,D]}),e[49]=A,e[50]=D,e[51]=K):K=e[51];let z;e[52]!==c||e[53]!==K?(z=l.jsx(Me,{open:c,onOpenChange:v,children:K}),e[52]=c,e[53]=K,e[54]=z):z=e[54];let $;return e[55]!==k||e[56]!==z?($=l.jsxs(l.Fragment,{children:[k,z]}),e[55]=k,e[56]=z,e[57]=$):$=e[57],$}function Ds(t){Y.error(`Failed to delete connection: ${t.message}`)}function St(t){const e=q.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=pe();let r,a,u,c,d;if(e[2]!==n?.providers||e[3]!==o||e[4]!==i){let N;e[10]!==i?(N=j=>j.id!==i,e[10]=i,e[11]=N):N=e[11];const b=(n?.providers??[]).filter(N),C=b.filter(Bs),_=b.filter(Vs),p=o.filter(Us),S=i!=="openai-compatible";let y;e[12]!==n?.providers?(y=n?.providers??[],e[12]=n?.providers,e[13]=y):y=e[13];let w;e[14]!==y?(w=y.find($s),e[14]=y,e[15]=w):w=e[15];const x=w;c="flex flex-col gap-6 w-full",d=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(j=>l.jsx(qe,{provider:j,keys:o.filter(I=>I.providerId===j.id)},j.id))})]})}),a=je,r=Se;let g;e[16]!==o?(g=j=>l.jsx(qe,{provider:j,keys:o.filter(I=>I.providerId===j.id)},j.id),e[16]=o,e[17]=g):g=e[17],u=[..._.map(g),...S?[...vt.map(j=>l.jsx(He,{preset:j,keys:p.filter(I=>I.presetId===j.id)},j.id)),l.jsx(He,{preset:null,keys:p.filter(Ks),fallbackLogo:x?.logo},"custom")]:[]],e[2]=n?.providers,e[3]=o,e[4]=i,e[5]=r,e[6]=a,e[7]=u,e[8]=c,e[9]=d}else r=e[5],a=e[6],u=e[7],c=e[8],d=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 m;e[21]!==a||e[22]!==f?(m=l.jsx(a,{children:f}),e[21]=a,e[22]=f,e[23]=m):m=e[23];let h;return e[24]!==c||e[25]!==d||e[26]!==m?(h=l.jsxs("div",{className:c,children:[d,m]}),e[24]=c,e[25]=d,e[26]=m,e[27]=h):h=e[27],h}function Ks(t){return!t.presetId}function $s(t){return t.id==="openai-compatible"}function Us(t){return t.providerId==="openai-compatible"}function Vs(t){return!t.supportedMethods.includes("cli-activate")&&t.id!=="openai-compatible"}function Bs(t){return t.supportedMethods.includes("cli-activate")}const Ws={usd:[10,20,100],brl:[50,100,500]};function qs(){const t=q.c(29),{org:e}=ie();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:ne,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const i=oe(s),[n,o]=U.useState(!1),{mutate:r,isPending:a}=le({mutationFn:async g=>{const j=await i.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:g,currency:m}});if(j?.isError)throw new Error(j.content?.[0]?.text??"Failed to get top-up URL");return j.structuredContent?.url},onSuccess:Qs,onError:Hs}),[u,c]=U.useState(""),[d,f]=U.useState("usd"),m=d,h=parseFloat(u),N=!isNaN(h)&&h>=1,b=m==="brl"?"R$":"$";let C;t[3]!==f?(C=g=>{g&&f(g)},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 S;t[7]!==m||t[8]!==C?(S=l.jsxs(us,{type:"single",variant:"outline",size:"default",value:m,onValueChange:C,children:[_,p]}),t[7]=m,t[8]=C,t[9]=S):S=t[9];let y;t[10]!==m||t[11]!==b||t[12]!==n||t[13]!==a||t[14]!==r?(y=!n&&l.jsxs(l.Fragment,{children:[Ws[m].map(g=>l.jsxs(Z,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:a,onClick:()=>r(g*100),children:[b,g]},g)),l.jsx(Z,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>o(!0),disabled:a,children:"Custom"})]}),t[10]=m,t[11]=b,t[12]=n,t[13]=a,t[14]=r,t[15]=y):y=t[15];let w;t[16]!==b||t[17]!==u||t[18]!==h||t[19]!==n||t[20]!==N||t[21]!==a||t[22]!==c||t[23]!==r?(w=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(re,{type:"number",min:"1",step:"1",placeholder:"50",value:u,onChange:g=>c(g.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),l.jsx(Z,{className:"h-10",disabled:!N||a,onClick:()=>r(Math.round(h*100)),children:a?"...":"Add"}),l.jsx(Z,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{o(!1),c("")},children:"Cancel"})]}),t[16]=b,t[17]=u,t[18]=h,t[19]=n,t[20]=N,t[21]=a,t[22]=c,t[23]=r,t[24]=w):w=t[24];let x;return t[25]!==S||t[26]!==y||t[27]!==w?(x=l.jsx("div",{className:"flex flex-col gap-2.5",children:l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S,y,w]})}),t[25]=S,t[26]=y,t[27]=w,t[28]=x):x=t[28],x}function Hs(t){Y.error(`Top-up failed: ${t.message}`)}function Qs(t){t&&window.open(t,"_blank","noopener,noreferrer")}function Ys(t){return t<=0?"text-destructive":t<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function Gs(){const t=q.c(61),{org:e}=ie();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:ne,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const i=oe(s),n=he(),o=pe();let r;t[3]!==o?(r=o.find(Js),t[3]=o,t[4]=r):r=t[4];const a=r,[u,c]=U.useState(!1);let d;t[5]!==i||t[6]!==a?(d=async()=>{a&&await i.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:a.id}})},t[5]=i,t[6]=a,t[7]=d):d=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"),c(!1)},t[8]=e.id,t[9]=n,t[10]=f):f=t[10];let m;t[11]!==d||t[12]!==f?(m={mutationFn:d,onSuccess:f,onError:Xs},t[11]=d,t[12]=f,t[13]=m):m=t[13];const{mutate:h,isPending:N}=le(m);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:S,isLoading:y,refetch:w,isFetching:x}=Je(p);if(!a)return null;const g=S?.balanceCents!=null?S.balanceCents/100:null;let j;t[22]!==g?(j=g!=null?`$${g.toFixed(2)}`:"—",t[22]=g,t[23]=j):j=t[23];const I=j;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 v;t[25]===Symbol.for("react.memo_cache_sentinel")?(v=()=>c(!0),t[25]=v):v=t[25];let E;t[26]!==N?(E=l.jsxs("div",{className:"flex items-center justify-between",children:[k,l.jsx(Z,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:v,disabled:N,children:"Disconnect"})]}),t[26]=N,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 T;t[32]!==u||t[33]!==A?(T=l.jsx(gt,{open:u,onOpenChange:c,children:A}),t[32]=u,t[33]=A,t[34]=T):T=t[34];let L;t[35]!==g||t[36]!==I||t[37]!==x||t[38]!==y?(L=y||x?l.jsx(Q,{className:"h-9 w-24"}):l.jsx("span",{className:ae("text-3xl font-semibold tabular-nums tracking-tight",g!=null&&Ys(g)),children:I}),t[35]=g,t[36]=I,t[37]=x,t[38]=y,t[39]=L):L=t[39];let V;t[40]!==w?(V=()=>w(),t[40]=w,t[41]=V):V=t[41];const D=x&&"animate-spin";let K;t[42]!==D?(K=ae(D),t[42]=D,t[43]=K):K=t[43];let z;t[44]!==K?(z=l.jsx(Ze,{size:14,className:K}),t[44]=K,t[45]=z):z=t[45];let $;t[46]!==x||t[47]!==V||t[48]!==z?($=l.jsx("button",{type:"button",onClick:V,disabled:x,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]=x,t[47]=V,t[48]=z,t[49]=$):$=t[49];let O;t[50]!==L||t[51]!==$?(O=l.jsxs("div",{className:"flex items-baseline gap-2",children:[L,$]}),t[50]=L,t[51]=$,t[52]=O):O=t[52];let R;t[53]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),t[53]=R):R=t[53];let B;t[54]!==O?(B=l.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[O,R]}),t[54]=O,t[55]=B):B=t[55];let F;t[56]===Symbol.for("react.memo_cache_sentinel")?(F=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(qs,{})]}),t[56]=F):F=t[56];let H;return t[57]!==E||t[58]!==T||t[59]!==B?(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,T,B,F]})})}),t[57]=E,t[58]=T,t[59]=B,t[60]=H):H=t[60],H}function Xs(t){Y.error(`Failed to disconnect: ${t.message}`)}function Js(t){return t.providerId==="deco"}const Zs=t=>t.capabilities?.includes("image")===!0,el=t=>{if(t.asyncResearch===!0)return!0;const e=t.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return e.includes("sonar")||e.includes("deepresearch")},tl={fast:"Fast",smart:"Smart",thinking:"Thinking"},sl={fast:"Fastest responses, best for quick tasks",smart:"Balanced speed and capability",thinking:"Most capable, best for complex tasks"};function Ne(t){const e=q.c(20),{slot:s,onSlotChange:i,filterModels:n,defaultKeyId:o}=t,r=pe(),[a,u]=U.useState(s?.keyId??o);let c;e[0]!==s?(c=()=>{s?.keyId&&u(s.keyId)},e[0]=s,e[1]=c):c=e[1];const d=s?.keyId;let f;e[2]!==d?(f=[d],e[2]=d,e[3]=f):f=e[3],U.useEffect(c,f);const m=a??o;let h;e[4]!==m||e[5]!==r?(h=m?r.find(g=>g.id===m):null,e[4]=m,e[5]=r,e[6]=h):h=e[6];const N=h,{models:b,isLoading:C}=be(n?m??void 0:void 0),_=n?C||b.some(n):!0;let p;e[7]!==s||e[8]!==N?.providerId?(p=s?{modelId:s.modelId,title:s.title??s.modelId,keyId:s.keyId,providerId:N?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,e[7]=s,e[8]=N?.providerId,e[9]=p):p=e[9];const S=p;if(n&&!_){let g;return e[10]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),e[10]=g):g=e[10],g}let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=g=>u(g),e[11]=y):y=e[11];let w;e[12]!==m||e[13]!==i?(w=g=>{const j=g.keyId??m??"";u(j),i({keyId:j,modelId:g.modelId,title:g.title})},e[12]=m,e[13]=i,e[14]=w):w=e[14];let x;return e[15]!==m||e[16]!==n||e[17]!==S||e[18]!==w?(x=l.jsx(Wl,{variant:"bordered",placeholder:"Pick model",model:S,credentialId:m,filterModels:n,onCredentialChange:y,onModelChange:w}),e[15]=m,e[16]=n,e[17]=S,e[18]=w,e[19]=x):x=e[19],x}function ll(t){const e=q.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(os,{size:12}),"Saved"]}),e[1]=n):n=e[1],n}return null}function il(){const t=pe(),e=fs(),s=t.length>0,i=ke({resolver:Ee(Es),values:e,mode:"onChange"}),{mutate:n,isPending:o,isSuccess:r}=hs(),a=i.formState.isDirty,{schedule:u}=is({delayMs:250,save:async()=>{if(!i.formState.isDirty)return;const p=i.getValues();n(p,{onSuccess:()=>i.reset(p,{keepValues:!0}),onError:S=>{i.reset(e),Y.error(`Failed to save: ${S.message}`)}})}}),c=t[0],d=t[1],f=t[2],{models:m}=be(c?.id),{models:h}=be(d?.id),{models:N}=be(f?.id),b=p=>{const S=i.getValues("chat");if(p&&!S.fast&&!S.smart&&!S.thinking){const y={};c?.id&&(y[c.id]=m),d?.id&&(y[d.id]=h),f?.id&&(y[f.id]=N);const w=Fe(t,y);i.reset({enabled:!0,chat:w.chat,image:w.image,webResearch:w.webResearch},{keepDirty:!0})}else i.setValue("enabled",p,{shouldDirty:!0});u()};U.useEffect(()=>{s||i.reset({enabled:!1,chat:{fast:null,smart:null,thinking:null},image:null,webResearch:null})},[s,i]),U.useEffect(()=>{const p=i.getValues();if(!p.enabled)return;const S=new Set(t.map(E=>E.id)),y={};c?.id&&(y[c.id]=m),d?.id&&(y[d.id]=h),f?.id&&(y[f.id]=N);const w=E=>E!=null&&!S.has(E.keyId),x={fast:w(p.chat.fast)?null:p.chat.fast,smart:w(p.chat.smart)?null:p.chat.smart,thinking:w(p.chat.thinking)?null:p.chat.thinking},g=w(p.image)?null:p.image,j=w(p.webResearch)?null:p.webResearch,I=!x.fast||!x.smart||!x.thinking||!g||!j,k=x.fast===p.chat.fast&&x.smart===p.chat.smart&&x.thinking===p.chat.thinking;if(!I&&k)return;const v=Fe(t,y);i.reset({...p,chat:{fast:x.fast??v.chat.fast,smart:x.smart??v.chat.smart,thinking:x.thinking??v.chat.thinking},image:g??v.image,webResearch:j??v.webResearch},{keepDirty:!0})},[i,t,m,h,N,c?.id,d?.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(ll,{isPending:o,showSaved:r&&!a}),l.jsx(ms,{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:S})=>l.jsx(fe,{title:tl[p],description:sl[p],action:l.jsx(Ne,{slot:S.value,defaultKeyId:t[0]?.id??null,onSlotChange:y=>{S.onChange(y),u()}})})},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:Zs,onSlotChange:S=>{p.onChange(S),u()}})})}),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:el,onSlotChange:S=>{p.onChange(S),u()}})})})]})]})})}function nl(){const t=q.c(6),s=pe().some(ol);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(Gs,{}),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(U.Suspense,{fallback:l.jsx(Q,{className:"h-16 w-full"}),children:l.jsx(il,{})}),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 ol(t){return t.providerId==="deco"}function Ii(){const t=q.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(ds,{children:[e,l.jsx(Xe,{fallback:rl,children:l.jsx(U.Suspense,{fallback:l.jsx(Q,{className:"h-64 w-full"}),children:l.jsx(nl,{})})})]})})})}),t[1]=s):s=t[1],s}function rl(t){const{error:e}=t;return l.jsx(Ms,{error:e??new Error("Failed to load AI providers")})}function al(){const t=q.c(10),{org:e}=ie();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:ne,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const i=oe(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:{}}),c=xs(u);return(Array.isArray(c?.items)?c.items:[]).find(cl)??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 cl(t){return t.isDefault&&!t.archivedAt}function dl(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 ml(t){const e=q.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=al(),u=o.name;let c;e[2]!==a?(c=a?dl(a):null,e[2]=a,e[3]=c):c=e[3];const d=c,f=a?.favicon??a?.logo??null,m=i??(u?`${u} is ready for agents`:"Your agents are almost ready"),h=n??"Choose how to power your AI team.",N=!!(f||d);let b;e[4]!==d?(b=d?{backgroundColor:`${d}18`,borderColor:`${d}30`}:void 0,e[4]=d,e[5]=b):b=e[5];const C=b,_=N?"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]!==d?(p=f?l.jsx("img",{src:f,alt:"",className:"size-7 rounded object-contain"}):l.jsx(ls,{size:24,style:d?{color:d}:void 0,className:ae(!d&&"text-lime-600 dark:text-lime-400")}),e[6]=f,e[7]=d,e[8]=p):p=e[8];let S;e[9]!==_||e[10]!==C||e[11]!==p?(S=l.jsx("div",{className:_,style:C,children:p}),e[9]=_,e[10]=C,e[11]=p,e[12]=S):S=e[12];let y;e[13]!==m?(y=l.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:m}),e[13]=m,e[14]=y):y=e[14];let w;e[15]!==h?(w=l.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:h}),e[15]=h,e[16]=w):w=e[16];let x;e[17]!==y||e[18]!==w?(x=l.jsxs("div",{className:"space-y-2",children:[y,w]}),e[17]=y,e[18]=w,e[19]=x):x=e[19];let g;e[20]!==S||e[21]!==x?(g=l.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[S,x]}),e[20]=S,e[21]=x,e[22]=g):g=e[22];let j;e[23]!==r?(j=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]=j):j=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(U.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]!==j?(k=l.jsxs("div",{className:"w-full space-y-3",children:[j,I]}),e[26]=j,e[27]=k):k=e[27];let v;return e[28]!==k||e[29]!==g?(v=l.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-2xl px-4",children:[g,k]}),e[28]=k,e[29]=g,e[30]=v):v=e[30],v}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"},ul=[{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"]}],fl=ul.flatMap(({tier:t,prefixes:e})=>e.map(s=>({tier:t,prefix:s}))).sort((t,e)=>e.prefix.length-t.prefix.length),hl=new Set(["google/gemini-2.5-pro"]),Qe=new Map;function pl(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 fl)if(t.startsWith(n)){if(hl.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=pl(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:",xl=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 gl(t){try{const e=localStorage.getItem(wt+t);return e?new Set(JSON.parse(e)):null}catch{return null}}function bl(t,e){localStorage.setItem(wt+t,JSON.stringify([...e]))}function vl(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 yl=["bg-destructive","bg-warning","bg-success","bg-success"],jl=["text-success","text-warning","text-warning","text-destructive"];function Sl(t){const e=Math.round(t*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(t*.75)} words`}function _l(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 Nl={text:{icon:l.jsx(Jt,{className:"size-3.5"}),label:"Text"},vision:{icon:l.jsx(Xt,{className:"size-3.5"}),label:"Vision"},image:{icon:l.jsx(Zt,{className:"size-3.5"}),label:"Image"},tools:{icon:l.jsx(Gt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:l.jsx(Yt,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:l.jsx(ot,{className:"size-3.5"}),label:"Web search"}};function wl(t){const e=q.c(5),{capability:s}=t;let i;e[0]!==s?(i=Nl[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 Cl(t){const e=q.c(49),{model:s,compact:i}=t,n=i===void 0?!1:i;if(!s){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=x):x=e[0],x}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:c}=a;if(n){let x;e[3]!==s.limits?(x=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]=x):x=e[4];let g;e[5]!==o?(g=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]=g):g=e[6];let j;e[7]!==r?(j=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]=j):j=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]!==x||e[12]!==g||e[13]!==j||e[14]!==I?(k=l.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,g,j,I]}),e[11]=x,e[12]=g,e[13]=j,e[14]=I,e[15]=k):k=e[15],k}let d;e[16]!==u?(d=l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:u}),e[16]=u,e[17]=d):d=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 m;e[21]!==c?(m=l.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:c}),e[21]=c,e[22]=m):m=e[22];let h;e[23]!==f||e[24]!==m?(h=l.jsxs("div",{className:"flex items-center gap-2.5",children:[f,m]}),e[23]=f,e[24]=m,e[25]=h):h=e[25];let N;e[26]!==s.modelId?(N=l.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:s.modelId}),e[26]=s.modelId,e[27]=N):N=e[27];let b;e[28]!==d||e[29]!==h||e[30]!==N?(b=l.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[d,h,N]}),e[28]=d,e[29]=h,e[30]=N,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(Il)}),e[32]=s.capabilities,e[33]=C):C=e[33];let _;e[34]!==s.limits?(_=s.limits?.contextWindow&&(()=>{const{level:x,label:g,description:j}=vl(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:ae("w-2 h-2 rounded-full",I<=x?yl[x-1]:"bg-muted")},I))}),l.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:g}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",j]})]}),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:Sl(s.limits.maxOutputTokens)})]})]}),e[36]=s.limits,e[37]=p):p=e[37];let S;e[38]!==o||e[39]!==r?(S=(o!=null||r!=null)&&(()=>{const{level:x,label:g}=o!=null?_l(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(j=>l.jsx("span",{className:ae("text-sm font-bold leading-none",j<=x?jl[x-1]:"text-muted-foreground/20"),children:"$"},j))}),l.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:g})]}),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]=S):S=e[40];let y;e[41]!==_||e[42]!==p||e[43]!==S?(y=l.jsxs("div",{className:"flex flex-col gap-6",children:[_,p,S]}),e[41]=_,e[42]=p,e[43]=S,e[44]=y):y=e[44];let w;return e[45]!==y||e[46]!==b||e[47]!==C?(w=l.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[b,C,y]}),e[45]=y,e[46]=b,e[47]=C,e[48]=w):w=e[48],w}function Il(t){return l.jsx(wl,{capability:t},t)}function kl(t){const e=q.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 c;e[4]!==s||e[5]!==i?(c=()=>i(s),e[4]=s,e[5]=i,e[6]=c):c=e[6];let d;e[7]!==s.title||e[8]!==u?(d=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]=d):d=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 m;e[12]!==r?(m=l.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=m):m=e[13];let h;e[14]!==f||e[15]!==m?(h=l.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,m]}),e[14]=f,e[15]=m,e[16]=h):h=e[16];let N;return e[17]!==c||e[18]!==d||e[19]!==h?(N=l.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:c,children:[d,h]}),e[17]=c,e[18]=d,e[19]=h,e[20]=N):N=e[20],N}function El(t){const e=q.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(es,{className:"size-3.5"}),e[4]=u):u=e[4];let c;e[5]!==i?(c=l.jsx("div",{className:"flex items-center gap-2",children:l.jsxs(Z,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[u,"Retry"]})}),e[5]=i,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function Ml(){const t=q.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(Al)}),t[0]=e):e=t[0],e}function Al(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=q.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 c;e[6]!==o||e[7]!==n?(c=d=>l.jsx("div",{onClick:()=>n(d),className:"cursor-pointer",children:l.jsx(kl,{model:d,onHover:o})},d.modelId),e[6]=o,e[7]=n,e[8]=c):c=e[8],a=i.map(c),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 Ol(t){const e=q.c(21),{model:s,isChecked:i,onToggle:n,onHover:o}=t,[r,a]=U.useState(i);r!==i&&a(i);let u;e[0]!==s?(u=Te(s),e[0]=s,e[1]=u):u=e[1];const c=u;let d;e[2]!==s||e[3]!==o?(d=()=>o(s),e[2]=s,e[3]=o,e[4]=d):d=e[4];let f;e[5]!==s.modelId||e[6]!==n?(f=()=>{a(Tl),n(s.modelId)},e[5]=s.modelId,e[6]=n,e[7]=f):f=e[7];let m;e[8]!==r||e[9]!==f?(m=l.jsx(Rt,{checked:r,onCheckedChange:f}),e[8]=r,e[9]=f,e[10]=m):m=e[10];let h;e[11]!==c||e[12]!==s.title?(h=l.jsx("img",{src:c,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[11]=c,e[12]=s.title,e[13]=h):h=e[13];let N;e[14]!==s.title?(N=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]=N):N=e[15];let b;return e[16]!==d||e[17]!==m||e[18]!==h||e[19]!==N?(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:d,children:[m,h,N]}),e[16]=d,e[17]=m,e[18]=h,e[19]=N,e[20]=b):b=e[20],b}function Tl(t){return!t}function Pl(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 Rl({items:t,shortlistSet:e,onToggle:s,onHover:i}){const n=U.useRef(null),o=ks({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(Ol,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:s,onHover:i})},r.key):null})})})}function Ll(t){const e=q.c(23),{keyId:s,searchTerm:i,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:u}=t,{models:c}=be(s),d=u?c.filter(u):c.filter(zl);let f;e[0]!==s?(f=()=>(s?gl(s):null)??xl,e[0]=s,e[1]=f):f=e[1];const[m,h]=U.useState(f),[,N]=U.useTransition();let b;e[2]!==s||e[3]!==N?(b=k=>{s&&N(()=>{h(v=>{const E=new Set(v);return E.has(k)?E.delete(k):E.add(k),bl(s,E),E})})},e[2]=s,e[3]=N,e[4]=b):b=e[4];const C=b,_=i.toLowerCase().trim(),p=k=>_?k.filter(v=>v.title.toLowerCase().includes(_)||v.modelId.toLowerCase().includes(_)):k;if(r){const k=Ye(p(d)),v=Pl(k);let E;e[5]!==m?(E=T=>m.has(T.modelId),e[5]=m,e[6]=E):E=e[6];const P=d.filter(E).length;let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=l.jsx(ts,{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(Rl,{items:v,shortlistSet:m,onToggle:C,onHover:n})]})}let S;e[10]!==m?(S=k=>m.has(k.modelId),e[10]=m,e[11]=S):S=e[11];const y=d.filter(S),w=y.length>0?y:d,x=Ye(p(w));let g;e[12]!==x||e[13]!==n||e[14]!==o?(g=_t.map(k=>l.jsx(Ge,{label:Nt[k],models:x[k],onSelect:o,onHover:n},k)),e[12]=x,e[13]=n,e[14]=o,e[15]=g):g=e[15];let j;e[16]!==x.other||e[17]!==n||e[18]!==o?(j=l.jsx(Ge,{label:"Other",models:x.other,onSelect:o,onHover:n}),e[16]=x.other,e[17]=n,e[18]=o,e[19]=j):j=e[19];let I;return e[20]!==g||e[21]!==j?(I=l.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[g,j]}),e[20]=g,e[21]=j,e[22]=I):I=e[22],I}function zl(t){return t.asyncResearch!==!0}function Ct(t){const e=q.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 c;e[8]!==s?(c=Te(s),e[8]=s,e[9]=c):c=e[9];const d=c;let f;e[10]!==s.title||e[11]!==d?(f=l.jsx("img",{src:d,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:s.title}),e[10]=s.title,e[11]=d,e[12]=f):f=e[12];let m;e[13]!==u?(m=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]=m):m=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 N;return e[16]!==f||e[17]!==m?(N=l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[f,m,h]}),e[16]=f,e[17]=m,e[18]=N):N=e[18],N}const Fl=["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?Fl.some(s=>e.includes(s)):!1}function ki(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 Ei(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 Mi(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 Dl(){const t=q.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(Kl)})]}),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 Kl(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=q.c(49),{onClose:s,credentialId:i,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=t,[u,c]=U.useState(null),[d,f]=U.useState(""),[m,h]=U.useState(!1),N=U.useRef(null),b=rt(),C=pe();let _;e[0]!==b?.providers?(_=Object.fromEntries((b?.providers??[]).map(Vl)),e[0]=b?.providers,e[1]=_):_=e[1];const p=_,S=Tt(),{org:y}=ie();let w;e[2]!==n?(w=F=>{n(F),c(null)},e[2]=n,e[3]=w):w=e[3];const x=w;let g;e[4]!==i||e[5]!==s||e[6]!==r?(g=F=>{i&&(r(F),f(""),s())},e[4]=i,e[5]=s,e[6]=r,e[7]=g):g=e[7];const j=g;if(C.length===0){let F;return e[8]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:l.jsx(ml,{})}),e[8]=F):F=e[8],F}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=m?"Search all models...":"Search for a model...";let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=F=>f(F.target.value),e[10]=v):v=e[10];let E;e[11]!==d||e[12]!==k?(E=l.jsx(re,{ref:N,type:"text",placeholder:k,value:d,onChange:v,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=d,e[12]=k,e[13]=E):E=e[13];let P;e[14]!==i||e[15]!==x||e[16]!==C||e[17]!==p?(P=C.length>0&&l.jsxs(Ut,{value:i??"",onValueChange:x,children:[l.jsxs(Vt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ul,children:[l.jsx(Bt,{placeholder:"Key",children:(()=>{const F=C.find(xe=>xe.id===i),H=F?p[F.providerId]:void 0,X=We(F?.presetId),te=X?.logo??H?.logo,ee=X?.name??H?.name??F?.providerId??"Key";return l.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[te?l.jsx("img",{src:te,alt:ee,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:ee.slice(0,1).toUpperCase()}),l.jsx("span",{className:"text-xs truncate",children:ee})]})})()}),l.jsx(Qt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),l.jsx(Wt,{children:C.map(F=>{const H=p[F.providerId],X=We(F.presetId),te=X?.logo??H?.logo,ee=X?.name??H?.name??F.providerId;return l.jsx(qt,{value:F.id,children:l.jsxs("div",{className:"flex items-center gap-2",children:[te?l.jsx("img",{src:te,alt:ee,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:ee.slice(0,1).toUpperCase()}),l.jsxs("span",{children:[ee," — ",F.label]})]})},F.id)})})]}),e[14]=i,e[15]=x,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=F=>{const{error:H,resetError:X}=F;return l.jsx(El,{error:H,onRetry:X,credentialId:i??void 0})},e[22]=i,e[23]=A):A=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=l.jsx(Ml,{}),e[24]=T):T=e[24];const L=i??void 0;let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=()=>h($l),e[25]=V):V=e[25];let D;e[26]!==a||e[27]!==j||e[28]!==m||e[29]!==d||e[30]!==L?(D=l.jsx(U.Suspense,{fallback:T,children:l.jsx(Ll,{keyId:L,searchTerm:d,onHover:c,onModelSelect:j,managing:m,onToggleManage:V,filterModels:a})}),e[26]=a,e[27]=j,e[28]=m,e[29]=d,e[30]=L,e[31]=D):D=e[31];let K;e[32]!==i||e[33]!==A||e[34]!==D?(K=l.jsx(Xe,{fallback:A,children:D},i),e[32]=i,e[33]=A,e[34]=D,e[35]=K):K=e[35];let z;e[36]!==m||e[37]!==S||e[38]!==y?(z=!m&&l.jsxs("div",{className:"border-t border-border flex",children:[l.jsxs("button",{type:"button",onClick:()=>U.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(ss,{className:"size-3.5 shrink-0"}),"Manage models"]}),l.jsx("div",{className:"w-px bg-border shrink-0"}),l.jsxs("button",{type:"button",onClick:()=>S({to:"/$org/settings/ai-providers",params:{org:y.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]=m,e[37]=S,e[38]=y,e[39]=z):z=e[39];let $;e[40]!==K||e[41]!==z||e[42]!==M?($=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,K,z]}),e[40]=K,e[41]=z,e[42]=M,e[43]=$):$=e[43];const O=u??o??null;let R;e[44]!==O?(R=l.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:l.jsx(Cl,{model:O})}),e[44]=O,e[45]=R):R=e[45];let B;return e[46]!==$||e[47]!==R?(B=l.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[$,R]}),e[46]=$,e[47]=R,e[48]=B):B=e[48],B}function $l(t){return!t}function Ul(t){return t.stopPropagation()}function Vl(t){return[t.id,t]}function Bl(t){const e=q.c(12),{onClose:s}=t,{credentialId:i,setCredentialId:n,selectedModel:o,setModel:r}=at();let a;e[0]!==n?(a=d=>{J("chat_credential_changed",{credential_id:d}),n(d)},e[0]=n,e[1]=a):a=e[1];let u;e[2]!==i||e[3]!==o?.modelId||e[4]!==r?(u=d=>{i&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:d.modelId,to_model_provider:d.providerId??null,credential_id:i}),r({...d,keyId:i}))},e[2]=i,e[3]=o?.modelId,e[4]=r,e[5]=u):u=e[5];let c;return e[6]!==i||e[7]!==s||e[8]!==o||e[9]!==a||e[10]!==u?(c=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]=c):c=e[11],c}function Wl(t){const e=q.c(38),{variant:s,className:i,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:u,onModelChange:c,filterModels:d}=t,f=s===void 0?"borderless":s,m=n===void 0?"Select model":n,[h,N]=U.useState(!1),b=c!==void 0,C=$t(),_=f==="borderless"?"ghost":"outline",p=f==="borderless"&&"md:border-none";let S;e[0]!==i||e[1]!==p?(S=ae("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]=S):S=e[2];let y;e[3]!==r||e[4]!==o||e[5]!==m||e[6]!==b?(y=b?l.jsx(Ct,{model:o??null,placeholder:m,isLoading:r}):l.jsx(Hl,{placeholder:m}),e[3]=r,e[4]=o,e[5]=m,e[6]=b,e[7]=y):y=e[7];let w;e[8]!==_||e[9]!==S||e[10]!==y?(w=l.jsx(Z,{variant:_,size:"sm",className:S,children:y}),e[8]=_,e[9]=S,e[10]=y,e[11]=w):w=e[11];const x=w;let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(Dl,{}),e[12]=g):g=e[12];let j;e[13]!==a||e[14]!==d||e[15]!==o||e[16]!==u||e[17]!==c||e[18]!==b?(j=l.jsx(U.Suspense,{fallback:g,children:b?l.jsx(Et,{onClose:()=>N(!1),credentialId:a??null,onCredentialChange:u??ql,selectedModel:o??null,onModelChange:c,filterModels:d}):l.jsx(Bl,{onClose:()=>N(!1)})}),e[13]=a,e[14]=d,e[15]=o,e[16]=u,e[17]=c,e[18]=b,e[19]=j):j=e[19];const I=j;if(C){let M;e[20]!==x?(M=l.jsx(zt,{asChild:!0,children:x}),e[20]=x,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 T;e[23]!==I?(T=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]=T):T=e[24];let L;return e[25]!==h||e[26]!==M||e[27]!==T?(L=l.jsxs(Kt,{open:h,onOpenChange:N,children:[M,T]}),e[25]=h,e[26]=M,e[27]=T,e[28]=L):L=e[28],L}let k;e[29]!==x?(k=l.jsx(Lt,{asChild:!0,children:x}),e[29]=x,e[30]=k):k=e[30];let v;e[31]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Oe,{className:"sr-only",children:"Select model"}),e[31]=v):v=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:[v,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:N,children:[k,E]}),e[34]=h,e[35]=k,e[36]=E,e[37]=P):P=e[37],P}function ql(){}function Hl(t){const e=q.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{Wl as M,ml as N,Ii as O,Mi as a,Ei as g,ki 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-D9n-W_rO.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-CMnREwkX.js";import{i as q}from"./ArrowNarrowLeft-yxFeL5-Q.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-BOPwjpzz.js";import{t as me,a as G}from"./Users03-BbIOB2XC.js";import{i as de}from"./ChevronRight-CZ_XAq5W.js";import{i as fe}from"./Lock01-63SpB195.js";import{i as xe}from"./Shield01-BGj8uiOU.js";import{s as be}from"./User01-CDDY3fE9.js";import{i as B}from"./Zap-Ctp20y2W.js";import{u as he}from"./tooltip-D3G-75TX.js";import{u as ue}from"./use-status-sounds-BFxmOR4f.js";import"./X-yKx8T0mV.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-2TQ7wYAd.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.306.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.306.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-CPXgqgtn.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-9WMiiDWH.js";import{i as q}from"./ArrowNarrowLeft-IKO0Pdme.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-DZh8af5t.js";import{t as me,a as G}from"./Users03-CRQrY9LZ.js";import{i as de}from"./ChevronRight-BxsGpbIW.js";import{i as fe}from"./Lock01-BDVFL4zm.js";import{i as xe}from"./Shield01-B-3tcngo.js";import{s as be}from"./User01-DGJlNaMw.js";import{i as B}from"./Zap-Dd-DoFdM.js";import{u as he}from"./tooltip-CCRvyunm.js";import{u as ue}from"./use-status-sounds-BnOGH79m.js";import"./X-DZI_qdyG.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-DQouP0Xf.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.306.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.306.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-D9n-W_rO.js";import{C as w}from"./card-CMatfPs6.js";import{i as E}from"./ArrowUpRight-Bxgj2IVp.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-CPXgqgtn.js";import{C as w}from"./card-DfBr11OH.js";import{i as E}from"./ArrowUpRight-B9ER_pU4.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-D9n-W_rO.js";import{a as G,c as B,d as H,b as Q}from"./dialog-CICi1bFC.js";import{R as Y}from"./required-auth-layout-BRdLiCQS.js";import{u as W}from"./use-tasks-B1IA46S1.js";import{b as V}from"./use-organization-settings-Crj_HvGT.js";import{u as J}from"./use-org-sso-V0U-retN.js";import{i as X}from"./Lock01-63SpB195.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-CPXgqgtn.js";import{a as G,c as B,d as H,b as Q}from"./dialog-sB-RNyMu.js";import{R as Y}from"./required-auth-layout-DxobDViQ.js";import{u as W}from"./use-tasks-CP9EEDgQ.js";import{b as V}from"./use-organization-settings-DZQEi_vL.js";import{u as J}from"./use-org-sso-XYdJdNGD.js";import{i as X}from"./Lock01-BDVFL4zm.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-D9n-W_rO.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-CPXgqgtn.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-D9n-W_rO.js";import{D as k}from"./domain-settings-CjSKJW17.js";import{P as x}from"./index-CMnREwkX.js";import{I as l}from"./input-Aj2AxbJX.js";import{S as z}from"./switch-D664sdCn.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-V0U-retN.js";import{d as F,S as y,a as C,b as a,c as O}from"./settings-section-DLmXqm7P.js";import{s as L}from"./Trash01-Dj5mVOWm.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./constants-BBSLGS7p.js";import"./tooltip-D3G-75TX.js";import"./X-yKx8T0mV.js";import"./card-CMatfPs6.js";import"./ArrowUpRight-Bxgj2IVp.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-CPXgqgtn.js";import{D as k}from"./domain-settings-CfN0XeQj.js";import{P as x}from"./index-9WMiiDWH.js";import{I as l}from"./input-BYLqJazY.js";import{S as z}from"./switch-B9P99cpo.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-XYdJdNGD.js";import{d as F,S as y,a as C,b as a,c as O}from"./settings-section-BSSTyi59.js";import{s as L}from"./Trash01-D676SGAl.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./constants-RvCh42kd.js";import"./tooltip-CCRvyunm.js";import"./X-DZI_qdyG.js";import"./card-DfBr11OH.js";import"./ArrowUpRight-B9ER_pU4.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};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-CZ27EJiP.js","assets/index-CPXgqgtn.js","assets/index-B_4-KoG_.css","assets/ArrowNarrowLeft-IKO0Pdme.js","assets/CheckCircle-C1PuOF6d.js","assets/Container-D_d73BfD.js","assets/Settings02-Bvv_nn0Y.js","assets/XCircle-BI7HQKdL.js","assets/constants-RvCh42kd.js","assets/useInfiniteQuery-m6hlUQnd.js","assets/infiniteQueryObserver-BeoG5sU6.js","assets/badge-CMhkMPpc.js","assets/input-BYLqJazY.js","assets/dropdown-menu-Ba10Ub1x.js","assets/Check-DVRpvrTF.js","assets/ChevronRight-BxsGpbIW.js","assets/DotsVertical-CFsox5cs.js","assets/table-BIJ38639.js","assets/toggle-group-DiN3ciV3.js","assets/use-view-mode-DBMTYwcB.js","assets/tooltip-CCRvyunm.js","assets/SearchMd-BH72zEYs.js","assets/dialog-sB-RNyMu.js","assets/X-DZI_qdyG.js","assets/AlertCircle-CcUtX5uM.js","assets/alert-dialog-DZnXWtkc.js","assets/card-DfBr11OH.js","assets/Trash01-D676SGAl.js","assets/label-wqfg1Psv.js","assets/select-DV6XTbu1.js","assets/ChevronDown-BgtmJwU7.js","assets/ChevronUp-DvM1tvKw.js","assets/switch-B9P99cpo.js","assets/textarea-Dk5HQM76.js","assets/RefreshCcw01-B_PJ5f1k.js","assets/checkbox-CsVxpSNu.js","assets/LinkExternal01-BFJlAOho.js","assets/use-copy-BHjujE3w.js","assets/Plus-BMxmddO-.js","assets/Play-CG03drxN.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-CPXgqgtn.js";const _=l.lazy(()=>u(()=>import("./registry-layout-CZ27EJiP.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,39])));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};