@decocms/mesh 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/client/assets/{AlertCircle-BPiWR69f.js → AlertCircle-CoA9j9_b.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CnWcM-Nt.js → ArrowLeft-Bu1JR7vY.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-CzJqGT44.js → ChevronDown-BmUd-Gap.js} +1 -1
  4. package/dist/client/assets/{Clock-DfIJLD0U.js → Clock-BGOqsAv_.js} +1 -1
  5. package/dist/client/assets/{Code01-BqdRSdUi.js → Code01-C4I9q0rm.js} +1 -1
  6. package/dist/client/assets/{Copy01-Bsnbushh.js → Copy01-D_YhbDiF.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-C8zbTCUz.js → CpuChip02-BkDt7iNK.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-Dld0ppCR.js → DotsVertical-CxdZClGh.js} +1 -1
  9. package/dist/client/assets/{File06-BqXxPQ9_.js → File06-BdMasDPT.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-DfSp-QEd.js → FlipBackward-B34yEzR2.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-D-IJ3Rmm.js → GitBranch01-D2Rua42v.js} +1 -1
  12. package/dist/client/assets/{Grid01-BGAyn8Yw.js → Grid01-Bom2qqwm.js} +1 -1
  13. package/dist/client/assets/{Inbox01-WG7d7KAj.js → Inbox01-Arx8J2Oq.js} +1 -1
  14. package/dist/client/assets/InfoCircle-BYXT4R1l.js +1 -0
  15. package/dist/client/assets/{Key01-BVEDd5ss.js → Key01-D0WGLaST.js} +1 -1
  16. package/dist/client/assets/LinkExternal01-LVkx-wZF.js +1 -0
  17. package/dist/client/assets/{Loading01-C25_IOHO.js → Loading01-Dw6V1r3u.js} +1 -1
  18. package/dist/client/assets/{Lock01-BrE0URxO.js → Lock01-Dw2P1WZh.js} +1 -1
  19. package/dist/client/assets/{Play-DMQjilHa.js → Play-BRRssd_q.js} +1 -1
  20. package/dist/client/assets/{Plus-BICwTwx2.js → Plus-CQSfshmp.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BfdAKKpi.js → SearchMd-CGUWNVUr.js} +1 -1
  22. package/dist/client/assets/{Terminal-BnLcMoVf.js → Terminal-CIo_ltVk.js} +1 -1
  23. package/dist/client/assets/{Trash01-COqd_w6V.js → Trash01-BgGiU9JZ.js} +1 -1
  24. package/dist/client/assets/{X-BS9TixYK.js → X-CsW5kmRT.js} +1 -1
  25. package/dist/client/assets/{XClose-BbtISBJv.js → XClose-D2IdV8gs.js} +1 -1
  26. package/dist/client/assets/{alert-dialog-BDXuXliX.js → alert-dialog-rSIOP2OM.js} +1 -1
  27. package/dist/client/assets/{auth-q6-9Qro0.js → auth-D6vm_lfk.js} +1 -1
  28. package/dist/client/assets/{auth-catchall-C96Z5CEi.js → auth-catchall-lDj0BXu4.js} +1 -1
  29. package/dist/client/assets/{avatar-B8vG4Uqa.js → avatar-C45Lgbwv.js} +1 -1
  30. package/dist/client/assets/{badge-C1bAg12O.js → badge-Z-ujar-h.js} +1 -1
  31. package/dist/client/assets/{button-DGQafcd8.js → button-DMnSM5FV.js} +1 -1
  32. package/dist/client/assets/{card-CYr6OLlA.js → card-DL_e-uTF.js} +1 -1
  33. package/dist/client/assets/{checkbox-CaJyqy-O.js → checkbox-SCLb_n1h.js} +1 -1
  34. package/dist/client/assets/{collection-detail-Cu_HUqcL.js → collection-detail-DZRR92ph.js} +1 -1
  35. package/dist/client/assets/{collection-display-button-KGOe_g_c.js → collection-display-button-BbSV76WH.js} +1 -1
  36. package/dist/client/assets/{collection-header-BTdNES9r.js → collection-header-CqO1LmKH.js} +1 -1
  37. package/dist/client/assets/{collection-page-zdZke2gS.js → collection-page-DDVR6yeu.js} +1 -1
  38. package/dist/client/assets/{collection-search-B3tGk-LW.js → collection-search-BOBOP2ro.js} +1 -1
  39. package/dist/client/assets/{collection-tab-DSAVfRke.js → collection-tab-CNlP707v.js} +1 -1
  40. package/dist/client/assets/{collection-table-wrapper-BX_y9ddJ.js → collection-table-wrapper-ByX0J-nn.js} +1 -1
  41. package/dist/client/assets/{connection-card-CjFdHSFM.js → connection-card-CZFyOgeO.js} +1 -1
  42. package/dist/client/assets/{connection-detail-BA5ZpgfC.js → connection-detail-oL5IGO2h.js} +1 -1
  43. package/dist/client/assets/{connections-D-_nUNdM.js → connections-BKlzJU2y.js} +1 -1
  44. package/dist/client/assets/constants-C4MXZrmv.js +1 -0
  45. package/dist/client/assets/{core-CqC2GVou.js → core-D9xILP6l.js} +1 -1
  46. package/dist/client/assets/{create-organization-dialog-CGAUGBhL.js → create-organization-dialog-lmQ3mepV.js} +1 -1
  47. package/dist/client/assets/{dialog-Dpiwsgfz.js → dialog-B1fXXmBI.js} +1 -1
  48. package/dist/client/assets/{dropdown-menu-B9xMQj69.js → dropdown-menu-gRHakuHp.js} +1 -1
  49. package/dist/client/assets/{empty-state-BeSrv53i.js → empty-state-BiqF__Lu.js} +1 -1
  50. package/dist/client/assets/{env-vars-editor-CGSk8J9z.js → env-vars-editor-Br0Q2jee.js} +1 -1
  51. package/dist/client/assets/{error-boundary-wmq9HPr0.js → error-boundary-CUq8HVcH.js} +1 -1
  52. package/dist/client/assets/{extract-connection-data-CpBGc1Lc.js → extract-connection-data-DsJuSGHU.js} +1 -1
  53. package/dist/client/assets/{form-D_YgJ7e_.js → form-BbwJs-Od.js} +1 -1
  54. package/dist/client/assets/{formatDistanceToNow-Ds7vgs-h.js → formatDistanceToNow-jHI_IOun.js} +1 -1
  55. package/dist/client/assets/gateway-detail-CvVf3uBW.js +1 -0
  56. package/dist/client/assets/{gateways-DNlHFwW1.js → gateways-BfCNNBIO.js} +1 -1
  57. package/dist/client/assets/{home-M_DzttVm.js → home-oGaB9rtf.js} +1 -1
  58. package/dist/client/assets/{index-D0CEOhNr.js → index-B1eBXzBF.js} +1 -1
  59. package/dist/client/assets/{index-DLujruNe.js → index-BMIizA12.js} +1 -1
  60. package/dist/client/assets/{index-Ddg6ZSnz.js → index-BVHhSH8M.js} +2 -2
  61. package/dist/client/assets/{index-SXKJnrpI.js → index-BbK2Byrj.js} +1 -1
  62. package/dist/client/assets/{input-B4ervJqC.js → input-C6vwKKeq.js} +1 -1
  63. package/dist/client/assets/json-GXJs871j.js +1 -0
  64. package/dist/client/assets/{json-syntax-highlighter-C24L-Dcz.js → json-syntax-highlighter-C3W2DACo.js} +2 -2
  65. package/dist/client/assets/{layout-DI3tY0Jg.js → layout-m8iq6RWE.js} +1 -1
  66. package/dist/client/assets/{lazy-highlighter-B_9Ne15K.js → lazy-highlighter-C7qLCeM-.js} +1 -1
  67. package/dist/client/assets/{localstorage-keys-B9p3fxpE.js → localstorage-keys-BB9xpX5T.js} +1 -1
  68. package/dist/client/assets/{login-Bb9ke2MY.js → login-CevUioqo.js} +1 -1
  69. package/dist/client/assets/{mcp-oauth-DJdQFUv3.js → mcp-oauth-CE6Gg3ul.js} +1 -1
  70. package/dist/client/assets/{members-DVNMtilz.js → members-CAJLI1Ui.js} +1 -1
  71. package/dist/client/assets/{monitoring-Dtmkvdkl.js → monitoring-_9gwma-O.js} +1 -1
  72. package/dist/client/assets/{oauth-callback-BX9ETVvQ.js → oauth-callback-DnSysdpG.js} +1 -1
  73. package/dist/client/assets/{page-DsxVj63x.js → page-jzi_ERcf.js} +1 -1
  74. package/dist/client/assets/{pin-to-sidebar-button-BKGCvVX6.js → pin-to-sidebar-button-DonhySMf.js} +1 -1
  75. package/dist/client/assets/{popover-CgilhutT.js → popover-BO5GT9tA.js} +1 -1
  76. package/dist/client/assets/prism-light-WCI-7yyK.js +1 -0
  77. package/dist/client/assets/{resizable-DsS5puYc.js → resizable-DpISfhV6.js} +1 -1
  78. package/dist/client/assets/{resource-tabs-DoDLyAeo.js → resource-tabs-JMDBPJhv.js} +1 -1
  79. package/dist/client/assets/{responsive-select-Db26zo9M.js → responsive-select-BZGantuu.js} +1 -1
  80. package/dist/client/assets/{select-twBCjq69.js → select-mD7lFwRj.js} +1 -1
  81. package/dist/client/assets/{settings-CVfx5hka.js → settings-iXHGs-4V.js} +1 -1
  82. package/dist/client/assets/{shell-layout-DCe42qoz.js → shell-layout-C1VOF_px.js} +3 -3
  83. package/dist/client/assets/{spinner-Dx5oa4h9.js → spinner-D7to-RHc.js} +1 -1
  84. package/dist/client/assets/{store-BJT-rcWj.js → store-C7bepdKu.js} +1 -1
  85. package/dist/client/assets/store-app-detail-dqrfmC2K.js +1 -0
  86. package/dist/client/assets/{switch-CBPgVkl4.js → switch-CpJO-7Kf.js} +1 -1
  87. package/dist/client/assets/{textarea-OX-GeuN9.js → textarea-Dma5FaAA.js} +1 -1
  88. package/dist/client/assets/{thread-history-popover-BTd50eKs.js → thread-history-popover-DTmh-wTW.js} +30 -30
  89. package/dist/client/assets/{tools-list-C94gLEYQ.js → tools-list-DJTZFgWM.js} +1 -1
  90. package/dist/client/assets/{tooltip-D8OED8cS.js → tooltip-DiQ9SlNX.js} +1 -1
  91. package/dist/client/assets/{types-DJryM_sg.js → types-Bq0bBlbx.js} +1 -1
  92. package/dist/client/assets/{use-binding-DALTy821.js → use-binding-DQTEUjPl.js} +1 -1
  93. package/dist/client/assets/{use-connection-bHHmK9mi.js → use-connection-DUMeVexv.js} +1 -1
  94. package/dist/client/assets/{use-connection-resources-DFv5BDo6.js → use-connection-resources-GqC2zg91.js} +1 -1
  95. package/dist/client/assets/{use-gateway-Dz9z17ME.js → use-gateway-pQG4iSzq.js} +1 -1
  96. package/dist/client/assets/{use-list-state-BhMQxwiZ.js → use-list-state-DKjekACN.js} +1 -1
  97. package/dist/client/assets/{use-mcp-DgFeI4fa.js → use-mcp-CaAgRxkf.js} +1 -1
  98. package/dist/client/assets/{use-members-Xa9kgxtY.js → use-members-Cxbw-nUt.js} +1 -1
  99. package/dist/client/assets/{use-mobile-oCggWXvr.js → use-mobile-C2teUdDI.js} +1 -1
  100. package/dist/client/assets/{use-organization-settings-cNGS6Euq.js → use-organization-settings-B-bw0Nsb.js} +1 -1
  101. package/dist/client/assets/{use-tool-call-D3vebIRo.js → use-tool-call-BwHyofVZ.js} +1 -1
  102. package/dist/client/assets/useQuery-C3iXPPho.js +1 -0
  103. package/dist/client/assets/{useSuspenseInfiniteQuery-DbaWYvOU.js → useSuspenseInfiniteQuery-WWHYgeeq.js} +1 -1
  104. package/dist/client/assets/{view-mode-toggle-CKl6PJqr.js → view-mode-toggle-DCDdw_zu.js} +1 -1
  105. package/dist/client/assets/{workflow-Cx97hdFm.js → workflow-nViVDMOR.js} +1 -1
  106. package/dist/client/index.html +1 -1
  107. package/package.json +1 -1
  108. package/dist/client/assets/LinkExternal01-754qZCAw.js +0 -1
  109. package/dist/client/assets/constants-DOHmO1ep.js +0 -1
  110. package/dist/client/assets/gateway-detail-D76LyPqO.js +0 -1
  111. package/dist/client/assets/json-1el7bQkh.js +0 -1
  112. package/dist/client/assets/prism-light-BjmAUPsT.js +0 -1
  113. package/dist/client/assets/store-app-detail-BRGaOqlr.js +0 -1
  114. package/dist/client/assets/useQuery-BvjuXhZf.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as S,c as p,e as Kt,d as st,K as pt,t as Je,j as l,f as He,a as Ce,g as Zt,R as Yt,T as qt,D as Qt,C as Xt,P as Jt,h as es,O as ts,i as ss,k as ns,l as ls,m as os,G as as,U as is,n as rs,S as xt,o as cs,p as ds,N as ms,q as fs,s as gt}from"./index-Ddg6ZSnz.js";import{E as us}from"./SearchMd-BfdAKKpi.js";import{u as hs,I as it,n as ps}from"./use-connection-bHHmK9mi.js";import{u as nt,L as Be}from"./localstorage-keys-B9p3fxpE.js";import{u as ye,T as xs,a as gs,b as bs,c as js,L as rt,i as vs,P as ws,O as Ss}from"./tooltip-D8OED8cS.js";import{B as Y,c as M}from"./button-DGQafcd8.js";import{i as et}from"./CpuChip02-C8zbTCUz.js";import{i as Ns}from"./Loading01-C25_IOHO.js";import{s as Cs}from"./Plus-BICwTwx2.js";import{i as Re}from"./X-BS9TixYK.js";import{u as ys}from"./use-binding-DALTy821.js";import{C as E,u as ct,a as _s,b as ks,c as dt,d as Is,N as $s,G as Ms,U as zs,T as Ts,M as Os}from"./thread-history-popover-BTd50eKs.js";import{E as lt}from"./error-boundary-wmq9HPr0.js";import{u as Es,G as As,R as bt,a as Ps,b as Ds}from"./resizable-DsS5puYc.js";import{i as Ls}from"./File06-BqXxPQ9_.js";import{u as _e}from"./use-mobile-oCggWXvr.js";import{u as jt,a as Rs}from"./use-organization-settings-cNGS6Euq.js";import{C as Hs}from"./create-organization-dialog-CGAUGBhL.js";import{I as Bs}from"./input-B4ervJqC.js";import{P as Us,a as Gs,b as Ws}from"./popover-CgilhutT.js";import{A as Ne}from"./avatar-B8vG4Uqa.js";import{c as Vs}from"./Grid01-BGAyn8Yw.js";import{D as Fs,a as Ks,b as Zs,c as Ys,u as qs,d as Qs}from"./responsive-select-Db26zo9M.js";import{D as Xs,a as Js,b as en,c as tn,d as mt}from"./dropdown-menu-B9xMQj69.js";import{a as sn}from"./Copy01-Bsnbushh.js";import{n as ft}from"./LinkExternal01-754qZCAw.js";import{D as vt,a as wt,b as St,c as Nt,d as Ct}from"./dialog-Dpiwsgfz.js";import"./useQuery-BvjuXhZf.js";import"./auth-q6-9Qro0.js";import"./AlertCircle-BPiWR69f.js";import"./textarea-OX-GeuN9.js";import"./Terminal-BnLcMoVf.js";import"./connection-card-CjFdHSFM.js";import"./card-CYr6OLlA.js";import"./json-syntax-highlighter-C24L-Dcz.js";import"./alert-dialog-BDXuXliX.js";import"./well-known-mcp-VNRT0JrW.js";import"./generate-id-Dyweu44Y.js";import"./Clock-DfIJLD0U.js";import"./Trash01-COqd_w6V.js";import"./use-gateway-Dz9z17ME.js";import"./form-D_YgJ7e_.js";import"./spinner-Dx5oa4h9.js";import"./select-twBCjq69.js";import"./ChevronDown-CzJqGT44.js";const yt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));yt.displayName="BarChart10";const _t=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));_t.displayName="Building02";const kt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));kt.displayName="ChevronSelectorVertical";const It=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));It.displayName="Globe01";const $t=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));$t.displayName="Home02";const Mt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Mt.displayName="LayoutRight";const zt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));zt.displayName="LogOut01";const Tt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Tt.displayName="Mail01";const Ot=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));Ot.displayName="Settings01";const Et=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Et.displayName="UserCircle";const At=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));At.displayName="Users01";const Pt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Pt.displayName="Zap";function ot(){const t=p.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Be.decoChatOpen(),t[0]=e):e=t[0];const[s,o]=nt(e,nn);let n;return t[1]!==s||t[2]!==o?(n=[s,o],t[1]=s,t[2]=o,t[3]=n):n=t[3],n}function nn(t){return!!(t??!1)}function ln(){const t=p.c(5),e=Kt(),{org:s}=ye();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const n=st(o);let a;return t[1]!==s||t[2]!==n||t[3]!==e?(a=i=>{const r=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!r||!r[1])return;const d=r[1],m=n.connectionId;if(!m)return;e.invalidateQueries({queryKey:pt.collection(s.slug,m,d)});const f=d.toLowerCase().replace(/_/g," ");Je.success(`${f} updated`)},t[1]=s,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}const on="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function an(t){const e=/\/[^/]+\/mcps\/([^/]+)\/([^/]+)\/([^/]+)/,s=t.match(e);return s&&s[1]&&s[2]&&s[3]?{connectionId:decodeURIComponent(s[1]),collectionName:decodeURIComponent(s[2]),itemId:decodeURIComponent(s[3])}:{connectionId:null,collectionName:null,itemId:null}}function rn(t){const e=p.c(2),s=Zt();let o;e[0]!==s.location.pathname?(o=an(s.location.pathname),e[0]=s.location.pathname,e[1]=o):o=e[1];const{connectionId:n,collectionName:a,itemId:i}=o;return`You are an AI assistant running in an MCP Mesh environment.
1
+ import{r as S,c as p,e as Kt,d as st,K as pt,t as Je,j as l,f as He,a as Ce,g as Zt,R as Yt,T as qt,D as Qt,C as Xt,P as Jt,h as es,O as ts,i as ss,k as ns,l as ls,m as as,G as os,U as is,n as rs,S as xt,o as cs,p as ds,N as ms,q as fs,s as gt}from"./index-BVHhSH8M.js";import{E as us}from"./SearchMd-CGUWNVUr.js";import{u as hs,I as it,n as ps}from"./use-connection-DUMeVexv.js";import{u as nt,L as Be}from"./localstorage-keys-BB9xpX5T.js";import{u as ye,T as xs,a as gs,b as bs,c as js,L as rt,i as vs,P as ws,O as Ss}from"./tooltip-DiQ9SlNX.js";import{B as Y,c as M}from"./button-DMnSM5FV.js";import{i as et}from"./CpuChip02-BkDt7iNK.js";import{i as Ns}from"./Loading01-Dw6V1r3u.js";import{s as Cs}from"./Plus-CQSfshmp.js";import{i as Re}from"./X-CsW5kmRT.js";import{u as ys}from"./use-binding-DQTEUjPl.js";import{C as E,u as ct,a as _s,b as ks,c as dt,d as Is,N as $s,G as Ms,U as zs,T as Ts,M as Os}from"./thread-history-popover-DTmh-wTW.js";import{E as lt}from"./error-boundary-CUq8HVcH.js";import{u as Es,G as As,R as bt,a as Ps,b as Ds}from"./resizable-DpISfhV6.js";import{i as Ls}from"./File06-BdMasDPT.js";import{u as _e}from"./use-mobile-C2teUdDI.js";import{u as jt,a as Rs}from"./use-organization-settings-B-bw0Nsb.js";import{C as Hs}from"./create-organization-dialog-lmQ3mepV.js";import{I as Bs}from"./input-C6vwKKeq.js";import{P as Us,a as Gs,b as Ws}from"./popover-BO5GT9tA.js";import{A as Ne}from"./avatar-C45Lgbwv.js";import{c as Vs}from"./Grid01-Bom2qqwm.js";import{D as Fs,a as Ks,b as Zs,c as Ys,u as qs,d as Qs}from"./responsive-select-BZGantuu.js";import{D as Xs,a as Js,b as en,c as tn,d as mt}from"./dropdown-menu-gRHakuHp.js";import{a as sn}from"./Copy01-D_YhbDiF.js";import{n as ft}from"./LinkExternal01-LVkx-wZF.js";import{D as vt,a as wt,b as St,c as Nt,d as Ct}from"./dialog-B1fXXmBI.js";import"./useQuery-C3iXPPho.js";import"./auth-D6vm_lfk.js";import"./AlertCircle-CoA9j9_b.js";import"./textarea-Dma5FaAA.js";import"./Terminal-CIo_ltVk.js";import"./json-syntax-highlighter-C3W2DACo.js";import"./alert-dialog-rSIOP2OM.js";import"./InfoCircle-BYXT4R1l.js";import"./well-known-mcp-VNRT0JrW.js";import"./generate-id-Dyweu44Y.js";import"./Clock-BGOqsAv_.js";import"./Trash01-BgGiU9JZ.js";import"./use-gateway-pQG4iSzq.js";import"./form-BbwJs-Od.js";import"./spinner-D7to-RHc.js";import"./select-mD7lFwRj.js";import"./ChevronDown-BmUd-Gap.js";const yt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));yt.displayName="BarChart10";const _t=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));_t.displayName="Building02";const kt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));kt.displayName="ChevronSelectorVertical";const It=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));It.displayName="Globe01";const $t=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));$t.displayName="Home02";const Mt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Mt.displayName="LayoutRight";const zt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));zt.displayName="LogOut01";const Tt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Tt.displayName="Mail01";const Ot=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));Ot.displayName="Settings01";const Et=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Et.displayName="UserCircle";const At=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));At.displayName="Users01";const Pt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Pt.displayName="Zap";function at(){const t=p.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Be.decoChatOpen(),t[0]=e):e=t[0];const[s,a]=nt(e,nn);let n;return t[1]!==s||t[2]!==a?(n=[s,a],t[1]=s,t[2]=a,t[3]=n):n=t[3],n}function nn(t){return!!(t??!1)}function ln(){const t=p.c(5),e=Kt(),{org:s}=ye();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[0]=a):a=t[0];const n=st(a);let o;return t[1]!==s||t[2]!==n||t[3]!==e?(o=i=>{const r=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!r||!r[1])return;const d=r[1],m=n.connectionId;if(!m)return;e.invalidateQueries({queryKey:pt.collection(s.slug,m,d)});const f=d.toLowerCase().replace(/_/g," ");Je.success(`${f} updated`)},t[1]=s,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}const an="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function on(t){const e=/\/[^/]+\/mcps\/([^/]+)\/([^/]+)\/([^/]+)/,s=t.match(e);return s&&s[1]&&s[2]&&s[3]?{connectionId:decodeURIComponent(s[1]),collectionName:decodeURIComponent(s[2]),itemId:decodeURIComponent(s[3])}:{connectionId:null,collectionName:null,itemId:null}}function rn(t){const e=p.c(2),s=Zt();let a;e[0]!==s.location.pathname?(a=on(s.location.pathname),e[0]=s.location.pathname,e[1]=a):a=e[1];const{connectionId:n,collectionName:o,itemId:i}=a;return`You are an AI assistant running in an MCP Mesh environment.
2
2
 
