decocms 2.312.5 → 2.312.6

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 (178) hide show
  1. package/dist/client/assets/{AlertCircle-8gO1aXOV.js → AlertCircle--E7UrpAr.js} +1 -1
  2. package/dist/client/assets/{Archive-CpwaQ9i2.js → Archive-D0ENLr1k.js} +1 -1
  3. package/dist/client/assets/{ArrowNarrowLeft-Bj9BOs-z.js → ArrowNarrowLeft-CIQd7Thm.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CGIcPNOI.js → ArrowUpRight-Dj7chErN.js} +1 -1
  5. package/dist/client/assets/{Check-iLkh97pT.js → Check-C_Bp7Lkb.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BqxncqLD.js → CheckCircle-9G-pL5Yz.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-hAIeVVjO.js → ChevronDown-XYfullCn.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DvySy092.js → ChevronRight-BoP1zu-d.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-nRc3sEaT.js → ChevronUp-BOtuvBeQ.js} +1 -1
  10. package/dist/client/assets/{Container-kWAyJ_HH.js → Container-BnqqIRxQ.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-C-S6nCss.js → DotsVertical-C8L9nh0Y.js} +1 -1
  12. package/dist/client/assets/{LayoutLeft-JykQcN-j.js → LayoutLeft-CRh2Avtv.js} +1 -1
  13. package/dist/client/assets/{LinkExternal01-BxIXc_ra.js → LinkExternal01-CsvNVKSe.js} +1 -1
  14. package/dist/client/assets/{Lock01-mA7QgL2y.js → Lock01-BfkT1rLN.js} +1 -1
  15. package/dist/client/assets/{Palette-BcbDyirO.js → Palette-C_x81RzA.js} +1 -1
  16. package/dist/client/assets/{Play-B-SyQLb4.js → Play-BGKlvj8h.js} +1 -1
  17. package/dist/client/assets/{Plus-Da0UZLbd.js → Plus-CoyZs5M_.js} +1 -1
  18. package/dist/client/assets/{RefreshCcw01-DjbieO7J.js → RefreshCcw01-BTQrYDoS.js} +1 -1
  19. package/dist/client/assets/{SearchMd-CRZSLxL6.js → SearchMd-CqfIDBLz.js} +1 -1
  20. package/dist/client/assets/{Settings02-CRn2TAbB.js → Settings02-Bj1bohUt.js} +1 -1
  21. package/dist/client/assets/{Shield01-mkPGOpR6.js → Shield01-D9x40AM1.js} +1 -1
  22. package/dist/client/assets/{Star01-DKC04CRs.js → Star01-Dezh7tEC.js} +1 -1
  23. package/dist/client/assets/{Sun-BmooIo9H.js → Sun-CF_fZ8z_.js} +1 -1
  24. package/dist/client/assets/{Tool01-Cmmu87hJ.js → Tool01-yEmwHppq.js} +1 -1
  25. package/dist/client/assets/{Trash01-_0GJuf6O.js → Trash01-CfYXqAgk.js} +1 -1
  26. package/dist/client/assets/{User01-BeQhAfkv.js → User01-nyGmAcbb.js} +1 -1
  27. package/dist/client/assets/{Users03-BRhtwP3R.js → Users03-CC5zD4NC.js} +1 -1
  28. package/dist/client/assets/{X-BIBUzPXw.js → X-_H3PwZ-x.js} +1 -1
  29. package/dist/client/assets/{XCircle-B3Ec4xbl.js → XCircle-DlAAwHo3.js} +1 -1
  30. package/dist/client/assets/{XClose-_fuYraP_.js → XClose-DJ6uZIFi.js} +1 -1
  31. package/dist/client/assets/{Zap-C2Ojyfeu.js → Zap-DAhFCcSC.js} +1 -1
  32. package/dist/client/assets/{ZapSquare-Bp-Tac0d.js → ZapSquare-BQR205kq.js} +1 -1
  33. package/dist/client/assets/{accordion-rzQTbL0h.js → accordion-BUvTDbcS.js} +1 -1
  34. package/dist/client/assets/{agent-icon-C3ToZMO1.js → agent-icon-pqJUo1bp.js} +1 -1
  35. package/dist/client/assets/{agents-list-sQ_2-MIz.js → agents-list-RvvpkzOh.js} +1 -1
  36. package/dist/client/assets/{ai-providers-DRxrdzrJ.js → ai-providers-CXyEZeAJ.js} +1 -1
  37. package/dist/client/assets/{alert-dialog-rJ8tQXxB.js → alert-dialog-D1FQBcc3.js} +1 -1
  38. package/dist/client/assets/{auth-catchall-Cqm9tpGx.js → auth-catchall-ol1v2Hpr.js} +1 -1
  39. package/dist/client/assets/{automation-list-row-A_8c4BfR.js → automation-list-row-BTS2cEDn.js} +1 -1
  40. package/dist/client/assets/{automations-YzDLAcj1.js → automations-BsVY7Fq2.js} +1 -1
  41. package/dist/client/assets/{avatar-BzKxqu3b.js → avatar-C-x5h3du.js} +1 -1
  42. package/dist/client/assets/{badge-CtvUEMa3.js → badge-B5O2UAE8.js} +1 -1
  43. package/dist/client/assets/{brand-context-CFaaMt6s.js → brand-context-CYXLTPxr.js} +1 -1
  44. package/dist/client/assets/{card-DTHqwNV7.js → card-DDt5rBOW.js} +1 -1
  45. package/dist/client/assets/{chat-context-DxzvANdp.js → chat-context-B0CrrMvm.js} +1 -1
  46. package/dist/client/assets/{checkbox-Cs8wVTnP.js → checkbox-DdbawBjt.js} +1 -1
  47. package/dist/client/assets/{collection-detail-BVdBCgeZ.js → collection-detail-BQGTMUz_.js} +1 -1
  48. package/dist/client/assets/{collection-display-button-B-70Ju9K.js → collection-display-button-BME188lN.js} +1 -1
  49. package/dist/client/assets/{collection-search-BvyGXjxx.js → collection-search-ClTmOQtV.js} +1 -1
  50. package/dist/client/assets/{collection-search-CbmTjLje.js → collection-search-DnJUOSiV.js} +1 -1
  51. package/dist/client/assets/{collection-table-wrapper-DXq2NrGj.js → collection-table-wrapper-jsYib-z5.js} +1 -1
  52. package/dist/client/assets/{collection-tabs-Cx7Fw5pB.js → collection-tabs-Bv32FI82.js} +1 -1
  53. package/dist/client/assets/{collections-BrXh640u.js → collections-C2GekKfD.js} +1 -1
  54. package/dist/client/assets/{command-Gp6-PTcb.js → command-4tV0tWXg.js} +1 -1
  55. package/dist/client/assets/{connection-card-gdrfoq9h.js → connection-card-D9M-U0UE.js} +1 -1
  56. package/dist/client/assets/{connection-detail-sPm6-FQh.js → connection-detail-W-i4n_V0.js} +1 -1
  57. package/dist/client/assets/{connection-form-helpers-CMTw78q4.js → connection-form-helpers-PKzSpxAP.js} +1 -1
  58. package/dist/client/assets/{connections-ClXPJSid.js → connections-CFyWQjm7.js} +1 -1
  59. package/dist/client/assets/{constants-Byqq7P-x.js → constants-ChOKU-PU.js} +1 -1
  60. package/dist/client/assets/{constants-j7SVGFua.js → constants-K_0FCyet.js} +1 -1
  61. package/dist/client/assets/{dialog-CVU8C65F.js → dialog-DLvaCZhi.js} +1 -1
  62. package/dist/client/assets/{domain-settings-DKmwgR9_.js → domain-settings-lkafeUQo.js} +1 -1
  63. package/dist/client/assets/{drawer-BPoStQav.js → drawer-e4igmw2U.js} +1 -1
  64. package/dist/client/assets/{dropdown-menu-CFvw1sby.js → dropdown-menu-B8cH2K9_.js} +1 -1
  65. package/dist/client/assets/{dynamic-plugin-layout-DB9J-dmB.js → dynamic-plugin-layout-C5NDBdyq.js} +1 -1
  66. package/dist/client/assets/{empty-state-8-OQfGVL.js → empty-state-_hM6S73f.js} +1 -1
  67. package/dist/client/assets/{empty-state-DICfxaK6.js → empty-state-xC0Hjgxk.js} +1 -1
  68. package/dist/client/assets/{extract-connection-data-D9CVtxg9.js → extract-connection-data-Dn4BJH0J.js} +1 -1
  69. package/dist/client/assets/{features-CozjNW2D.js → features-DlZAVmim.js} +1 -1
  70. package/dist/client/assets/{form-D2ajrZY7.js → form-BeBxrBEq.js} +1 -1
  71. package/dist/client/assets/{general-BkPw_hwG.js → general-iTpBfhZ3.js} +1 -1
  72. package/dist/client/assets/{index-BbzWWop6.js → index-713BaADI.js} +1 -1
  73. package/dist/client/assets/{index-D7EGXs0z.js → index-B4qEuPcM.js} +1 -1
  74. package/dist/client/assets/{index-BwduZbfJ.js → index-BMva3-9T.js} +1 -1
  75. package/dist/client/assets/{index-DR62hZV9.js → index-BO0Inq7t.js} +1 -1
  76. package/dist/client/assets/{index-CB-9CUUW.js → index-BRY25LXZ.js} +2 -2
  77. package/dist/client/assets/{index-MHifxSvC.js → index-BSuvPrwU.js} +1 -1
  78. package/dist/client/assets/{index-Cd02a-JG.js → index-BjpkEK9E.js} +1 -1
  79. package/dist/client/assets/{index-Ca8lIGfE.js → index-CWtyRHnw.js} +1 -1
  80. package/dist/client/assets/{index-CPY1FvNi.js → index-Ck8rOeRC.js} +1 -1
  81. package/dist/client/assets/{index-BcJogvuh.js → index-CuUtTo4R.js} +1 -1
  82. package/dist/client/assets/{index-D7tifyXI.js → index-DDOld6Hj.js} +1 -1
  83. package/dist/client/assets/{index-8aV9WSX6.js → index-D_QVZZhC.js} +1 -1
  84. package/dist/client/assets/{index-dI45a3oJ.js → index-nrobA16R.js} +1 -1
  85. package/dist/client/assets/{index-Bb5AeDnq.js → index-o9XsekIm.js} +1 -1
  86. package/dist/client/assets/{index-C_u8z90u.js → index-sv_5_jW0.js} +1 -1
  87. package/dist/client/assets/{index-4U7gRnbz.js → index-x7mx8TiN.js} +3 -3
  88. package/dist/client/assets/{infiniteQueryObserver-B8WYxU9o.js → infiniteQueryObserver-C1nf2zRF.js} +1 -1
  89. package/dist/client/assets/{input-DNFaDN-t.js → input-g22460I-.js} +1 -1
  90. package/dist/client/assets/{integration-icon-Bt36uZm6.js → integration-icon-BkoK_Zpp.js} +1 -1
  91. package/dist/client/assets/{label-EPch60Re.js → label-CB2xWKDz.js} +1 -1
  92. package/dist/client/assets/{layout-C-ijRiyr.js → layout-O8BY7YMT.js} +1 -1
  93. package/dist/client/assets/{lean-canvas-recruit-modal-DfNm4E73.js → lean-canvas-recruit-modal-C5kJnWTY.js} +1 -1
  94. package/dist/client/assets/{login-Dp5n-o6e.js → login-BAjANqId.js} +1 -1
  95. package/dist/client/assets/{members-B4-cMOsS.js → members-DdZ1NeQN.js} +1 -1
  96. package/dist/client/assets/{monaco-editor-UJJyG6n2.js → monaco-editor-DlTcdq5f.js} +1 -1
  97. package/dist/client/assets/{monitoring-stats-row-Ba3ar8Om.js → monitoring-stats-row-BdyzlkVq.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-Dgudf75C.js → oauth-callback-WBrarn1K.js} +1 -1
  99. package/dist/client/assets/{oauth-callback-ai-provider-EanhHzQY.js → oauth-callback-ai-provider-RNILsOLP.js} +1 -1
  100. package/dist/client/assets/{onboarding-CN7qNa98.js → onboarding-DyswWi3n.js} +1 -1
  101. package/dist/client/assets/{org-layout-CdBnaGi6.js → org-layout-DUCy6vsu.js} +1 -1
  102. package/dist/client/assets/{org-plugin-layout-pmz_1-KP.js → org-plugin-layout-DHoq95_4.js} +1 -1
  103. package/dist/client/assets/{pair-C-m8tavv.js → pair-DHYTbtVI.js} +1 -1
  104. package/dist/client/assets/{plugin-empty-state-PqSYiLpp.js → plugin-empty-state-Cmk2xH9Y.js} +1 -1
  105. package/dist/client/assets/{plugin-header-apdmEPGc.js → plugin-header-9qVbYUa2.js} +1 -1
  106. package/dist/client/assets/{plugin-layout-DE-RB_rr.js → plugin-layout-CFpRp241.js} +1 -1
  107. package/dist/client/assets/{popover-DqPZrAPW.js → popover-BTKCLXDn.js} +1 -1
  108. package/dist/client/assets/{profile-CDG3HHBU.js → profile-Bv6bMhaY.js} +1 -1
  109. package/dist/client/assets/{project-app-view-eNqi9XCt.js → project-app-view-e8_e4R8S.js} +1 -1
  110. package/dist/client/assets/{registry-layout-CoJtCj-r.js → registry-layout-CbP8TcT_.js} +1 -1
  111. package/dist/client/assets/registry-qNWihn9t.js +2 -0
  112. package/dist/client/assets/{required-auth-layout-DNLyc-Jc.js → required-auth-layout-bGbsPRe1.js} +1 -1
  113. package/dist/client/assets/{reset-password-BILcwCX-.js → reset-password-ftD4VHiA.js} +1 -1
  114. package/dist/client/assets/{roles-EUFvZijn.js → roles-BPdqIQwH.js} +1 -1
  115. package/dist/client/assets/{scroll-area-C80z-i4l.js → scroll-area-Bd7rJlST.js} +1 -1
  116. package/dist/client/assets/{search-input-CITVGcCE.js → search-input-C7xe1zP3.js} +1 -1
  117. package/dist/client/assets/{select-D2rWlduK.js → select-CRjOFVsl.js} +1 -1
  118. package/dist/client/assets/{select-model-BTNonZmN.js → select-model-DaqlG4E9.js} +1 -1
  119. package/dist/client/assets/{settings-layout-Bg2zZUvB.js → settings-layout-fOFpl38H.js} +1 -1
  120. package/dist/client/assets/{settings-section-Dnz7xxTt.js → settings-section-DS7ApbzG.js} +1 -1
  121. package/dist/client/assets/{shell-layout-C4Qbz79U.js → shell-layout-DCTWNnYh.js} +1 -1
  122. package/dist/client/assets/{sidebar-BWu_ePOy.js → sidebar-G21X9kgh.js} +1 -1
  123. package/dist/client/assets/{skeleton-DJTy6ez2.js → skeleton-CLaDxckX.js} +1 -1
  124. package/dist/client/assets/{spinner-WgqEYOpc.js → spinner-aHtyyvs3.js} +1 -1
  125. package/dist/client/assets/{sso-ZW_bBsst.js → sso-DG6fo7Wz.js} +1 -1
  126. package/dist/client/assets/{store-2-hWApJp.js → store-Co--1mXW.js} +1 -1
  127. package/dist/client/assets/store-registry-CGxsV0jz.js +2 -0
  128. package/dist/client/assets/{switch-qhfo8Vps.js → switch-BCi_tNrV.js} +1 -1
  129. package/dist/client/assets/{table-DT9Lwdc9.js → table-DKQMevzB.js} +1 -1
  130. package/dist/client/assets/{tabs-DdVMeHSM.js → tabs-D5qvY9dA.js} +1 -1
  131. package/dist/client/assets/{task-status-CNZzETah.js → task-status-CLd6IVO0.js} +1 -1
  132. package/dist/client/assets/{textarea-tUo13Bze.js → textarea-DU6sgZef.js} +1 -1
  133. package/dist/client/assets/{toggle-group-CDk1azIm.js → toggle-group-BYdg659y.js} +1 -1
  134. package/dist/client/assets/{tools-list-B7BG48WQ.js → tools-list-CxlLpio7.js} +1 -1
  135. package/dist/client/assets/{tooltip-Fw0r1Fnv.js → tooltip-CaFNQbaH.js} +1 -1
  136. package/dist/client/assets/{types-SLEmji6U.js → types-BcO5bOr1.js} +1 -1
  137. package/dist/client/assets/{use-ai-providers-C-k1YUCw.js → use-ai-providers-CMl8n2RP.js} +1 -1
  138. package/dist/client/assets/{use-collections-B62mMH76.js → use-collections-B18X79ey.js} +1 -1
  139. package/dist/client/assets/{use-connection-CGnX1bAr.js → use-connection-D-Y5WZLa.js} +1 -1
  140. package/dist/client/assets/{use-copy-S7d6ccvS.js → use-copy-C1Kl6cer.js} +1 -1
  141. package/dist/client/assets/{use-create-virtual-mcp-D8mqROzD.js → use-create-virtual-mcp-C5acPMBL.js} +1 -1
  142. package/dist/client/assets/{use-debounced-autosave-DSiduY2E.js → use-debounced-autosave-DTP9ZFm1.js} +1 -1
  143. package/dist/client/assets/{use-decopilot-events-CD5HmYFC.js → use-decopilot-events-DCwOC8tQ.js} +1 -1
  144. package/dist/client/assets/{use-delete-connection-DVHNgb48.js → use-delete-connection-CuUEXsMJ.js} +1 -1
  145. package/dist/client/assets/{use-infinite-scroll-SPOySZcn.js → use-infinite-scroll-BrvZ5kNc.js} +1 -1
  146. package/dist/client/assets/{use-list-state-CB5cSSEY.js → use-list-state-CYrR4koF.js} +1 -1
  147. package/dist/client/assets/{use-mcp-tools-DbRVIPCe.js → use-mcp-tools-p5eNuRu_.js} +1 -1
  148. package/dist/client/assets/{use-members-Cjc37mTg.js → use-members-asX6PNtQ.js} +1 -1
  149. package/dist/client/assets/{use-navigate-to-agent-BFHXdont.js → use-navigate-to-agent-re2UjJnQ.js} +1 -1
  150. package/dist/client/assets/{use-org-auth-client-CH982N7h.js → use-org-auth-client-Y6P_21Nx.js} +1 -1
  151. package/dist/client/assets/{use-org-sso-DyRmCzkM.js → use-org-sso-j8HePnUG.js} +1 -1
  152. package/dist/client/assets/{use-organization-roles-2UTk-DFF.js → use-organization-roles-D7hbxwdc.js} +1 -1
  153. package/dist/client/assets/{use-organization-settings-gXH8ly7B.js → use-organization-settings-8Xiyp7J6.js} +1 -1
  154. package/dist/client/assets/{use-registry-connections-DAbFKgpw.js → use-registry-connections-IbCOWAWk.js} +1 -1
  155. package/dist/client/assets/{use-status-sounds-VTPYJ4_T.js → use-status-sounds-B8tKxqE4.js} +1 -1
  156. package/dist/client/assets/{use-tasks-Buj64kOD.js → use-tasks-jUiBKFWl.js} +1 -1
  157. package/dist/client/assets/{use-view-mode-C9lWb9qo.js → use-view-mode-CJVMuzSM.js} +1 -1
  158. package/dist/client/assets/{use-virtual-mcp-CnvhxxMa.js → use-virtual-mcp-DLuIO4Fw.js} +1 -1
  159. package/dist/client/assets/useInfiniteQuery-ycBQMtqS.js +1 -0
  160. package/dist/client/assets/useSuspenseInfiniteQuery-DkCw-LQn.js +1 -0
  161. package/dist/client/assets/{user-Chu-GPC8.js → user-a1mAL36G.js} +1 -1
  162. package/dist/client/assets/{view-mode-toggle-Cj1WIwcj.js → view-mode-toggle-D2MfIulL.js} +1 -1
  163. package/dist/client/assets/{workflow-BBU02wN2.js → workflow-73m9n75X.js} +1 -1
  164. package/dist/client/assets/workflow-detail-80bLLyu0.js +1 -0
  165. package/dist/client/index.html +1 -1
  166. package/dist/server/cli.js +3 -3
  167. package/dist/server/server.js +2 -2
  168. package/package.json +1 -1
  169. package/dist/client/assets/registry-CBqcs7XA.js +0 -2
  170. package/dist/client/assets/store-registry-01dPTj0W.js +0 -2
  171. package/dist/client/assets/useInfiniteQuery-BECdJto-.js +0 -1
  172. package/dist/client/assets/useSuspenseInfiniteQuery-DLoMCiwp.js +0 -1
  173. package/dist/client/assets/workflow-detail-CoYIUlop.js +0 -1
  174. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  175. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  176. package/dist/server/node_modules/mimic-fn/license +0 -9
  177. package/dist/server/node_modules/mimic-fn/package.json +0 -42
  178. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
