@decocms/mesh 2.19.0 → 2.20.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.
- package/dist/client/assets/{AlertCircle-DZfqNByx.js → AlertCircle-CkNvGXW2.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Cd6RM4A6.js → ArrowLeft-BsUDOBX0.js} +1 -1
- package/dist/client/assets/{ArrowUp-VMKONnWJ.js → ArrowUp-Xq_0RBx_.js} +1 -1
- package/dist/client/assets/{Check-Clnl6VO2.js → Check-DijrPXQx.js} +1 -1
- package/dist/client/assets/{ChevronDown-CUCzTkUk.js → ChevronDown-DASi-DMo.js} +1 -1
- package/dist/client/assets/{Code01-BAik7hF-.js → Code01-C0ZFF6Hl.js} +1 -1
- package/dist/client/assets/{Copy01-CCfh45Hm.js → Copy01-BQZg7H8u.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-H1CDe03p.js → DotsHorizontal-CjU9uXdh.js} +1 -1
- package/dist/client/assets/{DotsVertical-CubHWPM8.js → DotsVertical-D6TZm5RT.js} +1 -1
- package/dist/client/assets/{Download01-DUxaWCdv.js → Download01-BTR8eSV6.js} +1 -1
- package/dist/client/assets/{Edit01-tXex8wx0.js → Edit01-BsdLQ-QO.js} +1 -1
- package/dist/client/assets/{File06-1GHbOIr4.js → File06-Bm9rDm48.js} +1 -1
- package/dist/client/assets/{FilterLines-Ttp2swRG.js → FilterLines-Dg_ubOas.js} +1 -1
- package/dist/client/assets/{FlipBackward-BkcMu9OY.js → FlipBackward-BZkXBjUF.js} +1 -1
- package/dist/client/assets/{GitBranch01-V6D4YBhB.js → GitBranch01-DYs19mSG.js} +1 -1
- package/dist/client/assets/{Grid01-Bf8eAyhK.js → Grid01-CTb93Z2I.js} +1 -1
- package/dist/client/assets/{Home02-8q2bbK8n.js → Home02-CAgSUdC-.js} +1 -1
- package/dist/client/assets/{Image01-Ba0mxAoN.js → Image01-CUinB3ac.js} +1 -1
- package/dist/client/assets/{Inbox01-BvYPvM_p.js → Inbox01-tMW4EgP4.js} +1 -1
- package/dist/client/assets/{InfoCircle-DKA0-FHH.js → InfoCircle-DqeM4n2r.js} +1 -1
- package/dist/client/assets/{Key01-CrI4HON6.js → Key01-BDVEoltU.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CqAE-za3.js → LinkExternal01-C2ZOZHgx.js} +1 -1
- package/dist/client/assets/{List-C6tpn114.js → List-jMJevXfS.js} +1 -1
- package/dist/client/assets/{Loading01-wy6i08TR.js → Loading01-6JGza9Vp.js} +1 -1
- package/dist/client/assets/{Lock01-CGlDIBQ9.js → Lock01-DAc7yIAH.js} +1 -1
- package/dist/client/assets/{Play-BvhASZjZ.js → Play-BWxFDrEk.js} +1 -1
- package/dist/client/assets/{Plus-DaMIylfN.js → Plus-Dcgso5EP.js} +1 -1
- package/dist/client/assets/{SearchMd-DsK25qy7.js → SearchMd-CbnCIalV.js} +1 -1
- package/dist/client/assets/{Terminal-cal0VHQd.js → Terminal-DNtUg1U7.js} +1 -1
- package/dist/client/assets/{Trash01-pB5oOXYU.js → Trash01-CzA8mxf_.js} +1 -1
- package/dist/client/assets/{Upload01-BRGUFGKZ.js → Upload01-BPJ4Vq2H.js} +1 -1
- package/dist/client/assets/{X-Bq7VzczH.js → X-C7-BOCtk.js} +1 -1
- package/dist/client/assets/{XClose-zOphE63W.js → XClose-COetRF8H.js} +1 -1
- package/dist/client/assets/{alert-dialog-BBkPKiLO.js → alert-dialog-Mcf5ObRp.js} +1 -1
- package/dist/client/assets/{auth-catchall-D7-AwG4p.js → auth-catchall-JCvomRO1.js} +1 -1
- package/dist/client/assets/{avatar-CumXES9B.js → avatar-D0pQKePK.js} +1 -1
- package/dist/client/assets/{badge-tnyrO2LA.js → badge-9bzwrgbk.js} +1 -1
- package/dist/client/assets/{binder-BxHiGQ64.js → binder-B4r3FJOG.js} +1 -1
- package/dist/client/assets/{button-BQMZIX_4.js → button-C_Xg9B1B.js} +1 -1
- package/dist/client/assets/{card-B-rrjyBF.js → card-BXLd4InC.js} +1 -1
- package/dist/client/assets/{checkbox-CJvAgYlu.js → checkbox-z9w2qryt.js} +1 -1
- package/dist/client/assets/{collection-detail-w6psdBlt.js → collection-detail-zSSQWfP2.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bi_NXbuN.js → collection-display-button-DNzo_eaI.js} +1 -1
- package/dist/client/assets/{collection-header-BfNxri-N.js → collection-header-DMI-enxo.js} +1 -1
- package/dist/client/assets/{collection-page-DJtrTRMH.js → collection-page-CPVm36im.js} +1 -1
- package/dist/client/assets/{collection-search-9baWd84b.js → collection-search-NPXhv3P8.js} +1 -1
- package/dist/client/assets/collection-tab-DoDfK_be.js +1 -0
- package/dist/client/assets/{collection-table-wrapper-Cu-yqUsH.js → collection-table-wrapper-CH0cDKjW.js} +1 -1
- package/dist/client/assets/{connection-BdWKvn2K.js → connection-DoXpv3Ov.js} +1 -1
- package/dist/client/assets/{connection-card-CwhA62aK.js → connection-card-zeRxy9uc.js} +1 -1
- package/dist/client/assets/{connection-detail-BvvvvXz6.js → connection-detail-vV4L4jYp.js} +1 -1
- package/dist/client/assets/{connections-CfRRCGSZ.js → connections-DNpwgzUU.js} +1 -1
- package/dist/client/assets/constants-CBp9PjFO.js +1 -0
- package/dist/client/assets/{create-organization-dialog-gxAB4wwP.js → create-organization-dialog-Ro3igzlR.js} +1 -1
- package/dist/client/assets/{dialog-BOTxth8M.js → dialog-C9Agm5JE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Cwg_0qoi.js → dropdown-menu-fQ8f1M5d.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DcLqC1O8.js → dynamic-plugin-layout-B3cv12GM.js} +1 -1
- package/dist/client/assets/{empty-state-DeORHrTg.js → empty-state-DBRX3hef.js} +1 -1
- package/dist/client/assets/{empty-state-2SJ3WxPr.js → empty-state-DdUozeuW.js} +1 -1
- package/dist/client/assets/{env-vars-editor-qkfhYptd.js → env-vars-editor-BXw6d8cC.js} +1 -1
- package/dist/client/assets/{error-boundary-KUKN2TxD.js → error-boundary-yHT4ni_0.js} +1 -1
- package/dist/client/assets/{extract-connection-data-37AfJqs-.js → extract-connection-data-PVjaut0P.js} +1 -1
- package/dist/client/assets/file-browser-Bh7hl3h8.js +2 -0
- package/dist/client/assets/{form-o9xmUpnK.js → form-D_wQlmgT.js} +1 -1
- package/dist/client/assets/{gateway-detail-B6zUy6TE.js → gateway-detail-B6I6y-jz.js} +1 -1
- package/dist/client/assets/{gateways-fe-SAKln.js → gateways-B0QSXg4v.js} +1 -1
- package/dist/client/assets/grid-view-BsHjiotE.js +1 -0
- package/dist/client/assets/{home-OB-BKE3S.js → home-m3uBo7L5.js} +1 -1
- package/dist/client/assets/{index-BGlkGnRh.js → index-3IJwc3nu.js} +12 -12
- package/dist/client/assets/{index-DB3RU6w4.js → index-Cg8UjPnN.js} +1 -1
- package/dist/client/assets/{index-BdoGlqOh.js → index-DZBCLPmz.js} +2 -2
- package/dist/client/assets/{index-DuoIQX0P.js → index-DiisCGqz.js} +1 -1
- package/dist/client/assets/{index-nfXEOl8p.js → index-QjJpaT60.js} +9 -9
- package/dist/client/assets/{infiniteQueryObserver-B-zosqIG.js → infiniteQueryObserver-CB9iuYaY.js} +1 -1
- package/dist/client/assets/{input-B0JGK4qg.js → input-DrOaW48H.js} +1 -1
- package/dist/client/assets/{layout-LCGR_e4n.js → layout-B4oQiZN6.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-7Ygumnp-.js → lazy-highlighter-CSmD3B45.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DJgrMpsR.js → localstorage-keys-ColTY5EO.js} +1 -1
- package/dist/client/assets/{login-CPHiXmVM.js → login-BdRlUNll.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DHBNZNZN.js → mcp-oauth-CcVuDlog.js} +1 -1
- package/dist/client/assets/{mcp-server-card-CCJD8rY5.js → mcp-server-card-BnclXini.js} +1 -1
- package/dist/client/assets/mcp-server-detail-DTSTQPDK.js +1 -0
- package/dist/client/assets/{members-BUKGWKo1.js → members-BAse2YpR.js} +1 -1
- package/dist/client/assets/{monaco-editor-2dgkKSmS.js → monaco-editor-BtLswDg1.js} +1 -1
- package/dist/client/assets/{monitoring-Co2ahvWI.js → monitoring-FELvrXqN.js} +11 -11
- package/dist/client/assets/{oauth-callback-DqMgYj7o.js → oauth-callback-sXSk4y6N.js} +1 -1
- package/dist/client/assets/page-IVcVoGr6.js +1 -0
- package/dist/client/assets/{page-CUhEXv2W.js → page-c25MW39x.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-BcuLv1ea.js → pin-to-sidebar-button-D7zfHxC-.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BMZ2lKdt.js → plugin-empty-state-DINK0udh.js} +1 -1
- package/dist/client/assets/{plugin-header-CzG6IJ7x.js → plugin-header-BaOkI6uW.js} +1 -1
- package/dist/client/assets/{plugins-DrfogMhA.js → plugins-DU28fvG7.js} +1 -1
- package/dist/client/assets/{popover-CXUBdgho.js → popover-DDq46px5.js} +1 -1
- package/dist/client/assets/{project-context-provider-DhgIBvJ2.js → project-context-provider-CwtkfEWe.js} +1 -1
- package/dist/client/assets/{registry-utils-C1MEHnjt.js → registry-utils-nz3H3-qh.js} +1 -1
- package/dist/client/assets/{resizable-CwvNlApq.js → resizable-ZYLqRZrr.js} +1 -1
- package/dist/client/assets/{resource-tabs-BnWaqzvN.js → resource-tabs-Dv00g9SH.js} +1 -1
- package/dist/client/assets/{select--nDzC8in.js → select-Cgab7LNB.js} +1 -1
- package/dist/client/assets/{settings-18XrU-68.js → settings-CUngx_cw.js} +1 -1
- package/dist/client/assets/shell-layout-IdYGAQZJ.js +3 -0
- package/dist/client/assets/{spinner-BJxZd1VB.js → spinner-ISlo4YZH.js} +1 -1
- package/dist/client/assets/{switch-BFRma3Oi.js → switch-BDCe2nGJ.js} +1 -1
- package/dist/client/assets/{textarea-CZGp5M36.js → textarea-BL4bZEBo.js} +1 -1
- package/dist/client/assets/{tool-set-selector-D-ihTeCw.js → tool-set-selector-CWxawPKU.js} +1 -1
- package/dist/client/assets/{tools-list-DdaO5B-A.js → tools-list-BAdvjUaK.js} +1 -1
- package/dist/client/assets/{tooltip-DSjdME5j.js → tooltip-CpJ7mUzE.js} +1 -1
- package/dist/client/assets/{typewriter-title-D3pHLziM.js → typewriter-title-vVGiDyZ3.js} +1 -1
- package/dist/client/assets/{use-binding-CdMfLY85.js → use-binding-DGnotkAI.js} +1 -1
- package/dist/client/assets/{use-collections-B_r4T3b1.js → use-collections-BmF5uRR6.js} +1 -1
- package/dist/client/assets/{use-connection-W2V2j8pE.js → use-connection-CD3KQhdl.js} +1 -1
- package/dist/client/assets/{use-connection-resources-_fz_82N5.js → use-connection-resources-Bk8Paqb0.js} +1 -1
- package/dist/client/assets/{use-create-gateway-DGaCqRhz.js → use-create-gateway-Buvj1BPg.js} +1 -1
- package/dist/client/assets/{use-gateway-CijYzCU9.js → use-gateway-HT97xIYl.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-CusPzWe3.js → use-gateway-system-prompt-DPiQIOlu.js} +1 -1
- package/dist/client/assets/{use-list-state-DNPGmD9A.js → use-list-state-DceT21J-.js} +1 -1
- package/dist/client/assets/{use-mcp-fzL3ILVj.js → use-mcp-C2xjgZVM.js} +1 -1
- package/dist/client/assets/{use-members-Cs5znkoZ.js → use-members-D-h9QOxK.js} +1 -1
- package/dist/client/assets/{use-mobile-DPzmQj9d.js → use-mobile-BH2x5CB1.js} +1 -1
- package/dist/client/assets/{use-organization-settings-sFF34W-p.js → use-organization-settings-BMsrsPvw.js} +1 -1
- package/dist/client/assets/{use-tool-call-CCdok443.js → use-tool-call-BmQnCqef.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-hrzJXDha.js +1 -0
- package/dist/client/assets/{useMutation-mOecCzvG.js → useMutation-DV6K6Nze.js} +1 -1
- package/dist/client/assets/useQuery-mZS4-X0F.js +1 -0
- package/dist/client/assets/{value-C7yMc_BN.js → value-BiYWDF0x.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DdRtk7o-.js → view-mode-toggle-DPk8_aIn.js} +1 -1
- package/dist/client/assets/{workflow-Ca7LNIxD.js → workflow-B_8Qc7GH.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +2 -2
- package/dist/client/assets/collection-tab-Ct4krCcB.js +0 -1
- package/dist/client/assets/constants-BoL9C76L.js +0 -1
- package/dist/client/assets/file-browser-D3uR2C9M.js +0 -2
- package/dist/client/assets/grid-view-vZ2Zpkzy.js +0 -1
- package/dist/client/assets/mcp-server-detail-B2BLpdBe.js +0 -1
- package/dist/client/assets/page-Xy2zuFaN.js +0 -1
- package/dist/client/assets/shell-layout-DPrrZeqr.js +0 -3
- package/dist/client/assets/useInfiniteQuery-Bx9UQHNH.js +0 -1
- package/dist/client/assets/useQuery-B_cnJjvx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b2 as l,b4 as b,bR as a,bS as d,b3 as h,x as p,r as o,bc as m,bT as v}from"./index-
|
|
1
|
+
import{b2 as l,b4 as b,bR as a,bS as d,b3 as h,x as p,r as o,bc as m,bT as v}from"./index-DZBCLPmz.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),b(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=p(s),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as u,b6 as s}from"./index-DZBCLPmz.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as z,aa as A,j as u,a6 as M,a8 as ge,H as h,a5 as he,ab as X,ac as pe,a4 as be,ad as me,h as ve,c as Y}from"./index-BdoGlqOh.js";import{c as Z}from"./button-BQMZIX_4.js";var ee="Toggle",te=z.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return u.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return u.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return u.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:u.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),f=h.useCallback(l=>s((d=[])=>[...d,l]),[s]),c=h.useCallback(l=>s((d=[])=>d.filter(xe=>xe!==l)),[s]);return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:f,onItemDeactivate:c,children:u.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...f}=t,c=ne(r),l=be(i),d={role:"group",dir:l,...f};return u.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?u.jsx(me,{asChild:!0,...c,orientation:o,dir:l,loop:s,children:u.jsx(M.div,{...d,ref:e})}):u.jsx(M.div,{...d,ref:e})})}),k="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(k,t.__scopeToggleGroup),n=Ne(k,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},f=h.useRef(null);return n.rovingFocus?u.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:f,children:u.jsx(D,{...s,ref:e})}):u.jsx(D,{...s,ref:e})});se.displayName=k;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(k,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return u.jsx(te,{...s,...a,ref:e,onPressedChange:f=>{f?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const Re=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=z.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let f;e[8]!==o||e[9]!==i?(f={variant:i,size:o},e[8]=o,e[9]=i,e[10]=f):f=e[10];let c;e[11]!==r||e[12]!==f?(c=u.jsx(fe.Provider,{value:f,children:r}),e[11]=r,e[12]=f,e[13]=c):c=e[13];let l;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==i?(l=u.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:c}),e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=i,e[19]=l):l=e[19],l}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=z.useContext(fe),f=s.variant||i,c=s.size||o;let l;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(l=Z(Re({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=l):l=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==f||e[15]!==c||e[16]!==l?(d=u.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":f,"data-size":c,className:l,...a,children:r}),e[12]=r,e[13]=a,e[14]=f,e[15]=c,e[16]=l,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,C=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ke=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Te=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),je=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:He,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function He(){return ce(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ke.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ce.exec(t))?new x(e[1],e[2],e[3],1):(e=Te.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=je.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function ze(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?ze(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=T(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ce(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,f=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=f<.5?o+a:2-o-a,i*=60):s=f>0&&f<1?0:i,new g(i,s,f,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ce(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(j(t>=240?t-240:t+120,a,n),j(t,a,n),j(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),R(this.s),R(this.l),T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=T(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function R(t){return Math.max(0,Math.min(1,t||0))}function j(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ue:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ue(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),f=r(a.b,o.b),c=ue(a.opacity,o.opacity);return function(l){return a.r=i(l),a.g=s(l),a.b=f(l),a.opacity=c(l),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var H=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(H.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=H.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],f=[];for(t=t+"",e=e+"";(n=H.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,f.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?f[0]?Ke(f[0].x):Je(e):(e=f.length,function(c){for(var l=0,d;l<e;++l)s[(d=f[l]).i]=d.x(c);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
|
|
1
|
+
import{r as z,aa as A,j as u,a6 as M,a8 as ge,H as h,a5 as he,ab as X,ac as pe,a4 as be,ad as me,h as ve,c as Y}from"./index-DZBCLPmz.js";import{c as Z}from"./button-C_Xg9B1B.js";var ee="Toggle",te=z.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return u.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return u.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return u.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:u.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),f=h.useCallback(l=>s((d=[])=>[...d,l]),[s]),c=h.useCallback(l=>s((d=[])=>d.filter(xe=>xe!==l)),[s]);return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:f,onItemDeactivate:c,children:u.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...f}=t,c=ne(r),l=be(i),d={role:"group",dir:l,...f};return u.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?u.jsx(me,{asChild:!0,...c,orientation:o,dir:l,loop:s,children:u.jsx(M.div,{...d,ref:e})}):u.jsx(M.div,{...d,ref:e})})}),k="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(k,t.__scopeToggleGroup),n=Ne(k,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},f=h.useRef(null);return n.rovingFocus?u.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:f,children:u.jsx(D,{...s,ref:e})}):u.jsx(D,{...s,ref:e})});se.displayName=k;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(k,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return u.jsx(te,{...s,...a,ref:e,onPressedChange:f=>{f?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const Re=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=z.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let f;e[8]!==o||e[9]!==i?(f={variant:i,size:o},e[8]=o,e[9]=i,e[10]=f):f=e[10];let c;e[11]!==r||e[12]!==f?(c=u.jsx(fe.Provider,{value:f,children:r}),e[11]=r,e[12]=f,e[13]=c):c=e[13];let l;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==i?(l=u.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:c}),e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=i,e[19]=l):l=e[19],l}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=z.useContext(fe),f=s.variant||i,c=s.size||o;let l;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(l=Z(Re({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=l):l=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==f||e[15]!==c||e[16]!==l?(d=u.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":f,"data-size":c,className:l,...a,children:r}),e[12]=r,e[13]=a,e[14]=f,e[15]=c,e[16]=l,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,C=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ke=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Te=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),je=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:He,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function He(){return ce(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ke.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ce.exec(t))?new x(e[1],e[2],e[3],1):(e=Te.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=je.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function ze(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?ze(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=T(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ce(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,f=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=f<.5?o+a:2-o-a,i*=60):s=f>0&&f<1?0:i,new g(i,s,f,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ce(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(j(t>=240?t-240:t+120,a,n),j(t,a,n),j(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),R(this.s),R(this.l),T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=T(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function R(t){return Math.max(0,Math.min(1,t||0))}function j(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ue:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ue(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),f=r(a.b,o.b),c=ue(a.opacity,o.opacity);return function(l){return a.r=i(l),a.g=s(l),a.b=f(l),a.opacity=c(l),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var H=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(H.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=H.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],f=[];for(t=t+"",e=e+"";(n=H.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,f.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?f[0]?Ke(f[0].x):Je(e):(e=f.length,function(c){for(var l=0,d;l<e;++l)s[(d=f[l]).i]=d.x(c);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Y,r as V,j as i}from"./index-
|
|
1
|
+
import{c as Y,r as V,j as i}from"./index-DZBCLPmz.js";import{c as n}from"./button-C_Xg9B1B.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L,f as P,r as v,j as e,c as k}from"./index-
|
|
1
|
+
import{a as L,f as P,r as v,j as e,c as k}from"./index-DZBCLPmz.js";import{d as _}from"./well-known-mcp-DOEdYmKO.js";import{C as R}from"./collection-tab-DoDfK_be.js";import{a as z,u as A}from"./use-connection-CD3KQhdl.js";import{u as B}from"./project-context-provider-CwtkfEWe.js";import{B as y}from"./button-C_Xg9B1B.js";import{E as F}from"./empty-state-DBRX3hef.js";import{C as M}from"./collection-header-DMI-enxo.js";import{b as O,a as H}from"./use-binding-DGnotkAI.js";import{i as T}from"./Loading01-6JGza9Vp.js";import"./generate-id-Dyweu44Y.js";import"./connection-DoXpv3Ov.js";import"./collection-display-button-DNzo_eaI.js";import"./dropdown-menu-fQ8f1M5d.js";import"./Grid01-CTb93Z2I.js";import"./ArrowUp-Xq_0RBx_.js";import"./Check-DijrPXQx.js";import"./List-jMJevXfS.js";import"./tooltip-CpJ7mUzE.js";import"./view-mode-toggle-DPk8_aIn.js";import"./collection-search-NPXhv3P8.js";import"./SearchMd-CbnCIalV.js";import"./input-DrOaW48H.js";import"./card-BXLd4InC.js";import"./Copy01-BQZg7H8u.js";import"./DotsVertical-D6TZm5RT.js";import"./Edit01-BsdLQ-QO.js";import"./use-list-state-DceT21J-.js";import"./use-mobile-BH2x5CB1.js";import"./Trash01-CzA8mxf_.js";import"./collection-table-wrapper-CH0cDKjW.js";import"./empty-state-DdUozeuW.js";import"./Inbox01-tMW4EgP4.js";import"./avatar-D0pQKePK.js";import"./useQuery-mZS4-X0F.js";import"./pin-to-sidebar-button-D7zfHxC-.js";import"./use-organization-settings-BMsrsPvw.js";import"./useMutation-DV6K6Nze.js";import"./use-collections-BmF5uRR6.js";import"./constants-CBp9PjFO.js";import"./alert-dialog-Mcf5ObRp.js";import"./Plus-Dcgso5EP.js";import"./layout-B4oQiZN6.js";import"./ArrowLeft-BsUDOBX0.js";import"./binder-B4r3FJOG.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=z(),{org:{slug:m}}=B(),{data:h}=L.useSession(),p=P(),[a,N]=v.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){N(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),p({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{N(!1)}}},j=()=>{p({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(F,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),p=A();let a;t[0]!==p||t[1]!==o?(a={connections:p,binding:o},t[0]=p,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=v.useState(null),b=l&&S&&(l.id||E);let d;t[8]!==s?(d=e.jsx(M,{title:s}),t[8]=s,t[9]=d):d=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let f;t[11]!==s?(f=s.toLowerCase(),t[11]=s,t[12]=f):f=t[12];let u;t[13]!==f?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",f,"..."]})]}),t[13]=f,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==b||t[20]!==m?(g=b?e.jsx(R,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=b,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(v.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let w;return t[25]!==d||t[26]!==x?(w=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[d,x]}),t[25]=d,t[26]=x,t[27]=w):w=t[27],w}function zt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{zt as default};
|
package/dist/client/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>MCP Mesh</title>
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
-
<script type="module" crossorigin src="/assets/index-
|
|
6
|
+
<script type="module" crossorigin src="/assets/index-DZBCLPmz.js"></script>
|
|
7
7
|
<link rel="stylesheet" crossorigin href="/assets/index-Dh9ePU0t.css">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/mesh",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
|
|
5
5
|
"author": "Deco team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@decocms/runtime": "workspace:*",
|
|
55
55
|
"@decocms/vite-plugin": "workspace:*",
|
|
56
56
|
"@hookform/resolvers": "^5.2.2",
|
|
57
|
-
"@modelcontextprotocol/sdk": "1.25.
|
|
57
|
+
"@modelcontextprotocol/sdk": "1.25.2",
|
|
58
58
|
"@monaco-editor/react": "^4.7.0",
|
|
59
59
|
"@opentelemetry/api": "^1.9.0",
|
|
60
60
|
"@opentelemetry/exporter-prometheus": "^0.208.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ne,j as t,K as it,f as nt,k as lt,a as rt,r as at,t as ct}from"./index-BdoGlqOh.js";import{g as Ke}from"./generate-id-Dyweu44Y.js";import{c as Le}from"./connection-BdWKvn2K.js";import{C as Re}from"./collection-display-button-Bi_NXbuN.js";import{C as dt}from"./collection-search-9baWd84b.js";import{C as mt}from"./card-B-rrjyBF.js";import{I as Ve,E as ft}from"./empty-state-DeORHrTg.js";import{b as qe,D as Ge,a as We,c as F}from"./dropdown-menu-Cwg_0qoi.js";import{B as Oe}from"./button-BQMZIX_4.js";import{a as He}from"./Copy01-CCfh45Hm.js";import{i as Je}from"./DotsVertical-CubHWPM8.js";import{i as Qe}from"./Edit01-tXex8wx0.js";import{s as Ye,u as ut}from"./use-list-state-DNPGmD9A.js";import{s as Xe}from"./Trash01-pB5oOXYU.js";import{C as pt}from"./collection-table-wrapper-Cu-yqUsH.js";import{E as Me}from"./empty-state-2SJ3WxPr.js";import{n as Ue}from"./Inbox01-BvYPvM_p.js";import{A as ze}from"./avatar-CumXES9B.js";import{u as ht}from"./useQuery-B_cnJjvx.js";import{P as xt}from"./pin-to-sidebar-button-BcuLv1ea.js";import{b as gt}from"./use-connection-W2V2j8pE.js";import{a as jt,b as Ct}from"./use-collections-B_r4T3b1.js";import{B as vt}from"./constants-BoL9C76L.js";import{A as bt,g as yt,c as Nt,b as wt,d as St,e as _t,a as Dt,f as At}from"./alert-dialog-BBkPKiLO.js";import{s as Tt}from"./Plus-DaMIylfN.js";import{V as $t}from"./layout-LCGR_e4n.js";function It(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of d)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Pt(n){const e=ne.c(25),{item:s,schema:d,actions:i}=n;let l;e[0]!==s||e[1]!==d?(l=It(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==i?(f=i&&Object.keys(i).length>0,e[3]=i,e[4]=f):f=e[4];const o=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(Ve,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let v;e[8]!==s.title?(v=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=v):v=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==v||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[v,m]}),e[12]=v,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let j;e[18]!==i||e[19]!==o||e[20]!==s?(j=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:kt,onMouseDown:Ot,children:t.jsxs(qe,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(Je,{size:20})})}),t.jsxs(We,{align:"end",onClick:Et,children:[i.open&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.open?.(s)},children:[t.jsx(Ye,{size:16}),"Open"]}),i.edit&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.edit?.(s)},children:[t.jsx(Qe,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(He,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(F,{variant:"destructive",onClick:r=>{r.stopPropagation(),i.delete?.(s)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=j):j=e[21];let S;return e[22]!==y||e[23]!==j?(S=t.jsxs(mt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,j]}),e[22]=y,e[23]=j,e[24]=S):S=e[24],S}function Et(n){return n.stopPropagation()}function zt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ft(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Le(),e[0]=s):s=e[0];const d=s;let i;e[1]!==n?(i=it.user(n),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==i||e[6]!==l||e[7]!==a?(c={queryKey:i,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=i,e[6]=l,e[7]=a,e[8]=c):c=e[8],ht(c)}function Kt(n){const e=ne.c(33),{id:s,size:d,showEmail:i,className:l}=n,a=d===void 0?"xs":d,c=i===void 0?!1:i,{data:f,isLoading:o,isError:u}=Ft(s);if(o){const r=`flex items-center gap-2 ${l||""}`;let g;e[0]!==a?(g=t.jsx(ze.Skeleton,{shape:"circle",size:a}),e[0]=a,e[1]=g):g=e[1];let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=C):C=e[2];let p;e[3]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=c,e[4]=p):p=e[4];let _;e[5]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[C,p]}),e[5]=p,e[6]=_):_=e[6];let b;return e[7]!==r||e[8]!==g||e[9]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[7]=r,e[8]=g,e[9]=_,e[10]=b):b=e[10],b}if(u||!f){const r=`flex items-center gap-2 ${l||""}`;let g;e[11]!==a?(g=t.jsx(ze,{shape:"circle",size:a,fallback:"?",muted:!0}),e[11]=a,e[12]=g):g=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=C):C=e[13];let p;return e[14]!==r||e[15]!==g?(p=t.jsxs("div",{className:r,children:[g,C]}),e[14]=r,e[15]=g,e[16]=p):p=e[16],p}const v=`flex items-center gap-2 ${l||""}`,h=f.image??void 0;let m;e[17]!==a||e[18]!==h||e[19]!==f.name?(m=t.jsx(ze,{shape:"circle",size:a,url:h,fallback:f.name}),e[17]=a,e[18]=h,e[19]=f.name,e[20]=m):m=e[20];let x;e[21]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[21]=f.name,e[22]=x):x=e[22];let y;e[23]!==c||e[24]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[23]=c,e[24]=f.email,e[25]=y):y=e[25];let j;e[26]!==x||e[27]!==y?(j=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[26]=x,e[27]=y,e[28]=j):j=e[28];let S;return e[29]!==v||e[30]!==m||e[31]!==j?(S=t.jsxs("div",{className:v,children:[m,j]}),e[29]=v,e[30]=m,e[31]=j,e[32]=S):S=e[32],S}const Mt=["icon","avatar","logo"],Be=["created_at","created_by","id"];function Ut(n){return Object.keys(n).find(e=>Mt.includes(e.toLowerCase()))}function Ze(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Bt(n){const e=ne.c(32),{data:s,schema:d,viewMode:i,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:o,actions:u,onItemClick:v,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:j,sortableFields:S}=n,r=l===void 0?Gt:l,g=f===void 0?"asc":f,C=o===void 0?qt:o;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=v===void 0?Vt:v,I=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,P=j===void 0?!1:j,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Rt).filter(k=>!D||D.includes(k.id)).map(Lt):Ze(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const K=z;let $;e[6]!==I||e[7]!==P||e[8]!==C||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==K||e[13]!==i?($=!P&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Re,{viewMode:i,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:C,sortOptions:K})})]})}),e[6]=I,e[7]=P,e[8]=C,e[9]=r,e[10]=g,e[11]=c,e[12]=K,e[13]=i,e[14]=$):$=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==C||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==i?(A=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Me,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(k=>t.jsx("div",{onClick:()=>b?.(k),className:"cursor-pointer h-full",children:t.jsx(Pt,{item:k,schema:d,readOnly:E,actions:_})},k.id))})}):t.jsx(pt,{columns:Jt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:C,onRowClick:b,emptyState:T||t.jsx(Me,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=C,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=i,e[28]=A):A=e[28];let O;return e[29]!==$||e[30]!==A?(O=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,A]}),e[29]=$,e[30]=A,e[31]=O):O=e[31],O}function Lt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Rt(n){return n.sortable!==!1}function Vt(){}function qt(){}function Gt(){}function Wt(n){return{id:"actions",header:"",render:e=>t.jsxs(qe,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Je,{size:20})})}),t.jsxs(We,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ye,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Qe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(He,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function et(n){const e=n.type;return Array.isArray(e)?e.every(s=>et({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(n,e){const s=n.properties||{},d=Object.keys(s).filter(o=>{const u=s[o];return u&&et(u)}),i=Ut(s),l=[],a=new Set;i&&d.includes(i)&&(l.push(i),a.add(i));const c=["title","description","updated_at","updated_by"];for(const o of c)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));const f=d.filter(o=>!a.has(o)&&!Be.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of f)l.push(o),a.add(o);for(const o of Be)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));return l.map(o=>{const u=s[o],v=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:h=>{const m=h[o];return t.jsx(Ve,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:v,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx(Kt,{id:String(m),size:"xs"}):"—"},sortable:v,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:v,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:v,cellClassName:"max-w-[200px]"}})}function Jt(n,e,s,d){const i=n||Ht(e,s);return i.some(c=>c.id==="actions")?i:Object.keys(d).length>0?[...i,Wt(d)]:i}function Ns(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:i}=n,l=i.name,a=i.schema??vt,c=i.hasCreateTool,f=i.hasUpdateTool,o=i.hasDeleteTool,u=nt(),h=lt().location.href,{data:m}=rt.useSession(),x=m?.user?.id||"unknown",y=gt(s);let j;e[0]!==s?(j=Le(s),e[0]=s,e[1]=j):j=e[1];const S=j,r=jt(s,l,S),g=`${s}-${l}`;let C;e[2]!==d||e[3]!==g?(C={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=C):C=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:I,setViewMode:T,sortKey:E,sortDirection:N,handleSort:P}=ut(C);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=Ct(s,l,S,D),K=!c&&!f&&!o;let $;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?($=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=$):$=e[13];const A=$;let O;e[14]!==r.create||e[15]!==x?(O=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Ke("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=O):O=e[16];const k=O,[M,xe]=at.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const tt=le;let U;e[18]!==A||e[19]!==f?(U=f&&{edit:A},e[18]=A,e[19]=f,e[20]=U):U=e[20];let B;e[21]!==k||e[22]!==c?(B=c&&{duplicate:k},e[21]=k,e[22]=c,e[23]=B):B=e[23];let L;e[24]!==o?(L=o&&{delete:tt},e[24]=o,e[25]=L):L=e[25];let re;e[26]!==L||e[27]!==U||e[28]!==B?(re={...U,...B,...L},e[26]=L,e[27]=U,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==M?(ae=async()=>{M&&(await r.delete.mutateAsync(M.id),xe(null))},e[30]=r.delete,e[31]=M,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){ct.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ke("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const Ce=ce;let de;e[41]!==a?(de=Ze(a),e[41]=a,e[42]=de):de=e[42];const ve=de,ke=(z?.length??0)>0,st=c&&ke,ot=c&&!ke&&!p;let me;e[43]!==r.create||e[44]!==Ce||e[45]!==c?(me=c?t.jsxs(Oe,{onClick:Ce,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=Ce,e[45]=c,e[46]=me):me=e[46];const Fe=me,be=E;let R;e[47]!==P||e[48]!==T||e[49]!==N||e[50]!==ve||e[51]!==be||e[52]!==I?(R=t.jsx(Re,{viewMode:I,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:P,sortOptions:ve}),e[47]=P,e[48]=T,e[49]=N,e[50]=ve,e[51]=be,e[52]=I,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(xt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=st&&Fe;let q;e[58]!==R||e[59]!==V||e[60]!==we?(q=t.jsxs($t,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${l}...`;let G;e[62]!==b?(G=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=G):G=e[63];let W;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==G?(W=t.jsx(dt,{value:p,onChange:b,placeholder:Se,onKeyDown:G}),e[64]=p,e[65]=b,e[66]=Se,e[67]=G,e[68]=W):W=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=ot?Fe:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(ft,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==P||e[78]!==K||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==I?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Bt,{hideToolbar:!0,data:H,schema:a,viewMode:I,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:P,actions:ge,onItemClick:J,readOnly:K,emptyState:Q})}),e[77]=P,e[78]=K,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=I,e[90]=Y):Y=e[90];let X;e[91]!==W||e[92]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[91]=W,e[92]=Y,e[93]=X):X=e[93];const $e=!!M;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ie=M?.title;let Z;e[96]!==Ie?(Z=t.jsxs(wt,{children:[ue,t.jsxs(St,{children:['Are you sure you want to delete "',Ie,'"? This action cannot be undone.']})]}),e[96]=Ie,e[97]=Z):Z=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(bt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(yt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(_t,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Z||e[108]!==se?(oe=t.jsxs(Dt,{children:[Z,se]}),e[107]=Z,e[108]=se,e[109]=oe):oe=e[109];let ie;e[110]!==$e||e[111]!==oe?(ie=t.jsx(At,{open:$e,onOpenChange:fe,children:oe}),e[110]=$e,e[111]=oe,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==X||e[115]!==ie?(pe=t.jsxs(t.Fragment,{children:[q,X,ie]}),e[113]=q,e[114]=X,e[115]=ie,e[116]=pe):pe=e[116],pe}export{Ns as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aJ as a,bo as o}from"./index-BdoGlqOh.js";const e="mcp.mesh",s=a(o,{target:"draft-7"});export{s as B,e as M};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-vZ2Zpkzy.js","assets/index-BdoGlqOh.js","assets/index-Dh9ePU0t.css","assets/button-BQMZIX_4.js","assets/AlertCircle-DZfqNByx.js","assets/Download01-DUxaWCdv.js","assets/File06-1GHbOIr4.js","assets/Image01-Ba0mxAoN.js","assets/Loading01-wy6i08TR.js","assets/Trash01-pB5oOXYU.js","assets/Upload01-BRGUFGKZ.js","assets/useMutation-mOecCzvG.js","assets/useQuery-B_cnJjvx.js","assets/useInfiniteQuery-Bx9UQHNH.js","assets/infiniteQueryObserver-B-zosqIG.js","assets/checkbox-CJvAgYlu.js","assets/Check-Clnl6VO2.js","assets/Grid01-Bf8eAyhK.js","assets/Home02-8q2bbK8n.js","assets/List-C6tpn114.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as _,c as K,bM as Q,bN as A,x as Y,j as t,t as B,aV as X,bL as ee}from"./index-BdoGlqOh.js";import{u as te}from"./useInfiniteQuery-Bx9UQHNH.js";import{B as M}from"./button-BQMZIX_4.js";import{C as D}from"./checkbox-CJvAgYlu.js";import{i as se}from"./AlertCircle-DZfqNByx.js";import{c as H,i as ae}from"./Grid01-Bf8eAyhK.js";import{n as ie}from"./Download01-DUxaWCdv.js";import{a as re}from"./Home02-8q2bbK8n.js";import{i as V}from"./List-C6tpn114.js";import{i as $}from"./Loading01-wy6i08TR.js";import{s as W}from"./Trash01-pB5oOXYU.js";import{i as U}from"./Upload01-BRGUFGKZ.js";import{u as G}from"./useMutation-mOecCzvG.js";const J=({size:s=24,color:e="currentColor",...a})=>_.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},_.createElement("path",{d:"M14 11H8m2 4H8m8-8H8m12-.2v10.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C20 4.28 20 5.12 20 6.8Z"}));J.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>_.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},_.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,a=!1,o=100)=>["object-storage","objects",s,e,{flat:a,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},oe=100;function ne(s){const e=K.c(30);let a;e[0]!==s?(a=s===void 0?{}:s,e[0]=s,e[1]=a):a=e[1];const o=a,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?oe:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async i=>{const{pageParam:r}=i;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:he,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:w,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:z}=te(E);let v;if(l){let i;e[15]!==p?.pages?(i=p?.pages.flatMap(pe).filter(xe).map(ue)??[],e[15]=p?.pages,e[16]=i):i=e[16],v=i}else{let i;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(fe)??[],j=p?.pages.flatMap(ce)??[];i=[...r.sort(le),...j],e[17]=p?.pages,e[18]=i}else i=e[18];v=i}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,P=y??!1,F=z;let k;return e[23]!==g||e[24]!==w||e[25]!==C||e[26]!==v||e[27]!==F||e[28]!==P?(k={objects:v,isLoading:w,isFetchingMore:g,hasMore:P,loadMore:C,error:F},e[23]=g,e[24]=w,e[25]=C,e[26]=v,e[27]=F,e[28]=P,e[29]=k):k=e[29],k}function le(s,e){return s.key.localeCompare(e.key)}function ce(s){return s.objects.filter(me).map(de)}function de(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function me(s){return!s.key.endsWith("/")}function fe(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function ue(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function xe(s){return!s.key.endsWith("/")}function pe(s){return s.objects}function he(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function ge(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=1024,o=Math.floor(Math.log(s)/Math.log(a));return`${parseFloat((s/Math.pow(a,o)).toFixed(1))} ${e[o]}`}function je(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ye(s){const e=[],a=s.split("/").filter(Boolean);let o="";for(const n of a)o+=n+"/",e.push({name:n,path:o});return e}function $e(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const ve=_.lazy(()=>X(()=>import("./grid-view-vZ2Zpkzy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function Ne(s){const e=K.c(48),{item:a,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==a.key||e[1]!==c?(b=c?a.key:I(a.key),e[0]=a.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(D,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==a.isFolder||e[7]!==a.key||e[8]!==d?(u=()=>a.isFolder?d(a.key):void 0,e[6]=a.isFolder,e[7]=a.key,e[8]=d,e[9]=u):u=e[9];const E=`flex items-center gap-2 flex-1 min-w-0 text-left ${a.isFolder?"cursor-pointer hover:text-primary":""}`;let p;e[10]!==a.isFolder?(p=a.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(J,{size:18,className:"text-muted-foreground shrink-0"}),e[10]=a.isFolder,e[11]=p):p=e[11];let w;e[12]!==S?(w=t.jsx("span",{className:"truncate",children:S}),e[12]=S,e[13]=w):w=e[13];let g;e[14]!==u||e[15]!==E||e[16]!==p||e[17]!==w?(g=t.jsxs("button",{type:"button",onClick:u,className:E,children:[p,w]}),e[14]=u,e[15]=E,e[16]=p,e[17]=w,e[18]=g):g=e[18];let y;e[19]!==a.isFolder||e[20]!==a.size?(y=a.isFolder?"-":ge(a.size),e[19]=a.isFolder,e[20]=a.size,e[21]=y):y=e[21];let h;e[22]!==y?(h=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:y}),e[22]=y,e[23]=h):h=e[23];let z;e[24]!==a.isFolder||e[25]!==a.lastModified?(z=a.isFolder?"-":je(a.lastModified),e[24]=a.isFolder,e[25]=a.lastModified,e[26]=z):z=e[26];let v;e[27]!==z?(v=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:z}),e[27]=z,e[28]=v):v=e[28];let N;e[29]!==a.isFolder||e[30]!==a.key||e[31]!==m?(N=!a.isFolder&&t.jsx(M,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(a.key),children:t.jsx(ie,{size:14})}),e[29]=a.isFolder,e[30]=a.key,e[31]=m,e[32]=N):N=e[32];let C;e[33]!==a.key||e[34]!==l?(C=()=>l(a.key),e[33]=a.key,e[34]=l,e[35]=C):C=e[35];let P;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(M,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:C,children:P}),e[37]=C,e[38]=F):F=e[38];let k;e[39]!==N||e[40]!==F?(k=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[N,F]}),e[39]=N,e[40]=F,e[41]=k):k=e[41];let i;return e[42]!==h||e[43]!==v||e[44]!==k||e[45]!==f||e[46]!==g?(i=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,g,h,v,k]}),e[42]=h,e[43]=v,e[44]=k,e[45]=f,e[46]=g,e[47]=i):i=e[47],i}function q(s){const e=K.c(8),{prefix:a,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==a){const x=ye(a);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(re,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:`hover:text-primary ${b===x.length-1?"font-medium text-foreground":"text-muted-foreground"}`,children:c.name})]},c.path))]}),e[0]=o,e[1]=a,e[2]=n}else n=e[2];return n}function be(){const{path:s="",flat:e=!1,view:a="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=_.useState(new Set),d=i=>{x(new Set),o({to:"/",search:{path:i||void 0,flat:e,view:a}})},m=i=>{x(new Set),o({to:"/",search:{path:i?void 0:s||void 0,flat:i,view:a}})},l=i=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:i}})},c=_.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:w,loadMore:g,error:y}=ne({prefix:s,flat:e}),h=G({mutationFn:async i=>{const r=s+i.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:i.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:i=>{B.success(`Uploaded ${I(i)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Upload failed: ${i.message}`)}}),z=G({mutationFn:async i=>i.length===1&&i[0]?f("DELETE_OBJECT",{key:i[0]}):f("DELETE_OBJECTS",{keys:i}),onSuccess:()=>{B.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Delete failed: ${i.message}`)}}),v=async i=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:i}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),L=document.createElement("a");L.href=O,L.download=I(i),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(O)}catch(r){B.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=i=>{const r=i.target.files;if(r){for(const j of Array.from(r))h.mutate(j);i.target.value=""}},C=(i,r)=>{const j=new Set(n);r?j.add(i):j.delete(i),x(j)},P=i=>{x(i?new Set(u.map(r=>r.key)):new Set)},F=()=>{n.size!==0&&z.mutate(Array.from(n))},k=i=>{if(!w||p)return;const r=i.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):a==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(q,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(M,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(M,{variant:a==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(M,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(q,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(M,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(M,{variant:a==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(M,{variant:"outline",size:"sm",className:"text-destructive",onClick:F,disabled:z.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(M,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(D,{checked:n.size>0&&n.size===u.length,onCheckedChange:P}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(M,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(i=>t.jsx(Ne,{item:i,selected:n.has(i.key),showFullPath:e,onSelect:r=>C(i.key,r),onNavigate:d,onDownload:v,onDelete:r=>z.mutate([r])},i.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{R as K,$e as a,De as b,ge as f,I as g,J as i,Z as s,ne as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as b,c as I,bM as _,j as s,x as O,t as F,bL as q}from"./index-BdoGlqOh.js";import{K as z,u as H,g as L,s as Z,a as Q,i as R,f as T}from"./file-browser-D3uR2C9M.js";import{B as w}from"./button-BQMZIX_4.js";import{i as D}from"./AlertCircle-DZfqNByx.js";import{n as W}from"./Download01-DUxaWCdv.js";import{i as A}from"./File06-1GHbOIr4.js";import{a as S}from"./Image01-Ba0mxAoN.js";import{i as $}from"./Loading01-wy6i08TR.js";import{s as U}from"./Trash01-pB5oOXYU.js";import{i as J}from"./Upload01-BRGUFGKZ.js";import{u as V}from"./useMutation-mOecCzvG.js";import{u as Y}from"./useQuery-B_cnJjvx.js";import"./useInfiniteQuery-Bx9UQHNH.js";import"./infiniteQueryObserver-B-zosqIG.js";import"./checkbox-CJvAgYlu.js";import"./Check-Clnl6VO2.js";import"./Grid01-Bf8eAyhK.js";import"./Home02-8q2bbK8n.js";import"./List-C6tpn114.js";const P=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));P.displayName="File04";const B=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File07";const G=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="FileCode01";const K=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function X(o){const e=I.c(5),[t,g]=b.useState(!1),c=b.useRef(null),f=b.useRef(!1);let n;e[0]!==o?(n=d=>{c.current&&(c.current.disconnect(),c.current=null),d&&!f.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!f.current&&(f.current=!0,g(!0),c.current?.disconnect(),c.current=null)},o),c.current.observe(d))},e[0]=o,e[1]=n):n=e[1];const l=n;let p;return e[2]!==t||e[3]!==l?(p=[t,l],e[2]=t,e[3]=l,e[4]=p):p=e[4],p}function ee(o){const e=I.c(22),{objectKey:t,alt:g,className:c}=o,f=c===void 0?"":c,{connectionId:n,toolCaller:l}=_();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={rootMargin:"100px",threshold:0},e[0]=p):p=e[0];const[d,y]=X(p);let a;e[1]!==n||e[2]!==t?(a=z.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let m;e[4]!==t||e[5]!==l?(m=async()=>{const{url:u}=await l("GET_PRESIGNED_URL",{key:t});return u},e[4]=t,e[5]=l,e[6]=m):m=e[6];let k;e[7]!==d||e[8]!==a||e[9]!==m?(k={queryKey:a,queryFn:m,enabled:d,staleTime:3e5,gcTime:6e5},e[7]=d,e[8]=a,e[9]=m,e[10]=k):k=e[10];const{data:h,isLoading:x,error:j}=Y(k),v=`relative w-full h-full flex items-center justify-center overflow-hidden ${f}`;let r;e[11]!==g||e[12]!==j||e[13]!==h||e[14]!==x||e[15]!==d||e[16]!==t?(r=!d||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx($,{size:24,className:"animate-spin"}):s.jsx(S,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(D,{size:24})}):h?s.jsx("img",{src:h,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[11]=g,e[12]=j,e[13]=h,e[14]=x,e[15]=d,e[16]=t,e[17]=r):r=e[17];let i;return e[18]!==y||e[19]!==v||e[20]!==r?(i=s.jsx("div",{ref:y,className:v,children:r}),e[18]=y,e[19]=v,e[20]=r,e[21]=i):i=e[21],i}const E=12,te={Image01:S,VideoRecorder:K,Music01:R,File02:R,File04:P,File06:A,File07:B,FileCode01:G,Folder:q};function se(o){const e=o.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function re(o){const e=I.c(38),{item:t,onNavigate:g,onDownload:c,onDelete:f}=o;let n;e[0]!==t.key?(n=L(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,p=t.isFolder?"Folder":Q(t.key),d=te[p]||R;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&se(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let m;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(m=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=m):m=e[8];const k=`flex flex-col items-center justify-center w-full h-full ${a?"":"p-4"} ${t.isFolder?"cursor-pointer":"cursor-default"}`;let h;e[9]!==d||e[10]!==a||e[11]!==t.isFolder||e[12]!==t.key||e[13]!==l?(h=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(ee,{objectKey:t.key,alt:l})}):s.jsx(d,{size:48,className:t.isFolder?"text-amber-500":"text-muted-foreground"}),e[9]=d,e[10]=a,e[11]=t.isFolder,e[12]=t.key,e[13]=l,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==t.isFolder||e[17]!==t.size||e[18]!==l?(x=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:T(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:T(t.size)})]}),e[15]=a,e[16]=t.isFolder,e[17]=t.size,e[18]=l,e[19]=x):x=e[19];let j;e[20]!==m||e[21]!==k||e[22]!==h||e[23]!==x?(j=s.jsxs("button",{type:"button",onClick:m,className:k,children:[h,x]}),e[20]=m,e[21]=k,e[22]=h,e[23]=x,e[24]=j):j=e[24];let v;e[25]!==t.isFolder||e[26]!==t.key||e[27]!==f||e[28]!==c?(v=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:u=>{u.stopPropagation(),c(t.key)},children:s.jsx(W,{size:14})}),s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})]}),e[25]=t.isFolder,e[26]=t.key,e[27]=f,e[28]=c,e[29]=v):v=e[29];let r;e[30]!==t.isFolder||e[31]!==t.key||e[32]!==f?(r=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})}),e[30]=t.isFolder,e[31]=t.key,e[32]=f,e[33]=r):r=e[33];let i;return e[34]!==j||e[35]!==v||e[36]!==r?(i=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[j,v,r]}),e[34]=j,e[35]=v,e[36]=r,e[37]=i):i=e[37],i}function Ne({prefix:o,flat:e,onNavigate:t}){const g=b.useRef(null),c=O(),{connectionId:f,toolCaller:n}=_(),{objects:l,isLoading:p,isFetchingMore:d,hasMore:y,loadMore:a,error:m}=H({prefix:o,flat:e,pageSize:E}),k=V({mutationFn:async r=>{const i=o+r.name,{url:u}=await n("PUT_PRESIGNED_URL",{key:i,contentType:r.type||"application/octet-stream"}),C=await fetch(u,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!C.ok)throw new Error(`Upload failed: ${C.statusText}`);return i},onSuccess:r=>{F.success(`Uploaded ${L(r)}`),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Upload failed: ${r.message}`)}}),h=V({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{F.success("Deleted successfully"),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:i}=await n("GET_PRESIGNED_URL",{key:r}),u=await fetch(i);if(!u.ok)throw new Error(`Failed to fetch file: ${u.statusText}`);const C=await u.blob(),M=URL.createObjectURL(C),N=document.createElement("a");N.href=M,N.download=L(r),document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(M)}catch(i){F.error(`Download failed: ${i instanceof Error?i.message:"Unknown error"}`)}},j=r=>{const i=r.target.files;if(i){for(const u of Array.from(i))k.mutate(u);r.target.value=""}},v=r=>{if(!y||d)return;const i=r.currentTarget;i.scrollHeight-i.scrollTop-i.clientHeight<200&&a()};return m?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(D,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:m.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:v,children:p?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(w,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(J,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(re,{item:r,onNavigate:t,onDownload:x,onDelete:i=>h.mutate([i])},r.key))}),d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx($,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ne as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-BdoGlqOh.js";import{i as Ze}from"./AlertCircle-DZfqNByx.js";import{i as De}from"./Loading01-wy6i08TR.js";import{B as ae}from"./button-BQMZIX_4.js";import{i as Je}from"./ArrowLeft-Cd6RM4A6.js";import{I as Re,E as et}from"./empty-state-DeORHrTg.js";import{i as tt,e as st}from"./extract-connection-data-37AfJqs-.js";import{t as ot}from"./ChevronDown-CUCzTkUk.js";import{s as Pe}from"./Plus-DaMIylfN.js";import{D as rt,c as nt,a as it,b as lt}from"./dropdown-menu-Cwg_0qoi.js";import{n as Me}from"./LinkExternal01-CqAE-za3.js";import{T as at,R as ct}from"./tools-list-DdaO5B-A.js";import{R as dt}from"./resource-tabs-BnWaqzvN.js";import{s as mt,f as ft,g as ut,c as pt}from"./registry-utils-C1MEHnjt.js";import{a as xt,b as ht,e as gt}from"./mcp-server-card-CCJD8rY5.js";import{i as vt}from"./Terminal-cal0VHQd.js";import{a as bt,u as jt,b as yt}from"./use-connection-W2V2j8pE.js";import{u as Nt}from"./use-binding-CdMfLY85.js";import{u as St}from"./use-tool-call-CCdok443.js";import{u as Ct}from"./use-mcp-fzL3ILVj.js";import{u as wt,L as _t}from"./localstorage-keys-DJgrMpsR.js";import{u as Ee}from"./project-context-provider-DhgIBvJ2.js";import{s as It}from"./slugify-CEUa2lfQ.js";import{e as kt,g as Tt}from"./github-icon-Dp3wHhYE.js";import{i as Lt}from"./InfoCircle-DKA0-FHH.js";import{c as Pt}from"./connection-BdWKvn2K.js";import"./constants-BoL9C76L.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-Bf8eAyhK.js";import"./useQuery-B_cnJjvx.js";import"./File06-1GHbOIr4.js";import"./collection-display-button-Bi_NXbuN.js";import"./ArrowUp-VMKONnWJ.js";import"./Check-Clnl6VO2.js";import"./List-C6tpn114.js";import"./tooltip-DSjdME5j.js";import"./view-mode-toggle-DdRtk7o-.js";import"./collection-search-9baWd84b.js";import"./SearchMd-DsK25qy7.js";import"./input-B0JGK4qg.js";import"./collection-table-wrapper-Cu-yqUsH.js";import"./card-B-rrjyBF.js";import"./layout-LCGR_e4n.js";import"./badge-tnyrO2LA.js";import"./Lock01-CGlDIBQ9.js";import"./use-collections-B_r4T3b1.js";import"./useMutation-mOecCzvG.js";import"./binder-BxHiGQ64.js";const Ae=({size:t=24,color:e="currentColor",...o})=>q.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},q.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"}));Ae.displayName="SearchLg";function Mt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function Vt(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,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]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function $t(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,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]=a):a=e[4],a}function Dt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Je,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=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(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(26),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,w=c===void 0?!1:c,u=o[r],S=w?"sm":"default",v=d==="brand"?"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer":"shrink-0 cursor-pointer";let _;e[0]!==u?.server?.version||e[1]!==w?(_=w&&s.jsxs("span",{className:"mr-1",children:["v",u?.server?.version||"unknown"]}),e[0]=u?.server?.version,e[1]=w,e[2]=_):_=e[2];const p=w?14:20;let b;e[3]!==p?(b=s.jsx(ot,{size:p}),e[3]=p,e[4]=b):b=e[4];let m;e[5]!==l||e[6]!==S||e[7]!==v||e[8]!==_||e[9]!==b||e[10]!==d?(m=s.jsx(rt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:S,className:v,children:[_,b]})}),e[5]=l,e[6]=S,e[7]=v,e[8]=_,e[9]=b,e[10]=d,e[11]=m):m=e[11];let g;if(e[12]!==l||e[13]!==n||e[14]!==r||e[15]!==o){let y;e[17]!==l||e[18]!==n||e[19]!==r?(y=(j,N)=>{const I=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(nt,{onClick:()=>n(N),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",j.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),N===r&&s.jsx(tt,{size:16,className:"text-muted-foreground shrink-0"})]})},N)},e[17]=l,e[18]=n,e[19]=r,e[20]=y):y=e[20],g=o.map(y),e[12]=l,e[13]=n,e[14]=r,e[15]=o,e[16]=g}else g=e[16];let x;e[21]!==g?(x=s.jsx(it,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[21]=g,e[22]=x):x=e[22];let T;return e[23]!==x||e[24]!==m?(T=s.jsxs(lt,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=T):T=e[25],T}function Rt(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,w=i===void 0?!0:i,u=a===void 0?!1:a,S=c===void 0?!1:c,[v,_]=q.useState(0),p=l??v;let b;e[0]!==d?(b=U=>{_(U),d?.(U)},e[0]=d,e[1]=b):b=e[1];const m=b,g=r[p]||r[0];let x;e[2]!==g?.server?.remotes?(x=g?.server?.remotes??[],e[2]=g?.server?.remotes,e[3]=x):x=e[3];const T=x;let y;e[4]!==g?.server?.packages?(y=g?.server?.packages??[],e[4]=g?.server?.packages,e[5]=y):y=e[5];const N=y.length>0,I=T.length>0,M=T.findIndex(At),h=M>=0?M:0;let K;e[6]!==h||e[7]!==N||e[8]!==I||e[9]!==n||e[10]!==p?(K=()=>{I?n(p,h,void 0):N&&n(p,void 0,0)},e[6]=h,e[7]=N,e[8]=I,e[9]=n,e[10]=p,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==m?(G=U=>{m(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(Et);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=m,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let P;e[19]!==o.name?(P=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=P):P=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==P||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[P,z]}),e[23]=P,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==w||e[32]!==E||e[33]!==L||e[34]!==S||e[35]!==u||e[36]!==r||e[37]!==p||e[38]!==m?(A=w&&!S?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:u,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:L,isInstalling:u,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||u,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),u?"Connecting...":"Connect"]})}):S?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:p,onSelect:m,isInstalling:u,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=w,e[32]=E,e[33]=L,e[34]=S,e[35]=u,e[36]=r,e[37]=p,e[38]=m,e[39]=A):A=e[39];let C;e[40]!==$||e[41]!==A?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=C):C=e[42];let k;return e[43]!==C||e[44]!==V?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,C]}),e[43]=C,e[44]=V,e[45]=k):k=e[45],k}function Et(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(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 Bt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=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 a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=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 d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=w):w=e[9];let u;e[10]!==d?(u=s.jsxs("div",{children:[d,w]}),e[10]=d,e[11]=u):u=e[11];let S;e[12]!==c||e[13]!==u?(S=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,u]})}),e[12]=c,e[13]=u,e[14]=S):S=e[14];let v;e[15]!==o.version?(v=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[15]=o.version,e[16]=v):v=e[16];let _;e[17]!==o.tags?(_=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ot)})]}),e[17]=o.tags,e[18]=_):_=e[18];let p;e[19]!==o.categories?(p=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(zt)})]}),e[19]=o.categories,e[20]=p):p=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 m;e[23]!==o.schemaVersion?(m=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]=m):m=e[24];let g;e[25]!==o.websiteUrl?(g=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(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=g):g=e[26];let x;e[27]!==o.repository?(x=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(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let T;e[29]!==_||e[30]!==p||e[31]!==b||e[32]!==m||e[33]!==g||e[34]!==x||e[35]!==v?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[v,_,p,b,m,g,x]}),e[29]=_,e[30]=p,e[31]=b,e[32]=m,e[33]=g,e[34]=x,e[35]=v,e[36]=T):T=e[36];let y;e[37]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=y):y=e[37];let j;e[38]!==n.updated_at?(j=Ut(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let N;e[40]!==j?(N=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[y,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=N):N=e[41];let I;return e[42]!==i||e[43]!==T||e[44]!==N||e[45]!==S?(I=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,T,N]}),e[42]=i,e[43]=T,e[44]=N,e[45]=S,e[46]=I):I=e[46],I}function zt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Ft=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Gt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Ht(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function Wt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function qt(t){const e=Gt[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Kt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Qt(t){return t.map((e,o)=>{const r=Kt(e.type),n=Ht(e.url),i=Wt(e.url),a=e.title||e.name||qt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Xt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(mt,{className:r}),sse:s.jsx(ht,{className:r}),stdio:s.jsx(vt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Yt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Xt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Zt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,w=d?o:o.filter(ss),u=Qt(w),S=u.length<13?"all":"http",[v,_]=q.useState(S);let p;e:{if(v==="all"){p="all";break e}let h;if(e[0]!==v?(h=E=>E.protocol===v,e[0]=v,e[1]=h):h=e[1],u.some(h)){p=v;break e}if(u.length<13){p="all";break e}p=u[0]?.protocol??"http"}const b=p,m=b==="all"?u:u.filter(h=>h.protocol===b),g=new Set(u.map(ts));let x=Ft.filter(h=>h.value==="all"||g.has(h.value));d||(x=x.filter(es));const T=g.size<=1?x.filter(Jt):x,y="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let j;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(j=h=>s.jsx(xt,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=j):j=e[6];const N=m.map(j);let I;e[7]!==N?(I=s.jsx("div",{className:y,children:N}),e[7]=N,e[8]=I):I=e[8];let M;return e[9]!==m.length?(M=m.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=m.length,e[10]=M):M=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Yt,{options:T,selected:b,onSelect:_}),I,M]})}function Jt(t){return t.value!=="all"}function es(t){return t.value!=="stdio"}function ts(t){return t.protocol}function ss(t){return t.type?.toLowerCase()!=="stdio"}function os(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:w,mcpIcon:u,mcpName:S,showStdio:v}=t,_=a===void 0?!1:a;let p;e[0]!==l?(p=l===void 0?[]:l,e[0]=l,e[1]=p):p=e[1];const b=p,m=w===void 0?!1:w,g=v===void 0?!1:v;let x;e[2]!==i?(x=i.map(rs),e[2]=i,e[3]=x):x=e[3];const T=x;let y;e[4]!==r||e[5]!==n||e[6]!==c?(y=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(dt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=y):y=e[7];let j;e[8]!==n||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==d||e[13]!==b||e[14]!==g?(j=n==="servers"&&b.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Zt,{servers:b,onInstall:h=>d?.(h),isInstalling:m,icon:u,mcpName:S,showStdio:g})}),e[8]=n,e[9]=m,e[10]=u,e[11]=S,e[12]=d,e[13]=b,e[14]=g,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==i.length||e[18]!==_||e[19]!==T?(N=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:_?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(at,{tools:T,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(et,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=_,e[19]=T,e[20]=N):N=e[20];let I;e[21]!==o?.repository||e[22]!==n?(I=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ct,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=I):I=e[23];let M;return e[24]!==I||e[25]!==y||e[26]!==j||e[27]!==N?(M=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[y,j,N,I]}),e[24]=I,e[25]=y,e[26]=j,e[27]=N,e[28]=M):M=e[28],M}function rs(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ns(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function is(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=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||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function ls(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=ut(r.remotes?.[0]?.type),i=pt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Tt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",w=gt(d),u=e?.friendly_name||w,S=e?.mesh_description||t.description||t.summary||r?.description||"",v=e?.short_description||null,_=e?.tags||[],p=e?.categories||[];return{name:u,description:S,shortDescription:v,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:_,categories:p,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 as extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx(Vt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function cs(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=_t.storeShowStdio(),t[2]=d):d=t[2];const[w,u]=wt(d,js),S=l==="true"?!0:l==="false"?!1:w;l!==void 0&&l==="true"!==w&&u(l==="true");const[v,_]=q.useState(null),[p,b]=q.useState(null),m=bt(),g=jt(),{data:x}=Ye.useSession(),T=Nt(g),y=a||T[0]?.id||"",j=yt(y),N=ft(j?.tools),I=j?.tools&&j.tools.find(bs)?.name||"",M=j?.tools&&j.tools.find(vs)?.name||"",h=Pt(y),K=!!c;let E,G;K?(E=I||M,G={name:c}):(E=N,G={});const{data:L}=St({toolCaller:h,toolName:E,toolInputParams:G,scope:y});let V=[],P=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const f=L.item,D=f.id||"",Z=f.server,le=f._meta;let B;t[3]!==f.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:f.title,server:Z,_meta:le}],t[3]=f.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let f;"versions"in L&&Array.isArray(L.versions)?f="versions":"servers"in L&&Array.isArray(L.servers)?f="servers":f=Object.keys(L).find(D=>Array.isArray(L[D])),f&&(V=L[f],(f==="versions"||E?.includes("VERSIONS"))&&(P=V))}}const O=P.findIndex(gs),H=O>=0?O:0,$=p??H;let A;t[8]!==n?(A=f=>{const D=f.name||f.title||f.server.title||"";return It(D)===n},t[8]=n,t[9]=A):A=t[9];let C=V.find(A);if(!C&&c){let f;t[10]!==c?(f=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=f):f=t[11],C=V.find(f)}const k=C?ls(C):null,U=(k?.tools?.length||0)>0,J=C?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=Ct({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(hs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?k?.tools||[]:Te,Ue=ns(g,k?.publisher),Ne=k?is(V,k.publisher,Ue,j??null,z):{count:0},Be=k?.repository?kt(k.repository):null,ze=C?.server?.remotes??[],Oe=C?.server?.packages??[],Se=[...ze.map(xs),...Oe.map(ps)],de=S?Se:Se.filter(us),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!k?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(fs),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(ms)?.id||F.find(ds)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==v||t[30]!==F||t[31]!==_e?(ue=v&&F.find(f=>f.id===v)?v:_e,t[29]=v,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==m||t[34]!==P||t[35]!==o||t[36]!==e||t[37]!==C||t[38]!==x?(pe=async(f,D,Z)=>{const le=P[f??0]||C;if(!le||!e||!x?.user?.id)return;const B=st(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await m.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=m,t[34]=P,t[35]=o,t[36]=e,t[37]=C,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!C){let f;return t[43]!==re?(f=s.jsx($t,{onBack:re}),t[43]=re,t[44]=f):f=t[44],f}if(!k)return null;const Ge=(C?.server?.remotes?.length??0)>0,He=(C?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Dt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&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(Lt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==P||t[50]!==C?(ie=P.length>0?P:[C],t[49]=P,t[50]=C,t[51]=ie):ie=t[51];let ve;t[52]!==m.create.isPending||t[53]!==ne||t[54]!==k||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Rt,{data:k,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:m.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:b}),t[52]=m.create.isPending,t[53]=ne,t[54]=k,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==k||t[61]!==Ne||t[62]!==C?(be=s.jsx(Bt,{data:k,publisherInfo:Ne,selectedItem:C}),t[60]=k,t[61]=Ne,t[62]=C,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=f=>{f._type==="remote"?Y($,f._index,void 0):Y($,void 0,f._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,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:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(os,{data:k,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:_,servers:Se,onInstallServer:je,isInstalling:m.create.isPending,mcpIcon:k.icon,mcpName:k.name,showStdio:S})]})]})})})]})}function ds(t){return t.id==="readme"}function ms(t){return t.id==="servers"}function fs(t){return t.visible}function us(t){return t.type?.toLowerCase()!=="stdio"}function ps(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function xs(t,e){return{...t,_type:"remote",_index:e}}function hs(t){return{name:t.name,description:t.description}}function gs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function vs(t){return t.name.endsWith("_GET")}function bs(t){return t.name.endsWith("_VERSIONS")}function js(){return!1}function ho(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Mt,{}),children:s.jsx(cs,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(as,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{ho as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as _,r as D,v as ie,K as X,ae,j as s,f as se,a as ce,k as me,w as de}from"./index-BdoGlqOh.js";import{g as fe,a as ue}from"./well-known-mcp-DOEdYmKO.js";import{C as xe}from"./collection-header-BfNxri-N.js";import{i as le}from"./FilterLines-Ttp2swRG.js";import{n as pe}from"./Inbox01-BvYPvM_p.js";import{i as Y}from"./Loading01-wy6i08TR.js";import{i as re}from"./SearchMd-DsK25qy7.js";import{b as ge,a as oe,u as he}from"./use-connection-W2V2j8pE.js";import{u as je}from"./useInfiniteQuery-Bx9UQHNH.js";import{c as ve}from"./connection-BdWKvn2K.js";import{a as ye,f as Ne,b as Ce}from"./registry-utils-C1MEHnjt.js";import{u as J}from"./project-context-provider-DhgIBvJ2.js";import{s as be}from"./slugify-CEUa2lfQ.js";import{C as Se}from"./collection-search-9baWd84b.js";import{M as ee}from"./mcp-server-card-CCJD8rY5.js";import{B as Q}from"./button-BQMZIX_4.js";import{I as we}from"./input-B0JGK4qg.js";import{P as Te,a as Ie,b as Re}from"./popover-CXUBdgho.js";import{i as $e}from"./Check-Clnl6VO2.js";import{t as ke}from"./ChevronDown-CUCzTkUk.js";import{s as U}from"./XClose-zOphE63W.js";import{d as Pe,a as ze,b as Fe,c as Le,S as Ke}from"./select--nDzC8in.js";import{s as Ae}from"./Plus-DaMIylfN.js";import{E as Ee}from"./empty-state-DeORHrTg.js";import{u as De}from"./use-binding-CdMfLY85.js";import{L as Me,u as Be}from"./localstorage-keys-DJgrMpsR.js";import"./collection-display-button-Bi_NXbuN.js";import"./dropdown-menu-Cwg_0qoi.js";import"./Grid01-Bf8eAyhK.js";import"./ArrowUp-VMKONnWJ.js";import"./List-C6tpn114.js";import"./tooltip-DSjdME5j.js";import"./view-mode-toggle-DdRtk7o-.js";import"./use-collections-B_r4T3b1.js";import"./useMutation-mOecCzvG.js";import"./infiniteQueryObserver-B-zosqIG.js";import"./Lock01-CGlDIBQ9.js";import"./Terminal-cal0VHQd.js";import"./card-B-rrjyBF.js";import"./github-icon-Dp3wHhYE.js";import"./binder-BxHiGQ64.js";import"./useQuery-B_cnJjvx.js";function Ve(t,e){const l=_.c(4),[o,c]=D.useState(t),r=D.useRef(null),i=D.useRef(!0);let n,g;return l[0]!==e||l[1]!==t?(n=()=>{if(i.current){i.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},g=[t,e],l[0]=e,l[1]=t,l[2]=n,l[3]=g):(n=l[2],g=l[3]),D.useEffect(n,g),o}function Oe(t){const e=_.c(14),l=D.useRef(null),o=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==o?(r=()=>{l.current&&sessionStorage.setItem(o,String(l.current.scrollTop))},e[0]=o,e[1]=r):r=e[1];const i=r;let n;e[2]!==o?(n=()=>{if(c.current===o)return;const f=sessionStorage.getItem(o);if(f&&l.current){const y=Number.parseInt(f,10);l.current.scrollTop=y}c.current=o},e[2]=o,e[3]=n):n=e[3];const g=n;let j;e[4]!==g||e[5]!==o?(j=()=>{c.current!==o&&g()},e[4]=g,e[5]=o,e[6]=j):j=e[6];const u=j;let a;e[7]!==g||e[8]!==o?(a=f=>{l.current=f,f&&c.current!==o&&requestAnimationFrame(()=>{g()})},e[7]=g,e[8]=o,e[9]=a):a=e[9];const v=a;let d;return e[10]!==u||e[11]!==i||e[12]!==v?(d={scrollRef:v,saveScrollPosition:i,handleScroll:u},e[10]=u,e[11]=i,e[12]=v,e[13]=d):d=e[13],d}const We=24;function qe(t){const e=_.c(52),{registryId:l,listToolName:o,filtersToolName:c,search:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[n,g]=D.useState(i);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[1]=j):j=e[1];const[u,a]=D.useState(j);let v;e[2]!==l?(v=ve(l),e[2]=l,e[3]=v):v=e[3];const d=v,f=!!c;let y;e[4]!==c||e[5]!==l?(y=X.toolCall(l,c||"no-filters","{}"),e[4]=c,e[5]=l,e[6]=y):y=e[6];let N;e[7]!==c||e[8]!==d?(N=async()=>c?await d(c,{}):{tags:[],categories:[]},e[7]=c,e[8]=d,e[9]=N):N=e[9];let S;e[10]!==y||e[11]!==N?(S={queryKey:y,queryFn:N,staleTime:36e5},e[10]=y,e[11]=N,e[12]=S):S=e[12];const{data:k}=ie(S);let $,w,b;if(e[13]!==o||e[14]!==l||e[15]!==r||e[16]!==u||e[17]!==n){const O=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;$={limit:We,...n.length>0&&{tags:n},...u.length>0&&{categories:u},...O&&{where:O}},b=je,w=X.toolCall(l,o,JSON.stringify($)),e[13]=o,e[14]=l,e[15]=r,e[16]=u,e[17]=n,e[18]=$,e[19]=w,e[20]=b}else $=e[18],w=e[19],b=e[20];let C;e[21]!==$||e[22]!==o||e[23]!==d?(C=async O=>{const{pageParam:Z}=O,ne=Z?{...$,cursor:Z}:$;return await d(o,ne)},e[21]=$,e[22]=o,e[23]=d,e[24]=C):C=e[24];let T;e[25]!==w||e[26]!==C?(T={queryKey:w,queryFn:C,initialPageParam:void 0,getNextPageParam:_e,staleTime:36e5,placeholderData:ae},e[25]=w,e[26]=C,e[27]=T):T=e[27];const{data:P,fetchNextPage:z,hasNextPage:L,isFetchingNextPage:I,isFetching:m,isLoading:x}=b(T);let h;e:{if(!P?.pages||P.pages.length===0){h=null;break e}const O=P.pages[0];if(typeof O=="object"&&O!==null&&"totalCount"in O&&typeof O.totalCount=="number"){h=O.totalCount;break e}h=null}const R=h,F=P?.pages;let p;e[28]!==F?(p=ye(F),e[28]=F,e[29]=p):p=e[29];const K=p;let A;e[30]!==r||e[31]!==u.length||e[32]!==n.length?(A=n.length>0||u.length>0||!!r?.trim(),e[30]=r,e[31]=u.length,e[32]=n.length,e[33]=A):A=e[33];const E=A,W=m&&!I&&!x&&E;let B;e[34]!==z||e[35]!==L||e[36]!==I?(B=()=>{L&&!I&&z()},e[34]=z,e[35]=L,e[36]=I,e[37]=B):B=e[37];const q=B,G=L??!1,M=f?k?.tags:void 0,V=f?k?.categories:void 0;let H;return e[38]!==E||e[39]!==m||e[40]!==I||e[41]!==W||e[42]!==x||e[43]!==K||e[44]!==q||e[45]!==u||e[46]!==n||e[47]!==G||e[48]!==M||e[49]!==V||e[50]!==R?(H={items:K,totalCount:R,hasMore:G,isLoadingMore:I,isFiltering:W,isInitialLoading:x,isFetching:m,loadMore:q,availableTags:M,availableCategories:V,selectedTags:n,selectedCategories:u,setSelectedTags:g,setSelectedCategories:a,hasActiveFilters:E},e[38]=E,e[39]=m,e[40]=I,e[41]=W,e[42]=x,e[43]=K,e[44]=q,e[45]=u,e[46]=n,e[47]=G,e[48]=M,e[49]=V,e[50]=R,e[51]=H):H=e[51],H}function _e(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ge(t,e){return[...t].sort((l,o)=>o.count-l.count).slice(0,e)}function te(t){const e=_.c(52),{label:l,items:o,selectedItems:c,onToggle:r,onClear:i}=t,[n,g]=D.useState(""),[j,u]=D.useState(!1);let a,v,d,f,y,N,S,k,$,w,b;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==j||e[4]!==n||e[5]!==c){const I=[...n?o.filter(A=>A.value.toLowerCase().includes(n.toLowerCase())):o].sort(He);d=c.length,v=Te,$=j,w=u;let m;e[17]!==l?(m=s.jsx("span",{children:l}),e[17]=l,e[18]=m):m=e[18];let x;e[19]!==d?(x=d>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=x):x=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{size:14,className:"opacity-50"}),e[21]=h):h=e[21],e[22]!==x||e[23]!==m?(b=s.jsx(Ie,{asChild:!0,children:s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[m,x,h]})}),e[22]=x,e[23]=m,e[24]=b):b=e[24],a=Re,N="w-64 p-0",S="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(re,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const p=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=A=>g(A.target.value),e[28]=K):K=e[28],e[29]!==n||e[30]!==p?(k=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(we,{type:"text",placeholder:p,value:n,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=n,e[30]=p,e[31]=k):k=e[31],f="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",y=I.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):I.map(A=>{const E=c.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:`w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors ${E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"}`,children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx($e,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=o,e[1]=l,e[2]=r,e[3]=j,e[4]=n,e[5]=c,e[6]=a,e[7]=v,e[8]=d,e[9]=f,e[10]=y,e[11]=N,e[12]=S,e[13]=k,e[14]=$,e[15]=w,e[16]=b}else a=e[6],v=e[7],d=e[8],f=e[9],y=e[10],N=e[11],S=e[12],k=e[13],$=e[14],w=e[15],b=e[16];let C;e[32]!==f||e[33]!==y?(C=s.jsx("div",{className:f,children:y}),e[32]=f,e[33]=y,e[34]=C):C=e[34];let T;e[35]!==l||e[36]!==i||e[37]!==d?(T=d>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(Q,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=i,e[37]=d,e[38]=T):T=e[38];let P;e[39]!==a||e[40]!==T||e[41]!==N||e[42]!==S||e[43]!==k||e[44]!==C?(P=s.jsxs(a,{className:N,align:S,children:[k,C,T]}),e[39]=a,e[40]=T,e[41]=N,e[42]=S,e[43]=k,e[44]=C,e[45]=P):P=e[45];let z;return e[46]!==v||e[47]!==P||e[48]!==$||e[49]!==w||e[50]!==b?(z=s.jsxs(v,{open:$,onOpenChange:w,children:[b,P]}),e[46]=v,e[47]=P,e[48]=$,e[49]=w,e[50]=b,e[51]=z):z=e[51],z}function He(t,e){return e.count-t.count}function Qe(t){const e=_.c(67),{availableTags:l,availableCategories:o,selectedTags:c,selectedCategories:r,onTagChange:i,onCategoryChange:n}=t,g=l&&l.length>0||o&&o.length>0,j=c.length>0||r.length>0;if(!g)return null;let u;e[0]!==i||e[1]!==c?(u=m=>{c.includes(m)?i(c.filter(x=>x!==m)):i([...c,m])},e[0]=i,e[1]=c,e[2]=u):u=e[2];const a=u;let v;e[3]!==n||e[4]!==r?(v=m=>{r.includes(m)?n(r.filter(x=>x!==m)):n([...r,m])},e[3]=n,e[4]=r,e[5]=v):v=e[5];const d=v;let f;e[6]!==n||e[7]!==i?(f=()=>{i([]),n([])},e[6]=n,e[7]=i,e[8]=f):f=e[8];const y=f;let N,S,k,$,w,b,C;if(e[9]!==o||e[10]!==l||e[11]!==n||e[12]!==i||e[13]!==r||e[14]!==c||e[15]!==d||e[16]!==a){const m=o?Ge(o,6):[];N=r,S=c,C=new Set(m.map(Ue)),w="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(le,{size:16})}),e[24]=x):x=e[24];let h;e[25]!==o||e[26]!==n||e[27]!==r||e[28]!==d?(h=o&&o.length>0&&s.jsx(te,{label:"Categories",items:o,selectedItems:r,onToggle:d,onClear:()=>n([])}),e[25]=o,e[26]=n,e[27]=r,e[28]=d,e[29]=h):h=e[29];let R;e[30]!==l||e[31]!==i||e[32]!==c||e[33]!==a?(R=l&&l.length>0&&s.jsx(te,{label:"Tags",items:l,selectedItems:c,onToggle:a,onClear:()=>i([])}),e[30]=l,e[31]=i,e[32]=c,e[33]=a,e[34]=R):R=e[34],e[35]!==R||e[36]!==h?(b=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,h,R]}),e[35]=R,e[36]=h,e[37]=b):b=e[37],k="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==d?(F=p=>{const K=r.includes(p.value);return s.jsxs("div",{onClick:()=>d(p.value),className:`inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer ${K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"}`,children:[s.jsx("span",{children:p.value}),K&&s.jsx("span",{onClick:A=>{A.stopPropagation(),d(p.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},p.value)},e[38]=r,e[39]=d,e[40]=F):F=e[40],$=m.map(F),e[9]=o,e[10]=l,e[11]=n,e[12]=i,e[13]=r,e[14]=c,e[15]=d,e[16]=a,e[17]=N,e[18]=S,e[19]=k,e[20]=$,e[21]=w,e[22]=b,e[23]=C}else N=e[17],S=e[18],k=e[19],$=e[20],w=e[21],b=e[22],C=e[23];let T;if(e[41]!==N||e[42]!==d||e[43]!==C){let m;e[45]!==C?(m=h=>!C.has(h),e[45]=C,e[46]=m):m=e[46];let x;e[47]!==d?(x=h=>s.jsxs("div",{onClick:()=>d(h),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:h}),s.jsx("span",{onClick:R=>{R.stopPropagation(),d(h)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},`cat-${h}`),e[47]=d,e[48]=x):x=e[48],T=N.filter(m).map(x),e[41]=N,e[42]=d,e[43]=C,e[44]=T}else T=e[44];let P;if(e[49]!==S||e[50]!==a){let m;e[52]!==a?(m=x=>s.jsxs("div",{onClick:()=>a(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:h=>{h.stopPropagation(),a(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(U,{size:12})})]},`tag-${x}`),e[52]=a,e[53]=m):m=e[53],P=S.map(m),e[49]=S,e[50]=a,e[51]=P}else P=e[51];let z;e[54]!==y||e[55]!==j?(z=j&&s.jsxs(Q,{variant:"ghost",size:"sm",onClick:y,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(U,{size:14}),"Clear all"]}),e[54]=y,e[55]=j,e[56]=z):z=e[56];let L;e[57]!==z||e[58]!==k||e[59]!==$||e[60]!==T||e[61]!==P?(L=s.jsxs("div",{className:k,children:[$,T,P,z]}),e[57]=z,e[58]=k,e[59]=$,e[60]=T,e[61]=P,e[62]=L):L=e[62];let I;return e[63]!==L||e[64]!==w||e[65]!==b?(I=s.jsxs("div",{className:w,children:[b,L]}),e[63]=L,e[64]=w,e[65]=b,e[66]=I):I=e[66],I}function Ue(t){return t.value}function Ye(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(o=>(o.name||o.title||"").toLowerCase().includes(l)||(o.description||o.server.description||"").toLowerCase().includes(l))}function Je(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function Ze(t){const e=_.c(54),{registryId:l,listToolName:o,filtersToolName:c}=t,[r,i]=D.useState(""),n=Ve(r,300),g=se(),{org:j}=J(),{scrollRef:u,saveScrollPosition:a,handleScroll:v}=Oe(`store-discovery:${l}`);let d;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==l?(d={registryId:l,listToolName:o,filtersToolName:c,search:n},e[0]=n,e[1]=c,e[2]=o,e[3]=l,e[4]=d):d=e[4];const{items:f,hasMore:y,isLoadingMore:N,isInitialLoading:S,isFetching:k,loadMore:$,availableTags:w,availableCategories:b,selectedTags:C,selectedCategories:T,setSelectedTags:P,setSelectedCategories:z,hasActiveFilters:L}=qe(d);let I,m,x,h;e[5]!==n||e[6]!==k||e[7]!==S||e[8]!==f||e[9]!==r?(I=r?Ye(f,r):f,m=(r!==n||k)&&!S&&!!r,h=I.filter(Je),x=I.filter(M=>!h.find(V=>V.id===M.id)),e[5]=n,e[6]=k,e[7]=S,e[8]=f,e[9]=r,e[10]=I,e[11]=m,e[12]=x,e[13]=h):(I=e[10],m=e[11],x=e[12],h=e[13]);const R=x;let F;e[14]!==g||e[15]!==j.slug||e[16]!==l||e[17]!==a?(F=M=>{a();const V=be(M.name||M.title||M.server.title||""),H=M.server.name;g({to:"/$org/store/$appName",params:{org:j.slug,appName:V},search:{registryId:l,serverName:H}})},e[14]=g,e[15]=j.slug,e[16]=l,e[17]=a,e[18]=F):F=e[18];const p=F;let K;e[19]!==v||e[20]!==y||e[21]!==N||e[22]!==$?(K=M=>{if(v(),!y||N)return;const V=M.currentTarget;V.scrollHeight-V.scrollTop-V.clientHeight<200&&$()},e[19]=v,e[20]=y,e[21]=N,e[22]=$,e[23]=K):K=e[23];const A=K;let E;e[24]!==m||e[25]!==r?(E=s.jsx(Se,{value:r,onChange:i,placeholder:"Search for an MCP Server...",isSearching:m}),e[24]=m,e[25]=r,e[26]=E):E=e[26];let W;e[27]!==b||e[28]!==w||e[29]!==T||e[30]!==C||e[31]!==z||e[32]!==P?(W=s.jsx(Qe,{availableTags:w,availableCategories:b,selectedTags:C,selectedCategories:T,onTagChange:P,onCategoryChange:z}),e[27]=b,e[28]=w,e[29]=T,e[30]=C,e[31]=z,e[32]=P,e[33]=W):W=e[33];let B;e[34]!==R||e[35]!==I||e[36]!==p||e[37]!==L||e[38]!==y||e[39]!==S||e[40]!==N||e[41]!==m||e[42]!==f||e[43]!==r||e[44]!==h?(B=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:S?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):f.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(pe,{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."})]}):f.length===0&&L&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&I.length===0&&!m?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 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:[m&&I.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Y,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),h.length>0&&s.jsx(ee,{items:h,title:"Verified",onItemClick:p}),R.length>0&&s.jsx(ee,{items:R,title:h.length>0?"All":"",onItemClick:p}),y&&N&&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(Y,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=I,e[36]=p,e[37]=L,e[38]=y,e[39]=S,e[40]=N,e[41]=m,e[42]=f,e[43]=r,e[44]=h,e[45]=B):B=e[45];let q;e[46]!==A||e[47]!==u||e[48]!==B?(q=s.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",onScroll:A,children:B}),e[46]=A,e[47]=u,e[48]=B,e[49]=q):q=e[49];let G;return e[50]!==E||e[51]!==W||e[52]!==q?(G=s.jsxs("div",{className:"flex flex-col h-full",children:[E,W,q]}),e[50]=E,e[51]=W,e[52]=q,e[53]=G):G=e[53],G}function Xe(t){const e=_.c(8),{registryId:l}=t,o=ge(l),c=o?.tools;let r;e[0]!==c?(r=Ne(c),e[0]=c,e[1]=r):r=e[1];const i=r;if(!i)throw new Error("This registry does not support listing store items.");const n=o?.tools;let g;e[2]!==n?(g=Ce(n),e[2]=n,e[3]=g):g=e[3];const u=g||void 0;let a;return e[4]!==i||e[5]!==l||e[6]!==u?(a=s.jsx(Ze,{registryId:l,listToolName:i,filtersToolName:u}),e[4]=i,e[5]=l,e[6]=u,e[7]=a):a=e[7],a}function et(t){const e=_.c(15),{registries:l,value:o,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:i,placeholder:n}=t,g=n===void 0?"Select a registry...":n;let j;e[0]!==g?(j=s.jsx(ze,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Fe,{placeholder:g})}),e[0]=g,e[1]=j):j=e[1];let u;e[2]!==l?(u=l.map(tt),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==r||e[5]!==i?(a=i.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"}),i.map(f=>s.jsxs("button",{onClick:y=>{y.preventDefault(),y.stopPropagation(),r(f)},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:[f.icon?s.jsx("img",{src:f.icon,alt:f.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:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Ae,{size:16})})]},f.id??f.title))]}),e[4]=r,e[5]=i,e[6]=a):a=e[6];let v;e[7]!==u||e[8]!==a?(v=s.jsxs(Le,{children:[u,a]}),e[7]=u,e[8]=a,e[9]=v):v=e[9];let d;return e[10]!==c||e[11]!==j||e[12]!==v||e[13]!==o?(d=s.jsxs(Ke,{value:o,onValueChange:c,children:[j,v]}),e[10]=c,e[11]=j,e[12]=v,e[13]=o,e[14]=d):d=e[14],d}function tt(t){return s.jsx(Pe,{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 st({registries:t,onConnected:e}){const l=oe(),{org:{slug:o}}=J(),{data:c}=ce.useSession(),r=se(),[i,n]=D.useState(!1),g=t[0],j=async()=>{if(!(!g||!c?.user?.id)){n(!0);try{const a=await l.create.mutateAsync(g);e?.(a.id)}finally{n(!1)}}},u=()=>{r({to:"/$org/mcps",params:{org:o},search:{action:"create"}})};return s.jsx(Ee,{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(Q,{variant:"outline",onClick:j,disabled:i||!g,children:[g?.icon&&s.jsx("img",{src:g.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),s.jsx(Q,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function Ut(){const t=_.c(41),{org:e}=J(),l=he(),o=oe(),c=me(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,i=De(l);let n;t[0]!==i?(n=i.map(ot),t[0]=i,t[1]=n):n=t[1];const g=n;let j;t[2]!==e.slug?(j=Me.selectedRegistry(e.slug),t[2]=e.slug,t[3]=j):j=t[3];const[u,a]=Be(j,rt);let v;if(t[4]!==i||t[5]!==u){let p;t[7]!==u?(p=K=>K.id===u,t[7]=u,t[8]=p):p=t[8],v=i.find(p),t[4]=i,t[5]=u,t[6]=v}else v=t[6];const f=v?.id||i[0]?.id||"";let y;t[9]!==e.id?(y=fe(e.id),t[9]=e.id,t[10]=y):y=t[10];let N;t[11]!==y?(N=[y],t[11]=y,t[12]=N):N=t[12];const S=N;let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k=[ue()],t[13]=k):k=t[13];const $=k;let w;t[14]!==o.create||t[15]!==a?(w=async p=>{const K=await o.create.mutateAsync(p);a(K.id)},t[14]=o.create,t[15]=a,t[16]=w):w=t[16];const b=w;let C;t[17]!==i?(C=new Set(i.map(lt)),t[17]=i,t[18]=C):C=t[18];const T=C;let P;t[19]!==T||t[20]!==S?(P=S.filter(p=>p.id&&!T.has(p.id)),t[19]=T,t[20]=S,t[21]=P):P=t[21];const z=P;let L;t[22]!==T?(L=$.filter(p=>p.id&&!T.has(p.id)),t[22]=T,t[23]=L):L=t[23];const I=L;if(r){let p;return t[24]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(de,{}),t[24]=p):p=t[24],p}let m;t[25]!==b?(m=async p=>b(p),t[25]=b,t[26]=m):m=t[26];let x;t[27]!==z||t[28]!==f||t[29]!==g||t[30]!==a||t[31]!==m?(x=s.jsx(xe,{title:"Store",ctaButton:s.jsx(et,{wellKnownRegistries:z,registries:g,value:f,onValueChange:a,onAddWellKnown:m,placeholder:"Select store..."})}),t[27]=z,t[28]=f,t[29]=g,t[30]=a,t[31]=m,t[32]=x):x=t[32];let h;t[33]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Y,{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]=h):h=t[33];let R;t[34]!==I||t[35]!==f||t[36]!==a?(R=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(D.Suspense,{fallback:h,children:f?s.jsx(Xe,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(st,{registries:I,onConnected:p=>{a(p)}})})})}),t[34]=I,t[35]=f,t[36]=a,t[37]=R):R=t[37];let F;return t[38]!==x||t[39]!==R?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[x,R]}),t[38]=x,t[39]=R,t[40]=F):F=t[40],F}function lt(t){return t.id}function rt(t){return t??""}function ot(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Ut as default};
|