3
3
  ## About MCP Mesh
4
4
  The Model Context Protocol (MCP) Mesh allows users to connect external Connections and expose their capabilities through Hubs. Each Hub provides access to a curated set of tools from connected Connections.
@@ -11,9 +11,9 @@ The Model Context Protocol (MCP) Mesh allows users to connect external Connectio
11
11
 
12
12
  ## Current Editing Context
13
13
  ${n?`- Connection ID: ${n}`:""}
14
- ${a?`- Collection Name: ${a}`:""}
14
+ ${o?`- Collection Name: ${o}`:""}
15
15
  ${i?`- Item ID: ${i}`:""}
16
16
  ${t?`- Gateway ID: ${t}`:""}
17
17
 
18
18
  Help the user understand and work with this resource.
19
- `}function cn(){const t=p.c(137),{org:e,locator:s}=ye(),{slug:o,id:n}=e,[,a]=ot(),i=He(),{data:c}=Ce.useSession(),r=c?.user,{createThread:d,activeThreadId:m,setActiveThreadId:f,hideThread:u}=ct(),{threads:x,refetch:h}=_s(),v=Es(),g=ks(),b=hs();let j;t[0]!==b?(j={connections:b,binding:"LLMS"},t[0]=b,t[1]=j):j=t[1];const[y]=ys(j),w=!!y,C=v.length>0,N=w&&C;let k;t[2]!==s?(k=Be.chatSelectedModel(s),t[2]=s,t[3]=k):k=t[3];const[z,$]=dt(k,g,mn),[_,A]=dt(`${s}:selected-gateway`,v,dn),P=rn(_?.id),H=ln();let V;t[4]!==d||t[5]!==_?.id?(V=O=>d({id:O.id,title:O.title,gatewayId:_?.id}),t[4]=d,t[5]=_?.id,t[6]=V):V=t[6];let q;t[7]!==m||t[8]!==H||t[9]!==P||t[10]!==V?(q={threadId:m,systemPrompt:P,onToolCall:H,onCreateThread:V},t[7]=m,t[8]=H,t[9]=P,t[10]=V,t[11]=q):q=t[11];const I=Is(q),{inputValue:W,setInputValue:T,branchContext:D,clearBranch:L}=ct(),{isEmpty:B}=I;let U;t[12]!==D||t[13]!==L||t[14]!==f||t[15]!==T?(U=()=>{D&&(f(D.originalThreadId),L(),T(""))},t[12]=D,t[13]=L,t[14]=f,t[15]=T,t[16]=U):U=t[16];const K=U;let ke;t[17]!==m||t[18]!==I||t[19]!==L||t[20]!==_||t[21]!==z||t[22]!==T||t[23]!==r?.image||t[24]!==r?.name?(ke=async O=>{if(!z){Je.error("No model configured");return}if(!_?.id){Je.error("No Hub configured");return}T(""),L();const F={created_at:new Date().toISOString(),thread_id:m,model:{id:z.id,connectionId:z.connectionId,provider:z.provider??void 0,limits:z.limits??void 0},gateway:{id:_.id},user:{avatar:r?.image??void 0,name:r?.name??"you"}};await I.sendMessage(O,F)},t[17]=m,t[18]=I,t[19]=L,t[20]=_,t[21]=z,t[22]=T,t[23]=r?.image,t[24]=r?.name,t[25]=ke):ke=t[25];const G=ke;let Ie;t[26]!==$?(Ie=O=>{$(O)},t[26]=$,t[27]=Ie):Ie=t[27];const Ge=Ie;let $e;t[28]!==A?($e=O=>{A({gatewayId:O})},t[28]=A,t[29]=$e):$e=t[29];const We=$e;if(!N){let O,F;!w&&!C?(O="Connect your providers",F="Connect an LLM provider and create a Hub to unlock AI-powered features."):w?(O="No Hubs configured",F="Create a Hub to expose your MCP tools to the chat."):(O="No model provider connected",F="Connect to a model provider to unlock AI-powered features.");let Ee;t[30]===Symbol.for("react.memo_cache_sentinel")?(Ee=l.jsxs(E.Header.Left,{children:[l.jsx("img",{src:on,alt:"deco chat",className:"size-5 rounded"}),l.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[30]=Ee):Ee=t[30];let ve;t[31]!==a?(ve=()=>a(!1),t[31]=a,t[32]=ve):ve=t[32];let Ae;t[33]===Symbol.for("react.memo_cache_sentinel")?(Ae=l.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=Ae):Ae=t[33];let we;t[34]!==ve?(we=l.jsxs(E.Header,{children:[Ee,l.jsx(E.Header.Right,{children:l.jsx("button",{type:"button",onClick:ve,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Ae})})]}),t[34]=ve,t[35]=we):we=t[35];let Se;t[36]!==b||t[37]!==F||t[38]!==w||t[39]!==i||t[40]!==n||t[41]!==o||t[42]!==O||t[43]!==r?.id?(Se=l.jsx(E.Main,{className:"flex flex-col items-center",children:l.jsx(E.EmptyState,{children:w?l.jsx(us,{title:O,description:F,actions:l.jsx(Y,{variant:"outline",onClick:()=>i({to:"/$org/mcps",params:{org:o},search:{action:"create"}}),children:"Custom Connection"})}):l.jsx($s,{title:O,description:F,orgSlug:o,orgId:n,userId:r?.id??"",allConnections:b,onInstallMcpServer:()=>i({to:"/$org/mcps",params:{org:o},search:{action:"create"}})})})}),t[36]=b,t[37]=F,t[38]=w,t[39]=i,t[40]=n,t[41]=o,t[42]=O,t[43]=r?.id,t[44]=Se):Se=t[44];let Pe;return t[45]!==we||t[46]!==Se?(Pe=l.jsxs(E,{children:[we,Se]}),t[45]=we,t[46]=Se,t[47]=Pe):Pe=t[47],Pe}const Ve=_?.icon,Fe=_?.title||"deco chat";let Me;t[48]===Symbol.for("react.memo_cache_sentinel")?(Me=l.jsx(et,{size:12}),t[48]=Me):Me=t[48];let Q;t[49]!==Fe||t[50]!==Ve?(Q=l.jsx(it,{icon:Ve,name:Fe,size:"xs",fallbackIcon:Me}),t[49]=Fe,t[50]=Ve,t[51]=Q):Q=t[51];const Ke=_?.title||"deco chat";let X;t[52]!==Ke?(X=l.jsx("span",{className:"text-sm font-medium",children:Ke}),t[52]=Ke,t[53]=X):X=t[53];let J;t[54]!==Q||t[55]!==X?(J=l.jsxs(E.Header.Left,{children:[Q,X]}),t[54]=Q,t[55]=X,t[56]=J):J=t[56];let ee;t[57]!==d?(ee=()=>d(),t[57]=d,t[58]=ee):ee=t[58];let ze;t[59]===Symbol.for("react.memo_cache_sentinel")?(ze=l.jsx(Cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[59]=ze):ze=t[59];let te;t[60]!==ee?(te=l.jsx("button",{type:"button",onClick:ee,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:ze}),t[60]=ee,t[61]=te):te=t[61];let se;t[62]!==h?(se=()=>h(),t[62]=h,t[63]=se):se=t[63];let ne;t[64]!==m||t[65]!==u||t[66]!==f||t[67]!==se||t[68]!==x?(ne=l.jsx(Ts,{threads:x,activeThreadId:m,onSelectThread:f,onRemoveThread:u,onOpen:se}),t[64]=m,t[65]=u,t[66]=f,t[67]=se,t[68]=x,t[69]=ne):ne=t[69];let le;t[70]!==a?(le=()=>a(!1),t[70]=a,t[71]=le):le=t[71];let Te;t[72]===Symbol.for("react.memo_cache_sentinel")?(Te=l.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[72]=Te):Te=t[72];let oe;t[73]!==le?(oe=l.jsx("button",{type:"button",onClick:le,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Te}),t[73]=le,t[74]=oe):oe=t[74];let ae;t[75]!==te||t[76]!==ne||t[77]!==oe?(ae=l.jsxs(E.Header.Right,{children:[te,ne,oe]}),t[75]=te,t[76]=ne,t[77]=oe,t[78]=ae):ae=t[78];let ie;t[79]!==J||t[80]!==ae?(ie=l.jsxs(E.Header,{children:[J,ae]}),t[79]=J,t[80]=ae,t[81]=ie):ie=t[81];let re;t[82]!==I.messages||t[83]!==I.status||t[84]!==G||t[85]!==B||t[86]!==_?(re=l.jsx(E.Main,{children:B?l.jsx(E.EmptyState,{children:l.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[l.jsx(it,{icon:_?.icon,name:_?.title||"deco chat",size:"lg",fallbackIcon:l.jsx(et,{size:32}),className:"size-[60px]! rounded-[18px]!"}),l.jsx("h3",{className:"text-xl font-medium text-foreground",children:_?.title||"Ask deco chat"}),l.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:_?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),_?.id&&l.jsx(lt,{fallback:null,children:l.jsx(S.Suspense,{fallback:l.jsx("div",{className:"flex justify-center",children:l.jsx(Ns,{size:20,className:"animate-spin text-muted-foreground"})}),children:l.jsx(Ms,{gatewayId:_.id,onSelect:O=>{G(O.description??O.name)}})})},_.id)]})}):l.jsx(E.Messages,{messages:I.messages,status:I.status,minHeightOffset:240})}),t[82]=I.messages,t[83]=I.status,t[84]=G,t[85]=B,t[86]=_,t[87]=re):re=t[87];let ce;t[88]!==I.error||t[89]!==G?(ce=()=>{I.error&&G(`I encountered this error: ${I.error.message}. Can you help me fix it?`)},t[88]=I.error,t[89]=G,t[90]=ce):ce=t[90];let de;t[91]!==I.clearError||t[92]!==I.error||t[93]!==ce?(de=l.jsx(E.ErrorBanner,{error:I.error,onFixInChat:ce,onDismiss:I.clearError}),t[91]=I.clearError,t[92]=I.error,t[93]=ce,t[94]=de):de=t[94];let me;t[95]!==G?(me=()=>{G("Please continue.")},t[95]=G,t[96]=me):me=t[96];let fe;t[97]!==I.clearFinishReason||t[98]!==I.finishReason||t[99]!==me?(fe=l.jsx(E.FinishReasonWarning,{finishReason:I.finishReason,onContinue:me,onDismiss:I.clearFinishReason}),t[97]=I.clearFinishReason,t[98]=I.finishReason,t[99]=me,t[100]=fe):fe=t[100];let ue;t[101]!==D||t[102]!==L||t[103]!==K||t[104]!==T?(ue=l.jsx(E.BranchPreview,{branchContext:D,clearBranchContext:L,onGoToOriginalMessage:K,setInputValue:T}),t[101]=D,t[102]=L,t[103]=K,t[104]=T,t[105]=ue):ue=t[105];let he;t[106]!==G||t[107]!==W?(he=async()=>{W.trim()&&await G(W.trim())},t[106]=G,t[107]=W,t[108]=he):he=t[108];const Ze=!z||!_?.id,Ye=I.status==="submitted"||I.status==="streaming",qe=z?"Ask anything or @ for context":"Select a model to start chatting",Qe=_?.id;let pe;t[109]!==We||t[110]!==Qe?(pe=l.jsx(As,{selectedGatewayId:Qe,onGatewayChange:We,placeholder:"Hub",variant:"borderless"}),t[109]=We,t[110]=Qe,t[111]=pe):pe=t[111];const Xe=z??void 0;let xe;t[112]!==Ge||t[113]!==Xe?(xe=l.jsx(Os,{selectedModel:Xe,onModelChange:Ge,placeholder:"Model",variant:"borderless"}),t[112]=Ge,t[113]=Xe,t[114]=xe):xe=t[114];let ge;t[115]!==I.messages?(ge=l.jsx(zs,{messages:I.messages}),t[115]=I.messages,t[116]=ge):ge=t[116];let be;t[117]!==I.stop||t[118]!==W||t[119]!==T||t[120]!==he||t[121]!==Ze||t[122]!==Ye||t[123]!==qe||t[124]!==pe||t[125]!==xe||t[126]!==ge?(be=l.jsxs(E.Input,{value:W,onChange:T,onSubmit:he,onStop:I.stop,disabled:Ze,isStreaming:Ye,placeholder:qe,children:[pe,xe,ge]}),t[117]=I.stop,t[118]=W,t[119]=T,t[120]=he,t[121]=Ze,t[122]=Ye,t[123]=qe,t[124]=pe,t[125]=xe,t[126]=ge,t[127]=be):be=t[127];let je;t[128]!==de||t[129]!==fe||t[130]!==ue||t[131]!==be?(je=l.jsx(E.Footer,{children:l.jsxs("div",{className:"flex flex-col gap-2",children:[de,fe,ue,be]})}),t[128]=de,t[129]=fe,t[130]=ue,t[131]=be,t[132]=je):je=t[132];let Oe;return t[133]!==ie||t[134]!==re||t[135]!==je?(Oe=l.jsxs(E,{children:[ie,re,je]}),t[133]=ie,t[134]=re,t[135]=je,t[136]=Oe):Oe=t[136],Oe}function dn(t,e){return t.id===e.gatewayId}function mn(t,e){return t.id===e.id&&t.connectionId===e.connectionId}function fn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(E.Provider,{children:l.jsx(cn,{})}),t[0]=e):e=t[0],e}function un(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=l.jsx(Yt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=o):o=e[3],o}function hn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=l.jsx(Jt,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=o):o=e[3],o}function pn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("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",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx(ts,{"data-slot":"sheet-overlay",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function xn(t){const e=p.c(17);let s,o,n,a;e[0]!==t?({className:o,children:s,side:a,...n}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=a):(s=e[1],o=e[2],n=e[3],a=e[4]);const i=a===void 0?"right":a;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(pn,{}),e[5]=c):c=e[5];const r=i==="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",d=i==="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",m=i==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=i==="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 u;e[6]!==o||e[7]!==r||e[8]!==d||e[9]!==m||e[10]!==f?(u=M("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-300 data-[state=open]:duration-500",r,d,m,f,o),e[6]=o,e[7]=r,e[8]=d,e[9]=m,e[10]=f,e[11]=u):u=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsxs(es,{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:[l.jsx(Re,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=x):x=e[12];let h;return e[13]!==s||e[14]!==n||e[15]!==u?(h=l.jsxs(hn,{children:[c,l.jsxs(Xt,{"data-slot":"sheet-content",className:u,...n,children:[s,x]})]}),e[13]=s,e[14]=n,e[15]=u,e[16]=h):h=e[16],h}function gn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-slot":"sheet-header",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function bn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("text-foreground font-semibold",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx(qt,{"data-slot":"sheet-title",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function jn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("text-muted-foreground text-sm",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx(Qt,{"data-slot":"sheet-description",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function Dt(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-slot":"skeleton",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}const vn="sidebar_state",wn=3600*24*7,Sn="16rem",Nn="18rem",Cn="3rem",yn="b",Lt=S.createContext(null);function at(){const t=S.useContext(Lt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _n(t){const e=p.c(21),{defaultOpen:s,open:o,onOpenChange:n,children:a}=t,i=s===void 0?!0:s,c=_e(),[r,d]=S.useState(!1),[m,f]=S.useState(i),u=o??m;let x;e[0]!==u||e[1]!==n?(x=z=>{const $=typeof z=="function"?z(u):z;n?n($):f($),document.cookie=`${vn}=${$}; path=/; max-age=${wn}`},e[0]=u,e[1]=n,e[2]=x):x=e[2];const h=x;let v;e[3]!==c||e[4]!==h?(v=()=>c?d(In):h(kn),e[3]=c,e[4]=h,e[5]=v):v=e[5];const g=v;let b,j;e[6]!==g?(b=()=>{const z=$=>{if($.key===yn&&($.metaKey||$.ctrlKey)){const _=$.target;if(_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_.isContentEditable)return;$.preventDefault(),g()}};return globalThis.addEventListener("keydown",z),()=>globalThis.removeEventListener("keydown",z)},j=[g],e[6]=g,e[7]=b,e[8]=j):(b=e[7],j=e[8]),S.useEffect(b,j);const y=u?"expanded":"collapsed";let w;e[9]!==c||e[10]!==u||e[11]!==r||e[12]!==h||e[13]!==y||e[14]!==g?(w={state:y,open:u,setOpen:h,isMobile:c,openMobile:r,setOpenMobile:d,toggleSidebar:g},e[9]=c,e[10]=u,e[11]=r,e[12]=h,e[13]=y,e[14]=g,e[15]=w):w=e[15];const C=w;let N;e[16]!==a?(N=l.jsx(gs,{delayDuration:0,children:a}),e[16]=a,e[17]=N):N=e[17];let k;return e[18]!==C||e[19]!==N?(k=l.jsx(Lt.Provider,{value:C,children:N}),e[18]=C,e[19]=N,e[20]=k):k=e[20],k}function kn(t){return!t}function In(t){return!t}function $n(t){const e=p.c(14);let s,o,n,a;e[0]!==t?({className:o,style:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=a):(s=e[1],o=e[2],n=e[3],a=e[4]);let i;e[5]!==a?(i={"--sidebar-width":Sn,"--sidebar-width-icon":Cn,...a},e[5]=a,e[6]=i):i=e[6];const c=i;let r;e[7]!==o?(r=M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",o),e[7]=o,e[8]=r):r=e[8];let d;return e[9]!==s||e[10]!==n||e[11]!==c||e[12]!==r?(d=l.jsx("div",{"data-slot":"sidebar-wrapper",style:c,className:r,...n,children:s}),e[9]=s,e[10]=n,e[11]=c,e[12]=r,e[13]=d):d=e[13],d}function Mn(t){const e=p.c(46);let s,o,n,a,i,c;e[0]!==t?({side:a,variant:i,collapsible:c,className:o,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=a,e[5]=i,e[6]=c):(s=e[1],o=e[2],n=e[3],a=e[4],i=e[5],c=e[6]);const r=a===void 0?"left":a,d=i===void 0?"sidebar":i,m=c===void 0?"offcanvas":c,{isMobile:f,state:u,openMobile:x,setOpenMobile:h}=at();if(m==="none"){let $;e[7]!==o?($=M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[7]=o,e[8]=$):$=e[8];let _;return e[9]!==s||e[10]!==n||e[11]!==$?(_=l.jsx("div",{"data-slot":"sidebar",className:$,...n,children:s}),e[9]=s,e[10]=n,e[11]=$,e[12]=_):_=e[12],_}if(f){let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($={"--sidebar-width":Nn},e[13]=$):$=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=l.jsxs(gn,{className:"sr-only",children:[l.jsx(bn,{children:"Sidebar"}),l.jsx(jn,{children:"Displays the mobile sidebar."})]}),e[14]=_):_=e[14];let A;e[15]!==s?(A=l.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=A):A=e[16];let P;e[17]!==r||e[18]!==A?(P=l.jsxs(xn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:$,side:r,children:[_,A]}),e[17]=r,e[18]=A,e[19]=P):P=e[19];let H;return e[20]!==x||e[21]!==n||e[22]!==h||e[23]!==P?(H=l.jsx(un,{open:x,onOpenChange:h,...n,children:P}),e[20]=x,e[21]=n,e[22]=h,e[23]=P,e[24]=H):H=e[24],H}const v=u==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let b;e[25]!==g?(b=M("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=b):b=e[26];let j;e[27]!==b?(j=l.jsx("div",{"data-slot":"sidebar-gap",className:b}),e[27]=b,e[28]=j):j=e[28];const y=r==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",w=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let C;e[29]!==o||e[30]!==y||e[31]!==w?(C=M("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",y,w,o),e[29]=o,e[30]=y,e[31]=w,e[32]=C):C=e[32];let N;e[33]!==s?(N=l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=N):N=e[34];let k;e[35]!==n||e[36]!==C||e[37]!==N?(k=l.jsx("div",{"data-slot":"sidebar-container",className:C,...n,children:N}),e[35]=n,e[36]=C,e[37]=N,e[38]=k):k=e[38];let z;return e[39]!==r||e[40]!==u||e[41]!==k||e[42]!==v||e[43]!==j||e[44]!==d?(z=l.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":u,"data-collapsible":v,"data-variant":d,"data-side":r,"data-slot":"sidebar",children:[j,k]}),e[39]=r,e[40]=u,e[41]=k,e[42]=v,e[43]=j,e[44]=d,e[45]=z):z=e[45],z}function zn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("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",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("main",{"data-slot":"sidebar-inset",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function Tn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("h-4 m-0! w-full",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-sidebar":"separator",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function On(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function En(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function An(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("w-full text-sm",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function Pn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}function Ue(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=M("group/menu-item relative",s),e[3]=s,e[4]=n):n=e[4];let a;return e[5]!==o||e[6]!==n?(a=l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...o}),e[5]=o,e[6]=n,e[7]=a):a=e[7],a}const Dn=ss("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 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/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Rt(t){const e=p.c(28);let s,o,n,a,i,c,r;e[0]!==t?({asChild:n,isActive:a,variant:i,size:c,tooltip:r,className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=a,e[5]=i,e[6]=c,e[7]=r):(s=e[1],o=e[2],n=e[3],a=e[4],i=e[5],c=e[6],r=e[7]);const d=n===void 0?!1:n,m=a===void 0?!1:a,f=i===void 0?"default":i,u=c===void 0?"default":c,x=d?ns:"button",{isMobile:h,state:v}=at();let g;e[8]!==s||e[9]!==u||e[10]!==f?(g=M(Dn({variant:f,size:u}),s),e[8]=s,e[9]=u,e[10]=f,e[11]=g):g=e[11];let b;e[12]!==x||e[13]!==m||e[14]!==o||e[15]!==u||e[16]!==g?(b=l.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":m,className:g,...o}),e[12]=x,e[13]=m,e[14]=o,e[15]=u,e[16]=g,e[17]=b):b=e[17];const j=b;if(!r)return j;if(typeof r=="string"){let k;e[18]!==r?(k={children:r},e[18]=r,e[19]=k):k=e[19],r=k}let y;e[20]!==j?(y=l.jsx(bs,{asChild:!0,children:j}),e[20]=j,e[21]=y):y=e[21];const w=v!=="collapsed"||h;let C;e[22]!==w||e[23]!==r?(C=l.jsx(xs,{side:"right",align:"center",hidden:w,...r}),e[22]=w,e[23]=r,e[24]=C):C=e[24];let N;return e[25]!==y||e[26]!==C?(N=l.jsxs(js,{children:[y,C]}),e[25]=y,e[26]=C,e[27]=N):N=e[27],N}function Ln(t){const e=p.c(26),{item:s}=t,o=He(),{org:n}=ye(),a=jt(n.id),i=Rs(n.id);let c;e[0]!==i.update||e[1]!==s.url||e[2]!==a?.sidebar_items?(c=async()=>{const w=(a?.sidebar_items||[]).filter(C=>C.url!==s.url);await i.update.mutateAsync({sidebar_items:w})},e[0]=i.update,e[1]=s.url,e[2]=a?.sidebar_items,e[3]=c):c=e[3];const r=c;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=m;let u;e[7]!==s.url||e[8]!==o?(u=()=>{o({to:s.url})},e[7]=s.url,e[8]=o,e[9]=u):u=e[9];const x=s.title;let h;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(h=l.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?l.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):l.jsx(Ls,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=h):h=e[13];let v;e[14]!==s.title?(v=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=v):v=e[15];let g;e[16]!==v?(g=l.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:l.jsx("span",{className:"truncate text-sm w-full capitalize",children:v})}),e[16]=v,e[17]=g):g=e[17];let b;e[18]!==r?(b=l.jsx(Re,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:y=>{y.preventDefault(),y.stopPropagation(),r()}}),e[18]=r,e[19]=b):b=e[19];let j;return e[20]!==s.title||e[21]!==u||e[22]!==h||e[23]!==g||e[24]!==b?(j=l.jsx(Ue,{children:l.jsxs(Rt,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:x,children:[h,g,b]})}),e[20]=s.title,e[21]=u,e[22]=h,e[23]=g,e[24]=b,e[25]=j):j=e[25],j}function Rn(){const t=p.c(4),{org:e}=ye(),o=jt(e.id)?.sidebar_items;if(!o?.length)return null;let n;t[0]!==o?(n=o.map(Hn),t[0]=o,t[1]=n):n=t[1];let a;return t[2]!==n?(a=l.jsx(Ht,{children:n}),t[2]=n,t[3]=a):a=t[3],a}function Hn(t){return l.jsx(Ln,{item:t},t.url)}function ut(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(Ue,{children:l.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:l.jsx(Dt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Ht(t){const e=p.c(4),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(Tn,{className:"my-2 -ml-1"}),e[0]=o):o=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Ue,{children:l.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:l.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=n):n=e[1];let a;return e[2]!==s?(a=l.jsxs(l.Fragment,{children:[o,n,s]}),e[2]=s,e[3]=a):a=e[3],a}function Bn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(S.Suspense,{fallback:l.jsxs(Ht,{children:[l.jsx(ut,{}),l.jsx(ut,{})]}),children:l.jsx(Rn,{})}),t[0]=e):e=t[0],e}function Un(){const t=p.c(48),{locator:e}=ye(),s=He();let o;t[0]!==e?(o=rt.parse(e),t[0]=e,t[1]=o):o=t[1];const{org:n}=o;let a;t[2]!==e?(a=rt.isOrgAdminProject(e),t[2]=e,t[3]=a):a=t[3];const i=a;let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx($t,{}),t[4]=c):c=t[4];let r;t[5]!==s||t[6]!==n?(r={key:"home",label:"Home",icon:c,onClick:()=>s({to:"/$org",params:{org:n}})},t[5]=s,t[6]=n,t[7]=r):r=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(_t,{}),t[8]=d):d=t[8];let m;t[9]!==s||t[10]!==n?(m={key:"store",label:"Store",icon:d,onClick:()=>s({to:"/$org/store",params:{org:n}})},t[9]=s,t[10]=n,t[11]=m):m=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(ps,{}),t[12]=f):f=t[12];let u;t[13]!==s||t[14]!==n?(u={key:"mcps",label:"Connections",icon:f,onClick:()=>s({to:"/$org/mcps",params:{org:n}})},t[13]=s,t[14]=n,t[15]=u):u=t[15];let x;t[16]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx(et,{}),t[16]=x):x=t[16];let h;t[17]!==s||t[18]!==n?(h={key:"gateways",label:"Hubs",icon:x,onClick:()=>s({to:"/$org/gateways",params:{org:n}})},t[17]=s,t[18]=n,t[19]=h):h=t[19];let v;t[20]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Pt,{}),t[20]=v):v=t[20];let g;t[21]!==s||t[22]!==n?(g={key:"workflow",label:"Workflows",icon:v,onClick:()=>s({to:"/$org/workflow",params:{org:n}})},t[21]=s,t[22]=n,t[23]=g):g=t[23];let b;t[24]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(yt,{}),t[24]=b):b=t[24];let j;t[25]!==s||t[26]!==n?(j={key:"monitoring",label:"Monitoring",icon:b,onClick:()=>s({to:"/$org/monitoring",params:{org:n}})},t[25]=s,t[26]=n,t[27]=j):j=t[27];let y;t[28]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(At,{}),t[28]=y):y=t[28];let w;t[29]!==s||t[30]!==n?(w={key:"members",label:"Members",icon:y,onClick:()=>s({to:"/$org/members",params:{org:n}})},t[29]=s,t[30]=n,t[31]=w):w=t[31];let C;t[32]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(Ot,{}),t[32]=C):C=t[32];let N;t[33]!==s||t[34]!==n?(N={key:"settings",label:"Settings",icon:C,onClick:()=>s({to:"/$org/settings",params:{org:n}})},t[33]=s,t[34]=n,t[35]=N):N=t[35];let k;t[36]!==g||t[37]!==j||t[38]!==w||t[39]!==N||t[40]!==r||t[41]!==m||t[42]!==u||t[43]!==h?(k=[r,m,u,h,g,j,w,N],t[36]=g,t[37]=j,t[38]=w,t[39]=N,t[40]=r,t[41]=m,t[42]=u,t[43]=h,t[44]=k):k=t[44];const z=k;let $;return t[45]!==z||t[46]!==i?($=i?z:[],t[45]=z,t[46]=i,t[47]=$):$=t[47],$}function Bt(t){const e=p.c(10),{navigationItems:s,footer:o,additionalContent:n,variant:a,collapsible:i}=t,c=a===void 0?"sidebar":a,r=i===void 0?"icon":i;let d;e[0]!==s?(d=s.map(Gn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==n||e[3]!==d?(m=l.jsx(On,{className:"flex-1 overflow-x-hidden",children:l.jsx(En,{className:"font-medium",children:l.jsx(An,{children:l.jsxs(Pn,{className:"gap-0.5",children:[d,n]})})})}),e[2]=n,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==o||e[7]!==m||e[8]!==c?(f=l.jsxs(Mn,{variant:c,collapsible:r,children:[m,o]}),e[5]=r,e[6]=o,e[7]=m,e[8]=c,e[9]=f):f=e[9],f}function Gn(t){return l.jsx(Ue,{children:l.jsxs(Rt,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[l.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),l.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Bt.Skeleton=function(){return l.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>l.jsx("div",{className:"w-full h-8",children:l.jsx(Dt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Wn(){const t=p.c(3),e=Un();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(l.Fragment,{children:l.jsx(lt,{children:l.jsx(S.Suspense,{fallback:null,children:l.jsx(Bn,{})})})}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=l.jsx(Bt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=o):o=t[2],o}function Vn(t){const e=p.c(12);let s,o,n,a;e[0]!==t?({className:s,orientation:n,decorative:a,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=a):(s=e[1],o=e[2],n=e[3],a=e[4]);const i=n===void 0?"horizontal":n,c=a===void 0?!0:a;let r;e[5]!==s?(r=M("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=r):r=e[6];let d;return e[7]!==c||e[8]!==i||e[9]!==o||e[10]!==r?(d=l.jsx(ls,{"data-slot":"separator-root",decorative:c,orientation:i,className:r,...o}),e[7]=c,e[8]=i,e[9]=o,e[10]=r,e[11]=d):d=e[11],d}const Ut=S.createContext(null);function Fn(){const t=S.useContext(Ut);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Kn(t){const e=p.c(10),{children:s,onItemHover:o}=t,[n,a]=S.useState(null);let i;e[0]!==o?(i=f=>{a(f),o?.(f)},e[0]=o,e[1]=i):i=e[1];const c=i;let r;e[2]!==n||e[3]!==c?(r={hoveredItem:n,setHoveredItem:c},e[2]=n,e[3]=c,e[4]=r):r=e[4];let d;e[5]!==s?(d=l.jsx(Us,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=l.jsx(Ut.Provider,{value:r,children:d}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Zn(t){const e=p.c(6),{children:s,onClick:o}=t;let n;e[0]!==s||e[1]!==o?(n=l.jsx(Y,{variant:"link",className:"p-0.5 h-auto",onClick:o,type:"button",children:s}),e[0]=s,e[1]=o,e[2]=n):n=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(Gs,{asChild:!0,children:l.jsx(Y,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:l.jsx(kt,{size:16,className:"opacity-50"})})}),e[3]=a):a=e[3];let i;return e[4]!==n?(i=l.jsxs("div",{className:"flex items-center gap-1",children:[n,a]}),e[4]=n,e[5]=i):i=e[5],i}function Yn(t){const e=p.c(8),{item:s,fallback:o}=t,n=o===void 0?"":o,a=s?.avatarUrl??"",i=s?.name??n;let c;e[0]!==a||e[1]!==i?(c=l.jsx(Ne,{url:a,fallback:i,size:"xs",objectFit:"contain"}),e[0]=a,e[1]=i,e[2]=c):c=e[2];const r=s?.name??n;let d;e[3]!==r?(d=l.jsx("span",{children:r}),e[3]=r,e[4]=d):d=e[4];let m;return e[5]!==c||e[6]!==d?(m=l.jsxs("div",{className:"flex items-center gap-2",children:[c,d]}),e[5]=c,e[6]=d,e[7]=m):m=e[7],m}function qn(t){const e=p.c(6),{children:s,align:o}=t,n=o===void 0?"start":o,i=S.Children.toArray(s).filter(Qn).length===1?"280px":"480px";let c;e[0]!==i?(c={width:i},e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==n||e[3]!==s||e[4]!==c?(r=l.jsx(Ws,{align:n,className:"p-0 flex items-start",style:c,children:s}),e[2]=n,e[3]=s,e[4]=c,e[5]=r):r=e[5],r}function Qn(t){return S.isValidElement(t)&&(t.type===Wt||t.type===Gt)}function Gt(t){const e=p.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=M("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",o),e[0]=o,e[1]=n):n=e[1];let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}const Wt=Gt;function Xn(t){const e=p.c(6),{placeholder:s,value:o,onChange:n}=t,a=s===void 0?"Search...":s;let i;e[0]!==n?(i=r=>n(r.target.value),e[0]=n,e[1]=i):i=e[1];let c;return e[2]!==a||e[3]!==i||e[4]!==o?(c=l.jsx(Bs,{placeholder:a,value:o,onChange:i,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=a,e[3]=i,e[4]=o,e[5]=c):c=e[5],c}function Jn(t){const e=p.c(6),{children:s,emptyMessage:o}=t,n=o===void 0?"No items found.":o,a=S.Children.count(s)>0;let i;e[0]!==n||e[1]!==a?(i=!a&&l.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:n}),e[0]=n,e[1]=a,e[2]=i):i=e[2];let c;return e[3]!==s||e[4]!==i?(c=l.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[i,s]}),e[3]=s,e[4]=i,e[5]=c):c=e[5],c}function el(t){const e=p.c(15),{item:s,onClick:o,onHover:n,children:a}=t,i=Fn();let c;e[0]!==i||e[1]!==s||e[2]!==n?(c=()=>{i.setHoveredItem(s.slug),n?.(s)},e[0]=i,e[1]=s,e[2]=n,e[3]=c):c=e[3];const r=c;let d;e[4]!==s||e[5]!==o?(d=()=>o(s),e[4]=s,e[5]=o,e[6]=d):d=e[6];let m;e[7]!==a||e[8]!==s.avatarUrl||e[9]!==s.name?(m=a||l.jsxs(l.Fragment,{children:[l.jsx(Ne,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),l.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=a,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==d||e[13]!==m?(f=l.jsx(Y,{onClick:d,onMouseEnter:r,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=r,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function tl(t){const e=p.c(2),{children:s}=t;let o;return e[0]!==s?(o=l.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=o):o=e[1],o}function sl(t){const e=p.c(11),{onClick:s,icon:o,children:n,variant:a}=t,c=(a===void 0?"default":a)==="muted"&&"text-muted-foreground";let r;e[0]!==c?(r=M("w-full justify-start font-normal",c),e[0]=c,e[1]=r):r=e[1];let d;e[2]!==o?(d=o&&l.jsx("span",{className:"[&>svg]:size-4",children:o}),e[2]=o,e[3]=d):d=e[3];let m;e[4]!==n?(m=l.jsx("span",{children:n}),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==m?(f=l.jsxs(Y,{variant:"ghost",size:"sm",className:r,onClick:s,children:[d,m]}),e[6]=s,e[7]=r,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function nl(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(Vn,{}),t[0]=e):e=t[0],e}function ll(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const R=Object.assign(Kn,{Trigger:Zn,CurrentItem:Yn,Content:qn,Panel:Wt,Search:Xn,Items:Jn,Item:el,Actions:tl,Action:sl,Separator:nl,Skeleton:ll});function tt(){const t=p.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=st(e),{data:o}=Ce.useListOrganizations(),n=He();let a;t[1]!==s||t[2]!==o?(a=o?.find(V=>V.slug===s),t[1]=s,t[2]=o,t[3]=a):a=t[3];const i=a,[c,r]=S.useState(""),[d,m]=S.useState(!1);let f,u,x,h,v,g,b,j;if(t[4]!==i||t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==o){const q=(o?(()=>{const B=o.filter(U=>U.name.toLowerCase().includes(c.toLowerCase()));if(s){const U=B.findIndex(K=>K.slug===s);if(U>0){const K=B[U];K&&(B.splice(U,1),B.unshift(K))}}return B})():[]).map(ol);let I;t[17]!==i?(I=i?{slug:i.slug,name:i.name,avatarUrl:i.logo}:void 0,t[17]=i,t[18]=I):I=t[18];const W=I;h=R;let T;t[19]!==n||t[20]!==s?(T=()=>n({to:"/$org",params:{org:s??""}}),t[19]=n,t[20]=s,t[21]=T):T=t[21];let D;t[22]!==W?(D=l.jsx(R.CurrentItem,{item:W}),t[22]=W,t[23]=D):D=t[23],t[24]!==T||t[25]!==D?(j=l.jsx(R.Trigger,{onClick:T,children:D}),t[24]=T,t[25]=D,t[26]=j):j=t[26],x=R.Content,u=R.Panel,t[27]!==c?(b=l.jsx(R.Search,{placeholder:"Search organizations...",value:c,onChange:r}),t[27]=c,t[28]=b):b=t[28],f=R.Items,v="No organizations found.";let L;t[29]!==n?(L=B=>l.jsx(R.Item,{item:B,onClick:U=>n({to:"/$org",params:{org:U.slug}})},B.slug),t[29]=n,t[30]=L):L=t[30],g=q.map(L),t[4]=i,t[5]=n,t[6]=s,t[7]=c,t[8]=o,t[9]=f,t[10]=u,t[11]=x,t[12]=h,t[13]=v,t[14]=g,t[15]=b,t[16]=j}else f=t[9],u=t[10],x=t[11],h=t[12],v=t[13],g=t[14],b=t[15],j=t[16];let y;t[31]!==f||t[32]!==v||t[33]!==g?(y=l.jsx(f,{emptyMessage:v,children:g}),t[31]=f,t[32]=v,t[33]=g,t[34]=y):y=t[34];let w,C;t[35]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx(R.Actions,{children:l.jsx(R.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),C=l.jsx(R.Separator,{}),t[35]=w,t[36]=C):(w=t[35],C=t[36]);let N;t[37]!==n?(N=()=>n({to:"/"}),t[37]=n,t[38]=N):N=t[38];let k;t[39]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(Vs,{}),t[39]=k):k=t[39];let z;t[40]!==N?(z=l.jsx(R.Actions,{children:l.jsx(R.Action,{onClick:N,icon:k,children:"See all organizations"})}),t[40]=N,t[41]=z):z=t[41];let $;t[42]!==u||t[43]!==z||t[44]!==b||t[45]!==y?($=l.jsxs(u,{children:[b,y,w,C,z]}),t[42]=u,t[43]=z,t[44]=b,t[45]=y,t[46]=$):$=t[46];let _;t[47]!==x||t[48]!==$?(_=l.jsx(x,{children:$}),t[47]=x,t[48]=$,t[49]=_):_=t[49];let A;t[50]!==h||t[51]!==_||t[52]!==j?(A=l.jsxs(h,{children:[j,_]}),t[50]=h,t[51]=_,t[52]=j,t[53]=A):A=t[53];let P;t[54]!==d?(P=l.jsx(Hs,{open:d,onOpenChange:m}),t[54]=d,t[55]=P):P=t[55];let H;return t[56]!==A||t[57]!==P?(H=l.jsxs(l.Fragment,{children:[A,P]}),t[56]=A,t[57]=P,t[58]=H):H=t[58],H}function ol(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}tt.Skeleton=R.Skeleton;const Vt=S.createContext({setOpen:()=>{}}),al=()=>S.useContext(Vt),il=t=>{const e=p.c(25);let s,o,n,a,i;e[0]!==t?({children:s,defaultOpen:o,open:a,onOpenChange:n,...i}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=a,e[5]=i):(s=e[1],o=e[2],n=e[3],a=e[4],i=e[5]);const c=o??!1;let r;e[6]!==n||e[7]!==a||e[8]!==c?(r={prop:a,defaultProp:c,onChange:n},e[6]=n,e[7]=a,e[8]=c,e[9]=r):r=e[9];const[d,m]=qs(r);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let u;e[12]!==s||e[13]!==d||e[14]!==i||e[15]!==m?(u=l.jsx(Qs,{open:d,onOpenChange:m,...i,children:s}),e[12]=s,e[13]=d,e[14]=i,e[15]=m,e[16]=u):u=e[16];let x;e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==u?(x=l.jsx(en,{open:d,onOpenChange:m,...i,children:u}),e[17]=d,e[18]=i,e[19]=m,e[20]=u,e[21]=x):x=e[21];let h;return e[22]!==f||e[23]!==x?(h=l.jsx(Vt.Provider,{value:f,children:x}),e[22]=f,e[23]=x,e[24]=h):h=e[24],h},rl=t=>{const{children:e,title:s,...o}=t,n=_e(),{className:a,...i}=o;return n?l.jsxs(Ks,{...i,children:[l.jsx(Zs,{className:"hidden",children:l.jsx(Ys,{children:s})}),l.jsx("div",{className:M("flex flex-col gap-2 p-2 py-4",a),children:e})]}):l.jsx(Js,{...o,children:e})},cl=t=>{const{children:e,...s}=t,{setOpen:o}=al(),n=_e(),{className:a,...i}=s;return n?l.jsx("div",{...i,onClick:c=>{o(!1);const{onClick:r}=i;r?.(c)},className:M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),children:e}):l.jsx(tn,{...s,children:e})},dl=t=>{const e=p.c(7);let s,o;e[0]!==t?({children:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=_e();let a;return e[3]!==s||e[4]!==n||e[5]!==o?(a=n?l.jsx(Fs,{asChild:!0,children:s}):l.jsx(Xs,{...o,children:s}),e[3]=s,e[4]=n,e[5]=o,e[6]=a):a=e[6],a},ml=t=>{const e=p.c(7);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=_e();let a;return e[3]!==s||e[4]!==n||e[5]!==o?(a=n?l.jsx(mt,{className:M(s),...o}):l.jsx(mt,{className:M(s),...o}),e[3]=s,e[4]=n,e[5]=o,e[6]=a):a=e[6],a};function fl(t){const e=p.c(11),{user:s,trigger:o,align:n,children:a}=t,i=n===void 0?"start":n;let c;e[0]!==o||e[1]!==s?(c=o(s),e[0]=o,e[1]=s,e[2]=c):c=e[2];let r;e[3]!==c?(r=l.jsx(dl,{asChild:!0,children:l.jsx("div",{children:c})}),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==i||e[6]!==a?(d=l.jsx(rl,{side:"top",align:i,className:"md:w-[240px]",children:a}),e[5]=i,e[6]=a,e[7]=d):d=e[7];let m;return e[8]!==r||e[9]!==d?(m=l.jsxs(il,{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function ul(t){const e=p.c(8),{children:s,onClick:o,className:n,asChild:a}=t;let i;e[0]!==a||e[1]!==s||e[2]!==o?(i=a?s:l.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:o,children:s}),e[0]=a,e[1]=s,e[2]=o,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==n||e[6]!==i?(c=l.jsx(cl,{asChild:a,className:n,children:i}),e[4]=a,e[5]=n,e[6]=i,e[7]=c):c=e[7],c}function hl(t){const e=p.c(2),{className:s}=t;let o;return e[0]!==s?(o=l.jsx(ml,{className:s}),e[0]=s,e[1]=o):o=e[1],o}function pl(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Z=Object.assign(fl,{Item:ul,Separator:hl,Skeleton:pl});function xl(t){const e=p.c(32),{open:s,onOpenChange:o,user:n,userImage:a}=t,[i,c]=S.useState(!1);let r;e[0]!==n.id?(r=()=>{navigator.clipboard.writeText(n.id),c(!0),setTimeout(()=>c(!1),2e3)},e[0]=n.id,e[1]=r):r=e[1];const d=r;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsxs(vt,{children:[l.jsx(wt,{children:"Profile"}),l.jsx(St,{children:"Your account information"})]}),e[2]=m):m=e[2];const f=n.name||n.email||"U";let u;e[3]!==f||e[4]!==a?(u=l.jsx(Ne,{url:a,fallback:f,shape:"circle",size:"2xl"}),e[3]=f,e[4]=a,e[5]=u):u=e[5];const x=n.name||n.email;let h;e[6]!==x?(h=l.jsx("div",{className:"text-lg font-semibold text-center",children:x}),e[6]=x,e[7]=h):h=e[7];let v;e[8]!==n.email?(v=l.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n.email}),e[8]=n.email,e[9]=v):v=e[9];let g;e[10]!==h||e[11]!==v?(g=l.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[h,v]}),e[10]=h,e[11]=v,e[12]=g):g=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=b):b=e[13];let j;e[14]!==n.id?(j=l.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[b,l.jsx("span",{className:"text-sm font-mono truncate",children:n.id})]}),e[14]=n.id,e[15]=j):j=e[15];let y;e[16]!==i?(y=i?l.jsx(vs,{size:16,className:"text-green-600"}):l.jsx(sn,{size:16,className:"text-muted-foreground"}),e[16]=i,e[17]=y):y=e[17];let w;e[18]!==d||e[19]!==y?(w=l.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:y}),e[18]=d,e[19]=y,e[20]=w):w=e[20];let C;e[21]!==j||e[22]!==w?(C=l.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[j,w]}),e[21]=j,e[22]=w,e[23]=C):C=e[23];let N;e[24]!==C||e[25]!==u||e[26]!==g?(N=l.jsxs(Nt,{className:"sm:max-w-md",children:[m,l.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[u,g,C]})]}),e[24]=C,e[25]=u,e[26]=g,e[27]=N):N=e[27];let k;return e[28]!==o||e[29]!==s||e[30]!==N?(k=l.jsx(Ct,{open:s,onOpenChange:o,children:N}),e[28]=o,e[29]=s,e[30]=N,e[31]=k):k=e[31],k}function gl(t){const e=p.c(5),{open:s,onOpenChange:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs(vt,{children:[l.jsx(wt,{children:"Invitations"}),l.jsx(St,{children:"Your pending organization invitations"})]}),e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsxs(Nt,{className:"sm:max-w-lg",children:[n,l.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:l.jsx(is,{})})]}),e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==s?(i=l.jsx(Ct,{open:s,onOpenChange:o,children:a}),e[2]=o,e[3]=s,e[4]=i):i=e[4],i}function bl(t){const e=p.c(31),{user:s,userImage:o,hasInvites:n,showInvitesItem:a}=t,[i,c]=S.useState(!1),[r,d]=S.useState(!1);let m;e[0]!==n||e[1]!==s.email||e[2]!==s.name||e[3]!==o?(m=()=>l.jsxs("div",{className:"relative",children:[l.jsx(Ne,{url:o,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),n&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=n,e[1]=s.email,e[2]=s.name,e[3]=o,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsxs(Z.Item,{onClick:()=>c(!0),children:[l.jsx(Et,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=f):f=e[5];let u;e[6]!==n||e[7]!==a?(u=a&&l.jsxs(Z.Item,{onClick:()=>d(!0),children:[l.jsx(Tt,{className:"text-muted-foreground",size:18}),"Invitations",n&&l.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=n,e[7]=a,e[8]=u):u=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx(Z.Separator,{}),e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(as,{className:"w-4 h-4 text-muted-foreground"}),e[10]=h):h=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Z.Item,{asChild:!0,children:l.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[h,"decocms/admin",l.jsx(ft,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=v):v=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(It,{className:"text-muted-foreground",size:18}),e[12]=g):g=e[12];let b,j;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(Z.Item,{asChild:!0,children:l.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"Homepage",l.jsx(ft,{size:18,className:"ml-auto text-muted-foreground"})]})}),j=l.jsx(Z.Separator,{}),e[13]=b,e[14]=j):(b=e[13],j=e[14]);let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsxs(Z.Item,{onClick:jl,children:[l.jsx(zt,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=y):y=e[15];let w;e[16]!==m||e[17]!==u||e[18]!==s?(w=l.jsxs(Z,{user:s,trigger:m,align:"end",children:[f,u,x,v,b,j,y]}),e[16]=m,e[17]=u,e[18]=s,e[19]=w):w=e[19];let C;e[20]!==i||e[21]!==s||e[22]!==o?(C=i&&l.jsx(xl,{open:i,onOpenChange:c,user:s,userImage:o}),e[20]=i,e[21]=s,e[22]=o,e[23]=C):C=e[23];let N;e[24]!==r||e[25]!==a?(N=a&&r&&l.jsx(gl,{open:r,onOpenChange:d}),e[24]=r,e[25]=a,e[26]=N):N=e[26];let k;return e[27]!==w||e[28]!==C||e[29]!==N?(k=l.jsxs(l.Fragment,{children:[w,C,N]}),e[27]=w,e[28]=C,e[29]=N,e[30]=k):k=e[30],k}function jl(){return Ce.signOut()}function vl(){const{data:t}=Ce.useSession(),e=S.useContext(os),{data:s}=e.hooks.useListUserInvitations(),n=(s??[]).length>0;if(!t?.user)return l.jsx(Ne,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const a=t.user,i={...a,name:a.name??void 0},c=a.image;return l.jsx(bl,{user:i,userImage:c,hasInvites:n,showInvitesItem:!0})}function wl(t){const e=p.c(6),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(rs,{children:l.jsx(xt,{})}),e[0]=o):o=e[0];let n;e[1]!==s?(n=l.jsx(cs,{children:s}),e[1]=s,e[2]=n):n=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(ds,{children:l.jsx(ms,{to:"/login",replace:!0})}),e[3]=a):a=e[3];let i;return e[4]!==n?(i=l.jsxs(l.Fragment,{children:[o,n,a]}),e[4]=n,e[5]=i):i=e[5],i}function Sl(t){const e=p.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=M("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",o),e[0]=o,e[1]=n):n=e[1];let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}function Nl(t){const e=p.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=M("flex items-center justify-center px-2 h-full border-r border-border",o),e[0]=o,e[1]=n):n=e[1];let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}function Cl(t){const e=p.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=M("flex items-center gap-2 px-2 h-full",o),e[0]=o,e[1]=n):n=e[1];let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}function yl(t){const e=p.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=M("flex items-center gap-2 px-2 h-full flex-1",o),e[0]=o,e[1]=n):n=e[1];let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}function _l(t){const e=p.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=M("flex items-center gap-2 px-2 h-full ml-auto",o),e[0]=o,e[1]=n):n=e[1];let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}function kl(){const t=p.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:l.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:l.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,s,l.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:l.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=o):o=t[2],o}const De=Object.assign(Sl,{Sidebar:Nl,Left:Cl,Center:yl,Right:_l,Skeleton:kl});function Il(){const t=p.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsxs("div",{className:"flex items-center gap-3",children:[e,l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),l.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[s,l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),l.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=o):o=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:l.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[l.jsx(Le,{align:"right",width:"w-3/4"}),l.jsx(Le,{align:"left",width:"w-full",lines:3}),l.jsx(Le,{align:"right",width:"w-2/3"}),l.jsx(Le,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=n):n=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:l.jsx("div",{className:"relative flex-1",children:l.jsxs("div",{className:"space-y-2 p-2",children:[l.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),l.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=a):a=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center gap-1",children:l.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let c;return t[6]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[o,n,l.jsx("div",{className:"px-4 py-4",children:l.jsx("div",{className:"mx-auto w-full max-w-2xl",children:l.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[a,l.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),l.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=c):c=t[6],c}function Le(t){const e=p.c(22),{align:s,width:o,lines:n}=t,a=o===void 0?"w-full":o,i=n===void 0?1:n,c=s==="right"?"flex-row-reverse":"flex-row";let r;e[0]!==c?(r=M("flex w-full gap-4 px-4 py-2",c),e[0]=c,e[1]=r):r=e[1];const d=s==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let m;e[2]!==d?(m=M("flex min-w-0 flex-col gap-2",d),e[2]=d,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const u=s==="right"?"bg-muted":"bg-transparent border border-border/40";let x;e[5]!==u||e[6]!==a?(x=M("min-w-0 rounded-2xl p-4",u,a),e[5]=u,e[6]=a,e[7]=x):x=e[7];let h;e[8]!==i?(h=Array.from({length:i}),e[8]=i,e[9]=h):h=e[9];let v;e[10]!==i||e[11]!==h?(v=l.jsx("div",{className:"space-y-2",children:h.map((y,w)=>l.jsx("div",{className:M("h-3 rounded bg-muted-foreground/20 animate-pulse",w===i-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=i,e[11]=h,e[12]=v):v=e[12];let g;e[13]!==v||e[14]!==x?(g=l.jsx("div",{className:x,children:v}),e[13]=v,e[14]=x,e[15]=g):g=e[15];let b;e[16]!==g||e[17]!==m?(b=l.jsxs("div",{className:m,children:[f,g]}),e[16]=g,e[17]=m,e[18]=b):b=e[18];let j;return e[19]!==b||e[20]!==r?(j=l.jsx("div",{className:r,children:b}),e[19]=b,e[20]=r,e[21]=j):j=e[21],j}function Ft(){const t=p.c(3),{toggleSidebar:e}=at();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(Mt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=l.jsx(l.Fragment,{children:l.jsx(Y,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:s})}),t[1]=e,t[2]=o):o=t[2],o}Ft.Skeleton=function(){return l.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const $l="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function ht(t){const e=p.c(18),{showSidebarToggle:s,showOrgSwitcher:o,showDecoChat:n}=t,a=s===void 0?!1:s,i=o===void 0?!1:o,c=n===void 0?!1:n,[,r]=ot();let d;e[0]!==r?(d=()=>r(Ml),e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==a?(f=a&&l.jsx(De.Sidebar,{children:l.jsx(Ft,{})}),e[2]=a,e[3]=f):f=e[3];let u;e[4]!==i?(u=i&&l.jsx(S.Suspense,{fallback:l.jsx(tt.Skeleton,{}),children:l.jsx(tt,{})}),e[4]=i,e[5]=u):u=e[5];let x;e[6]!==u?(x=l.jsx(De.Left,{children:u}),e[6]=u,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==m?(h=c&&l.jsxs(Y,{size:"sm",variant:"default",onClick:m,children:[l.jsx(Ne,{url:$l,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=c,e[9]=m,e[10]=h):h=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(vl,{}),e[11]=v):v=e[11];let g;e[12]!==h?(g=l.jsxs(De.Right,{className:"gap-2",children:[h,v]}),e[12]=h,e[13]=g):g=e[13];let b;return e[14]!==g||e[15]!==f||e[16]!==x?(b=l.jsxs(De,{children:[f,x,g]}),e[14]=g,e[15]=f,e[16]=x,e[17]=b):b=e[17],b}function Ml(t){return!t}function zl(t){const e=p.c(10),{children:s,className:o}=t,[,n]=S.useTransition();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Be.decoChatPanelWidth(),e[0]=a):a=e[0];const[i,c]=nt(a,30);let r;e[1]!==c?(r=u=>n(()=>c(u)),e[1]=c,e[2]=r):r=e[2];const d=r;let m;e[3]!==o?(m=M("min-w-0",o),e[3]=o,e[4]=m):m=e[4];let f;return e[5]!==i||e[6]!==s||e[7]!==d||e[8]!==m?(f=l.jsx(bt,{defaultSize:i,minSize:20,className:m,onResize:d,children:s}),e[5]=i,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function Tl(t){const e=p.c(5),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Be.sidebarOpen(),e[0]=o):o=e[0];const[n,a]=nt(o,!0);let i;return e[1]!==s||e[2]!==a||e[3]!==n?(i=l.jsx(_n,{open:n,onOpenChange:a,children:s}),e[1]=s,e[2]=a,e[3]=n,e[4]=i):i=e[4],i}function Ol(){const t=p.c(9),[e]=ot();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(bt,{className:"bg-background",children:l.jsx(gt,{})}),t[0]=s):s=t[0];let o;t[1]!==e?(o=l.jsx(Ps,{withHandle:e}),t[1]=e,t[2]=o):o=t[2];const n=e?"max-w-none":"max-w-0";let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(lt,{children:l.jsx(S.Suspense,{fallback:l.jsx(Il,{}),children:l.jsx(fn,{})})}),t[3]=a):a=t[3];let i;t[4]!==n?(i=l.jsx(zl,{className:n,children:a}),t[4]=n,t[5]=i):i=t[5];let c;return t[6]!==o||t[7]!==i?(c=l.jsxs(Ds,{direction:"horizontal",children:[s,o,i]}),t[6]=o,t[7]=i,t[8]=c):c=t[8],c}function El(){const t=p.c(16);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=st(e);let o;t[1]!==s?(o=pt.activeOrganization(s),t[1]=s,t[2]=o):o=t[2];let n;t[3]!==s?(n=async()=>{if(!s)return null;const{data:u}=await Ce.organization.setActive({organizationSlug:s});return{org:u,project:{slug:Ss}}},t[3]=s,t[4]=n):n=t[4];let a;t[5]!==o||t[6]!==n?(a={queryKey:o,queryFn:n,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=o,t[6]=n,t[7]=a):a=t[7];const{data:i}=fs(a);if(!i){let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(ht,{}),t[8]=u):u=t[8];let x;return t[9]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsxs("div",{className:"min-h-screen bg-background",children:[u,l.jsx("div",{className:"pt-12",children:l.jsx(gt,{})})]}),t[9]=x):x=t[9],x}let c;t[10]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(ht,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=c):c=t[10];let r;t[11]===Symbol.for("react.memo_cache_sentinel")?(r={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=r):r=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(Wn,{}),t[12]=d):d=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(Tl,{children:l.jsxs("div",{className:"flex flex-col h-screen",children:[c,l.jsxs($n,{className:"flex-1 bg-sidebar",style:r,children:[d,l.jsx(zn,{className:"pt-12",children:l.jsx(Ol,{})})]})]})}),t[13]=m):m=t[13];let f;return t[14]!==i?(f=l.jsx(ws,{...i,children:m}),t[14]=i,t[15]=f):f=t[15],f}function ko(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(wl,{children:l.jsx(S.Suspense,{fallback:l.jsx(xt,{}),children:l.jsx(El,{})})}),t[0]=e):e=t[0],e}export{ko as default};
19
+ `}function cn(){const t=p.c(137),{org:e,locator:s}=ye(),{slug:a,id:n}=e,[,o]=at(),i=He(),{data:c}=Ce.useSession(),r=c?.user,{createThread:d,activeThreadId:m,setActiveThreadId:f,hideThread:u}=ct(),{threads:x,refetch:h}=_s(),v=Es(),g=ks(),b=hs();let j;t[0]!==b?(j={connections:b,binding:"LLMS"},t[0]=b,t[1]=j):j=t[1];const[y]=ys(j),w=!!y,C=v.length>0,N=w&&C;let k;t[2]!==s?(k=Be.chatSelectedModel(s),t[2]=s,t[3]=k):k=t[3];const[z,$]=dt(k,g,mn),[_,A]=dt(`${s}:selected-gateway`,v,dn),P=rn(_?.id),H=ln();let V;t[4]!==d||t[5]!==_?.id?(V=O=>d({id:O.id,title:O.title,gatewayId:_?.id}),t[4]=d,t[5]=_?.id,t[6]=V):V=t[6];let q;t[7]!==m||t[8]!==H||t[9]!==P||t[10]!==V?(q={threadId:m,systemPrompt:P,onToolCall:H,onCreateThread:V},t[7]=m,t[8]=H,t[9]=P,t[10]=V,t[11]=q):q=t[11];const I=Is(q),{inputValue:W,setInputValue:T,branchContext:D,clearBranch:L}=ct(),{isEmpty:B}=I;let U;t[12]!==D||t[13]!==L||t[14]!==f||t[15]!==T?(U=()=>{D&&(f(D.originalThreadId),L(),T(""))},t[12]=D,t[13]=L,t[14]=f,t[15]=T,t[16]=U):U=t[16];const K=U;let ke;t[17]!==m||t[18]!==I||t[19]!==L||t[20]!==_||t[21]!==z||t[22]!==T||t[23]!==r?.image||t[24]!==r?.name?(ke=async O=>{if(!z){Je.error("No model configured");return}if(!_?.id){Je.error("No Hub configured");return}T(""),L();const F={created_at:new Date().toISOString(),thread_id:m,model:{id:z.id,connectionId:z.connectionId,provider:z.provider??void 0,limits:z.limits??void 0},gateway:{id:_.id},user:{avatar:r?.image??void 0,name:r?.name??"you"}};await I.sendMessage(O,F)},t[17]=m,t[18]=I,t[19]=L,t[20]=_,t[21]=z,t[22]=T,t[23]=r?.image,t[24]=r?.name,t[25]=ke):ke=t[25];const G=ke;let Ie;t[26]!==$?(Ie=O=>{$(O)},t[26]=$,t[27]=Ie):Ie=t[27];const Ge=Ie;let $e;t[28]!==A?($e=O=>{A({gatewayId:O})},t[28]=A,t[29]=$e):$e=t[29];const We=$e;if(!N){let O,F;!w&&!C?(O="Connect your providers",F="Connect an LLM provider and create a Hub to unlock AI-powered features."):w?(O="No Hubs configured",F="Create a Hub to expose your MCP tools to the chat."):(O="No model provider connected",F="Connect to a model provider to unlock AI-powered features.");let Ee;t[30]===Symbol.for("react.memo_cache_sentinel")?(Ee=l.jsxs(E.Header.Left,{children:[l.jsx("img",{src:an,alt:"deco chat",className:"size-5 rounded"}),l.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[30]=Ee):Ee=t[30];let ve;t[31]!==o?(ve=()=>o(!1),t[31]=o,t[32]=ve):ve=t[32];let Ae;t[33]===Symbol.for("react.memo_cache_sentinel")?(Ae=l.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=Ae):Ae=t[33];let we;t[34]!==ve?(we=l.jsxs(E.Header,{children:[Ee,l.jsx(E.Header.Right,{children:l.jsx("button",{type:"button",onClick:ve,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Ae})})]}),t[34]=ve,t[35]=we):we=t[35];let Se;t[36]!==b||t[37]!==F||t[38]!==w||t[39]!==i||t[40]!==n||t[41]!==a||t[42]!==O||t[43]!==r?.id?(Se=l.jsx(E.Main,{className:"flex flex-col items-center",children:l.jsx(E.EmptyState,{children:w?l.jsx(us,{title:O,description:F,actions:l.jsx(Y,{variant:"outline",onClick:()=>i({to:"/$org/mcps",params:{org:a},search:{action:"create"}}),children:"Custom Connection"})}):l.jsx($s,{title:O,description:F,orgSlug:a,orgId:n,userId:r?.id??"",allConnections:b,onInstallMcpServer:()=>i({to:"/$org/mcps",params:{org:a},search:{action:"create"}})})})}),t[36]=b,t[37]=F,t[38]=w,t[39]=i,t[40]=n,t[41]=a,t[42]=O,t[43]=r?.id,t[44]=Se):Se=t[44];let Pe;return t[45]!==we||t[46]!==Se?(Pe=l.jsxs(E,{children:[we,Se]}),t[45]=we,t[46]=Se,t[47]=Pe):Pe=t[47],Pe}const Ve=_?.icon,Fe=_?.title||"deco chat";let Me;t[48]===Symbol.for("react.memo_cache_sentinel")?(Me=l.jsx(et,{size:12}),t[48]=Me):Me=t[48];let Q;t[49]!==Fe||t[50]!==Ve?(Q=l.jsx(it,{icon:Ve,name:Fe,size:"xs",fallbackIcon:Me}),t[49]=Fe,t[50]=Ve,t[51]=Q):Q=t[51];const Ke=_?.title||"deco chat";let X;t[52]!==Ke?(X=l.jsx("span",{className:"text-sm font-medium",children:Ke}),t[52]=Ke,t[53]=X):X=t[53];let J;t[54]!==Q||t[55]!==X?(J=l.jsxs(E.Header.Left,{children:[Q,X]}),t[54]=Q,t[55]=X,t[56]=J):J=t[56];let ee;t[57]!==d?(ee=()=>d(),t[57]=d,t[58]=ee):ee=t[58];let ze;t[59]===Symbol.for("react.memo_cache_sentinel")?(ze=l.jsx(Cs,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[59]=ze):ze=t[59];let te;t[60]!==ee?(te=l.jsx("button",{type:"button",onClick:ee,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:ze}),t[60]=ee,t[61]=te):te=t[61];let se;t[62]!==h?(se=()=>h(),t[62]=h,t[63]=se):se=t[63];let ne;t[64]!==m||t[65]!==u||t[66]!==f||t[67]!==se||t[68]!==x?(ne=l.jsx(Ts,{threads:x,activeThreadId:m,onSelectThread:f,onRemoveThread:u,onOpen:se}),t[64]=m,t[65]=u,t[66]=f,t[67]=se,t[68]=x,t[69]=ne):ne=t[69];let le;t[70]!==o?(le=()=>o(!1),t[70]=o,t[71]=le):le=t[71];let Te;t[72]===Symbol.for("react.memo_cache_sentinel")?(Te=l.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[72]=Te):Te=t[72];let ae;t[73]!==le?(ae=l.jsx("button",{type:"button",onClick:le,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Te}),t[73]=le,t[74]=ae):ae=t[74];let oe;t[75]!==te||t[76]!==ne||t[77]!==ae?(oe=l.jsxs(E.Header.Right,{children:[te,ne,ae]}),t[75]=te,t[76]=ne,t[77]=ae,t[78]=oe):oe=t[78];let ie;t[79]!==J||t[80]!==oe?(ie=l.jsxs(E.Header,{children:[J,oe]}),t[79]=J,t[80]=oe,t[81]=ie):ie=t[81];let re;t[82]!==I.messages||t[83]!==I.status||t[84]!==G||t[85]!==B||t[86]!==_?(re=l.jsx(E.Main,{children:B?l.jsx(E.EmptyState,{children:l.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[l.jsx(it,{icon:_?.icon,name:_?.title||"deco chat",size:"lg",fallbackIcon:l.jsx(et,{size:32}),className:"size-[60px]! rounded-[18px]!"}),l.jsx("h3",{className:"text-xl font-medium text-foreground",children:_?.title||"Ask deco chat"}),l.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:_?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),_?.id&&l.jsx(lt,{fallback:null,children:l.jsx(S.Suspense,{fallback:l.jsx("div",{className:"flex justify-center",children:l.jsx(Ns,{size:20,className:"animate-spin text-muted-foreground"})}),children:l.jsx(Ms,{gatewayId:_.id,onSelect:O=>{G(O.description??O.name)}})})},_.id)]})}):l.jsx(E.Messages,{messages:I.messages,status:I.status,minHeightOffset:240})}),t[82]=I.messages,t[83]=I.status,t[84]=G,t[85]=B,t[86]=_,t[87]=re):re=t[87];let ce;t[88]!==I.error||t[89]!==G?(ce=()=>{I.error&&G(`I encountered this error: ${I.error.message}. Can you help me fix it?`)},t[88]=I.error,t[89]=G,t[90]=ce):ce=t[90];let de;t[91]!==I.clearError||t[92]!==I.error||t[93]!==ce?(de=l.jsx(E.ErrorBanner,{error:I.error,onFixInChat:ce,onDismiss:I.clearError}),t[91]=I.clearError,t[92]=I.error,t[93]=ce,t[94]=de):de=t[94];let me;t[95]!==G?(me=()=>{G("Please continue.")},t[95]=G,t[96]=me):me=t[96];let fe;t[97]!==I.clearFinishReason||t[98]!==I.finishReason||t[99]!==me?(fe=l.jsx(E.FinishReasonWarning,{finishReason:I.finishReason,onContinue:me,onDismiss:I.clearFinishReason}),t[97]=I.clearFinishReason,t[98]=I.finishReason,t[99]=me,t[100]=fe):fe=t[100];let ue;t[101]!==D||t[102]!==L||t[103]!==K||t[104]!==T?(ue=l.jsx(E.BranchPreview,{branchContext:D,clearBranchContext:L,onGoToOriginalMessage:K,setInputValue:T}),t[101]=D,t[102]=L,t[103]=K,t[104]=T,t[105]=ue):ue=t[105];let he;t[106]!==G||t[107]!==W?(he=async()=>{W.trim()&&await G(W.trim())},t[106]=G,t[107]=W,t[108]=he):he=t[108];const Ze=!z||!_?.id,Ye=I.status==="submitted"||I.status==="streaming",qe=z?"Ask anything or @ for context":"Select a model to start chatting",Qe=_?.id;let pe;t[109]!==We||t[110]!==Qe?(pe=l.jsx(As,{selectedGatewayId:Qe,onGatewayChange:We,placeholder:"Hub",variant:"borderless"}),t[109]=We,t[110]=Qe,t[111]=pe):pe=t[111];const Xe=z??void 0;let xe;t[112]!==Ge||t[113]!==Xe?(xe=l.jsx(Os,{selectedModel:Xe,onModelChange:Ge,placeholder:"Model",variant:"borderless"}),t[112]=Ge,t[113]=Xe,t[114]=xe):xe=t[114];let ge;t[115]!==I.messages?(ge=l.jsx(zs,{messages:I.messages}),t[115]=I.messages,t[116]=ge):ge=t[116];let be;t[117]!==I.stop||t[118]!==W||t[119]!==T||t[120]!==he||t[121]!==Ze||t[122]!==Ye||t[123]!==qe||t[124]!==pe||t[125]!==xe||t[126]!==ge?(be=l.jsxs(E.Input,{value:W,onChange:T,onSubmit:he,onStop:I.stop,disabled:Ze,isStreaming:Ye,placeholder:qe,children:[pe,xe,ge]}),t[117]=I.stop,t[118]=W,t[119]=T,t[120]=he,t[121]=Ze,t[122]=Ye,t[123]=qe,t[124]=pe,t[125]=xe,t[126]=ge,t[127]=be):be=t[127];let je;t[128]!==de||t[129]!==fe||t[130]!==ue||t[131]!==be?(je=l.jsx(E.Footer,{children:l.jsxs("div",{className:"flex flex-col gap-2",children:[de,fe,ue,be]})}),t[128]=de,t[129]=fe,t[130]=ue,t[131]=be,t[132]=je):je=t[132];let Oe;return t[133]!==ie||t[134]!==re||t[135]!==je?(Oe=l.jsxs(E,{children:[ie,re,je]}),t[133]=ie,t[134]=re,t[135]=je,t[136]=Oe):Oe=t[136],Oe}function dn(t,e){return t.id===e.gatewayId}function mn(t,e){return t.id===e.id&&t.connectionId===e.connectionId}function fn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(E.Provider,{children:l.jsx(cn,{})}),t[0]=e):e=t[0],e}function un(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=l.jsx(Yt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function hn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=l.jsx(Jt,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function pn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("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",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx(ts,{"data-slot":"sheet-overlay",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function xn(t){const e=p.c(17);let s,a,n,o;e[0]!==t?({className:a,children:s,side:o,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=o):(s=e[1],a=e[2],n=e[3],o=e[4]);const i=o===void 0?"right":o;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(pn,{}),e[5]=c):c=e[5];const r=i==="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",d=i==="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",m=i==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=i==="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 u;e[6]!==a||e[7]!==r||e[8]!==d||e[9]!==m||e[10]!==f?(u=M("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-300 data-[state=open]:duration-500",r,d,m,f,a),e[6]=a,e[7]=r,e[8]=d,e[9]=m,e[10]=f,e[11]=u):u=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsxs(es,{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:[l.jsx(Re,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=x):x=e[12];let h;return e[13]!==s||e[14]!==n||e[15]!==u?(h=l.jsxs(hn,{children:[c,l.jsxs(Xt,{"data-slot":"sheet-content",className:u,...n,children:[s,x]})]}),e[13]=s,e[14]=n,e[15]=u,e[16]=h):h=e[16],h}function gn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("div",{"data-slot":"sheet-header",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function bn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("text-foreground font-semibold",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx(qt,{"data-slot":"sheet-title",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function jn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("text-muted-foreground text-sm",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx(Qt,{"data-slot":"sheet-description",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Dt(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("div",{"data-slot":"skeleton",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}const vn="sidebar_state",wn=3600*24*7,Sn="16rem",Nn="18rem",Cn="3rem",yn="b",Lt=S.createContext(null);function ot(){const t=S.useContext(Lt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _n(t){const e=p.c(21),{defaultOpen:s,open:a,onOpenChange:n,children:o}=t,i=s===void 0?!0:s,c=_e(),[r,d]=S.useState(!1),[m,f]=S.useState(i),u=a??m;let x;e[0]!==u||e[1]!==n?(x=z=>{const $=typeof z=="function"?z(u):z;n?n($):f($),document.cookie=`${vn}=${$}; path=/; max-age=${wn}`},e[0]=u,e[1]=n,e[2]=x):x=e[2];const h=x;let v;e[3]!==c||e[4]!==h?(v=()=>c?d(In):h(kn),e[3]=c,e[4]=h,e[5]=v):v=e[5];const g=v;let b,j;e[6]!==g?(b=()=>{const z=$=>{if($.key===yn&&($.metaKey||$.ctrlKey)){const _=$.target;if(_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_.isContentEditable)return;$.preventDefault(),g()}};return globalThis.addEventListener("keydown",z),()=>globalThis.removeEventListener("keydown",z)},j=[g],e[6]=g,e[7]=b,e[8]=j):(b=e[7],j=e[8]),S.useEffect(b,j);const y=u?"expanded":"collapsed";let w;e[9]!==c||e[10]!==u||e[11]!==r||e[12]!==h||e[13]!==y||e[14]!==g?(w={state:y,open:u,setOpen:h,isMobile:c,openMobile:r,setOpenMobile:d,toggleSidebar:g},e[9]=c,e[10]=u,e[11]=r,e[12]=h,e[13]=y,e[14]=g,e[15]=w):w=e[15];const C=w;let N;e[16]!==o?(N=l.jsx(gs,{delayDuration:0,children:o}),e[16]=o,e[17]=N):N=e[17];let k;return e[18]!==C||e[19]!==N?(k=l.jsx(Lt.Provider,{value:C,children:N}),e[18]=C,e[19]=N,e[20]=k):k=e[20],k}function kn(t){return!t}function In(t){return!t}function $n(t){const e=p.c(14);let s,a,n,o;e[0]!==t?({className:a,style:o,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=o):(s=e[1],a=e[2],n=e[3],o=e[4]);let i;e[5]!==o?(i={"--sidebar-width":Sn,"--sidebar-width-icon":Cn,...o},e[5]=o,e[6]=i):i=e[6];const c=i;let r;e[7]!==a?(r=M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=r):r=e[8];let d;return e[9]!==s||e[10]!==n||e[11]!==c||e[12]!==r?(d=l.jsx("div",{"data-slot":"sidebar-wrapper",style:c,className:r,...n,children:s}),e[9]=s,e[10]=n,e[11]=c,e[12]=r,e[13]=d):d=e[13],d}function Mn(t){const e=p.c(46);let s,a,n,o,i,c;e[0]!==t?({side:o,variant:i,collapsible:c,className:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=o,e[5]=i,e[6]=c):(s=e[1],a=e[2],n=e[3],o=e[4],i=e[5],c=e[6]);const r=o===void 0?"left":o,d=i===void 0?"sidebar":i,m=c===void 0?"offcanvas":c,{isMobile:f,state:u,openMobile:x,setOpenMobile:h}=ot();if(m==="none"){let $;e[7]!==a?($=M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=$):$=e[8];let _;return e[9]!==s||e[10]!==n||e[11]!==$?(_=l.jsx("div",{"data-slot":"sidebar",className:$,...n,children:s}),e[9]=s,e[10]=n,e[11]=$,e[12]=_):_=e[12],_}if(f){let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($={"--sidebar-width":Nn},e[13]=$):$=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_=l.jsxs(gn,{className:"sr-only",children:[l.jsx(bn,{children:"Sidebar"}),l.jsx(jn,{children:"Displays the mobile sidebar."})]}),e[14]=_):_=e[14];let A;e[15]!==s?(A=l.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=A):A=e[16];let P;e[17]!==r||e[18]!==A?(P=l.jsxs(xn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:$,side:r,children:[_,A]}),e[17]=r,e[18]=A,e[19]=P):P=e[19];let H;return e[20]!==x||e[21]!==n||e[22]!==h||e[23]!==P?(H=l.jsx(un,{open:x,onOpenChange:h,...n,children:P}),e[20]=x,e[21]=n,e[22]=h,e[23]=P,e[24]=H):H=e[24],H}const v=u==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let b;e[25]!==g?(b=M("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=b):b=e[26];let j;e[27]!==b?(j=l.jsx("div",{"data-slot":"sidebar-gap",className:b}),e[27]=b,e[28]=j):j=e[28];const y=r==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",w=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let C;e[29]!==a||e[30]!==y||e[31]!==w?(C=M("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",y,w,a),e[29]=a,e[30]=y,e[31]=w,e[32]=C):C=e[32];let N;e[33]!==s?(N=l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=N):N=e[34];let k;e[35]!==n||e[36]!==C||e[37]!==N?(k=l.jsx("div",{"data-slot":"sidebar-container",className:C,...n,children:N}),e[35]=n,e[36]=C,e[37]=N,e[38]=k):k=e[38];let z;return e[39]!==r||e[40]!==u||e[41]!==k||e[42]!==v||e[43]!==j||e[44]!==d?(z=l.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":u,"data-collapsible":v,"data-variant":d,"data-side":r,"data-slot":"sidebar",children:[j,k]}),e[39]=r,e[40]=u,e[41]=k,e[42]=v,e[43]=j,e[44]=d,e[45]=z):z=e[45],z}function zn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("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",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("main",{"data-slot":"sidebar-inset",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Tn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("h-4 m-0! w-full",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("div",{"data-sidebar":"separator",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function On(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function En(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function An(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("w-full text-sm",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Pn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Ue(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=M("group/menu-item relative",s),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}const Dn=ss("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 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/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Rt(t){const e=p.c(28);let s,a,n,o,i,c,r;e[0]!==t?({asChild:n,isActive:o,variant:i,size:c,tooltip:r,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=o,e[5]=i,e[6]=c,e[7]=r):(s=e[1],a=e[2],n=e[3],o=e[4],i=e[5],c=e[6],r=e[7]);const d=n===void 0?!1:n,m=o===void 0?!1:o,f=i===void 0?"default":i,u=c===void 0?"default":c,x=d?ns:"button",{isMobile:h,state:v}=ot();let g;e[8]!==s||e[9]!==u||e[10]!==f?(g=M(Dn({variant:f,size:u}),s),e[8]=s,e[9]=u,e[10]=f,e[11]=g):g=e[11];let b;e[12]!==x||e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==g?(b=l.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":m,className:g,...a}),e[12]=x,e[13]=m,e[14]=a,e[15]=u,e[16]=g,e[17]=b):b=e[17];const j=b;if(!r)return j;if(typeof r=="string"){let k;e[18]!==r?(k={children:r},e[18]=r,e[19]=k):k=e[19],r=k}let y;e[20]!==j?(y=l.jsx(bs,{asChild:!0,children:j}),e[20]=j,e[21]=y):y=e[21];const w=v!=="collapsed"||h;let C;e[22]!==w||e[23]!==r?(C=l.jsx(xs,{side:"right",align:"center",hidden:w,...r}),e[22]=w,e[23]=r,e[24]=C):C=e[24];let N;return e[25]!==y||e[26]!==C?(N=l.jsxs(js,{children:[y,C]}),e[25]=y,e[26]=C,e[27]=N):N=e[27],N}function Ln(t){const e=p.c(26),{item:s}=t,a=He(),{org:n}=ye(),o=jt(n.id),i=Rs(n.id);let c;e[0]!==i.update||e[1]!==s.url||e[2]!==o?.sidebar_items?(c=async()=>{const w=(o?.sidebar_items||[]).filter(C=>C.url!==s.url);await i.update.mutateAsync({sidebar_items:w})},e[0]=i.update,e[1]=s.url,e[2]=o?.sidebar_items,e[3]=c):c=e[3];const r=c;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=m;let u;e[7]!==s.url||e[8]!==a?(u=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=u):u=e[9];const x=s.title;let h;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(h=l.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?l.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):l.jsx(Ls,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=h):h=e[13];let v;e[14]!==s.title?(v=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=v):v=e[15];let g;e[16]!==v?(g=l.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:l.jsx("span",{className:"truncate text-sm w-full capitalize",children:v})}),e[16]=v,e[17]=g):g=e[17];let b;e[18]!==r?(b=l.jsx(Re,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:y=>{y.preventDefault(),y.stopPropagation(),r()}}),e[18]=r,e[19]=b):b=e[19];let j;return e[20]!==s.title||e[21]!==u||e[22]!==h||e[23]!==g||e[24]!==b?(j=l.jsx(Ue,{children:l.jsxs(Rt,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:x,children:[h,g,b]})}),e[20]=s.title,e[21]=u,e[22]=h,e[23]=g,e[24]=b,e[25]=j):j=e[25],j}function Rn(){const t=p.c(4),{org:e}=ye(),a=jt(e.id)?.sidebar_items;if(!a?.length)return null;let n;t[0]!==a?(n=a.map(Hn),t[0]=a,t[1]=n):n=t[1];let o;return t[2]!==n?(o=l.jsx(Ht,{children:n}),t[2]=n,t[3]=o):o=t[3],o}function Hn(t){return l.jsx(Ln,{item:t},t.url)}function ut(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(Ue,{children:l.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:l.jsx(Dt,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Ht(t){const e=p.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(Tn,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Ue,{children:l.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:l.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=n):n=e[1];let o;return e[2]!==s?(o=l.jsxs(l.Fragment,{children:[a,n,s]}),e[2]=s,e[3]=o):o=e[3],o}function Bn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(S.Suspense,{fallback:l.jsxs(Ht,{children:[l.jsx(ut,{}),l.jsx(ut,{})]}),children:l.jsx(Rn,{})}),t[0]=e):e=t[0],e}function Un(){const t=p.c(48),{locator:e}=ye(),s=He();let a;t[0]!==e?(a=rt.parse(e),t[0]=e,t[1]=a):a=t[1];const{org:n}=a;let o;t[2]!==e?(o=rt.isOrgAdminProject(e),t[2]=e,t[3]=o):o=t[3];const i=o;let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx($t,{}),t[4]=c):c=t[4];let r;t[5]!==s||t[6]!==n?(r={key:"home",label:"Home",icon:c,onClick:()=>s({to:"/$org",params:{org:n}})},t[5]=s,t[6]=n,t[7]=r):r=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(_t,{}),t[8]=d):d=t[8];let m;t[9]!==s||t[10]!==n?(m={key:"store",label:"Store",icon:d,onClick:()=>s({to:"/$org/store",params:{org:n}})},t[9]=s,t[10]=n,t[11]=m):m=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx(ps,{}),t[12]=f):f=t[12];let u;t[13]!==s||t[14]!==n?(u={key:"mcps",label:"Connections",icon:f,onClick:()=>s({to:"/$org/mcps",params:{org:n}})},t[13]=s,t[14]=n,t[15]=u):u=t[15];let x;t[16]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx(et,{}),t[16]=x):x=t[16];let h;t[17]!==s||t[18]!==n?(h={key:"gateways",label:"Hubs",icon:x,onClick:()=>s({to:"/$org/gateways",params:{org:n}})},t[17]=s,t[18]=n,t[19]=h):h=t[19];let v;t[20]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Pt,{}),t[20]=v):v=t[20];let g;t[21]!==s||t[22]!==n?(g={key:"workflow",label:"Workflows",icon:v,onClick:()=>s({to:"/$org/workflow",params:{org:n}})},t[21]=s,t[22]=n,t[23]=g):g=t[23];let b;t[24]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(yt,{}),t[24]=b):b=t[24];let j;t[25]!==s||t[26]!==n?(j={key:"monitoring",label:"Monitoring",icon:b,onClick:()=>s({to:"/$org/monitoring",params:{org:n}})},t[25]=s,t[26]=n,t[27]=j):j=t[27];let y;t[28]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(At,{}),t[28]=y):y=t[28];let w;t[29]!==s||t[30]!==n?(w={key:"members",label:"Members",icon:y,onClick:()=>s({to:"/$org/members",params:{org:n}})},t[29]=s,t[30]=n,t[31]=w):w=t[31];let C;t[32]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(Ot,{}),t[32]=C):C=t[32];let N;t[33]!==s||t[34]!==n?(N={key:"settings",label:"Settings",icon:C,onClick:()=>s({to:"/$org/settings",params:{org:n}})},t[33]=s,t[34]=n,t[35]=N):N=t[35];let k;t[36]!==g||t[37]!==j||t[38]!==w||t[39]!==N||t[40]!==r||t[41]!==m||t[42]!==u||t[43]!==h?(k=[r,m,u,h,g,j,w,N],t[36]=g,t[37]=j,t[38]=w,t[39]=N,t[40]=r,t[41]=m,t[42]=u,t[43]=h,t[44]=k):k=t[44];const z=k;let $;return t[45]!==z||t[46]!==i?($=i?z:[],t[45]=z,t[46]=i,t[47]=$):$=t[47],$}function Bt(t){const e=p.c(10),{navigationItems:s,footer:a,additionalContent:n,variant:o,collapsible:i}=t,c=o===void 0?"sidebar":o,r=i===void 0?"icon":i;let d;e[0]!==s?(d=s.map(Gn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==n||e[3]!==d?(m=l.jsx(On,{className:"flex-1 overflow-x-hidden",children:l.jsx(En,{className:"font-medium",children:l.jsx(An,{children:l.jsxs(Pn,{className:"gap-0.5",children:[d,n]})})})}),e[2]=n,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==a||e[7]!==m||e[8]!==c?(f=l.jsxs(Mn,{variant:c,collapsible:r,children:[m,a]}),e[5]=r,e[6]=a,e[7]=m,e[8]=c,e[9]=f):f=e[9],f}function Gn(t){return l.jsx(Ue,{children:l.jsxs(Rt,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[l.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),l.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Bt.Skeleton=function(){return l.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>l.jsx("div",{className:"w-full h-8",children:l.jsx(Dt,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Wn(){const t=p.c(3),e=Un();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(l.Fragment,{children:l.jsx(lt,{children:l.jsx(S.Suspense,{fallback:null,children:l.jsx(Bn,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=l.jsx(Bt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Vn(t){const e=p.c(12);let s,a,n,o;e[0]!==t?({className:s,orientation:n,decorative:o,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=o):(s=e[1],a=e[2],n=e[3],o=e[4]);const i=n===void 0?"horizontal":n,c=o===void 0?!0:o;let r;e[5]!==s?(r=M("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=r):r=e[6];let d;return e[7]!==c||e[8]!==i||e[9]!==a||e[10]!==r?(d=l.jsx(ls,{"data-slot":"separator-root",decorative:c,orientation:i,className:r,...a}),e[7]=c,e[8]=i,e[9]=a,e[10]=r,e[11]=d):d=e[11],d}const Ut=S.createContext(null);function Fn(){const t=S.useContext(Ut);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Kn(t){const e=p.c(10),{children:s,onItemHover:a}=t,[n,o]=S.useState(null);let i;e[0]!==a?(i=f=>{o(f),a?.(f)},e[0]=a,e[1]=i):i=e[1];const c=i;let r;e[2]!==n||e[3]!==c?(r={hoveredItem:n,setHoveredItem:c},e[2]=n,e[3]=c,e[4]=r):r=e[4];let d;e[5]!==s?(d=l.jsx(Us,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=l.jsx(Ut.Provider,{value:r,children:d}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Zn(t){const e=p.c(6),{children:s,onClick:a}=t;let n;e[0]!==s||e[1]!==a?(n=l.jsx(Y,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(Gs,{asChild:!0,children:l.jsx(Y,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:l.jsx(kt,{size:16,className:"opacity-50"})})}),e[3]=o):o=e[3];let i;return e[4]!==n?(i=l.jsxs("div",{className:"flex items-center gap-1",children:[n,o]}),e[4]=n,e[5]=i):i=e[5],i}function Yn(t){const e=p.c(8),{item:s,fallback:a}=t,n=a===void 0?"":a,o=s?.avatarUrl??"",i=s?.name??n;let c;e[0]!==o||e[1]!==i?(c=l.jsx(Ne,{url:o,fallback:i,size:"xs",objectFit:"contain"}),e[0]=o,e[1]=i,e[2]=c):c=e[2];const r=s?.name??n;let d;e[3]!==r?(d=l.jsx("span",{children:r}),e[3]=r,e[4]=d):d=e[4];let m;return e[5]!==c||e[6]!==d?(m=l.jsxs("div",{className:"flex items-center gap-2",children:[c,d]}),e[5]=c,e[6]=d,e[7]=m):m=e[7],m}function qn(t){const e=p.c(6),{children:s,align:a}=t,n=a===void 0?"start":a,i=S.Children.toArray(s).filter(Qn).length===1?"280px":"480px";let c;e[0]!==i?(c={width:i},e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==n||e[3]!==s||e[4]!==c?(r=l.jsx(Ws,{align:n,className:"p-0 flex items-start",style:c,children:s}),e[2]=n,e[3]=s,e[4]=c,e[5]=r):r=e[5],r}function Qn(t){return S.isValidElement(t)&&(t.type===Wt||t.type===Gt)}function Gt(t){const e=p.c(5),{children:s,className:a}=t;let n;e[0]!==a?(n=M("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}const Wt=Gt;function Xn(t){const e=p.c(6),{placeholder:s,value:a,onChange:n}=t,o=s===void 0?"Search...":s;let i;e[0]!==n?(i=r=>n(r.target.value),e[0]=n,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==i||e[4]!==a?(c=l.jsx(Bs,{placeholder:o,value:a,onChange:i,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=o,e[3]=i,e[4]=a,e[5]=c):c=e[5],c}function Jn(t){const e=p.c(6),{children:s,emptyMessage:a}=t,n=a===void 0?"No items found.":a,o=S.Children.count(s)>0;let i;e[0]!==n||e[1]!==o?(i=!o&&l.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:n}),e[0]=n,e[1]=o,e[2]=i):i=e[2];let c;return e[3]!==s||e[4]!==i?(c=l.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[i,s]}),e[3]=s,e[4]=i,e[5]=c):c=e[5],c}function el(t){const e=p.c(15),{item:s,onClick:a,onHover:n,children:o}=t,i=Fn();let c;e[0]!==i||e[1]!==s||e[2]!==n?(c=()=>{i.setHoveredItem(s.slug),n?.(s)},e[0]=i,e[1]=s,e[2]=n,e[3]=c):c=e[3];const r=c;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==o||e[8]!==s.avatarUrl||e[9]!==s.name?(m=o||l.jsxs(l.Fragment,{children:[l.jsx(Ne,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),l.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=o,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==d||e[13]!==m?(f=l.jsx(Y,{onClick:d,onMouseEnter:r,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=r,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function tl(t){const e=p.c(2),{children:s}=t;let a;return e[0]!==s?(a=l.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function sl(t){const e=p.c(11),{onClick:s,icon:a,children:n,variant:o}=t,c=(o===void 0?"default":o)==="muted"&&"text-muted-foreground";let r;e[0]!==c?(r=M("w-full justify-start font-normal",c),e[0]=c,e[1]=r):r=e[1];let d;e[2]!==a?(d=a&&l.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==n?(m=l.jsx("span",{children:n}),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==m?(f=l.jsxs(Y,{variant:"ghost",size:"sm",className:r,onClick:s,children:[d,m]}),e[6]=s,e[7]=r,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function nl(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(Vn,{}),t[0]=e):e=t[0],e}function ll(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const R=Object.assign(Kn,{Trigger:Zn,CurrentItem:Yn,Content:qn,Panel:Wt,Search:Xn,Items:Jn,Item:el,Actions:tl,Action:sl,Separator:nl,Skeleton:ll});function tt(){const t=p.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=st(e),{data:a}=Ce.useListOrganizations(),n=He();let o;t[1]!==s||t[2]!==a?(o=a?.find(V=>V.slug===s),t[1]=s,t[2]=a,t[3]=o):o=t[3];const i=o,[c,r]=S.useState(""),[d,m]=S.useState(!1);let f,u,x,h,v,g,b,j;if(t[4]!==i||t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==a){const q=(a?(()=>{const B=a.filter(U=>U.name.toLowerCase().includes(c.toLowerCase()));if(s){const U=B.findIndex(K=>K.slug===s);if(U>0){const K=B[U];K&&(B.splice(U,1),B.unshift(K))}}return B})():[]).map(al);let I;t[17]!==i?(I=i?{slug:i.slug,name:i.name,avatarUrl:i.logo}:void 0,t[17]=i,t[18]=I):I=t[18];const W=I;h=R;let T;t[19]!==n||t[20]!==s?(T=()=>n({to:"/$org",params:{org:s??""}}),t[19]=n,t[20]=s,t[21]=T):T=t[21];let D;t[22]!==W?(D=l.jsx(R.CurrentItem,{item:W}),t[22]=W,t[23]=D):D=t[23],t[24]!==T||t[25]!==D?(j=l.jsx(R.Trigger,{onClick:T,children:D}),t[24]=T,t[25]=D,t[26]=j):j=t[26],x=R.Content,u=R.Panel,t[27]!==c?(b=l.jsx(R.Search,{placeholder:"Search organizations...",value:c,onChange:r}),t[27]=c,t[28]=b):b=t[28],f=R.Items,v="No organizations found.";let L;t[29]!==n?(L=B=>l.jsx(R.Item,{item:B,onClick:U=>n({to:"/$org",params:{org:U.slug}})},B.slug),t[29]=n,t[30]=L):L=t[30],g=q.map(L),t[4]=i,t[5]=n,t[6]=s,t[7]=c,t[8]=a,t[9]=f,t[10]=u,t[11]=x,t[12]=h,t[13]=v,t[14]=g,t[15]=b,t[16]=j}else f=t[9],u=t[10],x=t[11],h=t[12],v=t[13],g=t[14],b=t[15],j=t[16];let y;t[31]!==f||t[32]!==v||t[33]!==g?(y=l.jsx(f,{emptyMessage:v,children:g}),t[31]=f,t[32]=v,t[33]=g,t[34]=y):y=t[34];let w,C;t[35]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx(R.Actions,{children:l.jsx(R.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),C=l.jsx(R.Separator,{}),t[35]=w,t[36]=C):(w=t[35],C=t[36]);let N;t[37]!==n?(N=()=>n({to:"/"}),t[37]=n,t[38]=N):N=t[38];let k;t[39]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(Vs,{}),t[39]=k):k=t[39];let z;t[40]!==N?(z=l.jsx(R.Actions,{children:l.jsx(R.Action,{onClick:N,icon:k,children:"See all organizations"})}),t[40]=N,t[41]=z):z=t[41];let $;t[42]!==u||t[43]!==z||t[44]!==b||t[45]!==y?($=l.jsxs(u,{children:[b,y,w,C,z]}),t[42]=u,t[43]=z,t[44]=b,t[45]=y,t[46]=$):$=t[46];let _;t[47]!==x||t[48]!==$?(_=l.jsx(x,{children:$}),t[47]=x,t[48]=$,t[49]=_):_=t[49];let A;t[50]!==h||t[51]!==_||t[52]!==j?(A=l.jsxs(h,{children:[j,_]}),t[50]=h,t[51]=_,t[52]=j,t[53]=A):A=t[53];let P;t[54]!==d?(P=l.jsx(Hs,{open:d,onOpenChange:m}),t[54]=d,t[55]=P):P=t[55];let H;return t[56]!==A||t[57]!==P?(H=l.jsxs(l.Fragment,{children:[A,P]}),t[56]=A,t[57]=P,t[58]=H):H=t[58],H}function al(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}tt.Skeleton=R.Skeleton;const Vt=S.createContext({setOpen:()=>{}}),ol=()=>S.useContext(Vt),il=t=>{const e=p.c(25);let s,a,n,o,i;e[0]!==t?({children:s,defaultOpen:a,open:o,onOpenChange:n,...i}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=o,e[5]=i):(s=e[1],a=e[2],n=e[3],o=e[4],i=e[5]);const c=a??!1;let r;e[6]!==n||e[7]!==o||e[8]!==c?(r={prop:o,defaultProp:c,onChange:n},e[6]=n,e[7]=o,e[8]=c,e[9]=r):r=e[9];const[d,m]=qs(r);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let u;e[12]!==s||e[13]!==d||e[14]!==i||e[15]!==m?(u=l.jsx(Qs,{open:d,onOpenChange:m,...i,children:s}),e[12]=s,e[13]=d,e[14]=i,e[15]=m,e[16]=u):u=e[16];let x;e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==u?(x=l.jsx(en,{open:d,onOpenChange:m,...i,children:u}),e[17]=d,e[18]=i,e[19]=m,e[20]=u,e[21]=x):x=e[21];let h;return e[22]!==f||e[23]!==x?(h=l.jsx(Vt.Provider,{value:f,children:x}),e[22]=f,e[23]=x,e[24]=h):h=e[24],h},rl=t=>{const{children:e,title:s,...a}=t,n=_e(),{className:o,...i}=a;return n?l.jsxs(Ks,{...i,children:[l.jsx(Zs,{className:"hidden",children:l.jsx(Ys,{children:s})}),l.jsx("div",{className:M("flex flex-col gap-2 p-2 py-4",o),children:e})]}):l.jsx(Js,{...a,children:e})},cl=t=>{const{children:e,...s}=t,{setOpen:a}=ol(),n=_e(),{className:o,...i}=s;return n?l.jsx("div",{...i,onClick:c=>{a(!1);const{onClick:r}=i;r?.(c)},className:M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),children:e}):l.jsx(tn,{...s,children:e})},dl=t=>{const e=p.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const n=_e();let o;return e[3]!==s||e[4]!==n||e[5]!==a?(o=n?l.jsx(Fs,{asChild:!0,children:s}):l.jsx(Xs,{...a,children:s}),e[3]=s,e[4]=n,e[5]=a,e[6]=o):o=e[6],o},ml=t=>{const e=p.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const n=_e();let o;return e[3]!==s||e[4]!==n||e[5]!==a?(o=n?l.jsx(mt,{className:M(s),...a}):l.jsx(mt,{className:M(s),...a}),e[3]=s,e[4]=n,e[5]=a,e[6]=o):o=e[6],o};function fl(t){const e=p.c(11),{user:s,trigger:a,align:n,children:o}=t,i=n===void 0?"start":n;let c;e[0]!==a||e[1]!==s?(c=a(s),e[0]=a,e[1]=s,e[2]=c):c=e[2];let r;e[3]!==c?(r=l.jsx(dl,{asChild:!0,children:l.jsx("div",{children:c})}),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==i||e[6]!==o?(d=l.jsx(rl,{side:"top",align:i,className:"md:w-[240px]",children:o}),e[5]=i,e[6]=o,e[7]=d):d=e[7];let m;return e[8]!==r||e[9]!==d?(m=l.jsxs(il,{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function ul(t){const e=p.c(8),{children:s,onClick:a,className:n,asChild:o}=t;let i;e[0]!==o||e[1]!==s||e[2]!==a?(i=o?s:l.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=o,e[1]=s,e[2]=a,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==n||e[6]!==i?(c=l.jsx(cl,{asChild:o,className:n,children:i}),e[4]=o,e[5]=n,e[6]=i,e[7]=c):c=e[7],c}function hl(t){const e=p.c(2),{className:s}=t;let a;return e[0]!==s?(a=l.jsx(ml,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function pl(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Z=Object.assign(fl,{Item:ul,Separator:hl,Skeleton:pl});function xl(t){const e=p.c(32),{open:s,onOpenChange:a,user:n,userImage:o}=t,[i,c]=S.useState(!1);let r;e[0]!==n.id?(r=()=>{navigator.clipboard.writeText(n.id),c(!0),setTimeout(()=>c(!1),2e3)},e[0]=n.id,e[1]=r):r=e[1];const d=r;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsxs(vt,{children:[l.jsx(wt,{children:"Profile"}),l.jsx(St,{children:"Your account information"})]}),e[2]=m):m=e[2];const f=n.name||n.email||"U";let u;e[3]!==f||e[4]!==o?(u=l.jsx(Ne,{url:o,fallback:f,shape:"circle",size:"2xl"}),e[3]=f,e[4]=o,e[5]=u):u=e[5];const x=n.name||n.email;let h;e[6]!==x?(h=l.jsx("div",{className:"text-lg font-semibold text-center",children:x}),e[6]=x,e[7]=h):h=e[7];let v;e[8]!==n.email?(v=l.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n.email}),e[8]=n.email,e[9]=v):v=e[9];let g;e[10]!==h||e[11]!==v?(g=l.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[h,v]}),e[10]=h,e[11]=v,e[12]=g):g=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=b):b=e[13];let j;e[14]!==n.id?(j=l.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[b,l.jsx("span",{className:"text-sm font-mono truncate",children:n.id})]}),e[14]=n.id,e[15]=j):j=e[15];let y;e[16]!==i?(y=i?l.jsx(vs,{size:16,className:"text-green-600"}):l.jsx(sn,{size:16,className:"text-muted-foreground"}),e[16]=i,e[17]=y):y=e[17];let w;e[18]!==d||e[19]!==y?(w=l.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:y}),e[18]=d,e[19]=y,e[20]=w):w=e[20];let C;e[21]!==j||e[22]!==w?(C=l.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[j,w]}),e[21]=j,e[22]=w,e[23]=C):C=e[23];let N;e[24]!==C||e[25]!==u||e[26]!==g?(N=l.jsxs(Nt,{className:"sm:max-w-md",children:[m,l.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[u,g,C]})]}),e[24]=C,e[25]=u,e[26]=g,e[27]=N):N=e[27];let k;return e[28]!==a||e[29]!==s||e[30]!==N?(k=l.jsx(Ct,{open:s,onOpenChange:a,children:N}),e[28]=a,e[29]=s,e[30]=N,e[31]=k):k=e[31],k}function gl(t){const e=p.c(5),{open:s,onOpenChange:a}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsxs(vt,{children:[l.jsx(wt,{children:"Invitations"}),l.jsx(St,{children:"Your pending organization invitations"})]}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsxs(Nt,{className:"sm:max-w-lg",children:[n,l.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:l.jsx(is,{})})]}),e[1]=o):o=e[1];let i;return e[2]!==a||e[3]!==s?(i=l.jsx(Ct,{open:s,onOpenChange:a,children:o}),e[2]=a,e[3]=s,e[4]=i):i=e[4],i}function bl(t){const e=p.c(31),{user:s,userImage:a,hasInvites:n,showInvitesItem:o}=t,[i,c]=S.useState(!1),[r,d]=S.useState(!1);let m;e[0]!==n||e[1]!==s.email||e[2]!==s.name||e[3]!==a?(m=()=>l.jsxs("div",{className:"relative",children:[l.jsx(Ne,{url:a,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),n&&l.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=n,e[1]=s.email,e[2]=s.name,e[3]=a,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsxs(Z.Item,{onClick:()=>c(!0),children:[l.jsx(Et,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=f):f=e[5];let u;e[6]!==n||e[7]!==o?(u=o&&l.jsxs(Z.Item,{onClick:()=>d(!0),children:[l.jsx(Tt,{className:"text-muted-foreground",size:18}),"Invitations",n&&l.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=n,e[7]=o,e[8]=u):u=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsx(Z.Separator,{}),e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(os,{className:"w-4 h-4 text-muted-foreground"}),e[10]=h):h=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Z.Item,{asChild:!0,children:l.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[h,"decocms/admin",l.jsx(ft,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=v):v=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx(It,{className:"text-muted-foreground",size:18}),e[12]=g):g=e[12];let b,j;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(Z.Item,{asChild:!0,children:l.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"Homepage",l.jsx(ft,{size:18,className:"ml-auto text-muted-foreground"})]})}),j=l.jsx(Z.Separator,{}),e[13]=b,e[14]=j):(b=e[13],j=e[14]);let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsxs(Z.Item,{onClick:jl,children:[l.jsx(zt,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=y):y=e[15];let w;e[16]!==m||e[17]!==u||e[18]!==s?(w=l.jsxs(Z,{user:s,trigger:m,align:"end",children:[f,u,x,v,b,j,y]}),e[16]=m,e[17]=u,e[18]=s,e[19]=w):w=e[19];let C;e[20]!==i||e[21]!==s||e[22]!==a?(C=i&&l.jsx(xl,{open:i,onOpenChange:c,user:s,userImage:a}),e[20]=i,e[21]=s,e[22]=a,e[23]=C):C=e[23];let N;e[24]!==r||e[25]!==o?(N=o&&r&&l.jsx(gl,{open:r,onOpenChange:d}),e[24]=r,e[25]=o,e[26]=N):N=e[26];let k;return e[27]!==w||e[28]!==C||e[29]!==N?(k=l.jsxs(l.Fragment,{children:[w,C,N]}),e[27]=w,e[28]=C,e[29]=N,e[30]=k):k=e[30],k}function jl(){return Ce.signOut()}function vl(){const{data:t}=Ce.useSession(),e=S.useContext(as),{data:s}=e.hooks.useListUserInvitations(),n=(s??[]).length>0;if(!t?.user)return l.jsx(Ne,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const o=t.user,i={...o,name:o.name??void 0},c=o.image;return l.jsx(bl,{user:i,userImage:c,hasInvites:n,showInvitesItem:!0})}function wl(t){const e=p.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(rs,{children:l.jsx(xt,{})}),e[0]=a):a=e[0];let n;e[1]!==s?(n=l.jsx(cs,{children:s}),e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(ds,{children:l.jsx(ms,{to:"/login",replace:!0})}),e[3]=o):o=e[3];let i;return e[4]!==n?(i=l.jsxs(l.Fragment,{children:[a,n,o]}),e[4]=n,e[5]=i):i=e[5],i}function Sl(t){const e=p.c(5),{children:s,className:a}=t;let n;e[0]!==a?(n=M("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function Nl(t){const e=p.c(5),{children:s,className:a}=t;let n;e[0]!==a?(n=M("flex items-center justify-center px-2 h-full border-r border-border",a),e[0]=a,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function Cl(t){const e=p.c(5),{children:s,className:a}=t;let n;e[0]!==a?(n=M("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function yl(t){const e=p.c(5),{children:s,className:a}=t;let n;e[0]!==a?(n=M("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function _l(t){const e=p.c(5),{children:s,className:a}=t;let n;e[0]!==a?(n=M("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=n):n=e[1];let o;return e[2]!==s||e[3]!==n?(o=l.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=o):o=e[4],o}function kl(){const t=p.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:l.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:l.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,s,l.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:l.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=a):a=t[2],a}const De=Object.assign(Sl,{Sidebar:Nl,Left:Cl,Center:yl,Right:_l,Skeleton:kl});function Il(){const t=p.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsxs("div",{className:"flex items-center gap-3",children:[e,l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),l.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=s):s=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[s,l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),l.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=a):a=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:l.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[l.jsx(Le,{align:"right",width:"w-3/4"}),l.jsx(Le,{align:"left",width:"w-full",lines:3}),l.jsx(Le,{align:"right",width:"w-2/3"}),l.jsx(Le,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=n):n=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:l.jsx("div",{className:"relative flex-1",children:l.jsxs("div",{className:"space-y-2 p-2",children:[l.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),l.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center gap-1",children:l.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let c;return t[6]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[a,n,l.jsx("div",{className:"px-4 py-4",children:l.jsx("div",{className:"mx-auto w-full max-w-2xl",children:l.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[o,l.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),l.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=c):c=t[6],c}function Le(t){const e=p.c(22),{align:s,width:a,lines:n}=t,o=a===void 0?"w-full":a,i=n===void 0?1:n,c=s==="right"?"flex-row-reverse":"flex-row";let r;e[0]!==c?(r=M("flex w-full gap-4 px-4 py-2",c),e[0]=c,e[1]=r):r=e[1];const d=s==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let m;e[2]!==d?(m=M("flex min-w-0 flex-col gap-2",d),e[2]=d,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=l.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const u=s==="right"?"bg-muted":"bg-transparent border border-border/40";let x;e[5]!==u||e[6]!==o?(x=M("min-w-0 rounded-2xl p-4",u,o),e[5]=u,e[6]=o,e[7]=x):x=e[7];let h;e[8]!==i?(h=Array.from({length:i}),e[8]=i,e[9]=h):h=e[9];let v;e[10]!==i||e[11]!==h?(v=l.jsx("div",{className:"space-y-2",children:h.map((y,w)=>l.jsx("div",{className:M("h-3 rounded bg-muted-foreground/20 animate-pulse",w===i-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=i,e[11]=h,e[12]=v):v=e[12];let g;e[13]!==v||e[14]!==x?(g=l.jsx("div",{className:x,children:v}),e[13]=v,e[14]=x,e[15]=g):g=e[15];let b;e[16]!==g||e[17]!==m?(b=l.jsxs("div",{className:m,children:[f,g]}),e[16]=g,e[17]=m,e[18]=b):b=e[18];let j;return e[19]!==b||e[20]!==r?(j=l.jsx("div",{className:r,children:b}),e[19]=b,e[20]=r,e[21]=j):j=e[21],j}function Ft(){const t=p.c(3),{toggleSidebar:e}=ot();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(Mt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=l.jsx(l.Fragment,{children:l.jsx(Y,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:s})}),t[1]=e,t[2]=a):a=t[2],a}Ft.Skeleton=function(){return l.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const $l="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function ht(t){const e=p.c(18),{showSidebarToggle:s,showOrgSwitcher:a,showDecoChat:n}=t,o=s===void 0?!1:s,i=a===void 0?!1:a,c=n===void 0?!1:n,[,r]=at();let d;e[0]!==r?(d=()=>r(Ml),e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==o?(f=o&&l.jsx(De.Sidebar,{children:l.jsx(Ft,{})}),e[2]=o,e[3]=f):f=e[3];let u;e[4]!==i?(u=i&&l.jsx(S.Suspense,{fallback:l.jsx(tt.Skeleton,{}),children:l.jsx(tt,{})}),e[4]=i,e[5]=u):u=e[5];let x;e[6]!==u?(x=l.jsx(De.Left,{children:u}),e[6]=u,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==m?(h=c&&l.jsxs(Y,{size:"sm",variant:"default",onClick:m,children:[l.jsx(Ne,{url:$l,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=c,e[9]=m,e[10]=h):h=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(vl,{}),e[11]=v):v=e[11];let g;e[12]!==h?(g=l.jsxs(De.Right,{className:"gap-2",children:[h,v]}),e[12]=h,e[13]=g):g=e[13];let b;return e[14]!==g||e[15]!==f||e[16]!==x?(b=l.jsxs(De,{children:[f,x,g]}),e[14]=g,e[15]=f,e[16]=x,e[17]=b):b=e[17],b}function Ml(t){return!t}function zl(t){const e=p.c(10),{children:s,className:a}=t,[,n]=S.useTransition();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Be.decoChatPanelWidth(),e[0]=o):o=e[0];const[i,c]=nt(o,30);let r;e[1]!==c?(r=u=>n(()=>c(u)),e[1]=c,e[2]=r):r=e[2];const d=r;let m;e[3]!==a?(m=M("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let f;return e[5]!==i||e[6]!==s||e[7]!==d||e[8]!==m?(f=l.jsx(bt,{defaultSize:i,minSize:20,className:m,onResize:d,children:s}),e[5]=i,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function Tl(t){const e=p.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Be.sidebarOpen(),e[0]=a):a=e[0];const[n,o]=nt(a,!0);let i;return e[1]!==s||e[2]!==o||e[3]!==n?(i=l.jsx(_n,{open:n,onOpenChange:o,children:s}),e[1]=s,e[2]=o,e[3]=n,e[4]=i):i=e[4],i}function Ol(){const t=p.c(9),[e]=at();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(bt,{className:"bg-background",children:l.jsx(gt,{})}),t[0]=s):s=t[0];let a;t[1]!==e?(a=l.jsx(Ps,{withHandle:e}),t[1]=e,t[2]=a):a=t[2];const n=e?"max-w-none":"max-w-0";let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(lt,{children:l.jsx(S.Suspense,{fallback:l.jsx(Il,{}),children:l.jsx(fn,{})})}),t[3]=o):o=t[3];let i;t[4]!==n?(i=l.jsx(zl,{className:n,children:o}),t[4]=n,t[5]=i):i=t[5];let c;return t[6]!==a||t[7]!==i?(c=l.jsxs(Ds,{direction:"horizontal",children:[s,a,i]}),t[6]=a,t[7]=i,t[8]=c):c=t[8],c}function El(){const t=p.c(16);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=st(e);let a;t[1]!==s?(a=pt.activeOrganization(s),t[1]=s,t[2]=a):a=t[2];let n;t[3]!==s?(n=async()=>{if(!s)return null;const{data:u}=await Ce.organization.setActive({organizationSlug:s});return{org:u,project:{slug:Ss}}},t[3]=s,t[4]=n):n=t[4];let o;t[5]!==a||t[6]!==n?(o={queryKey:a,queryFn:n,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=a,t[6]=n,t[7]=o):o=t[7];const{data:i}=fs(o);if(!i){let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(ht,{}),t[8]=u):u=t[8];let x;return t[9]===Symbol.for("react.memo_cache_sentinel")?(x=l.jsxs("div",{className:"min-h-screen bg-background",children:[u,l.jsx("div",{className:"pt-12",children:l.jsx(gt,{})})]}),t[9]=x):x=t[9],x}let c;t[10]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(ht,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=c):c=t[10];let r;t[11]===Symbol.for("react.memo_cache_sentinel")?(r={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=r):r=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsx(Wn,{}),t[12]=d):d=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=l.jsx(Tl,{children:l.jsxs("div",{className:"flex flex-col h-screen",children:[c,l.jsxs($n,{className:"flex-1 bg-sidebar",style:r,children:[d,l.jsx(zn,{className:"pt-12",children:l.jsx(Ol,{})})]})]})}),t[13]=m):m=t[13];let f;return t[14]!==i?(f=l.jsx(ws,{...i,children:m}),t[14]=i,t[15]=f):f=t[15],f}function ya(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(wl,{children:l.jsx(S.Suspense,{fallback:l.jsx(xt,{}),children:l.jsx(El,{})})}),t[0]=e):e=t[0],e}export{ya as default};
@@ -1 +1 @@
1
- import{c as C,i as d,j as a}from"./index-Ddg6ZSnz.js";import{c as m}from"./button-DGQafcd8.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},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=m(u({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{c as C,i as d,j as a}from"./index-BVHhSH8M.js";import{c as m}from"./button-DMnSM5FV.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},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=m(u({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 +1 @@
1
- import{r as K,c as $,j as s,f as F,K as H,a as G,g as q,s as Y}from"./index-Ddg6ZSnz.js";import{g as Z,a as J}from"./well-known-mcp-VNRT0JrW.js";import{C as Q}from"./collection-header-BTdNES9r.js";import{I as X,b as ee,c as te,a as W,u as se}from"./use-connection-bHHmK9mi.js";import{b as le,T as ie,c as ne,u as V}from"./tooltip-D8OED8cS.js";import{s as oe}from"./slugify-CEUa2lfQ.js";import{n as re}from"./Inbox01-WG7d7KAj.js";import{i as O}from"./Loading01-C25_IOHO.js";import{i as ae,E as ce}from"./SearchMd-BfdAKKpi.js";import{C as me}from"./collection-search-B3tGk-LW.js";import{i as de}from"./Lock01-BrE0URxO.js";import{C as fe}from"./card-CYr6OLlA.js";import{g as ue,f as pe,a as xe}from"./registry-utils-ulDDT0d8.js";import{e as he}from"./app-name-gTETL9So.js";import{u as ge}from"./useSuspenseInfiniteQuery-DbaWYvOU.js";import{d as je,a as ve,b as Ne,c as ye,S as Ce}from"./select-twBCjq69.js";import{s as we}from"./Plus-BICwTwx2.js";import{B as _}from"./button-DGQafcd8.js";import{a as Se}from"./use-binding-DALTy821.js";import{L as be,u as Ie}from"./localstorage-keys-B9p3fxpE.js";import"./collection-display-button-KGOe_g_c.js";import"./dropdown-menu-B9xMQj69.js";import"./Grid01-BGAyn8Yw.js";import"./view-mode-toggle-CKl6PJqr.js";import"./input-B4ervJqC.js";import"./ChevronDown-CzJqGT44.js";import"./auth-q6-9Qro0.js";import"./useQuery-BvjuXhZf.js";const U=({size:t=24,color:e="currentColor",...i})=>K.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},K.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";function Re(t){const e=t.title||t.server.title||t.id||"Unnamed Item",i=t.server.description||null,f=t.server.icons?.[0]?.src||ue(t.server.repository)||null,a=t._meta?.["mcp.mesh"]?.verified??!1,p=t.server.version,r=(t.server.remotes?.length??0)>0;let c=e,l=null;if(e.includes("/")){const n=e.split("/");n.length>=2&&(l=n[0]||null,c=he(e))}if(!l){const n=t._meta?.["mcp.mesh"]?.scopeName,m=t._meta?.["mcp.mesh"]?.appName;n&&m?l=`${n}/${m}`:n&&(l=n)}return{icon:f,scopeName:l,displayName:c,description:i,version:p||null,isVerified:a,canInstall:r}}function Le(t){const e=$.c(39),{icon:i,scopeName:f,displayName:a,description:p,isVerified:o,canInstall:r,onClick:c}=t;let l;e[0]!==a||e[1]!==i?(l=s.jsx(X,{icon:i,name:a,size:"md",className:"shadow-sm"}),e[0]=a,e[1]=i,e[2]=l):l=e[2];let n;e[3]!==a?(n=s.jsx("span",{className:"truncate",children:a}),e[3]=a,e[4]=n):n=e[4];let m;e[5]!==o?(m=o&&s.jsx(U,{size:16,className:"text-success shrink-0"}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==r?(x=!r&&s.jsx(de,{size:16,className:"text-muted-foreground shrink-0"}),e[7]=r,e[8]=x):x=e[8];let j;e[9]!==n||e[10]!==m||e[11]!==x?(j=s.jsx(le,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[n,m,x]})}),e[9]=n,e[10]=m,e[11]=x,e[12]=j):j=e[12];let d;e[13]!==a?(d=s.jsx("p",{children:a}),e[13]=a,e[14]=d):d=e[14];let h;e[15]!==r?(h=!r&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=r,e[16]=h):h=e[16];let g;e[17]!==d||e[18]!==h?(g=s.jsxs(ie,{children:[d,h]}),e[17]=d,e[18]=h,e[19]=g):g=e[19];let y;e[20]!==j||e[21]!==g?(y=s.jsxs(ne,{children:[j,g]}),e[20]=j,e[21]=g,e[22]=y):y=e[22];let C;e[23]!==f?(C=f&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:f}),e[23]=f,e[24]=C):C=e[24];let b;e[25]!==C||e[26]!==y?(b=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[y,C]})}),e[25]=C,e[26]=y,e[27]=b):b=e[27];let w;e[28]!==l||e[29]!==b?(w=s.jsxs("div",{className:"flex gap-3",children:[l,b]}),e[28]=l,e[29]=b,e[30]=w):w=e[30];const I=p||"No description available";let v;e[31]!==I?(v=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:I})}),e[31]=I,e[32]=v):v=e[32];let u;e[33]!==w||e[34]!==v?(u=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[w,v]}),e[33]=w,e[34]=v,e[35]=u):u=e[35];let S;return e[36]!==c||e[37]!==u?(S=s.jsx(fe,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:c,children:u}),e[36]=c,e[37]=u,e[38]=S):S=e[38],S}function B(t){const e=$.c(12),{items:i,title:f,onItemClick:a}=t;if(i.length===0)return null;let p;e[0]!==f?(p=f&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:f})}),e[0]=f,e[1]=p):p=e[1];let o;if(e[2]!==i||e[3]!==a){let l;e[5]!==a?(l=n=>{const m=Re(n);return s.jsx(Le,{...m,onClick:()=>a(n)},n.id)},e[5]=a,e[6]=l):l=e[6],o=i.map(l),e[2]=i,e[3]=a,e[4]=o}else o=e[4];let r;e[7]!==o?(r=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=r):r=e[8];let c;return e[9]!==p||e[10]!==r?(c=s.jsxs("div",{className:"flex flex-col gap-4",children:[p,r]}),e[9]=p,e[10]=r,e[11]=c):c=e[11],c}function ke(t,e){if(!e)return t;const i=e.toLowerCase();return t.filter(f=>(f.name||f.title||"").toLowerCase().includes(i)||(f.description||f.server.description||"").toLowerCase().includes(i))}function Te(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function Ee(t){const e=$.c(32),{items:i,isLoadingMore:f,registryId:a,hasMore:p,onLoadMore:o}=t,r=f===void 0?!1:f,c=p===void 0?!1:p,[l,n]=K.useState(""),m=F(),{org:x}=V(),j=K.useRef(null);let d,h,g;e[0]!==i||e[1]!==l?(d=ke(i,l),g=d.filter(Te),h=d.filter(R=>!g.find(L=>L.id===R.id)),e[0]=i,e[1]=l,e[2]=d,e[3]=h,e[4]=g):(d=e[2],h=e[3],g=e[4]);const y=h;let C;e[5]!==m||e[6]!==x.slug||e[7]!==a?(C=R=>{const L=oe(R.name||R.title||R.server.title||""),E=R.server.name;m({to:"/$org/store/$appName",params:{org:x.slug,appName:L},search:{registryId:a,serverName:E}})},e[5]=m,e[6]=x.slug,e[7]=a,e[8]=C):C=e[8];const b=C;let w;e[9]!==c||e[10]!==r||e[11]!==o||e[12]!==l?(w=R=>{if(!c||!o||l||r)return;const L=R.currentTarget;L.scrollHeight-L.scrollTop-L.clientHeight<200&&o()},e[9]=c,e[10]=r,e[11]=o,e[12]=l,e[13]=w):w=e[13];const I=w;let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=R=>{R.key==="Enter"&&n(R.currentTarget.value)},e[14]=v):v=e[14];let u;e[15]!==l?(u=s.jsx(me,{value:l,onChange:n,placeholder:"Search for an MCP Server...",onKeyDown:v}),e[15]=l,e[16]=u):u=e[16];let S;e[17]!==y||e[18]!==d||e[19]!==b||e[20]!==c||e[21]!==r||e[22]!==i.length||e[23]!==l||e[24]!==g?(S=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:i.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):l&&d.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[g.length>0&&s.jsx(B,{items:g,title:"Verified",onItemClick:b}),y.length>0&&s.jsx(B,{items:y,title:g.length>0?"All":"",onItemClick:b}),c&&!l&&r&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(O,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=d,e[19]=b,e[20]=c,e[21]=r,e[22]=i.length,e[23]=l,e[24]=g,e[25]=S):S=e[25];let k;e[26]!==I||e[27]!==S?(k=s.jsx("div",{ref:j,className:"flex-1 overflow-y-auto",onScroll:I,children:S}),e[26]=I,e[27]=S,e[28]=k):k=e[28];let T;return e[29]!==u||e[30]!==k?(T=s.jsxs("div",{className:"flex flex-col h-full",children:[u,k]}),e[29]=u,e[30]=k,e[31]=T):T=e[31],T}const D=24;function Ae(t){const e=$.c(27),{registryId:i}=t,f=ee(i);let a,p,o,r;if(e[0]!==f?.tools||e[1]!==i){if(a=pe(f?.tools),!a)throw new Error("This registry does not support listing store items.");let u;e[6]!==i?(u=te(i),e[6]=i,e[7]=u):u=e[7],r=u,o=ge,p=H.toolCall(i,a,JSON.stringify({limit:D})),e[0]=f?.tools,e[1]=i,e[2]=a,e[3]=p,e[4]=o,e[5]=r}else a=e[2],p=e[3],o=e[4],r=e[5];let c;e[8]!==a||e[9]!==r?(c=async u=>{const{pageParam:S}=u;return await r(a,S?{cursor:S,limit:D}:{limit:D})},e[8]=a,e[9]=r,e[10]=c):c=e[10];let l;e[11]!==p||e[12]!==c?(l={queryKey:p,queryFn:c,initialPageParam:void 0,getNextPageParam:Ke,staleTime:36e5},e[11]=p,e[12]=c,e[13]=l):l=e[13];const{data:n,fetchNextPage:m,hasNextPage:x,isFetchingNextPage:j}=o(l);let d;e:{if(!n?.pages||n.pages.length===0){d=null;break e}const u=n.pages[0];if(typeof u=="object"&&u!==null&&"totalCount"in u&&typeof u.totalCount=="number"){d=u.totalCount;break e}d=null}const h=d,g=n?.pages;let y;e[14]!==g?(y=xe(g),e[14]=g,e[15]=y):y=e[15];const C=y;let b;e[16]!==m||e[17]!==x||e[18]!==j?(b=()=>{x&&!j&&m()},e[16]=m,e[17]=x,e[18]=j,e[19]=b):b=e[19];const w=b,I=x??!1;let v;return e[20]!==C||e[21]!==w||e[22]!==j||e[23]!==i||e[24]!==I||e[25]!==h?(v=s.jsx(Ee,{items:C,isLoadingMore:j,registryId:i,hasMore:I,onLoadMore:w,totalCount:h}),e[20]=C,e[21]=w,e[22]=j,e[23]=i,e[24]=I,e[25]=h,e[26]=v):v=e[26],v}function Ke(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function $e(t){const e=$.c(15),{registries:i,value:f,onValueChange:a,onAddWellKnown:p,wellKnownRegistries:o,placeholder:r}=t,c=r===void 0?"Select a registry...":r;let l;e[0]!==c?(l=s.jsx(ve,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ne,{placeholder:c})}),e[0]=c,e[1]=l):l=e[1];let n;e[2]!==i?(n=i.map(ze),e[2]=i,e[3]=n):n=e[3];let m;e[4]!==p||e[5]!==o?(m=o.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(d=>s.jsxs("button",{onClick:h=>{h.preventDefault(),h.stopPropagation(),p(d)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(we,{size:16})})]},d.id??d.title))]}),e[4]=p,e[5]=o,e[6]=m):m=e[6];let x;e[7]!==n||e[8]!==m?(x=s.jsxs(ye,{children:[n,m]}),e[7]=n,e[8]=m,e[9]=x):x=e[9];let j;return e[10]!==a||e[11]!==l||e[12]!==x||e[13]!==f?(j=s.jsxs(Ce,{value:f,onValueChange:a,children:[l,x]}),e[10]=a,e[11]=l,e[12]=x,e[13]=f,e[14]=j):j=e[14],j}function ze(t){return s.jsx(je,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function Pe({registries:t,onConnected:e}){const i=W(),{org:{slug:f}}=V(),{data:a}=G.useSession(),p=F(),[o,r]=K.useState(!1),c=t[0],l=async()=>{if(!(!c||!a?.user?.id)){r(!0);try{const m=await i.create.mutateAsync(c);e?.(m.id)}finally{r(!1)}}},n=()=>{p({to:"/$org/mcps",params:{org:f},search:{action:"create"}})};return s.jsx(ce,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(_,{variant:"outline",onClick:l,disabled:o||!c,children:[c?.icon&&s.jsx("img",{src:c.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),s.jsx(_,{variant:"outline",onClick:n,children:"Custom Connection"})]})})}function pt(){const t=$.c(41),{org:e}=V(),i=se(),f=W(),a=q(),p=a.location.pathname.includes("/store/")&&a.location.pathname.split("/").length>3,o=Se(i);let r;t[0]!==o?(r=o.map(Ve),t[0]=o,t[1]=r):r=t[1];const c=r;let l;t[2]!==e.slug?(l=be.selectedRegistry(e.slug),t[2]=e.slug,t[3]=l):l=t[3];const[n,m]=Ie(l,De);let x;if(t[4]!==o||t[5]!==n){let N;t[7]!==n?(N=M=>M.id===n,t[7]=n,t[8]=N):N=t[8],x=o.find(N),t[4]=o,t[5]=n,t[6]=x}else x=t[6];const d=x?.id||o[0]?.id||"";let h;t[9]!==e.id?(h=Z(e.id),t[9]=e.id,t[10]=h):h=t[10];let g;t[11]!==h?(g=[h],t[11]=h,t[12]=g):g=t[12];const y=g;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[J()],t[13]=C):C=t[13];const b=C;let w;t[14]!==f.create||t[15]!==m?(w=async N=>{const M=await f.create.mutateAsync(N);m(M.id)},t[14]=f.create,t[15]=m,t[16]=w):w=t[16];const I=w;let v;t[17]!==o?(v=new Set(o.map(Me)),t[17]=o,t[18]=v):v=t[18];const u=v;let S;t[19]!==u||t[20]!==y?(S=y.filter(N=>N.id&&!u.has(N.id)),t[19]=u,t[20]=y,t[21]=S):S=t[21];const k=S;let T;t[22]!==u?(T=b.filter(N=>N.id&&!u.has(N.id)),t[22]=u,t[23]=T):T=t[23];const R=T;if(p){let N;return t[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Y,{}),t[24]=N):N=t[24],N}let L;t[25]!==I?(L=async N=>I(N),t[25]=I,t[26]=L):L=t[26];let E;t[27]!==k||t[28]!==d||t[29]!==c||t[30]!==m||t[31]!==L?(E=s.jsx(Q,{title:"Store",ctaButton:s.jsx($e,{wellKnownRegistries:k,registries:c,value:d,onValueChange:m,onAddWellKnown:L,placeholder:"Select store..."})}),t[27]=k,t[28]=d,t[29]=c,t[30]=m,t[31]=L,t[32]=E):E=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(O,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=z):z=t[33];let A;t[34]!==R||t[35]!==d||t[36]!==m?(A=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(K.Suspense,{fallback:z,children:d?s.jsx(Ae,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(Pe,{registries:R,onConnected:N=>{m(N)}})})})}),t[34]=R,t[35]=d,t[36]=m,t[37]=A):A=t[37];let P;return t[38]!==E||t[39]!==A?(P=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[E,A]}),t[38]=E,t[39]=A,t[40]=P):P=t[40],P}function Me(t){return t.id}function De(){return""}function Ve(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{pt as default};
1
+ import{r as K,c as $,j as s,f as F,K as H,a as G,g as q,s as Y}from"./index-BVHhSH8M.js";import{g as Z,a as J}from"./well-known-mcp-VNRT0JrW.js";import{C as Q}from"./collection-header-CqO1LmKH.js";import{I as X,b as ee,c as te,a as W,u as se}from"./use-connection-DUMeVexv.js";import{b as le,T as ie,c as ne,u as V}from"./tooltip-DiQ9SlNX.js";import{s as oe}from"./slugify-CEUa2lfQ.js";import{n as re}from"./Inbox01-Arx8J2Oq.js";import{i as O}from"./Loading01-Dw6V1r3u.js";import{i as ae,E as ce}from"./SearchMd-CGUWNVUr.js";import{C as me}from"./collection-search-BOBOP2ro.js";import{i as de}from"./Lock01-Dw2P1WZh.js";import{C as fe}from"./card-DL_e-uTF.js";import{g as ue,f as pe,a as xe}from"./registry-utils-ulDDT0d8.js";import{e as he}from"./app-name-gTETL9So.js";import{u as ge}from"./useSuspenseInfiniteQuery-WWHYgeeq.js";import{d as je,a as ve,b as Ne,c as ye,S as Ce}from"./select-mD7lFwRj.js";import{s as we}from"./Plus-CQSfshmp.js";import{B as _}from"./button-DMnSM5FV.js";import{a as Se}from"./use-binding-DQTEUjPl.js";import{L as be,u as Ie}from"./localstorage-keys-BB9xpX5T.js";import"./collection-display-button-BbSV76WH.js";import"./dropdown-menu-gRHakuHp.js";import"./Grid01-Bom2qqwm.js";import"./view-mode-toggle-DCDdw_zu.js";import"./input-C6vwKKeq.js";import"./ChevronDown-BmUd-Gap.js";import"./auth-D6vm_lfk.js";import"./useQuery-C3iXPPho.js";const U=({size:t=24,color:e="currentColor",...i})=>K.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},K.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";function Re(t){const e=t.title||t.server.title||t.id||"Unnamed Item",i=t.server.description||null,f=t.server.icons?.[0]?.src||ue(t.server.repository)||null,a=t._meta?.["mcp.mesh"]?.verified??!1,p=t.server.version,r=(t.server.remotes?.length??0)>0;let c=e,l=null;if(e.includes("/")){const n=e.split("/");n.length>=2&&(l=n[0]||null,c=he(e))}if(!l){const n=t._meta?.["mcp.mesh"]?.scopeName,m=t._meta?.["mcp.mesh"]?.appName;n&&m?l=`${n}/${m}`:n&&(l=n)}return{icon:f,scopeName:l,displayName:c,description:i,version:p||null,isVerified:a,canInstall:r}}function Le(t){const e=$.c(39),{icon:i,scopeName:f,displayName:a,description:p,isVerified:o,canInstall:r,onClick:c}=t;let l;e[0]!==a||e[1]!==i?(l=s.jsx(X,{icon:i,name:a,size:"md",className:"shadow-sm"}),e[0]=a,e[1]=i,e[2]=l):l=e[2];let n;e[3]!==a?(n=s.jsx("span",{className:"truncate",children:a}),e[3]=a,e[4]=n):n=e[4];let m;e[5]!==o?(m=o&&s.jsx(U,{size:16,className:"text-success shrink-0"}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==r?(x=!r&&s.jsx(de,{size:16,className:"text-muted-foreground shrink-0"}),e[7]=r,e[8]=x):x=e[8];let j;e[9]!==n||e[10]!==m||e[11]!==x?(j=s.jsx(le,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[n,m,x]})}),e[9]=n,e[10]=m,e[11]=x,e[12]=j):j=e[12];let d;e[13]!==a?(d=s.jsx("p",{children:a}),e[13]=a,e[14]=d):d=e[14];let h;e[15]!==r?(h=!r&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=r,e[16]=h):h=e[16];let g;e[17]!==d||e[18]!==h?(g=s.jsxs(ie,{children:[d,h]}),e[17]=d,e[18]=h,e[19]=g):g=e[19];let y;e[20]!==j||e[21]!==g?(y=s.jsxs(ne,{children:[j,g]}),e[20]=j,e[21]=g,e[22]=y):y=e[22];let C;e[23]!==f?(C=f&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:f}),e[23]=f,e[24]=C):C=e[24];let b;e[25]!==C||e[26]!==y?(b=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[y,C]})}),e[25]=C,e[26]=y,e[27]=b):b=e[27];let w;e[28]!==l||e[29]!==b?(w=s.jsxs("div",{className:"flex gap-3",children:[l,b]}),e[28]=l,e[29]=b,e[30]=w):w=e[30];const I=p||"No description available";let v;e[31]!==I?(v=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:I})}),e[31]=I,e[32]=v):v=e[32];let u;e[33]!==w||e[34]!==v?(u=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[w,v]}),e[33]=w,e[34]=v,e[35]=u):u=e[35];let S;return e[36]!==c||e[37]!==u?(S=s.jsx(fe,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:c,children:u}),e[36]=c,e[37]=u,e[38]=S):S=e[38],S}function B(t){const e=$.c(12),{items:i,title:f,onItemClick:a}=t;if(i.length===0)return null;let p;e[0]!==f?(p=f&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:f})}),e[0]=f,e[1]=p):p=e[1];let o;if(e[2]!==i||e[3]!==a){let l;e[5]!==a?(l=n=>{const m=Re(n);return s.jsx(Le,{...m,onClick:()=>a(n)},n.id)},e[5]=a,e[6]=l):l=e[6],o=i.map(l),e[2]=i,e[3]=a,e[4]=o}else o=e[4];let r;e[7]!==o?(r=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=r):r=e[8];let c;return e[9]!==p||e[10]!==r?(c=s.jsxs("div",{className:"flex flex-col gap-4",children:[p,r]}),e[9]=p,e[10]=r,e[11]=c):c=e[11],c}function ke(t,e){if(!e)return t;const i=e.toLowerCase();return t.filter(f=>(f.name||f.title||"").toLowerCase().includes(i)||(f.description||f.server.description||"").toLowerCase().includes(i))}function Te(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function Ee(t){const e=$.c(32),{items:i,isLoadingMore:f,registryId:a,hasMore:p,onLoadMore:o}=t,r=f===void 0?!1:f,c=p===void 0?!1:p,[l,n]=K.useState(""),m=F(),{org:x}=V(),j=K.useRef(null);let d,h,g;e[0]!==i||e[1]!==l?(d=ke(i,l),g=d.filter(Te),h=d.filter(R=>!g.find(L=>L.id===R.id)),e[0]=i,e[1]=l,e[2]=d,e[3]=h,e[4]=g):(d=e[2],h=e[3],g=e[4]);const y=h;let C;e[5]!==m||e[6]!==x.slug||e[7]!==a?(C=R=>{const L=oe(R.name||R.title||R.server.title||""),E=R.server.name;m({to:"/$org/store/$appName",params:{org:x.slug,appName:L},search:{registryId:a,serverName:E}})},e[5]=m,e[6]=x.slug,e[7]=a,e[8]=C):C=e[8];const b=C;let w;e[9]!==c||e[10]!==r||e[11]!==o||e[12]!==l?(w=R=>{if(!c||!o||l||r)return;const L=R.currentTarget;L.scrollHeight-L.scrollTop-L.clientHeight<200&&o()},e[9]=c,e[10]=r,e[11]=o,e[12]=l,e[13]=w):w=e[13];const I=w;let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=R=>{R.key==="Enter"&&n(R.currentTarget.value)},e[14]=v):v=e[14];let u;e[15]!==l?(u=s.jsx(me,{value:l,onChange:n,placeholder:"Search for an MCP Server...",onKeyDown:v}),e[15]=l,e[16]=u):u=e[16];let S;e[17]!==y||e[18]!==d||e[19]!==b||e[20]!==c||e[21]!==r||e[22]!==i.length||e[23]!==l||e[24]!==g?(S=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:i.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):l&&d.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[g.length>0&&s.jsx(B,{items:g,title:"Verified",onItemClick:b}),y.length>0&&s.jsx(B,{items:y,title:g.length>0?"All":"",onItemClick:b}),c&&!l&&r&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(O,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=d,e[19]=b,e[20]=c,e[21]=r,e[22]=i.length,e[23]=l,e[24]=g,e[25]=S):S=e[25];let k;e[26]!==I||e[27]!==S?(k=s.jsx("div",{ref:j,className:"flex-1 overflow-y-auto",onScroll:I,children:S}),e[26]=I,e[27]=S,e[28]=k):k=e[28];let T;return e[29]!==u||e[30]!==k?(T=s.jsxs("div",{className:"flex flex-col h-full",children:[u,k]}),e[29]=u,e[30]=k,e[31]=T):T=e[31],T}const D=24;function Ae(t){const e=$.c(27),{registryId:i}=t,f=ee(i);let a,p,o,r;if(e[0]!==f?.tools||e[1]!==i){if(a=pe(f?.tools),!a)throw new Error("This registry does not support listing store items.");let u;e[6]!==i?(u=te(i),e[6]=i,e[7]=u):u=e[7],r=u,o=ge,p=H.toolCall(i,a,JSON.stringify({limit:D})),e[0]=f?.tools,e[1]=i,e[2]=a,e[3]=p,e[4]=o,e[5]=r}else a=e[2],p=e[3],o=e[4],r=e[5];let c;e[8]!==a||e[9]!==r?(c=async u=>{const{pageParam:S}=u;return await r(a,S?{cursor:S,limit:D}:{limit:D})},e[8]=a,e[9]=r,e[10]=c):c=e[10];let l;e[11]!==p||e[12]!==c?(l={queryKey:p,queryFn:c,initialPageParam:void 0,getNextPageParam:Ke,staleTime:36e5},e[11]=p,e[12]=c,e[13]=l):l=e[13];const{data:n,fetchNextPage:m,hasNextPage:x,isFetchingNextPage:j}=o(l);let d;e:{if(!n?.pages||n.pages.length===0){d=null;break e}const u=n.pages[0];if(typeof u=="object"&&u!==null&&"totalCount"in u&&typeof u.totalCount=="number"){d=u.totalCount;break e}d=null}const h=d,g=n?.pages;let y;e[14]!==g?(y=xe(g),e[14]=g,e[15]=y):y=e[15];const C=y;let b;e[16]!==m||e[17]!==x||e[18]!==j?(b=()=>{x&&!j&&m()},e[16]=m,e[17]=x,e[18]=j,e[19]=b):b=e[19];const w=b,I=x??!1;let v;return e[20]!==C||e[21]!==w||e[22]!==j||e[23]!==i||e[24]!==I||e[25]!==h?(v=s.jsx(Ee,{items:C,isLoadingMore:j,registryId:i,hasMore:I,onLoadMore:w,totalCount:h}),e[20]=C,e[21]=w,e[22]=j,e[23]=i,e[24]=I,e[25]=h,e[26]=v):v=e[26],v}function Ke(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function $e(t){const e=$.c(15),{registries:i,value:f,onValueChange:a,onAddWellKnown:p,wellKnownRegistries:o,placeholder:r}=t,c=r===void 0?"Select a registry...":r;let l;e[0]!==c?(l=s.jsx(ve,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ne,{placeholder:c})}),e[0]=c,e[1]=l):l=e[1];let n;e[2]!==i?(n=i.map(ze),e[2]=i,e[3]=n):n=e[3];let m;e[4]!==p||e[5]!==o?(m=o.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(d=>s.jsxs("button",{onClick:h=>{h.preventDefault(),h.stopPropagation(),p(d)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(we,{size:16})})]},d.id??d.title))]}),e[4]=p,e[5]=o,e[6]=m):m=e[6];let x;e[7]!==n||e[8]!==m?(x=s.jsxs(ye,{children:[n,m]}),e[7]=n,e[8]=m,e[9]=x):x=e[9];let j;return e[10]!==a||e[11]!==l||e[12]!==x||e[13]!==f?(j=s.jsxs(Ce,{value:f,onValueChange:a,children:[l,x]}),e[10]=a,e[11]=l,e[12]=x,e[13]=f,e[14]=j):j=e[14],j}function ze(t){return s.jsx(je,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function Pe({registries:t,onConnected:e}){const i=W(),{org:{slug:f}}=V(),{data:a}=G.useSession(),p=F(),[o,r]=K.useState(!1),c=t[0],l=async()=>{if(!(!c||!a?.user?.id)){r(!0);try{const m=await i.create.mutateAsync(c);e?.(m.id)}finally{r(!1)}}},n=()=>{p({to:"/$org/mcps",params:{org:f},search:{action:"create"}})};return s.jsx(ce,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(_,{variant:"outline",onClick:l,disabled:o||!c,children:[c?.icon&&s.jsx("img",{src:c.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),s.jsx(_,{variant:"outline",onClick:n,children:"Custom Connection"})]})})}function pt(){const t=$.c(41),{org:e}=V(),i=se(),f=W(),a=q(),p=a.location.pathname.includes("/store/")&&a.location.pathname.split("/").length>3,o=Se(i);let r;t[0]!==o?(r=o.map(Ve),t[0]=o,t[1]=r):r=t[1];const c=r;let l;t[2]!==e.slug?(l=be.selectedRegistry(e.slug),t[2]=e.slug,t[3]=l):l=t[3];const[n,m]=Ie(l,De);let x;if(t[4]!==o||t[5]!==n){let N;t[7]!==n?(N=M=>M.id===n,t[7]=n,t[8]=N):N=t[8],x=o.find(N),t[4]=o,t[5]=n,t[6]=x}else x=t[6];const d=x?.id||o[0]?.id||"";let h;t[9]!==e.id?(h=Z(e.id),t[9]=e.id,t[10]=h):h=t[10];let g;t[11]!==h?(g=[h],t[11]=h,t[12]=g):g=t[12];const y=g;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[J()],t[13]=C):C=t[13];const b=C;let w;t[14]!==f.create||t[15]!==m?(w=async N=>{const M=await f.create.mutateAsync(N);m(M.id)},t[14]=f.create,t[15]=m,t[16]=w):w=t[16];const I=w;let v;t[17]!==o?(v=new Set(o.map(Me)),t[17]=o,t[18]=v):v=t[18];const u=v;let S;t[19]!==u||t[20]!==y?(S=y.filter(N=>N.id&&!u.has(N.id)),t[19]=u,t[20]=y,t[21]=S):S=t[21];const k=S;let T;t[22]!==u?(T=b.filter(N=>N.id&&!u.has(N.id)),t[22]=u,t[23]=T):T=t[23];const R=T;if(p){let N;return t[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Y,{}),t[24]=N):N=t[24],N}let L;t[25]!==I?(L=async N=>I(N),t[25]=I,t[26]=L):L=t[26];let E;t[27]!==k||t[28]!==d||t[29]!==c||t[30]!==m||t[31]!==L?(E=s.jsx(Q,{title:"Store",ctaButton:s.jsx($e,{wellKnownRegistries:k,registries:c,value:d,onValueChange:m,onAddWellKnown:L,placeholder:"Select store..."})}),t[27]=k,t[28]=d,t[29]=c,t[30]=m,t[31]=L,t[32]=E):E=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(O,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=z):z=t[33];let A;t[34]!==R||t[35]!==d||t[36]!==m?(A=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(K.Suspense,{fallback:z,children:d?s.jsx(Ae,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(Pe,{registries:R,onConnected:N=>{m(N)}})})})}),t[34]=R,t[35]=d,t[36]=m,t[37]=A):A=t[37];let P;return t[38]!==E||t[39]!==A?(P=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[E,A]}),t[38]=E,t[39]=A,t[40]=P):P=t[40],P}function Me(t){return t.id}function De(){return""}function Ve(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{pt as default};
@@ -0,0 +1 @@
1
+ import{r as D,c as _,j as s,f as ve,d as Se,b as Ie,a as _e,t as he}from"./index-BVHhSH8M.js";import{i as Le}from"./AlertCircle-CoA9j9_b.js";import{i as je}from"./Loading01-Dw6V1r3u.js";import{B as ie}from"./button-DMnSM5FV.js";import{i as Ae}from"./ArrowLeft-Bu1JR7vY.js";import{I as ye,a as Ee,u as De,b as Me,c as Ue}from"./use-connection-DUMeVexv.js";import{t as Ve}from"./ChevronDown-BmUd-Gap.js";import{s as ge}from"./Plus-CQSfshmp.js";import{b as $e,D as Re,a as ze,c as Be}from"./dropdown-menu-gRHakuHp.js";import{n as be}from"./LinkExternal01-LVkx-wZF.js";import{E as Pe}from"./SearchMd-CGUWNVUr.js";import{T as Ge,R as Fe}from"./tools-list-DJTZFgWM.js";import{R as Oe}from"./resource-tabs-JMDBPJhv.js";import{a as We}from"./use-binding-DQTEUjPl.js";import{u as He}from"./use-tool-call-BwHyofVZ.js";import{u as Ze}from"./use-mcp-CaAgRxkf.js";import{u as Ne}from"./tooltip-DiQ9SlNX.js";import{e as Ke}from"./extract-connection-data-DsJuSGHU.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-BYXT4R1l.js";import"./useQuery-C3iXPPho.js";import"./File06-BdMasDPT.js";import"./collection-display-button-BbSV76WH.js";import"./Grid01-Bom2qqwm.js";import"./view-mode-toggle-DCDdw_zu.js";import"./collection-search-BOBOP2ro.js";import"./input-C6vwKKeq.js";import"./collection-table-wrapper-ByX0J-nn.js";import"./card-DL_e-uTF.js";import"./layout-m8iq6RWE.js";import"./badge-Z-ujar-h.js";import"./auth-D6vm_lfk.js";import"./constants-C4MXZrmv.js";import"./generate-id-Dyweu44Y.js";const Ce=({size:t=24,color:e="currentColor",...o})=>D.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},D.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ce.displayName="CheckCircle";const we=({size:t=24,color:e="currentColor",...o})=>D.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},D.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function ot(t){const e=_.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function rt(t){const e=_.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Le,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ae,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function lt(t){const e=_.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=D.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ye,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(ze,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,w)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Be,{onClick:()=>f(w),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),w===m&&s.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"})]})},w)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let C;e[19]!==y||e[20]!==N?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=C):C=e[21];let T;return e[22]!==h||e[23]!==C?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,C]}),e[22]=h,e[23]=C,e[24]=T):T=e[24],T}function at(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ct(t){const e=_.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ye,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(be,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let C;e[27]!==o.repository?(C=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(be,{size:14})]})]}),e[27]=o.repository,e[28]=C):C=e[28];let T;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==C?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,C]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=C,e[34]=T):T=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let w;e[36]!==r.updated_at?(w=at(r.updated_at),e[36]=r.updated_at,e[37]=w):w=e[37];let I;e[38]!==w?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:w})]}),e[38]=w,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==T||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,T,I]}),e[40]=i,e[41]=T,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(mt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Oe,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Pe,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Fe,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function ut(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function pt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:tt(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class xt extends D.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Se(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Ie(i),[l,m]=D.useState("readme"),p=Ee(),x=De(),{data:f}=_e.useSession(),h=We(x),g=d||h[0]?.id||"",b=Me(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",C=b?.tools&&b.tools.find(jt)?.name||"",T=Ue(g),S=!!a;let w,I;S?(w=N||C,I={name:a}):(w=y,I={});const{data:u}=He({toolCaller:T,toolName:w,toolInputParams:I,scope:g});let M=[],L=[],pe=null;if(u){if(Array.isArray(u))M=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,k=c.id||"",U=c.server,V=c._meta;let E;t[2]!==c.title||t[3]!==k||t[4]!==U||t[5]!==V?(E=[{id:k,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=k,t[4]=U,t[5]=V,t[6]=E):E=t[6],M=E}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(k=>Array.isArray(u[k])),c&&(M=u[c],(c==="versions"||w?.includes("VERSIONS"))&&(L=M))}}let X;t[7]!==r?(X=c=>{const k=c.name||c.title||c.server.title||"";return qe(k)===r},t[7]=r,t[8]=X):X=t[8];let j=M.find(X);if(!j&&a){let c;t[9]!==a?(c=k=>k.server.name===a||k.name===a||k.title===a,t[9]=a,t[10]=c):c=t[10],j=M.find(c)}const v=j?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ze({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,$=le?v?.tools||[]:xe,ke=ft(x,v?.publisher),ce=v?ut(M,v.publisher,ke,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let R;t[14]!==de?(R={id:"readme",label:"README",visible:de},t[14]=de,t[15]=R):R=t[15];const me=le||xe.length>0||Y&&!!ae;let z;t[16]!==$.length||t[17]!==me?(z={id:"tools",label:"Tools",count:$.length,visible:me},t[16]=$.length,t[17]=me,t[18]=z):z=t[18];let te;t[19]!==R||t[20]!==z?(te=[R,z].filter(bt),t[19]=R,t[20]=z,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const k=L[c??0]||j;if(!k||!e||!f?.user?.id)return;const U=Ke(k,e.id,f.user.id);if(!U.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const E=V;he.error(`Failed to connect MCP Server: ${E instanceof Error?E.message:String(E)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const ue=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const B=re;if(!j){let c;return t[35]!==B?(c=s.jsx(nt,{onBack:B}),t[35]=B,t[36]=c):c=t[36],c}if(!v)return null;const P=(j?.server?.remotes?.length??0)>0;let G;t[37]!==B?(G=s.jsx(it,{onBack:B}),t[37]=B,t[38]=G):G=t[38];let F;t[39]!==P?(F=!P&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=P,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let W;t[44]!==p.create.isPending||t[45]!==P||t[46]!==v||t[47]!==ue||t[48]!==O?(W=s.jsx(lt,{data:v,itemVersions:O,onInstall:ue,canInstall:P,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=P,t[46]=v,t[47]=ue,t[48]=O,t[49]=W):W=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let Z;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==$||t[58]!==Y?(Z=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:$,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=$,t[58]=Y,t[59]=Z):Z=t[59];let K;t[60]!==H||t[61]!==Z?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,Z]}),t[60]=H,t[61]=Z,t[62]=K):K=t[62];let q;t[63]!==F||t[64]!==W||t[65]!==K?(q=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[F,W,K]})})}),t[63]=F,t[64]=W,t[65]=K,t[66]=q):q=t[66];let ne;return t[67]!==G||t[68]!==q?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,q]}),t[67]=G,t[68]=q,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(D.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};