@@ -1 +1 @@
1
- import{r as i,aR as nt,aS as Pe,j as d,c3 as rt,aT as be,b5 as k,c4 as st,a7 as j,a8 as N,cD as $,c5 as lt,ao as _e,c6 as Ee,b8 as at,b6 as ct,a4 as it,c7 as dt,ca as ut,c8 as pt,cb as ft,cc as mt,ae as ht,c9 as vt,cd as gt,ce as xt,e as ee,c as oe}from"./index-CB-9CUUW.js";import{V as St}from"./tooltip-Fw0r1Fnv.js";import{i as wt}from"./Check-iLkh97pT.js";import{t as Re}from"./ChevronDown-hAIeVVjO.js";import{n as Ct}from"./ChevronUp-nRc3sEaT.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),[F,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,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:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,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:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===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,F]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>F(f)),[O,U]=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)&&(U(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(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.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-U.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[F,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:F},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",Fe=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),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),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=Ue;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",Ft=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});Ft.displayName=Ie;var Ut="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=Ut;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=Fe,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,aR as nt,aS as Pe,j as d,c3 as rt,aT as be,b5 as k,c4 as st,a7 as j,a8 as N,cD as $,c5 as lt,ao as _e,c6 as Ee,b8 as at,b6 as ct,a4 as it,c7 as dt,ca as ut,c8 as pt,cb as ft,cc as mt,ae as ht,c9 as vt,cd as gt,ce as xt,e as ee,c as oe}from"./index-BRY25LXZ.js";import{V as St}from"./tooltip-CaFNQbaH.js";import{i as wt}from"./Check-C_Bp7Lkb.js";import{t as Re}from"./ChevronDown-XYfullCn.js";import{n as Ct}from"./ChevronUp-BOtuvBeQ.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),[F,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,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:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,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:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===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,F]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>F(f)),[O,U]=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)&&(U(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(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.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-U.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[F,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:F},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",Fe=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),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),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=Ue;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",Ft=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});Ft.displayName=Ie;var Ut="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=Ut;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=Fe,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 R,ao as Ze,e as U,j as s,H as Oe,J as oe,s as re,o as xe,D as Ae,z as Te,a as ae,K as te,x as Q,B as J,t as X,u as et,c as me,n as tt,f as st,E as it,y as nt}from"./index-CB-9CUUW.js";import{C as lt}from"./checkbox-Cs8wVTnP.js";import{I as le}from"./input-DNFaDN-t.js";import{D as ze,b as Le,a as Re,c as rt,d as Pe,e as ot,h as at}from"./dialog-CVU8C65F.js";import{g as ct,D as dt,a as mt,b as ut}from"./drawer-BPoStQav.js";import{u as ht}from"./tooltip-Fw0r1Fnv.js";import{S as ft,a as pt,b as xt,c as gt,d as vt}from"./select-D2rWlduK.js";import{S as W}from"./skeleton-DJTy6ez2.js";import{c as bt,t as yt,b as jt,a as St,d as Nt}from"./Tool01-Cmmu87hJ.js";import{b as Fe,s as $e,i as Ke,c as kt,a as wt}from"./RefreshCcw01-DjbieO7J.js";import{t as ye}from"./ChevronDown-hAIeVVjO.js";import{i as De,a as _t}from"./SearchMd-CRZSLxL6.js";import{a as It}from"./Settings02-CRn2TAbB.js";import{b as Ue,u as Ct,a as Et}from"./use-ai-providers-C-k1YUCw.js";import{b as Be}from"./chat-context-DxzvANdp.js";import{g as ge}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Zap-C2Ojyfeu.js";import{i as Ot}from"./AlertCircle-8gO1aXOV.js";import{S as je}from"./spinner-WgqEYOpc.js";import{S as ue,u as he}from"./constants-Byqq7P-x.js";import{A as At}from"./avatar-BzKxqu3b.js";import{S as fe,a as pe,b as Tt}from"./settings-section-Dnz7xxTt.js";import{u as zt}from"./unwrap-tool-result-BYXdCQMg.js";function ie(i,e,t){let n=t.initialDeps??[],l,r=!0;function a(){var o,c,m;let u;t.key&&((o=t.debug)!=null&&o.call(t))&&(u=Date.now());const x=i();if(!(x.length!==n.length||x.some((g,v)=>n[v]!==g)))return l;n=x;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),l=e(...x),t.key&&((m=t.debug)!=null&&m.call(t))){const g=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-f)*100)/100,_=v/16,N=(k,C)=>{for(k=String(k);k.length<C;)k=" "+k;return k};console.info(`%c⏱ ${N(v,5)} /${N(g,5)} ms`,`
1
+ import{r as R,ao as Ze,e as U,j as s,H as Oe,J as oe,s as re,o as xe,D as Ae,z as Te,a as ae,K as te,x as Q,B as J,t as X,u as et,c as me,n as tt,f as st,E as it,y as nt}from"./index-BRY25LXZ.js";import{C as lt}from"./checkbox-DdbawBjt.js";import{I as le}from"./input-g22460I-.js";import{D as ze,b as Le,a as Re,c as rt,d as Pe,e as ot,h as at}from"./dialog-DLvaCZhi.js";import{g as ct,D as dt,a as mt,b as ut}from"./drawer-e4igmw2U.js";import{u as ht}from"./tooltip-CaFNQbaH.js";import{S as ft,a as pt,b as xt,c as gt,d as vt}from"./select-CRjOFVsl.js";import{S as W}from"./skeleton-CLaDxckX.js";import{c as bt,t as yt,b as jt,a as St,d as Nt}from"./Tool01-yEmwHppq.js";import{b as Fe,s as $e,i as Ke,c as kt,a as wt}from"./RefreshCcw01-BTQrYDoS.js";import{t as ye}from"./ChevronDown-XYfullCn.js";import{i as De,a as _t}from"./SearchMd-CqfIDBLz.js";import{a as It}from"./Settings02-Bj1bohUt.js";import{b as Ue,u as Ct,a as Et}from"./use-ai-providers-CMl8n2RP.js";import{b as Be}from"./chat-context-B0CrrMvm.js";import{g as ge}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Zap-DAhFCcSC.js";import{i as Ot}from"./AlertCircle--E7UrpAr.js";import{S as je}from"./spinner-aHtyyvs3.js";import{S as ue,u as he}from"./constants-ChOKU-PU.js";import{A as At}from"./avatar-C-x5h3du.js";import{S as fe,a as pe,b as Tt}from"./settings-section-DS7ApbzG.js";import{u as zt}from"./unwrap-tool-result-BYXdCQMg.js";function ie(i,e,t){let n=t.initialDeps??[],l,r=!0;function a(){var o,c,m;let u;t.key&&((o=t.debug)!=null&&o.call(t))&&(u=Date.now());const x=i();if(!(x.length!==n.length||x.some((g,v)=>n[v]!==g)))return l;n=x;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),l=e(...x),t.key&&((m=t.debug)!=null&&m.call(t))){const g=Math.round((Date.now()-u)*100)/100,v=Math.round((Date.now()-f)*100)/100,_=v/16,N=(k,C)=>{for(k=String(k);k.length<C;)k=" "+k;return k};console.info(`%c⏱ ${N(v,5)} /${N(g,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*_,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(r&&t.skipInitialOnChange)&&t.onChange(l),r=!1,l}return a.updateDeps=o=>{n=o},a}function Se(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Lt=(i,e)=>Math.abs(i-e)<1.01,Rt=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},Ne=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Pt=i=>i,Ft=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},$t=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=a=>{const{width:o,height:c}=a;e({width:Math.round(o),height:Math.round(c)})};if(l(Ne(t)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver(a=>{const o=()=>{const c=a[0];if(c?.borderBoxSize){const m=c.borderBoxSize[0];if(m){l({width:m.inlineSize,height:m.blockSize});return}}l(Ne(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return r.observe(t,{box:"border-box"}),()=>{r.unobserve(t)}},ke={passive:!0},we=typeof window>"u"?!0:"onscrollend"in window,Kt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const r=i.options.useScrollendEvent&&we?()=>{}:Rt(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),a=u=>()=>{const{horizontal:x,isRtl:p}=i.options;l=x?t.scrollLeft*(p&&-1||1):t.scrollTop,r(),e(l,u)},o=a(!0),c=a(!1);t.addEventListener("scroll",o,ke);const m=i.options.useScrollendEvent&&we;return m&&t.addEventListener("scrollend",c,ke),()=>{t.removeEventListener("scroll",o),m&&t.removeEventListener("scrollend",c)}},Dt=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Ut=(i,{adjustments:e=0,behavior:t},n)=>{var l,r;const a=i+e;(r=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||r.call(l,{[n.options.horizontal?"left":"top"]:a,behavior:t})};class Bt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(r=>{const a=()=>{const o=r.target,c=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(o,r,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var r;return(r=n())==null?void 0:r.observe(l,{box:"border-box"})},unobserve:l=>{var r;return(r=n())==null?void 0:r.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Pt,rangeExtractor:Ft,onChange:()=>{},measureElement:Dt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=r,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,r=new Map;for(let a=n-1;a>=0;a--){const o=t[a];if(l.has(o.lane))continue;const c=r.get(o.lane);if(c==null||o.end>c.end?r.set(o.lane,o):o.end<c.end&&l.set(o.lane,!0),l.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,r,a,o,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:r,enabled:a,lanes:o,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:r,enabled:a,lanes:o,laneAssignmentMode:c},m)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);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(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const x=this.measurementsCache.slice(0,u),p=new Array(o).fill(void 0);for(let f=0;f<u;f++){const g=x[f];g&&(p[g.lane]=f)}for(let f=u;f<t;f++){const g=r(f),v=this.laneAssignments.get(f);let _,N;const k=c==="estimate"||m.has(g);if(v!==void 0&&this.options.lanes>1){_=v;const d=p[_],h=d!==void 0?x[d]:void 0;N=h?h.end+this.options.gap:n+l}else{const d=this.options.lanes===1?x[f-1]:this.getFurthestMeasurement(x,f);N=d?d.end+this.options.gap:n+l,_=d?d.lane:f%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(f,_)}const C=m.get(g),w=typeof C=="number"?C:this.options.estimateSize(f),E=N+w;x[f]={index:f,start:N,size:w,end:E,key:g,lane:_},p[_]=f}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,r)=>this.range=t.length>0&&n>0?Wt({measurements:t,outerSize:n,scrollOffset:l,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,r,a)=>r===null||a===null?[]:t({startIndex:r,endIndex:a,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,l-r),o=Math.min(this.options.count-1,l+r);return t>=a&&t<=o}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),r=this.elementsCache.get(l);r!==t&&(r&&this.observer.unobserve(r),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const r=this.measurementsCache[t];if(!r)return;const a=this.itemSizeCache.get(r.key)??r.size,o=n-a;o!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let r=0,a=t.length;r<a;r++){const o=t[r],c=n[o];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return Se(n[We(0,n.length-1,l=>Se(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),a=this.getScrollOffset();n==="auto"&&(n=t>=a+r?"end":"start"),n==="center"?t+=(l-r)/2:n==="end"&&(t-=r);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),r=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(n==="auto")if(a.end>=r+l-this.options.scrollPaddingEnd)n="end";else if(a.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const o=n==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,n,a.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const r=this.getOffsetForAlignment(t,n),a=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:a,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.getOffsetForIndex(t,n);if(!r)return;const[a,o]=r,c=this.now();this.scrollState={index:t,align:o,behavior:l,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,r=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:r,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const r=Array(this.options.lanes).fill(null);let a=n.length-1;for(;a>=0&&r.some(o=>o===null);){const o=n[a];r[o.lane]===null&&(r[o.lane]=o.end),a--}l=Math.max(...r.filter(o=>o!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,r=1,a=l!==this.scrollState.lastTargetOffset;if(!a&&Lt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=r){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const We=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,r=t(l);if(r<n)i=l+1;else if(r>n)e=l-1;else return l}return i>0?i-1:0};function Wt({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,r=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let a=We(0,l,r,t),o=a;if(n===1)for(;o<l&&i[o].end<t+e;)o++;else if(n>1){const c=Array(n).fill(0);for(;o<l&&c.some(u=>u<t+e);){const u=i[o];c[u.lane]=u.end,o++}const m=Array(n).fill(t+e);for(;a>=0&&m.some(u=>u>=t);){const u=i[a];m[u.lane]=u.start,a--}a=Math.max(0,a-a%n),o=Math.min(l,o+(n-1-o%n))}return{startIndex:a,endIndex:o}}const _e=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Vt({useFlushSync:i=!0,...e}){const t=R.useReducer(()=>({}),{})[1],n={...e,onChange:(r,a)=>{var o;i&&a?Ze.flushSync(t):t(),(o=e.onChange)==null||o.call(e,r,a)}},[l]=R.useState(()=>new Bt(n));return l.setOptions(n),_e(()=>l._didMount(),[]),_e(()=>l._willUpdate()),l}function Ht(i){return Vt({observeElementRect:$t,observeElementOffset:Kt,scrollToFn:Ut,...i})}const ce=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Ie(i){if(i)return ce.find(e=>e.id===i)}function ne(i){const e=U.c(8),{logo:t,name:n,description:l,onClick:r}=i;let a;e[0]!==t||e[1]!==n?(a=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(At,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o;return e[3]!==l||e[4]!==n||e[5]!==r||e[6]!==a?(o=s.jsx(Tt,{onClick:r,icon:a,title:n,description:l}),e[3]=l,e[4]=n,e[5]=r,e[6]=a,e[7]=o):o=e[7],o}function qt(i){const e=U.c(36),{providers:t,onSelect:n}=i;let l;e[0]!==t?(l=t.find(Zt),e[0]=t,e[1]=l):l=e[1];const r=l;let a,o,c,m,u,x;if(e[2]!==r||e[3]!==n||e[4]!==t){const v=t.filter(Jt);let _;e[11]===Symbol.for("react.memo_cache_sentinel")?(_={openrouter:0,anthropic:1,google:2},e[11]=_):_=e[11];const N=_;let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k=(j,M)=>{const I=N[j.id]??Number.MAX_SAFE_INTEGER,O=N[M.id]??Number.MAX_SAFE_INTEGER;return I-O},e[12]=k):k=e[12];const C=t.filter(Qt).sort(k);let w;e[13]!==t?(w=t.find(Xt),e[13]=t,e[14]=w):w=e[14];const E=w;let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=ce.find(Yt),e[15]=d):d=e[15];const h=d;m="flex flex-col gap-6",e[16]!==r||e[17]!==n?(u=r&&s.jsx(fe,{children:s.jsxs("div",{className:"relative rounded-xl border border-primary/30 bg-gradient-to-br from-primary/10 via-transparent to-primary/5 dark:from-primary/15 dark:to-primary/5 p-4",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-primary/5 to-transparent pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-primary mb-3 relative",children:"Recommended — start in seconds, pay as you go"}),s.jsx(pe,{className:"relative",children:s.jsx(ne,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[16]=r,e[17]=n,e[18]=u):u=e[18],x=v.length>0&&s.jsx(fe,{children:s.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:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-lime-400/5 to-yellow-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-lime-700 dark:text-lime-400 mb-3 relative",children:"Bring your Claude or ChatGPT subscription"}),s.jsx(pe,{className:"relative",children:v.map(j=>s.jsx(ne,{logo:j.logo,name:j.name,description:j.description,onClick:()=>n({kind:"provider",provider:j})},j.id))})]})}),o=fe,a=pe;let b;e[19]!==n?(b=j=>s.jsx(ne,{logo:j.logo,name:j.name,description:j.description,onClick:()=>n({kind:"provider",provider:j})},j.id),e[19]=n,e[20]=b):b=e[20];let S,y;e[21]!==n||e[22]!==E?(S=E&&h?[s.jsx(ne,{logo:h.logo,name:h.name,description:h.description,onClick:()=>n({kind:"openai-compatible",provider:E,preset:h})},h.id)]:[],y=E?[...ce.filter(Gt).map(j=>s.jsx(ne,{logo:j.logo,name:j.name,description:j.description,onClick:()=>n({kind:"openai-compatible",provider:E,preset:j})},j.id)),s.jsx(ne,{logo:E.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:E,preset:null})},"custom")]:[],e[21]=n,e[22]=E,e[23]=S,e[24]=y):(S=e[23],y=e[24]),c=[...C.map(b),...S,...y],e[2]=r,e[3]=n,e[4]=t,e[5]=a,e[6]=o,e[7]=c,e[8]=m,e[9]=u,e[10]=x}else a=e[5],o=e[6],c=e[7],m=e[8],u=e[9],x=e[10];let p;e[25]!==a||e[26]!==c?(p=s.jsx(a,{children:c}),e[25]=a,e[26]=c,e[27]=p):p=e[27];let f;e[28]!==o||e[29]!==p?(f=s.jsx(o,{children:p}),e[28]=o,e[29]=p,e[30]=f):f=e[30];let g;return e[31]!==m||e[32]!==u||e[33]!==x||e[34]!==f?(g=s.jsxs("div",{className:m,children:[u,x,f]}),e[31]=m,e[32]=u,e[33]=x,e[34]=f,e[35]=g):g=e[35],g}function Gt(i){return i.id!=="openai"}function Yt(i){return i.id==="openai"}function Xt(i){return i.id==="openai-compatible"}function Qt(i){return i.id!=="deco"&&!i.supportedMethods.includes("cli-activate")&&i.id!=="openai-compatible"}function Jt(i){return i.id!=="deco"&&i.supportedMethods.includes("cli-activate")}function Zt(i){return i.id==="deco"}const es=Oe({label:oe().optional(),apiKey:oe().min(1,"API key is required")});function ts(i){const e=U.c(62),{providerId:t,onCancel:n,onSuccess:l}=i,{org:r}=re();let a;e[0]!==r.id||e[1]!==r.slug?(a={connectionId:ue,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=a):a=e[2];const o=he(a),c=xe(),[m,u]=R.useState(!1);let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x={resolver:Ae(es),defaultValues:{label:"",apiKey:""}},e[3]=x):x=e[3];const{register:p,handleSubmit:f,formState:g}=Te(x),{errors:v}=g;let _;e[4]!==o||e[5]!==t?(_=async B=>{await o.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:t,label:B.label||"Personal key",apiKey:B.apiKey}})},e[4]=o,e[5]=t,e[6]=_):_=e[6];let N;e[7]!==l||e[8]!==r.id||e[9]!==c?(N=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(r.id)}),c.invalidateQueries({queryKey:te.aiProviders(r.id)}),Q.success("Key saved successfully"),l()},e[7]=l,e[8]=r.id,e[9]=c,e[10]=N):N=e[10];let k;e[11]!==_||e[12]!==N?(k={mutationFn:_,onSuccess:N,onError:ss},e[11]=_,e[12]=N,e[13]=k):k=e[13];const{mutate:C,isPending:w,error:E}=ae(k);let d;e[14]!==C?(d=B=>C(B),e[14]=C,e[15]=d):d=e[15];let h;e[16]!==f||e[17]!==d?(h=f(d),e[16]=f,e[17]=d,e[18]=h):h=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=b):b=e[19];let S;e[20]!==p?(S=p("label"),e[20]=p,e[21]=S):S=e[21];let y;e[22]!==S?(y=s.jsxs("div",{className:"space-y-1",children:[b,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[22]=S,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=j):j=e[24];const M=m?"text":"password";let I;e[25]!==p?(I=p("apiKey"),e[25]=p,e[26]=I):I=e[26];let O;e[27]!==M||e[28]!==I?(O=s.jsx(le,{type:M,placeholder:"sk-...",...I,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=M,e[28]=I,e[29]=O):O=e[29];let T;e[30]!==m?(T=()=>u(!m),e[30]=m,e[31]=T):T=e[31];let z;e[32]!==m?(z=m?s.jsx(Fe,{size:14}):s.jsx($e,{size:14}),e[32]=m,e[33]=z):z=e[33];let L;e[34]!==T||e[35]!==z?(L=s.jsx("button",{type:"button",onClick:T,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[34]=T,e[35]=z,e[36]=L):L=e[36];let H;e[37]!==O||e[38]!==L?(H=s.jsxs("div",{className:"relative",children:[O,L]}),e[37]=O,e[38]=L,e[39]=H):H=e[39];let P;e[40]!==v.apiKey?(P=v.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:v.apiKey.message}),e[40]=v.apiKey,e[41]=P):P=e[41];let F;e[42]!==H||e[43]!==P?(F=s.jsxs("div",{className:"space-y-1",children:[j,H,P]}),e[42]=H,e[43]=P,e[44]=F):F=e[44];let $;e[45]!==E?($=E&&s.jsx("p",{className:"text-xs text-destructive",children:E.message}),e[45]=E,e[46]=$):$=e[46];let K;e[47]!==w||e[48]!==n?(K=s.jsx(J,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:w,children:"Cancel"}),e[47]=w,e[48]=n,e[49]=K):K=e[49];const q=w?"Saving...":"Save Key";let D;e[50]!==w||e[51]!==q?(D=s.jsx(J,{type:"submit",size:"sm",disabled:w,children:q}),e[50]=w,e[51]=q,e[52]=D):D=e[52];let V;e[53]!==K||e[54]!==D?(V=s.jsxs(ze,{children:[K,D]}),e[53]=K,e[54]=D,e[55]=V):V=e[55];let A;return e[56]!==y||e[57]!==F||e[58]!==$||e[59]!==V||e[60]!==h?(A=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[y,F,$,V]}),e[56]=y,e[57]=F,e[58]=$,e[59]=V,e[60]=h,e[61]=A):A=e[61],A}function ss(i){Q.error(`Failed to save key: ${i.message}`)}const is=Oe({label:oe().optional(),baseUrl:oe().min(1,"Base URL is required"),apiKey:oe().optional()});function ns(i){const e=U.c(73),{preset:t,onCancel:n,onSuccess:l}=i,{org:r}=re();let a;e[0]!==r.id||e[1]!==r.slug?(a={connectionId:ue,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=a):a=e[2];const o=he(a),c=xe(),[m,u]=R.useState(!1);let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=Ae(is),e[3]=x):x=e[3];const p=t?.defaultBaseUrl??"";let f;e[4]!==p?(f={resolver:x,defaultValues:{label:"",baseUrl:p,apiKey:""}},e[4]=p,e[5]=f):f=e[5];const{register:g,handleSubmit:v,formState:_}=Te(f),{errors:N}=_;let k;e[6]!==o||e[7]!==t?(k=async se=>{const Je=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await o.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Je,...t?{presetId:t.id}:{}}})},e[6]=o,e[7]=t,e[8]=k):k=e[8];let C;e[9]!==l||e[10]!==r.id||e[11]!==c?(C=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(r.id)}),c.invalidateQueries({queryKey:te.aiProviders(r.id)}),Q.success("Connection saved successfully"),l()},e[9]=l,e[10]=r.id,e[11]=c,e[12]=C):C=e[12];let w;e[13]!==k||e[14]!==C?(w={mutationFn:k,onSuccess:C,onError:ls},e[13]=k,e[14]=C,e[15]=w):w=e[15];const{mutate:E,isPending:d,error:h}=ae(w),b=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let y;e[16]!==E?(y=se=>E(se),e[16]=E,e[17]=y):y=e[17];let j;e[18]!==v||e[19]!==y?(j=v(y),e[18]=v,e[19]=y,e[20]=j):j=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[21]=M):M=e[21];let I;e[22]!==g?(I=g("label"),e[22]=g,e[23]=I):I=e[23];let O;e[24]!==b||e[25]!==I?(O=s.jsxs("div",{className:"space-y-1",children:[M,s.jsx(le,{placeholder:b,...I,className:"h-8 text-sm"})]}),e[24]=b,e[25]=I,e[26]=O):O=e[26];let T;e[27]!==S||e[28]!==N||e[29]!==t?.defaultBaseUrl||e[30]!==g?(T=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...g("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...g("baseUrl"),className:"h-8 text-sm"}),N.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:N.baseUrl.message})]}),e[27]=S,e[28]=N,e[29]=t?.defaultBaseUrl,e[30]=g,e[31]=T):T=e[31];const z=t?.apiKeyRecommended?"recommended":"optional";let L;e[32]!==z?(L=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[32]=z,e[33]=L):L=e[33];const H=m?"text":"password";let P;e[34]!==g?(P=g("apiKey"),e[34]=g,e[35]=P):P=e[35];let F;e[36]!==H||e[37]!==P?(F=s.jsx(le,{type:H,placeholder:"sk-...",...P,className:"ph-no-capture h-8 text-sm pr-8"}),e[36]=H,e[37]=P,e[38]=F):F=e[38];let $;e[39]!==m?($=()=>u(!m),e[39]=m,e[40]=$):$=e[40];let K;e[41]!==m?(K=m?s.jsx(Fe,{size:14}):s.jsx($e,{size:14}),e[41]=m,e[42]=K):K=e[42];let q;e[43]!==$||e[44]!==K?(q=s.jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:K}),e[43]=$,e[44]=K,e[45]=q):q=e[45];let D;e[46]!==F||e[47]!==q?(D=s.jsxs("div",{className:"relative",children:[F,q]}),e[46]=F,e[47]=q,e[48]=D):D=e[48];let V;e[49]!==L||e[50]!==D?(V=s.jsxs("div",{className:"space-y-1",children:[L,D]}),e[49]=L,e[50]=D,e[51]=V):V=e[51];let A;e[52]!==t?(A=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[52]=t,e[53]=A):A=e[53];let B;e[54]!==h?(B=h&&s.jsx("p",{className:"text-xs text-destructive",children:h.message}),e[54]=h,e[55]=B):B=e[55];let G;e[56]!==d||e[57]!==n?(G=s.jsx(J,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:d,children:"Cancel"}),e[56]=d,e[57]=n,e[58]=G):G=e[58];const Z=d?"Saving...":"Save Connection";let Y;e[59]!==d||e[60]!==Z?(Y=s.jsx(J,{type:"submit",size:"sm",disabled:d,children:Z}),e[59]=d,e[60]=Z,e[61]=Y):Y=e[61];let ee;e[62]!==G||e[63]!==Y?(ee=s.jsxs(ze,{children:[G,Y]}),e[62]=G,e[63]=Y,e[64]=ee):ee=e[64];let de;return e[65]!==j||e[66]!==O||e[67]!==T||e[68]!==V||e[69]!==A||e[70]!==B||e[71]!==ee?(de=s.jsxs("form",{onSubmit:j,className:"space-y-3",children:[O,T,V,A,B,ee]}),e[65]=j,e[66]=O,e[67]=T,e[68]=V,e[69]=A,e[70]=B,e[71]=ee,e[72]=de):de=e[72],de}function ls(i){Q.error(`Failed to save connection: ${i.message}`)}const rs={kind:"closed"};function os(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"cli-pending":case"cli-error":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"select-cli":return i.kind!=="grid"?i:{kind:"cli-pending",providerId:e.providerId};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"cli-error":return i.kind!=="cli-pending"?i:{kind:"cli-error",providerId:i.providerId,error:e.error};case"retry-cli":return i.kind!=="cli-error"?i:{kind:"cli-pending",providerId:i.providerId};case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function as(i){switch(i.kind){case"form":case"oauth-pending":case"cli-pending":case"cli-error":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function cs({open:i,onOpenChange:e}){const n=Ue()?.providers??[],{org:l}=re(),r=he({connectionId:ue,orgId:l.id,orgSlug:l.slug}),a=xe(),[o,c]=R.useReducer(os,rs);R.useEffect(()=>{i&&o.kind==="closed"?c({type:"open"}):!i&&o.kind!=="closed"&&c({type:"close"})},[i,o.kind]);const m=()=>{c({type:"close"}),e(!1)},u=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(l.id)}),a.invalidateQueries({queryKey:te.aiProviders(l.id)})},{mutate:x}=ae({mutationFn:async({providerId:d,code:h,stateToken:b,label:S})=>{const y=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:d,code:h,stateToken:b,label:S}});if(y?.isError)throw new Error(y.content?.[0]?.text??"OAuth exchange failed");return d},onSuccess:d=>{X("ai_provider_oauth_succeeded",{provider_id:d}),u();const h=n.find(b=>b.id===d);Q.success(`${h?.name??"Provider"} connected successfully`),m()},onError:(d,h)=>{X("ai_provider_oauth_failed",{provider_id:h.providerId,error:d.message}),Q.error(`OAuth connection failed: ${d.message}`),c({type:"oauth-failed"})}}),{mutate:p}=ae({mutationFn:async d=>{const h=await r.callTool({name:"AI_PROVIDER_CLI_ACTIVATE",arguments:{providerId:d}});if(h?.isError)throw new Error(h.content?.[0]?.text??"CLI activation failed");return{providerId:d,...h.structuredContent}},onSuccess:d=>{if(!d?.activated){X("ai_provider_cli_activate_failed",{provider_id:d.providerId,error:d?.error??"unknown"}),c({type:"cli-error",error:d?.error??"CLI activation failed"});return}X("ai_provider_cli_activated",{provider_id:d.providerId}),u();const h=n.find(b=>b.id===d.providerId);Q.success(`${h?.name??"Provider"} activated`),m()},onError:(d,h)=>{X("ai_provider_cli_activate_failed",{provider_id:h,error:d.message}),c({type:"cli-error",error:d.message})}}),{mutate:f}=ae({mutationFn:async d=>{const h=await r.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:d}});if(h?.isError)throw new Error(h.content?.[0]?.text??"Key provisioning failed");return d},onSuccess:d=>{X("ai_provider_provision_succeeded",{provider_id:d}),u();const h=n.find(b=>b.id===d);Q.success(`${h?.name??"Provider"} connected successfully`),m()},onError:(d,h)=>{X("ai_provider_provision_failed",{provider_id:h,error:d.message}),c({type:"provision-error",error:d.message})}}),g=async d=>{const{provider:h}=d,b=d.kind==="openai-compatible"?d.preset?.id??null:null,S=h.supportedMethods.includes("oauth-pkce"),y=h.supportedMethods.includes("cli-activate"),j=h.supportedMethods.includes("api-key");if(h.supportsProvision===!0){X("ai_provider_connect_clicked",{provider_id:h.id,method:"provision"}),c({type:"select-provision",providerId:h.id}),f(h.id);return}if(y){X("ai_provider_connect_clicked",{provider_id:h.id,method:"cli-activate"}),c({type:"select-cli",providerId:h.id}),p(h.id);return}if(S){X("ai_provider_connect_clicked",{provider_id:h.id,method:"oauth-pkce"});try{const I=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:h.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(!I.structuredContent)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");c({type:"select-oauth",providerId:h.id,stateToken:I.structuredContent.stateToken}),window.open(I.structuredContent.url,"AiProviderOAuth","width=600,height=700")}catch(I){Q.error(`Failed to start OAuth: ${I instanceof Error?I.message:String(I)}`)}return}j&&(X("ai_provider_connect_clicked",{provider_id:h.id,...b!==null?{preset_id:b}:{},method:"api-key"}),c({type:"select-form",providerId:h.id,presetId:b}))},v=o.kind==="oauth-pending"?o.stateToken:null,_=o.kind==="oauth-pending"?o.providerId:null;R.useEffect(()=>{if(o.kind!=="oauth-pending")return;let d=!1;const h=o.stateToken,b=o.providerId,S=j=>{if(j.origin!==window.location.origin||j.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:M,stateToken:I}=j.data;if(I!==h){Q.error("Security check failed: State token mismatch"),c({type:"oauth-failed"});return}d=!0;const O=n.find(T=>T.id===b);x({providerId:b,code:M,stateToken:h,label:O?.name??b})};window.addEventListener("message",S);const y=setTimeout(()=>{d||(X("ai_provider_oauth_timeout",{provider_id:b}),c({type:"oauth-failed"}),Q.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",S),clearTimeout(y)}},[o.kind,v,_,x]);const N=as(o),k=N?n.find(d=>d.id===N):null,w=(o.kind==="form"&&o.presetId?ce.find(d=>d.id===o.presetId):null)?.name??k?.name??"Connect an AI provider",E=o.kind!=="grid"&&o.kind!=="closed";return s.jsx(Le,{open:o.kind!=="closed",onOpenChange:d=>!d&&m(),children:s.jsxs(Re,{className:"sm:max-w-3xl",children:[s.jsxs(rt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[E&&s.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c({type:"back"}),children:s.jsx(Ke,{size:16})}),s.jsx(Pe,{children:w})]}),o.kind==="grid"&&s.jsx(ot,{children:"Pick a provider — we'll handle the rest."})]}),o.kind==="grid"&&s.jsx(qt,{providers:n,onSelect:g}),o.kind==="form"&&(o.providerId==="openai-compatible"?s.jsx(ns,{preset:o.presetId?ce.find(d=>d.id===o.presetId):void 0,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),m()}}):s.jsx(ts,{providerId:o.providerId,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),m()}})),o.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(je,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),(o.kind==="cli-pending"||o.kind==="provision-pending")&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(je,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o.kind==="cli-pending"?"Checking CLI…":"Connecting…"})]}),(o.kind==="cli-error"||o.kind==="provision-error")&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Ot,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:o.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(J,{variant:"outline",size:"sm",onClick:()=>c({type:"back"}),children:"Back"}),s.jsx(J,{size:"sm",onClick:()=>{o.kind==="cli-error"?(c({type:"retry-cli"}),p(o.providerId)):(c({type:"retry-provision"}),f(o.providerId))},children:"Retry"})]})]})]})})}function ds(){const i=U.c(10),{org:e}=re();let t;i[0]!==e.id||i[1]!==e.slug?(t={connectionId:ue,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=t):t=i[2];const n=he(t);let l;i[3]!==e.id?(l=te.defaultBrand(e.id),i[3]=e.id,i[4]=l):l=i[4];let r;i[5]!==n?(r=async()=>{const c=await n.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),m=zt(c);return(Array.isArray(m?.items)?m.items:[]).find(ms)??null},i[5]=n,i[6]=r):r=i[6];let a;i[7]!==l||i[8]!==r?(a={queryKey:l,queryFn:r},i[7]=l,i[8]=r,i[9]=a):a=i[9];const{data:o}=tt(a);return o??null}function ms(i){return i.isDefault&&!i.archivedAt}function us(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function hs(i){const e=U.c(34);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:r}=re(),{localMode:a}=et(),o=ds(),[c,m]=R.useState(!1),u=r.name;let x;e[2]!==o?(x=o?us(o):null,e[2]=o,e[3]=x):x=e[3];const p=x,f=o?.favicon??o?.logo??null,g=n??(u?`${u} is ready for agents`:"Your agents are almost ready"),v=l??"Choose how to power your AI team.",_=!!(f||p);let N;e[4]!==p?(N=p?{backgroundColor:`${p}18`,borderColor:`${p}30`}:void 0,e[4]=p,e[5]=N):N=e[5];const k=N,C=_?"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 w;e[6]!==f||e[7]!==p?(w=f?s.jsx("img",{src:f,alt:"",className:"size-7 rounded object-contain"}):s.jsx(Mt,{size:24,style:p?{color:p}:void 0,className:me(!p&&"text-lime-600 dark:text-lime-400")}),e[6]=f,e[7]=p,e[8]=w):w=e[8];let E;e[9]!==C||e[10]!==k||e[11]!==w?(E=s.jsx("div",{className:C,style:k,children:w}),e[9]=C,e[10]=k,e[11]=w,e[12]=E):E=e[12];let d;e[13]!==g?(d=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:g}),e[13]=g,e[14]=d):d=e[14];let h;e[15]!==v?(h=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:v}),e[15]=v,e[16]=h):h=e[16];let b;e[17]!==d||e[18]!==h?(b=s.jsxs("div",{className:"space-y-2",children:[d,h]}),e[17]=d,e[18]=h,e[19]=b):b=e[19];let S;e[20]!==E||e[21]!==b?(S=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[E,b]}),e[20]=E,e[21]=b,e[22]=S):S=e[22];let y;e[23]!==a?(y=a&&s.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Local models + use your existing AI provider"}),e[23]=a,e[24]=y):y=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(J,{onClick:()=>m(!0),children:"Connect AI provider"}),e[25]=j):j=e[25];let M;e[26]!==y?(M=s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[y,j]}),e[26]=y,e[27]=M):M=e[27];let I;e[28]!==c?(I=s.jsx(cs,{open:c,onOpenChange:m}),e[28]=c,e[29]=I):I=e[29];let O;return e[30]!==M||e[31]!==I||e[32]!==S?(O=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-2xl px-4",children:[S,M,I]}),e[30]=M,e[31]=I,e[32]=S,e[33]=O):O=e[33],O}function ve(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}const Ve=["smarter","faster","cheaper"],He={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},fs=[{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"]}],ps=fs.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),xs=new Set(["google/gemini-2.5-pro"]),Ce=new Map;function gs(i){const e=Ce.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else e:for(const{tier:n,prefix:l}of ps)if(i.startsWith(l)){if(xs.has(l)&&i.length>l.length&&i[l.length]==="-"){const a=i[l.length+1];if(!a||!/\d/.test(a))continue e}t=n;break}return Ce.set(i,t),t}function Ee(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=gs(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const qe="mesh:model-shortlist:",vs=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 bs(i){try{const e=localStorage.getItem(qe+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function ys(i,e){localStorage.setItem(qe+i,JSON.stringify([...e]))}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const Ss=["bg-destructive","bg-warning","bg-success","bg-success"],Ns=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function ws(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const _s={text:{icon:s.jsx(Nt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(St,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(kt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(jt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(yt,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(De,{className:"size-3.5"}),label:"Web search"}};function Is(i){const e=U.c(5),{capability:t}=i;let n;e[0]!==t?(n=_s[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let r;return e[2]!==l.icon||e[3]!==l.label?(r=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=r):r=e[4],r}function Cs(i){const e=U.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=d):d=e[0],d}const r=t.costs?.input!=null?t.costs.input*1e6:null,a=t.costs?.output!=null?t.costs.output*1e6:null;let o;e[1]!==t?(o=ve(t),e[1]=t,e[2]=o):o=e[2];const{provider:c,displayName:m}=o;if(l){let d;e[3]!==t.limits?(d=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=d):d=e[4];let h;e[5]!==r?(h=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[5]=r,e[6]=h):h=e[6];let b;e[7]!==a?(b=a!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",a.toFixed(2)," / 1M"]})]}),e[7]=a,e[8]=b):b=e[8];let S;e[9]!==t.limits?(S=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=S):S=e[10];let y;return e[11]!==d||e[12]!==h||e[13]!==b||e[14]!==S?(y=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[d,h,b,S]}),e[11]=d,e[12]=h,e[13]=b,e[14]=S,e[15]=y):y=e[15],y}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let x;e[18]!==t.logo||e[19]!==t.title?(x=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=x):x=e[20];let p;e[21]!==m?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:m}),e[21]=m,e[22]=p):p=e[22];let f;e[23]!==x||e[24]!==p?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[x,p]}),e[23]=x,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let v;e[28]!==u||e[29]!==f||e[30]!==g?(v=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=v):v=e[31];let _;e[32]!==t.capabilities?(_=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Es)}),e[32]=t.capabilities,e[33]=_):_=e[33];let N;e[34]!==t.limits?(N=t.limits?.contextWindow&&(()=>{const{level:d,label:h,description:b}=js(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(S=>s.jsx("div",{className:me("w-2 h-2 rounded-full",S<=d?Ss[d-1]:"bg-muted")},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:h}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",b]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=N):N=e[35];let k;e[36]!==t.limits?(k=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=k):k=e[37];let C;e[38]!==r||e[39]!==a?(C=(r!=null||a!=null)&&(()=>{const{level:d,label:h}=r!=null?ws(r):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),r!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(b=>s.jsx("span",{className:me("text-sm font-bold leading-none",b<=d?Ns[d-1]:"text-muted-foreground/20"),children:"$"},b))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:h})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]}),a!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",a.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=r,e[39]=a,e[40]=C):C=e[40];let w;e[41]!==N||e[42]!==k||e[43]!==C?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,k,C]}),e[41]=N,e[42]=k,e[43]=C,e[44]=w):w=e[44];let E;return e[45]!==w||e[46]!==v||e[47]!==_?(E=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[v,_,w]}),e[45]=w,e[46]=v,e[47]=_,e[48]=E):E=e[48],E}function Es(i){return s.jsx(Is,{capability:i},i)}function Ms(i){const e=U.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=ve(t),e[0]=t,e[1]=l):l=e[1];const{displayName:r,provider:a}=l;let o;e[2]!==t?(o=ge(t),e[2]=t,e[3]=o):o=e[3];const c=o;let m;e[4]!==t||e[5]!==n?(m=()=>n(t),e[4]=t,e[5]=n,e[6]=m):m=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let x;e[10]!==r?(x=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:r}),e[10]=r,e[11]=x):x=e[11];let p;e[12]!==a?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:a}),e[12]=a,e[13]=p):p=e[13];let f;e[14]!==x||e[15]!==p?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[x,p]}),e[14]=x,e[15]=p,e[16]=f):f=e[16];let g;return e[17]!==m||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:m,children:[u,f]}),e[17]=m,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function Os(i){const e=U.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(nt,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=r):r=e[1];const a=t?.message||"Could not fetch models from this provider.";let o;e[2]!==a?(o=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[a," Try another provider or retry."]})]}),e[2]=a,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(wt,{className:"size-3.5"}),e[4]=c):c=e[4];let m;e[5]!==n?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(J,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=m):m=e[6];let u;return e[7]!==o||e[8]!==m?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,o,m]}),e[7]=o,e[8]=m,e[9]=u):u=e[9],u}function As(){const i=U.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Ts)}),i[0]=e):e=i[0],e}function Ts(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(W,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(W,{className:"flex-1 h-4"}),s.jsx(W,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Me(i){const e=U.c(12),{label:t,models:n,onSelect:l,onHover:r}=i;if(n.length===0)return null;let a;e[0]!==t?(a=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=a):a=e[1];let o;if(e[2]!==n||e[3]!==r||e[4]!==l){let m;e[6]!==r||e[7]!==l?(m=u=>s.jsx("div",{onClick:()=>l(u),className:"cursor-pointer",children:s.jsx(Ms,{model:u,onHover:r})},u.modelId),e[6]=r,e[7]=l,e[8]=m):m=e[8],o=n.map(m),e[2]=n,e[3]=r,e[4]=l,e[5]=o}else o=e[5];let c;return e[9]!==a||e[10]!==o?(c=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=c):c=e[11],c}function zs(i){const e=U.c(21),{model:t,isChecked:n,onToggle:l,onHover:r}=i,[a,o]=R.useState(n);a!==n&&o(n);let c;e[0]!==t?(c=ge(t),e[0]=t,e[1]=c):c=e[1];const m=c;let u;e[2]!==t||e[3]!==r?(u=()=>r(t),e[2]=t,e[3]=r,e[4]=u):u=e[4];let x;e[5]!==t.modelId||e[6]!==l?(x=()=>{o(Ls),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=x):x=e[7];let p;e[8]!==a||e[9]!==x?(p=s.jsx(lt,{checked:a,onCheckedChange:x}),e[8]=a,e[9]=x,e[10]=p):p=e[10];let f;e[11]!==m||e[12]!==t.title?(f=s.jsx("img",{src:m,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=m,e[12]=t.title,e[13]=f):f=e[13];let g;e[14]!==t.title?(g=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=g):g=e[15];let v;return e[16]!==u||e[17]!==p||e[18]!==f||e[19]!==g?(v=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[p,f,g]}),e[16]=u,e[17]=p,e[18]=f,e[19]=g,e[20]=v):v=e[20],v}function Ls(i){return!i}function Rs(i){const e=[];for(const t of Ve)if(i[t].length>0){e.push({type:"header",label:He[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ps({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=R.useRef(null),r=Ht({count:i.length,getScrollElement:()=>l.current,estimateSize:a=>i[a]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:r.getTotalSize()},children:r.getVirtualItems().map(a=>{const o=i[a.index];return o?s.jsx("div",{"data-index":a.index,ref:r.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${a.start}px)`},children:o.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:o.label}):s.jsx(zs,{model:o.model,isChecked:e.has(o.model.modelId),onToggle:t,onHover:n})},a.key):null})})})}function Fs(i){const e=U.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:r,managing:a,onToggleManage:o,filterModels:c}=i,{models:m}=Et(t),u=c?m.filter(c):m.filter($s);let x;e[0]!==t?(x=()=>(t?bs(t):null)??vs,e[0]=t,e[1]=x):x=e[1];const[p,f]=R.useState(x),[,g]=R.useTransition();let v;e[2]!==t||e[3]!==g?(v=y=>{t&&g(()=>{f(j=>{const M=new Set(j);return M.has(y)?M.delete(y):M.add(y),ys(t,M),M})})},e[2]=t,e[3]=g,e[4]=v):v=e[4];const _=v,N=n.toLowerCase().trim(),k=y=>N?y.filter(j=>j.title.toLowerCase().includes(N)||j.modelId.toLowerCase().includes(N)):y;if(a){const y=Ee(k(u)),j=Rs(y);let M;e[5]!==p?(M=z=>p.has(z.modelId),e[5]=p,e[6]=M):M=e[6];const I=u.filter(M).length;let O;e[7]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ke,{size:14}),e[7]=O):O=e[7];let T;return e[8]!==o?(T=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[O,"Back"]}),e[8]=o,e[9]=T):T=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[T,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[I," selected"]})]}),s.jsx(Ps,{items:j,shortlistSet:p,onToggle:_,onHover:l})]})}let C;e[10]!==p?(C=y=>p.has(y.modelId),e[10]=p,e[11]=C):C=e[11];const w=u.filter(C),E=w.length>0?w:u,d=Ee(k(E));let h;e[12]!==d||e[13]!==l||e[14]!==r?(h=Ve.map(y=>s.jsx(Me,{label:He[y],models:d[y],onSelect:r,onHover:l},y)),e[12]=d,e[13]=l,e[14]=r,e[15]=h):h=e[15];let b;e[16]!==d.other||e[17]!==l||e[18]!==r?(b=s.jsx(Me,{label:"Other",models:d.other,onSelect:r,onHover:l}),e[16]=d.other,e[17]=l,e[18]=r,e[19]=b):b=e[19];let S;return e[20]!==h||e[21]!==b?(S=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[h,b]}),e[20]=h,e[21]=b,e[22]=S):S=e[22],S}function $s(i){return i.asyncResearch!==!0}function Ge(i){const e=U.c(19),{model:t,placeholder:n,isLoading:l}=i,r=n===void 0?"Select model":n;if(l===void 0?!1:l){let v;return e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(W,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(W,{className:"w-16 h-3 hidden md:block"})]}),e[0]=v):v=e[0],v}if(!t){let v;e[1]!==r?(v=s.jsx("span",{className:"text-sm text-muted-foreground",children:r}),e[1]=r,e[2]=v):v=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=_):_=e[3];let N;return e[4]!==v?(N=s.jsxs("div",{className:"flex items-center gap-1.5",children:[v,_]}),e[4]=v,e[5]=N):N=e[5],N}let o;e[6]!==t?(o=ve(t),e[6]=t,e[7]=o):o=e[7];const{displayName:c}=o;let m;e[8]!==t?(m=ge(t),e[8]=t,e[9]=m):m=e[9];const u=m;let x;e[10]!==t.title||e[11]!==u?(x=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=x):x=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==x||e[17]!==p?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[x,p,f]}),e[16]=x,e[17]=p,e[18]=g):g=e[18],g}const Ks=["vision","image","file","audio","video"],Ye=["image/png","image/jpeg","image/gif","image/webp"],Xe=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function be(i){const e=i?.capabilities;return e?Ks.some(t=>e.includes(t)):!1}function vi(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),r=t.includes("audio"),a=t.includes("video");return!!(n&&Ye.includes(i)||l&&i==="application/pdf"||r&&i.startsWith("audio/")||a&&i.startsWith("video/")||be(e)&&Xe.includes(i))}function bi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ye),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),be(i)&&t.push(...Xe),t.join(",")}function yi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),be(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}function Ds(){const i=U.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(W,{className:"size-4 shrink-0"}),s.jsx(W,{className:"flex-1 h-6"}),s.jsx(W,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Us)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(W,{className:"size-6 shrink-0"}),s.jsx(W,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(W,{className:"h-6 w-20 rounded-md"}),s.jsx(W,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let r;i[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(W,{className:"h-4 w-24"}),s.jsx(W,{className:"h-4 w-32"})]}),i[4]=r):r=i[4];let a;return i[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[r,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(W,{className:"h-4 w-16"}),s.jsx(W,{className:"h-4 w-40"})]})]})]})})]}),i[5]=a):a=i[5],a}function Us(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(W,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(W,{className:"flex-1 h-4"}),s.jsx(W,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Qe(i){const e=U.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:r,onModelChange:a,filterModels:o}=i,[c,m]=R.useState(null),[u,x]=R.useState(""),[p,f]=R.useState(!1),g=R.useRef(null),v=Ue(),_=Ct();let N;e[0]!==v?.providers?(N=Object.fromEntries((v?.providers??[]).map(Vs)),e[0]=v?.providers,e[1]=N):N=e[1];const k=N,C=st(),{org:w}=re();let E;e[2]!==l?(E=A=>{l(A),m(null)},e[2]=l,e[3]=E):E=e[3];const d=E;let h;e[4]!==n||e[5]!==t||e[6]!==a?(h=A=>{n&&(a(A),x(""),t())},e[4]=n,e[5]=t,e[6]=a,e[7]=h):h=e[7];const b=h;if(_.length===0){let A;return e[8]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(hs,{})}),e[8]=A):A=e[8],A}let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(De,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=S):S=e[9];const y=p?"Search all models...":"Search for a model...";let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=A=>x(A.target.value),e[10]=j):j=e[10];let M;e[11]!==u||e[12]!==y?(M=s.jsx(le,{ref:g,type:"text",placeholder:y,value:u,onChange:j,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]=u,e[12]=y,e[13]=M):M=e[13];let I;e[14]!==n||e[15]!==d||e[16]!==_||e[17]!==k?(I=_.length>0&&s.jsxs(ft,{value:n??"",onValueChange:d,children:[s.jsxs(pt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ws,children:[s.jsx(xt,{placeholder:"Key",children:(()=>{const A=_.find(ee=>ee.id===n),B=A?k[A.providerId]:void 0,G=Ie(A?.presetId),Z=G?.logo??B?.logo,Y=G?.name??B?.name??A?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Z?s.jsx("img",{src:Z,alt:Y,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Y.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:Y})]})})()}),s.jsx(bt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(gt,{children:_.map(A=>{const B=k[A.providerId],G=Ie(A.presetId),Z=G?.logo??B?.logo,Y=G?.name??B?.name??A.providerId;return s.jsx(vt,{value:A.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Z?s.jsx("img",{src:Z,alt:Y,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Y.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[Y," — ",A.label]})]})},A.id)})})]}),e[14]=n,e[15]=d,e[16]=_,e[17]=k,e[18]=I):I=e[18];let O;e[19]!==M||e[20]!==I?(O=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[S,M,I]})}),e[19]=M,e[20]=I,e[21]=O):O=e[21];let T;e[22]!==n?(T=A=>{const{error:B,resetError:G}=A;return s.jsx(Os,{error:B,onRetry:G,credentialId:n??void 0})},e[22]=n,e[23]=T):T=e[23];let z;e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(As,{}),e[24]=z):z=e[24];const L=n??void 0;let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=()=>f(Bs),e[25]=H):H=e[25];let P;e[26]!==o||e[27]!==b||e[28]!==p||e[29]!==u||e[30]!==L?(P=s.jsx(R.Suspense,{fallback:z,children:s.jsx(Fs,{keyId:L,searchTerm:u,onHover:m,onModelSelect:b,managing:p,onToggleManage:H,filterModels:o})}),e[26]=o,e[27]=b,e[28]=p,e[29]=u,e[30]=L,e[31]=P):P=e[31];let F;e[32]!==n||e[33]!==T||e[34]!==P?(F=s.jsx(it,{fallback:T,children:P},n),e[32]=n,e[33]=T,e[34]=P,e[35]=F):F=e[35];let $;e[36]!==p||e[37]!==C||e[38]!==w?($=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>R.startTransition(()=>f(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(It,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>C({to:"/$org/settings/ai-providers",params:{org:w.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(_t,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=C,e[38]=w,e[39]=$):$=e[39];let K;e[40]!==F||e[41]!==$||e[42]!==O?(K=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[O,F,$]}),e[40]=F,e[41]=$,e[42]=O,e[43]=K):K=e[43];const q=c??r??null;let D;e[44]!==q?(D=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Cs,{model:q})}),e[44]=q,e[45]=D):D=e[45];let V;return e[46]!==K||e[47]!==D?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[K,D]}),e[46]=K,e[47]=D,e[48]=V):V=e[48],V}function Bs(i){return!i}function Ws(i){return i.stopPropagation()}function Vs(i){return[i.id,i]}function Hs(i){const e=U.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:r,setModel:a}=Be();let o;e[0]!==l?(o=u=>{X("chat_credential_changed",{credential_id:u}),l(u)},e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n||e[3]!==r?.modelId||e[4]!==a?(c=u=>{n&&(X("chat_model_changed",{from_model_id:r?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:n}),a({...u,keyId:n}))},e[2]=n,e[3]=r?.modelId,e[4]=a,e[5]=c):c=e[5];let m;return e[6]!==n||e[7]!==t||e[8]!==r||e[9]!==o||e[10]!==c?(m=s.jsx(Qe,{onClose:t,credentialId:n,onCredentialChange:o,selectedModel:r,onModelChange:c}),e[6]=n,e[7]=t,e[8]=r,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function ji(i){const e=U.c(38),{variant:t,className:n,placeholder:l,model:r,isLoading:a,credentialId:o,onCredentialChange:c,onModelChange:m,filterModels:u}=i,x=t===void 0?"borderless":t,p=l===void 0?"Select model":l,[f,g]=R.useState(!1),v=m!==void 0,_=ht(),N=x==="borderless"?"ghost":"outline",k=x==="borderless"&&"md:border-none";let C;e[0]!==n||e[1]!==k?(C=me("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",k,n),e[0]=n,e[1]=k,e[2]=C):C=e[2];let w;e[3]!==a||e[4]!==r||e[5]!==p||e[6]!==v?(w=v?s.jsx(Ge,{model:r??null,placeholder:p,isLoading:a}):s.jsx(Gs,{placeholder:p}),e[3]=a,e[4]=r,e[5]=p,e[6]=v,e[7]=w):w=e[7];let E;e[8]!==N||e[9]!==C||e[10]!==w?(E=s.jsx(J,{variant:N,size:"sm",className:C,children:w}),e[8]=N,e[9]=C,e[10]=w,e[11]=E):E=e[11];const d=E;let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ds,{}),e[12]=h):h=e[12];let b;e[13]!==o||e[14]!==u||e[15]!==r||e[16]!==c||e[17]!==m||e[18]!==v?(b=s.jsx(R.Suspense,{fallback:h,children:v?s.jsx(Qe,{onClose:()=>g(!1),credentialId:o??null,onCredentialChange:c??qs,selectedModel:r??null,onModelChange:m,filterModels:u}):s.jsx(Hs,{onClose:()=>g(!1)})}),e[13]=o,e[14]=u,e[15]=r,e[16]=c,e[17]=m,e[18]=v,e[19]=b):b=e[19];const S=b;if(_){let O;e[20]!==d?(O=s.jsx(ct,{asChild:!0,children:d}),e[20]=d,e[21]=O):O=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(dt,{className:"sr-only",children:"Select model"}),e[22]=T):T=e[22];let z;e[23]!==S?(z=s.jsxs(mt,{className:"p-0 flex flex-col max-h-[95vh]",children:[T,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:S})]}),e[23]=S,e[24]=z):z=e[24];let L;return e[25]!==f||e[26]!==O||e[27]!==z?(L=s.jsxs(ut,{open:f,onOpenChange:g,children:[O,z]}),e[25]=f,e[26]=O,e[27]=z,e[28]=L):L=e[28],L}let y;e[29]!==d?(y=s.jsx(at,{asChild:!0,children:d}),e[29]=d,e[30]=y):y=e[30];let j;e[31]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Pe,{className:"sr-only",children:"Select model"}),e[31]=j):j=e[31];let M;e[32]!==S?(M=s.jsxs(Re,{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:[j,S]}),e[32]=S,e[33]=M):M=e[33];let I;return e[34]!==f||e[35]!==y||e[36]!==M?(I=s.jsxs(Le,{open:f,onOpenChange:g,children:[y,M]}),e[34]=f,e[35]=y,e[36]=M,e[37]=I):I=e[37],I}function qs(){}function Gs(i){const e=U.c(4),{placeholder:t}=i,{selectedModel:n,isModelsLoading:l}=Be();let r;return e[0]!==l||e[1]!==n||e[2]!==t?(r=s.jsx(Ge,{model:n,placeholder:t,isLoading:l}),e[0]=l,e[1]=n,e[2]=t,e[3]=r):r=e[3],r}export{cs as C,ji as M,hs as N,ce as O,yi as a,bi as g,vi as i,be as m};
@@ -1 +1 @@
1
- import{e as k,g as E,U as L,j as s,s as R,aF as D,c as $,L as z,t as T,b as F,O as I,l as H,r as J}from"./index-CB-9CUUW.js";import{S as K,a as Q,b as V,u as X,f as w,g as C,h as O,j as P,i as M,l as Y,m as Z,c as ee,d as se,e as te}from"./sidebar-BWu_ePOy.js";import{a as A}from"./index-DR62hZV9.js";import{i as W}from"./ArrowNarrowLeft-Bj9BOs-z.js";import{c as le,d as ne,b as re,e as ie,f as oe,i as U,a as ae,n as ce}from"./ZapSquare-Bp-Tac0d.js";import{t as me,a as G}from"./Users03-BRhtwP3R.js";import{i as de}from"./ChevronRight-DvySy092.js";import{i as fe}from"./Lock01-mA7QgL2y.js";import{i as xe}from"./Shield01-mkPGOpR6.js";import{s as be}from"./User01-BeQhAfkv.js";import{i as B}from"./Zap-C2Ojyfeu.js";import{u as he}from"./tooltip-Fw0r1Fnv.js";import{u as ue}from"./use-status-sounds-VTPYJ4_T.js";import"./LayoutLeft-JykQcN-j.js";import"./X-BIBUzPXw.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-CD5HmYFC.js";import"./create-sse-subscription-CxkOgzKf.js";function q(){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=q();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(W,{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(U,{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.312.5"]})}),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"}),F.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=k.c(29),{onClose:n}=e,l=q();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(W,{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(U,{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.312.5"]})}),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 F.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 Je(){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,Je as default};
1
+ import{e as k,g as E,U as L,j as s,s as R,aF as D,c as $,L as z,t as T,b as F,O as I,l as H,r as J}from"./index-BRY25LXZ.js";import{S as K,a as Q,b as V,u as X,f as w,g as C,h as O,j as P,i as M,l as Y,m as Z,c as ee,d as se,e as te}from"./sidebar-G21X9kgh.js";import{a as A}from"./index-BO0Inq7t.js";import{i as W}from"./ArrowNarrowLeft-CIQd7Thm.js";import{c as le,d as ne,b as re,e as ie,f as oe,i as U,a as ae,n as ce}from"./ZapSquare-BQR205kq.js";import{t as me,a as G}from"./Users03-CC5zD4NC.js";import{i as de}from"./ChevronRight-BoP1zu-d.js";import{i as fe}from"./Lock01-BfkT1rLN.js";import{i as xe}from"./Shield01-D9x40AM1.js";import{s as be}from"./User01-nyGmAcbb.js";import{i as B}from"./Zap-DAhFCcSC.js";import{u as he}from"./tooltip-CaFNQbaH.js";import{u as ue}from"./use-status-sounds-B8tKxqE4.js";import"./LayoutLeft-CRh2Avtv.js";import"./X-_H3PwZ-x.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-DCwOC8tQ.js";import"./create-sse-subscription-CxkOgzKf.js";function q(){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=q();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(W,{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(U,{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.312.6"]})}),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"}),F.signOut()}function _e(e){return e.location.pathname}function ye(e){const t=k.c(29),{onClose:n}=e,l=q();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(W,{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(U,{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.312.6"]})}),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 F.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 Je(){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,Je as default};
@@ -1 +1 @@
1
- import{e as v,c as N,j as r,r as S}from"./index-CB-9CUUW.js";import{C as w}from"./card-DTHqwNV7.js";import{i as E}from"./ArrowUpRight-CGIcPNOI.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),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]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.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 a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}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=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.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]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,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]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("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=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("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 v,c as N,j as r,r as S}from"./index-BRY25LXZ.js";import{C as w}from"./card-DDt5rBOW.js";import{i as E}from"./ArrowUpRight-Dj7chErN.js";function I(c){const e=v.c(12),{title:i,description:l,docsHref:t,actions:s,className:n,headerClassName:a,children:d}=c;let m;e[0]!==n?(m=N("flex flex-col gap-3",n),e[0]=n,e[1]=m):m=e[1];let f;e[2]!==s||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==i?(f=(i||l||t||s)&&r.jsxs("div",{className:N("flex items-center justify-between gap-3 px-4",a),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]=a,e[6]=i,e[7]=f):f=e[7];let o;return e[8]!==d||e[9]!==m||e[10]!==f?(o=r.jsxs("section",{className:m,children:[f,d]}),e[8]=d,e[9]=m,e[10]=f,e[11]=o):o=e[11],o}function P(c){const e=v.c(11),{className:i,children:l}=c;let t,s,n;if(e[0]!==l||e[1]!==i){const d=S.Children.toArray(l).filter(S.isValidElement);t=w,e[5]!==i?(s=N("p-0 gap-0 overflow-hidden",i),e[5]=i,e[6]=s):s=e[6],n=d.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 a;return e[7]!==t||e[8]!==s||e[9]!==n?(a=r.jsx(t,{className:s,children:n}),e[7]=t,e[8]=s,e[9]=n,e[10]=a):a=e[10],a}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=v.c(27),{icon:i,title:l,description:t,action:s,onClick:n,className:a,children:d}=c,m=d?"flex items-start gap-3 px-4 py-4":"flex items-center gap-3 px-4 py-4",f=n&&"hover:bg-muted/50 cursor-pointer";let o;e[0]!==a||e[1]!==m||e[2]!==f?(o=N(m,f,a),e[0]=a,e[1]=m,e[2]=f,e[3]=o):o=e[3];const b=n?"button":void 0,C=n?0:void 0;let x;e[4]!==n?(x=n?k=>{(k.key==="Enter"||k.key===" ")&&(k.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]!==d||e[13]!==u||e[14]!==h?(g=r.jsxs("div",{className:"flex-1 min-w-0",children:[u,h,d]}),e[12]=d,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]!==o||e[22]!==b||e[23]!==C||e[24]!==x||e[25]!==p?(y=r.jsxs("div",{className:o,onClick:n,role:b,tabIndex:C,onKeyDown:x,children:[p,g,j]}),e[18]=n,e[19]=g,e[20]=j,e[21]=o,e[22]=b,e[23]=C,e[24]=x,e[25]=p,e[26]=y):y=e[26],y}function D(c){return c.stopPropagation()}function H(c){const e=v.c(5),{children:i,className:l}=c;let t;e[0]!==l?(t=N("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=v.c(5),{className:i,children:l}=c;let t;e[0]!==i?(t=N("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 _,j as s,bi as I,K as D,B as C,f as K,o as E,s as M,g as R,d as $,a1 as L,r as A,w as q,R as T,b as z,S as F,O as G,bj as U}from"./index-CB-9CUUW.js";import{a as B,c as H,d as Q,b as Y}from"./dialog-CVU8C65F.js";import{R as W}from"./required-auth-layout-DNLyc-Jc.js";import{u as V}from"./use-tasks-Buj64kOD.js";import{b as J}from"./use-organization-settings-gXH8ly7B.js";import{u as X}from"./use-org-sso-DyRmCzkM.js";import{i as Z}from"./Lock01-mA7QgL2y.js";import{i as ee}from"./Archive-CpwaQ9i2.js";const P=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),k=P?"⌘":"Ctrl",b={keyboardShortcuts:{keys:[k,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[k,"L"],description:"Focus chat input"},saveAndFormat:{keys:[k,"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:[k,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[k,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",k,"S"],description:"New task"},toggleDaemon:{keys:[k,"D"],description:"Toggle daemon logs"}},te=[{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 se(t){return P?t.metaKey:t.ctrlKey}function ne(t){const e=_.c(5),{open:o,onOpenChange:i}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(H,{children:s.jsx(Q,{children:"Keyboard Shortcuts"})}),e[0]=c):c=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(B,{className:"sm:max-w-md",children:[c,s.jsx("div",{className:"flex flex-col gap-4",children:te.map(oe)})]}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=s.jsx(Y,{open:o,onOpenChange:i,children:r}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}function oe(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(ae)})]},t.label)}function ae(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(ie)})]},t.description)}function ie(t){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:t},t)}function re({activeOrg:t}){return t&&I(t.id,{name:t.name??void 0,slug:t.slug??void 0}),null}function le(t,e,o){if(!o)return null;const i=t.getQueriesData({queryKey:D.tasksPrefix(e)});for(const[,c]of i){const r=c?.items?.find(a=>a.id===o);if(r?.branch)return r.branch}return null}function ce(t){const e=_.c(17),{orgSlug:o,orgName:i,domain:c}=t;let r;e[0]!==o?(r=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=r):r=e[1];const a=r,u=me;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(Z,{className:"h-6 w-6 text-primary"})}),e[2]=l):l=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=h):h=e[3];let p;e[4]!==c||e[5]!==i?(p=i?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:i})," requires SSO authentication",c?` via ${c}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=c,e[5]=i,e[6]=p):p=e[6];let n;e[7]!==p?(n=s.jsxs("div",{className:"space-y-2",children:[h,s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]}),e[7]=p,e[8]=n):n=e[8];let S;e[9]!==a?(S=s.jsx(C,{onClick:a,children:"Sign in with SSO"}),e[9]=a,e[10]=S):S=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(C,{variant:"ghost",onClick:u,children:"Go back"}),e[11]=j):j=e[11];let x;e[12]!==S?(x=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[S,j]}),e[12]=S,e[13]=x):x=e[13];let v;return e[14]!==n||e[15]!==x?(v=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:[l,n,x]})}),e[14]=n,e[15]=x,e[16]=v):v=e[16],v}function me(){window.location.href="/"}function de(t){const e=_.c(9),{orgName:o}=t,i=ue;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"bg-muted p-3 rounded-full",children:s.jsx(ee,{className:"h-6 w-6 text-muted-foreground"})}),e[0]=c):c=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),e[1]=r):r=e[1];let a;e[2]!==o?(a=o?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:o})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",e[2]=o,e[3]=a):a=e[3];let u;e[4]!==a?(u=s.jsxs("div",{className:"space-y-2",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:a})]}),e[4]=a,e[5]=u):u=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(C,{onClick:i,children:"Go to home"}),e[6]=l):l=e[6];let h;return e[7]!==u?(h=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:[c,u,l]})}),e[7]=u,e[8]=h):h=e[8],h}function ue(){window.location.href="/"}function fe(t){const e=_.c(8),{org:o,children:i}=t,r=J(o.id,o.slug)?.enabled_plugins??null;let a;e[0]!==o.id||e[1]!==o.name||e[2]!==r?(a={id:o.id,organizationId:o.id,slug:"_org",name:o.name,enabledPlugins:r,ui:null},e[0]=o.id,e[1]=o.name,e[2]=r,e[3]=a):a=e[3];const u=a;let l;return e[4]!==i||e[5]!==o||e[6]!==u?(l=s.jsx(U,{org:o,project:u,children:i}),e[4]=i,e[5]=o,e[6]=u,e[7]=l):l=e[7],l}function ge(){const t=K(),e=E(),o=V(),{locator:i}=M(),c=R({strict:!1}),r=$({strict:!1}),a=c.org??"",u=c.taskId??"",l=(m,d,f=!0)=>t({to:"/$org/$taskId",params:{org:a,taskId:m},search:d,replace:f}),h=(m,d=!0)=>l(u,m,d),p=m=>h(d=>({...d,chat:m?1:0})),n=m=>h(d=>({...d,tasks:m?1:0})),S=(m,d)=>l(m,f=>{const y={chat:1};return d?y.virtualmcpid=d:f.virtualmcpid&&(y.virtualmcpid=f.virtualmcpid),f.tasks&&(y.tasks=f.tasks),f.main&&(y.main=f.main),y},!1);return{setChatOpen:p,setTasksOpen:n,setTaskId:S,createNewTask:async()=>{const m=crypto.randomUUID(),d=le(e,i,u),f=r.virtualmcpid;try{await o.create.mutateAsync({id:m,...f?{virtual_mcp_id:f}:{},...d?{branch:d}:{}})}catch{}S(m)},openTab:m=>l(u||crypto.randomUUID(),d=>({...d,main:m})),toggleMain:()=>h(m=>{if(m.main!==void 0&&m.main!=="0")return{...m,main:"0"};const f={...m};return delete f.main,f})}}function he(){const t=_.c(30);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const i=L(e)?.params.org,[c,r]=A.useState(!1);let a,u;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const g=w=>{se(w)&&w.code==="KeyK"&&(w.preventDefault(),r(!0))};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},u=[],t[1]=a,t[2]=u):(a=t[1],u=t[2]),A.useEffect(a,u);let l;t[3]!==i?(l=D.activeOrganization(i),t[3]=i,t[4]=l):l=t[4];let h;t[5]!==i?(h=async()=>{if(!i)return null;const{data:g}=await z.organization.getFullOrganization({query:{organizationSlug:i}}),w=g?.metadata?.archived===!0;return g&&!w&&localStorage.setItem(T.lastOrgSlug(),i),g},t[5]=i,t[6]=h):h=t[6];let p;t[7]!==l||t[8]!==h?(p={queryKey:l,queryFn:h,gcTime:1/0,refetchOnWindowFocus:!1},t[7]=l,t[8]=h,t[9]=p):p=t[9];const{data:n}=q(p),S=n?.id,j=n?.slug,{data:x}=X(S,j);if(!n){let g;return t[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(F,{}),t[10]=g):g=t[10],g}if(n.metadata?.archived===!0){localStorage.getItem(T.lastOrgSlug())===i&&localStorage.removeItem(T.lastOrgSlug());let g;return t[11]!==n.name?(g=s.jsx(de,{orgName:n.name}),t[11]=n.name,t[12]=g):g=t[12],g}if(x?.ssoRequired&&!x.authenticated){let g;return t[13]!==n.id||t[14]!==n.name||t[15]!==n.slug||t[16]!==x.domain?(g=s.jsx(ce,{orgId:n.id,orgSlug:n.slug,orgName:n.name,domain:x.domain}),t[13]=n.id,t[14]=n.name,t[15]=n.slug,t[16]=x.domain,t[17]=g):g=t[17],g}const m=n.logo??null;let d;t[18]!==n||t[19]!==m?(d={...n,logo:m},t[18]=n,t[19]=m,t[20]=d):d=t[20];let f;t[21]!==n?(f=s.jsx(re,{activeOrg:n}),t[21]=n,t[22]=f):f=t[22];let y;t[23]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(G,{}),t[23]=y):y=t[23];let O;t[24]!==c?(O=s.jsx(ne,{open:c,onOpenChange:r}),t[24]=c,t[25]=O):O=t[25];let N;return t[26]!==O||t[27]!==d||t[28]!==f?(N=s.jsxs(fe,{org:d,children:[f,y,O]}),t[26]=O,t[27]=d,t[28]=f,t[29]=N):N=t[29],N}function pe(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(W,{children:s.jsx(he,{})}),t[0]=e):e=t[0],e}const _e=Object.freeze(Object.defineProperty({__proto__:null,default:pe,usePanelActions:ge},Symbol.toStringTag,{value:"Module"}));export{se as i,le as r,_e as s,ge as u};
1
+ import{e as _,j as s,bi as I,K as D,B as C,f as K,o as E,s as M,g as R,d as $,a1 as L,r as A,w as q,R as T,b as z,S as F,O as G,bj as U}from"./index-BRY25LXZ.js";import{a as B,c as H,d as Q,b as Y}from"./dialog-DLvaCZhi.js";import{R as W}from"./required-auth-layout-bGbsPRe1.js";import{u as V}from"./use-tasks-jUiBKFWl.js";import{b as J}from"./use-organization-settings-8Xiyp7J6.js";import{u as X}from"./use-org-sso-j8HePnUG.js";import{i as Z}from"./Lock01-BfkT1rLN.js";import{i as ee}from"./Archive-D0ENLr1k.js";const P=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),k=P?"⌘":"Ctrl",b={keyboardShortcuts:{keys:[k,"K"],description:"Keyboard shortcuts"},focusChatInput:{keys:[k,"L"],description:"Focus chat input"},saveAndFormat:{keys:[k,"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:[k,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[k,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",k,"S"],description:"New task"},toggleDaemon:{keys:[k,"D"],description:"Toggle daemon logs"}},te=[{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 se(t){return P?t.metaKey:t.ctrlKey}function ne(t){const e=_.c(5),{open:o,onOpenChange:i}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(H,{children:s.jsx(Q,{children:"Keyboard Shortcuts"})}),e[0]=c):c=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(B,{className:"sm:max-w-md",children:[c,s.jsx("div",{className:"flex flex-col gap-4",children:te.map(oe)})]}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=s.jsx(Y,{open:o,onOpenChange:i,children:r}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}function oe(t){return s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),s.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(ae)})]},t.label)}function ae(t){return s.jsxs("div",{className:"flex items-center justify-between py-1",children:[s.jsx("span",{className:"text-sm",children:t.description}),s.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(ie)})]},t.description)}function ie(t){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:t},t)}function re({activeOrg:t}){return t&&I(t.id,{name:t.name??void 0,slug:t.slug??void 0}),null}function le(t,e,o){if(!o)return null;const i=t.getQueriesData({queryKey:D.tasksPrefix(e)});for(const[,c]of i){const r=c?.items?.find(a=>a.id===o);if(r?.branch)return r.branch}return null}function ce(t){const e=_.c(17),{orgSlug:o,orgName:i,domain:c}=t;let r;e[0]!==o?(r=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=r):r=e[1];const a=r,u=me;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:s.jsx(Z,{className:"h-6 w-6 text-primary"})}),e[2]=l):l=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("h3",{className:"text-lg font-medium",children:"SSO Authentication Required"}),e[3]=h):h=e[3];let p;e[4]!==c||e[5]!==i?(p=i?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:i})," requires SSO authentication",c?` via ${c}`:"","."]}):"This organization requires SSO authentication to access.",e[4]=c,e[5]=i,e[6]=p):p=e[6];let n;e[7]!==p?(n=s.jsxs("div",{className:"space-y-2",children:[h,s.jsx("p",{className:"text-sm text-muted-foreground",children:p})]}),e[7]=p,e[8]=n):n=e[8];let S;e[9]!==a?(S=s.jsx(C,{onClick:a,children:"Sign in with SSO"}),e[9]=a,e[10]=S):S=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(C,{variant:"ghost",onClick:u,children:"Go back"}),e[11]=j):j=e[11];let x;e[12]!==S?(x=s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[S,j]}),e[12]=S,e[13]=x):x=e[13];let v;return e[14]!==n||e[15]!==x?(v=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:[l,n,x]})}),e[14]=n,e[15]=x,e[16]=v):v=e[16],v}function me(){window.location.href="/"}function de(t){const e=_.c(9),{orgName:o}=t,i=ue;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"bg-muted p-3 rounded-full",children:s.jsx(ee,{className:"h-6 w-6 text-muted-foreground"})}),e[0]=c):c=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h3",{className:"text-lg font-medium",children:"Organization unavailable"}),e[1]=r):r=e[1];let a;e[2]!==o?(a=o?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:o})," has been deleted or is no longer available."]}):"This organization has been deleted or is no longer available.",e[2]=o,e[3]=a):a=e[3];let u;e[4]!==a?(u=s.jsxs("div",{className:"space-y-2",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:a})]}),e[4]=a,e[5]=u):u=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(C,{onClick:i,children:"Go to home"}),e[6]=l):l=e[6];let h;return e[7]!==u?(h=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:[c,u,l]})}),e[7]=u,e[8]=h):h=e[8],h}function ue(){window.location.href="/"}function fe(t){const e=_.c(8),{org:o,children:i}=t,r=J(o.id,o.slug)?.enabled_plugins??null;let a;e[0]!==o.id||e[1]!==o.name||e[2]!==r?(a={id:o.id,organizationId:o.id,slug:"_org",name:o.name,enabledPlugins:r,ui:null},e[0]=o.id,e[1]=o.name,e[2]=r,e[3]=a):a=e[3];const u=a;let l;return e[4]!==i||e[5]!==o||e[6]!==u?(l=s.jsx(U,{org:o,project:u,children:i}),e[4]=i,e[5]=o,e[6]=u,e[7]=l):l=e[7],l}function ge(){const t=K(),e=E(),o=V(),{locator:i}=M(),c=R({strict:!1}),r=$({strict:!1}),a=c.org??"",u=c.taskId??"",l=(m,d,f=!0)=>t({to:"/$org/$taskId",params:{org:a,taskId:m},search:d,replace:f}),h=(m,d=!0)=>l(u,m,d),p=m=>h(d=>({...d,chat:m?1:0})),n=m=>h(d=>({...d,tasks:m?1:0})),S=(m,d)=>l(m,f=>{const y={chat:1};return d?y.virtualmcpid=d:f.virtualmcpid&&(y.virtualmcpid=f.virtualmcpid),f.tasks&&(y.tasks=f.tasks),f.main&&(y.main=f.main),y},!1);return{setChatOpen:p,setTasksOpen:n,setTaskId:S,createNewTask:async()=>{const m=crypto.randomUUID(),d=le(e,i,u),f=r.virtualmcpid;try{await o.create.mutateAsync({id:m,...f?{virtual_mcp_id:f}:{},...d?{branch:d}:{}})}catch{}S(m)},openTab:m=>l(u||crypto.randomUUID(),d=>({...d,main:m})),toggleMain:()=>h(m=>{if(m.main!==void 0&&m.main!=="0")return{...m,main:"0"};const f={...m};return delete f.main,f})}}function he(){const t=_.c(30);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const i=L(e)?.params.org,[c,r]=A.useState(!1);let a,u;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const g=w=>{se(w)&&w.code==="KeyK"&&(w.preventDefault(),r(!0))};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},u=[],t[1]=a,t[2]=u):(a=t[1],u=t[2]),A.useEffect(a,u);let l;t[3]!==i?(l=D.activeOrganization(i),t[3]=i,t[4]=l):l=t[4];let h;t[5]!==i?(h=async()=>{if(!i)return null;const{data:g}=await z.organization.getFullOrganization({query:{organizationSlug:i}}),w=g?.metadata?.archived===!0;return g&&!w&&localStorage.setItem(T.lastOrgSlug(),i),g},t[5]=i,t[6]=h):h=t[6];let p;t[7]!==l||t[8]!==h?(p={queryKey:l,queryFn:h,gcTime:1/0,refetchOnWindowFocus:!1},t[7]=l,t[8]=h,t[9]=p):p=t[9];const{data:n}=q(p),S=n?.id,j=n?.slug,{data:x}=X(S,j);if(!n){let g;return t[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(F,{}),t[10]=g):g=t[10],g}if(n.metadata?.archived===!0){localStorage.getItem(T.lastOrgSlug())===i&&localStorage.removeItem(T.lastOrgSlug());let g;return t[11]!==n.name?(g=s.jsx(de,{orgName:n.name}),t[11]=n.name,t[12]=g):g=t[12],g}if(x?.ssoRequired&&!x.authenticated){let g;return t[13]!==n.id||t[14]!==n.name||t[15]!==n.slug||t[16]!==x.domain?(g=s.jsx(ce,{orgId:n.id,orgSlug:n.slug,orgName:n.name,domain:x.domain}),t[13]=n.id,t[14]=n.name,t[15]=n.slug,t[16]=x.domain,t[17]=g):g=t[17],g}const m=n.logo??null;let d;t[18]!==n||t[19]!==m?(d={...n,logo:m},t[18]=n,t[19]=m,t[20]=d):d=t[20];let f;t[21]!==n?(f=s.jsx(re,{activeOrg:n}),t[21]=n,t[22]=f):f=t[22];let y;t[23]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(G,{}),t[23]=y):y=t[23];let O;t[24]!==c?(O=s.jsx(ne,{open:c,onOpenChange:r}),t[24]=c,t[25]=O):O=t[25];let N;return t[26]!==O||t[27]!==d||t[28]!==f?(N=s.jsxs(fe,{org:d,children:[f,y,O]}),t[26]=O,t[27]=d,t[28]=f,t[29]=N):N=t[29],N}function pe(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(W,{children:s.jsx(he,{})}),t[0]=e):e=t[0],e}const _e=Object.freeze(Object.defineProperty({__proto__:null,default:pe,usePanelActions:ge},Symbol.toStringTag,{value:"Module"}));export{se as i,le as r,_e as s,ge as u};
@@ -1 +1 @@
1
- import{e as b,c as g,j as o,cH as H,bZ as P,bd as R,cI as A,b_ as W,cK as V,b$ as q,r as I,aX as G,aW as L,B as F}from"./index-CB-9CUUW.js";import{i as K}from"./LayoutLeft-JykQcN-j.js";import{u as X,c as B,a as D,T as k,b as O}from"./tooltip-Fw0r1Fnv.js";import{i as Z}from"./X-BIBUzPXw.js";function J(i){const e=b.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(P,{"data-slot":"sheet",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(i){const e=b.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(W,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function U(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(q,{"data-slot":"sheet-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Y(i){const e=b.c(20);let t,s,a,l,n;e[0]!==i?({className:s,children:t,side:l,hideCloseButton:n,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=n):(t=e[1],s=e[2],a=e[3],l=e[4],n=e[5]);const d=l===void 0?"right":l,r=n===void 0?!1:n;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(U,{}),e[6]=u):u=e[6];const c=d==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",p=d==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",f=d==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",m=d==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[7]!==s||e[8]!==c||e[9]!==p||e[10]!==f||e[11]!==m?(h=g("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-200",c,p,f,m,s),e[7]=s,e[8]=c,e[9]=p,e[10]=f,e[11]=m,e[12]=h):h=e[12];let x;e[13]!==r?(x=!r&&o.jsxs(V,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(Z,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),e[13]=r,e[14]=x):x=e[14];let v;return e[15]!==t||e[16]!==a||e[17]!==h||e[18]!==x?(v=o.jsxs(Q,{children:[u,o.jsxs(R,{"data-slot":"sheet-content",className:h,...a,children:[t,x]})]}),e[15]=t,e[16]=a,e[17]=h,e[18]=x,e[19]=v):v=e[19],v}function ee(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sheet-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function te(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(H,{"data-slot":"sheet-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function se(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(A,{"data-slot":"sheet-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}const ae="15rem",le="18rem",ie="4.5rem",E=I.createContext(null);function z(){const i=I.useContext(E);if(!i)throw new Error("useSidebar must be used within a SidebarProvider.");return i}function be(i){const e=b.c(13),{children:t,defaultOpen:s}=i,a=s===void 0?!1:s,l=X(),[n,d]=I.useState(!1);let r;e[0]!==l?(r=()=>{l&&d(re)},e[0]=l,e[1]=r):r=e[1];const u=r,c=a?"expanded":"collapsed";let p;e[2]!==a||e[3]!==l||e[4]!==n||e[5]!==c||e[6]!==u?(p={state:c,open:a,setOpen:oe,isMobile:l,openMobile:n,setOpenMobile:d,toggleSidebar:u},e[2]=a,e[3]=l,e[4]=n,e[5]=c,e[6]=u,e[7]=p):p=e[7];const f=p;let m;e[8]!==t?(m=o.jsx(B,{delayDuration:0,children:t}),e[8]=t,e[9]=m):m=e[9];let h;return e[10]!==f||e[11]!==m?(h=o.jsx(E.Provider,{value:f,children:m}),e[10]=f,e[11]=m,e[12]=h):h=e[12],h}function oe(){}function re(i){return!i}function me(i){const e=b.c(14);let t,s,a,l;e[0]!==i?({className:s,style:l,children:t,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l):(t=e[1],s=e[2],a=e[3],l=e[4]);let n;e[5]!==l?(n={"--sidebar-width":ae,"--sidebar-width-icon":ie,...l},e[5]=l,e[6]=n):n=e[6];const d=n;let r;e[7]!==s?(r=g("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=r):r=e[8];let u;return e[9]!==t||e[10]!==a||e[11]!==d||e[12]!==r?(u=o.jsx("div",{"data-slot":"sidebar-wrapper",style:d,className:r,...a,children:t}),e[9]=t,e[10]=a,e[11]=d,e[12]=r,e[13]=u):u=e[13],u}function xe(i){const e=b.c(36);let t,s,a,l,n;e[0]!==i?({side:l,variant:n,className:s,children:t,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=n):(t=e[1],s=e[2],a=e[3],l=e[4],n=e[5]);const d=l===void 0?"left":l,r=n===void 0?"sidebar":n,{isMobile:u,state:c,openMobile:p,setOpenMobile:f}=z();if(u){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_={"--sidebar-width":le},e[6]=_):_=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(ee,{className:"sr-only",children:[o.jsx(te,{children:"Sidebar"}),o.jsx(se,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let $;e[8]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let C;e[10]!==d||e[11]!==$?(C=o.jsxs(Y,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:_,side:d,children:[M,$]}),e[10]=d,e[11]=$,e[12]=C):C=e[12];let T;return e[13]!==p||e[14]!==a||e[15]!==f||e[16]!==C?(T=o.jsx(J,{open:p,onOpenChange:f,...a,children:C}),e[13]=p,e[14]=a,e[15]=f,e[16]=C,e[17]=T):T=e[17],T}const m=c==="expanded",h=m?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let x;e[18]!==h?(x=g("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden",h),e[18]=h,e[19]=x):x=e[19];const v=m?void 0:"icon",y=m?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let j;e[20]!==s||e[21]!==y?(j=g("flex flex-col h-full",y,s),e[20]=s,e[21]=y,e[22]=j):j=e[22];let N;e[23]!==t?(N=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=N):N=e[24];let w;e[25]!==a||e[26]!==j||e[27]!==N?(w=o.jsx("div",{"data-slot":"sidebar-container",className:j,...a,children:N}),e[25]=a,e[26]=j,e[27]=N,e[28]=w):w=e[28];let S;return e[29]!==d||e[30]!==c||e[31]!==x||e[32]!==v||e[33]!==w||e[34]!==r?(S=o.jsx("div",{className:x,"data-state":c,"data-collapsible":v,"data-variant":r,"data-side":d,"data-slot":"sidebar",children:w}),e[29]=d,e[30]=c,e[31]=x,e[32]=v,e[33]=w,e[34]=r,e[35]=S):S=e[35],S}function he(i){const e=b.c(18);let t,s,a;e[0]!==i?({className:t,onClick:s,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const{toggleSidebar:l}=z();let n;e[4]!==t?(n=g("size-7",t),e[4]=t,e[5]=n):n=e[5];let d;e[6]!==s||e[7]!==l?(d=m=>{s?.(m),l()},e[6]=s,e[7]=l,e[8]=d):d=e[8];let r,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(K,{}),u=o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=r,e[10]=u):(r=e[9],u=e[10]);let c;e[11]!==a||e[12]!==n||e[13]!==d?(c=o.jsx(k,{asChild:!0,children:o.jsxs(F,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:n,onClick:d,...a,children:[r,u]})}),e[11]=a,e[12]=n,e[13]=d,e[14]=c):c=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(D,{side:"bottom",className:"flex items-center gap-1.5",children:["Collapse sidebar",o.jsx("span",{className:"flex items-center gap-0.5",children:["⌘","B"].map(ne)})]}),e[15]=p):p=e[15];let f;return e[16]!==c?(f=o.jsx(B,{delayDuration:300,children:o.jsxs(O,{children:[c,p]})}),e[16]=c,e[17]=f):f=e[17],f}function ne(i){return o.jsx("kbd",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1 rounded-sm border border-white/20 bg-white/10 text-white/70 text-xs font-mono",children:i},i)}function ge(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ve(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function je(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Ne(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("h-4 m-0! w-full",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-sidebar":"separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function we(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Se(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ye(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("w-full text-sm overflow-visible",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function $e(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex w-full min-w-0 flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Ce(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("group/menu-item relative w-full",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}const de=L("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm outline-0 outline-sidebar-ring transition-[width,height,padding] focus-visible:outline-2 focus-visible:-outline-offset-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:w-full! group-data-[state=collapsed]/sidebar:aspect-square! group-data-[state=collapsed]/sidebar:h-auto! group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:justify-center text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function _e(i){const e=b.c(28);let t,s,a,l,n,d,r;e[0]!==i?({asChild:a,isActive:l,variant:n,size:d,tooltip:r,className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=n,e[6]=d,e[7]=r):(t=e[1],s=e[2],a=e[3],l=e[4],n=e[5],d=e[6],r=e[7]);const u=a===void 0?!1:a,c=l===void 0?!1:l,p=n===void 0?"default":n,f=d===void 0?"default":d,m=u?G:"button",{isMobile:h}=z();let x;e[8]!==t||e[9]!==f||e[10]!==p?(x=g(de({variant:p,size:f}),t),e[8]=t,e[9]=f,e[10]=p,e[11]=x):x=e[11];let v;e[12]!==m||e[13]!==c||e[14]!==s||e[15]!==f||e[16]!==x?(v=o.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":f,"data-active":c,className:x,...s}),e[12]=m,e[13]=c,e[14]=s,e[15]=f,e[16]=x,e[17]=v):v=e[17];const y=v;if(!r)return y;if(typeof r=="string"){let S;e[18]!==r?(S={children:r},e[18]=r,e[19]=S):S=e[19],r=S}let j;e[20]!==y?(j=o.jsx(k,{asChild:!0,children:y}),e[20]=y,e[21]=j):j=e[21];let N;e[22]!==h||e[23]!==r?(N=o.jsx(D,{side:"right",align:"center",hidden:h,...r}),e[22]=h,e[23]=r,e[24]=N):N=e[24];let w;return e[25]!==j||e[26]!==N?(w=o.jsxs(O,{children:[j,N]}),e[25]=j,e[26]=N,e[27]=w):w=e[27],w}export{be as S,me as a,ge as b,te as c,Y as d,J as e,Se as f,ye as g,$e as h,_e as i,Ce as j,Ne as k,we as l,xe as m,ve as n,je as o,ee as p,se as q,he as r,z as u};
1
+ import{e as b,c as g,j as o,cH as H,bZ as P,bd as R,cI as A,b_ as W,cK as V,b$ as q,r as I,aX as G,aW as L,B as F}from"./index-BRY25LXZ.js";import{i as K}from"./LayoutLeft-CRh2Avtv.js";import{u as X,c as B,a as D,T as k,b as O}from"./tooltip-CaFNQbaH.js";import{i as Z}from"./X-_H3PwZ-x.js";function J(i){const e=b.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(P,{"data-slot":"sheet",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(i){const e=b.c(4);let t;e[0]!==i?({...t}=i,e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(W,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function U(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(q,{"data-slot":"sheet-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Y(i){const e=b.c(20);let t,s,a,l,n;e[0]!==i?({className:s,children:t,side:l,hideCloseButton:n,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=n):(t=e[1],s=e[2],a=e[3],l=e[4],n=e[5]);const d=l===void 0?"right":l,r=n===void 0?!1:n;let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(U,{}),e[6]=u):u=e[6];const c=d==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",p=d==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",f=d==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",m=d==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[7]!==s||e[8]!==c||e[9]!==p||e[10]!==f||e[11]!==m?(h=g("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-200",c,p,f,m,s),e[7]=s,e[8]=c,e[9]=p,e[10]=f,e[11]=m,e[12]=h):h=e[12];let x;e[13]!==r?(x=!r&&o.jsxs(V,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(Z,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]}),e[13]=r,e[14]=x):x=e[14];let v;return e[15]!==t||e[16]!==a||e[17]!==h||e[18]!==x?(v=o.jsxs(Q,{children:[u,o.jsxs(R,{"data-slot":"sheet-content",className:h,...a,children:[t,x]})]}),e[15]=t,e[16]=a,e[17]=h,e[18]=x,e[19]=v):v=e[19],v}function ee(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sheet-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function te(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(H,{"data-slot":"sheet-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function se(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx(A,{"data-slot":"sheet-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}const ae="15rem",le="18rem",ie="4.5rem",E=I.createContext(null);function z(){const i=I.useContext(E);if(!i)throw new Error("useSidebar must be used within a SidebarProvider.");return i}function be(i){const e=b.c(13),{children:t,defaultOpen:s}=i,a=s===void 0?!1:s,l=X(),[n,d]=I.useState(!1);let r;e[0]!==l?(r=()=>{l&&d(re)},e[0]=l,e[1]=r):r=e[1];const u=r,c=a?"expanded":"collapsed";let p;e[2]!==a||e[3]!==l||e[4]!==n||e[5]!==c||e[6]!==u?(p={state:c,open:a,setOpen:oe,isMobile:l,openMobile:n,setOpenMobile:d,toggleSidebar:u},e[2]=a,e[3]=l,e[4]=n,e[5]=c,e[6]=u,e[7]=p):p=e[7];const f=p;let m;e[8]!==t?(m=o.jsx(B,{delayDuration:0,children:t}),e[8]=t,e[9]=m):m=e[9];let h;return e[10]!==f||e[11]!==m?(h=o.jsx(E.Provider,{value:f,children:m}),e[10]=f,e[11]=m,e[12]=h):h=e[12],h}function oe(){}function re(i){return!i}function me(i){const e=b.c(14);let t,s,a,l;e[0]!==i?({className:s,style:l,children:t,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l):(t=e[1],s=e[2],a=e[3],l=e[4]);let n;e[5]!==l?(n={"--sidebar-width":ae,"--sidebar-width-icon":ie,...l},e[5]=l,e[6]=n):n=e[6];const d=n;let r;e[7]!==s?(r=g("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=r):r=e[8];let u;return e[9]!==t||e[10]!==a||e[11]!==d||e[12]!==r?(u=o.jsx("div",{"data-slot":"sidebar-wrapper",style:d,className:r,...a,children:t}),e[9]=t,e[10]=a,e[11]=d,e[12]=r,e[13]=u):u=e[13],u}function xe(i){const e=b.c(36);let t,s,a,l,n;e[0]!==i?({side:l,variant:n,className:s,children:t,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=n):(t=e[1],s=e[2],a=e[3],l=e[4],n=e[5]);const d=l===void 0?"left":l,r=n===void 0?"sidebar":n,{isMobile:u,state:c,openMobile:p,setOpenMobile:f}=z();if(u){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_={"--sidebar-width":le},e[6]=_):_=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(ee,{className:"sr-only",children:[o.jsx(te,{children:"Sidebar"}),o.jsx(se,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let $;e[8]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let C;e[10]!==d||e[11]!==$?(C=o.jsxs(Y,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:_,side:d,children:[M,$]}),e[10]=d,e[11]=$,e[12]=C):C=e[12];let T;return e[13]!==p||e[14]!==a||e[15]!==f||e[16]!==C?(T=o.jsx(J,{open:p,onOpenChange:f,...a,children:C}),e[13]=p,e[14]=a,e[15]=f,e[16]=C,e[17]=T):T=e[17],T}const m=c==="expanded",h=m?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let x;e[18]!==h?(x=g("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden",h),e[18]=h,e[19]=x):x=e[19];const v=m?void 0:"icon",y=m?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let j;e[20]!==s||e[21]!==y?(j=g("flex flex-col h-full",y,s),e[20]=s,e[21]=y,e[22]=j):j=e[22];let N;e[23]!==t?(N=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=N):N=e[24];let w;e[25]!==a||e[26]!==j||e[27]!==N?(w=o.jsx("div",{"data-slot":"sidebar-container",className:j,...a,children:N}),e[25]=a,e[26]=j,e[27]=N,e[28]=w):w=e[28];let S;return e[29]!==d||e[30]!==c||e[31]!==x||e[32]!==v||e[33]!==w||e[34]!==r?(S=o.jsx("div",{className:x,"data-state":c,"data-collapsible":v,"data-variant":r,"data-side":d,"data-slot":"sidebar",children:w}),e[29]=d,e[30]=c,e[31]=x,e[32]=v,e[33]=w,e[34]=r,e[35]=S):S=e[35],S}function he(i){const e=b.c(18);let t,s,a;e[0]!==i?({className:t,onClick:s,...a}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const{toggleSidebar:l}=z();let n;e[4]!==t?(n=g("size-7",t),e[4]=t,e[5]=n):n=e[5];let d;e[6]!==s||e[7]!==l?(d=m=>{s?.(m),l()},e[6]=s,e[7]=l,e[8]=d):d=e[8];let r,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(K,{}),u=o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=r,e[10]=u):(r=e[9],u=e[10]);let c;e[11]!==a||e[12]!==n||e[13]!==d?(c=o.jsx(k,{asChild:!0,children:o.jsxs(F,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:n,onClick:d,...a,children:[r,u]})}),e[11]=a,e[12]=n,e[13]=d,e[14]=c):c=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(D,{side:"bottom",className:"flex items-center gap-1.5",children:["Collapse sidebar",o.jsx("span",{className:"flex items-center gap-0.5",children:["⌘","B"].map(ne)})]}),e[15]=p):p=e[15];let f;return e[16]!==c?(f=o.jsx(B,{delayDuration:300,children:o.jsxs(O,{children:[c,p]})}),e[16]=c,e[17]=f):f=e[17],f}function ne(i){return o.jsx("kbd",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1 rounded-sm border border-white/20 bg-white/10 text-white/70 text-xs font-mono",children:i},i)}function ge(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("main",{"data-slot":"sidebar-inset",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ve(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function je(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Ne(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("h-4 m-0! w-full",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-sidebar":"separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function we(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Se(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function ye(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("w-full text-sm overflow-visible",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function $e(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("flex w-full min-w-0 flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function Ce(i){const e=b.c(8);let t,s;e[0]!==i?({className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=g("group/menu-item relative w-full",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}const de=L("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm outline-0 outline-sidebar-ring transition-[width,height,padding] focus-visible:outline-2 focus-visible:-outline-offset-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:w-full! group-data-[state=collapsed]/sidebar:aspect-square! group-data-[state=collapsed]/sidebar:h-auto! group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:justify-center text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function _e(i){const e=b.c(28);let t,s,a,l,n,d,r;e[0]!==i?({asChild:a,isActive:l,variant:n,size:d,tooltip:r,className:t,...s}=i,e[0]=i,e[1]=t,e[2]=s,e[3]=a,e[4]=l,e[5]=n,e[6]=d,e[7]=r):(t=e[1],s=e[2],a=e[3],l=e[4],n=e[5],d=e[6],r=e[7]);const u=a===void 0?!1:a,c=l===void 0?!1:l,p=n===void 0?"default":n,f=d===void 0?"default":d,m=u?G:"button",{isMobile:h}=z();let x;e[8]!==t||e[9]!==f||e[10]!==p?(x=g(de({variant:p,size:f}),t),e[8]=t,e[9]=f,e[10]=p,e[11]=x):x=e[11];let v;e[12]!==m||e[13]!==c||e[14]!==s||e[15]!==f||e[16]!==x?(v=o.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":f,"data-active":c,className:x,...s}),e[12]=m,e[13]=c,e[14]=s,e[15]=f,e[16]=x,e[17]=v):v=e[17];const y=v;if(!r)return y;if(typeof r=="string"){let S;e[18]!==r?(S={children:r},e[18]=r,e[19]=S):S=e[19],r=S}let j;e[20]!==y?(j=o.jsx(k,{asChild:!0,children:y}),e[20]=y,e[21]=j):j=e[21];let N;e[22]!==h||e[23]!==r?(N=o.jsx(D,{side:"right",align:"center",hidden:h,...r}),e[22]=h,e[23]=r,e[24]=N):N=e[24];let w;return e[25]!==j||e[26]!==N?(w=o.jsxs(O,{children:[j,N]}),e[25]=j,e[26]=N,e[27]=w):w=e[27],w}export{be as S,me as a,ge as b,te as c,Y as d,J as e,Se as f,ye as g,$e as h,_e as i,Ce as j,Ne as k,we as l,xe as m,ve as n,je as o,ee as p,se as q,he as r,z as u};
@@ -1 +1 @@
1
- import{e as n,c,j as i}from"./index-CB-9CUUW.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-BRY25LXZ.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{e as C,c as d,aW as u,j as a}from"./index-CB-9CUUW.js";const m=u("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function h(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=d(m({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{h as S};
1
+ import{e as C,c as d,aW as u,j as a}from"./index-BRY25LXZ.js";const m=u("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function h(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=d(m({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{h as S};