@kaitranntt/ccs 8.9.0-dev.3 → 8.9.0-dev.5
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/README.md +3 -3
- package/dist/cliproxy/model-catalog.d.ts.map +1 -1
- package/dist/cliproxy/model-catalog.js +11 -0
- package/dist/cliproxy/model-catalog.js.map +1 -1
- package/dist/cliproxy/services/catalog-cache.d.ts.map +1 -1
- package/dist/cliproxy/services/catalog-cache.js +2 -0
- package/dist/cliproxy/services/catalog-cache.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +12 -2
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/management/shared-manager/diverged-file-adopter.d.ts.map +1 -1
- package/dist/management/shared-manager/diverged-file-adopter.js +106 -76
- package/dist/management/shared-manager/diverged-file-adopter.js.map +1 -1
- package/dist/shared/provider-preset-catalog.d.ts +2 -1
- package/dist/shared/provider-preset-catalog.d.ts.map +1 -1
- package/dist/shared/provider-preset-catalog.js +18 -1
- package/dist/shared/provider-preset-catalog.js.map +1 -1
- package/dist/ui/assets/{Trans-dQ5QXCeL.js → Trans-C9a30Wca.js} +1 -1
- package/dist/ui/assets/{accounts-DMMNI7g4.js → accounts-BKp3N-5E.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BIWuuEiP.js → alert-dialog-CiVZsqbo.js} +1 -1
- package/dist/ui/assets/{api-BKTghVxS.js → api-B0fV9tUE.js} +1 -1
- package/dist/ui/assets/{auth-section-BKDcPs0P.js → auth-section-D8ATj-lB.js} +1 -1
- package/dist/ui/assets/{backups-section-DB1N4X1P.js → backups-section-nkmP274g.js} +1 -1
- package/dist/ui/assets/{channels-dhk_rRcA.js → channels-BRwYOtRh.js} +1 -1
- package/dist/ui/assets/{checkbox-h1pwW_6m.js → checkbox-Dj6i9vkQ.js} +1 -1
- package/dist/ui/assets/{claude-extension-WLOGl6eK.js → claude-extension-mjVsEnOI.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-DVkAmHVF.js → cliproxy-ai-providers-C5-VKq-1.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-D25OT5u5.js → cliproxy-control-panel-C0Keq7FR.js} +1 -1
- package/dist/ui/assets/{cliproxy-CE_mZIGU.js → cliproxy-vP8TLbZE.js} +3 -3
- package/dist/ui/assets/{codex-Bqc25al7.js → codex-B9xHZeHg.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BnAIV9ZB.js → confirm-dialog-BNYjggRg.js} +1 -1
- package/dist/ui/assets/{copilot-BdjZjuRs.js → copilot-jWSO6Y4F.js} +1 -1
- package/dist/ui/assets/{cursor-DTbIQ-d7.js → cursor-EBe-Dypr.js} +1 -1
- package/dist/ui/assets/{droid-DAjrpAjP.js → droid-DDSYb18I.js} +1 -1
- package/dist/ui/assets/{globalenv-section-BzirfKtN.js → globalenv-section-D-kyaWiZ.js} +1 -1
- package/dist/ui/assets/{health-CDCop1Et.js → health-DBSj_C4g.js} +1 -1
- package/dist/ui/assets/{index-BhGdNER3.js → index-C0j2sAkv.js} +1 -1
- package/dist/ui/assets/{index-BF4hYrQf.js → index-C17Ym86F.js} +1 -1
- package/dist/ui/assets/{index-B4yjQknk.js → index-C5u0R8cB.js} +30 -30
- package/dist/ui/assets/{index-bC8F80OC.js → index-CCJ0U6K1.js} +1 -1
- package/dist/ui/assets/{index-Dkee4NQG.js → index-Cr_IFaHc.js} +1 -1
- package/dist/ui/assets/{index-DMGiMF5C.js → index-DjdKQ_V4.js} +1 -1
- package/dist/ui/assets/{index-vdkPayvk.js → index-uqNpL8B4.js} +1 -1
- package/dist/ui/assets/{logs-Bb1BaiFq.js → logs-D6DGIPoL.js} +1 -1
- package/dist/ui/assets/{masked-input-DxWhb6sQ.js → masked-input-ChDuxEjb.js} +1 -1
- package/dist/ui/assets/proxy-status-widget-BVMtBer6.js +1 -0
- package/dist/ui/assets/{raw-json-settings-editor-panel-BeZJbsnO.js → raw-json-settings-editor-panel-CH459LFC.js} +1 -1
- package/dist/ui/assets/{searchable-select-CcXdAHJm.js → searchable-select-BcxLzV8F.js} +1 -1
- package/dist/ui/assets/{separator-O1g2RdCE.js → separator-D6A0dARJ.js} +1 -1
- package/dist/ui/assets/{shared-Ct6UqE0N.js → shared-DXKXimwP.js} +1 -1
- package/dist/ui/assets/{table-D4ZJKsoh.js → table-D3njUfqP.js} +1 -1
- package/dist/ui/assets/{updates-jnNBispr.js → updates-IzpAbXjx.js} +1 -1
- package/dist/ui/assets/{use-accounts-DXwh5f2t.js → use-accounts-gJ1NFpyH.js} +1 -1
- package/dist/ui/icons/orcarouter.svg +1 -0
- package/dist/ui/index.html +1 -1
- package/dist/utils/hooks/image-analysis-backend-resolver.d.ts.map +1 -1
- package/dist/utils/hooks/image-analysis-backend-resolver.js +6 -0
- package/dist/utils/hooks/image-analysis-backend-resolver.js.map +1 -1
- package/dist/utils/hooks/image-analysis-runtime-status.d.ts.map +1 -1
- package/dist/utils/hooks/image-analysis-runtime-status.js +8 -3
- package/dist/utils/hooks/image-analysis-runtime-status.js.map +1 -1
- package/dist/utils/package-manager-detector.d.ts.map +1 -1
- package/dist/utils/package-manager-detector.js +6 -2
- package/dist/utils/package-manager-detector.js.map +1 -1
- package/package.json +4 -1
- package/scripts/dev-release.sh +1 -1
- package/dist/ui/assets/proxy-status-widget-Dj_46CdP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-detector.d.ts","sourceRoot":"","sources":["../../src/utils/package-manager-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;AAKH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"package-manager-detector.d.ts","sourceRoot":"","sources":["../../src/utils/package-manager-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;AAKH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAuJD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,MAA8B,GAAG,cAAc,CAsC/F;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,MAA8B,GAAG,cAAc,CAE/F;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,OAAO,GAAE,MAAM,CAAC,UAAwB,GACvC,MAAM,CAAC,UAAU,CA8BnB;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAElF;AAUD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,cAAc,GAAG,qBAAqB,CA8BxF;AAiBD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,cAAuC,EAChD,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,MAAM,CAwBR"}
|
|
@@ -102,8 +102,12 @@ function inferInstallFromPath(targetPath) {
|
|
|
102
102
|
}
|
|
103
103
|
if (normalizedPath.includes('/global/') &&
|
|
104
104
|
normalizedPath.includes('/node_modules/@kaitranntt/ccs')) {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
// pnpm v9+ nests a version segment plus a store-hash segment under
|
|
106
|
+
// global/ (e.g. global/v11/139e7-1a00df73ffb.../node_modules), while
|
|
107
|
+
// older pnpm uses a single segment (global/5/node_modules). Accept one
|
|
108
|
+
// or more segments but keep excluding yarn's global/lib/node_modules.
|
|
109
|
+
const pnpmFlatMatch = normalizedPath.match(/\/global\/([^/]+(?:\/[^/]+)*)\/node_modules\/@kaitranntt\/ccs/);
|
|
110
|
+
if (!pnpmFlatMatch || pnpmFlatMatch[1].split('/')[0] === 'lib') {
|
|
107
111
|
return null;
|
|
108
112
|
}
|
|
109
113
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager-detector.js","sourceRoot":"","sources":["../../src/utils/package-manager-detector.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAmB7B,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,SAAS,iBAAiB,CAAC,UAAkB;IAC3C,6EAA6E;IAC7E,iEAAiE;IACjE,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACtE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED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AAG,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CACjF,CACF,CAAC;QACF,IAAI,qBAAqB,EAAE,CAAC;YAC1B,OAAO;gBACL,OAAO,EAAE,MAAM;gBACf,MAAM,EAAE,qBAAqB,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,GAAG,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC;aAC1E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IACE,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC;QACnC,cAAc,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EACxD,CAAC;QACD,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"package-manager-detector.js","sourceRoot":"","sources":["../../src/utils/package-manager-detector.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAmB7B,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C,SAAS,iBAAiB,CAAC,UAAkB;IAC3C,6EAA6E;IAC7E,iEAAiE;IACjE,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACtE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,UAAkB;IACzC,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM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,EAAE;QAClD,IAAI,EAAE,mCAAmC,SAAS,EAAE;QACpD,IAAI,EAAE,+BAA+B,SAAS,EAAE;QAChD,GAAG,EAAE,8BAA8B,SAAS,EAAE;KAC/C,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,MAAM,GAAG;QACb,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,aAAa;KACnB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnB,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,GAAG,MAAM,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;AACjE,CAAC;AA5BD,8DA4BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaitranntt/ccs",
|
|
3
|
-
"version": "8.9.0-dev.
|
|
3
|
+
"version": "8.9.0-dev.5",
|
|
4
4
|
"description": "Claude Codex Switch - Instant profile switching between Claude, GLM, Kimi, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"url": "git+https://github.com/kaitranntt/ccs.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
22
25
|
"author": {
|
|
23
26
|
"name": "Tam Nhu Tran (Kai)",
|
|
24
27
|
"email": "kaitranntt@users.noreply.github.com"
|
package/scripts/dev-release.sh
CHANGED
|
@@ -115,7 +115,7 @@ PACKAGE_NAME=$(jq -r '.name' package.json)
|
|
|
115
115
|
if npm view "${PACKAGE_NAME}@${VERSION}" version >/dev/null 2>&1; then
|
|
116
116
|
log_info "npm already has ${PACKAGE_NAME}@${VERSION}, skipping publish"
|
|
117
117
|
else
|
|
118
|
-
npm publish --tag dev
|
|
118
|
+
npm publish --tag dev --access public
|
|
119
119
|
log_info "Published to npm with @dev tag"
|
|
120
120
|
fi
|
|
121
121
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as x}from"./react-vendor-Bjx91N7w.js";import{a as z,bG as Ce,bH as Re,c as h,B as k,e as q,bC as ke,aZ as Ae,bI as Ge,bJ as Te,bK as Pe,bL as We,bM as Ve,bN as _e,bO as Ie,bP as De,bQ as Ee,T as Oe,O as $e,R as Ue,j as Le,k as Me,l as Fe,m as qe,n as Be,o as He,p as ze,q as Ke,_ as Qe}from"./index-B4yjQknk.js";import{A as Ye,a as Je,b as Xe,c as Ze,d as et,e as tt,f as st,g as nt}from"./alert-dialog-BIWuuEiP.js";import{u as he,a as rt,b as at,h as ot}from"./tanstack-bhJxV1h8.js";import{t as ne}from"./notifications-B4_o8bcr.js";import{bg as ge,R as F,u as it,t as lt,v as dt,A as ct,bh as ut,bi as xt,bj as gt,X as mt,e as pt,bk as ft,bl as bt,U as ht,w as yt,n as jt,x as vt,aG as Nt,T as re,aQ as St}from"./icons-DSLG1YsC.js";import{T as me}from"./Trans-dQ5QXCeL.js";async function wt(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let s="Failed to fetch sync status";try{const n=await t.json();s=n.error||n.message||s}catch{}throw new Error(s)}return t.json()}async function Ct(){const t=new AbortController,s=setTimeout(()=>t.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!n.ok){let a="Sync failed";try{const o=await n.json();a=o.error||o.message||a}catch{}throw new Error(a)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function Rt(){return he({queryKey:["cliproxy-sync-status"],queryFn:wt,refetchInterval:3e4,retry:1,staleTime:1e4})}function kt(){const t=rt(),{t:s}=z();return at({mutationFn:Ct,onSuccess:n=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?ne.info(s("toasts.noProfilesToSync")):ne.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{ne.error(s("toasts.syncFailed",{error:n.message}))}})}function pe(t){const s=t.trim().replace(/^v/,""),[n,a="0"]=s.split("-",2),[o=0,u=0,c=0]=n.split(".").map(y=>Number.parseInt(y,10)||0),p=/^\d+$/.test(a)&&Number.parseInt(a,10)||0;return{major:o,minor:u,patch:c,forkRelease:p}}function Y(t,s){return t>s?1:t<s?-1:0}function le(t,s){const n=pe(t),a=pe(s);return Y(n.major,a.major)||Y(n.minor,a.minor)||Y(n.patch,a.patch)||Y(n.forkRelease,a.forkRelease)}function ae(t,s){return le(t,s)>0}function oe(t,s,n){return le(t,s)>=0&&le(t,n)<=0}function fe(t){if(!/^\d+$/.test(t))return null;const s=Number(t);return Number.isSafeInteger(s)?s:null}function At(){const{t}=z(),s=Ce(),n=Re(),a=s.data?.request_retry??0,o=s.data?.max_retry_interval??0,u=s.data?.manageable!==!1,c=s.isLoading||s.isError||n.isPending||!u,p=s.error?.message??s.data?.message;return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:t("routingGuidance.retryTitle")}),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[t("routingGuidance.retryHint"),s.data?` · ${s.data.source} · ${s.data.target}`:""]})]}),e.jsx(Gt,{requestRetry:a,maxRetryInterval:o,disabled:c,onUpdate:(y,r)=>n.mutate({request_retry:y,max_retry_interval:r})},`${a}:${o}`)]}),p?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:p}):null]})}function Gt({requestRetry:t,maxRetryInterval:s,disabled:n,onUpdate:a}){const{t:o}=z(),[u,c]=x.useState(String(t)),[p,y]=x.useState(String(s)),[r,j]=x.useState(null),g=()=>{if(n)return;const m=fe(u.trim()),w=fe(p.trim());if(m===null||w===null){j(o("routingGuidance.retryRangeError")),c(String(t)),y(String(s));return}j(null),(m!==t||w!==s)&&a(m,w)};return e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{"aria-label":o("routingGuidance.requestRetryLabel"),inputMode:"numeric",className:"h-6 w-10 rounded border border-border/70 bg-background px-1.5 text-[10px] text-foreground",value:u,onChange:m=>c(m.target.value),onBlur:g,disabled:n}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"/"}),e.jsx("input",{"aria-label":o("routingGuidance.maxRetryIntervalLabel"),inputMode:"numeric",className:"h-6 w-10 rounded border border-border/70 bg-background px-1.5 text-[10px] text-foreground",value:p,onChange:m=>y(m.target.value),onBlur:g,disabled:n})]}),r?e.jsx("div",{className:"text-[10px] text-destructive",children:r}):null]})}const ie={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function be({className:t,compact:s=!1,state:n,sessionAffinityState:a,isLoading:o,isSaving:u,error:c,onApply:p,onApplyAffinity:y}){const{t:r}=z(),j=n?.strategy??"round-robin",g=n?.poolRouting?.enabled??!1,m=n?.poolRouting?.maxRetryCredentials,w=n?.poolRouting?.manageable??!0,C=!w,E=n?.poolRouting?.message??r("routingGuidance.poolRoutingLocalOnly"),R=a?.enabled??!1,f=a?.ttl??"1h",b=a?.manageable??!0,[v,B]=x.useState(j),[W,_]=x.useState(R),[A,I]=x.useState(f),[N,X]=x.useState(!1),Z=n?.source==="live"?"Live CLIProxy":"Saved startup default",O=o||u||!n||v===j,$=N?"Hide details":"Show details",V=o||u||!!c||!b,D=r(b?W?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),G=x.useRef(null),U=x.useRef(!1);x.useEffect(()=>{B(j)},[j]),x.useEffect(()=>{_(R),I(f)},[R,f]),x.useEffect(()=>{if(u||!G.current)return;const l=G.current;l.enabled===R&&l.ttl===f||(_(R),I(f)),G.current=null},[u,R,f]);const K=()=>{if(!b)return;const l=!W,d=A.trim()||"1h";G.current={enabled:l,ttl:d},_(l),y({enabled:l,ttl:d})},T=()=>{if(!b||c)return;if(U.current){U.current=!1;return}const l=A.trim()||"1h";l!==f&&(G.current={enabled:W,ttl:l},y({enabled:W,ttl:l}))};if(s){const l=d=>{B(d),d!==j&&p(d)};return e.jsxs("div",{className:h("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ge,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),u&&e.jsx(F,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:h("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",v==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(ie).map(([d,S])=>{const H=v===d;return e.jsx("button",{type:"button",className:h("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",H?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>l(d),disabled:o||u||!!c,title:S.description,children:S.title},d)})]})]}),g&&w?e.jsx("div",{role:"status",className:"rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-1.5 text-[10px] leading-4 text-amber-700 dark:text-amber-300",children:r("routingGuidance.poolRoutingApplyWarning")}):null,e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:r("routingGuidance.poolRouting")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:C?E:r(g?"routingGuidance.drainOrderHint":"routingGuidance.poolRoutingOffHint")})]}),e.jsx(k,{variant:C?"outline":g?"secondary":"outline",title:C?E:r(g?"routingGuidance.poolRoutingManaged":"routingGuidance.poolRoutingOffHint"),children:C?r("routingGuidance.localOnly"):g?`${r("routingGuidance.poolRoutingOn")} · ${r("routingGuidance.poolMaxRetry",{count:m??0})}`:r("routingGuidance.poolRoutingOff")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:r("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:b?r("routingGuidance.ttlBadge",{ttl:f}):r("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[b?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:A,onChange:d=>I(d.target.value),onBlur:T,disabled:V}):null,e.jsx("button",{type:"button","aria-label":D,className:h("rounded border px-2 py-1 text-[10px] font-medium transition-colors",b?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{U.current=!0},onClick:K,disabled:V,title:a?.message,children:r(b?W?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),a?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:a.message}):null,e.jsx(At,{})]})}return e.jsx("section",{className:h("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ge,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:r("routingGuidance.routingStrategy")}),e.jsx(k,{variant:"secondary",children:j}),n?e.jsx(k,{variant:"outline",children:Z}):null,n?e.jsx(k,{variant:"outline",children:n.target}):null,n?e.jsxs(k,{variant:C?"outline":g?"secondary":"outline",title:C?E:r(g?"routingGuidance.poolRoutingManaged":"routingGuidance.poolRoutingOffHint"),children:[r("routingGuidance.poolRouting"),":"," ",r(C?"routingGuidance.localOnly":g?"routingGuidance.poolRoutingOn":"routingGuidance.poolRoutingOff"),!C&&g&&m!==void 0?` · ${r("routingGuidance.poolMaxRetry",{count:m})}`:""]}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."}),e.jsx("p",{className:"max-w-3xl text-[11px] leading-5 text-muted-foreground",children:r("routingGuidance.drainOrderHint")})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(ie).map(([l,d])=>{const S=v===l;return e.jsx("button",{type:"button",className:h("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>B(l),disabled:o||u||!!c,children:d.title},l)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>X(l=>!l),children:[N?e.jsx(it,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(lt,{className:"mr-1 h-3.5 w-3.5"}),$]}),e.jsx(q,{size:"sm",onClick:()=>p(v),disabled:O||!!c,children:u?"Saving...":`Use ${v}`})]}),g&&w?e.jsx("p",{role:"status",className:"max-w-xs text-[11px] leading-4 text-amber-700 dark:text-amber-400 xl:text-right",children:r("routingGuidance.poolRoutingApplyWarning")}):null]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:r("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:r("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:r("routingGuidance.sessionAffinity")}),e.jsx(k,{variant:"secondary",children:r(W?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),a?.ttl?e.jsx(k,{variant:"outline",children:r("routingGuidance.ttlBadge",{ttl:f})}):null,b?null:e.jsx(k,{variant:"outline",children:r("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:r("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:A,onChange:l=>I(l.target.value),onBlur:T,disabled:V}),e.jsx(q,{type:"button",variant:"outline",onMouseDown:()=>{U.current=!0},onClick:K,disabled:V,"aria-label":D,children:D})]}),a?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:a.message}):null]}),c?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:c.message}):null,!c&&n?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,N?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(ie).map(([l,d])=>{const S=j===l;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:d.title}),S?e.jsx(k,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:d.description})]},l)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:r("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:r("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function Tt(t){if(!t)return"";const s=new Date(t).getTime(),a=Date.now()-s,o=Math.floor(a/(1e3*60*60)),u=Math.floor(a%(1e3*60*60)/(1e3*60));return o>0?`${o}h ${u}m`:`${u}m`}function Pt(t,s){if(!t)return"";const n=Date.now()-t,a=Math.floor(n/(1e3*60)),o=Math.floor(n/(1e3*60*60));return a<1?s("proxyStatusWidget.justNow"):a<60?s("proxyStatusWidget.minutesAgo",{count:a}):s("proxyStatusWidget.hoursAgo",{count:o})}function J({icon:t,tooltip:s,onClick:n,disabled:a,isPending:o,className:u,variant:c="ghost"}){return e.jsxs(He,{children:[e.jsx(ze,{asChild:!0,children:e.jsx(q,{variant:c==="destructive-ghost"?"ghost":c,size:"sm",className:h("h-7 w-7 p-0",c==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",u),onClick:n,disabled:a,children:o?e.jsx(F,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(Ke,{side:"bottom",className:"text-xs",children:s})]})}function Ut(){const{t}=z(),{data:s,isLoading:n}=ke(),{data:a}=Ae(),{data:o,isLoading:u}=Ge(),{data:c,isLoading:p,error:y}=Te(),r=Pe(),{data:j,isLoading:g,error:m}=We(),w=Ve(),C=r.isPending||w.isPending,E=y instanceof Error?y:null,R=_e(),f=Ie(),b=De(),v=Ee(),{data:B}=Rt(),{mutate:W,isPending:_}=kt(),[A,I]=x.useState(!1),[N,X]=x.useState(""),[Z,O]=x.useState(!1),[$,V]=x.useState(null),[D,G]=x.useState(null),{data:U}=he({queryKey:["cliproxy-server-config"],queryFn:()=>Qe.cliproxyServer.get(),staleTime:3e4}),K=ot({mutationKey:["update-backend"]})>0,T=U?.remote,l=T?.enabled&&T?.host,d=j??(m instanceof Error?{source:"unsupported",target:c?.target??(l?"remote":"local"),reachable:!1,manageable:!1,message:m.message}:void 0),S=s?.running??!1,H=R.isPending||f.isPending||b.isPending||v.isPending||K||_,ye=a?.hasUpdate??!1,L=a?.isStable===!1,de=a?.currentVersion,Q=B?.configured??!1,je=t(Q?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),ee=L?a?.maxStableVersion||o?.latestStable:a?.latestVersion,ce=o?.maxStableVersion||a?.maxStableVersion||"6.6.80",M=o?.faultyRange,ve=M&&`${M.min.replace(/-\d+$/,"")}-${M.max.replace(/-\d+$/,"")}`,te=(i,P)=>{V(i),G(P),O(!0)},ue=async i=>{if(!i)return;const P=ae(i,ce);if(M!==void 0&&oe(i,M.min,M.max)){te(i,"faulty");return}if(P){te(i,"experimental");return}try{const xe=await v.mutateAsync({version:i});xe.requiresConfirmation&&te(i,xe.isFaulty?"faulty":"experimental")}catch{}},Ne=()=>{$&&v.mutate({version:$,force:!0}),O(!1),V(null),G(null)},Se=()=>{O(!1),V(null),G(null)},we=l?(()=>{const i=T.protocol||"http",P=T.port||(i==="https"?443:80);return i==="https"&&P===443||i==="http"&&P===80?T.host:`${T.host}:${P}`})():null;return l?e.jsxs("div",{className:h("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dt,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(k,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(ct,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:we})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(be,{compact:!0,className:"mt-3",state:c,sessionAffinityState:d,isLoading:p||g,isSaving:C,error:E,onApply:i=>r.mutate(i),onApplyAffinity:i=>w.mutate(i)},`remote:${c?.strategy??"round-robin"}:${d?.enabled??"na"}:${d?.ttl??"na"}:${d?.manageable??"na"}`)]}):e.jsx(Oe,{delayDuration:300,children:e.jsxs("div",{className:h("rounded-lg border p-3 transition-colors",S?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:h("w-2 h-2 rounded-full",S?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:a?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(F,{className:"w-3 h-3 animate-spin text-muted-foreground"}):S?e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:_?F:ut,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>W(),disabled:!Q||H,isPending:_}),e.jsx(J,{icon:xt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>b.mutate(),disabled:H,isPending:b.isPending}),e.jsx(J,{icon:gt,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>f.mutate(),disabled:H,isPending:f.isPending,variant:"destructive-ghost"})]}):null,e.jsx(J,{icon:A?mt:pt,tooltip:t(A?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>I(!A),className:A?"bg-muted":void 0})]})]}),de&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:h("text-xs font-mono text-muted-foreground",L&&"text-amber-600 dark:text-amber-400"),children:["v",de]}),(ye||L)&&ee&&e.jsxs(k,{variant:"secondary",className:h("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",L?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void ue(ee),title:t(L?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[L?e.jsx(ft,{className:"w-2.5 h-2.5"}):e.jsx(bt,{className:"w-2.5 h-2.5"}),ee]})]}),S&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ht,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(yt,{className:"w-3 h-3"}),Tt(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[Q?e.jsx(jt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(vt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:h("text-xs",Q?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:je})]}),e.jsx(be,{compact:!0,className:"mt-3",state:c,sessionAffinityState:d,isLoading:p||g,isSaving:C,error:E,onApply:i=>r.mutate(i),onApplyAffinity:i=>w.mutate(i)},`local:${c?.strategy??"round-robin"}:${d?.enabled??"na"}:${d?.ttl??"na"}:${d?.manageable??"na"}`),e.jsx($e,{open:A,onOpenChange:I,children:e.jsxs(Ue,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Le,{value:N,onValueChange:X,disabled:u,children:[e.jsx(Me,{className:"h-8 text-xs flex-1",children:e.jsx(Fe,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(qe,{children:o?.versions.slice(0,20).map(i=>{const P=o?.maxStableVersion&&ae(i,o.maxStableVersion),se=o?.faultyRange&&oe(i,o.faultyRange.min,o.faultyRange.max);return e.jsx(Be,{value:i,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",i,i===o.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(se||P)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},i)})})]}),e.jsxs(q,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void ue(N),disabled:v.isPending||!N,children:[v.isPending?e.jsx(F,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Nt,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),N&&o?.maxStableVersion&&ae(N,o.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(re,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:o.maxStableVersion})})]}),N&&o?.faultyRange&&oe(N,o.faultyRange.min,o.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(re,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:N})})]}),a?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:Pt(a.checkedAt,t)})})]})}),!S&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(q,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>R.mutate(),disabled:R.isPending,children:[R.isPending?e.jsx(F,{className:"w-3 h-3 animate-spin"}):e.jsx(St,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(Ye,{open:Z,onOpenChange:O,children:e.jsxs(Je,{children:[e.jsxs(Xe,{children:[e.jsxs(Ze,{className:"flex items-center gap-2",children:[e.jsx(re,{className:"w-5 h-5 text-amber-500"}),t(D==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(et,{className:"space-y-2",children:[D==="faulty"?e.jsx("p",{children:e.jsx(me,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:$??"",range:ve||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(me,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:$??"",maxStable:ce},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(D==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(tt,{children:[e.jsx(st,{onClick:Se,children:t("proxyStatusWidget.cancel")}),e.jsx(nt,{onClick:Ne,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{Ut as P};
|