omniroute 3.0.6 → 3.0.8
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/app/.next/BUILD_ID +1 -1
- package/app/.next/build-manifest.json +2 -2
- package/app/.next/prerender-manifest.json +3 -3
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/agents/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/agents/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/costs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/health/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/limits/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/logs/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/media/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/playground/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/playground/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/search-tools/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/search-tools/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/search-tools/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
- package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/400/page.js +2 -2
- package/app/.next/server/app/400/page.js.nft.json +1 -1
- package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/401/page.js +2 -2
- package/app/.next/server/app/401/page.js.nft.json +1 -1
- package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/403/page.js +2 -2
- package/app/.next/server/app/403/page.js.nft.json +1 -1
- package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/408/page.js +2 -2
- package/app/.next/server/app/408/page.js.nft.json +1 -1
- package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/429/page.js +2 -2
- package/app/.next/server/app/429/page.js.nft.json +1 -1
- package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/500/page.js +2 -2
- package/app/.next/server/app/500/page.js.nft.json +1 -1
- package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/502/page.js +2 -2
- package/app/.next/server/app/502/page.js.nft.json +1 -1
- package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/503/page.js +2 -2
- package/app/.next/server/app/503/page.js.nft.json +1 -1
- package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_global-error/page.js +1 -1
- package/app/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next/server/app/_global-error.html +2 -2
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js +2 -2
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js +1 -1
- package/app/.next/server/app/api/logs/console/route.js.nft.json +1 -1
- package/app/.next/server/app/api/openapi/spec/route.js +1 -1
- package/app/.next/server/app/api/openapi/spec/route.js.nft.json +1 -1
- package/app/.next/server/app/api/settings/proxy/test/route.js +7 -2
- package/app/.next/server/app/api/settings/proxy/test/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/load/route.js +1 -1
- package/app/.next/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next/server/app/api/translator/save/route.js +1 -1
- package/app/.next/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next/server/app/api/usage/[connectionId]/route.js +6 -5
- package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next/server/app/callback/page.js +2 -2
- package/app/.next/server/app/callback/page.js.nft.json +1 -1
- package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/docs/page.js +2 -2
- package/app/.next/server/app/docs/page.js.nft.json +1 -1
- package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forbidden/page.js +2 -2
- package/app/.next/server/app/forbidden/page.js.nft.json +1 -1
- package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/forgot-password/page.js +2 -2
- package/app/.next/server/app/forgot-password/page.js.nft.json +1 -1
- package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/landing/page.js +2 -2
- package/app/.next/server/app/landing/page.js.nft.json +1 -1
- package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/login/page.js +2 -2
- package/app/.next/server/app/login/page.js.nft.json +1 -1
- package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/maintenance/page.js +2 -2
- package/app/.next/server/app/maintenance/page.js.nft.json +1 -1
- package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/offline/page.js +2 -2
- package/app/.next/server/app/offline/page.js.nft.json +1 -1
- package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/page.js +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/privacy/page.js +2 -2
- package/app/.next/server/app/privacy/page.js.nft.json +1 -1
- package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/status/page.js +2 -2
- package/app/.next/server/app/status/page.js.nft.json +1 -1
- package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/terms/page.js +2 -2
- package/app/.next/server/app/terms/page.js.nft.json +1 -1
- package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__051203a6._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__0891af92._.js +1 -1
- package/app/.next/server/chunks/{[root-of-the-server]__fea5312b._.js → [root-of-the-server]__1a67cabb._.js} +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__1f2b0d89._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__228deb98._.js +6 -0
- package/app/.next/server/chunks/[root-of-the-server]__3aa1672b._.js +3 -0
- package/app/.next/server/chunks/{[root-of-the-server]__9d50d114._.js → [root-of-the-server]__3e31c0c5._.js} +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__46e00e59._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__4e5a04c2._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__6e52619e._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__70a3877b._.js +5 -5
- package/app/.next/server/chunks/[root-of-the-server]__7ace0fcd._.js +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__7d0781e8._.js +6 -0
- package/app/.next/server/chunks/[root-of-the-server]__7fa4d14e._.js +1 -1
- package/app/.next/server/chunks/{[root-of-the-server]__6ff1ab32._.js → [root-of-the-server]__ab1817d2._.js} +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__b013abab._.js +6 -6
- package/app/.next/server/chunks/{[root-of-the-server]__e376e668._.js → [root-of-the-server]__b2d1faff._.js} +2 -2
- package/app/.next/server/chunks/{[root-of-the-server]__192ce3e4._.js → [root-of-the-server]__b974107a._.js} +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__d49fae76._.js +3 -0
- package/app/.next/server/chunks/{[root-of-the-server]__1a89bfa5._.js → [root-of-the-server]__d6de923d._.js} +3 -3
- package/app/.next/server/chunks/_05c48915._.js +1 -1
- package/app/.next/server/chunks/_06515a8a._.js +1 -1
- package/app/.next/server/chunks/_2115d8de._.js +1 -1
- package/app/.next/server/chunks/_3ac953eb._.js +1 -1
- package/app/.next/server/chunks/_4b8fd853._.js +1 -1
- package/app/.next/server/chunks/_68683848._.js +1 -1
- package/app/.next/server/chunks/_85c0d9b3._.js +1 -1
- package/app/.next/server/chunks/_d13cbb6d._.js +3 -0
- package/app/.next/server/chunks/_ee9b677b._.js +1 -1
- package/app/.next/server/chunks/_efd5ede2._.js +1 -1
- package/app/.next/server/chunks/open-sse_config_providerModels_ts_04541468._.js +1 -1
- package/app/.next/server/chunks/open-sse_config_providerRegistry_ts_2f74ec2a._.js +1 -1
- package/app/.next/server/chunks/open-sse_config_providerRegistry_ts_dec0f840._.js +1 -1
- package/app/.next/server/chunks/open-sse_translator_index_ts_f5fd0821._.js +1 -1
- package/app/.next/server/chunks/ssr/{[root-of-the-server]__d5a9e5ee._.js → [root-of-the-server]__62183d3b._.js} +2 -2
- package/app/.next/server/chunks/ssr/{[root-of-the-server]__e4499d60._.js → [root-of-the-server]__7a1929fd._.js} +2 -2
- package/app/.next/server/chunks/ssr/{[root-of-the-server]__18da985c._.js → [root-of-the-server]__9c6249ab._.js} +2 -2
- package/app/.next/server/chunks/ssr/[root-of-the-server]__9ef96d20._.js +1 -1
- package/app/.next/server/chunks/ssr/[root-of-the-server]__a6942102._.js +1 -1
- package/app/.next/server/chunks/ssr/_19b3d5b1._.js +1 -1
- package/app/.next/server/chunks/ssr/open-sse_config_providerModels_ts_4cac55e2._.js +1 -1
- package/app/.next/server/chunks/ssr/src_608e5edc._.js +1 -1
- package/app/.next/server/chunks/ssr/src_app_(dashboard)_dashboard_936a9ee0._.js +1 -1
- package/app/.next/server/chunks/ssr/src_app_(dashboard)_dashboard_playground_page_tsx_06c08266._.js +2 -2
- package/app/.next/server/chunks/ssr/src_app_(dashboard)_dashboard_settings_9e20fb8d._.js +1 -1
- package/app/.next/server/middleware.js +1 -1
- package/app/.next/server/pages/500.html +2 -2
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/{c4538578367f8d6e.js → 29003ec8ef226c62.js} +2 -2
- package/app/.next/static/chunks/{98a065e472ead1c5.js → 58d319dd9faa8901.js} +1 -1
- package/app/.next/static/chunks/6350bc1d56a7114c.js +2 -0
- package/app/.next/static/chunks/{339b27cecfee41d1.js → 6d9bfb06374cbab3.js} +1 -1
- package/app/.next/static/chunks/9330486b16098458.js +1 -0
- package/app/.next/static/chunks/a622fa7a630e2dc2.js +1 -0
- package/app/CHANGELOG.md +35 -0
- package/app/docs/openapi.yaml +1 -1
- package/app/open-sse/config/providerRegistry.ts +7 -1
- package/app/open-sse/handlers/responseSanitizer.ts +58 -0
- package/app/open-sse/services/signatureCache.ts +5 -0
- package/app/open-sse/translator/response/openai-to-claude.ts +12 -1
- package/app/open-sse/utils/usageTracking.ts +44 -5
- package/app/package-lock.json +20 -20
- package/app/package.json +1 -1
- package/app/src/app/(dashboard)/dashboard/cli-tools/CLIToolsPageClient.tsx +40 -0
- package/app/src/app/(dashboard)/dashboard/playground/page.tsx +39 -40
- package/app/src/app/(dashboard)/dashboard/settings/components/ProxyRegistryManager.tsx +1 -2
- package/app/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.tsx +1 -1
- package/app/src/app/api/settings/proxy/test/route.ts +21 -1
- package/app/src/app/api/usage/[connectionId]/route.ts +83 -35
- package/app/src/lib/db/combos.ts +5 -5
- package/app/src/lib/db/models.ts +9 -9
- package/package.json +1 -1
- package/app/.next/server/chunks/[root-of-the-server]__5dcab57b._.js +0 -6
- package/app/.next/server/chunks/[root-of-the-server]__643f87ad._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__765c4417._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__7afe1e49._.js +0 -3
- package/app/.next/static/chunks/0e39e279bf7e4cd9.js +0 -2
- package/app/.next/static/chunks/3f18998354dd49b9.js +0 -1
- package/app/.next/static/chunks/f62c550263d8bca8.js +0 -1
- /package/app/.next/static/{4vzx2qUM_tiJPdpx_Hiqj → VtLeHcThjUtEgx1Z2skPg}/_buildManifest.js +0 -0
- /package/app/.next/static/{4vzx2qUM_tiJPdpx_Hiqj → VtLeHcThjUtEgx1Z2skPg}/_clientMiddlewareManifest.json +0 -0
- /package/app/.next/static/{4vzx2qUM_tiJPdpx_Hiqj → VtLeHcThjUtEgx1Z2skPg}/_ssgManifest.js +0 -0
|
@@ -6,6 +6,6 @@ model_provider = "omniroute"
|
|
|
6
6
|
name = "OmniRoute"
|
|
7
7
|
base_url = "${an()}"
|
|
8
8
|
wire_api = "responses"
|
|
9
|
-
`,w=JSON.stringify({OPENAI_API_KEY:u},null,2),[{filename:"~/.codex/config.toml",content:v},{filename:"~/.codex/auth.json",content:w}])})]})}[f,i]=n.then?(await n)():n,a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),8919,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:q,cloudEnabled:r,batchStatus:s,lastConfiguredAt:t}){let u,v,w,x,y=(0,m.useTranslations)("cliTools"),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)({}),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(""),V=(0,e.useRef)(!1),[W,X]=(0,e.useState)([]),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(null),aa=!!(z?.installed&&z?.runnable),ab=(()=>{if(!aa)return null;let a=z.settings?.customModels?.find(a=>"custom:OmniRoute-0"===a.id);if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=r&&p&&a.baseUrl?.startsWith(p);return b||c?"configured":"other"})()||s?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!J&&K(o[0].key)},[o,J]),(0,e.useEffect)(()=>{b&&!z&&(ad(),ac(),ah())},[b,z]);let ac=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&Q(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(z?.installed&&!V.current){V.current=!0;let a=z.settings?.customModels?.find(a=>"custom:OmniRoute-0"===a.id);a&&(a.model&&M(a.model),a.apiKey&&o?.some(b=>b.key===a.apiKey)&&K(a.apiKey))}},[z,o]);let ad=async()=>{C(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();A(b)}catch(a){A({installed:!1,error:a.message})}finally{C(!1)}},ae=()=>{let a=T||f;return a.endsWith("/v1")?a:`${a}/v1`},af=async()=>{E(!0),I(null);try{let a=J?.trim()||(o?.length>0?o[0].key:null)||(r?null:"sk_omniroute"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ae(),apiKey:a,model:L})}),c=await b.json();b.ok?(I({type:"success",text:y("settingsApplied")}),ad()):I({type:"error",text:c.error||y("failedApplySettings")})}catch(a){I({type:"error",text:a.message})}finally{E(!1)}},ag=async()=>{G(!0),I(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(I({type:"success",text:y("settingsReset")}),M(""),K(""),ad()):I({type:"error",text:b.error||y("failedResetSettings")})}catch(a){I({type:"error",text:a.message})}finally{G(!1)}},ah=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=droid"),b=await a.json();a.ok&&X(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},ai=async a=>{_(a),I(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:a})}),c=await b.json();b.ok?(I({type:"success",text:y("backupRestored")}),ad(),ah()):I({type:"error",text:c.error||y("failedRestore")})}catch(a){I({type:"error",text:a.message})}finally{_(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/droid.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:ab,batchStatus:s,lastConfiguredAt:t})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:y("toolDescriptions.droid")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:y("checkingCli",{tool:"Factory Droid"})})]}),!B&&z&&!aa&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:z.installed?y("cliNotRunnable",{tool:"Factory Droid"}):y("cliNotInstalled",{tool:"Factory Droid"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:z.installed?y("cliFoundFailedHealthcheck",{tool:"Factory Droid",reason:z.reason?` (${z.reason})`:""}):y("installCliPrompt",{tool:"Factory Droid"})})]})]}),!B&&aa&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[z?.settings?.customModels?.find(a=>"custom:OmniRoute-0"===a.id)?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:z.settings.customModels.find(a=>"custom:OmniRoute-0"===a.id).baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(u=T||f).endsWith("/v1")?u:`${u}/v1`,onChange:a=>U(a.target.value),placeholder:y("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),T&&T!==f&&(0,d.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:y("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,d.jsx)("select",{value:J,onChange:a=>K(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:r?y("noApiKeysCreateOne"):y("defaultOmnirouteKey")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("model")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:y("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>O(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:y("selectModel")}),L&&(0,d.jsx)("button",{onClick:()=>M(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:y("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),H&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===H.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===H.type?"check_circle":"error"}),(0,d.jsx)("span",{children:H.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:af,disabled:!L,loading:D,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:ag,disabled:!z?.hasOmniRoute,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),y("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>S(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),y("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{Z(!Y),Y||ah()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),y("backups"),W.length>0&&` (${W.length})`]})]}),Y&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),y("configBackups")]}),0===W.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:W.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>ai(a.id),disabled:$===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:$===a.id?"...":y("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:N,onClose:()=>O(!1),onSelect:a=>{M(a.value),O(!1)},selectedModel:L,activeProviders:q,modelAliases:P,title:y("selectModelForTool",{tool:"Factory Droid"})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:R,onClose:()=>S(!1),title:y("droidManualConfiguration"),configs:(v=J&&J.trim()?J:r?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",w={customModels:[{model:L||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:ae(),apiKey:v,displayName:L||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},x="u">typeof navigator&&navigator.platform,[{filename:x?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(w,null,2)}])})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),957648,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:q,cloudEnabled:r,batchStatus:s,lastConfiguredAt:t}){let u,v,w,x=(0,m.useTranslations)("cliTools"),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)({}),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),U=(0,e.useRef)(!1),[V,W]=(0,e.useState)([]),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(null),_=!!(y?.installed&&y?.runnable),aa=(()=>{if(!_)return null;let a=y.settings?.models?.providers?.omniroute;if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=r&&p&&a.baseUrl?.startsWith(p);return b||c?"configured":"other"})()||s?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!I&&J(o[0].key)},[o,I]),(0,e.useEffect)(()=>{b&&!y&&(ac(),ab(),ag())},[b,y]);let ab=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&P(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(y?.installed&&!U.current){U.current=!0;let a=y.settings?.models?.providers?.omniroute;if(a){let b=y.settings?.agents?.defaults?.model?.primary;if(b){let a=b.replace("omniroute/","");L(a)}a.apiKey&&o?.some(b=>b.key===a.apiKey)&&J(a.apiKey)}}},[y,o]);let ac=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ad=()=>{let a=S||f;return a.endsWith("/v1")?a:`${a}/v1`},ae=async()=>{D(!0),H(null);try{let a=I?.trim()||(o?.length>0?o[0].key:null)||(r?null:"sk_omniroute"),b=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ad(),apiKey:a,model:K})}),c=await b.json();b.ok?(H({type:"success",text:x("settingsApplied")}),ac()):H({type:"error",text:c.error||x("failedApplySettings")})}catch(a){H({type:"error",text:a.message})}finally{D(!1)}},af=async()=>{F(!0),H(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(H({type:"success",text:x("settingsReset")}),L(""),J(""),ac()):H({type:"error",text:b.error||x("failedResetSettings")})}catch(a){H({type:"error",text:a.message})}finally{F(!1)}},ag=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=openclaw"),b=await a.json();a.ok&&W(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},ah=async a=>{$(a),H(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:a})}),c=await b.json();b.ok?(H({type:"success",text:x("backupRestored")}),ac(),ag()):H({type:"error",text:c.error||x("failedRestore")})}catch(a){H({type:"error",text:a.message})}finally{$(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/openclaw.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:aa,batchStatus:s,lastConfiguredAt:t})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:x("toolDescriptions.openclaw")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:x("checkingCli",{tool:"Open Claw"})})]}),!A&&y&&!_&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?x("cliNotRunnable",{tool:"Open Claw"}):x("cliNotInstalled",{tool:"Open Claw"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?x("cliFoundFailedHealthcheck",{tool:"Open Claw",reason:y.reason?` (${y.reason})`:""}):x("installCliPrompt",{tool:"Open Claw"})})]})]}),!A&&_&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.models?.providers?.omniroute?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings.models.providers.omniroute.baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(u=S||f).endsWith("/v1")?u:`${u}/v1`,onChange:a=>T(a.target.value),placeholder:x("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),S&&S!==f&&(0,d.jsx)("button",{onClick:()=>T(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:x("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,d.jsx)("select",{value:I,onChange:a=>J(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:r?x("noApiKeysCreateOne"):x("defaultOmnirouteKey")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("model")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:K,onChange:a=>L(a.target.value),placeholder:x("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>N(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:x("selectModel")}),K&&(0,d.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:x("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ae,disabled:!K,loading:C,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),x("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:af,disabled:!y?.hasOmniRoute,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),x("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>R(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),x("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{Y(!X),X||ag()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),x("backups"),V.length>0&&` (${V.length})`]})]}),X&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),x("configBackups")]}),0===V.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:x("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:V.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>ah(a.id),disabled:Z===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:Z===a.id?"...":x("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{L(a.value),N(!1)},selectedModel:K,activeProviders:q,modelAliases:O,title:x("selectModelForTool",{tool:"Open Claw"})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:Q,onClose:()=>R(!1),title:x("openClawManualConfiguration"),configs:(v=I&&I.trim()?I:r?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",w={agents:{defaults:{model:{primary:`omniroute/${K||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:ad(),apiKey:v,api:"openai-completions",models:[{id:K||"provider/model-id",name:(K||"provider/model-id").split("/").pop()}]}}}},[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify(w,null,2)}])})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),778730,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:q,cloudEnabled:r,batchStatus:s,lastConfiguredAt:t}){let u=(0,m.useTranslations)("cliTools"),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)({}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(""),R=(0,e.useRef)(!1),[S,T]=(0,e.useState)([]),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(null),Y=!!(v?.installed&&v?.runnable),Z=(()=>{if(!Y)return null;if(!v.hasOmniRoute)return"not_configured";let a=v.settings?.openAiBaseUrl||"",b=a.includes("localhost")||a.includes("127.0.0.1"),c=r&&p&&a.startsWith(p);return b||c?"configured":"other"})(),$=Z||s?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!F&&G(o[0].key)},[o,F]),(0,e.useEffect)(()=>{b&&!v&&(ac(),_(),aa())},[b,v]),(0,e.useEffect)(()=>{if(v?.settings&&!R.current){let a=v.settings.openAiModelId;a&&(I(a),R.current=!0)}},[v]);let _=async()=>{try{let a=await fetch("/api/models/alias");if(a.ok){let b=await a.json();M(b.aliases||{})}}catch{}},aa=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=cline");if(a.ok){let b=await a.json();T(b.backups||[])}}catch{}},ab=async a=>{X(a);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"cline",backupId:a})});if(b.ok)E({type:"success",text:u("backupRestoredReloading")}),await ac(),await aa();else{let a=await b.json();E({type:"error",text:a.error||u("failedRestoreBackup")})}}catch(a){E({type:"error",text:a.message})}finally{X(null)}},ac=async()=>{y(!0);try{let a=await fetch("/api/cli-tools/cline-settings"),b=await a.json();w(b)}catch(a){w({error:a.message})}finally{y(!1)}},ad=async()=>{A(!0),E(null);try{let a=P||f||"http://localhost:20128",b=a.endsWith("/v1")?a:`${a}/v1`,c=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:b,apiKey:F||"sk_omniroute",model:H})}),d=await c.json();c.ok?(E({type:"success",text:d.message||u("applied")}),await ac(),await aa()):E({type:"error",text:d.error||u("failed")})}catch(a){E({type:"error",text:a.message})}finally{A(!1)}},ae=async()=>{C(!0),E(null);try{let a=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),b=await a.json();a.ok?(E({type:"success",text:b.message||u("resetDone")}),I(""),R.current=!1,await ac(),await aa()):E({type:"error",text:b.error||u("failed")})}catch(a){E({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:a.image?(0,d.jsx)(k.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}}):(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:a.color},children:"terminal"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:$,batchStatus:s,lastConfiguredAt:t})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:u("toolDescriptions.cline")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:u("checkingCli",{tool:"Cline"})})]}),v&&!x&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${Y?"text-green-500":"text-yellow-500"}`,children:Y?"check_circle":"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:Y?u("cliDetectedReady",{tool:"Cline"}):v.installed?u("cliNotRunnable",{tool:"Cline"}):u("cliNotDetected",{tool:"Cline"})}),v.commandPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("binary"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:v.commandPath})]}),v.globalStatePath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("configPathShort"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:v.globalStatePath})]})]})]}),Y&&(0,d.jsxs)(d.Fragment,{children:["configured"===Z&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:u("omnirouteConfiguredOpenAiCompatible")}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("provider"),": ",(0,d.jsx)("strong",{children:"openai"})," • ",u("model"),":"," ",(0,d.jsx)("strong",{children:v.settings?.openAiModelId||"—"})]})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:u("model")}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:H,onChange:a=>I(a.target.value),placeholder:u("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>K(!0),disabled:!n,children:u("select")}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>O(!0),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:u("apiKey")}),o&&o.length>0?(0,d.jsx)("select",{value:F,onChange:a=>G(a.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("p",{className:"text-sm text-text-muted",children:r?u("noApiKeysAvailable"):u("usingDefaultOmniroute")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ad,disabled:!H,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===Z?u("updateConfig"):u("applyConfig")]}),"configured"===Z&&(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:ae,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),u("reset")]})]}),D&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===D.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===D.type?"check_circle":"error"}),(0,d.jsx)("span",{children:D.text})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,d.jsxs)("button",{onClick:()=>V(!U),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${U?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),u("backups")," ",S.length>0&&`(${S.length})`]}),U&&S.length>0&&(0,d.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:S.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsx)("span",{className:"font-medium",children:a.originalFile}),(0,d.jsx)("span",{className:"text-text-muted",children:new Date(a.createdAt).toLocaleString()})]}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>ab(a.id),loading:W===a.id,children:u("restore")})]},a.id))}),U&&0===S.length&&(0,d.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:u("noBackupsAvailable")})]})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:J,onClose:()=>K(!1),onSelect:a=>{I(a.value),K(!1)},selectedModel:H,activeProviders:q,title:u("selectModelForTool",{tool:"Cline"})}),N&&(0,d.jsx)(j.ManualConfigModal,{isOpen:N,onClose:()=>O(!1),title:u("clineManualConfiguration"),...{onApply:a=>{a.model&&I(a.model),a.apiKey&&G(a.apiKey),a.baseUrl&&Q(a.baseUrl),O(!1)},currentConfig:{model:H,apiKey:F,baseUrl:P||f}}})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),298210,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:p,cloudEnabled:q,batchStatus:r,lastConfiguredAt:s}){let t=(0,m.useTranslations)("cliTools"),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(""),Q=(0,e.useRef)(!1),[R,S]=(0,e.useState)([]),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(null),X=!!(u?.installed&&u?.runnable),Y=X?u.hasOmniRoute?"configured":"not_configured":null,Z=Y||r?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!E&&F(o[0].key)},[o,E]),(0,e.useEffect)(()=>{b&&!u&&(ab(),$(),_())},[b,u]);let $=async()=>{try{let a=await fetch("/api/models/alias");if(a.ok){let b=await a.json();L(b.aliases||{})}}catch{}},_=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=kilo");if(a.ok){let b=await a.json();S(b.backups||[])}}catch{}},aa=async a=>{W(a);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"kilo",backupId:a})});if(b.ok)D({type:"success",text:t("backupRestoredReloading")}),await ab(),await _();else{let a=await b.json();D({type:"error",text:a.error||t("failedRestoreBackup")})}}catch(a){D({type:"error",text:a.message})}finally{W(null)}},ab=async()=>{x(!0);try{let a=await fetch("/api/cli-tools/kilo-settings"),b=await a.json();v(b)}catch(a){v({error:a.message})}finally{x(!1)}},ac=async()=>{z(!0),D(null);try{let a=O||f||"http://localhost:20128",b=a.endsWith("/v1")?a:`${a}/v1`,c=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:b,apiKey:E||"sk_omniroute",model:G})}),d=await c.json();c.ok?(D({type:"success",text:d.message||t("applied")}),await ab(),await _()):D({type:"error",text:d.error||t("failed")})}catch(a){D({type:"error",text:a.message})}finally{z(!1)}},ad=async()=>{B(!0),D(null);try{let a=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),b=await a.json();a.ok?(D({type:"success",text:b.message||t("resetDone")}),H(""),Q.current=!1,await ab(),await _()):D({type:"error",text:b.error||t("failed")})}catch(a){D({type:"error",text:a.message})}finally{B(!1)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:a.image?(0,d.jsx)(k.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}}):(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:a.color},children:"terminal"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:Z,batchStatus:r,lastConfiguredAt:s})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:t("toolDescriptions.kilo")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[w&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:t("checkingCli",{tool:"Kilo Code"})})]}),u&&!w&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${X?"text-green-500":"text-yellow-500"}`,children:X?"check_circle":"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:X?t("cliDetectedReady",{tool:"Kilo Code"}):u.installed?t("cliNotRunnable",{tool:"Kilo Code"}):t("cliNotDetected",{tool:"Kilo Code"})}),u.commandPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[t("binary"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.commandPath})]}),u.authPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[t("auth"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.authPath})]})]})]}),X&&(0,d.jsxs)(d.Fragment,{children:["configured"===Y&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:t("omnirouteConfiguredOpenAiCompatible")}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[t("providers"),":"," ",(0,d.jsx)("strong",{children:u.settings?.auth?.join(", ")||"—"})]})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:t("model")}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:G,onChange:a=>H(a.target.value),placeholder:t("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:!n,children:t("select")}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>N(!0),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:t("apiKey")}),o&&o.length>0?(0,d.jsx)("select",{value:E,onChange:a=>F(a.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("p",{className:"text-sm text-text-muted",children:q?t("noApiKeysAvailable"):t("usingDefaultOmniroute")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ac,disabled:!G,loading:y,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===Y?t("updateConfig"):t("applyConfig")]}),"configured"===Y&&(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:ad,loading:A,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),t("reset")]})]}),C&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===C.type?"check_circle":"error"}),(0,d.jsx)("span",{children:C.text})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,d.jsxs)("button",{onClick:()=>U(!T),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${T?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),t("backups")," ",R.length>0&&`(${R.length})`]}),T&&R.length>0&&(0,d.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:R.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsx)("span",{className:"font-medium",children:a.originalFile}),(0,d.jsx)("span",{className:"text-text-muted",children:new Date(a.createdAt).toLocaleString()})]}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>aa(a.id),loading:V===a.id,children:t("restore")})]},a.id))}),T&&0===R.length&&(0,d.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:t("noBackupsAvailable")})]})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:I,onClose:()=>J(!1),onSelect:a=>{H(a.value),J(!1)},selectedModel:G,activeProviders:p,title:t("selectModelForTool",{tool:"Kilo Code"})}),M&&(0,d.jsx)(j.ManualConfigModal,{isOpen:M,onClose:()=>N(!1),title:t("kiloManualConfiguration"),...{onApply:a=>{a.model&&H(a.model),a.apiKey&&F(a.apiKey),a.baseUrl&&P(a.baseUrl),N(!1)},currentConfig:{model:G,apiKey:E,baseUrl:O||f}}})]})}[f,i]=n.then?(await n)():n,process.env.NEXT_PUBLIC_CLOUD_URL,a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),798480,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(571987),k=a.i(415925),l=a.i(95455),m=b([f,i]);function n({toolId:a,tool:b,isExpanded:c,onToggle:f,baseUrl:m,apiKeys:n,activeProviders:o=[],cloudEnabled:p=!1,batchStatus:q}){let r,s,t,u=(0,k.useTranslations)("cliTools"),v=(0,e.useCallback)((a,b,c)=>{try{return u(a,c)}catch{return b}},[u]),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(!1),I=(0,e.useRef)(!1),[J,K]=(0,e.useState)(()=>n?.length>0?n[0].key:"");(0,e.useEffect)(()=>{let b=localStorage.getItem(`omniroute-cli-model-${a}`);b&&B(b);let c=localStorage.getItem(`omniroute-cli-key-${a}`);c&&n?.some(a=>a.key===c)&&K(c)},[a,n]);let L=(0,e.useCallback)(b=>{B(b),b?localStorage.setItem(`omniroute-cli-model-${a}`,b):localStorage.removeItem(`omniroute-cli-model-${a}`)},[a]),M=(0,e.useCallback)(b=>{K(b),b&&localStorage.setItem(`omniroute-cli-key-${a}`,b)},[a]);(0,e.useEffect)(()=>{!c||C||I.current||(I.current=!0,fetch(`/api/cli-tools/runtime/${a}`).then(a=>a.json()).then(a=>D(a)).catch(a=>D({error:a?.message||u("runtimeCheckFailed")})))},[c,C,a]);let N=a=>{let b=J&&J.trim()?J:p?u("yourApiKeyPlaceholder"):"sk_omniroute",c=m||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,A||u("modelPlaceholder"))},O=async(a,b)=>{await (0,l.copyToClipboard)(N(a)),x(b),setTimeout(()=>x(null),2e3)},P=o.length>0,Q=c&&null===C,R=async()=>{H(!0),F(null);try{let b=J&&J.trim()?J:p?"":"sk_omniroute",c=m||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`,e=await fetch(`/api/cli-tools/guide-settings/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d,apiKey:b,model:A})}),f=await e.json();e.ok?F({type:"success",text:f.message||u("configurationSaved")}):F({type:"error",text:f.error||u("failedToSave")})}catch(a){F({type:"error",text:a.message})}finally{H(!1)}},S=["continue","opencode"].includes(a),T=()=>!b.requiresCloud||!!p;return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:f,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(j.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(j.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(r=C?.reason==="not_required"||"guide"===b.configType,s=C?C.installed&&C.runnable:q?.installed&&q?.runnable,t=C?C.installed:q?.installed,r?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),u("guide")]}):s?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-green-500/10 text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-green-500"}),u("detected")]}):!1===t&&(C||q)?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500"}),u("notInstalled")]}):t&&!s&&(C||q)?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-yellow-500"}),u("notReady")]}):null)]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:v(`toolDescriptions.${a}`,b.description)})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[Q&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:u("checkingRuntime")})]}),!Q&&C&&!C.error&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===C.reason?"info":C.installed&&C.runnable?"check_circle":"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===C.reason?u("guideOnlyIntegration"):C.installed&&C.runnable?u("cliRuntimeDetected"):C.installed?u("cliFoundNotRunnable",{reason:C.reason?`: ${C.reason}`:""}):u("cliRuntimeNotDetected")}),C.commandPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("binary"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.commandPath})]}),C.configPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("configPath"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.configPath})]})]})]}),!Q&&C?.error&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:u("failedCheckRuntimeStatus")})]}),b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((b,c)=>{if("cloudCheck"===b.type&&p)return null;let e="warning"===b.type,f="cloudCheck"===b.type&&!p,g="bg-blue-500/10 border-blue-500/30",h="text-blue-600 dark:text-blue-400",i="text-blue-500",j="info";return e?(g="bg-yellow-500/10 border-yellow-500/30",h="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",j="warning"):f&&(g="bg-red-500/10 border-red-500/30",h="text-red-600 dark:text-red-400",i="text-red-500",j="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${g}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${i}`,children:j}),(0,d.jsx)("p",{className:`text-sm ${h}`,children:v(`guides.${a}.notes.${c}`,b.text)})]},c)})}):null,T()&&b.guideSteps.map(c=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:c.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:v(`guides.${a}.steps.${c.step}.title`,c.title)}),c.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:v(`guides.${a}.steps.${c.step}.desc`,c.desc)}),"apiKeySelector"===c.type&&(0,d.jsx)("div",{className:"mt-2 flex items-center gap-2",children:n&&n.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("select",{value:J,onChange:a=>M(a.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}),(0,d.jsx)("button",{onClick:()=>O(J,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===w?"check":"content_copy"})})]}):(0,d.jsx)("span",{className:"text-sm text-text-muted",children:p?u("noApiKeysCreateOne"):"sk_omniroute"})}),"modelSelector"===c.type&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:A,onChange:a=>L(a.target.value),placeholder:u("modelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>z(!0),disabled:!P,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${P?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:u("selectModel")}),A&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>O(A,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===w?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>L(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:u("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),c.value&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:N(c.value)}),c.copyable&&(0,d.jsx)("button",{onClick:()=>O(c.value,`${c.step}-${c.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:w===`${c.step}-${c.title}`?"check":"content_copy"})})]})]})]},c.step)),T()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>O(b.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===w?"check":"content_copy"}),"codeblock"===w?u("copied"):u("copy")]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:N(b.codeBlock.code)})})]}),T()&&(0,d.jsxs)("div",{className:"mt-2",children:[E&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,d.jsx)("span",{children:E.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[S&&(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:R,disabled:!A,loading:G,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),u("saveConfig")]}),b.codeBlock&&(0,d.jsxs)(h.Button,{variant:S?"outline":"primary",size:"sm",onClick:()=>O(b.codeBlock.code,"codeblock"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===w?"check":"content_copy"}),"codeblock"===w?u("copied"):u("copyConfig")]}),A&&(0,d.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),u("selectionSaved")]})]})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:u("comingSoon")})}),(0,d.jsx)(i.ModelSelectModal,{isOpen:y,onClose:()=>z(!1),onSelect:a=>{L(a.value)},selectedModel:A,activeProviders:o,title:u("selectModel")})]})}[f,i]=m.then?(await m)():m,a.s(["default",()=>n]),c()}catch(a){c(a)}},!1),623403,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(818465),j=a.i(563203),k=a.i(489108),l=a.i(959852),m=a.i(571987),n=a.i(415925),o=b([f,l]);function p({tool:a,isExpanded:b,onToggle:c,baseUrl:f,apiKeys:o,activeProviders:p,hasActiveProviders:q,cloudEnabled:r}){let s,t,u,v=(0,n.useTranslations)("cliTools"),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(null);(0,e.useEffect)(()=>{o?.length>0&&!E&&F(o[0].key)},[o,E]),(0,e.useEffect)(()=>{b&&!w&&(P(),O())},[b,w]);let O=async()=>{try{let b=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${a.id}`);if(b.ok){let a=(await b.json()).aliases||{};Object.keys(a).length>0&&J(a)}}catch(a){console.log("Error loading saved mappings:",a)}},P=async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();x(b)}}catch(a){console.log("Error fetching status:",a),x({running:!1})}},Q="u">typeof navigator&&navigator.userAgent?.includes("Windows"),R=async a=>{z(!0),H(null);try{let b=E?.trim()||(o?.length>0?o[0].key:null)||(r?null:"sk_omniroute"),c=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:b,sudoPassword:a})}),d=await c.json();c.ok?(H({type:"success",text:v("mitmStarted")}),B(!1),D(""),P()):H({type:"error",text:d.error||v("failedStart")})}catch(a){H({type:"error",text:a.message})}finally{z(!1)}},S=async a=>{z(!0),H(null);try{let b=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:a})}),c=await b.json();b.ok?(H({type:"success",text:v("mitmStopped")}),B(!1),D(""),P()):H({type:"error",text:c.error||v("failedStop")})}catch(a){H({type:"error",text:a.message})}finally{z(!1)}},T=()=>{C.trim()?w?.running?S(C):R(C):H({type:"error",text:v("sudoPasswordRequiredError")})},U=(a,b)=>{J(c=>({...c,[a]:b}))},V=async()=>{z(!0),H(null);try{let b=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:I})});if(!b.ok){let a=await b.json();throw Error(a.error||v("failedSaveMappings"))}H({type:"success",text:v("mappingsSaved")})}catch(a){H({type:"error",text:a.message})}finally{z(!1)}},W=w?.running;return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(m.default,{src:a.image||"/providers/antigravity.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),W?(0,d.jsx)(i.Badge,{variant:"success",size:"sm",children:v("active")}):(0,d.jsx)(i.Badge,{variant:"default",size:"sm",children:v("inactive")})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"flex items-center gap-2",children:W?(0,d.jsxs)("button",{onClick:()=>{Q||w?.hasCachedPassword?S(""):(B(!0),H(null))},disabled:y,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),v("stopMitm")]}):(0,d.jsxs)("button",{onClick:()=>{Q||w?.hasCachedPassword?R(""):(B(!0),H(null))},disabled:y||!q,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),v("startMitm")]})}),G?.type==="error"&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:G.text})]}),W&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,d.jsx)("select",{value:E,onChange:a=>F(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:r?v("noApiKeysCreateOne"):v("defaultOmnirouteKey")})]}),(a.defaultModels||[]).map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:I[a.alias]||"",onChange:b=>U(a.alias,b.target.value),placeholder:v("modelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.alias,void(N(b),L(!0))},disabled:!q,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${q?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:v("select")}),I[a.alias]&&(0,d.jsx)("button",{onClick:()=>U(a.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:v("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},a.alias)),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:V,disabled:y||0===Object.keys(I).length,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),v("saveMappings")]})})]}),!W&&(s={antigravity:"daily-cloudcode-pa.googleapis.com",kiro:"api.anthropic.com"},t=a.name||a.id,u=s[a.id]||s.antigravity,(0,d.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:v("howItWorks")})," ",v("mitmHowWorksDesc",{toolName:t})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,d.jsx)("span",{children:v("mitmStep1")}),(0,d.jsxs)("span",{children:[v("mitmStep2Prefix")," ",(0,d.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:u})," ",v("mitmStep2Suffix")]}),(0,d.jsx)("span",{children:v("mitmStep3",{toolName:t})})]})]}))]}),(0,d.jsx)(j.Modal,{isOpen:A,onClose:()=>{B(!1),D(""),H(null)},title:v("sudoPasswordRequiredTitle"),size:"sm",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:v("sudoPasswordHint")})]}),(0,d.jsx)(k.Input,{type:"password",placeholder:v("enterSudoPassword"),value:C,onChange:a=>D(a.target.value),onKeyDown:a=>{"Enter"!==a.key||y||T()}}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{B(!1),D(""),H(null)},disabled:y,children:v("cancel")}),(0,d.jsx)(h.Button,{variant:"primary",size:"sm",onClick:T,loading:y,children:v("confirm")})]})]})}),(0,d.jsx)(l.ModelSelectModal,{isOpen:K,onClose:()=>L(!1),onSelect:a=>{M&&J(b=>({...b,[M]:a.value}))},selectedModel:M?I[M]:null,activeProviders:p,title:v("selectModelForAlias",{alias:M||""})})]})}[f,l]=o.then?(await o)():o,a.s(["default",()=>p]),c()}catch(a){c(a)}},!1),291658,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(571987),j=a.i(415925),k=b([f]);function l({tool:a,isExpanded:b,onToggle:c,baseUrl:f,apiKeys:k,activeProviders:l=[],hasActiveProviders:m=!1,cloudEnabled:n=!1,batchStatus:o}){let p=(0,j.useTranslations)("cliTools"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(()=>new Set),[u,v]=(0,e.useState)(()=>k?.length>0?k[0].key:""),[w,x]=(0,e.useState)(128e3),[y,z]=(0,e.useState)(16e3),[A,B]=(0,e.useState)(!0),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)("");(0,e.useEffect)(()=>{if(!b||G)return;let a=!1;return fetch("/v1/models").then(a=>a.json()).then(b=>{if(a)return;let c=(b.data||[]).filter(a=>a&&!a.type&&!a.parent&&a.id).map(a=>({value:a.id,label:a.id}));F(c),H(!0)}).catch(()=>{a||H(!0)}),()=>{a=!0}},[b,G]);let K=I?E.filter(a=>a.label.toLowerCase().includes(I.toLowerCase())):E;(0,e.useEffect)(()=>{s.size>0&&localStorage.setItem("omniroute-copilot-selected-models",JSON.stringify([...s]))},[s]);let L=()=>{let a=[...s].map(a=>({id:a,name:a,url:`${f}/v1/chat/completions#models.ai.azure.com`,toolCalling:A,vision:C,maxInputTokens:w,maxOutputTokens:y}));return JSON.stringify({name:"OmniRoute",vendor:"azure",apiKey:"${input:chat.lm.secret.omniroute}",models:a},null,2)},M=async(a,b)=>{await navigator.clipboard.writeText(a),r(b),setTimeout(()=>r(null),2e3)};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:(0,d.jsx)(i.default,{src:a.image||"/providers/copilot.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),p("guide")]})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,d.jsxs)("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[(0,d.jsx)("p",{className:"font-medium",children:"GitHub Copilot Config Generator"}),(0,d.jsxs)("p",{className:"mt-1 text-xs opacity-80",children:["Generates the"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"chatLanguageModels.json"})," ","block for VS Code GitHub Copilot using the Azure vendor pattern. Select the models you want, then copy the JSON into your config file."]})]})]}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,d.jsxs)("p",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:["This configuration uses the Azure vendor workaround for custom model lists. Tested with ",(0,d.jsx)("strong",{children:"VS Code ≥ 1.109"})," and"," ",(0,d.jsx)("strong",{children:"GitHub Copilot Chat ≥ v0.37"}),". Future extension updates may change this behavior."]})]}),n&&k?.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:a.color},children:"1"}),(0,d.jsx)("span",{className:"font-medium text-sm",children:"API Key"})]}),(0,d.jsx)("select",{value:u,onChange:a=>{var b;return b=a.target.value,void(v(b),b&&localStorage.setItem("omniroute-cli-key-copilot",b))},className:"w-full px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:k.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:a.color},children:n&&k?.length>0?"2":"1"}),(0,d.jsxs)("span",{className:"font-medium text-sm",children:["Select Models (",s.size,"/",K.length,")"]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{t(new Set(E.map(a=>a.value)))},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Select All"}),(0,d.jsx)("button",{onClick:()=>{t(new Set)},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Clear"})]})]}),(0,d.jsx)("div",{className:"mb-2",children:(0,d.jsx)("input",{type:"text",value:I,onChange:a=>J(a.target.value),placeholder:"Filter models...",className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})}),G||0!==E.length?0===K.length&&0===E.length?(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,d.jsx)("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:p("noActiveProviders")})]}):(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-border bg-bg-secondary",children:K.map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-bg-tertiary cursor-pointer border-b border-border last:border-0 transition-colors",children:[(0,d.jsx)("input",{type:"checkbox",checked:s.has(a.value),onChange:()=>{var b;return b=a.value,void t(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"rounded border-border text-primary accent-[#1F6FEB]"}),(0,d.jsx)("span",{className:"text-sm font-mono truncate",children:a.label})]},a.value))}):(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:"Loading models..."})]})]}),(0,d.jsxs)("details",{className:"group",children:[(0,d.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base group-open:rotate-90 transition-transform",children:"chevron_right"}),"Advanced Options"]}),(0,d.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3 pl-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Input Tokens"}),(0,d.jsx)("input",{type:"number",value:w,onChange:a=>x(Number(a.target.value)||128e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Output Tokens"}),(0,d.jsx)("input",{type:"number",value:y,onChange:a=>z(Number(a.target.value)||16e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:A,onChange:a=>B(a.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,d.jsx)("span",{className:"text-sm",children:"Tool Calling"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:C,onChange:a=>D(a.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,d.jsx)("span",{className:"text-sm",children:"Vision"})]})]})]}),s.size>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:a.color},children:n&&k?.length>0?"3":"2"}),(0,d.jsxs)("span",{className:"font-medium text-sm",children:["Copy Config (",s.size," model",1!==s.size?"s":"",")"]})]}),(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:()=>M(L(),"config"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"config"===q?"check":"content_copy"}),p("config"===q?"copied":"copyConfig")]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto max-h-80",children:(0,d.jsx)("code",{className:"text-xs font-mono whitespace-pre text-text-main",children:L()})}),(0,d.jsxs)("div",{className:"mt-3 p-3 bg-bg-secondary rounded-lg border border-border",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Paste into: "}),(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"~/.config/Code/User/chatLanguageModels.json"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Then reload VS Code and set the API key in the input prompt."})]})]})]})})]})}[f]=k.then?(await k)():k,a.s(["default",()=>l]),c()}catch(a){c(a)}},!1),612927,a=>a.a(async(b,c)=>{try{var d=a.i(437713),e=a.i(929105),f=a.i(8919),g=a.i(957648),h=a.i(778730),i=a.i(298210),j=a.i(798480),k=a.i(623403),l=a.i(291658),m=b([d,e,f,g,h,i,j,k,l]);[d,e,f,g,h,i,j,k,l]=m.then?(await m)():m,a.s([]),c()}catch(a){c(a)}},!1),63816,a=>a.a(async(b,c)=>{try{var d=a.i(437713),e=b([d]);[d]=e.then?(await e)():e,a.s(["ClaudeToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),165517,a=>a.a(async(b,c)=>{try{var d=a.i(929105),e=b([d]);[d]=e.then?(await e)():e,a.s(["CodexToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),830218,a=>a.a(async(b,c)=>{try{var d=a.i(8919),e=b([d]);[d]=e.then?(await e)():e,a.s(["DroidToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),716238,a=>a.a(async(b,c)=>{try{var d=a.i(957648),e=b([d]);[d]=e.then?(await e)():e,a.s(["OpenClawToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),7334,a=>a.a(async(b,c)=>{try{var d=a.i(778730),e=b([d]);[d]=e.then?(await e)():e,a.s(["ClineToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),628319,a=>a.a(async(b,c)=>{try{var d=a.i(298210),e=b([d]);[d]=e.then?(await e)():e,a.s(["KiloToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),270978,a=>a.a(async(b,c)=>{try{var d=a.i(798480),e=b([d]);[d]=e.then?(await e)():e,a.s(["DefaultToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),45888,a=>a.a(async(b,c)=>{try{var d=a.i(623403),e=b([d]);[d]=e.then?(await e)():e,a.s(["AntigravityToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),112697,a=>a.a(async(b,c)=>{try{var d=a.i(291658),e=b([d]);[d]=e.then?(await e)():e,a.s(["CopilotToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),977750,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(831097),i=a.i(781133),j=a.i(867933),k=a.i(911655),l=a.i(612927),m=a.i(63816),n=a.i(165517),o=a.i(830218),p=a.i(716238),q=a.i(7334),r=a.i(628319),s=a.i(270978),t=a.i(45888),u=a.i(112697),v=a.i(415925),w=b([f,j,l,m,n,o,p,q,r,s,t,u]);[f,j,l,m,n,o,p,q,r,s,t,u]=w.then?(await w)():w;let y=process.env.NEXT_PUBLIC_CLOUD_URL;function x({machineId:a}){let b,c,f,j=(0,v.useTranslations)("cliTools"),[l,w]=(0,e.useState)([]),[x,z]=(0,e.useState)(!0),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)({}),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)([]),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)(!1),M=(0,e.useCallback)((a,b,c)=>{try{return j(a,c)}catch{return b}},[j]);(0,e.useEffect)(()=>{Q(),N(),O(),P()},[]);let N=async()=>{try{let a=await fetch("/api/settings");if(a.ok){let b=await a.json();F(b.cloudEnabled||!1)}}catch(a){console.log("Error loading cloud settings:",a)}},O=async()=>{try{let a=await fetch("/api/keys");if(a.ok){let b=await a.json();H(b.keys||[])}}catch(a){console.log("Error fetching API keys:",a)}},P=async()=>{try{let a=new AbortController,b=setTimeout(()=>a.abort(),8e3),c=await fetch("/api/cli-tools/status",{signal:a.signal});if(clearTimeout(b),c.ok){let a=await c.json();J(a||{})}}catch(a){console.log("CLI tool status check timed out or failed:",a)}finally{L(!0)}},Q=async()=>{try{let a=await fetch("/api/providers"),b=await a.json();a.ok&&w(b.connections||[])}catch(a){console.log("Error fetching connections:",a)}finally{z(!1)}},R=()=>l.filter(a=>!1!==a.isActive),S=(0,e.useCallback)((a,b,c)=>{D(d=>d[a]?.[b]===c?d:{...d,[a]:{...d[a],[b]:c}})},[]);if(x||!K)return(0,d.jsx)("div",{className:"flex flex-col gap-6",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.CardSkeleton,{}),(0,d.jsx)(h.CardSkeleton,{}),(0,d.jsx)(h.CardSkeleton,{})]})});let T=(b=R(),c=[],f=new Set,b.forEach(a=>{let b=k.PROVIDER_ID_TO_ALIAS[a.provider]||a.provider;(0,k.getModelsByProviderId)(a.provider).forEach(d=>{let e=`${b}/${d.id}`;f.has(e)||(f.add(e),c.push({value:e,label:`${b}/${d.id}`,provider:a.provider,alias:b,connectionName:a.name,modelId:d.id}))})}),c).length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsx)(g.Card,{children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"tips_and_updates"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:j("howItWorks")}),(0,d.jsxs)("div",{className:"mt-2 grid grid-cols-1 md:grid-cols-3 gap-2 text-xs text-text-muted",children:[(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:j("installationGuide")}),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:j("configureEndpoint")}),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:j("testConnection")})]})]})]})}),!T&&(0,d.jsx)(g.Card,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:j("noActiveProviders")}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:j("noActiveProvidersDesc")})]})]})}),(0,d.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(i.CLI_TOOLS).map(([a,b])=>{let c,e="string"==typeof b.docsUrl&&b.docsUrl.trim()?b.docsUrl.trim():`/docs?section=cli-tools&tool=${a}`,f=/^https?:\/\//i.test(e);return(0,d.jsxs)("div",{className:"flex flex-col gap-2.5",children:[((a,b)=>{let c={tool:b,isExpanded:A===a,onToggle:()=>B(A===a?null:a),baseUrl:E&&y?y:"http://localhost:20128",apiKeys:G,batchStatus:I[a]||null,lastConfiguredAt:I[a]?.lastConfiguredAt||null};switch(a){case"claude":return(0,d.jsx)(m.ClaudeToolCard,{...c,activeProviders:R(),modelMappings:C[a]||{},onModelMappingChange:(b,c)=>S(a,b,c),hasActiveProviders:T,cloudEnabled:E},a);case"codex":return(0,d.jsx)(n.CodexToolCard,{...c,activeProviders:R(),cloudEnabled:E},a);case"droid":return(0,d.jsx)(o.DroidToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);case"openclaw":return(0,d.jsx)(p.OpenClawToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);case"antigravity":return(0,d.jsx)(t.AntigravityToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);case"cline":return(0,d.jsx)(q.ClineToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);case"kilo":return(0,d.jsx)(r.KiloToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);case"copilot":return(0,d.jsx)(u.CopilotToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);default:if("mitm"===b.configType)return(0,d.jsx)(t.AntigravityToolCard,{...c,activeProviders:R(),hasActiveProviders:T,cloudEnabled:E},a);return(0,d.jsx)(s.DefaultToolCard,{toolId:a,...c,activeProviders:R(),cloudEnabled:E},a)}})(a,b),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-3",children:(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2.5",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:j("whenToUseLabel")}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1 break-words",children:(c=M(`toolDescriptions.${a}`,b.description),M(`toolUseCases.${a}`,c))})]}),(0,d.jsxs)("a",{href:e,target:f?"_blank":void 0,rel:f?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 text-xs text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"menu_book"}),j("openToolDocs")]})]})})]},a)})})]})}a.s(["default",()=>x]),c()}catch(a){c(a)}},!1)];
|
|
9
|
+
`,w=JSON.stringify({OPENAI_API_KEY:u},null,2),[{filename:"~/.codex/config.toml",content:v},{filename:"~/.codex/auth.json",content:w}])})]})}[f,i]=n.then?(await n)():n,a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),8919,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:q,cloudEnabled:r,batchStatus:s,lastConfiguredAt:t}){let u,v,w,x,y=(0,m.useTranslations)("cliTools"),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)({}),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(""),V=(0,e.useRef)(!1),[W,X]=(0,e.useState)([]),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(null),aa=!!(z?.installed&&z?.runnable),ab=(()=>{if(!aa)return null;let a=z.settings?.customModels?.find(a=>"custom:OmniRoute-0"===a.id);if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=r&&p&&a.baseUrl?.startsWith(p);return b||c?"configured":"other"})()||s?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!J&&K(o[0].key)},[o,J]),(0,e.useEffect)(()=>{b&&!z&&(ad(),ac(),ah())},[b,z]);let ac=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&Q(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(z?.installed&&!V.current){V.current=!0;let a=z.settings?.customModels?.find(a=>"custom:OmniRoute-0"===a.id);a&&(a.model&&M(a.model),a.apiKey&&o?.some(b=>b.key===a.apiKey)&&K(a.apiKey))}},[z,o]);let ad=async()=>{C(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();A(b)}catch(a){A({installed:!1,error:a.message})}finally{C(!1)}},ae=()=>{let a=T||f;return a.endsWith("/v1")?a:`${a}/v1`},af=async()=>{E(!0),I(null);try{let a=J?.trim()||(o?.length>0?o[0].key:null)||(r?null:"sk_omniroute"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ae(),apiKey:a,model:L})}),c=await b.json();b.ok?(I({type:"success",text:y("settingsApplied")}),ad()):I({type:"error",text:c.error||y("failedApplySettings")})}catch(a){I({type:"error",text:a.message})}finally{E(!1)}},ag=async()=>{G(!0),I(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(I({type:"success",text:y("settingsReset")}),M(""),K(""),ad()):I({type:"error",text:b.error||y("failedResetSettings")})}catch(a){I({type:"error",text:a.message})}finally{G(!1)}},ah=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=droid"),b=await a.json();a.ok&&X(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},ai=async a=>{_(a),I(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"droid",backupId:a})}),c=await b.json();b.ok?(I({type:"success",text:y("backupRestored")}),ad(),ah()):I({type:"error",text:c.error||y("failedRestore")})}catch(a){I({type:"error",text:a.message})}finally{_(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/droid.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:ab,batchStatus:s,lastConfiguredAt:t})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:y("toolDescriptions.droid")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:y("checkingCli",{tool:"Factory Droid"})})]}),!B&&z&&!aa&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:z.installed?y("cliNotRunnable",{tool:"Factory Droid"}):y("cliNotInstalled",{tool:"Factory Droid"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:z.installed?y("cliFoundFailedHealthcheck",{tool:"Factory Droid",reason:z.reason?` (${z.reason})`:""}):y("installCliPrompt",{tool:"Factory Droid"})})]})]}),!B&&aa&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[z?.settings?.customModels?.find(a=>"custom:OmniRoute-0"===a.id)?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:z.settings.customModels.find(a=>"custom:OmniRoute-0"===a.id).baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(u=T||f).endsWith("/v1")?u:`${u}/v1`,onChange:a=>U(a.target.value),placeholder:y("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),T&&T!==f&&(0,d.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:y("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,d.jsx)("select",{value:J,onChange:a=>K(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:r?y("noApiKeysCreateOne"):y("defaultOmnirouteKey")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:y("model")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:y("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>O(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:y("selectModel")}),L&&(0,d.jsx)("button",{onClick:()=>M(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:y("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),H&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===H.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===H.type?"check_circle":"error"}),(0,d.jsx)("span",{children:H.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:af,disabled:!L,loading:D,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),y("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:ag,disabled:!z?.hasOmniRoute,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),y("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>S(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),y("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{Z(!Y),Y||ah()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),y("backups"),W.length>0&&` (${W.length})`]})]}),Y&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),y("configBackups")]}),0===W.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:y("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:W.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>ai(a.id),disabled:$===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:$===a.id?"...":y("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:N,onClose:()=>O(!1),onSelect:a=>{M(a.value),O(!1)},selectedModel:L,activeProviders:q,modelAliases:P,title:y("selectModelForTool",{tool:"Factory Droid"})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:R,onClose:()=>S(!1),title:y("droidManualConfiguration"),configs:(v=J&&J.trim()?J:r?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",w={customModels:[{model:L||"provider/model-id",id:"custom:OmniRoute-0",index:0,baseUrl:ae(),apiKey:v,displayName:L||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},x="u">typeof navigator&&navigator.platform,[{filename:x?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(w,null,2)}])})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),957648,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:q,cloudEnabled:r,batchStatus:s,lastConfiguredAt:t}){let u,v,w,x=(0,m.useTranslations)("cliTools"),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)({}),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),U=(0,e.useRef)(!1),[V,W]=(0,e.useState)([]),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(null),_=!!(y?.installed&&y?.runnable),aa=(()=>{if(!_)return null;let a=y.settings?.models?.providers?.omniroute;if(!a)return"not_configured";let b=a.baseUrl?.includes("localhost")||a.baseUrl?.includes("127.0.0.1"),c=r&&p&&a.baseUrl?.startsWith(p);return b||c?"configured":"other"})()||s?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!I&&J(o[0].key)},[o,I]),(0,e.useEffect)(()=>{b&&!y&&(ac(),ab(),ag())},[b,y]);let ab=async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&P(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}};(0,e.useEffect)(()=>{if(y?.installed&&!U.current){U.current=!0;let a=y.settings?.models?.providers?.omniroute;if(a){let b=y.settings?.agents?.defaults?.model?.primary;if(b){let a=b.replace("omniroute/","");L(a)}a.apiKey&&o?.some(b=>b.key===a.apiKey)&&J(a.apiKey)}}},[y,o]);let ac=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ad=()=>{let a=S||f;return a.endsWith("/v1")?a:`${a}/v1`},ae=async()=>{D(!0),H(null);try{let a=I?.trim()||(o?.length>0?o[0].key:null)||(r?null:"sk_omniroute"),b=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ad(),apiKey:a,model:K})}),c=await b.json();b.ok?(H({type:"success",text:x("settingsApplied")}),ac()):H({type:"error",text:c.error||x("failedApplySettings")})}catch(a){H({type:"error",text:a.message})}finally{D(!1)}},af=async()=>{F(!0),H(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(H({type:"success",text:x("settingsReset")}),L(""),J(""),ac()):H({type:"error",text:b.error||x("failedResetSettings")})}catch(a){H({type:"error",text:a.message})}finally{F(!1)}},ag=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=openclaw"),b=await a.json();a.ok&&W(b.backups||[])}catch(a){console.log("Error fetching backups:",a)}},ah=async a=>{$(a),H(null);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"openclaw",backupId:a})}),c=await b.json();b.ok?(H({type:"success",text:x("backupRestored")}),ac(),ag()):H({type:"error",text:c.error||x("failedRestore")})}catch(a){H({type:"error",text:a.message})}finally{$(null)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(k.default,{src:"/providers/openclaw.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:aa,batchStatus:s,lastConfiguredAt:t})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:x("toolDescriptions.openclaw")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:x("checkingCli",{tool:"Open Claw"})})]}),!A&&y&&!_&&(0,d.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:y.installed?x("cliNotRunnable",{tool:"Open Claw"}):x("cliNotInstalled",{tool:"Open Claw"})}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:y.installed?x("cliFoundFailedHealthcheck",{tool:"Open Claw",reason:y.reason?` (${y.reason})`:""}):x("installCliPrompt",{tool:"Open Claw"})})]})]}),!A&&_&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.models?.providers?.omniroute?.baseUrl&&(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("current")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings.models.providers.omniroute.baseUrl})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("baseUrl")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:(u=S||f).endsWith("/v1")?u:`${u}/v1`,onChange:a=>T(a.target.value),placeholder:x("baseUrlPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),S&&S!==f&&(0,d.jsx)("button",{onClick:()=>T(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:x("resetToDefault"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,d.jsx)("select",{value:I,onChange:a=>J(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:r?x("noApiKeysCreateOne"):x("defaultOmnirouteKey")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:x("model")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:K,onChange:a=>L(a.target.value),placeholder:x("providerModelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>N(!0),disabled:!n,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${n?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:x("selectModel")}),K&&(0,d.jsx)("button",{onClick:()=>L(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:x("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ae,disabled:!K,loading:C,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),x("apply")]}),(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:af,disabled:!y?.hasOmniRoute,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),x("reset")]}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>R(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),x("manualConfig")]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{Y(!X),X||ag()},children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"history"}),x("backups"),V.length>0&&` (${V.length})`]})]}),X&&(0,d.jsxs)("div",{className:"mt-2 p-3 bg-surface border border-border rounded-lg",children:[(0,d.jsxs)("h4",{className:"text-xs font-semibold text-text-main mb-2 flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"history"}),x("configBackups")]}),0===V.length?(0,d.jsx)("p",{className:"text-xs text-text-muted",children:x("noBackupsYet")}):(0,d.jsx)("div",{className:"space-y-1.5",children:V.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-black/5 dark:bg-white/5 rounded text-xs",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"description"}),(0,d.jsx)("span",{className:"flex-1 truncate font-mono",title:a.id,children:a.id}),(0,d.jsx)("span",{className:"text-text-muted whitespace-nowrap",children:new Date(a.createdAt).toLocaleString()}),(0,d.jsx)("button",{onClick:()=>ah(a.id),disabled:Z===a.id,className:"px-2 py-0.5 bg-primary/10 text-primary rounded text-[10px] font-medium hover:bg-primary/20 transition-colors disabled:opacity-50",children:Z===a.id?"...":x("restore")})]},a.id))})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{L(a.value),N(!1)},selectedModel:K,activeProviders:q,modelAliases:O,title:x("selectModelForTool",{tool:"Open Claw"})}),(0,d.jsx)(j.ManualConfigModal,{isOpen:Q,onClose:()=>R(!1),title:x("openClawManualConfiguration"),configs:(v=I&&I.trim()?I:r?"<API_KEY_FROM_DASHBOARD>":"sk_omniroute",w={agents:{defaults:{model:{primary:`omniroute/${K||"provider/model-id"}`}}},models:{providers:{omniroute:{baseUrl:ad(),apiKey:v,api:"openai-completions",models:[{id:K||"provider/model-id",name:(K||"provider/model-id").split("/").pop()}]}}}},[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify(w,null,2)}])})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),778730,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);[f,i]=n.then?(await n)():n;let p=process.env.NEXT_PUBLIC_CLOUD_URL;function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:q,cloudEnabled:r,batchStatus:s,lastConfiguredAt:t}){let u=(0,m.useTranslations)("cliTools"),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)({}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(""),R=(0,e.useRef)(!1),[S,T]=(0,e.useState)([]),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(null),Y=!!(v?.installed&&v?.runnable),Z=(()=>{if(!Y)return null;if(!v.hasOmniRoute)return"not_configured";let a=v.settings?.openAiBaseUrl||"",b=a.includes("localhost")||a.includes("127.0.0.1"),c=r&&p&&a.startsWith(p);return b||c?"configured":"other"})(),$=Z||s?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!F&&G(o[0].key)},[o,F]),(0,e.useEffect)(()=>{b&&!v&&(ac(),_(),aa())},[b,v]),(0,e.useEffect)(()=>{if(v?.settings&&!R.current){let a=v.settings.openAiModelId;a&&(I(a),R.current=!0)}},[v]);let _=async()=>{try{let a=await fetch("/api/models/alias");if(a.ok){let b=await a.json();M(b.aliases||{})}}catch{}},aa=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=cline");if(a.ok){let b=await a.json();T(b.backups||[])}}catch{}},ab=async a=>{X(a);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"cline",backupId:a})});if(b.ok)E({type:"success",text:u("backupRestoredReloading")}),await ac(),await aa();else{let a=await b.json();E({type:"error",text:a.error||u("failedRestoreBackup")})}}catch(a){E({type:"error",text:a.message})}finally{X(null)}},ac=async()=>{y(!0);try{let a=await fetch("/api/cli-tools/cline-settings"),b=await a.json();w(b)}catch(a){w({error:a.message})}finally{y(!1)}},ad=async()=>{A(!0),E(null);try{let a=P||f||"http://localhost:20128",b=a.endsWith("/v1")?a:`${a}/v1`,c=await fetch("/api/cli-tools/cline-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:b,apiKey:F||"sk_omniroute",model:H})}),d=await c.json();c.ok?(E({type:"success",text:d.message||u("applied")}),await ac(),await aa()):E({type:"error",text:d.error||u("failed")})}catch(a){E({type:"error",text:a.message})}finally{A(!1)}},ae=async()=>{C(!0),E(null);try{let a=await fetch("/api/cli-tools/cline-settings",{method:"DELETE"}),b=await a.json();a.ok?(E({type:"success",text:b.message||u("resetDone")}),I(""),R.current=!1,await ac(),await aa()):E({type:"error",text:b.error||u("failed")})}catch(a){E({type:"error",text:a.message})}finally{C(!1)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:a.image?(0,d.jsx)(k.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}}):(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:a.color},children:"terminal"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:$,batchStatus:s,lastConfiguredAt:t})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:u("toolDescriptions.cline")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:u("checkingCli",{tool:"Cline"})})]}),v&&!x&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${Y?"text-green-500":"text-yellow-500"}`,children:Y?"check_circle":"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:Y?u("cliDetectedReady",{tool:"Cline"}):v.installed?u("cliNotRunnable",{tool:"Cline"}):u("cliNotDetected",{tool:"Cline"})}),v.commandPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("binary"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:v.commandPath})]}),v.globalStatePath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("configPathShort"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:v.globalStatePath})]})]})]}),Y&&(0,d.jsxs)(d.Fragment,{children:["configured"===Z&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:u("omnirouteConfiguredOpenAiCompatible")}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("provider"),": ",(0,d.jsx)("strong",{children:"openai"})," • ",u("model"),":"," ",(0,d.jsx)("strong",{children:v.settings?.openAiModelId||"—"})]})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:u("model")}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:H,onChange:a=>I(a.target.value),placeholder:u("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>K(!0),disabled:!n,children:u("select")}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>O(!0),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:u("apiKey")}),o&&o.length>0?(0,d.jsx)("select",{value:F,onChange:a=>G(a.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("p",{className:"text-sm text-text-muted",children:r?u("noApiKeysAvailable"):u("usingDefaultOmniroute")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ad,disabled:!H,loading:z,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===Z?u("updateConfig"):u("applyConfig")]}),"configured"===Z&&(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:ae,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),u("reset")]})]}),D&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===D.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===D.type?"check_circle":"error"}),(0,d.jsx)("span",{children:D.text})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,d.jsxs)("button",{onClick:()=>V(!U),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${U?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),u("backups")," ",S.length>0&&`(${S.length})`]}),U&&S.length>0&&(0,d.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:S.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsx)("span",{className:"font-medium",children:a.originalFile}),(0,d.jsx)("span",{className:"text-text-muted",children:new Date(a.createdAt).toLocaleString()})]}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>ab(a.id),loading:W===a.id,children:u("restore")})]},a.id))}),U&&0===S.length&&(0,d.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:u("noBackupsAvailable")})]})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:J,onClose:()=>K(!1),onSelect:a=>{I(a.value),K(!1)},selectedModel:H,activeProviders:q,title:u("selectModelForTool",{tool:"Cline"})}),N&&(0,d.jsx)(j.ManualConfigModal,{isOpen:N,onClose:()=>O(!1),title:u("clineManualConfiguration"),...{onApply:a=>{a.model&&I(a.model),a.apiKey&&G(a.apiKey),a.baseUrl&&Q(a.baseUrl),O(!1)},currentConfig:{model:H,apiKey:F,baseUrl:P||f}}})]})}a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),298210,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(210849),k=a.i(571987),l=a.i(116795),m=a.i(415925),n=b([f,i]);function o({tool:a,isExpanded:b,onToggle:c,baseUrl:f,hasActiveProviders:n,apiKeys:o,activeProviders:p,cloudEnabled:q,batchStatus:r,lastConfiguredAt:s}){let t=(0,m.useTranslations)("cliTools"),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(""),Q=(0,e.useRef)(!1),[R,S]=(0,e.useState)([]),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(null),X=!!(u?.installed&&u?.runnable),Y=X?u.hasOmniRoute?"configured":"not_configured":null,Z=Y||r?.configStatus||null;(0,e.useEffect)(()=>{o?.length>0&&!E&&F(o[0].key)},[o,E]),(0,e.useEffect)(()=>{b&&!u&&(ab(),$(),_())},[b,u]);let $=async()=>{try{let a=await fetch("/api/models/alias");if(a.ok){let b=await a.json();L(b.aliases||{})}}catch{}},_=async()=>{try{let a=await fetch("/api/cli-tools/backups?tool=kilo");if(a.ok){let b=await a.json();S(b.backups||[])}}catch{}},aa=async a=>{W(a);try{let b=await fetch("/api/cli-tools/backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"kilo",backupId:a})});if(b.ok)D({type:"success",text:t("backupRestoredReloading")}),await ab(),await _();else{let a=await b.json();D({type:"error",text:a.error||t("failedRestoreBackup")})}}catch(a){D({type:"error",text:a.message})}finally{W(null)}},ab=async()=>{x(!0);try{let a=await fetch("/api/cli-tools/kilo-settings"),b=await a.json();v(b)}catch(a){v({error:a.message})}finally{x(!1)}},ac=async()=>{z(!0),D(null);try{let a=O||f||"http://localhost:20128",b=a.endsWith("/v1")?a:`${a}/v1`,c=await fetch("/api/cli-tools/kilo-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:b,apiKey:E||"sk_omniroute",model:G})}),d=await c.json();c.ok?(D({type:"success",text:d.message||t("applied")}),await ab(),await _()):D({type:"error",text:d.error||t("failed")})}catch(a){D({type:"error",text:a.message})}finally{z(!1)}},ad=async()=>{B(!0),D(null);try{let a=await fetch("/api/cli-tools/kilo-settings",{method:"DELETE"}),b=await a.json();a.ok?(D({type:"success",text:b.message||t("resetDone")}),H(""),Q.current=!1,await ab(),await _()):D({type:"error",text:b.error||t("failed")})}catch(a){D({type:"error",text:a.message})}finally{B(!1)}};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:a.image?(0,d.jsx)(k.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}}):(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:a.color},children:"terminal"})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)(l.default,{effectiveConfigStatus:Z,batchStatus:r,lastConfiguredAt:s})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:t("toolDescriptions.kilo")})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[w&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:t("checkingCli",{tool:"Kilo Code"})})]}),u&&!w&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-bg-secondary/50 border-border",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${X?"text-green-500":"text-yellow-500"}`,children:X?"check_circle":"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:X?t("cliDetectedReady",{tool:"Kilo Code"}):u.installed?t("cliNotRunnable",{tool:"Kilo Code"}):t("cliNotDetected",{tool:"Kilo Code"})}),u.commandPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[t("binary"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.commandPath})]}),u.authPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[t("auth"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:u.authPath})]})]})]}),X&&(0,d.jsxs)(d.Fragment,{children:["configured"===Y&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-green-500/10 border border-green-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-green-500 text-lg",children:"check_circle"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm text-green-700 dark:text-green-300",children:t("omnirouteConfiguredOpenAiCompatible")}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[t("providers"),":"," ",(0,d.jsx)("strong",{children:u.settings?.auth?.join(", ")||"—"})]})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:t("model")}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:G,onChange:a=>H(a.target.value),placeholder:t("providerModelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:!n,children:t("select")}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>N(!0),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-sm text-text-muted",children:t("apiKey")}),o&&o.length>0?(0,d.jsx)("select",{value:E,onChange:a=>F(a.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("p",{className:"text-sm text-text-muted",children:q?t("noApiKeysAvailable"):t("usingDefaultOmniroute")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pt-2",children:[(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:ac,disabled:!G,loading:y,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"configured"===Y?t("updateConfig"):t("applyConfig")]}),"configured"===Y&&(0,d.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:ad,loading:A,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restart_alt"}),t("reset")]})]}),C&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg text-sm ${"success"===C.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"success"===C.type?"check_circle":"error"}),(0,d.jsx)("span",{children:C.text})]}),(0,d.jsxs)("div",{className:"border-t border-border pt-3 mt-1",children:[(0,d.jsxs)("button",{onClick:()=>U(!T),className:"flex items-center gap-2 text-sm text-text-muted hover:text-text transition-colors",children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-[16px] transition-transform ${T?"rotate-90":""}`,children:"chevron_right"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"backup"}),t("backups")," ",R.length>0&&`(${R.length})`]}),T&&R.length>0&&(0,d.jsx)("div",{className:"mt-2 flex flex-col gap-1.5 pl-6",children:R.map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2 rounded bg-bg-secondary/50 text-xs",children:[(0,d.jsxs)("div",{className:"flex flex-col",children:[(0,d.jsx)("span",{className:"font-medium",children:a.originalFile}),(0,d.jsx)("span",{className:"text-text-muted",children:new Date(a.createdAt).toLocaleString()})]}),(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>aa(a.id),loading:V===a.id,children:t("restore")})]},a.id))}),T&&0===R.length&&(0,d.jsx)("p",{className:"mt-2 pl-6 text-xs text-text-muted",children:t("noBackupsAvailable")})]})]})]})]}),(0,d.jsx)(i.ModelSelectModal,{isOpen:I,onClose:()=>J(!1),onSelect:a=>{H(a.value),J(!1)},selectedModel:G,activeProviders:p,title:t("selectModelForTool",{tool:"Kilo Code"})}),M&&(0,d.jsx)(j.ManualConfigModal,{isOpen:M,onClose:()=>N(!1),title:t("kiloManualConfiguration"),...{onApply:a=>{a.model&&H(a.model),a.apiKey&&F(a.apiKey),a.baseUrl&&P(a.baseUrl),N(!1)},currentConfig:{model:G,apiKey:E,baseUrl:O||f}}})]})}[f,i]=n.then?(await n)():n,process.env.NEXT_PUBLIC_CLOUD_URL,a.s(["default",()=>o]),c()}catch(a){c(a)}},!1),798480,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(959852),j=a.i(571987),k=a.i(415925),l=a.i(95455),m=b([f,i]);function n({toolId:a,tool:b,isExpanded:c,onToggle:f,baseUrl:m,apiKeys:n,activeProviders:o=[],cloudEnabled:p=!1,batchStatus:q}){let r,s,t,u=(0,k.useTranslations)("cliTools"),v=(0,e.useCallback)((a,b,c)=>{try{return u(a,c)}catch{return b}},[u]),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(!1),I=(0,e.useRef)(!1),[J,K]=(0,e.useState)(()=>n?.length>0?n[0].key:"");(0,e.useEffect)(()=>{let b=localStorage.getItem(`omniroute-cli-model-${a}`);b&&B(b);let c=localStorage.getItem(`omniroute-cli-key-${a}`);c&&n?.some(a=>a.key===c)&&K(c)},[a,n]);let L=(0,e.useCallback)(b=>{B(b),b?localStorage.setItem(`omniroute-cli-model-${a}`,b):localStorage.removeItem(`omniroute-cli-model-${a}`)},[a]),M=(0,e.useCallback)(b=>{K(b),b&&localStorage.setItem(`omniroute-cli-key-${a}`,b)},[a]);(0,e.useEffect)(()=>{!c||C||I.current||(I.current=!0,fetch(`/api/cli-tools/runtime/${a}`).then(a=>a.json()).then(a=>D(a)).catch(a=>D({error:a?.message||u("runtimeCheckFailed")})))},[c,C,a]);let N=a=>{let b=J&&J.trim()?J:p?u("yourApiKeyPlaceholder"):"sk_omniroute",c=m||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,A||u("modelPlaceholder"))},O=async(a,b)=>{await (0,l.copyToClipboard)(N(a)),x(b),setTimeout(()=>x(null),2e3)},P=o.length>0,Q=c&&null===C,R=async()=>{H(!0),F(null);try{let b=J&&J.trim()?J:p?"":"sk_omniroute",c=m||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`,e=await fetch(`/api/cli-tools/guide-settings/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:d,apiKey:b,model:A})}),f=await e.json();e.ok?F({type:"success",text:f.message||u("configurationSaved")}):F({type:"error",text:f.error||u("failedToSave")})}catch(a){F({type:"error",text:a.message})}finally{H(!1)}},S=["continue","opencode"].includes(a),T=()=>!b.requiresCloud||!!p;return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:f,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(j.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(j.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(r=C?.reason==="not_required"||"guide"===b.configType,s=C?C.installed&&C.runnable:q?.installed&&q?.runnable,t=C?C.installed:q?.installed,r?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),u("guide")]}):s?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-green-500/10 text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-green-500"}),u("detected")]}):!1===t&&(C||q)?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-zinc-500/10 text-zinc-500 dark:text-zinc-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-zinc-400 dark:bg-zinc-500"}),u("notInstalled")]}):t&&!s&&(C||q)?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-yellow-500"}),u("notReady")]}):null)]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:v(`toolDescriptions.${a}`,b.description)})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[Q&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:u("checkingRuntime")})]}),!Q&&C&&!C.error&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"not_required"===C.reason?"info":C.installed&&C.runnable?"check_circle":"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"not_required"===C.reason?u("guideOnlyIntegration"):C.installed&&C.runnable?u("cliRuntimeDetected"):C.installed?u("cliFoundNotRunnable",{reason:C.reason?`: ${C.reason}`:""}):u("cliRuntimeNotDetected")}),C.commandPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("binary"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.commandPath})]}),C.configPath&&(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[u("configPath"),":"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:C.configPath})]})]})]}),!Q&&C?.error&&(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-red-500/10 border border-red-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-red-500 text-lg",children:"error"}),(0,d.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:u("failedCheckRuntimeStatus")})]}),b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((b,c)=>{if("cloudCheck"===b.type&&p)return null;let e="warning"===b.type,f="cloudCheck"===b.type&&!p,g="bg-blue-500/10 border-blue-500/30",h="text-blue-600 dark:text-blue-400",i="text-blue-500",j="info";return e?(g="bg-yellow-500/10 border-yellow-500/30",h="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",j="warning"):f&&(g="bg-red-500/10 border-red-500/30",h="text-red-600 dark:text-red-400",i="text-red-500",j="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${g}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${i}`,children:j}),(0,d.jsx)("p",{className:`text-sm ${h}`,children:v(`guides.${a}.notes.${c}`,b.text)})]},c)})}):null,T()&&b.guideSteps.map(c=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:c.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:v(`guides.${a}.steps.${c.step}.title`,c.title)}),c.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:v(`guides.${a}.steps.${c.step}.desc`,c.desc)}),"apiKeySelector"===c.type&&(0,d.jsx)("div",{className:"mt-2 flex items-center gap-2",children:n&&n.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("select",{value:J,onChange:a=>M(a.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:n.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}),(0,d.jsx)("button",{onClick:()=>O(J,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===w?"check":"content_copy"})})]}):(0,d.jsx)("span",{className:"text-sm text-text-muted",children:p?u("noApiKeysCreateOne"):"sk_omniroute"})}),"modelSelector"===c.type&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:A,onChange:a=>L(a.target.value),placeholder:u("modelPlaceholder"),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>z(!0),disabled:!P,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${P?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:u("selectModel")}),A&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>O(A,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===w?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>L(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:u("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),c.value&&(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:N(c.value)}),c.copyable&&(0,d.jsx)("button",{onClick:()=>O(c.value,`${c.step}-${c.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:w===`${c.step}-${c.title}`?"check":"content_copy"})})]})]})]},c.step)),T()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>O(b.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===w?"check":"content_copy"}),"codeblock"===w?u("copied"):u("copy")]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:N(b.codeBlock.code)})})]}),T()&&(0,d.jsxs)("div",{className:"mt-2",children:[E&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs mb-2 ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,d.jsx)("span",{children:E.text})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[S&&(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:R,disabled:!A,loading:G,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),u("saveConfig")]}),b.codeBlock&&(0,d.jsxs)(h.Button,{variant:S?"outline":"primary",size:"sm",onClick:()=>O(b.codeBlock.code,"codeblock"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"codeblock"===w?"check":"content_copy"}),"codeblock"===w?u("copied"):u("copyConfig")]}),A&&(0,d.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-green-500",children:"check_circle"}),u("selectionSaved")]})]})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:u("comingSoon")})}),(0,d.jsx)(i.ModelSelectModal,{isOpen:y,onClose:()=>z(!1),onSelect:a=>{L(a.value)},selectedModel:A,activeProviders:o,title:u("selectModel")})]})}[f,i]=m.then?(await m)():m,a.s(["default",()=>n]),c()}catch(a){c(a)}},!1),623403,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(818465),j=a.i(563203),k=a.i(489108),l=a.i(959852),m=a.i(571987),n=a.i(415925),o=b([f,l]);function p({tool:a,isExpanded:b,onToggle:c,baseUrl:f,apiKeys:o,activeProviders:p,hasActiveProviders:q,cloudEnabled:r}){let s,t,u,v=(0,n.useTranslations)("cliTools"),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)({}),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(null);(0,e.useEffect)(()=>{o?.length>0&&!E&&F(o[0].key)},[o,E]),(0,e.useEffect)(()=>{b&&!w&&(P(),O())},[b,w]);let O=async()=>{try{let b=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${a.id}`);if(b.ok){let a=(await b.json()).aliases||{};Object.keys(a).length>0&&J(a)}}catch(a){console.log("Error loading saved mappings:",a)}},P=async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();x(b)}}catch(a){console.log("Error fetching status:",a),x({running:!1})}},Q="u">typeof navigator&&navigator.userAgent?.includes("Windows"),R=async a=>{z(!0),H(null);try{let b=E?.trim()||(o?.length>0?o[0].key:null)||(r?null:"sk_omniroute"),c=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:b,sudoPassword:a})}),d=await c.json();c.ok?(H({type:"success",text:v("mitmStarted")}),B(!1),D(""),P()):H({type:"error",text:d.error||v("failedStart")})}catch(a){H({type:"error",text:a.message})}finally{z(!1)}},S=async a=>{z(!0),H(null);try{let b=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:a})}),c=await b.json();b.ok?(H({type:"success",text:v("mitmStopped")}),B(!1),D(""),P()):H({type:"error",text:c.error||v("failedStop")})}catch(a){H({type:"error",text:a.message})}finally{z(!1)}},T=()=>{C.trim()?w?.running?S(C):R(C):H({type:"error",text:v("sudoPasswordRequiredError")})},U=(a,b)=>{J(c=>({...c,[a]:b}))},V=async()=>{z(!0),H(null);try{let b=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:I})});if(!b.ok){let a=await b.json();throw Error(a.error||v("failedSaveMappings"))}H({type:"success",text:v("mappingsSaved")})}catch(a){H({type:"error",text:a.message})}finally{z(!1)}},W=w?.running;return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(m.default,{src:a.image||"/providers/antigravity.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),W?(0,d.jsx)(i.Badge,{variant:"success",size:"sm",children:v("active")}):(0,d.jsx)(i.Badge,{variant:"default",size:"sm",children:v("inactive")})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"flex items-center gap-2",children:W?(0,d.jsxs)("button",{onClick:()=>{Q||w?.hasCachedPassword?S(""):(B(!0),H(null))},disabled:y,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),v("stopMitm")]}):(0,d.jsxs)("button",{onClick:()=>{Q||w?.hasCachedPassword?R(""):(B(!0),H(null))},disabled:y||!q,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),v("startMitm")]})}),G?.type==="error"&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:G.text})]}),W&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:v("apiKey")}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),o.length>0?(0,d.jsx)("select",{value:E,onChange:a=>F(a.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:o.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}):(0,d.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:r?v("noApiKeysCreateOne"):v("defaultOmnirouteKey")})]}),(a.defaultModels||[]).map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:I[a.alias]||"",onChange:b=>U(a.alias,b.target.value),placeholder:v("modelPlaceholder"),className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.alias,void(N(b),L(!0))},disabled:!q,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${q?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:v("select")}),I[a.alias]&&(0,d.jsx)("button",{onClick:()=>U(a.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:v("clear"),children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},a.alias)),(0,d.jsx)("div",{className:"flex items-center gap-2",children:(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:V,disabled:y||0===Object.keys(I).length,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),v("saveMappings")]})})]}),!W&&(s={antigravity:"daily-cloudcode-pa.googleapis.com",kiro:"api.anthropic.com"},t=a.name||a.id,u=s[a.id]||s.antigravity,(0,d.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:v("howItWorks")})," ",v("mitmHowWorksDesc",{toolName:t})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,d.jsx)("span",{children:v("mitmStep1")}),(0,d.jsxs)("span",{children:[v("mitmStep2Prefix")," ",(0,d.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:u})," ",v("mitmStep2Suffix")]}),(0,d.jsx)("span",{children:v("mitmStep3",{toolName:t})})]})]}))]}),(0,d.jsx)(j.Modal,{isOpen:A,onClose:()=>{B(!1),D(""),H(null)},title:v("sudoPasswordRequiredTitle"),size:"sm",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:v("sudoPasswordHint")})]}),(0,d.jsx)(k.Input,{type:"password",placeholder:v("enterSudoPassword"),value:C,onChange:a=>D(a.target.value),onKeyDown:a=>{"Enter"!==a.key||y||T()}}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{B(!1),D(""),H(null)},disabled:y,children:v("cancel")}),(0,d.jsx)(h.Button,{variant:"primary",size:"sm",onClick:T,loading:y,children:v("confirm")})]})]})}),(0,d.jsx)(l.ModelSelectModal,{isOpen:K,onClose:()=>L(!1),onSelect:a=>{M&&J(b=>({...b,[M]:a.value}))},selectedModel:M?I[M]:null,activeProviders:p,title:v("selectModelForAlias",{alias:M||""})})]})}[f,l]=o.then?(await o)():o,a.s(["default",()=>p]),c()}catch(a){c(a)}},!1),291658,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(294023),i=a.i(571987),j=a.i(415925),k=b([f]);function l({tool:a,isExpanded:b,onToggle:c,baseUrl:f,apiKeys:k,activeProviders:l=[],hasActiveProviders:m=!1,cloudEnabled:n=!1,batchStatus:o}){let p=(0,j.useTranslations)("cliTools"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(()=>new Set),[u,v]=(0,e.useState)(()=>k?.length>0?k[0].key:""),[w,x]=(0,e.useState)(128e3),[y,z]=(0,e.useState)(16e3),[A,B]=(0,e.useState)(!0),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)("");(0,e.useEffect)(()=>{if(!b||G)return;let a=!1;return fetch("/v1/models").then(a=>a.json()).then(b=>{if(a)return;let c=(b.data||[]).filter(a=>a&&!a.type&&!a.parent&&a.id).map(a=>({value:a.id,label:a.id}));F(c),H(!0)}).catch(()=>{a||H(!0)}),()=>{a=!0}},[b,G]);let K=I?E.filter(a=>a.label.toLowerCase().includes(I.toLowerCase())):E;(0,e.useEffect)(()=>{s.size>0&&localStorage.setItem("omniroute-copilot-selected-models",JSON.stringify([...s]))},[s]);let L=()=>{let a=[...s].map(a=>({id:a,name:a,url:`${f}/v1/chat/completions#models.ai.azure.com`,toolCalling:A,vision:C,maxInputTokens:w,maxOutputTokens:y}));return JSON.stringify({name:"OmniRoute",vendor:"azure",apiKey:"${input:chat.lm.secret.omniroute}",models:a},null,2)},M=async(a,b)=>{await navigator.clipboard.writeText(a),r(b),setTimeout(()=>r(null),2e3)};return(0,d.jsxs)(g.Card,{padding:"sm",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:c,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:(0,d.jsx)(i.default,{src:a.image||"/providers/copilot.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.currentTarget.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px] font-medium rounded-full bg-blue-500/10 text-blue-600 dark:text-blue-400",children:[(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-blue-500"}),p("guide")]})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:(0,d.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,d.jsxs)("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[(0,d.jsx)("p",{className:"font-medium",children:"GitHub Copilot Config Generator"}),(0,d.jsxs)("p",{className:"mt-1 text-xs opacity-80",children:["Generates the"," ",(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"chatLanguageModels.json"})," ","block for VS Code GitHub Copilot using the Azure vendor pattern. Select the models you want, then copy the JSON into your config file."]})]})]}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,d.jsxs)("p",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:["This configuration uses the Azure vendor workaround for custom model lists. Tested with ",(0,d.jsx)("strong",{children:"VS Code ≥ 1.109"})," and"," ",(0,d.jsx)("strong",{children:"GitHub Copilot Chat ≥ v0.37"}),". Future extension updates may change this behavior."]})]}),n&&k?.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,d.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:a.color},children:"1"}),(0,d.jsx)("span",{className:"font-medium text-sm",children:"API Key"})]}),(0,d.jsx)("select",{value:u,onChange:a=>{var b;return b=a.target.value,void(v(b),b&&localStorage.setItem("omniroute-cli-key-copilot",b))},className:"w-full px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:k.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:a.color},children:n&&k?.length>0?"2":"1"}),(0,d.jsxs)("span",{className:"font-medium text-sm",children:["Select Models (",s.size,"/",K.length,")"]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{t(new Set(E.map(a=>a.value)))},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Select All"}),(0,d.jsx)("button",{onClick:()=>{t(new Set)},className:"px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:"Clear"})]})]}),(0,d.jsx)("div",{className:"mb-2",children:(0,d.jsx)("input",{type:"text",value:I,onChange:a=>J(a.target.value),placeholder:"Filter models...",className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})}),G||0!==E.length?0===K.length&&0===E.length?(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-lg",children:"warning"}),(0,d.jsx)("p",{className:"text-sm text-yellow-600 dark:text-yellow-400",children:p("noActiveProviders")})]}):(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-border bg-bg-secondary",children:K.map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-3 px-3 py-2 hover:bg-bg-tertiary cursor-pointer border-b border-border last:border-0 transition-colors",children:[(0,d.jsx)("input",{type:"checkbox",checked:s.has(a.value),onChange:()=>{var b;return b=a.value,void t(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"rounded border-border text-primary accent-[#1F6FEB]"}),(0,d.jsx)("span",{className:"text-sm font-mono truncate",children:a.label})]},a.value))}):(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 text-text-muted text-sm",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-base",children:"progress_activity"}),(0,d.jsx)("span",{children:"Loading models..."})]})]}),(0,d.jsxs)("details",{className:"group",children:[(0,d.jsxs)("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base group-open:rotate-90 transition-transform",children:"chevron_right"}),"Advanced Options"]}),(0,d.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3 pl-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Input Tokens"}),(0,d.jsx)("input",{type:"number",value:w,onChange:a=>x(Number(a.target.value)||128e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-xs text-text-muted block mb-1",children:"Max Output Tokens"}),(0,d.jsx)("input",{type:"number",value:y,onChange:a=>z(Number(a.target.value)||16e3),className:"w-full px-3 py-1.5 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:A,onChange:a=>B(a.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,d.jsx)("span",{className:"text-sm",children:"Tool Calling"})]}),(0,d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,d.jsx)("input",{type:"checkbox",checked:C,onChange:a=>D(a.target.checked),className:"rounded border-border accent-[#1F6FEB]"}),(0,d.jsx)("span",{className:"text-sm",children:"Vision"})]})]})]}),s.size>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"size-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",style:{backgroundColor:a.color},children:n&&k?.length>0?"3":"2"}),(0,d.jsxs)("span",{className:"font-medium text-sm",children:["Copy Config (",s.size," model",1!==s.size?"s":"",")"]})]}),(0,d.jsxs)(h.Button,{variant:"primary",size:"sm",onClick:()=>M(L(),"config"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"config"===q?"check":"content_copy"}),p("config"===q?"copied":"copyConfig")]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto max-h-80",children:(0,d.jsx)("code",{className:"text-xs font-mono whitespace-pre text-text-main",children:L()})}),(0,d.jsxs)("div",{className:"mt-3 p-3 bg-bg-secondary rounded-lg border border-border",children:[(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Paste into: "}),(0,d.jsx)("code",{className:"px-1 py-0.5 rounded bg-black/5 dark:bg-white/10",children:"~/.config/Code/User/chatLanguageModels.json"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Then reload VS Code and set the API key in the input prompt."})]})]})]})})]})}[f]=k.then?(await k)():k,a.s(["default",()=>l]),c()}catch(a){c(a)}},!1),612927,a=>a.a(async(b,c)=>{try{var d=a.i(437713),e=a.i(929105),f=a.i(8919),g=a.i(957648),h=a.i(778730),i=a.i(298210),j=a.i(798480),k=a.i(623403),l=a.i(291658),m=b([d,e,f,g,h,i,j,k,l]);[d,e,f,g,h,i,j,k,l]=m.then?(await m)():m,a.s([]),c()}catch(a){c(a)}},!1),63816,a=>a.a(async(b,c)=>{try{var d=a.i(437713),e=b([d]);[d]=e.then?(await e)():e,a.s(["ClaudeToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),165517,a=>a.a(async(b,c)=>{try{var d=a.i(929105),e=b([d]);[d]=e.then?(await e)():e,a.s(["CodexToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),830218,a=>a.a(async(b,c)=>{try{var d=a.i(8919),e=b([d]);[d]=e.then?(await e)():e,a.s(["DroidToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),716238,a=>a.a(async(b,c)=>{try{var d=a.i(957648),e=b([d]);[d]=e.then?(await e)():e,a.s(["OpenClawToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),7334,a=>a.a(async(b,c)=>{try{var d=a.i(778730),e=b([d]);[d]=e.then?(await e)():e,a.s(["ClineToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),628319,a=>a.a(async(b,c)=>{try{var d=a.i(298210),e=b([d]);[d]=e.then?(await e)():e,a.s(["KiloToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),270978,a=>a.a(async(b,c)=>{try{var d=a.i(798480),e=b([d]);[d]=e.then?(await e)():e,a.s(["DefaultToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),45888,a=>a.a(async(b,c)=>{try{var d=a.i(623403),e=b([d]);[d]=e.then?(await e)():e,a.s(["AntigravityToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),112697,a=>a.a(async(b,c)=>{try{var d=a.i(291658),e=b([d]);[d]=e.then?(await e)():e,a.s(["CopilotToolCard",()=>d.default]),c()}catch(a){c(a)}},!1),977750,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(831097),i=a.i(781133),j=a.i(867933),k=a.i(911655),l=a.i(612927),m=a.i(63816),n=a.i(165517),o=a.i(830218),p=a.i(716238),q=a.i(7334),r=a.i(628319),s=a.i(270978),t=a.i(45888),u=a.i(112697),v=a.i(415925),w=b([f,j,l,m,n,o,p,q,r,s,t,u]);[f,j,l,m,n,o,p,q,r,s,t,u]=w.then?(await w)():w;let y=process.env.NEXT_PUBLIC_CLOUD_URL;function x({machineId:a}){let b,c,f,j,l,w=(0,v.useTranslations)("cliTools"),[x,z]=(0,e.useState)([]),[A,B]=(0,e.useState)(!0),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)([]),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)([]),Q=(0,e.useCallback)((a,b,c)=>{try{return w(a,c)}catch{return b}},[w]);(0,e.useEffect)(()=>{U(),R(),S(),T(),V()},[]);let R=async()=>{try{let a=await fetch("/api/settings");if(a.ok){let b=await a.json();H(b.cloudEnabled||!1)}}catch(a){console.log("Error loading cloud settings:",a)}},S=async()=>{try{let a=await fetch("/api/keys");if(a.ok){let b=await a.json();J(b.keys||[])}}catch(a){console.log("Error fetching API keys:",a)}},T=async()=>{try{let a=new AbortController,b=setTimeout(()=>a.abort(),8e3),c=await fetch("/api/cli-tools/status",{signal:a.signal});if(clearTimeout(b),c.ok){let a=await c.json();L(a||{})}}catch(a){console.log("CLI tool status check timed out or failed:",a)}finally{N(!0)}},U=async()=>{try{let a=await fetch("/api/providers"),b=await a.json();a.ok&&z(b.connections||[])}catch(a){console.log("Error fetching connections:",a)}finally{B(!1)}},V=async()=>{try{let a=await fetch("/v1/models");if(a.ok){let b=await a.json();P(b?.data||[])}}catch(a){console.log("Error fetching dynamic models:",a)}},W=()=>x.filter(a=>!1!==a.isActive),X=(0,e.useCallback)((a,b,c)=>{F(d=>d[a]?.[b]===c?d:{...d,[a]:{...d[a],[b]:c}})},[]);if(A||!M)return(0,d.jsx)("div",{className:"flex flex-col gap-6",children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.CardSkeleton,{}),(0,d.jsx)(h.CardSkeleton,{}),(0,d.jsx)(h.CardSkeleton,{})]})});let Y=(b=W(),c=[],f=new Set,b.forEach(a=>{let b=k.PROVIDER_ID_TO_ALIAS[a.provider]||a.provider;(0,k.getModelsByProviderId)(a.provider).forEach(d=>{let e=`${b}/${d.id}`;f.has(e)||(f.add(e),c.push({value:e,label:`${b}/${d.id}`,provider:a.provider,alias:b,connectionName:a.name,modelId:d.id}))})}),j=new Set(b.map(a=>a.provider)),l=new Set(b.map(a=>k.PROVIDER_ID_TO_ALIAS[a.provider]||a.provider)),O.forEach(a=>{let b=a.id||a;if(f.has(b))return;let d=b.indexOf("/");if(-1===d)return;let e=b.substring(0,d),g=b.substring(d+1);(l.has(e)||j.has(e))&&(f.add(b),c.push({value:b,label:b,provider:e,alias:e,connectionName:"",modelId:g}))}),c).length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsx)(g.Card,{children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"tips_and_updates"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("h2",{className:"text-sm font-semibold",children:w("howItWorks")}),(0,d.jsxs)("div",{className:"mt-2 grid grid-cols-1 md:grid-cols-3 gap-2 text-xs text-text-muted",children:[(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:w("installationGuide")}),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:w("configureEndpoint")}),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:w("testConnection")})]})]})]})}),!Y&&(0,d.jsx)(g.Card,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:w("noActiveProviders")}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:w("noActiveProvidersDesc")})]})]})}),(0,d.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(i.CLI_TOOLS).map(([a,b])=>{let c,e="string"==typeof b.docsUrl&&b.docsUrl.trim()?b.docsUrl.trim():`/docs?section=cli-tools&tool=${a}`,f=/^https?:\/\//i.test(e);return(0,d.jsxs)("div",{className:"flex flex-col gap-2.5",children:[((a,b)=>{let c={tool:b,isExpanded:C===a,onToggle:()=>D(C===a?null:a),baseUrl:G&&y?y:"http://localhost:20128",apiKeys:I,batchStatus:K[a]||null,lastConfiguredAt:K[a]?.lastConfiguredAt||null};switch(a){case"claude":return(0,d.jsx)(m.ClaudeToolCard,{...c,activeProviders:W(),modelMappings:E[a]||{},onModelMappingChange:(b,c)=>X(a,b,c),hasActiveProviders:Y,cloudEnabled:G},a);case"codex":return(0,d.jsx)(n.CodexToolCard,{...c,activeProviders:W(),cloudEnabled:G},a);case"droid":return(0,d.jsx)(o.DroidToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);case"openclaw":return(0,d.jsx)(p.OpenClawToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);case"antigravity":return(0,d.jsx)(t.AntigravityToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);case"cline":return(0,d.jsx)(q.ClineToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);case"kilo":return(0,d.jsx)(r.KiloToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);case"copilot":return(0,d.jsx)(u.CopilotToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);default:if("mitm"===b.configType)return(0,d.jsx)(t.AntigravityToolCard,{...c,activeProviders:W(),hasActiveProviders:Y,cloudEnabled:G},a);return(0,d.jsx)(s.DefaultToolCard,{toolId:a,...c,activeProviders:W(),cloudEnabled:G},a)}})(a,b),(0,d.jsx)("div",{className:"rounded-lg border border-border/50 bg-black/[0.02] dark:bg-white/[0.02] p-3",children:(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2.5",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:w("whenToUseLabel")}),(0,d.jsx)("p",{className:"text-xs text-text-muted mt-1 break-words",children:(c=Q(`toolDescriptions.${a}`,b.description),Q(`toolUseCases.${a}`,c))})]}),(0,d.jsxs)("a",{href:e,target:f?"_blank":void 0,rel:f?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 text-xs text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"menu_book"}),w("openToolDocs")]})]})})]},a)})})]})}a.s(["default",()=>x]),c()}catch(a){c(a)}},!1)];
|
|
10
10
|
|
|
11
11
|
//# sourceMappingURL=src_608e5edc._.js.map
|