@decocms/mesh 1.0.0-alpha.4 → 1.0.0-alpha.40
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/README.md +287 -0
- package/dist/client/assets/AlertCircle-DXrRWAdV.js +1 -0
- package/dist/client/assets/ArrowLeft-B2kSl8Am.js +1 -0
- package/dist/client/assets/CheckCircle-BjfQSM1r.js +1 -0
- package/dist/client/assets/ChevronDown-LB39JZIr.js +1 -0
- package/dist/client/assets/Clock-umdgxXOC.js +1 -0
- package/dist/client/assets/Copy01-Bilz-YTB.js +1 -0
- package/dist/client/assets/CpuChip02-CHm038ee.js +1 -0
- package/dist/client/assets/DotsVertical-Bpn8NPVg.js +1 -0
- package/dist/client/assets/File06-88jNCz1V.js +1 -0
- package/dist/client/assets/Grid01-irgYf3_6.js +1 -0
- package/dist/client/assets/Inbox01-CoVSGBs_.js +1 -0
- package/dist/client/assets/InfoCircle-D7V0pgdh.js +1 -0
- package/dist/client/assets/Key01-CKDDrXuQ.js +1 -0
- package/dist/client/assets/LinkExternal01-BWsuTDiz.js +1 -0
- package/dist/client/assets/Loading01-BWm5a2UX.js +1 -0
- package/dist/client/assets/Plus-Slubr3Mn.js +1 -0
- package/dist/client/assets/SearchMd-D-BfTFbd.js +1 -0
- package/dist/client/assets/Trash01-QqFxB-ic.js +1 -0
- package/dist/client/assets/Upload01-BSDcq_ig.js +1 -0
- package/dist/client/assets/X-qVvh8Z0J.js +1 -0
- package/dist/client/assets/XClose-Crvz7f11.js +1 -0
- package/dist/client/assets/{alert-dialog-BvyEfL2D.js → alert-dialog-BKLc86P2.js} +2 -2
- package/dist/client/assets/app-name-gTETL9So.js +1 -0
- package/dist/client/assets/{auth-catchall-BBilN1Dc.js → auth-catchall-BAv_qdLN.js} +1 -1
- package/dist/client/assets/auth-g7Ue41hR.js +1 -0
- package/dist/client/assets/avatar-7mHRD9aF.js +1 -0
- package/dist/client/assets/badge-CuERIkGI.js +1 -0
- package/dist/client/assets/button-WiHHb1ae.js +1 -0
- package/dist/client/assets/{card-DFBJ_uBy.js → card-BCizSi8r.js} +1 -1
- package/dist/client/assets/checkbox-D_yjB9VU.js +1 -0
- package/dist/client/assets/collection-detail-CgNwKBY0.js +1 -0
- package/dist/client/assets/collection-display-button-C_wVSNLi.js +1 -0
- package/dist/client/assets/collection-header-l34pbgNv.js +1 -0
- package/dist/client/assets/{collection-page-DwBYqm_T.js → collection-page-BP2Cy5Z_.js} +1 -1
- package/dist/client/assets/collection-search-ByjFbpzN.js +1 -0
- package/dist/client/assets/collection-table-wrapper-PcMFmqtb.js +1 -0
- package/dist/client/assets/connection-card-DeV1geDy.js +1 -0
- package/dist/client/assets/connection-detail-z_aMgOoM.js +1 -0
- package/dist/client/assets/connections-FFVYK2AT.js +1 -0
- package/dist/client/assets/core-BdjBMvYV.js +6 -0
- package/dist/client/assets/create-organization-dialog-DVhMCLRC.js +1 -0
- package/dist/client/assets/deco-chat-skeleton-DyT_mbhr.js +124 -0
- package/dist/client/assets/dialog-CbMK5n2S.js +1 -0
- package/dist/client/assets/dropdown-menu-24ciec9y.js +1 -0
- package/dist/client/assets/error-boundary-Bstevc3G.js +1 -0
- package/dist/client/assets/{extract-connection-data-DrneYG29.js → extract-connection-data-BDRFIBL1.js} +1 -1
- package/dist/client/assets/form-BrDOMpvk.js +1 -0
- package/dist/client/assets/gateway-detail-DT2HrSfW.js +1 -0
- package/dist/client/assets/gateways-DSDcO81b.js +1 -0
- package/dist/client/assets/home-jplK_fO7.js +1 -0
- package/dist/client/assets/index-1pyJ2pUa.js +32 -0
- package/dist/client/assets/index-BXYAUeFB.js +118 -0
- package/dist/client/assets/index-C3HgpkDC.js +1 -0
- package/dist/client/assets/index-CyW1ja-u.css +1 -0
- package/dist/client/assets/index-RVsrtNt7.js +1 -0
- package/dist/client/assets/{input-NL8_dTk4.js → input-BElOouK2.js} +1 -1
- package/dist/client/assets/json-BESjz4hO.js +1 -0
- package/dist/client/assets/json-CtipqR6C.js +1 -0
- package/dist/client/assets/json-syntax-highlighter-D6mKVwSQ.js +2 -0
- package/dist/client/assets/layout-BDLGK1gR.js +1 -0
- package/dist/client/assets/lazy-highlighter-nw4fsvsj.js +4 -0
- package/dist/client/assets/localstorage-keys-BbAFEk_U.js +1 -0
- package/dist/client/assets/login-DlVoXdaF.js +1 -0
- package/dist/client/assets/mcp-oauth-O6gPUgdn.js +1 -0
- package/dist/client/assets/members-DnI1WLbh.js +3 -0
- package/dist/client/assets/monitoring-WJqycdC6.js +1 -0
- package/dist/client/assets/oauth-callback-C-msM3ED.js +1 -0
- package/dist/client/assets/page-BZV40eAE.css +1 -0
- package/dist/client/assets/page-CKHPoEps.js +21 -0
- package/dist/client/assets/popover--gsKamR2.js +1 -0
- package/dist/client/assets/prism-light-DntDK3V1.js +1 -0
- package/dist/client/assets/resource-tabs-BwUWNlYE.js +1 -0
- package/dist/client/assets/schema-DxhaF6b0.js +1 -0
- package/dist/client/assets/select-DuRyb06m.js +1 -0
- package/dist/client/assets/settings-Cf2w5DBP.js +1 -0
- package/dist/client/assets/shell-layout-Ca0-di6U.js +17 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/spinner-CkZFBFUf.js +1 -0
- package/dist/client/assets/store-BCi6vudl.js +1 -0
- package/dist/client/assets/store-app-detail-CjU1HPaK.js +1 -0
- package/dist/client/assets/switch-D3JJPNlW.js +1 -0
- package/dist/client/assets/{textarea-DAuZp-vs.js → textarea-4CYb655q.js} +1 -1
- package/dist/client/assets/tooltip-Dgdin-_i.js +1 -0
- package/dist/client/assets/types-DaSChKd_.js +44 -0
- package/dist/client/assets/use-binding-BgnJVxG_.js +5 -0
- package/dist/client/assets/use-connection-DcTy916p.js +2 -0
- package/dist/client/assets/{use-gateway-gKeEvLRE.js → use-gateway-I6Ko0Jgt.js} +1 -1
- package/dist/client/assets/use-list-state-SFgQOu4M.js +1 -0
- package/dist/client/assets/use-mcp-CiOCImLK.js +1 -0
- package/dist/client/assets/use-members-DZwzW0q9.js +1 -0
- package/dist/client/assets/{use-mobile-BXGgFxUH.js → use-mobile-_Q7J0JGT.js} +1 -1
- package/dist/client/assets/use-organization-settings-CWarZMrC.js +1 -0
- package/dist/client/assets/use-tool-call-BWqj0h3N.js +1 -0
- package/dist/client/assets/useQuery-C_tbj2zS.js +1 -0
- package/dist/client/assets/utils-D2m6QoGq.js +1 -0
- package/dist/client/assets/well-known-mcp-6m7w8EhN.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +247 -254
- package/dist/server/migrate.js +206 -204
- package/dist/server/server.js +261 -270
- package/package.json +10 -7
- package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
- package/dist/client/assets/auth-CYg5mzvi.js +0 -1
- package/dist/client/assets/avatar-UcUmG598.js +0 -1
- package/dist/client/assets/badge-DO3BPtZ-.js +0 -1
- package/dist/client/assets/button-BeTb9YZU.js +0 -1
- package/dist/client/assets/checkbox-Ep63AJ5F.js +0 -1
- package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
- package/dist/client/assets/circle-alert-BjmT_0vz.js +0 -1
- package/dist/client/assets/collection-detail-sG8EIVfm.js +0 -1
- package/dist/client/assets/collection-display-button-DE8BFxrp.js +0 -1
- package/dist/client/assets/collection-header-DNBGdgEG.js +0 -1
- package/dist/client/assets/collection-search-C3auuf0Y.js +0 -1
- package/dist/client/assets/collection-table-wrapper-z4CuwV_C.js +0 -1
- package/dist/client/assets/connection-card-BbhdU3sl.js +0 -1
- package/dist/client/assets/connection-detail-DfywFkvi.js +0 -1
- package/dist/client/assets/connections-DgCJgxmU.js +0 -1
- package/dist/client/assets/create-organization-dialog-Bde9CI-n.js +0 -1
- package/dist/client/assets/dialog-BT08DzpN.js +0 -1
- package/dist/client/assets/dropdown-menu-DsWv8lkW.js +0 -1
- package/dist/client/assets/empty-state-DCGHu7Ht.js +0 -1
- package/dist/client/assets/error-boundary-dk0EDCPp.js +0 -1
- package/dist/client/assets/form-BmmDx2Hv.js +0 -1
- package/dist/client/assets/gateway-detail-DlujL-fA.js +0 -1
- package/dist/client/assets/gateways-C0s_xtLd.js +0 -1
- package/dist/client/assets/home-BUeYyp--.js +0 -1
- package/dist/client/assets/icon-HmCDqOPd.js +0 -1
- package/dist/client/assets/index-BMEwImqy.js +0 -32
- package/dist/client/assets/index-BrYbjxXv.js +0 -1
- package/dist/client/assets/index-CxSCpakB.js +0 -118
- package/dist/client/assets/index-DmUDvTrM.js +0 -1
- package/dist/client/assets/index-Dt9jPzUp.js +0 -1
- package/dist/client/assets/index-feMggVqN.css +0 -1
- package/dist/client/assets/integration-icon-B5ZzeehM.js +0 -1
- package/dist/client/assets/layout-CKQw59Ep.js +0 -1
- package/dist/client/assets/lazy-highlighter-DOxi3dm5.js +0 -1
- package/dist/client/assets/localstorage-keys-CT9IjLo2.js +0 -1
- package/dist/client/assets/login-CVO6DM5O.js +0 -1
- package/dist/client/assets/members-DloLkRIF.js +0 -1
- package/dist/client/assets/monitoring-BzP-NKj7.js +0 -1
- package/dist/client/assets/monitoring-stats-row-D3nSXKWj.js +0 -42
- package/dist/client/assets/oauth-callback-CNapBDIq.js +0 -10
- package/dist/client/assets/page-CYEiDnba.js +0 -1
- package/dist/client/assets/popover-Dqhqu57Q.js +0 -1
- package/dist/client/assets/prism-BM0Im-Yv.js +0 -9
- package/dist/client/assets/resource-tabs-Cyi6PwbN.js +0 -1
- package/dist/client/assets/schema-DlhuekEX.js +0 -1
- package/dist/client/assets/select-BOj5RERj.js +0 -1
- package/dist/client/assets/settings-C_okskGZ.js +0 -1
- package/dist/client/assets/shell-layout-DWIG-gbq.js +0 -124
- package/dist/client/assets/spinner-wv31KLi9.js +0 -1
- package/dist/client/assets/store-Czna7Dgw.js +0 -1
- package/dist/client/assets/store-app-detail-Kn0xLpzy.js +0 -1
- package/dist/client/assets/tool-set-selector-BYF6NlFy.js +0 -1
- package/dist/client/assets/tooltip-BKoAX5gw.js +0 -1
- package/dist/client/assets/upload-DnaQ_f0x.js +0 -1
- package/dist/client/assets/use-binding-BfGhaGVE.js +0 -5
- package/dist/client/assets/use-connection-v-w_yxra.js +0 -2
- package/dist/client/assets/use-list-state-j-4cxeBJ.js +0 -1
- package/dist/client/assets/use-members-C80sliR8.js +0 -1
- package/dist/client/assets/use-organization-settings-ClRwCrjK.js +0 -1
- package/dist/client/assets/use-tool-call-CqAWykKA.js +0 -1
- package/dist/client/assets/useQuery-CkIva3b0.js +0 -1
- package/dist/client/assets/utils-BGgJIaEU.js +0 -1
- package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/mesh",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.40",
|
|
4
4
|
"description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Deco team",
|
|
@@ -35,12 +35,16 @@
|
|
|
35
35
|
"prepublishOnly": "bun run build:client && bun run build:server"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@untitledui/icons": "^0.0.19",
|
|
39
|
+
"@jitl/quickjs-wasmfile-release-sync": "^0.31.0",
|
|
40
|
+
"@xyflow/react": "^12.10.0",
|
|
38
41
|
"kysely": "^0.28.8",
|
|
39
|
-
"kysely-bun-worker": "^0.6.0"
|
|
42
|
+
"kysely-bun-worker": "^0.6.0",
|
|
43
|
+
"quickjs-emscripten-core": "^0.31.0"
|
|
40
44
|
},
|
|
41
45
|
"devDependencies": {
|
|
42
|
-
"@ai-sdk/provider": "^
|
|
43
|
-
"@ai-sdk/react": "^
|
|
46
|
+
"@ai-sdk/provider": "^3.0.0",
|
|
47
|
+
"@ai-sdk/react": "^3.0.1",
|
|
44
48
|
"@better-auth/sso": "1.4.1",
|
|
45
49
|
"@daveyplate/better-auth-ui": "^3.2.7",
|
|
46
50
|
"@deco/ui": "workspace:*",
|
|
@@ -79,7 +83,8 @@
|
|
|
79
83
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
80
84
|
"@vercel/nft": "^1.1.1",
|
|
81
85
|
"@vitejs/plugin-react": "^5.1.0",
|
|
82
|
-
"
|
|
86
|
+
"@xyflow/react": "^12.10.0",
|
|
87
|
+
"ai": "^6.0.1",
|
|
83
88
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
84
89
|
"better-auth": "1.4.5",
|
|
85
90
|
"class-variance-authority": "^0.7.1",
|
|
@@ -93,7 +98,6 @@
|
|
|
93
98
|
"idb-keyval": "^6.2.2",
|
|
94
99
|
"input-otp": "^1.4.2",
|
|
95
100
|
"jose": "^6.0.11",
|
|
96
|
-
"lucide-react": "^0.552.0",
|
|
97
101
|
"nanoid": "^5.1.6",
|
|
98
102
|
"pg": "^8.16.3",
|
|
99
103
|
"react": "^19.2.0",
|
|
@@ -105,7 +109,6 @@
|
|
|
105
109
|
"tailwind-merge": "^3.3.1",
|
|
106
110
|
"tailwindcss": "^4.1.17",
|
|
107
111
|
"typescript": "^5.9.3",
|
|
108
|
-
"use-mcp": "^0.0.21",
|
|
109
112
|
"vite": "^7.2.1",
|
|
110
113
|
"vite-tsconfig-paths": "^5.1.4",
|
|
111
114
|
"zod": "^3.25.76",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function p(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function i(e){if(!e.includes("/"))return e;const a=e.split("/"),r=a[0],t=a[1];if(!r||!t)return e;if(r.includes(".")){const s=r.split("."),c=s[s.length-1]||r,n=t.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!n||n.length<2?c:n}return t}export{i as e,p as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as r,bX as n,bj as i,bq as _,br as y,aq as t,bs as f,bi as k,bn as u,bl as O,bk as I,bY as ze,bp as Ve,bZ as He,b_ as De}from"./index-CxSCpakB.js";const ae="2025-06-18",xo=[ae,"2025-03-26","2024-11-05","2024-10-07"],z="2.0",fe=y([t(),f().int()]),we=t(),Je=r({progressToken:n(fe)}).passthrough(),x=r({_meta:n(Je)}).passthrough(),S=r({method:t(),params:n(x)}),q=r({_meta:n(r({}).passthrough())}).passthrough(),b=r({method:t(),params:n(q)}),C=r({_meta:n(r({}).passthrough())}).passthrough(),V=y([t(),f().int()]),Re=r({jsonrpc:u(z),id:V}).merge(S).strict(),Co=e=>Re.safeParse(e).success,ye=r({jsonrpc:u(z)}).merge(b).strict(),To=e=>ye.safeParse(e).success,Se=r({jsonrpc:u(z),id:V,result:C}).strict(),bo=e=>Se.safeParse(e).success;var me;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"})(me||(me={}));const ve=r({jsonrpc:u(z),id:V,error:r({code:f().int(),message:t(),data:n(O())})}).strict(),Po=e=>ve.safeParse(e).success,ko=y([Re,ye,Se,ve]),xe=C.strict(),Ce=b.extend({method:u("notifications/cancelled"),params:q.extend({requestId:V,reason:t().optional()})}),We=r({src:t(),mimeType:n(t()),sizes:n(i(t()))}).passthrough(),A=r({icons:i(We).optional()}).passthrough(),M=r({name:t(),title:n(t())}).passthrough(),Te=M.extend({version:t(),websiteUrl:n(t())}).merge(A),Be=r({experimental:n(r({}).passthrough()),sampling:n(r({}).passthrough()),elicitation:n(r({}).passthrough()),roots:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ge=S.extend({method:u("initialize"),params:x.extend({protocolVersion:t(),capabilities:Be,clientInfo:Te})}),Ze=r({experimental:n(r({}).passthrough()),logging:n(r({}).passthrough()),completions:n(r({}).passthrough()),prompts:n(r({listChanged:n(_())}).passthrough()),resources:n(r({subscribe:n(_()),listChanged:n(_())}).passthrough()),tools:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ye=C.extend({protocolVersion:t(),capabilities:Ze,serverInfo:Te,instructions:n(t())}),be=b.extend({method:u("notifications/initialized")}),Uo=e=>be.safeParse(e).success,Pe=S.extend({method:u("ping")}),Xe=r({progress:f(),total:n(f()),message:n(t())}).passthrough(),ke=b.extend({method:u("notifications/progress"),params:q.merge(Xe).extend({progressToken:fe})}),H=S.extend({params:x.extend({cursor:n(we)}).optional()}),D=C.extend({nextCursor:n(we)}),Ue=r({uri:t(),mimeType:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Le=Ue.extend({text:t()}),ie=t().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ee=Ue.extend({blob:ie}),Oe=M.extend({uri:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Ke=M.extend({uriTemplate:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Qe=H.extend({method:u("resources/list")}),Fe=D.extend({resources:i(Oe)}),et=H.extend({method:u("resources/templates/list")}),tt=D.extend({resourceTemplates:i(Ke)}),ot=S.extend({method:u("resources/read"),params:x.extend({uri:t()})}),nt=C.extend({contents:i(y([Le,Ee]))}),st=b.extend({method:u("notifications/resources/list_changed")}),rt=S.extend({method:u("resources/subscribe"),params:x.extend({uri:t()})}),at=S.extend({method:u("resources/unsubscribe"),params:x.extend({uri:t()})}),it=b.extend({method:u("notifications/resources/updated"),params:q.extend({uri:t()})}),ct=r({name:t(),description:n(t()),required:n(_())}).passthrough(),ut=M.extend({description:n(t()),arguments:n(i(ct)),_meta:n(r({}).passthrough())}).merge(A),lt=H.extend({method:u("prompts/list")}),pt=D.extend({prompts:i(ut)}),dt=S.extend({method:u("prompts/get"),params:x.extend({name:t(),arguments:n(I(t()))})}),ce=r({type:u("text"),text:t(),_meta:n(r({}).passthrough())}).passthrough(),ue=r({type:u("image"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),le=r({type:u("audio"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),ht=r({type:u("resource"),resource:y([Le,Ee]),_meta:n(r({}).passthrough())}).passthrough(),mt=Oe.extend({type:u("resource_link")}),Ie=y([ce,ue,le,mt,ht]),_t=r({role:k(["user","assistant"]),content:Ie}).passthrough(),gt=C.extend({description:n(t()),messages:i(_t)}),ft=b.extend({method:u("notifications/prompts/list_changed")}),wt=r({title:n(t()),readOnlyHint:n(_()),destructiveHint:n(_()),idempotentHint:n(_()),openWorldHint:n(_())}).passthrough(),Rt=M.extend({description:n(t()),inputSchema:r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough(),outputSchema:n(r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough()),annotations:n(wt),_meta:n(r({}).passthrough())}).merge(A),yt=H.extend({method:u("tools/list")}),St=D.extend({tools:i(Rt)}),qe=C.extend({content:i(Ie).default([]),structuredContent:r({}).passthrough().optional(),isError:n(_())});qe.or(C.extend({toolResult:O()}));const vt=S.extend({method:u("tools/call"),params:x.extend({name:t(),arguments:n(I(O()))})}),xt=b.extend({method:u("notifications/tools/list_changed")}),Ae=k(["debug","info","notice","warning","error","critical","alert","emergency"]),Ct=S.extend({method:u("logging/setLevel"),params:x.extend({level:Ae})}),Tt=b.extend({method:u("notifications/message"),params:q.extend({level:Ae,logger:n(t()),data:O()})}),bt=r({name:t().optional()}).passthrough(),Pt=r({hints:n(i(bt)),costPriority:n(f().min(0).max(1)),speedPriority:n(f().min(0).max(1)),intelligencePriority:n(f().min(0).max(1))}).passthrough(),kt=r({role:k(["user","assistant"]),content:y([ce,ue,le])}).passthrough(),Ut=S.extend({method:u("sampling/createMessage"),params:x.extend({messages:i(kt),systemPrompt:n(t()),includeContext:n(k(["none","thisServer","allServers"])),temperature:n(f()),maxTokens:f().int(),stopSequences:n(i(t())),metadata:n(r({}).passthrough()),modelPreferences:n(Pt)})}),Lt=C.extend({model:t(),stopReason:n(k(["endTurn","stopSequence","maxTokens"]).or(t())),role:k(["user","assistant"]),content:ze("type",[ce,ue,le])}),Et=r({type:u("boolean"),title:n(t()),description:n(t()),default:n(_())}).passthrough(),Ot=r({type:u("string"),title:n(t()),description:n(t()),minLength:n(f()),maxLength:n(f()),format:n(k(["email","uri","date","date-time"]))}).passthrough(),It=r({type:k(["number","integer"]),title:n(t()),description:n(t()),minimum:n(f()),maximum:n(f())}).passthrough(),qt=r({type:u("string"),title:n(t()),description:n(t()),enum:i(t()),enumNames:n(i(t()))}).passthrough(),At=y([Et,Ot,It,qt]),Mt=S.extend({method:u("elicitation/create"),params:x.extend({message:t(),requestedSchema:r({type:u("object"),properties:I(t(),At),required:n(i(t()))}).passthrough()})}),Nt=C.extend({action:k(["accept","decline","cancel"]),content:n(I(t(),O()))}),jt=r({type:u("ref/resource"),uri:t()}).passthrough(),$t=r({type:u("ref/prompt"),name:t()}).passthrough(),zt=S.extend({method:u("completion/complete"),params:x.extend({ref:y([$t,jt]),argument:r({name:t(),value:t()}).passthrough(),context:n(r({arguments:n(I(t(),t()))}))})}),Vt=C.extend({completion:r({values:i(t()).max(100),total:n(f().int()),hasMore:n(_())}).passthrough()}),Ht=r({uri:t().startsWith("file://"),name:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Dt=S.extend({method:u("roots/list")}),Jt=C.extend({roots:i(Ht)}),Wt=b.extend({method:u("notifications/roots/list_changed")});y([Pe,Ge,zt,Ct,dt,lt,Qe,et,ot,rt,at,vt,yt]);y([Ce,ke,be,Wt]);y([xe,Lt,Nt,Jt]);y([Pe,Ut,Mt,Dt]);y([Ce,ke,Tt,it,st,xt,ft]);y([xe,Ye,Vt,gt,pt,Fe,tt,nt,qe,St]);class Lo extends Error{constructor(o,a,s){super(`MCP error ${o}: ${a}`),this.code=o,this.data=s,this.name="McpError"}}let pe;pe=globalThis.crypto;async function Bt(e){return(await pe).getRandomValues(new Uint8Array(e))}async function Gt(e){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",a=Math.pow(2,8)-Math.pow(2,8)%o.length;let s="";for(;s.length<e;){const c=await Bt(e-s.length);for(const p of c)p<a&&(s+=o[p%o.length])}return s}async function Zt(e){return await Gt(e)}async function Yt(e){const o=await(await pe).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Xt(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const o=await Zt(e),a=await Yt(o);return{code_verifier:o,code_challenge:a}}const w=t().url().superRefine((e,o)=>{if(!URL.canParse(e))return o.addIssue({code:He.custom,message:"URL must be parseable",fatal:!0}),De}).refine(e=>{const o=new URL(e);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Kt=r({resource:t().url(),authorization_servers:i(w).optional(),jwks_uri:t().url().optional(),scopes_supported:i(t()).optional(),bearer_methods_supported:i(t()).optional(),resource_signing_alg_values_supported:i(t()).optional(),resource_name:t().optional(),resource_documentation:t().optional(),resource_policy_uri:t().url().optional(),resource_tos_uri:t().url().optional(),tls_client_certificate_bound_access_tokens:_().optional(),authorization_details_types_supported:i(t()).optional(),dpop_signing_alg_values_supported:i(t()).optional(),dpop_bound_access_tokens_required:_().optional()}).passthrough(),Me=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:i(t()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i(t()).optional(),introspection_endpoint:t().optional(),introspection_endpoint_auth_methods_supported:i(t()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i(t()).optional(),code_challenge_methods_supported:i(t()).optional()}).passthrough(),Qt=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),acr_values_supported:i(t()).optional(),subject_types_supported:i(t()),id_token_signing_alg_values_supported:i(t()),id_token_encryption_alg_values_supported:i(t()).optional(),id_token_encryption_enc_values_supported:i(t()).optional(),userinfo_signing_alg_values_supported:i(t()).optional(),userinfo_encryption_alg_values_supported:i(t()).optional(),userinfo_encryption_enc_values_supported:i(t()).optional(),request_object_signing_alg_values_supported:i(t()).optional(),request_object_encryption_alg_values_supported:i(t()).optional(),request_object_encryption_enc_values_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),display_values_supported:i(t()).optional(),claim_types_supported:i(t()).optional(),claims_supported:i(t()).optional(),service_documentation:t().optional(),claims_locales_supported:i(t()).optional(),ui_locales_supported:i(t()).optional(),claims_parameter_supported:_().optional(),request_parameter_supported:_().optional(),request_uri_parameter_supported:_().optional(),require_request_uri_registration:_().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional()}).passthrough(),Ft=Qt.merge(Me.pick({code_challenge_methods_supported:!0})),Ne=r({access_token:t(),id_token:t().optional(),token_type:t(),expires_in:f().optional(),scope:t().optional(),refresh_token:t().optional()}).strip(),eo=r({error:t(),error_description:t().optional(),error_uri:t().optional()}),_e=w.optional().or(u("").transform(()=>{})),to=r({redirect_uris:i(w),token_endpoint_auth_method:t().optional(),grant_types:i(t()).optional(),response_types:i(t()).optional(),client_name:t().optional(),client_uri:w.optional(),logo_uri:_e,scope:t().optional(),contacts:i(t()).optional(),tos_uri:_e,policy_uri:t().optional(),jwks_uri:w.optional(),jwks:Ve().optional(),software_id:t().optional(),software_version:t().optional(),software_statement:t().optional()}).strip(),oo=r({client_id:t(),client_secret:t().optional(),client_id_issued_at:f().optional(),client_secret_expires_at:f().optional()}).strip(),no=to.merge(oo);r({error:t(),error_description:t().optional()}).strip();r({token:t(),token_type_hint:t().optional()}).strip();function so(e){const o=typeof e=="string"?new URL(e):new URL(e.href);return o.hash="",o}function ro({requestedResource:e,configuredResource:o}){const a=typeof e=="string"?new URL(e):new URL(e.href),s=typeof o=="string"?new URL(o):new URL(o.href);if(a.origin!==s.origin||a.pathname.length<s.pathname.length)return!1;const c=a.pathname.endsWith("/")?a.pathname:a.pathname+"/",p=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,a){super(o),this.errorUri=a,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class Z extends R{}Z.errorCode="invalid_request";class N extends R{}N.errorCode="invalid_client";class j extends R{}j.errorCode="invalid_grant";class $ extends R{}$.errorCode="unauthorized_client";class Y extends R{}Y.errorCode="unsupported_grant_type";class X extends R{}X.errorCode="invalid_scope";class K extends R{}K.errorCode="access_denied";class E extends R{}E.errorCode="server_error";class Q extends R{}Q.errorCode="temporarily_unavailable";class F extends R{}F.errorCode="unsupported_response_type";class ee extends R{}ee.errorCode="unsupported_token_type";class te extends R{}te.errorCode="invalid_token";class oe extends R{}oe.errorCode="method_not_allowed";class ne extends R{}ne.errorCode="too_many_requests";class se extends R{}se.errorCode="invalid_client_metadata";class re extends R{}re.errorCode="insufficient_scope";const ao={[Z.errorCode]:Z,[N.errorCode]:N,[j.errorCode]:j,[$.errorCode]:$,[Y.errorCode]:Y,[X.errorCode]:X,[K.errorCode]:K,[E.errorCode]:E,[Q.errorCode]:Q,[F.errorCode]:F,[ee.errorCode]:ee,[te.errorCode]:te,[oe.errorCode]:oe,[ne.errorCode]:ne,[se.errorCode]:se,[re.errorCode]:re};class Eo extends Error{constructor(o){super(o??"Unauthorized")}}const W="code",B="S256";function je(e,o){const a=e.client_secret!==void 0;return o.length===0?a?"client_secret_post":"none":a&&o.includes("client_secret_basic")?"client_secret_basic":a&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":a?"client_secret_post":"none"}function $e(e,o,a,s){const{client_id:c,client_secret:p}=o;switch(e){case"client_secret_basic":io(c,p,a);return;case"client_secret_post":co(c,p,s);return;case"none":uo(c,s);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function io(e,o,a){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${e}:${o}`);a.set("Authorization",`Basic ${s}`)}function co(e,o,a){a.set("client_id",e),o&&a.set("client_secret",o)}function uo(e,o){o.set("client_id",e)}async function de(e){const o=e instanceof Response?e.status:void 0,a=e instanceof Response?await e.text():e;try{const s=eo.parse(JSON.parse(a)),{error:c,error_description:p,error_uri:d}=s,l=ao[c]||E;return new l(p||"",d)}catch(s){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${s}. Raw body: ${a}`;return new E(c)}}async function Oo(e,o){var a,s;try{return await G(e,o)}catch(c){if(c instanceof N||c instanceof $)return await((a=e.invalidateCredentials)===null||a===void 0?void 0:a.call(e,"all")),await G(e,o);if(c instanceof j)return await((s=e.invalidateCredentials)===null||s===void 0?void 0:s.call(e,"tokens")),await G(e,o);throw c}}async function G(e,{serverUrl:o,authorizationCode:a,scope:s,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await po(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=o);const h=await lo(o,e,d),g=await fo(l,{fetchFn:p});let m=await Promise.resolve(e.clientInformation());if(!m){if(a!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const v=await So(l,{metadata:g,clientMetadata:e.clientMetadata,fetchFn:p});await e.saveClientInformation(v),m=v}if(a!==void 0){const v=await e.codeVerifier(),J=await Ro(l,{metadata:g,clientInformation:m,authorizationCode:a,codeVerifier:v,redirectUri:e.redirectUrl,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(J),"AUTHORIZED"}const T=await e.tokens();if(T?.refresh_token)try{const v=await yo(l,{metadata:g,clientInformation:m,refreshToken:T.refresh_token,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof E))throw v}const P=e.state?await e.state():void 0,{authorizationUrl:U,codeVerifier:L}=await wo(l,{metadata:g,clientInformation:m,state:P,redirectUrl:e.redirectUrl,scope:s||e.clientMetadata.scope,resource:h});return await e.saveCodeVerifier(L),await e.redirectToAuthorization(U),"REDIRECT"}async function lo(e,o,a){const s=so(e);if(o.validateResourceURL)return await o.validateResourceURL(s,a?.resource);if(a){if(!ro({requestedResource:s,configuredResource:a.resource}))throw new Error(`Protected resource ${a.resource} does not match expected ${s} (or origin)`);return new URL(a.resource)}}function Io(e){const o=e.headers.get("WWW-Authenticate");if(!o)return;const[a,s]=o.split(" ");if(a.toLowerCase()!=="bearer"||!s)return;const p=/resource_metadata="([^"]*)"/.exec(o);if(p)try{return new URL(p[1])}catch{return}}async function po(e,o,a=fetch){const s=await _o(e,"oauth-protected-resource",a,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Kt.parse(await s.json())}async function he(e,o,a=fetch){try{return await a(e,{headers:o})}catch(s){if(s instanceof TypeError)return o?he(e,void 0,a):void 0;throw s}}function ho(e,o="",a={}){return o.endsWith("/")&&(o=o.slice(0,-1)),a.prependPathname?`${o}/.well-known/${e}`:`/.well-known/${e}${o}`}async function ge(e,o,a=fetch){return await he(e,{"MCP-Protocol-Version":o},a)}function mo(e,o){return!e||e.status>=400&&e.status<500&&o!=="/"}async function _o(e,o,a,s){var c,p;const d=new URL(e),l=(c=s?.protocolVersion)!==null&&c!==void 0?c:ae;let h;if(s?.metadataUrl)h=new URL(s.metadataUrl);else{const m=ho(o,d.pathname);h=new URL(m,(p=s?.metadataServerUrl)!==null&&p!==void 0?p:d),h.search=d.search}let g=await ge(h,l,a);if(!s?.metadataUrl&&mo(g,d.pathname)){const m=new URL(`/.well-known/${o}`,d);g=await ge(m,l,a)}return g}function go(e){const o=typeof e=="string"?new URL(e):e,a=o.pathname!=="/",s=[];if(!a)return s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),s;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),s.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),s}async function fo(e,{fetchFn:o=fetch,protocolVersion:a=ae}={}){const s={"MCP-Protocol-Version":a,Accept:"application/json"},c=go(e);for(const{url:p,type:d}of c){const l=await he(p,s,o);if(l){if(!l.ok){if(l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?Me.parse(await l.json()):Ft.parse(await l.json())}}}async function wo(e,{metadata:o,clientInformation:a,redirectUrl:s,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(W))throw new Error(`Incompatible auth server: does not support response type ${W}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(B))throw new Error(`Incompatible auth server: does not support code challenge method ${B}`)}else l=new URL("/authorize",e);const h=await Xt(),g=h.code_verifier,m=h.code_challenge;return l.searchParams.set("response_type",W),l.searchParams.set("client_id",a.client_id),l.searchParams.set("code_challenge",m),l.searchParams.set("code_challenge_method",B),l.searchParams.set("redirect_uri",String(s)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:g}}async function Ro(e,{metadata:o,clientInformation:a,authorizationCode:s,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:h}){var g;const m="authorization_code",T=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",e);if(o?.grant_types_supported&&!o.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const P=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),U=new URLSearchParams({grant_type:m,code:s,code_verifier:c,redirect_uri:String(p)});if(l)l(P,U,e,o);else{const v=(g=o?.token_endpoint_auth_methods_supported)!==null&&g!==void 0?g:[],J=je(a,v);$e(J,a,P,U)}d&&U.set("resource",d.href);const L=await(h??fetch)(T,{method:"POST",headers:P,body:U});if(!L.ok)throw await de(L);return Ne.parse(await L.json())}async function yo(e,{metadata:o,clientInformation:a,refreshToken:s,resource:c,addClientAuthentication:p,fetchFn:d}){var l;const h="refresh_token";let g;if(o){if(g=new URL(o.token_endpoint),o.grant_types_supported&&!o.grant_types_supported.includes(h))throw new Error(`Incompatible auth server: does not support grant type ${h}`)}else g=new URL("/token",e);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),T=new URLSearchParams({grant_type:h,refresh_token:s});if(p)p(m,T,e,o);else{const U=(l=o?.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],L=je(a,U);$e(L,a,m,T)}c&&T.set("resource",c.href);const P=await(d??fetch)(g,{method:"POST",headers:m,body:T});if(!P.ok)throw await de(P);return Ne.parse({refresh_token:s,...await P.json()})}async function So(e,{metadata:o,clientMetadata:a,fetchFn:s}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",e);const p=await(s??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!p.ok)throw await de(p);return no.parse(await p.json())}export{qe as C,me as E,gt as G,Ye as I,ko as J,Fe as L,Lo as M,ke as P,nt as R,xo as S,Eo as U,Oo as a,pt as b,St as c,Ce as d,Pe as e,Po as f,Co as g,To as h,bo as i,ae as j,xe as k,Vt as l,tt as m,Io as n,Uo as o};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as i,r as V,af as R,au as $,av as O,aw as U}from"./index-CxSCpakB.js";import{c as m}from"./utils-BGgJIaEU.js";import{I as L}from"./icon-HmCDqOPd.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function _(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const E=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],D="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function W(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%E.length;return E[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),G=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let I;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],I=c;break e}I=t}const C=I;let z;e:{if(j){z=D;break e}if(typeof t=="string"){let c;e[11]!==t?(c=W(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=E[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const A=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==A||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&A?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{name:A,size:G(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(B({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(_,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=A,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let F;return e[31]!==o||e[32]!==v||e[33]!==w?(F=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=F):F=e[34],F}function J(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(H,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}J.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{J as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,af as u,j as l,ag as v}from"./index-CxSCpakB.js";import{c as g}from"./utils-BGgJIaEU.js";const f=u("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,i,t;e[0]!==o?({className:r,variant:t,asChild:i,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=t):(r=e[1],s=e[2],i=e[3],t=e[4]);const c=(i===void 0?!1:i)?v:"span";let a;e[5]!==r||e[6]!==t?(a=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=a):a=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==a?(n=l.jsx(c,{"data-slot":"badge",className:a,...s}),e[8]=c,e[9]=s,e[10]=a,e[11]=n):n=e[11],n}export{m as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bQ as p,bR as v,bS as l,bT as g,bU as b,a1 as f,r as u,bV as m,bW as x,c as y,af as O,j as k,ag as C}from"./index-CxSCpakB.js";import{c as E}from"./utils-BGgJIaEU.js";var M=class extends p{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),v(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??g();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,i=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,i,s),this.#s.onSettled?.(e.data,null,t,i,s)):e?.type==="error"&&(this.#s.onError?.(e.error,t,i,s),this.#s.onSettled?.(void 0,e.error,t,i,s))}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const i=f(t),[s]=u.useState(()=>new M(i,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const r=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,d)=>{s.mutate(n,d).catch(m)},[s]);if(r.error&&x(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const S=O("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=y.c(14);let i,s,r,o,n;t[0]!==e?({className:i,variant:n,size:r,asChild:o,...s}=e,t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=o,t[5]=n):(i=t[1],s=t[2],r=t[3],o=t[4],n=t[5]);const c=(o===void 0?!1:o)?C:"button";let a;t[6]!==i||t[7]!==r||t[8]!==n?(a=E(S({variant:n,size:r,className:i})),t[6]=i,t[7]=r,t[8]=n,t[9]=a):a=t[9];let h;return t[10]!==c||t[11]!==s||t[12]!==a?(h=k.jsx(c,{"data-slot":"button",className:a,...s}),t[10]=c,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}export{z as B,S as b,K as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,j as c,b9 as n,ba as l}from"./index-CxSCpakB.js";import{c as m}from"./utils-BGgJIaEU.js";import{f as b}from"./select-BOj5RERj.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=m("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(r){const e=()=>{throw new Error(`Invalid url to pass to open(): ${r}`)};let t;try{t=new URL(r)}catch{e()}return t.protocol!=="https:"&&t.protocol!=="http:"&&e(),t.hostname!==encodeURIComponent(t.hostname)&&e(),t.username&&(t.username=encodeURIComponent(t.username)),t.password&&(t.password=encodeURIComponent(t.password)),t.pathname=t.pathname.slice(0,1)+encodeURIComponent(t.pathname.slice(1)).replace(/%2f/ig,"/"),t.search=t.search.slice(0,1)+Array.from(t.searchParams.entries()).map(l).join("&"),t.hash=t.hash.slice(0,1)+encodeURIComponent(t.hash.slice(1)),t.href}function l([r,e]){return`${encodeURIComponent(r)}${e.length>0?`=${encodeURIComponent(e)}`:""}`}var u=class{serverUrl;storageKeyPrefix;serverUrlHash;clientName;clientUri;callbackUrl;preventAutoAuth;onPopupWindow;constructor(r,e={}){this.serverUrl=r,this.storageKeyPrefix=e.storageKeyPrefix||"mcp:auth",this.serverUrlHash=this.hashString(r),this.clientName=e.clientName||"MCP Browser Client",this.clientUri=e.clientUri||(typeof window<"u"?window.location.origin:""),this.callbackUrl=n(e.callbackUrl||(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback")),this.preventAutoAuth=e.preventAutoAuth,this.onPopupWindow=e.onPopupWindow}get redirectUrl(){return n(this.callbackUrl)}get clientMetadata(){return{redirect_uris:[this.redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:this.clientName,client_uri:this.clientUri}}async clientInformation(){const r=this.getKey("client_info"),e=localStorage.getItem(r);if(e)try{return JSON.parse(e)}catch(t){console.warn(`[${this.storageKeyPrefix}] Failed to parse client information:`,t),localStorage.removeItem(r);return}}async saveClientInformation(r){const e=this.getKey("client_info");localStorage.setItem(e,JSON.stringify(r))}async tokens(){const r=this.getKey("tokens"),e=localStorage.getItem(r);if(e)try{return JSON.parse(e)}catch(t){console.warn(`[${this.storageKeyPrefix}] Failed to parse tokens:`,t),localStorage.removeItem(r);return}}async saveTokens(r){const e=this.getKey("tokens");localStorage.setItem(e,JSON.stringify(r)),localStorage.removeItem(this.getKey("code_verifier")),localStorage.removeItem(this.getKey("last_auth_url"))}async saveCodeVerifier(r){const e=this.getKey("code_verifier");localStorage.setItem(e,r)}async codeVerifier(){const r=this.getKey("code_verifier"),e=localStorage.getItem(r);if(!e)throw new Error(`[${this.storageKeyPrefix}] Code verifier not found in storage for key ${r}. Auth flow likely corrupted or timed out.`);return e}async prepareAuthorizationUrl(r){const e=crypto.randomUUID(),t=`${this.storageKeyPrefix}:state_${e}`,o={serverUrlHash:this.serverUrlHash,expiry:Date.now()+1e3*60*10,providerOptions:{serverUrl:this.serverUrl,storageKeyPrefix:this.storageKeyPrefix,clientName:this.clientName,clientUri:this.clientUri,callbackUrl:this.callbackUrl}};localStorage.setItem(t,JSON.stringify(o)),r.searchParams.set("state",e);const c=r.toString(),s=n(c);return localStorage.setItem(this.getKey("last_auth_url"),s),s}async redirectToAuthorization(r){if(this.preventAutoAuth)return;const e=await this.prepareAuthorizationUrl(r),t="width=600,height=700,resizable=yes,scrollbars=yes,status=yes";try{const o=window.open(e,`mcp_auth_${this.serverUrlHash}`,t);this.onPopupWindow&&this.onPopupWindow(e,t,o),!o||o.closed||typeof o.closed>"u"?console.warn(`[${this.storageKeyPrefix}] Popup likely blocked by browser. Manual navigation might be required using the stored URL.`):(o.focus(),console.info(`[${this.storageKeyPrefix}] Redirecting to authorization URL in popup.`))}catch(o){console.error(`[${this.storageKeyPrefix}] Error opening popup window:`,o)}}getLastAttemptedAuthUrl(){const r=localStorage.getItem(this.getKey("last_auth_url"));return r?n(r):null}clearStorage(){const r=`${this.storageKeyPrefix}_${this.serverUrlHash}_`,e=`${this.storageKeyPrefix}:state_`,t=[];let o=0;for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);if(i){if(i.startsWith(r))t.push(i);else if(i.startsWith(e))try{const a=localStorage.getItem(i);a&&JSON.parse(a).serverUrlHash===this.serverUrlHash&&t.push(i)}catch(a){console.warn(`[${this.storageKeyPrefix}] Error parsing state key ${i} during clearStorage:`,a)}}}return[...new Set(t)].forEach(s=>{localStorage.removeItem(s),o++}),o}hashString(r){let e=0;for(let t=0;t<r.length;t++){const o=r.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}getKey(r){return`${this.storageKeyPrefix}_${this.serverUrlHash}_${r}`}};export{u as B,n as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b6 as e}from"./index-CxSCpakB.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b6 as _,r as y,d as R,as as ee,j as t,c as S,af as te,a6 as se,b5 as W}from"./index-CxSCpakB.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./use-connection-v-w_yxra.js";import{T as ae}from"./tool-set-selector-BYF6NlFy.js";import{B as ie}from"./badge-DO3BPtZ-.js";import{B as I}from"./button-BeTb9YZU.js";import{I as z}from"./icon-HmCDqOPd.js";import{I as V}from"./input-NL8_dTk4.js";import{S as ce}from"./spinner-wv31KLi9.js";import{T as q}from"./textarea-DAuZp-vs.js";import{c as k}from"./utils-BGgJIaEU.js";import{a as G,u as le,O as de,P as me,E as ue}from"./index-BMEwImqy.js";import{b as Z,a as xe,V as H}from"./layout-CKQw59Ep.js";import{U as fe}from"./upload-DnaQ_f0x.js";import{u as pe}from"./index-DmUDvTrM.js";import{C as he}from"./circle-alert-BjmT_0vz.js";import{E as ge}from"./error-boundary-dk0EDCPp.js";import"./tooltip-BKoAX5gw.js";import"./integration-icon-B5ZzeehM.js";import"./checkbox-Ep63AJ5F.js";import"./select-BOj5RERj.js";import"./collection-search-C3auuf0Y.js";import"./use-organization-settings-ClRwCrjK.js";import"./empty-state-DCGHu7Ht.js";import"./use-binding-BfGhaGVE.js";import"./auth-CYg5mzvi.js";import"./use-tool-call-CqAWykKA.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./form-BmmDx2Hv.js";import"./use-gateway-gKeEvLRE.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-DrneYG29.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-Dt9jPzUp.js";import"./index-BrYbjxXv.js";import"./schema-DlhuekEX.js";const be=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],je=_("box",be);const ve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ne=_("clock",ve);const ye=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],we=_("code",ye);const Se=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ce=_("copy",Se);const ke=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$e=_("database",ke);const Ie=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_e=_("info",Ie);const Te=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],K=_("play",Te);function Ee(s){const e=S.c(14),{value:n,onChange:a,alt:r}=s,o=y.useRef(null);let i;e[0]!==a?(i=p=>{const v=p.target.files?.[0];if(v){const w=new FileReader;w.onloadend=()=>{const j=w.result;a(j)},w.readAsDataURL(v)}},e[0]=a,e[1]=i):i=e[1];const m=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const u=l;let c;e[3]!==m?(c=t.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:m}),e[3]=m,e[4]=c):c=e[4];let h;e[5]!==r||e[6]!==n?(h=n?t.jsx("img",{src:n,alt:r||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-2xl",children:"🤖"}),e[5]=r,e[6]=n,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(fe,{className:"h-5 w-5 text-white"})}),e[8]=g):g=e[8];let b;e[9]!==h?(b=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[h,g]}),e[9]=h,e[10]=b):b=e[10];let f;return e[11]!==c||e[12]!==b?(f=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:u,children:[c,b]}),e[11]=c,e[12]=b,e[13]=f):f=e[13],f}function Ae({itemId:s,onBack:e,onUpdate:n}){const[a,r]=y.useState(!1),[o,i]=y.useState("profile"),{connectionId:m}=R({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=m??B,u=D(l),c=oe(l,"AGENT",s,u),{register:h,handleSubmit:g,reset:b,setValue:f,watch:p,formState:{isDirty:v}}=ee({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),w=p("avatar"),j=p("tool_set")??{};y.useEffect(()=>{c&&b({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,b]);const x=async $=>{r(!0);try{await n($)}finally{r(!1)}},M=$=>{f("tool_set",$,{shouldDirty:!0})};return c?t.jsxs(Z,{onBack:e,children:[t.jsxs(xe,{children:[t.jsx(I,{variant:o==="profile"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="profile"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("profile"),children:"Profile"}),t.jsx(I,{variant:o==="tools"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="tools"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("tools"),children:"Tools"}),t.jsx(I,{variant:o==="triggers"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="triggers"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("triggers"),disabled:!0,children:"Triggers"}),t.jsx(I,{variant:o==="advanced"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="advanced"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("advanced"),disabled:!0,children:"Advanced"})]}),t.jsxs(H,{children:[t.jsx(G,{connectionId:m,title:c.title,icon:c.avatar??"smart_toy"}),t.jsx(I,{className:"bg-[#d0ec1a] text-[#07401a] hover:bg-[#d0ec1a]/90 h-7 text-xs font-medium",onClick:g(x),disabled:!v||a,children:a?t.jsxs(t.Fragment,{children:[t.jsx(z,{name:"progress_activity",size:12,className:"mr-2 animate-spin"}),"Saving..."]}):"Save changes"})]}),o==="profile"&&t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[t.jsxs("div",{className:"flex gap-4 items-start",children:[t.jsx(Ee,{value:w,onChange:$=>f("avatar",$,{shouldDirty:!0}),alt:p("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(V,{...h("title"),className:"text-2xl font-medium text-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Agent Name"}),t.jsx(V,{...h("description"),className:"text-sm text-muted-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Brief description"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ie,{variant:"secondary",className:"px-2 py-0.5 h-6 gap-1.5 bg-secondary/50 text-muted-foreground font-normal text-xs hover:bg-secondary/50",children:[t.jsx(_e,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(q,{...h("instructions"),className:"min-h-[400px] resize-none text-sm leading-relaxed font-normal border-0 focus-visible:ring-0 px-0 py-0 shadow-none",placeholder:"Enter agent instructions..."})})]})]})}),o==="tools"&&t.jsx(ae,{toolSet:j,onToolSetChange:M}),o==="triggers"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers tab coming soon"})}),o==="advanced"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Advanced tab coming soon"})})]}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{})})}const ze=te("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/10 text-destructive border-destructive [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Re(s){const e=S.c(10);let n,a,r;e[0]!==s?({className:n,variant:r,...a}=s,e[0]=s,e[1]=n,e[2]=a,e[3]=r):(n=e[1],a=e[2],r=e[3]);let o;e[4]!==n||e[5]!==r?(o=k(ze({variant:r}),n),e[4]=n,e[5]=r,e[6]=o):o=e[6];let i;return e[7]!==a||e[8]!==o?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:o,...a}),e[7]=a,e[8]=o,e[9]=i):i=e[9],i}function Me(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Oe(s){const e=S.c(8);let n,a;e[0]!==s?({className:n,...a}=s,e[0]=s,e[1]=n,e[2]=a):(n=e[1],a=e[2]);let r;e[3]!==n?(r=k("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=t.jsx("div",{"data-slot":"alert-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Pe(s){try{const e=new URL(s);return e.pathname=e.pathname.replace(/\/i:([a-f0-9-]+)/gi,"/$1"),e.toString()}catch{return s}}const Ue=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ve(s){const e=S.c(15),{toolName:n,connectionId:a,connection:r,onBack:o}=s;let i;e[0]!==r.connection_url?(i=Pe(r.connection_url),e[0]=r.connection_url,e[1]=i):i=e[1];const m=i,l=`/mcp/${a}`;let u;e[2]!==l?(u=new URL(l,window.location.origin),e[2]=l,e[3]=u):u=e[3];const c=u,h=r.connection_token??null;let g;if(e[4]!==m||e[5]!==h?(g={url:m,token:h},e[4]=m,e[5]=h,e[6]=g):g=e[6],!le(g)){let v;return e[7]!==o?(v=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{onAuthenticate:()=>o(),buttonText:"Go back"})}),e[7]=o,e[8]=v):v=e[8],v}const f=`${a}:${n}`;let p;return e[9]!==a||e[10]!==c||e[11]!==o||e[12]!==f||e[13]!==n?(p=t.jsx(De,{toolName:n,connectionId:a,mcpProxyUrl:c,onBack:o},f),e[9]=a,e[10]=c,e[11]=o,e[12]=f,e[13]=n,e[14]=p):p=e[14],p}function De({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:a}){const[r,o]=y.useState({}),[i,m]=y.useState("{}"),[l,u]=y.useState(null),[c,h]=y.useState(null),[g,b]=y.useState(!1),[f,p]=y.useState(null),[v,w]=y.useState("json"),j=pe({url:n.href,clientName:"MCP Tool Inspector",clientUri:window.location.origin,autoReconnect:!1});y.useEffect(()=>{j.error&&console.error("MCP Error:",j.error)},[j.error]);const x=j.tools?.find(d=>d.name===s),M=x?.inputSchema?.properties,$=M?Object.keys(M):[],A=$.length>0,O={};if(A&&x?.inputSchema?.properties)for(const d of $)O[d]=x.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(r,d),Q=async()=>{b(!0),h(null),u(null),p(null);const d=performance.now(),C=D(e);try{const N=A?{...O,...r}:(()=>{const T=i.trim();if(!T)return{};const E=JSON.parse(T);if(E&&typeof E=="object")return E;throw new Error("Raw JSON input must be an object.")})();A&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([T,E])=>{if((E.type==="object"||E.type==="array")&&typeof N[T]=="string")try{N[T]=JSON.parse(N[T])}catch{}});const P=await C(s,N),U=performance.now(),X=Math.round(U-d);u(P);const Y=JSON.stringify(P),F=new TextEncoder().encode(Y).length;p({duration:`${X}ms`,bytes:`${F} bytes`,tokens:`~${Math.ceil(F/4)} tokens`,cost:"$0.0000"})}catch(N){const P=N instanceof Error?N.message:String(N);h(P||"Unknown error occurred");const U=performance.now();p({duration:`${Math.round(U-d)}ms`})}finally{b(!1)}},L=(d,C)=>{o(N=>({...N,[d]:C}))};return t.jsxs(Z,{onBack:a,children:[t.jsx(H,{children:t.jsx(G,{connectionId:e,title:x?.title??Ue(s),icon:"build"})}),t.jsxs("div",{className:"flex flex-col items-center w-full max-w-[1500px] mx-auto p-10 gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h1",{className:"text-2xl font-medium text-foreground",children:s}),t.jsx("p",{className:"text-muted-foreground text-base",children:x?.description||"No description available"})]}),t.jsxs("div",{className:"flex items-center gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[j.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):j.state==="connecting"||j.state==="authenticating"?t.jsx(z,{name:"progress_activity",size:12,className:"animate-spin text-yellow-500"}):t.jsx("div",{className:"h-2 w-2 rounded-full bg-red-500"}),t.jsx("span",{className:"font-mono text-sm capitalize text-muted-foreground",children:j.state.replace("_"," ")})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ne,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.duration||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.tokens||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:f?.bytes||"-"})]})]}),c&&t.jsxs(Re,{variant:"destructive",className:"max-w-[800px] w-full bg-red-50 dark:bg-red-900/10 border-red-200 dark:border-red-900",children:[t.jsx(he,{className:"h-4 w-4"}),t.jsx(Me,{children:"Execution Failed"}),t.jsx(Oe,{children:c})]}),t.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[800px] items-center",children:[t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-4 w-4 rounded-sm bg-primary/10 flex items-center justify-center",children:t.jsx(K,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{className:"font-medium text-sm",children:"Input"})]}),t.jsxs(I,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Q,disabled:g,children:[g?t.jsx(z,{name:"progress_activity",size:14,className:"animate-spin"}):t.jsx(K,{className:"h-3.5 w-3.5 fill-current"}),"Execute tool"]})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("div",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Arguments"}),A&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,C])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:d}),x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:C.type})]}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:C.description}),C.type==="object"||C.type==="array"?t.jsx(q,{className:"flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 font-mono",value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(V,{value:J(d)?r[d]??"":O[d]??"",onChange:N=>L(d,N.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),x?.inputSchema&&!A&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx("textarea",{className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:i,onChange:d=>m(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]})]})]}),t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Execution Result"}),t.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 h-8",children:[t.jsx("button",{onClick:()=>w("json"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all",v==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>w("view"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",v==="view"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),disabled:!0,title:"Coming soon",children:["Create view",t.jsx(me,{className:"h-3 w-3"})]})]})]}),t.jsxs("div",{className:"relative min-h-[200px] max-h-[500px] overflow-auto bg-zinc-950 text-zinc-50 p-4 font-mono text-xs",children:[l?t.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(l,null,2)}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-zinc-700",children:[t.jsx(we,{className:"h-8 w-8 mb-2 opacity-50"}),t.jsx("p",{children:"Run the tool to see results"})]}),l&&t.jsx("div",{className:"absolute top-4 right-4 flex gap-2",children:t.jsx(I,{size:"icon",variant:"secondary",className:"h-8 w-8 bg-zinc-800 text-zinc-400 hover:text-white hover:bg-zinc-700 border-zinc-700",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(l,null,2)),se.success("Copied to clipboard")},children:t.jsx(Ce,{className:"h-4 w-4"})})})]})]})]})]})]})}function Be(s){const e=S.c(8),{itemId:n,onBack:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=R(r).connectionId??B,m=ne(i);if(!m){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=c):c=e[1],c}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[2]=l):l=e[2];let u;return e[3]!==m||e[4]!==i||e[5]!==a||e[6]!==n?(u=t.jsx(y.Suspense,{fallback:l,children:t.jsx(Ve,{toolName:n,connectionId:i,connection:m,onBack:a})}),e[3]=m,e[4]=i,e[5]=a,e[6]=n,e[7]=u):u=e[7],u}const Je={agent:Ae};function Le(){const s=S.c(6),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=decodeURIComponent(a.itemId);let o;s[1]!==e.history?(o=()=>{e.history.back()},s[1]=e.history,s[2]=o):o=s[2];const i=o,m=Fe;let l;return s[3]!==i||s[4]!==r?(l=t.jsx(Be,{itemId:r,onBack:i,onUpdate:m}),s[3]=i,s[4]=r,s[5]=l):l=s[5],l}async function Fe(s){return Promise.resolve()}function Ke(){const s=S.c(17),e=W();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const a=R(n),r=a.connectionId,o=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let m;s[1]!==e.history?(m=()=>{e.history.back()},s[1]=e.history,s[2]=m):m=s[2];const l=m,u=r??B;let c;s[3]!==u?(c=D(u),s[3]=u,s[4]=c):c=s[4];const g=re(u,o,c);let b;s[5]!==g||s[6]!==i?(b=async x=>{i&&await g.update.mutateAsync({id:i,data:x})},s[5]=g,s[6]=i,s[7]=b):b=s[7];const f=b;let p;s[8]!==o?(p=o?.toLowerCase(),s[8]=o,s[9]=p):p=s[9];const v=p,w=v&&Je[v];if(w){let x;return s[10]!==w||s[11]!==l||s[12]!==f||s[13]!==i?(x=t.jsx(w,{itemId:i,onBack:l,onUpdate:f}),s[10]=w,s[11]=l,s[12]=f,s[13]=i,s[14]=x):x=s[14],x}let j;return s[15]!==l?(j=t.jsx(ue,{icon:"extension",title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:l,children:"Go back"}}),s[15]=l,s[16]=j):j=s[16],j}function We(){const s=S.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=R(e);if(decodeURIComponent(n.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ke,{}),s[2]=o):o=s[2],o}function _t(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{children:t.jsx(y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(We,{})})}),s[0]=e):e=s[0],e}export{_t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as F,r as R,j as t}from"./index-CxSCpakB.js";import{B as G}from"./button-BeTb9YZU.js";import{c as H,D as J,a as Q,b as U}from"./dropdown-menu-DsWv8lkW.js";import{I as w}from"./icon-HmCDqOPd.js";import{d as X,b as Y,a as Z,T as ee}from"./tooltip-BKoAX5gw.js";import{c as L}from"./utils-BGgJIaEU.js";function ne(W){const e=F.c(47),{viewMode:r,onViewModeChange:i,sortKey:I,sortDirection:y,onSort:N,sortOptions:v}=W;let _;e[0]!==v?(_=v===void 0?[]:v,e[0]=v,e[1]=_):_=e[1];const C=_,E=R.useRef(null),B=R.useRef(null);let z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z={left:0,width:0,opacity:0},e[2]=z):z=e[2];const[j,q]=R.useState(z);let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=s=>{if(!s.current)return;const{offsetLeft:o,offsetWidth:A}=s.current;q({left:o,width:A,opacity:1})},e[3]=k):k=e[3];const V=k;let S,T;e[4]!==r?(S=()=>{V(r==="table"?E:B)},T=[r],e[4]=r,e[5]=S,e[6]=T):(S=e[5],T=e[6]),R.useEffect(S,T);let l;e[7]!==r?(l=s=>{s&&setTimeout(()=>{V(r==="table"?E:B)},0)},e[7]=r,e[8]=l):l=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X,{children:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(J,{asChild:!0,children:t.jsx(G,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(w,{name:"tune",size:16})})})}),t.jsx(ee,{children:"Search filters"})]})}),e[9]=D):D=e[9];let n;e[10]!==i?(n=()=>{i("table")},e[10]=i,e[11]=n):n=e[11];const O=r==="table"?"text-foreground":"text-muted-foreground";let a;e[12]!==O?(a=L("transition-colors ease-out duration-200",O),e[12]=O,e[13]=a):a=e[13];let c;e[14]!==a?(c=t.jsx(w,{name:"table_rows",size:16,className:a}),e[14]=a,e[15]=c):c=e[15];let d;e[16]!==c||e[17]!==n?(d=t.jsx("button",{ref:E,type:"button",onClick:n,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:c}),e[16]=c,e[17]=n,e[18]=d):d=e[18];let f;e[19]!==i?(f=()=>{i("cards")},e[19]=i,e[20]=f):f=e[20];const P=r==="cards"?"text-foreground":"text-muted-foreground";let u;e[21]!==P?(u=L("transition-colors ease-out duration-200",P),e[21]=P,e[22]=u):u=e[22];let m;e[23]!==u?(m=t.jsx(w,{name:"grid_view",size:16,className:u}),e[23]=u,e[24]=m):m=e[24];let x;e[25]!==f||e[26]!==m?(x=t.jsx("button",{ref:B,type:"button",onClick:f,className:"relative z-10 flex-1 flex items-center justify-center gap-2 h-12 px-4 rounded-lg",children:m}),e[25]=f,e[26]=m,e[27]=x):x=e[27];const $=`${j.left}px`,K=`${j.width}px`;let p;e[28]!==j.opacity||e[29]!==$||e[30]!==K?(p=t.jsx("div",{className:"absolute z-0 h-12 bg-background border border-border rounded-lg transition-all ease-out duration-200",style:{left:$,width:K,opacity:j.opacity}}),e[28]=j.opacity,e[29]=$,e[30]=K,e[31]=p):p=e[31];let h;e[32]!==d||e[33]!==x||e[34]!==p?(h=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx("div",{className:"relative bg-muted rounded-lg p-1",children:t.jsxs("div",{className:"relative flex gap-0",children:[d,x,p]})})}),e[32]=d,e[33]=x,e[34]=p,e[35]=h):h=e[35];let b;e[36]!==N||e[37]!==y||e[38]!==I||e[39]!==C?(b=C.length>0&&N&&t.jsxs("div",{className:"p-2",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(s=>{const o=I===s.id;return t.jsx(H,{onClick:()=>N(s.id),className:L("h-8 px-2 py-0 cursor-pointer",o&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o&&t.jsx(w,{name:"check",size:16,className:"text-foreground shrink-0"}),!o&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:s.label}),o&&y&&t.jsx(w,{name:y==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-foreground shrink-0"})]})},s.id)})]}),e[36]=N,e[37]=y,e[38]=I,e[39]=C,e[40]=b):b=e[40];let g;e[41]!==h||e[42]!==b?(g=t.jsxs(Q,{align:"end",className:"w-[200px] p-0 gap-0",children:[h,b]}),e[41]=h,e[42]=b,e[43]=g):g=e[43];let M;return e[44]!==g||e[45]!==l?(M=t.jsxs(U,{onOpenChange:l,children:[D,g]}),e[44]=g,e[45]=l,e[46]=M):M=e[46],M}export{ne as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as j,j as i}from"./index-CxSCpakB.js";import{C as b}from"./collection-display-button-DE8BFxrp.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-base font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as x,j as a}from"./index-CxSCpakB.js";import{I as u}from"./icon-HmCDqOPd.js";import{I as b}from"./input-NL8_dTk4.js";import{c as g}from"./utils-BGgJIaEU.js";function I(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let r;e[0]!==m?(r=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{name:"search",size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let s;e[3]!==c?(s=p=>c(p.target.value),e[3]=c,e[4]=s):s=e[4];let t;e[5]!==i||e[6]!==f||e[7]!==s||e[8]!==n?(t=a.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[o,a.jsx(b,{value:n,onChange:s,onKeyDown:i,placeholder:f,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[5]=i,e[6]=f,e[7]=s,e[8]=n,e[9]=t):t=e[9];let l;return e[10]!==r||e[11]!==t?(l=a.jsx("div",{className:r,children:t}),e[10]=r,e[11]=t,e[12]=l):l=e[12],l}export{I as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as N,j as o}from"./index-CxSCpakB.js";import{c as u}from"./utils-BGgJIaEU.js";import{I as T}from"./icon-HmCDqOPd.js";function $(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function R(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function I(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=N.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:p}=a;let b;e[0]!==r?(b=function(n,h){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&r&&o.jsx(T,{name:r==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-muted-foreground transition-colors"})})},e[0]=r,e[1]=b):b=e[1];const g=b;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=function(n,h){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===h-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=x):x=e[2];const i=x;let d;if(e[3]!==t||e[4]!==f||e[5]!==g||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==g||e[11]!==l?(m=(n,h)=>{const C=l===n.id;return o.jsx(I,{className:u(i(h,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&g(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=g,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=g,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(R,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==p){let m;e[20]!==t||e[21]!==c||e[22]!==p?(m=(n,h)=>{const C=p?.(n);return o.jsx(S,{"data-row-index":h,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(w=>o.jsx(L,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",w.cellClassName,w.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u("min-w-0 w-full",!w.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:w.render?w.render(n):w.accessor?w.accessor(n):null})},w.id))},h)},e[20]=t,e[21]=c,e[22]=p,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=p,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(H,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs($,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function _(a){const e=N.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:p,emptyState:b}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==b?(i=b||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=b,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let x;return e[5]!==t||e[6]!==s||e[7]!==p||e[8]!==c||e[9]!==f||e[10]!==r?(x=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(z,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:p})}),e[5]=t,e[6]=s,e[7]=p,e[8]=c,e[9]=f,e[10]=r,e[11]=x):x=e[11],x}export{_ as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-CxSCpakB.js";import{B as _}from"./badge-DO3BPtZ-.js";import{C as A}from"./card-DFBJ_uBy.js";import{c as j}from"./utils-BGgJIaEU.js";import{I as $}from"./integration-icon-B5ZzeehM.js";function L(v){const t=S.c(44),{connection:e,onClick:N,headerActions:i,footer:C,className:b,size:R,fallbackIcon:k}=v,z=R===void 0?"md":R,I=z==="sm"?"p-4":"p-6",w=z==="sm"?"text-sm":"text-base",B=z==="sm"?"text-xs":"text-base",E=N&&"hover:bg-muted/50";let o;t[0]!==b||t[1]!==E?(o=j("cursor-pointer transition-colors group",E,b),t[0]=b,t[1]=E,t[2]=o):o=t[2];let l;t[3]!==I?(l=j("flex flex-col gap-4 relative",I),t[3]=I,t[4]=l):l=t[4];let a;t[5]!==e.icon||t[6]!==e.title||t[7]!==k?(a=s.jsx($,{icon:e.icon,name:e.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:k}),t[5]=e.icon,t[6]=e.title,t[7]=k,t[8]=a):a=t[8];let n;t[9]!==e.status||t[10]!==i?(n=e.status&&s.jsx(_,{variant:e.status==="active"?"default":"outline",className:j("text-xs transition-opacity",i&&"opacity-100 group-hover:opacity-0"),children:e.status}),t[9]=e.status,t[10]=i,t[11]=n):n=t[11];let c;t[12]!==i?(c=i&&s.jsx("div",{className:j("absolute top-0 right-0 transition-opacity","opacity-0 group-hover:opacity-100"),onClick:D,children:i}),t[12]=i,t[13]=c):c=t[13];let r;t[14]!==n||t[15]!==c?(r=s.jsxs("div",{className:"relative",children:[n,c]}),t[14]=n,t[15]=c,t[16]=r):r=t[16];let m;t[17]!==a||t[18]!==r?(m=s.jsxs("div",{className:"flex items-start justify-between",children:[a,r]}),t[17]=a,t[18]=r,t[19]=m):m=t[19];let p;t[20]!==w?(p=j("font-medium text-foreground truncate",w),t[20]=w,t[21]=p):p=t[21];let d;t[22]!==e.title||t[23]!==p?(d=s.jsx("h3",{className:p,children:e.title}),t[22]=e.title,t[23]=p,t[24]=d):d=t[24];let f;t[25]!==B?(f=j("text-muted-foreground line-clamp-2",B),t[25]=B,t[26]=f):f=t[26];const P=e.description||"No description";let x;t[27]!==f||t[28]!==P?(x=s.jsx("p",{className:f,children:P}),t[27]=f,t[28]=P,t[29]=x):x=t[29];let u;t[30]!==d||t[31]!==x?(u=s.jsxs("div",{className:"flex flex-col gap-0",children:[d,x]}),t[30]=d,t[31]=x,t[32]=u):u=t[32];let h;t[33]!==C?(h=C&&s.jsx("div",{onClick:q,children:C}),t[33]=C,t[34]=h):h=t[34];let g;t[35]!==u||t[36]!==h||t[37]!==l||t[38]!==m?(g=s.jsxs("div",{className:l,children:[m,u,h]}),t[35]=u,t[36]=h,t[37]=l,t[38]=m,t[39]=g):g=t[39];let y;return t[40]!==N||t[41]!==g||t[42]!==o?(y=s.jsx(A,{className:o,onClick:N,children:g}),t[40]=N,t[41]=g,t[42]=o,t[43]=y):y=t[43],y}function q(v){return v.stopPropagation()}function D(v){return v.stopPropagation()}export{L as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as V,j as o,a5 as Oe,a as Ye,r as ze,a6 as Ze,d as et,b as tt,b5 as ot}from"./index-CxSCpakB.js";import{E as Ee}from"./empty-state-DCGHu7Ht.js";import{E as Fe}from"./error-boundary-dk0EDCPp.js";import{a as Ke,e as st,u as nt,c as it,d as lt}from"./use-connection-v-w_yxra.js";import{b as at}from"./use-binding-BfGhaGVE.js";import{E as Ve,P as rt,a as ct,u as dt,S as mt}from"./index-BMEwImqy.js";import{B as ge}from"./button-BeTb9YZU.js";import{I as M}from"./icon-HmCDqOPd.js";import{a as ut,T as ft,R as pt}from"./resource-tabs-Cyi6PwbN.js";import{V as ht,a as gt,b as xt}from"./layout-CKQw59Ep.js";import{g as Be}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-DE8BFxrp.js";import{C as jt}from"./collection-search-C3auuf0Y.js";import{C as bt}from"./card-DFBJ_uBy.js";import{I as Ct}from"./integration-icon-B5ZzeehM.js";import{b as We,D as qe,a as He,c as B}from"./dropdown-menu-DsWv8lkW.js";import{C as vt}from"./collection-table-wrapper-z4CuwV_C.js";import{u as yt}from"./use-list-state-j-4cxeBJ.js";import{B as _t}from"./extract-connection-data-DrneYG29.js";import{A as wt,g as St,c as Nt,b as It,d as Tt,e as Dt,a as $t,f as At}from"./alert-dialog-BvyEfL2D.js";import"./utils-BGgJIaEU.js";import"./tooltip-BKoAX5gw.js";import"./auth-CYg5mzvi.js";import"./use-organization-settings-ClRwCrjK.js";import"./use-tool-call-CqAWykKA.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./form-BmmDx2Hv.js";import"./input-NL8_dTk4.js";import"./select-BOj5RERj.js";import"./use-gateway-gKeEvLRE.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-Dt9jPzUp.js";import"./index-BrYbjxXv.js";import"./schema-DlhuekEX.js";import"./useQuery-CkIva3b0.js";import"./badge-DO3BPtZ-.js";import"./use-mobile-BXGgFxUH.js";function Pt(t,e){const s=t.properties||{};for(const i in s){const a=s[i];if(a&&a.type==="string"&&(a.format==="url"||a.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of l)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function kt(t){const e=V.c(25),{item:s,schema:l,actions:i}=t;let a;e[0]!==s||e[1]!==l?(a=Pt(l,s),e[0]=s,e[1]=l,e[2]=a):a=e[2];const u=a,n=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 g=f;let r;e[5]!==u||e[6]!==s.title?(r=o.jsx(Ct,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=r):r=e[7];let d;e[8]!==s.title?(d=o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=d):d=e[9];const x=n||"No description";let h;e[10]!==x?(h=o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x}),e[10]=x,e[11]=h):h=e[11];let j;e[12]!==d||e[13]!==h?(j=o.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,h]}),e[12]=d,e[13]=h,e[14]=j):j=e[14];let p;e[15]!==r||e[16]!==j?(p=o.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[r,j]}),e[15]=r,e[16]=j,e[17]=p):p=e[17];let c;e[18]!==i||e[19]!==g||e[20]!==s?(c=g&&o.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Et,children:o.jsxs(We,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:o.jsx(M,{name:"more_vert",size:20})})}),o.jsxs(He,{align:"end",onClick:Ot,children:[i.open&&o.jsxs(B,{onClick:C=>{C.stopPropagation(),i.open?.(s)},children:[o.jsx(M,{name:"visibility",size:16}),"Open"]}),i.edit&&o.jsxs(B,{onClick:C=>{C.stopPropagation(),i.edit?.(s)},children:[o.jsx(M,{name:"edit",size:16}),"Edit"]}),i.duplicate&&o.jsxs(B,{onClick:C=>{C.stopPropagation(),i.duplicate?.(s)},children:[o.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&o.jsxs(B,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(s)},children:[o.jsx(M,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=g,e[20]=s,e[21]=c):c=e[21];let N;return e[22]!==p||e[23]!==c?(N=o.jsxs(bt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[p,c]}),e[22]=p,e[23]=c,e[24]=N):N=e[24],N}function Ot(t){return t.stopPropagation()}function zt(t){return t.stopPropagation()}function Et(t){return t.stopPropagation()}function Mt(t){return t.stopPropagation()}function Je(t,e){return Object.keys(t.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 Ut(t){const e=V.c(32),{data:s,schema:l,viewMode:i,onViewModeChange:a,search:u,sortKey:n,sortDirection:f,onSort:g,actions:r,onItemClick:d,headerActions:x,emptyState:h,readOnly:j,columns:p,hideToolbar:c,sortableFields:N}=t,C=a===void 0?Kt:a,v=f===void 0?"asc":f,P=g===void 0?Ft:g;let m;e[0]!==r?(m=r===void 0?{}:r,e[0]=r,e[1]=m):m=e[1];const I=m,k=d===void 0?Rt:d,T=x===void 0?null:x,y=h===void 0?null:h,O=j===void 0?!1:j,_=p===void 0?void 0:p,z=c===void 0?!1:c,w=N===void 0?void 0:N;let D;e[2]!==_||e[3]!==l||e[4]!==w?(D=_?_.filter(Bt).filter(U=>!w||w.includes(U.id)).map(Vt):Je(l,w),e[2]=_,e[3]=l,e[4]=w,e[5]=D):D=e[5];const S=D;let $;e[6]!==T||e[7]!==z||e[8]!==P||e[9]!==C||e[10]!==v||e[11]!==n||e[12]!==S||e[13]!==i?($=!z&&o.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:o.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[o.jsx("div",{className:"flex items-center gap-2 flex-1",children:T}),o.jsx("div",{className:"flex items-center gap-2 shrink-0",children:o.jsx(Le,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:v,onSort:P,sortOptions:S})})]})}),e[6]=T,e[7]=z,e[8]=P,e[9]=C,e[10]=v,e[11]=n,e[12]=S,e[13]=i,e[14]=$):$=e[14];let b;e[15]!==I||e[16]!==_||e[17]!==s||e[18]!==y||e[19]!==k||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==u||e[24]!==v||e[25]!==n||e[26]!==w||e[27]!==i?(b=i==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?o.jsx("div",{className:"flex items-center justify-center h-full",children:y||o.jsx(Ve,{icon:"inbox",title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(U=>o.jsx("div",{onClick:()=>k?.(U),className:"cursor-pointer h-full",children:o.jsx(kt,{item:U,schema:l,readOnly:O,actions:I})},U.id))})}):o.jsx(vt,{columns:Ht(_,l,w,I),data:s,sortKey:n,sortDirection:v,onSort:P,onRowClick:k,emptyState:y||o.jsx(Ve,{icon:"inbox",title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=I,e[16]=_,e[17]=s,e[18]=y,e[19]=k,e[20]=P,e[21]=O,e[22]=l,e[23]=u,e[24]=v,e[25]=n,e[26]=w,e[27]=i,e[28]=b):b=e[28];let E;return e[29]!==$||e[30]!==b?(E=o.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,b]}),e[29]=$,e[30]=b,e[31]=E):E=e[31],E}function Vt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Bt(t){return t.sortable!==!1}function Rt(){}function Ft(){}function Kt(){}function Lt(t){return{id:"actions",header:"",render:e=>o.jsxs(We,{children:[o.jsx(qe,{asChild:!0,children:o.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:o.jsx(M,{name:"more_vert",size:20})})}),o.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[t.open&&o.jsxs(B,{onClick:s=>{s.stopPropagation(),t.open?.(e)},children:[o.jsx(M,{name:"visibility",size:16}),"Open"]}),t.edit&&o.jsxs(B,{onClick:s=>{s.stopPropagation(),t.edit?.(e)},children:[o.jsx(M,{name:"edit",size:16}),"Edit"]}),t.duplicate&&o.jsxs(B,{onClick:s=>{s.stopPropagation(),t.duplicate?.(e)},children:[o.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&o.jsxs(B,{variant:"destructive",onClick:s=>{s.stopPropagation(),t.delete?.(e)},children:[o.jsx(M,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function Wt(t){const e=t.type;return e==="string"||e==="number"||e==="integer"||e==="boolean"}function Re(t){return t.type==="string"&&(t.format==="url"||t.format==="uri")}function qt(t,e){const s=t.properties||{},l=Object.keys(s).filter(n=>{const f=s[n];return f&&Wt(f)}),i=l.find(n=>{const f=s[n];return f&&Re(f)}),a=new Set;i&&a.add(i);const u=["title","description","updated_at","updated_by"];for(const n of u)l.includes(n)&&i!==n&&!a.has(n)&&a.add(n);for(const n of l)a.has(n)||a.add(n);return[...a.values()].map(n=>{const f=s[n];if(!f)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d==null?"—":o.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:e?e.includes(n):!["id"].includes(n),cellClassName:"max-w-[200px]"};const g=e?e.includes(n):!["id"].includes(n);return f.format==="date-time"||n.endsWith("_at")?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d?o.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:i===n&&Re(f)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d?o.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d==null?"—":o.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:g,cellClassName:"max-w-[100px]"}})}function Ht(t,e,s,l){const i=t||qt(e,s);return i.some(n=>n.id==="actions")?i:Object.keys(l).length>0?[...i,Lt(l)]:i}function Jt(t){const e=V.c(117),{connectionId:s,org:l,activeCollection:i}=t,a=i.name,u=i.schema??_t,n=i.hasCreateTool,f=i.hasUpdateTool,g=i.hasDeleteTool,r=Oe(),{data:d}=Ye.useSession(),x=d?.user?.id||"unknown",h=Ke(s);let j;e[0]!==s?(j=it(s),e[0]=s,e[1]=j):j=e[1];const p=j,c=st(s,a,p),N=`${s}-${a}`;let C;e[2]!==l||e[3]!==N?(C={namespace:l,resource:N,defaultSortKey:"updated_at"},e[2]=l,e[3]=N,e[4]=C):C=e[4];const{search:v,searchTerm:P,setSearch:m,viewMode:I,setViewMode:k,sortKey:T,sortDirection:y,handleSort:O}=yt(C);let _;e[5]!==P||e[6]!==y||e[7]!==T?(_={searchTerm:P,sortKey:T,sortDirection:y},e[5]=P,e[6]=y,e[7]=T,e[8]=_):_=e[8];const z=nt(s,a,p,_),w=!n&&!f&&!g;let D;e[9]!==a||e[10]!==s||e[11]!==r||e[12]!==l?(D=A=>{r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:s,collectionName:a,itemId:A.id}})},e[9]=a,e[10]=s,e[11]=r,e[12]=l,e[13]=D):D=e[13];const S=D;let $;e[14]!==c.create||e[15]!==x?($=async A=>{const he=new Date().toISOString();await c.create.mutateAsync({...A,id:Be("conn"),title:`${A.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=c.create,e[15]=x,e[16]=$):$=e[16];const b=$,[E,U]=ze.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=A=>{U(A)},e[17]=le):le=e[17];const Ge=le;let R;e[18]!==S||e[19]!==f?(R=f&&{edit:S},e[18]=S,e[19]=f,e[20]=R):R=e[20];let F;e[21]!==b||e[22]!==n?(F=n&&{duplicate:b},e[21]=b,e[22]=n,e[23]=F):F=e[23];let K;e[24]!==g?(K=g&&{delete:Ge},e[24]=g,e[25]=K):K=e[25];let ae;e[26]!==K||e[27]!==R||e[28]!==F?(ae={...R,...F,...K},e[26]=K,e[27]=R,e[28]=F,e[29]=ae):ae=e[29];const xe=ae;let re;e[30]!==c.delete||e[31]!==E?(re=async()=>{E&&(await c.delete.mutateAsync(E.id),U(null))},e[30]=c.delete,e[31]=E,e[32]=re):re=e[32];const je=re;let ce;e[33]!==c.create||e[34]!==a||e[35]!==s||e[36]!==n||e[37]!==r||e[38]!==l||e[39]!==x?(ce=async()=>{if(!n){Ze.error("Create operation is not available for this collection");return}const A=new Date().toISOString(),he={id:Be("conn"),title:"New Item",created_at:A,updated_at:A,created_by:x,updated_by:x};try{const ke=await c.create.mutateAsync(he);r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:s,collectionName:a,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[33]=c.create,e[34]=a,e[35]=s,e[36]=n,e[37]=r,e[38]=l,e[39]=x,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==u?(de=Je(u),e[41]=u,e[42]=de):de=e[42];const Ce=de,Me=(z?.length??0)>0,Qe=n&&Me,Xe=n&&!Me&&!v;let me;e[43]!==c.create||e[44]!==be||e[45]!==n?(me=n?o.jsxs(ge,{onClick:be,size:"sm",disabled:c.create.isPending,className:"h-7",children:[o.jsx(rt,{className:"mr-2 h-4 w-4"}),c.create.isPending?"Creating...":"Create"]}):null,e[43]=c.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=T;let L;e[47]!==O||e[48]!==k||e[49]!==y||e[50]!==Ce||e[51]!==ve||e[52]!==I?(L=o.jsx(Le,{viewMode:I,onViewModeChange:k,sortKey:ve,sortDirection:y,onSort:O,sortOptions:Ce}),e[47]=O,e[48]=k,e[49]=y,e[50]=Ce,e[51]=ve,e[52]=I,e[53]=L):L=e[53];const ye=`${a}s`,_e=h?.icon??"grid_view";let W;e[54]!==s||e[55]!==ye||e[56]!==_e?(W=o.jsx(ct,{connectionId:s,title:ye,icon:_e}),e[54]=s,e[55]=ye,e[56]=_e,e[57]=W):W=e[57];const we=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==we?(q=o.jsxs(ht,{children:[L,W,we]}),e[58]=L,e[59]=W,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${a}...`;let H;e[62]!==m?(H=A=>{A.key==="Escape"&&(m(""),A.target.blur())},e[62]=m,e[63]=H):H=e[63];let J;e[64]!==v||e[65]!==m||e[66]!==Se||e[67]!==H?(J=o.jsx(jt,{value:v,onChange:m,placeholder:Se,onKeyDown:H}),e[64]=v,e[65]=m,e[66]=Se,e[67]=H,e[68]=J):J=e[68];let G;e[69]!==z?(G=z??[],e[69]=z,e[70]=G):G=e[70];const Ne=T;let Q;e[71]!==S?(Q=A=>S(A),e[71]=S,e[72]=Q):Q=e[72];const Ie="No items found",Te=v?"Try adjusting your search terms":"This collection doesn't have any items yet.",De=Xe?Ue:void 0;let X;e[73]!==Ie||e[74]!==Te||e[75]!==De?(X=o.jsx(Ee,{image:null,title:Ie,description:Te,actions:De}),e[73]=Ie,e[74]=Te,e[75]=De,e[76]=X):X=e[76];let Y;e[77]!==O||e[78]!==w||e[79]!==xe||e[80]!==u||e[81]!==v||e[82]!==m||e[83]!==k||e[84]!==y||e[85]!==G||e[86]!==Ne||e[87]!==Q||e[88]!==X||e[89]!==I?(Y=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(Ut,{hideToolbar:!0,data:G,schema:u,viewMode:I,onViewModeChange:k,search:v,onSearchChange:m,sortKey:Ne,sortDirection:y,onSort:O,actions:xe,onItemClick:Q,readOnly:w,emptyState:X})}),e[77]=O,e[78]=w,e[79]=xe,e[80]=u,e[81]=v,e[82]=m,e[83]=k,e[84]=y,e[85]=G,e[86]=Ne,e[87]=Q,e[88]=X,e[89]=I,e[90]=Y):Y=e[90];let Z;e[91]!==J||e[92]!==Y?(Z=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[J,Y]}),e[91]=J,e[92]=Y,e[93]=Z):Z=e[93];const $e=!!E;let ue;e[94]===Symbol.for("react.memo_cache_sentinel")?(ue=A=>{A||U(null)},e[94]=ue):ue=e[94];let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=o.jsx(Nt,{children:"Delete item?"}),e[95]=fe):fe=e[95];const Ae=E?.title;let ee;e[96]!==Ae?(ee=o.jsxs(It,{children:[fe,o.jsxs(Tt,{children:['Are you sure you want to delete "',Ae,'"? This action cannot be undone.']})]}),e[96]=Ae,e[97]=ee):ee=e[97];let te;e[98]!==c.delete.isPending?(te=o.jsx(wt,{disabled:c.delete.isPending,children:"Cancel"}),e[98]=c.delete.isPending,e[99]=te):te=e[99];const Pe=c.delete.isPending?"Deleting...":"Delete";let oe;e[100]!==c.delete.isPending||e[101]!==je||e[102]!==Pe?(oe=o.jsx(St,{onClick:je,disabled:c.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=c.delete.isPending,e[101]=je,e[102]=Pe,e[103]=oe):oe=e[103];let se;e[104]!==te||e[105]!==oe?(se=o.jsxs(Dt,{children:[te,oe]}),e[104]=te,e[105]=oe,e[106]=se):se=e[106];let ne;e[107]!==ee||e[108]!==se?(ne=o.jsxs($t,{children:[ee,se]}),e[107]=ee,e[108]=se,e[109]=ne):ne=e[109];let ie;e[110]!==$e||e[111]!==ne?(ie=o.jsx(At,{open:$e,onOpenChange:ue,children:ne}),e[110]=$e,e[111]=ne,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==Z||e[115]!==ie?(pe=o.jsxs(o.Fragment,{children:[q,Z,ie]}),e[113]=q,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}function Gt(t){const e=V.c(2),{repository:s}=t;let l;return e[0]!==s?(l=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(ut,{repository:s})}),e[0]=s,e[1]=l):l=e[1],l}function Qt(t){const e=V.c(4),{tools:s,connectionId:l,org:i}=t;let a;return e[0]!==l||e[1]!==i||e[2]!==s?(a=o.jsx(ft,{tools:s,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=s,e[3]=a):a=e[3],a}function Xt(t){const e=V.c(49),{connection:s,connectionId:l,org:i,requestedTabId:a,collections:u,onUpdate:n,isUpdating:f}=t,g=ot();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/$org/mcps/$connectionId"},e[0]=r):r=e[0];const d=Oe(r);let x;e[1]!==s.connection_token||e[2]!==s.connection_url?(x={url:s.connection_url,token:s.connection_token},e[1]=s.connection_token,e[2]=s.connection_url,e[3]=x):x=e[3];const h=dt(x),j=s?.metadata?.repository,p=!!j?.url,c=s?.tools?.length??0;let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N={id:"settings",label:"Settings"},e[4]=N):N=e[4];let C;e[5]!==h||e[6]!==c?(C=h&&c>0?[{id:"tools",label:"Tools",count:c}]:[],e[5]=h,e[6]=c,e[7]=C):C=e[7];let v;if(e[8]!==u||e[9]!==p||e[10]!==h||e[11]!==C){let b;e[13]!==p?(b=p?[{id:"readme",label:"README"}]:[],e[13]=p,e[14]=b):b=e[14],v=[N,...C,...h?(u||[]).map(Yt):[],...b],e[8]=u,e[9]=p,e[10]=h,e[11]=C,e[12]=v}else v=e[12];const P=v,m=P.some(b=>b.id===a)?a:"settings";let I;e[15]!==d?(I=b=>{d({search:E=>({...E,tab:b}),replace:!0})},e[15]=d,e[16]=I):I=e[16];const k=I;let T;e[17]!==u?(T=u||[],e[17]=u,e[18]=T):T=e[18];let y;if(e[19]!==m||e[20]!==T){let b;e[22]!==m?(b=E=>E.name===m,e[22]=m,e[23]=b):b=e[23],y=T.find(b),e[19]=m,e[20]=T,e[21]=y}else y=e[21];const O=y;let _;e[24]!==g.history?(_=()=>g.history.back(),e[24]=g.history,e[25]=_):_=e[25];let z;e[26]!==m||e[27]!==k||e[28]!==P?(z=o.jsx(gt,{children:o.jsx(pt,{tabs:P,activeTab:m,onTabChange:k})}),e[26]=m,e[27]=k,e[28]=P,e[29]=z):z=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(M,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[30]=w):w=e[30];let D;e[31]!==O||e[32]!==m||e[33]!==s||e[34]!==l||e[35]!==p||e[36]!==h||e[37]!==f||e[38]!==n||e[39]!==i||e[40]!==j?(D=o.jsx(ze.Suspense,{fallback:w,children:m==="tools"?o.jsx(Qt,{tools:s.tools??void 0,connectionId:l,org:i}):m==="settings"?o.jsx(mt,{connection:s,onUpdate:n,isUpdating:f,isMCPAuthenticated:h}):m==="readme"&&p?o.jsx(Gt,{repository:j}):O&&h?o.jsx(Jt,{connectionId:l,org:i,activeCollection:O},m):o.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[31]=O,e[32]=m,e[33]=s,e[34]=l,e[35]=p,e[36]=h,e[37]=f,e[38]=n,e[39]=i,e[40]=j,e[41]=D):D=e[41];let S;e[42]!==m||e[43]!==D?(S=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Fe,{children:D},m)})}),e[42]=m,e[43]=D,e[44]=S):S=e[44];let $;return e[45]!==z||e[46]!==S||e[47]!==_?($=o.jsxs(xt,{onBack:_,children:[z,S]}),e[45]=z,e[46]=S,e[47]=_,e[48]=$):$=e[48],$}function Yt(t){return{id:t.name,label:t.displayName}}function Zt(){const t=V.c(17);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const s=Oe(e);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[1]=l):l=t[1];const{connectionId:i,org:a}=et(l);let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/mcps/$connectionId"},t[2]=u):u=t[2];const f=tt(u).tab||"settings",g=Ke(i),r=lt(),d=at(g??void 0);let x;t[3]!==r.update||t[4]!==i?(x=async p=>{await r.update.mutateAsync({id:i,data:p})},t[3]=r.update,t[4]=i,t[5]=x):x=t[5];const h=x;if(!g){let p;return t[6]!==s||t[7]!==a?(p=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Ee,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(ge,{variant:"outline",onClick:()=>s({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[6]=s,t[7]=a,t[8]=p):p=t[8],p}let j;return t[9]!==r.update.isPending||t[10]!==d||t[11]!==g||t[12]!==i||t[13]!==h||t[14]!==a||t[15]!==f?(j=o.jsx(Xt,{org:a,connection:g,connectionId:i,requestedTabId:f,collections:d,onUpdate:h,isUpdating:r.update.isPending}),t[9]=r.update.isPending,t[10]=d,t[11]=g,t[12]=i,t[13]=h,t[14]=a,t[15]=f,t[16]=j):j=t[16],j}function eo(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Fe,{children:o.jsx(ze.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Zt,{})})}),t[0]=e):e=t[0],e}function Ro(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(eo,{}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Ae,j as t,r as Ne,a5 as ze,b as Ee,a as Fe,ar as Ke,as as Be}from"./index-CxSCpakB.js";import{C as He}from"./schema-DlhuekEX.js";import{C as Oe}from"./collection-header-DNBGdgEG.js";import{C as Re}from"./collection-page-DwBYqm_T.js";import{C as Ve}from"./collection-search-C3auuf0Y.js";import{C as Le}from"./collection-table-wrapper-z4CuwV_C.js";import{C as Ue}from"./connection-card-BbhdU3sl.js";import{E as De}from"./empty-state-DCGHu7Ht.js";import{E as We}from"./error-boundary-dk0EDCPp.js";import{I as qe}from"./integration-icon-B5ZzeehM.js";import{d as Ge,b as Je}from"./use-connection-v-w_yxra.js";import{u as Qe}from"./use-list-state-j-4cxeBJ.js";import{u as Xe}from"./tooltip-BKoAX5gw.js";import{c as Ye,b as Ze,d as et,A as tt,e as nt,g as ot,a as st,f as it}from"./alert-dialog-BvyEfL2D.js";import{B as rt}from"./badge-DO3BPtZ-.js";import{B as E}from"./button-BeTb9YZU.js";import{a as ct,b as lt,D as at,f as dt,c as mt,d as ut}from"./dialog-BT08DzpN.js";import{b as Me,D as Pe,a as Te,c as pe}from"./dropdown-menu-DsWv8lkW.js";import{F,a as pt,b as K,c as B,d as H,f as O}from"./form-BmmDx2Hv.js";import{I as m}from"./icon-HmCDqOPd.js";import{I as Ie}from"./input-NL8_dTk4.js";import{c as ht,a as ft,S as gt,b as xt,d as ke}from"./select-BOj5RERj.js";import{T as jt}from"./textarea-DAuZp-vs.js";import{g as _t}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-DE8BFxrp.js";import"./utils-BGgJIaEU.js";import"./card-DFBJ_uBy.js";import"./use-mobile-BXGgFxUH.js";const Ct=He.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function St(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function yt(){const e=Ae.c(120),{org:n}=Xe(),r=ze();let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={strict:!1},e[0]=R):R=e[0];const $e=Ee(R),{data:he}=Fe.useSession();let V;e[1]!==n.slug?(V={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=V):V=e[2];const o=Qe(V),d=Ge(),z=Je(o);let L;e[3]===Symbol.for("react.memo_cache_sentinel")?(L={mode:"idle"},e[3]=L):L=e[3];const[l,u]=Ne.useReducer(St,L),U=$e.action==="create";let W;e[4]!==r||e[5]!==n.slug?(W=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=W):W=e[6];const fe=W;let q;e[7]!==r||e[8]!==n.slug?(q=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=q):q=e[9];const p=q;let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G={resolver:Ke(Ct),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=G):G=e[10];const i=Be(G),c=l.mode==="editing"?l.connection:null;let J,Q;e[11]!==c||e[12]!==i?(J=()=>{c?i.reset({title:c.title,description:c.description,connection_type:c.connection_type,connection_url:c.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},Q=[c,i],e[11]=c,e[12]=i,e[13]=J,e[14]=Q):(J=e[13],Q=e[14]),Ne.useEffect(J,Q);let X;e[15]!==d||e[16]!==l.connection||e[17]!==l.mode?(X=async()=>{if(l.mode!=="deleting")return;const s=l.connection.id;u({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=l.connection,e[17]=l.mode,e[18]=X):X=e[18];const ge=X;let Y;e[19]!==d||e[20]!==p||e[21]!==c||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==he?.user?.id?(Y=async s=>{if(c){await d.update.mutateAsync({id:c.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),u({type:"close"}),i.reset();return}const a=_t("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:he?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),p(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=p,e[21]=c,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=he?.user?.id,e[27]=Y):Y=e[27];const xe=Y;let Z;e[28]!==p||e[29]!==i||e[30]!==U?(Z=s=>{s||(U?p():u({type:"close"}),i.reset())},e[28]=p,e[29]=i,e[30]=U,e[31]=Z):Z=e[31];const h=Z;let ee,te,ne,oe,se,ie;e[32]===Symbol.for("react.memo_cache_sentinel")?(ee={id:"icon",header:"",render:Ft,cellClassName:"w-16 shrink-0"},te={id:"title",header:"Name",render:Et,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},ne={id:"description",header:"Description",render:zt,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},oe={id:"connection_type",header:"Type",accessor:$t,cellClassName:"w-24 shrink-0",sortable:!0},se={id:"connection_url",header:"URL",render:At,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},ie={id:"status",header:"Status",render:Tt,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=ee,e[33]=te,e[34]=ne,e[35]=oe,e[36]=se,e[37]=ie):(ee=e[32],te=e[33],ne=e[34],oe=e[35],se=e[36],ie=e[37]);let re;e[38]!==r||e[39]!==n.slug?(re=[ee,te,ne,oe,se,ie,{id:"actions",header:"",render:s=>t.jsxs(Me,{children:[t.jsx(Pe,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Pt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs(Te,{align:"end",onClick:Mt,children:[t.jsxs(pe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(pe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=re):re=e[40];const je=re;let ce;e[41]!==fe?(ce=t.jsx(E,{onClick:fe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[41]=fe,e[42]=ce):ce=e[42];const _e=ce,Ce=U||l.mode==="editing",Se=c?"Edit Connection":"Create New Connection";let f;e[43]!==Se?(f=t.jsx(ct,{children:Se}),e[43]=Se,e[44]=f):f=e[44];const ye=c?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let g;e[45]!==ye?(g=t.jsx(lt,{children:ye}),e[45]=ye,e[46]=g):g=e[46];let x;e[47]!==f||e[48]!==g?(x=t.jsxs(at,{children:[f,g]}),e[47]=f,e[48]=g,e[49]=x):x=e[49];let j;e[50]!==i||e[51]!==xe?(j=i.handleSubmit(xe),e[50]=i,e[51]=xe,e[52]=j):j=e[52];let _;e[53]!==i.control?(_=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(F,{control:i.control,name:"title",render:It}),t.jsx(F,{control:i.control,name:"description",render:Nt}),t.jsx(F,{control:i.control,name:"connection_type",render:kt}),t.jsx(F,{control:i.control,name:"connection_url",render:Dt}),t.jsx(F,{control:i.control,name:"connection_token",render:wt})]}),e[53]=i.control,e[54]=_):_=e[54];let C;e[55]!==h?(C=t.jsx(E,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e[55]=h,e[56]=C):C=e[56];const ve=i.formState.isSubmitting?"Saving...":c?"Update Connection":"Create Connection";let S;e[57]!==i.formState.isSubmitting||e[58]!==ve?(S=t.jsx(E,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:ve}),e[57]=i.formState.isSubmitting,e[58]=ve,e[59]=S):S=e[59];let y;e[60]!==C||e[61]!==S?(y=t.jsxs(dt,{children:[C,S]}),e[60]=C,e[61]=S,e[62]=y):y=e[62];let v;e[63]!==j||e[64]!==_||e[65]!==y?(v=t.jsxs("form",{onSubmit:j,children:[_,y]}),e[63]=j,e[64]=_,e[65]=y,e[66]=v):v=e[66];let b;e[67]!==i||e[68]!==v?(b=t.jsx(pt,{...i,children:v}),e[67]=i,e[68]=v,e[69]=b):b=e[69];let w;e[70]!==x||e[71]!==b?(w=t.jsxs(mt,{className:"sm:max-w-[525px]",children:[x,b]}),e[70]=x,e[71]=b,e[72]=w):w=e[72];let D;e[73]!==h||e[74]!==Ce||e[75]!==w?(D=t.jsx(ut,{open:Ce,onOpenChange:h,children:w}),e[73]=h,e[74]=Ce,e[75]=w,e[76]=D):D=e[76];const be=l.mode==="deleting";let le;e[77]===Symbol.for("react.memo_cache_sentinel")?(le=s=>!s&&u({type:"close"}),e[77]=le):le=e[77];let ae;e[78]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(Ye,{children:"Delete Connection?"}),e[78]=ae):ae=e[78];const we=l.mode==="deleting"&&l.connection.title;let k;e[79]!==we?(k=t.jsxs(Ze,{children:[ae,t.jsxs(et,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:we}),"."]})]}),e[79]=we,e[80]=k):k=e[80];let de;e[81]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(tt,{children:"Cancel"}),e[81]=de):de=e[81];let N;e[82]!==ge?(N=t.jsxs(nt,{children:[de,t.jsx(ot,{onClick:ge,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[82]=ge,e[83]=N):N=e[83];let I;e[84]!==k||e[85]!==N?(I=t.jsxs(st,{children:[k,N]}),e[84]=k,e[85]=N,e[86]=I):I=e[86];let M;e[87]!==be||e[88]!==I?(M=t.jsx(it,{open:be,onOpenChange:le,children:I}),e[87]=be,e[88]=I,e[89]=M):M=e[89];let me;e[90]===Symbol.for("react.memo_cache_sentinel")?(me=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[90]=me):me=e[90];let P;e[91]!==_e||e[92]!==o.handleSort||e[93]!==o.setViewMode||e[94]!==o.sortDirection||e[95]!==o.sortKey||e[96]!==o.viewMode?(P=t.jsx(Oe,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:me,ctaButton:_e}),e[91]=_e,e[92]=o.handleSort,e[93]=o.setViewMode,e[94]=o.sortDirection,e[95]=o.sortKey,e[96]=o.viewMode,e[97]=P):P=e[97];let T;e[98]!==o?(T=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[98]=o,e[99]=T):T=e[99];let A;e[100]!==o.search||e[101]!==o.setSearch||e[102]!==T?(A=t.jsx(Ve,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:T}),e[100]=o.search,e[101]=o.setSearch,e[102]=T,e[103]=A):A=e[103];let $;e[104]!==je||e[105]!==z||e[106]!==o.handleSort||e[107]!==o.search||e[108]!==o.sortDirection||e[109]!==o.sortKey||e[110]!==o.viewMode||e[111]!==r||e[112]!==n.slug?($=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:z.length===0?t.jsx(De,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:z.map(s=>t.jsx(Ue,{connection:s,fallbackIcon:"extension",onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Me,{children:[t.jsx(Pe,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:bt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs(Te,{align:"end",onClick:vt,children:[t.jsxs(pe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(pe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(Le,{columns:je,data:z,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(De,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(De,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[104]=je,e[105]=z,e[106]=o.handleSort,e[107]=o.search,e[108]=o.sortDirection,e[109]=o.sortKey,e[110]=o.viewMode,e[111]=r,e[112]=n.slug,e[113]=$):$=e[113];let ue;return e[114]!==D||e[115]!==M||e[116]!==P||e[117]!==A||e[118]!==$?(ue=t.jsxs(Re,{children:[D,M,P,A,$]}),e[114]=D,e[115]=M,e[116]=P,e[117]=A,e[118]=$,e[119]=ue):ue=e[119],ue}function vt(e){return e.stopPropagation()}function bt(e){return e.stopPropagation()}function wt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Token (optional)"}),t.jsx(H,{children:t.jsx(Ie,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(O,{})]})}function Dt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"URL *"}),t.jsx(H,{children:t.jsx(Ie,{placeholder:"https://example.com/mcp",...n})}),t.jsx(O,{})]})}function kt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Type *"}),t.jsxs(ht,{value:n.value,onValueChange:n.onChange,children:[t.jsx(H,{children:t.jsx(ft,{children:t.jsx(gt,{})})}),t.jsxs(xt,{children:[t.jsx(ke,{value:"HTTP",children:"HTTP"}),t.jsx(ke,{value:"SSE",children:"SSE"}),t.jsx(ke,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(O,{})]})}function Nt(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Description"}),t.jsx(H,{children:t.jsx(jt,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(O,{})]})}function It(e){const{field:n}=e;return t.jsxs(K,{children:[t.jsx(B,{children:"Name *"}),t.jsx(H,{children:t.jsx(Ie,{placeholder:"My Connection",...n})}),t.jsx(O,{})]})}function Mt(e){return e.stopPropagation()}function Pt(e){return e.stopPropagation()}function Tt(e){return t.jsx(rt,{variant:e.status==="active"?"default":"outline",children:e.status})}function At(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function $t(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function zt(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Et(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ft(e){return t.jsx(qe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function pn(){const e=Ae.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(We,{children:t.jsx(Ne.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(m,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(yt,{})})}),e[0]=n):n=e[0],n}export{pn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as D,aq as O,c as _,a5 as N,ar as E,as as T,j as r,a as I}from"./index-CxSCpakB.js";import{A as M,a as L,b as R,c as $,d as q,e as B,f as V}from"./alert-dialog-BvyEfL2D.js";import{u as k,B as H}from"./button-BeTb9YZU.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-BmmDx2Hv.js";import{I as X}from"./input-NL8_dTk4.js";import{S as Y}from"./spinner-wv31KLi9.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,y=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=T(b);let z;e[1]!==y?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;y({to:"/$org",params:{org:s}})}},e[1]=y,e[2]=z):z=e[2];const a=k(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsxs(R,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(q,{children:"Set up a new organization to collaborate with others."})]}),e[3]=C):C=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const v=!t.formState.isValid||t.formState.isSubmitting;let p;e[22]!==t.formState.isSubmitting?(p=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=p):p=e[23];let S;e[24]!==v||e[25]!==p?(S=r.jsx(H,{type:"submit",variant:"default",disabled:v,children:p}),e[24]=v,e[25]=p,e[26]=S):S=e[26];let x;e[27]!==S||e[28]!==d?(x=r.jsxs(B,{children:[d,S]}),e[27]=S,e[28]=d,e[29]=x):x=e[29];let h;e[30]!==x||e[31]!==m||e[32]!==g||e[33]!==f?(h=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,x]}),e[30]=x,e[31]=m,e[32]=g,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==t||e[36]!==h?(j=r.jsxs(L,{children:[C,r.jsx(G,{...t,children:h})]}),e[35]=t,e[36]=h,e[37]=j):j=e[37];let w;return e[38]!==l||e[39]!==o||e[40]!==j?(w=r.jsx(V,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=w):w=e[41],w}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await I.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,j as i,a8 as m,ax as g,ab as u,a9 as x,aa as j,ac as N,ae as h,ad as b}from"./index-CxSCpakB.js";import{c}from"./utils-BGgJIaEU.js";import{c as D}from"./tooltip-BKoAX5gw.js";const v=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],y=D("x",v);function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function _(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(h,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function k(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(y,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function B(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-lg duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx(k,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs($,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function S(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{E as D,y as X,P as a,S as b,B as c,T as d,R as e,O as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c,j as i,bC as p,bD as f,bE as m,bF as g,bG as x,bH as b,bI as v,bJ as w,bK as h}from"./index-CxSCpakB.js";import{c as u}from"./utils-BGgJIaEU.js";import{c as j}from"./tooltip-BKoAX5gw.js";const N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],D=j("chevron-right",N);function _(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function y(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function C(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function I(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function R(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(b,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function k(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{D as C,$ as D,y as a,_ as b,C as c,I as d,R as e,T as f,k as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as v,j as t}from"./index-CxSCpakB.js";import{c as N}from"./utils-BGgJIaEU.js";function y(){const f=v.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:218,height:190,"aria-hidden":"true"}),f[0]=e):e=f[0],e}function S(f){const e=v.c(24),{image:o,title:p,description:u,actions:x,className:h,descriptionClassName:j,actionsClassName:g}=f;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==o?(l=o!==null&&t.jsx("div",{className:"flex items-center justify-center",children:o??t.jsx(y,{})}),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let r;e[11]!==i||e[12]!==a?(r=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=r):r=e[13];let n;e[14]!==x||e[15]!==g?(n=x&&t.jsx("div",{className:N("flex items-center gap-2",g),children:x}),e[14]=x,e[15]=g,e[16]=n):n=e[16];let m;e[17]!==r||e[18]!==n?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r,n]}),e[17]=r,e[18]=n,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{S as E};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b6 as s,r as a,j as e}from"./index-CxSCpakB.js";import{B as o}from"./button-BeTb9YZU.js";const n=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],l=s("triangle-alert",n);class h extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,t){console.error("Uncaught error:",r,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(l,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(o,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{h as E};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,j as m,bb as $,bL as j,bM as C,r as f,ag as N,bN as v,bO as h}from"./index-CxSCpakB.js";import{c as u}from"./utils-BGgJIaEU.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const y=j,g=f.createContext({}),D=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=v();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function E(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(N,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function O(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{D as F,y as a,E as b,L as c,P as d,R as e,O as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as N,aB as Be,j as t,aC as je,az as be,aO as Fe,aE as Ge,bf as De,bg as Ue,c as O,a5 as Ve,d as Me,ap as Oe,bi as fe,aq as he,b5 as We,ar as Le,as as qe,a6 as xe}from"./index-CxSCpakB.js";import{E as He}from"./empty-state-DCGHu7Ht.js";import{E as ye}from"./error-boundary-dk0EDCPp.js";import{I as Je}from"./integration-icon-B5ZzeehM.js";import{T as Xe}from"./tool-set-selector-BYF6NlFy.js";import{b as Ke,a as Qe}from"./use-gateway-gKeEvLRE.js";import{b as Ye}from"./use-connection-v-w_yxra.js";import{B as J}from"./button-BeTb9YZU.js";import{I as M}from"./icon-HmCDqOPd.js";import{I as ve}from"./input-NL8_dTk4.js";import{c as pe}from"./utils-BGgJIaEU.js";import{F as Z,a as Ze,b as te,d as se,f as oe,c as _e}from"./form-BmmDx2Hv.js";import{c as we,a as Ce,S as Se,b as Ne,d as ee}from"./select-BOj5RERj.js";import{d as X,b as K,a as Q,T as Y}from"./tooltip-BKoAX5gw.js";import{V as et,b as tt}from"./layout-CKQw59Ep.js";import{f as st}from"./formatDistanceToNow-Ctx6mZEP.js";import"./checkbox-Ep63AJ5F.js";import"./collection-search-C3auuf0Y.js";var me="Switch",[ot]=Be(me),[nt,lt]=ot(me),ke=N.forwardRef((o,e)=>{const{__scopeSwitch:s,name:n,checked:a,defaultChecked:r,required:i,disabled:c,value:l="on",onCheckedChange:m,form:d,...p}=o,[u,j]=N.useState(null),f=be(e,b=>j(b)),h=N.useRef(!1),g=u?d||!!u.closest("form"):!0,[A,D]=Fe({prop:a,defaultProp:r??!1,onChange:m,caller:me});return t.jsxs(nt,{scope:s,checked:A,disabled:c,children:[t.jsx(je.button,{type:"button",role:"switch","aria-checked":A,"aria-required":i,"data-state":$e(A),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:Ge(o.onClick,b=>{D(y=>!y),g&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})}),g&&t.jsx(Ee,{control:u,bubbles:!h.current,name:n,value:l,checked:A,required:i,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});ke.displayName=me;var Te="SwitchThumb",Ie=N.forwardRef((o,e)=>{const{__scopeSwitch:s,...n}=o,a=lt(Te,s);return t.jsx(je.span,{"data-state":$e(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});Ie.displayName=Te;var at="SwitchBubbleInput",Ee=N.forwardRef(({__scopeSwitch:o,control:e,checked:s,bubbles:n=!0,...a},r)=>{const i=N.useRef(null),c=be(i,r),l=De(s),m=Ue(e);return N.useEffect(()=>{const d=i.current;if(!d)return;const p=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(p,"checked").set;if(l!==s&&j){const f=new Event("click",{bubbles:n});j.call(d,s),d.dispatchEvent(f)}},[l,s,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...a,tabIndex:-1,ref:c,style:{...a.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ee.displayName=at;function $e(o){return o?"checked":"unchecked"}var it=ke,rt=Ie;function ct(o){const e=O.c(9);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=pe("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=a):a=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(rt,{"data-slot":"switch-thumb",className:pe("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=r):r=e[5];let i;return e[6]!==n||e[7]!==a?(i=t.jsx(it,{"data-slot":"switch",className:a,...n,children:r}),e[6]=n,e[7]=a,e[8]=i):i=e[8],i}function ge(o){const s=new TextEncoder().encode(o),n=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(n)}function dt(o){const e=O.c(63),{serverName:s,gatewayUrl:n}=o,[a,r]=N.useState(!1),[i,c]=N.useState(null);let l,m,d,p,u;if(e[0]!==n||e[1]!==s){const re={type:"http",url:n},ce={[s]:re};l=JSON.stringify(ce,null,2);const ue=ze=>JSON.stringify({...re,headers:{"x-mesh-client":ze}},null,2),Pe=ge(ue("Cursor"));m=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(s)}&config=${encodeURIComponent(Pe)}`;const Re=ge(ue("Windsurf"));u=`windsurf://codeium.windsurf/mcp/install?name=${encodeURIComponent(s)}&config=${encodeURIComponent(Re)}`;const Ae=ue("Claude Code");d=s;let de;e[7]===Symbol.for("react.memo_cache_sentinel")?(de=/'/g,e[7]=de):de=e[7],p=Ae.replace(de,"'\\''"),e[0]=n,e[1]=s,e[2]=l,e[3]=m,e[4]=d,e[5]=p,e[6]=u}else l=e[2],m=e[3],d=e[4],p=e[5],u=e[6];const j=`claude mcp add "${d}" --config '${p}'`;let f;e[8]!==l?(f=async()=>{await navigator.clipboard.writeText(l),r(!0),xe.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[8]=l,e[9]=f):f=e[9];const h=f;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=async(re,ce)=>{await navigator.clipboard.writeText(re),c(ce),xe.success(`${ce} command copied`),setTimeout(()=>c(null),2e3)},e[10]=g):g=e[10];const A=g,D=mt;let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[11]=b):b=e[11];const y=a?"check":"content_copy";let V;e[12]!==y?(V=t.jsx(M,{name:y,size:14}),e[12]=y,e[13]=V):V=e[13];let z;e[14]!==h||e[15]!==V?(z=t.jsx(Q,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:h,children:V})}),e[14]=h,e[15]=V,e[16]=z):z=e[16];let G;e[17]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Y,{children:"Copy configuration"}),e[17]=G):G=e[17];let B;e[18]!==z?(B=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(X,{children:t.jsxs(K,{children:[z,G]})})}),e[18]=z,e[19]=B):B=e[19];let v;e[20]!==l||e[21]!==h?(v=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:h,children:l}),e[20]=l,e[21]=h,e[22]=v):v=e[22];let _;e[23]!==B||e[24]!==v?(_=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[B,v]}),e[23]=B,e[24]=v,e[25]=_):_=e[25];let w;e[26]!==m?(w=()=>D(m),e[26]=m,e[27]=w):w=e[27];let k,T;e[28]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),T=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[28]=k,e[29]=T):(k=e[28],T=e[29]);let F;e[30]!==w?(F=t.jsx(Q,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:w,children:[k,T]})}),e[30]=w,e[31]=F):F=e[31];let I;e[32]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Y,{children:"Add to Cursor"}),e[32]=I):I=e[32];let E;e[33]!==F?(E=t.jsx(X,{children:t.jsxs(K,{children:[F,I]})}),e[33]=F,e[34]=E):E=e[34];let C;e[35]!==j?(C=()=>A(j,"Claude"),e[35]=j,e[36]=C):C=e[36];let $,P;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),P=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[37]=$,e[38]=P):($=e[37],P=e[38]);let S;e[39]!==i?(S=i==="Claude"&&t.jsx(M,{name:"check",size:14,className:"ml-2 text-green-500"}),e[39]=i,e[40]=S):S=e[40];let R;e[41]!==C||e[42]!==S?(R=t.jsx(Q,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:C,children:[$,P,S]})}),e[41]=C,e[42]=S,e[43]=R):R=e[43];let x;e[44]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Y,{children:"Add to Claude Code"}),e[44]=x):x=e[44];let U;e[45]!==R?(U=t.jsx(X,{children:t.jsxs(K,{children:[R,x]})}),e[45]=R,e[46]=U):U=e[46];let W;e[47]!==u?(W=()=>D(u),e[47]=u,e[48]=W):W=e[48];let ne,le;e[49]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("img",{src:"/logos/Windsurf.svg",alt:"Windsurf",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(6%) sepia(68%) saturate(3620%) hue-rotate(204deg) brightness(92%) contrast(103%)"}}),le=t.jsx("span",{className:"text-sm font-medium",children:"Windsurf"}),e[49]=ne,e[50]=le):(ne=e[49],le=e[50]);let L;e[51]!==W?(L=t.jsx(Q,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:W,children:[ne,le]})}),e[51]=W,e[52]=L):L=e[52];let ae;e[53]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(Y,{children:"Add to Windsurf"}),e[53]=ae):ae=e[53];let q;e[54]!==L?(q=t.jsx(X,{children:t.jsxs(K,{children:[L,ae]})}),e[54]=L,e[55]=q):q=e[55];let H;e[56]!==E||e[57]!==U||e[58]!==q?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[E,U,q]}),e[56]=E,e[57]=U,e[58]=q,e[59]=H):H=e[59];let ie;return e[60]!==_||e[61]!==H?(ie=t.jsxs("div",{className:"flex flex-col gap-4",children:[b,_,H]}),e[60]=_,e[61]=H,e[62]=ie):ie=e[62],ie}function mt(o){window.open(o,"_blank")}const ut=Oe({title:he().min(1,"Name is required").max(255),description:he().nullable(),status:fe(["active","inactive"]),tool_selection_mode:fe(["inclusion","exclusion"]),tool_selection_strategy:fe(["passthrough","smart_tool_selection","code_execution"])});function ft(o,e){const s={};for(const n of o.connections)if(n.selected_tools===null){const a=e.get(n.connection_id)??[];a.length>0&&(s[n.connection_id]=a)}else n.selected_tools.length>0&&(s[n.connection_id]=n.selected_tools);return s}function ht(o,e){return Object.entries(o).map(([s,n])=>{const a=e.get(s)??[],r=a.length>0&&a.every(i=>n.includes(i));return{connection_id:s,selected_tools:r?null:n}})}function xt(o){const e=O.c(28),{form:s,toolSet:n,onToolSetChange:a,icon:r}=o;let i;e[0]!==s?(i=s.watch("title")||"Gateway",e[0]=s,e[1]=i):i=e[1];let c;e[2]!==r||e[3]!==i?(c=t.jsx(Je,{icon:r,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"}),e[2]=r,e[3]=i,e[4]=c):c=e[4];let l;e[5]!==s.control?(l=t.jsx(Z,{control:s.control,name:"status",render:yt}),e[5]=s.control,e[6]=l):l=e[6];let m;e[7]!==c||e[8]!==l?(m=t.jsxs("div",{className:"flex items-start justify-between",children:[c,l]}),e[7]=c,e[8]=l,e[9]=m):m=e[9];let d;e[10]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(Z,{control:s.control,name:"title",render:bt}),t.jsx(Z,{control:s.control,name:"description",render:jt})]}),e[10]=s.control,e[11]=d):d=e[11];let p;e[12]!==m||e[13]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,d]}),e[12]=m,e[13]=d,e[14]=p):p=e[14];let u;e[15]!==s.control?(u=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(Z,{control:s.control,name:"tool_selection_mode",render:gt}),t.jsx(Z,{control:s.control,name:"tool_selection_strategy",render:pt})]}),e[15]=s.control,e[16]=u):u=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[17]=j):j=e[17];let f;e[18]!==a||e[19]!==n?(f=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(ye,{children:t.jsx(N.Suspense,{fallback:j,children:t.jsx(Xe,{toolSet:n,onToolSetChange:a})})})}),e[18]=a,e[19]=n,e[20]=f):f=e[20];let h;e[21]!==p||e[22]!==u||e[23]!==f?(h=t.jsxs("div",{className:"flex flex-col h-full",children:[p,u,f]}),e[21]=p,e[22]=u,e[23]=f,e[24]=h):h=e[24];let g;return e[25]!==s||e[26]!==h?(g=t.jsx(Ze,{...s,children:h}),e[25]=s,e[26]=h,e[27]=g):g=e[27],g}function pt(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(_e,{className:"mb-0",children:"Gateway Strategy"}),t.jsx(X,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(M,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})})]}),t.jsxs(we,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(Ce,{className:"w-[180px]",children:t.jsx(Se,{})})}),t.jsxs(Ne,{children:[t.jsx(ee,{value:"passthrough",children:"Passthrough"}),t.jsx(ee,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(ee,{value:"code_execution",children:"Code Execution"})]})]})]}),t.jsx(oe,{})]})}function gt(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(_e,{className:"mb-0",children:"Tool Selection Mode"}),t.jsx(X,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(M,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"right",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})})]}),t.jsxs(we,{value:e.value,onValueChange:e.onChange,children:[t.jsx(se,{children:t.jsx(Ce,{className:"w-[180px]",children:t.jsx(Se,{})})}),t.jsxs(Ne,{children:[t.jsx(ee,{value:"inclusion",children:"Include Selected"}),t.jsx(ee,{value:"exclusion",children:"Exclude Selected"})]})]})]}),t.jsx(oe,{})]})}function jt(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(ve,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(oe,{})]})}function bt(o){const{field:e}=o;return t.jsxs(te,{className:"w-full space-y-0",children:[t.jsx(se,{children:t.jsx(ve,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(oe,{})]})}function yt(o){const{field:e}=o;return t.jsxs(te,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(se,{children:t.jsx(ct,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(oe,{})]})}function vt(o){const e=O.c(53),{gateway:s,gatewayId:n}=o,a=We(),r=Qe();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const c=Ye(i);let l;if(e[1]!==c){l=new Map;for(const x of c)x.tools&&x.tools.length>0&&l.set(x.id,x.tools.map(_t));e[1]=c,e[2]=l}else l=e[2];let m;e[3]!==l||e[4]!==s?(m=()=>ft(s,l),e[3]=l,e[4]=s,e[5]=m):m=e[5];const[d,p]=N.useState(m),[u,j]=N.useState(!1);let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{p(x),j(!0)},e[6]=f):f=e[6];const h=f;let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=Le(ut),e[7]=g):g=e[7];const A=s.tool_selection_mode??"inclusion",D=s.tool_selection_strategy??"passthrough";let b;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==A||e[12]!==D?(b={resolver:g,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:A,tool_selection_strategy:D}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=A,e[12]=D,e[13]=b):b=e[13];const y=qe(b),z=y.formState.isDirty||u;let G;e[14]!==r.update||e[15]!==l||e[16]!==y||e[17]!==n||e[18]!==d?(G=async()=>{const x=y.getValues(),U=ht(d,l);await r.update.mutateAsync({id:n,data:{title:x.title,description:x.description,status:x.status,tool_selection_mode:x.tool_selection_mode,tool_selection_strategy:x.tool_selection_strategy,connections:U}}),y.reset(x),j(!1)},e[14]=r.update,e[15]=l,e[16]=y,e[17]=n,e[18]=d,e[19]=G):G=e[19];const B=G;let v;e[20]!==a.history?(v=()=>a.history.back(),e[20]=a.history,e[21]=v):v=e[21];let _;e[22]!==r.update.isPending||e[23]!==B||e[24]!==z?(_=z&&t.jsxs(J,{onClick:B,disabled:r.update.isPending,size:"sm",className:"h-7",children:[r.update.isPending&&t.jsx(M,{name:"progress_activity",size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=r.update.isPending,e[23]=B,e[24]=z,e[25]=_):_=e[25];let w;e[26]!==_?(w=t.jsx(et,{children:_}),e[26]=_,e[27]=w):w=e[27];let k;e[28]!==y||e[29]!==s.icon||e[30]!==d?(k=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(xt,{form:y,toolSet:d,onToolSetChange:h,icon:s.icon})}),e[28]=y,e[29]=s.icon,e[30]=d,e[31]=k):k=e[31];let T;e[32]!==s.id||e[33]!==s.title?(T=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=T):T=e[34];const F=`${window.location.origin}/mcp/gateway/${s.id}`;let I;e[35]!==T||e[36]!==F?(I=t.jsx("div",{className:"p-5",children:t.jsx(dt,{serverName:T,gatewayUrl:F})}),e[35]=T,e[36]=F,e[37]=I):I=e[37];let E;e[38]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=E):E=e[38];let C;e[39]!==s.updated_at?(C=s.updated_at?st(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=C):C=e[40];let $;e[41]!==C?($=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[E,t.jsx("span",{className:"font-mono text-sm uppercase text-muted-foreground",children:C})]}),e[41]=C,e[42]=$):$=e[42];let P;e[43]!==I||e[44]!==$?(P=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[I,$]}),e[43]=I,e[44]=$,e[45]=P):P=e[45];let S;e[46]!==k||e[47]!==P?(S=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[k,P]}),e[46]=k,e[47]=P,e[48]=S):S=e[48];let R;return e[49]!==w||e[50]!==S||e[51]!==v?(R=t.jsxs(tt,{onBack:v,children:[w,S]}),e[49]=w,e[50]=S,e[51]=v,e[52]=R):R=e[52],R}function _t(o){return o.name}function wt(){const o=O.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Ve(e);let n;o[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/gateways/$gatewayId"},o[1]=n):n=o[1];const{gatewayId:a,org:r}=Me(n),i=Ke(a);if(!i){let l;return o[2]!==s||o[3]!==r?(l=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(He,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),o[2]=s,o[3]=r,o[4]=l):l=o[4],l}let c;return o[5]!==i||o[6]!==a?(c=t.jsx(vt,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=c):c=o[7],c}function Ct(){const o=O.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ye,{children:t.jsx(N.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(wt,{})})}),o[0]=e):e=o[0],e}function Ot(){const o=O.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ct,{}),o[0]=e):e=o[0],e}export{Ot as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Y,j as t,r as Z,a5 as te,a6 as se}from"./index-CxSCpakB.js";import{C as oe}from"./collection-header-DNBGdgEG.js";import{C as ae}from"./collection-page-DwBYqm_T.js";import{C as ne}from"./collection-search-C3auuf0Y.js";import{C as re}from"./collection-table-wrapper-z4CuwV_C.js";import{C as ie}from"./connection-card-BbhdU3sl.js";import{E as q}from"./empty-state-DCGHu7Ht.js";import{E as le}from"./error-boundary-dk0EDCPp.js";import{I as ce}from"./integration-icon-B5ZzeehM.js";import{a as de,u as me}from"./use-gateway-gKeEvLRE.js";import{b as ue}from"./use-connection-v-w_yxra.js";import{u as ge}from"./use-list-state-j-4cxeBJ.js";import{u as pe}from"./tooltip-BKoAX5gw.js";import{c as he,b as fe,d as xe,A as we,e as ye,g as je,a as Ce,f as Ne}from"./alert-dialog-BvyEfL2D.js";import{B as ee}from"./badge-DO3BPtZ-.js";import{B as J}from"./button-BeTb9YZU.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-DsWv8lkW.js";import{I as i}from"./icon-HmCDqOPd.js";import"./collection-display-button-DE8BFxrp.js";import"./utils-BGgJIaEU.js";import"./input-NL8_dTk4.js";import"./card-DFBJ_uBy.js";import"./use-mobile-BXGgFxUH.js";function ve(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function De(){const e=Y.c(68),{org:a}=pe(),n=te();let y;e[0]!==a.slug?(y={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=y):y=e[1];const s=ge(y),r=de(),w=me(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[l,N]=Z.useReducer(ve,C);let v;e[4]!==r.create||e[5]!==R.length||e[6]!==n||e[7]!==a.slug?(v=async()=>{if(R.length===0){se.error("Create at least one MCP connection first");return}const o=await r.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=r.create,e[5]=R.length,e[6]=n,e[7]=a.slug,e[8]=v):v=e[8];const T=v;let D;e[9]!==r.delete||e[10]!==l.gateway||e[11]!==l.mode?(D=async()=>{if(l.mode!=="deleting")return;const o=l.gateway.id;N({type:"close"});try{await r.delete.mutateAsync(o)}catch{}},e[9]=r.delete,e[10]=l.gateway,e[11]=l.mode,e[12]=D):D=e[12];const O=D;let S,_,b,k,I,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={id:"icon",header:"",render:$e,cellClassName:"w-16 shrink-0"},b={id:"title",header:"Name",render:Ae,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},k={id:"description",header:"Description",render:ze,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Pe,cellClassName:"w-[100px]"},M={id:"connections",header:"Connections",render:Me,cellClassName:"w-24 shrink-0"},S={id:"status",header:"Status",render:Ie,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=S,e[14]=_,e[15]=b,e[16]=k,e[17]=I,e[18]=M):(S=e[13],_=e[14],b=e[15],k=e[16],I=e[17],M=e[18]);let P;e[19]!==n||e[20]!==a.slug?(P=[_,b,k,I,M,S,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ke,children:t.jsx(i,{name:"more_vert",size:20})})}),t.jsxs(X,{align:"end",onClick:be,children:[t.jsxs(B,{onClick:c=>{c.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(i,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:c=>{c.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(i,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=n,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=r.create.isPending?"Creating...":"Create MCP Gateway";let z;e[22]!==r.create.isPending||e[23]!==T||e[24]!==H?(z=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:r.create.isPending,children:H}),e[22]=r.create.isPending,e[23]=T,e[24]=H,e[25]=z):z=e[25];const L=z,F=l.mode==="deleting";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o=>!o&&N({type:"close"}),e[26]=A):A=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(he,{children:"Delete Gateway?"}),e[27]=$):$=e[27];const W=l.mode==="deleting"&&l.gateway.title;let d;e[28]!==W?(d=t.jsxs(fe,{children:[$,t.jsxs(xe,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=d):d=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(we,{children:"Cancel"}),e[30]=E):E=e[30];let m;e[31]!==O?(m=t.jsxs(ye,{children:[E,t.jsx(je,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=m):m=e[32];let u;e[33]!==d||e[34]!==m?(u=t.jsxs(Ce,{children:[d,m]}),e[33]=d,e[34]=m,e[35]=u):u=e[35];let g;e[36]!==F||e[37]!==u?(g=t.jsx(Ne,{open:F,onOpenChange:A,children:u}),e[36]=F,e[37]=u,e[38]=g):g=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let p;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(p=t.jsx(oe,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=p):p=e[46];let h;e[47]!==s?(h=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=h):h=e[48];let f;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==h?(f=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:h}),e[49]=s.search,e[50]=s.setSearch,e[51]=h,e[52]=f):f=e[52];let x;e[53]!==V||e[54]!==w||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==n||e[61]!==a.slug?(x=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:w.length===0?t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:w.map(o=>t.jsx(ie,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:"network_node",onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_e,children:t.jsx(i,{name:"more_vert",size:20})})}),t.jsxs(X,{align:"end",onClick:Se,children:[t.jsxs(B,{onClick:c=>{c.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(i,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:c=>{c.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(i,{name:"delete",size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(re,{columns:V,data:w,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=w,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=n,e[61]=a.slug,e[62]=x):x=e[62];let K;return e[63]!==g||e[64]!==p||e[65]!==f||e[66]!==x?(K=t.jsxs(ae,{children:[g,p,f,x]}),e[63]=g,e[64]=p,e[65]=f,e[66]=x,e[67]=K):K=e[67],K}function Se(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function be(e){return e.stopPropagation()}function ke(e){return e.stopPropagation()}function Ie(e){return t.jsx(ee,{variant:e.status==="active"?"default":"outline",children:e.status})}function Me(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Pe(e){return t.jsx(ee,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function ze(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ae(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function $e(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"})}function at(){const e=Y.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(le,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(i,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(De,{})})}),e[0]=a):a=e[0],a}export{at as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as u,j as i,a as w,r as C,a5 as $}from"./index-CxSCpakB.js";import{C as _}from"./card-DFBJ_uBy.js";import{c as v}from"./utils-BGgJIaEU.js";import{A as k}from"./avatar-UcUmG598.js";import{I as z}from"./icon-HmCDqOPd.js";import{B as A}from"./button-BeTb9YZU.js";import{I as O}from"./input-NL8_dTk4.js";import{C as L}from"./create-organization-dialog-Bde9CI-n.js";import"./alert-dialog-BvyEfL2D.js";import"./form-BmmDx2Hv.js";import"./spinner-wv31KLi9.js";function D(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let o;e[0]!==s?(o=p=>{s&&s(p)},e[0]=s,e[1]=o):o=e[1];const m=o,d=s&&"cursor-pointer",a=x&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==d||e[4]!==a?(c=v("group transition-all flex flex-col gap-0",d,a,l),e[2]=l,e[3]=d,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=i.jsx(_,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function F(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:o}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,a=x===void 0?"contain":x;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==d||e[5]!==n?(c=i.jsx(k,{url:n,fallback:l,shape:m,size:d,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=d,e[5]=n,e[6]=c):c=e[6],c}function H(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(D,{Avatar:F,AvatarSection:G,Header:H,Title:R,Subtitle:I,Content:B,Footer:q,Badge:M,Skeleton:Q}),T={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},P={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},V={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},X={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},J={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},K={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function E(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const o=x,d=T[s===void 0?4:s],a=o.sm&&P[o.sm],c=o.md&&V[o.md],g=o.lg&&X[o.lg],p=o.xl&&J[o.xl],j=o["2xl"]&&K[o["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,a,c,g,p,j,r),e[2]=r,e[3]=d,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function U(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,d=s===void 0?4:s;let a;e[2]!==x?(a=Array.from({length:x}).map(W),e[2]=x,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==a?(c=i.jsx(E,{columns:m,gap:d,className:r,children:a}),e[4]=r,e[5]=m,e[6]=d,e[7]=a,e[8]=c):c=e[8],c}function W(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(E,{Skeleton:U});function Y(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=$();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(x.length===0){let a;return e[4]!==n?(a=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==x||e[8]!==s){let a;e[10]!==s?(a=c=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:c.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",c.slug]}),i.jsx(b.Title,{children:c.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=s,e[11]=a):a=e[11],m=x.map(a),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:o,children:m}),e[12]=m,e[13]=d):d=e[13],d}function Z(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(z,{name:"error",size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function ee(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),o=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(Z,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let a;t[6]!==l?(a=i.jsx(O,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=a):a=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs(A,{variant:"default",onClick:()=>x(!0),children:[i.jsx(z,{name:"add",size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=c):c=t[8];let g;t[9]!==a?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[a,c]})]}),t[9]=a,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==o?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Y,{query:o})})}),t[12]=o,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(L,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function xe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(ee,{})}),t[0]=e):e=t[0],e}export{xe as default};
|