@kaitranntt/ccs 7.78.1-dev.6 → 7.78.1-dev.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/dist/bin/ccsxp-runtime.d.ts +1 -0
- package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
- package/dist/bin/ccsxp-runtime.js +2 -0
- package/dist/bin/ccsxp-runtime.js.map +1 -1
- package/dist/cliproxy/executor/claude-launcher.d.ts.map +1 -1
- package/dist/cliproxy/executor/claude-launcher.js +15 -11
- package/dist/cliproxy/executor/claude-launcher.js.map +1 -1
- package/dist/cliproxy/executor/session-bridge.d.ts +16 -1
- package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
- package/dist/cliproxy/executor/session-bridge.js +86 -54
- package/dist/cliproxy/executor/session-bridge.js.map +1 -1
- package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -1
- package/dist/dispatcher/flows/settings-flow.js +6 -2
- package/dist/dispatcher/flows/settings-flow.js.map +1 -1
- package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
- package/dist/dispatcher/profile-resolver.js +14 -1
- package/dist/dispatcher/profile-resolver.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts +1 -0
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +18 -1
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/codex-cliproxy-provider-config.d.ts +16 -0
- package/dist/targets/codex-cliproxy-provider-config.d.ts.map +1 -0
- package/dist/targets/codex-cliproxy-provider-config.js +156 -0
- package/dist/targets/codex-cliproxy-provider-config.js.map +1 -0
- package/dist/targets/target-runtime-compatibility.js +1 -1
- package/dist/targets/target-runtime-compatibility.js.map +1 -1
- package/dist/ui/assets/{accounts-DhGQBR60.js → accounts-ODg4vRYO.js} +1 -1
- package/dist/ui/assets/{alert-dialog-OK7OmKDC.js → alert-dialog-DOkcpleU.js} +1 -1
- package/dist/ui/assets/{api-BUpGea2f.js → api-BT_0qMeR.js} +1 -1
- package/dist/ui/assets/{auth-section-B2NAmUkz.js → auth-section-CeSiLsXy.js} +1 -1
- package/dist/ui/assets/{backups-section-BKBS9Er1.js → backups-section-iVmpYvyb.js} +1 -1
- package/dist/ui/assets/{channels-DLuF45Gi.js → channels-zZKhs8WR.js} +1 -1
- package/dist/ui/assets/{checkbox-D6o6gikg.js → checkbox-C-I3i4Q4.js} +1 -1
- package/dist/ui/assets/{claude-extension-DGgDrDCs.js → claude-extension-BAoBvPvA.js} +1 -1
- package/dist/ui/assets/{cliproxy-Cxgxp4kg.js → cliproxy-IfhUOGN4.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-DIhU1U0a.js → cliproxy-ai-providers-DyDkgHp7.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-D2liVEy7.js → cliproxy-control-panel-CLsxYShw.js} +1 -1
- package/dist/ui/assets/{codex-BHasRc3P.js → codex-BUQaneEo.js} +5 -2
- package/dist/ui/assets/{confirm-dialog-VGknxJET.js → confirm-dialog-CC1GlhTa.js} +1 -1
- package/dist/ui/assets/{copilot-COk6htNP.js → copilot-BohFv0NM.js} +1 -1
- package/dist/ui/assets/{cursor-CEcSVzsK.js → cursor-C1IOfCtR.js} +1 -1
- package/dist/ui/assets/{droid-69pHafym.js → droid-CZbjGOaK.js} +1 -1
- package/dist/ui/assets/{globalenv-section-C4-uOp5W.js → globalenv-section-Bqi0fVGe.js} +1 -1
- package/dist/ui/assets/{health-Ds3eVp8s.js → health-CiA0mNhQ.js} +1 -1
- package/dist/ui/assets/{index-B-Xsn3pB.js → index-9xFrS28W.js} +1 -1
- package/dist/ui/assets/{index-BPvsFKho.js → index-BB0thfeB.js} +2 -2
- package/dist/ui/assets/{index-BHUMjLhA.js → index-BWwOcbRZ.js} +1 -1
- package/dist/ui/assets/{index-BGagjv0t.js → index-CdqlhnY2.js} +1 -1
- package/dist/ui/assets/{index-7MkuzUnB.js → index-Clx3EIEh.js} +1 -1
- package/dist/ui/assets/{index-DgnGGCqH.js → index-Cp5UeBTW.js} +1 -1
- package/dist/ui/assets/{index-BUKxCopE.js → index-sEOc1fZf.js} +1 -1
- package/dist/ui/assets/{logs-C8Yknto2.js → logs-WziPXnEI.js} +1 -1
- package/dist/ui/assets/{masked-input-DlLOwasV.js → masked-input-dygs7T1G.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-jPG1h4kb.js → proxy-status-widget-EU0qf73i.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-BELmHBxo.js → raw-json-settings-editor-panel-DV6AQbQf.js} +1 -1
- package/dist/ui/assets/{searchable-select-M153w1S5.js → searchable-select-ZehCX5PV.js} +1 -1
- package/dist/ui/assets/{separator-Cuagv-0z.js → separator-DJy3ImQI.js} +1 -1
- package/dist/ui/assets/{shared-CEP2o-Il.js → shared-CnZ8AED_.js} +1 -1
- package/dist/ui/assets/{table-DlRQZ7sG.js → table-CgmEQVhj.js} +1 -1
- package/dist/ui/assets/{updates-Dfn4zngu.js → updates-C24j_PKK.js} +1 -1
- package/dist/ui/assets/{use-accounts-CUzy8Zo8.js → use-accounts-BG5kGe9H.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/utils/claude-subcommand-detector.d.ts +2 -0
- package/dist/utils/claude-subcommand-detector.d.ts.map +1 -1
- package/dist/utils/claude-subcommand-detector.js +49 -16
- package/dist/utils/claude-subcommand-detector.js.map +1 -1
- package/dist/utils/shell-executor.d.ts.map +1 -1
- package/dist/utils/shell-executor.js +8 -5
- package/dist/utils/shell-executor.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,6 +32,9 @@ const signal_forwarder_1 = require("../utils/signal-forwarder");
|
|
|
32
32
|
const shell_executor_1 = require("../utils/shell-executor");
|
|
33
33
|
const codex_detector_1 = require("./codex-detector");
|
|
34
34
|
const logging_1 = require("../services/logging");
|
|
35
|
+
const auth_token_manager_1 = require("../cliproxy/auth/auth-token-manager");
|
|
36
|
+
const port_manager_1 = require("../cliproxy/config/port-manager");
|
|
37
|
+
const codex_cliproxy_provider_config_1 = require("./codex-cliproxy-provider-config");
|
|
35
38
|
const adapterLogger = (0, logging_1.createLogger)('targets:codex');
|
|
36
39
|
const CODEX_RUNTIME_PROVIDER_ID = 'ccs_runtime';
|
|
37
40
|
const CODEX_RUNTIME_ENV_KEY = 'CCS_CODEX_API_KEY';
|
|
@@ -157,12 +160,22 @@ class CodexAdapter {
|
|
|
157
160
|
constructor() {
|
|
158
161
|
this.type = 'codex';
|
|
159
162
|
this.displayName = 'Codex CLI';
|
|
163
|
+
this.ccsxpCliproxyEnvKey = codex_cliproxy_provider_config_1.CODEX_CLIPROXY_PROVIDER_ENV_KEY;
|
|
160
164
|
}
|
|
161
165
|
detectBinary() {
|
|
162
166
|
return (0, codex_detector_1.getCodexBinaryInfo)({ includeVersion: false, includeFeatures: false });
|
|
163
167
|
}
|
|
164
168
|
async prepareCredentials(_creds) {
|
|
165
|
-
|
|
169
|
+
if (!(0, codex_cliproxy_provider_config_1.isCcsxpCliproxyShortcut)()) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const providerRepair = await (0, codex_cliproxy_provider_config_1.ensureCodexCliproxyProviderConfig)((0, port_manager_1.resolveLifecyclePort)());
|
|
174
|
+
this.ccsxpCliproxyEnvKey = providerRepair.envKey;
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
throw new Error(`ccsxp could not repair the native Codex cliproxy provider: ${error.message}`);
|
|
178
|
+
}
|
|
166
179
|
}
|
|
167
180
|
buildArgs(_profile, userArgs, options) {
|
|
168
181
|
const profileType = options?.profileType || 'default';
|
|
@@ -215,7 +228,11 @@ class CodexAdapter {
|
|
|
215
228
|
const env = {
|
|
216
229
|
...(0, shell_executor_1.stripBrowserEnv)((0, shell_executor_1.stripCodexSessionEnv)((0, shell_executor_1.stripAnthropicEnv)(process.env))),
|
|
217
230
|
};
|
|
231
|
+
delete env[codex_cliproxy_provider_config_1.CCSXP_CLIPROXY_SHORTCUT_ENV];
|
|
218
232
|
delete env[CODEX_RUNTIME_ENV_KEY];
|
|
233
|
+
if (profileType === 'default' && (0, codex_cliproxy_provider_config_1.isCcsxpCliproxyShortcut)()) {
|
|
234
|
+
env[this.ccsxpCliproxyEnvKey || codex_cliproxy_provider_config_1.CODEX_CLIPROXY_PROVIDER_ENV_KEY] = (0, auth_token_manager_1.getEffectiveApiKey)();
|
|
235
|
+
}
|
|
219
236
|
if (profileType !== 'default') {
|
|
220
237
|
if (!creds.apiKey?.trim()) {
|
|
221
238
|
throw new Error('Codex target requires an API key for CCS-backed profile launches.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../src/targets/codex-adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAoD;AACpD,uCAAyB;AAEzB,sCAAuC;AACvC,8CAA8C;AAC9C,gEAAoE;AACpE,4DAMiC;AAOjC,qDAK0B;AAC1B,iDAAmD;AAEnD,MAAM,aAAa,GAAG,IAAA,sBAAY,EAAC,eAAe,CAAC,CAAC;AAEpD,MAAM,yBAAyB,GAAG,aAAa,CAAC;AAChD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAClD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACtF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtE,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAmB;IAClD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,I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SAAS,EAAE,CAAC,CAAC;gBAC/D,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAClE,CAAC;iBAAM,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACjC,IAAI,kBAAkB,EAAE,CAAC;oBACvB,OAAO,CAAC,KAAK,CAAC,yEAAyE,CAAC,CAAC;gBAC3F,CAAC;qBAAM,IAAI,UAAU,EAAE,CAAC;oBACtB,OAAO,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;gBACjF,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,KAAK,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;gBACzD,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,kCAAkC,SAAS,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YAChF,CAAC;YACD,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB,CAAC,WAAwB;QAC1C,iFAAiF;QACjF,mFAAmF;QACnF,OAAO,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,UAAU,CAAC;IACjE,CAAC;CACF;AAxND,oCAwNC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="bun-types" />
|
|
3
|
+
export declare const CCSXP_CLIPROXY_SHORTCUT_ENV = "CCSXP_CLIPROXY_SHORTCUT";
|
|
4
|
+
export declare const CODEX_CLIPROXY_PROVIDER_ID = "cliproxy";
|
|
5
|
+
export declare const CODEX_CLIPROXY_PROVIDER_ENV_KEY = "CLIPROXY_API_KEY";
|
|
6
|
+
export declare const CODEX_CLIPROXY_PROVIDER_NAME = "CLIProxy Codex";
|
|
7
|
+
export interface CodexCliproxyProviderRepairResult {
|
|
8
|
+
changed: boolean;
|
|
9
|
+
configPath: string;
|
|
10
|
+
displayPath: string;
|
|
11
|
+
envKey: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildCodexCliproxyProviderBaseUrl(port: number): string;
|
|
14
|
+
export declare function isCcsxpCliproxyShortcut(env?: NodeJS.ProcessEnv): boolean;
|
|
15
|
+
export declare function ensureCodexCliproxyProviderConfig(port: number, env?: NodeJS.ProcessEnv): Promise<CodexCliproxyProviderRepairResult>;
|
|
16
|
+
//# sourceMappingURL=codex-cliproxy-provider-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-cliproxy-provider-config.d.ts","sourceRoot":"","sources":["../../src/targets/codex-cliproxy-provider-config.ts"],"names":[],"mappings":";;AASA,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AACrE,eAAO,MAAM,0BAA0B,aAAa,CAAC;AACrD,eAAO,MAAM,+BAA+B,qBAAqB,CAAC;AAClE,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAE7D,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAgBD,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAErF;AA0ED,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,iCAAiC,CAAC,CAuD5C"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ensureCodexCliproxyProviderConfig = exports.isCcsxpCliproxyShortcut = exports.buildCodexCliproxyProviderBaseUrl = exports.CODEX_CLIPROXY_PROVIDER_NAME = exports.CODEX_CLIPROXY_PROVIDER_ENV_KEY = exports.CODEX_CLIPROXY_PROVIDER_ID = exports.CCSXP_CLIPROXY_SHORTCUT_ENV = void 0;
|
|
27
|
+
const os = __importStar(require("os"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const helpers_1 = require("../utils/helpers");
|
|
30
|
+
const compatible_cli_toml_file_service_1 = require("../web-server/services/compatible-cli-toml-file-service");
|
|
31
|
+
exports.CCSXP_CLIPROXY_SHORTCUT_ENV = 'CCSXP_CLIPROXY_SHORTCUT';
|
|
32
|
+
exports.CODEX_CLIPROXY_PROVIDER_ID = 'cliproxy';
|
|
33
|
+
exports.CODEX_CLIPROXY_PROVIDER_ENV_KEY = 'CLIPROXY_API_KEY';
|
|
34
|
+
exports.CODEX_CLIPROXY_PROVIDER_NAME = 'CLIProxy Codex';
|
|
35
|
+
function resolveCodexConfigPath(env = process.env) {
|
|
36
|
+
const baseDir = path.resolve(env.CODEX_HOME ? (0, helpers_1.expandPath)(env.CODEX_HOME) : path.join(os.homedir(), '.codex'));
|
|
37
|
+
const displayBase = env.CODEX_HOME ? '$CODEX_HOME' : '~/.codex';
|
|
38
|
+
return {
|
|
39
|
+
configPath: path.join(baseDir, 'config.toml'),
|
|
40
|
+
displayPath: `${displayBase}/config.toml`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function buildCodexCliproxyProviderBaseUrl(port) {
|
|
44
|
+
return `http://127.0.0.1:${port}/api/provider/codex`;
|
|
45
|
+
}
|
|
46
|
+
exports.buildCodexCliproxyProviderBaseUrl = buildCodexCliproxyProviderBaseUrl;
|
|
47
|
+
function isCcsxpCliproxyShortcut(env = process.env) {
|
|
48
|
+
return env[exports.CCSXP_CLIPROXY_SHORTCUT_ENV] === '1';
|
|
49
|
+
}
|
|
50
|
+
exports.isCcsxpCliproxyShortcut = isCcsxpCliproxyShortcut;
|
|
51
|
+
function asObject(value) {
|
|
52
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
53
|
+
? value
|
|
54
|
+
: null;
|
|
55
|
+
}
|
|
56
|
+
function normalizeLocalProviderUrl(value) {
|
|
57
|
+
if (typeof value !== 'string')
|
|
58
|
+
return null;
|
|
59
|
+
const trimmed = value.trim();
|
|
60
|
+
try {
|
|
61
|
+
const url = new URL(trimmed);
|
|
62
|
+
if ((url.hostname === 'localhost' || url.hostname === '127.0.0.1') &&
|
|
63
|
+
url.pathname === '/api/provider/codex') {
|
|
64
|
+
url.hostname = '127.0.0.1';
|
|
65
|
+
return url.toString().replace(/\/$/, '');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function resolveProviderEnvKey(provider) {
|
|
74
|
+
const envKey = provider?.env_key;
|
|
75
|
+
if (typeof envKey === 'string' && envKey.trim()) {
|
|
76
|
+
return envKey.trim();
|
|
77
|
+
}
|
|
78
|
+
return exports.CODEX_CLIPROXY_PROVIDER_ENV_KEY;
|
|
79
|
+
}
|
|
80
|
+
function isProviderReady(provider, expectedBaseUrl, envKey) {
|
|
81
|
+
return (provider.name === exports.CODEX_CLIPROXY_PROVIDER_NAME &&
|
|
82
|
+
normalizeLocalProviderUrl(provider.base_url) === expectedBaseUrl &&
|
|
83
|
+
provider.env_key === envKey &&
|
|
84
|
+
provider.wire_api === 'responses' &&
|
|
85
|
+
provider.requires_openai_auth === false &&
|
|
86
|
+
provider.supports_websockets === false);
|
|
87
|
+
}
|
|
88
|
+
function buildProviderConfig(baseUrl, envKey) {
|
|
89
|
+
return {
|
|
90
|
+
name: exports.CODEX_CLIPROXY_PROVIDER_NAME,
|
|
91
|
+
base_url: baseUrl,
|
|
92
|
+
env_key: envKey,
|
|
93
|
+
wire_api: 'responses',
|
|
94
|
+
requires_openai_auth: false,
|
|
95
|
+
supports_websockets: false,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function buildProviderBlock(baseUrl) {
|
|
99
|
+
return (0, compatible_cli_toml_file_service_1.stringifyTomlObject)({
|
|
100
|
+
model_providers: {
|
|
101
|
+
[exports.CODEX_CLIPROXY_PROVIDER_ID]: buildProviderConfig(baseUrl, exports.CODEX_CLIPROXY_PROVIDER_ENV_KEY),
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function appendProviderBlock(rawText, baseUrl) {
|
|
106
|
+
const prefix = rawText.trimEnd();
|
|
107
|
+
const providerBlock = buildProviderBlock(baseUrl).trimEnd();
|
|
108
|
+
return prefix ? `${prefix}\n\n${providerBlock}\n` : `${providerBlock}\n`;
|
|
109
|
+
}
|
|
110
|
+
async function ensureCodexCliproxyProviderConfig(port, env = process.env) {
|
|
111
|
+
const { configPath, displayPath } = resolveCodexConfigPath(env);
|
|
112
|
+
const fileProbe = await (0, compatible_cli_toml_file_service_1.probeTomlObjectFile)(configPath, 'Codex user config', displayPath);
|
|
113
|
+
if (fileProbe.diagnostics.readError) {
|
|
114
|
+
throw new Error(`Cannot repair ${displayPath}: ${fileProbe.diagnostics.readError}`);
|
|
115
|
+
}
|
|
116
|
+
if (fileProbe.diagnostics.parseError) {
|
|
117
|
+
throw new Error(`Cannot repair ${displayPath}: ${fileProbe.diagnostics.parseError}`);
|
|
118
|
+
}
|
|
119
|
+
const config = fileProbe.config ?? {};
|
|
120
|
+
const modelProvidersValue = config.model_providers;
|
|
121
|
+
const providers = asObject(modelProvidersValue);
|
|
122
|
+
const expectedBaseUrl = buildCodexCliproxyProviderBaseUrl(port);
|
|
123
|
+
if (modelProvidersValue !== undefined && !providers) {
|
|
124
|
+
throw new Error(`Cannot repair ${displayPath}: [model_providers] must be a table.`);
|
|
125
|
+
}
|
|
126
|
+
if (!providers || !Object.prototype.hasOwnProperty.call(providers, exports.CODEX_CLIPROXY_PROVIDER_ID)) {
|
|
127
|
+
await (0, compatible_cli_toml_file_service_1.writeTomlFileAtomic)({
|
|
128
|
+
filePath: configPath,
|
|
129
|
+
rawText: appendProviderBlock(fileProbe.rawText, expectedBaseUrl),
|
|
130
|
+
expectedMtime: fileProbe.diagnostics.mtimeMs ?? undefined,
|
|
131
|
+
fileLabel: 'config.toml',
|
|
132
|
+
});
|
|
133
|
+
return { changed: true, configPath, displayPath, envKey: exports.CODEX_CLIPROXY_PROVIDER_ENV_KEY };
|
|
134
|
+
}
|
|
135
|
+
const currentProvider = asObject(providers[exports.CODEX_CLIPROXY_PROVIDER_ID]);
|
|
136
|
+
if (!currentProvider) {
|
|
137
|
+
throw new Error(`Cannot repair ${displayPath}: [model_providers.${exports.CODEX_CLIPROXY_PROVIDER_ID}] must be a table.`);
|
|
138
|
+
}
|
|
139
|
+
const envKey = resolveProviderEnvKey(currentProvider);
|
|
140
|
+
if (isProviderReady(currentProvider, expectedBaseUrl, envKey)) {
|
|
141
|
+
return { changed: false, configPath, displayPath, envKey };
|
|
142
|
+
}
|
|
143
|
+
providers[exports.CODEX_CLIPROXY_PROVIDER_ID] = {
|
|
144
|
+
...currentProvider,
|
|
145
|
+
...buildProviderConfig(expectedBaseUrl, envKey),
|
|
146
|
+
};
|
|
147
|
+
await (0, compatible_cli_toml_file_service_1.writeTomlFileAtomic)({
|
|
148
|
+
filePath: configPath,
|
|
149
|
+
rawText: (0, compatible_cli_toml_file_service_1.stringifyTomlObject)(config),
|
|
150
|
+
expectedMtime: fileProbe.diagnostics.mtimeMs ?? undefined,
|
|
151
|
+
fileLabel: 'config.toml',
|
|
152
|
+
});
|
|
153
|
+
return { changed: true, configPath, displayPath, envKey };
|
|
154
|
+
}
|
|
155
|
+
exports.ensureCodexCliproxyProviderConfig = ensureCodexCliproxyProviderConfig;
|
|
156
|
+
//# sourceMappingURL=codex-cliproxy-provider-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-cliproxy-provider-config.js","sourceRoot":"","sources":["../../src/targets/codex-cliproxy-provider-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,8CAA8C;AAC9C,8GAIiE;AAEpD,QAAA,2BAA2B,GAAG,yBAAyB,CAAC;AACxD,QAAA,0BAA0B,GAAG,UAAU,CAAC;AACxC,QAAA,+BAA+B,GAAG,kBAAkB,CAAC;AACrD,QAAA,4BAA4B,GAAG,gBAAgB,CAAC;AAS7D,SAAS,sBAAsB,CAAC,MAAyB,OAAO,CAAC,GAAG;IAIlE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAC1B,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAA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DC"}
|
|
@@ -21,7 +21,7 @@ function evaluateTargetRuntimeCompatibility(input) {
|
|
|
21
21
|
return { supported: true };
|
|
22
22
|
}
|
|
23
23
|
if (input.profileType === 'account') {
|
|
24
|
-
return unsupported('Codex CLI does not support Claude account-based profiles.', '
|
|
24
|
+
return unsupported('Codex CLI does not support Claude account-based profiles.', 'Native Codex: ccs --target codex. CLIProxy Codex pool: ccs codex --target codex or ccsxp. Manage pool/routing with: ccs codex --auth and ccs cliproxy routing.');
|
|
25
25
|
}
|
|
26
26
|
if (input.profileType === 'copilot') {
|
|
27
27
|
return unsupported('Codex CLI does not support Copilot profiles.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target-runtime-compatibility.js","sourceRoot":"","sources":["../../src/targets/target-runtime-compatibility.ts"],"names":[],"mappings":";;;AAkBA,SAAS,WAAW,CAAC,MAAc,EAAE,UAAmB;IACtD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAClD,CAAC;AAED,SAAgB,kCAAkC,CAChD,KAAsC;IAEtC,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,WAAW,CAChB,+DAA+D,EAC/D,2DAA2D,CAC5D,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,WAAW,CAAC,kDAAkD,CAAC,CAAC;QACzE,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,WAAW,CAAC,6DAA6D,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,WAAW,CAChB,2DAA2D,EAC3D,
|
|
1
|
+
{"version":3,"file":"target-runtime-compatibility.js","sourceRoot":"","sources":["../../src/targets/target-runtime-compatibility.ts"],"names":[],"mappings":";;;AAkBA,SAAS,WAAW,CAAC,MAAc,EAAE,UAAmB;IACtD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAClD,CAAC;AAED,SAAgB,kCAAkC,CAChD,KAAsC;IAEtC,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,WAAW,CAChB,+DAA+D,EAC/D,2DAA2D,CAC5D,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,WAAW,CAAC,kDAAkD,CAAC,CAAC;QACzE,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,WAAW,CAAC,6DAA6D,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,WAAW,CAChB,2DAA2D,EAC3D,gKAAgK,CACjK,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC,8CAA8C,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,WAAW,CAAC,yDAAyD,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACrC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,WAAW,CAChB,mEAAmE,EACnE,mFAAmF,CACpF,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,CAAC,gBAAgB,KAAK,OAAO,EAAE,CAAC;YACvC,OAAO,WAAW,CAChB,8EAA8E,KAAK,CAAC,gBAAgB,IAAI,SAAS,IAAI,EACrH,oFAAoF,CACrF,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACrC,IAAI,KAAK,CAAC,sBAAsB,KAAK,OAAO,EAAE,CAAC;YAC7C,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC7B,CAAC;QACD,IAAI,KAAK,CAAC,sBAAsB,EAAE,CAAC;YACjC,OAAO,WAAW,CAChB,qFAAqF,KAAK,CAAC,sBAAsB,IAAI,EACrH,sEAAsE,CACvE,CAAC;QACJ,CAAC;QACD,OAAO,WAAW,CAChB,+FAA+F,EAC/F,oHAAoH,CACrH,CAAC;IACJ,CAAC;IAED,OAAO,WAAW,CAAC,wCAAwC,CAAC,CAAC;AAC/D,CAAC;AA3ED,gFA2EC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as k,e as Ae}from"./react-vendor-Bjx91N7w.js";import{e as Pe,f as se,g as De}from"./tanstack-bhJxV1h8.js";import{T as Te,a as Se,b as te,c as Re,d as _e,e as Oe}from"./table-DlRQZ7sG.js";import{a as R,ah as q,ai as W,aj as Q,ak as J,al as Y,L as S,I as E,x as P,aD as pe,d as p,r as Ge,s as Me,t as ze,v as Le,w as ae,bi as ne,bj as re,bk as ce,B as C,c as $e,C as O,j as M,k as z,_ as F,b as G,e as Ie,f as He,g as Fe,n as Be}from"./index-BPvsFKho.js";import{A as Ue,a as Ke,b as Ee,c as Ze,d as Ve,e as Xe,f as qe,g as We}from"./alert-dialog-OK7OmKDC.js";import{u as fe,a as Qe,b as Je,c as Ye,d as es,e as ss,f as ts}from"./use-accounts-CUzy8Zo8.js";import{b1 as Z,b2 as L,b3 as ee,aH as be,_ as je,b4 as Ne,ai as ye,w as as,b5 as ns,b6 as rs,m as V,at as cs,Q as os,b7 as ds,a7 as ls,$ as ve,a6 as B,T as X,x as is,o as oe,U as xs,a9 as de,Z as le}from"./icons-DzKUh8vG.js";import{C as ie}from"./checkbox-D6o6gikg.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const xe=64,us=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ms({account:a,groupSummaries:x,plainCcsLane:t,onClose:m}){const{t:s}=R(),u=fe(),[r,l]=k.useState(a.context_mode==="shared"?"shared":"isolated"),[g,b]=k.useState(a.context_group||"default"),[h,v]=k.useState(a.continuity_mode==="deeper"?"deeper":"standard"),d=k.useMemo(()=>g.trim().toLowerCase().replace(/\s+/g,"-"),[g]),c=k.useMemo(()=>x.find(f=>f.group===d),[x,d]),N=d.length>0&&d.length<=xe&&us.test(d),j=r==="isolated"||N,y=r==="shared"?Math.max((c?.sharedCount??0)-(a.context_mode==="shared"&&a.context_group===d?1:0),0):0,n=r==="shared"?Math.max((c?.deeperCount??0)-(a.continuity_mode==="deeper"&&a.context_group===d?1:0),0):0,o=t?.account_name===a.name,i=!!t&&!o,w=`ccs auth default ${a.name}`,D=`ccs auth backup ${a.name}`,A=(f,I,_,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(f.key))return;f.preventDefault();const ke=_.indexOf(I),we=f.key==="ArrowLeft"||f.key==="ArrowUp"?-1:1,Ce=(ke+we+_.length)%_.length;H(_[Ce])},$=t?t.kind==="native"?s("continuityOverview.lane.native"):t.kind==="account-default"?s("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?s("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?s("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",T=()=>{j&&u.mutate({name:a.name,context_mode:r,context_group:r==="shared"?d:void 0,continuity_mode:r==="shared"?h:void 0},{onSuccess:()=>{m()}})},U=f=>{f||m()};return e.jsx(q,{open:!0,onOpenChange:U,children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:s("editAccountContext.title")}),e.jsx(Y,{children:s("editAccountContext.description",{name:a.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.syncMode")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="isolated",tabIndex:r==="isolated"?0:-1,onClick:()=>l("isolated"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="isolated"?"bg-background text-blue-600 dark:text-blue-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="shared",tabIndex:r==="shared"?0:-1,onClick:()=>l("shared"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="shared"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(r==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"context-group",children:s("editAccountContext.historySyncGroup")}),e.jsx(E,{id:"context-group",value:g,onChange:f=>b(f.target.value),placeholder:s("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.groupHint",{max:xe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:s("editAccountContext.invalidGroup")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.continuityDepth")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.continuityDepth"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="standard",tabIndex:h==="standard"?0:-1,onClick:()=>v("standard"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="standard"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.standardOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="deeper",tabIndex:h==="deeper"?0:-1,onClick:()=>v("deeper"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="deeper"?"bg-background text-indigo-600 dark:text-indigo-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(h==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.credentialsIsolated")}),i&&e.jsx("div",{className:"rounded-[14px] border border-amber-200 bg-amber-50/50 p-4 text-xs shadow-sm dark:border-amber-900/40 dark:bg-amber-900/10",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s("continuityOverview.plainLaneDescription",{lane:$||"plain ccs",name:a.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:D}),e.jsx(P,{value:D,size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:w}),e.jsx(P,{value:w,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${r==="isolated"?"bg-blue-50/50 border-blue-200 dark:bg-blue-900/10 dark:border-blue-800/40":"bg-muted/40 border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[r==="isolated"?e.jsx(be,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}):e.jsx(je,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1.5 flex-1 text-muted-foreground leading-relaxed",children:[r==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:s("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:s("editAccountContext.sameGroupRule",{group:d})})," ",y>0?s("editAccountContext.sameGroupPeerCount",{count:y}):s("editAccountContext.noSameGroupPeer")]}),h==="deeper"&&e.jsx("p",{children:n>0?s("editAccountContext.deeperReady",{count:n}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:s("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${r==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:s("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:m,disabled:u.isPending,children:s("editAccountContext.cancel")}),e.jsx(p,{onClick:T,disabled:!j||u.isPending,children:u.isPending?s("editAccountContext.saving"):s("editAccountContext.save")})]})]})})}function hs({account:a,onClose:x}){const{t}=R(),m=Qe(),[s,u]=k.useState(a.shared_resource_mode||"shared"),r=()=>{m.mutate({name:a.name,shared_resource_mode:s},{onSuccess:()=>{x()}})};return e.jsx(q,{open:!0,onOpenChange:x,children:e.jsxs(W,{className:"sm:max-w-[425px]",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("editAccountSharedResources.title")}),e.jsx(Y,{children:t("editAccountSharedResources.description",{name:a.name})})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"resource-mode",children:t("editAccountSharedResources.resourceMode")}),e.jsxs(Ge,{value:s,onValueChange:l=>u(l),children:[e.jsx(Me,{id:"resource-mode",className:"w-full",children:e.jsx(ze,{placeholder:t("editAccountSharedResources.selectResourceMode")})}),e.jsxs(Le,{children:[e.jsx(ae,{value:"shared",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.sharedOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.sharedHint")})]})}),e.jsx(ae,{value:"profile-local",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.profileLocalHint")})]})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t("editAccountSharedResources.implicationTitle")}),s==="shared"?e.jsxs(ne,{className:"border-emerald-500/20 bg-emerald-500/5",children:[e.jsx(Ne,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),e.jsx(re,{className:"text-xs font-semibold text-emerald-800 dark:text-emerald-300",children:t("editAccountSharedResources.sharedOption")}),e.jsx(ce,{className:"text-xs text-emerald-700/80 dark:text-emerald-400/80",children:t("editAccountSharedResources.sharedImplication")})]}):e.jsxs(ne,{className:"border-amber-500/20 bg-amber-500/5",children:[e.jsx(ye,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),e.jsx(re,{className:"text-xs font-semibold text-amber-800 dark:text-amber-300",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx(ce,{className:"text-xs text-amber-700/80 dark:text-amber-400/80",children:t("editAccountSharedResources.profileLocalImplication")})]})]}),a.shared_resource_inferred&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted/50 p-3",children:[e.jsx(as,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("accountsTable.legacyReview")})]})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:x,children:t("editAccountSharedResources.cancel")}),e.jsx(p,{onClick:r,disabled:m.isPending,children:m.isPending?t("editAccountSharedResources.saving"):t("editAccountSharedResources.save")})]})]})})}function ue({data:a,defaultAccount:x,groupSummaries:t,plainCcsLane:m}){const{t:s}=R(),u=Je(),r=Ye(),l=es(),g=fe(),[b,h]=k.useState(null),[v,d]=k.useState(null),[c,N]=k.useState(null),j=[{accessorKey:"name",header:s("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===x&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:s("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:s("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:s("accountsTable.created"),size:150,cell:({row:n})=>{const o=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{accessorKey:"last_used",header:s("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{id:"context",header:s("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const i=n.original.context_group||"default",w=n.original.continuity_mode==="deeper";return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(C,{variant:"outline",className:`font-mono text-[10px] uppercase px-1.5 py-0 border ${w?"text-indigo-700 border-indigo-300/60 bg-indigo-50/50 dark:text-indigo-300 dark:border-indigo-900/40 dark:bg-indigo-900/20":"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20"}`,children:s(w?"accountsTable.badges.deeper":"accountsTable.badges.shared")}),e.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:i})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:n.original.sameGroupPeerCount>0?s("accountsTable.sameGroupPeerCount",{count:n.original.sameGroupPeerCount}):s("accountsTable.noSameGroupPeer")})]})}return n.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:"outline",className:"text-amber-700 border-amber-300/60 bg-amber-50/50 dark:text-amber-400 dark:border-amber-900/40 dark:bg-amber-900/20 font-mono text-[10px] uppercase px-1.5 py-0",children:s("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(C,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:s("accountsTable.badges.isolated")})})}},{id:"resources",header:s("accountsTable.sharedResources"),size:150,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=n.original.shared_resource_mode||"shared",i=n.original.shared_resource_inferred;return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:o==="shared"?"outline":"secondary",className:$e("font-mono text-[10px] uppercase px-1.5 py-0",o==="shared"?"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20":"text-muted-foreground bg-muted/60 border-transparent shadow-none"),children:s(o==="shared"?"accountsTable.resourcesShared":"accountsTable.resourcesProfileLocal")}),i&&e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]})}},{id:"actions",header:s("accountsTable.actions"),size:220,cell:({row:n})=>{const o=n.original.name===x,i=u.isPending||r.isPending||g.isPending,w=n.original.type==="cliproxy",D=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>d(n.original),title:s("accountsTable.syncTitle"),children:[e.jsx(ns,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sync")]}),!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>N(n.original),title:s("accountsTable.resourcesTitle"),children:[e.jsx(Ne,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sharedResources")]}),!w&&D&&e.jsxs(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:i,onClick:()=>g.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:s("accountsTable.confirmLegacyTitle"),children:[e.jsx(rs,{className:"w-3 h-3 mr-1"}),s("accountsTable.confirm")]}),e.jsxs(p,{variant:o?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:o||i,onClick:()=>u.mutate(n.original.name),children:[e.jsx(V,{className:`w-3 h-3 mr-1 ${o?"opacity-50":""}`}),s(o?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:o||i,onClick:()=>h(n.original.name),title:s(o?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(cs,{className:"w-4 h-4"})})]})}}],y=Pe({data:a,columns:j,getCoreRowModel:De()});return a.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Te,{children:[e.jsx(Se,{children:y.getHeaderGroups().map(n=>e.jsx(te,{children:n.headers.map(o=>{const i={name:"w-[180px]",type:"w-[80px]",created:"w-[120px]",last_used:"w-[120px]",context:"w-[150px]",resources:"w-[120px]",actions:"w-[320px]"}[o.id]||"w-auto";return e.jsx(Re,{className:i,children:o.isPlaceholder?null:se(o.column.columnDef.header,o.getContext())},o.id)})},n.id))}),e.jsx(_e,{children:y.getRowModel().rows.map(n=>e.jsx(te,{children:n.getVisibleCells().map(o=>e.jsx(Oe,{children:se(o.column.columnDef.cell,o.getContext())},o.id))},n.id))})]})}),x&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.isPending,children:[e.jsx(os,{className:"w-4 h-4 mr-2"}),s("accountsTable.resetToDefault")]})})]}),v&&e.jsx(ms,{account:v,groupSummaries:t,plainCcsLane:m,onClose:()=>d(null)}),c&&e.jsx(hs,{account:c,onClose:()=>N(null)}),e.jsx(Ue,{open:!!b,onOpenChange:n=>!n&&h(null),children:e.jsxs(Ke,{children:[e.jsxs(Ee,{children:[e.jsx(Ze,{children:s("accountsTable.deleteDialogTitle")}),e.jsx(Ve,{children:s("accountsTable.deleteDialogDesc",{name:b??""})})]}),e.jsxs(Xe,{children:[e.jsx(qe,{children:s("accountsTable.cancel")}),e.jsx(We,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{b&&(r.mutate(b),h(null))},children:s("accountsTable.delete")})]})]})})]})}function me({totalAccounts:a,isolatedCount:x,sharedPeerGroups:t,deeperReadyGroups:m}){const{t:s}=R(),u=m[0]||t[0]||"daily",r=a<2?"empty":m.length>0?"deeper":t.length>0?"shared":a>=2&&x===a?"isolated":a===0?"empty":"mixed",l=`ccs auth create work2 --share-context --context-group ${u} --deeper-continuity`;return e.jsxs(O,{className:"overflow-hidden",children:[e.jsx(M,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(z,{className:"text-lg",children:s("accountRouteGuide.title")}),e.jsx(F,{children:s("accountRouteGuide.description")})]}),e.jsx(C,{variant:r==="deeper"?"default":"secondary",children:s(`accountRouteGuide.status.${r}`)})]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("section",{className:"rounded-md border bg-blue-50/50 p-3 text-sm dark:bg-blue-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ye,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),s("accountRouteGuide.cards.isolated.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.isolated.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-emerald-50/50 p-3 text-sm dark:bg-emerald-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ds,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),s("accountRouteGuide.cards.select.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.select.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-sky-50/50 p-3 text-sm dark:bg-sky-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ls,{className:"h-4 w-4 text-sky-600 dark:text-sky-400"}),s("accountRouteGuide.cards.settings.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.settings.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-indigo-50/50 p-3 text-sm dark:bg-indigo-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(L,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400"}),s("accountRouteGuide.cards.sync.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.sync.desc")})]})]}),e.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.isolated")]}),["ccs auth create work","ccs auth create personal","ccs work","ccs personal"].map(g=>e.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:g}),e.jsx(P,{value:g,size:"icon"})]},g))]}),e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.sync")]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:l}),e.jsx(P,{value:l,size:"icon"})]}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.commands.syncDesc",{group:u})})]})]})]})]})}const K=({titleKey:a,descKey:x})=>{const{t}=R();return e.jsxs(Ie,{children:[e.jsx(He,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon","aria-label":t(a),className:"h-5 w-5 rounded-full hover:bg-muted text-muted-foreground/70 transition-colors",children:e.jsx(je,{className:"h-3 w-3"})})}),e.jsxs(Fe,{className:"w-72 p-4 rounded-xl shadow-lg border-border/50 text-sm",side:"top",align:"center",children:[e.jsx("p",{className:"font-semibold tracking-tight",children:t(a)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(x)})]})]})};function he({totalAccounts:a,primaryAccountName:x,isolatedCount:t,sharedStandardCount:m,deeperSharedCount:s,sharedAloneCount:u,sharedPeerAccountCount:r,deeperReadyAccountCount:l,sharedPeerGroups:g,deeperReadyGroups:b,legacyTargetCount:h,cliproxyCount:v,plainCcsLane:d}){const{t:c}=R(),N=d?d.kind==="native"?c("continuityOverview.lane.native"):d.kind==="account-default"?c("continuityOverview.lane.accountDefault",{name:d.account_name||""}):d.kind==="account-inherited"?c("continuityOverview.lane.accountInherited",{name:d.account_name||""}):d.kind==="profile-default"?c("continuityOverview.lane.profileDefault",{name:d.profile_name||"default"}):d.label:"",j=a<2?"single":g.length===0?t===a?"isolated":"shared-alone":b.length===0?"shared-standard":t>0||u>0||l<r||b.length<g.length?"partial":"ready",y=b[0]||g[0]||"default",n=b.length>0&&(t>0||m>0||g.length>b.length),i={ready:e.jsx(is,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(L,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"}),single:e.jsx(be,{className:"h-6 w-6 text-stone-400"}),isolated:e.jsx(Z,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),"shared-alone":e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),partial:e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}[j],w=!!x&&d?.account_name===x,D=a>0&&!!d&&(!x||!w),A=a>1&&j!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{className:"flex flex-col justify-between overflow-hidden relative group p-0 border-border bg-card shadow-sm hover:shadow-md transition-shadow duration-300",children:e.jsxs(G,{className:"p-6 flex flex-col h-full bg-gradient-to-br from-card to-muted/20 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsx("div",{className:"rounded-2xl bg-background p-3 shadow-sm ring-1 ring-border/50 self-start shrink-0",children:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:c(`continuityReadiness.messages.${j}.title`,{group:y})}),e.jsx(C,{variant:j==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:c(`continuityReadiness.state.${j}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:c(`continuityReadiness.messages.${j}.description`,{group:y,count:u})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[v>0&&e.jsx(C,{variant:"outline",className:"text-blue-700 bg-blue-50/50 border-blue-200/60 dark:border-blue-900/40 dark:bg-blue-900/20 dark:text-blue-300",children:c("historySyncLearningMap.cliproxyManaged",{count:v})}),h>0&&e.jsx(C,{variant:"outline",className:"text-amber-700 bg-amber-50/50 border-amber-200/60 dark:border-amber-900/40 dark:bg-amber-900/20 dark:text-amber-300",children:c("historySyncLearningMap.legacyConfirmation",{count:h})}),g.length>0&&b.length===0&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.recommendBadge",{group:y})}),n&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.partialBadge",{group:y})})]})]})}),(D||A)&&e.jsx(O,{className:"border-dashed",children:e.jsxs(G,{className:"p-5 space-y-4",children:[D&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c("continuityOverview.plainLaneDescription",{lane:N||"plain ccs"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),x?e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:`ccs auth default ${x}`}),e.jsx(P,{value:`ccs auth default ${x}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:c("continuityOverview.setDefaultHint")})]})]}),A&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:c("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:c("continuityReadiness.steps.sameGroup",{group:y})}),e.jsx("li",{children:c("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:c("continuityReadiness.steps.resumeOriginal")})]})]})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-3",children:[e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-blue-300/40 bg-blue-50/50 dark:border-blue-900/30 dark:bg-blue-900/10 shadow-sm transition-colors hover:bg-blue-100/40 dark:hover:bg-blue-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4 text-blue-700/80 dark:text-blue-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-900 dark:text-blue-200",children:c("historySyncLearningMap.isolated")}),e.jsx(K,{titleKey:"accountsPage.isolated",descKey:"accountsPage.isolatedDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-blue-900 dark:text-blue-200",children:t})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-emerald-300/40 bg-emerald-50/50 dark:border-emerald-900/30 dark:bg-emerald-900/10 shadow-sm transition-colors hover:bg-emerald-100/40 dark:hover:bg-emerald-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-emerald-700/80 dark:text-emerald-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-900 dark:text-emerald-200",children:c("historySyncLearningMap.shared")}),e.jsx(K,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:m})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-indigo-300/40 bg-indigo-50/50 dark:border-indigo-900/30 dark:bg-indigo-900/10 shadow-sm transition-colors hover:bg-indigo-100/40 dark:hover:bg-indigo-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-4 w-4 text-indigo-700/80 dark:text-indigo-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-indigo-900 dark:text-indigo-200",children:c("historySyncLearningMap.deeper")}),e.jsx(K,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:s})]})]})]})}const ge=64;function gs({open:a,onClose:x}){const{t}=R(),[m,s]=k.useState(""),[u,r]=k.useState(!1),[l,g]=k.useState(""),[b,h]=k.useState(!1),[v,d]=k.useState(!1),c=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(m),N=l.trim().toLowerCase().replace(/\s+/g,"-"),j=N.length===0||N.length<=ge&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),y=m&&c?[`ccs auth create ${m}`,u?N.length>0?`--context-group ${N}`:"--share-context":"",u&&b?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),n=async()=>{!c||u&&!j||(await navigator.clipboard.writeText(y),d(!0),setTimeout(()=>d(!1),2e3))},o=()=>{s(""),r(!1),g(""),h(!1),d(!1),x()};return e.jsx(q,{open:a,onOpenChange:i=>!i&&o(),children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("createAuthProfileDialog.title")}),e.jsx(Y,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(E,{id:"profile-name",value:m,onChange:i=>s(i.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),m&&!c&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{id:"share-context",checked:u,onCheckedChange:i=>r(i===!0)}),e.jsx(S,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),u&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(S,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(E,{id:"context-group",value:l,onChange:i=>g(i.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ie,{id:"deeper-continuity",checked:b,onCheckedChange:i=>h(i===!0)}),e.jsx(S,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),l.trim().length>0&&!j&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ge})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(ve,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:y}),e.jsx(p,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:n,disabled:!c||u&&!j,children:v?e.jsx(V,{className:"w-4 h-4 text-green-500"}):e.jsx(oe,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p,{variant:"ghost",onClick:o,children:t("createAuthProfileDialog.close")}),e.jsx(p,{onClick:n,disabled:!c||u&&!j,children:v?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function Ts(){const{t:a}=R(),x=Ae(),{data:t,isLoading:m}=ss(),s=ts(),[u,r]=k.useState(!1),l=t?.accounts||[],g=t?.cliproxyCount||0,b=t?.legacyContextCount||0,h=t?.legacyContinuityCount||0,v=t?.sharedCount||0,d=t?.sharedStandardCount||0,c=t?.deeperSharedCount||0,N=t?.isolatedCount||0,j=t?.sharedAloneCount||0,y=t?.sharedPeerAccountCount||0,n=t?.deeperReadyAccountCount||0,o=t?.sharedPeerGroups||[],i=t?.deeperReadyGroups||[],w=t?.sharedGroups||[],D=t?.groupSummaries||[],A=t?.plainCcsLane||null,$=l.filter(H=>H.context_inferred||H.continuity_inferred),T=$.length,U=T>0,f=()=>x("/cliproxy?provider=claude"),I=()=>x("/cliproxy?provider=claude&action=auth"),_=()=>s.mutate($);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:a("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.manageSuffix")]})]}),e.jsx(Be,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.primaryActions")}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:I,children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),a("accountsPage.authClaudeInPool")]}),e.jsxs(p,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:f,children:[a("accountsPage.openClaudePoolSettings"),e.jsx(B,{className:"w-4 h-4 ml-auto"})]})]}),U?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(X,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContextPending",{count:b})}),h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContinuityPending",{count:h})})]})]}),e.jsx(p,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:a("accountsPage.noLegacyFollowup")}),e.jsxs(O,{children:[e.jsxs(M,{className:"pb-2",children:[e.jsx(z,{className:"text-sm",children:a("accountsPage.quickCommands")}),e.jsx(F,{children:a("accountsPage.quickCommandsDesc")})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity"}),e.jsx(P,{value:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(P,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",children:a("accountsPage.workspaceBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.historySyncBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.resourcesBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:a("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[a("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:a("accountsTable.sync")}),a("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{className:"flex flex-col",children:[e.jsxs(M,{className:"pb-3",children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.accountMatrix")}),e.jsx(F,{children:a("accountsPage.sharedTotalDesc",{count:v})})]}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(O,{children:[e.jsxs(M,{children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.title")}),e.jsxs(F,{children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.mobileManageSuffix")]})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs(p,{className:"w-full",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:f,children:[a("accountsPage.openCliProxyClaudePool"),e.jsx(B,{className:"w-4 h-4 ml-2"})]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:I,children:[a("accountsPage.authClaudeInPool"),e.jsx(le,{className:"w-4 h-4 ml-2"})]}),e.jsx(p,{variant:"outline",className:"w-full",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}),e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{children:[e.jsx(M,{className:"pb-3",children:e.jsx(z,{className:"text-base",children:a("accountsPage.accountMatrix")})}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]}),e.jsx(gs,{open:u,onClose:()=>r(!1)})]})}export{Ts as AccountsPage};
|
|
1
|
+
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as k,e as Ae}from"./react-vendor-Bjx91N7w.js";import{e as Pe,f as se,g as De}from"./tanstack-bhJxV1h8.js";import{T as Te,a as Se,b as te,c as Re,d as _e,e as Oe}from"./table-CgmEQVhj.js";import{a as R,ah as q,ai as W,aj as Q,ak as J,al as Y,L as S,I as E,x as P,aD as pe,d as p,r as Ge,s as Me,t as ze,v as Le,w as ae,bi as ne,bj as re,bk as ce,B as C,c as $e,C as O,j as M,k as z,_ as F,b as G,e as Ie,f as He,g as Fe,n as Be}from"./index-BB0thfeB.js";import{A as Ue,a as Ke,b as Ee,c as Ze,d as Ve,e as Xe,f as qe,g as We}from"./alert-dialog-DOkcpleU.js";import{u as fe,a as Qe,b as Je,c as Ye,d as es,e as ss,f as ts}from"./use-accounts-BG5kGe9H.js";import{b1 as Z,b2 as L,b3 as ee,aH as be,_ as je,b4 as Ne,ai as ye,w as as,b5 as ns,b6 as rs,m as V,at as cs,Q as os,b7 as ds,a7 as ls,$ as ve,a6 as B,T as X,x as is,o as oe,U as xs,a9 as de,Z as le}from"./icons-DzKUh8vG.js";import{C as ie}from"./checkbox-C-I3i4Q4.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";const xe=64,us=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ms({account:a,groupSummaries:x,plainCcsLane:t,onClose:m}){const{t:s}=R(),u=fe(),[r,l]=k.useState(a.context_mode==="shared"?"shared":"isolated"),[g,b]=k.useState(a.context_group||"default"),[h,v]=k.useState(a.continuity_mode==="deeper"?"deeper":"standard"),d=k.useMemo(()=>g.trim().toLowerCase().replace(/\s+/g,"-"),[g]),c=k.useMemo(()=>x.find(f=>f.group===d),[x,d]),N=d.length>0&&d.length<=xe&&us.test(d),j=r==="isolated"||N,y=r==="shared"?Math.max((c?.sharedCount??0)-(a.context_mode==="shared"&&a.context_group===d?1:0),0):0,n=r==="shared"?Math.max((c?.deeperCount??0)-(a.continuity_mode==="deeper"&&a.context_group===d?1:0),0):0,o=t?.account_name===a.name,i=!!t&&!o,w=`ccs auth default ${a.name}`,D=`ccs auth backup ${a.name}`,A=(f,I,_,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(f.key))return;f.preventDefault();const ke=_.indexOf(I),we=f.key==="ArrowLeft"||f.key==="ArrowUp"?-1:1,Ce=(ke+we+_.length)%_.length;H(_[Ce])},$=t?t.kind==="native"?s("continuityOverview.lane.native"):t.kind==="account-default"?s("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?s("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?s("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",T=()=>{j&&u.mutate({name:a.name,context_mode:r,context_group:r==="shared"?d:void 0,continuity_mode:r==="shared"?h:void 0},{onSuccess:()=>{m()}})},U=f=>{f||m()};return e.jsx(q,{open:!0,onOpenChange:U,children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:s("editAccountContext.title")}),e.jsx(Y,{children:s("editAccountContext.description",{name:a.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.syncMode")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="isolated",tabIndex:r==="isolated"?0:-1,onClick:()=>l("isolated"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="isolated"?"bg-background text-blue-600 dark:text-blue-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="shared",tabIndex:r==="shared"?0:-1,onClick:()=>l("shared"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="shared"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(r==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"context-group",children:s("editAccountContext.historySyncGroup")}),e.jsx(E,{id:"context-group",value:g,onChange:f=>b(f.target.value),placeholder:s("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.groupHint",{max:xe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:s("editAccountContext.invalidGroup")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.continuityDepth")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.continuityDepth"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="standard",tabIndex:h==="standard"?0:-1,onClick:()=>v("standard"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="standard"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.standardOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="deeper",tabIndex:h==="deeper"?0:-1,onClick:()=>v("deeper"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="deeper"?"bg-background text-indigo-600 dark:text-indigo-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(h==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.credentialsIsolated")}),i&&e.jsx("div",{className:"rounded-[14px] border border-amber-200 bg-amber-50/50 p-4 text-xs shadow-sm dark:border-amber-900/40 dark:bg-amber-900/10",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s("continuityOverview.plainLaneDescription",{lane:$||"plain ccs",name:a.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:D}),e.jsx(P,{value:D,size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:w}),e.jsx(P,{value:w,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${r==="isolated"?"bg-blue-50/50 border-blue-200 dark:bg-blue-900/10 dark:border-blue-800/40":"bg-muted/40 border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[r==="isolated"?e.jsx(be,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}):e.jsx(je,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1.5 flex-1 text-muted-foreground leading-relaxed",children:[r==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:s("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:s("editAccountContext.sameGroupRule",{group:d})})," ",y>0?s("editAccountContext.sameGroupPeerCount",{count:y}):s("editAccountContext.noSameGroupPeer")]}),h==="deeper"&&e.jsx("p",{children:n>0?s("editAccountContext.deeperReady",{count:n}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:s("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${r==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:s("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:m,disabled:u.isPending,children:s("editAccountContext.cancel")}),e.jsx(p,{onClick:T,disabled:!j||u.isPending,children:u.isPending?s("editAccountContext.saving"):s("editAccountContext.save")})]})]})})}function hs({account:a,onClose:x}){const{t}=R(),m=Qe(),[s,u]=k.useState(a.shared_resource_mode||"shared"),r=()=>{m.mutate({name:a.name,shared_resource_mode:s},{onSuccess:()=>{x()}})};return e.jsx(q,{open:!0,onOpenChange:x,children:e.jsxs(W,{className:"sm:max-w-[425px]",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("editAccountSharedResources.title")}),e.jsx(Y,{children:t("editAccountSharedResources.description",{name:a.name})})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"resource-mode",children:t("editAccountSharedResources.resourceMode")}),e.jsxs(Ge,{value:s,onValueChange:l=>u(l),children:[e.jsx(Me,{id:"resource-mode",className:"w-full",children:e.jsx(ze,{placeholder:t("editAccountSharedResources.selectResourceMode")})}),e.jsxs(Le,{children:[e.jsx(ae,{value:"shared",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.sharedOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.sharedHint")})]})}),e.jsx(ae,{value:"profile-local",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.profileLocalHint")})]})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t("editAccountSharedResources.implicationTitle")}),s==="shared"?e.jsxs(ne,{className:"border-emerald-500/20 bg-emerald-500/5",children:[e.jsx(Ne,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),e.jsx(re,{className:"text-xs font-semibold text-emerald-800 dark:text-emerald-300",children:t("editAccountSharedResources.sharedOption")}),e.jsx(ce,{className:"text-xs text-emerald-700/80 dark:text-emerald-400/80",children:t("editAccountSharedResources.sharedImplication")})]}):e.jsxs(ne,{className:"border-amber-500/20 bg-amber-500/5",children:[e.jsx(ye,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),e.jsx(re,{className:"text-xs font-semibold text-amber-800 dark:text-amber-300",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx(ce,{className:"text-xs text-amber-700/80 dark:text-amber-400/80",children:t("editAccountSharedResources.profileLocalImplication")})]})]}),a.shared_resource_inferred&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted/50 p-3",children:[e.jsx(as,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("accountsTable.legacyReview")})]})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:x,children:t("editAccountSharedResources.cancel")}),e.jsx(p,{onClick:r,disabled:m.isPending,children:m.isPending?t("editAccountSharedResources.saving"):t("editAccountSharedResources.save")})]})]})})}function ue({data:a,defaultAccount:x,groupSummaries:t,plainCcsLane:m}){const{t:s}=R(),u=Je(),r=Ye(),l=es(),g=fe(),[b,h]=k.useState(null),[v,d]=k.useState(null),[c,N]=k.useState(null),j=[{accessorKey:"name",header:s("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===x&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:s("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:s("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:s("accountsTable.created"),size:150,cell:({row:n})=>{const o=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{accessorKey:"last_used",header:s("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{id:"context",header:s("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const i=n.original.context_group||"default",w=n.original.continuity_mode==="deeper";return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(C,{variant:"outline",className:`font-mono text-[10px] uppercase px-1.5 py-0 border ${w?"text-indigo-700 border-indigo-300/60 bg-indigo-50/50 dark:text-indigo-300 dark:border-indigo-900/40 dark:bg-indigo-900/20":"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20"}`,children:s(w?"accountsTable.badges.deeper":"accountsTable.badges.shared")}),e.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:i})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:n.original.sameGroupPeerCount>0?s("accountsTable.sameGroupPeerCount",{count:n.original.sameGroupPeerCount}):s("accountsTable.noSameGroupPeer")})]})}return n.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:"outline",className:"text-amber-700 border-amber-300/60 bg-amber-50/50 dark:text-amber-400 dark:border-amber-900/40 dark:bg-amber-900/20 font-mono text-[10px] uppercase px-1.5 py-0",children:s("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(C,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:s("accountsTable.badges.isolated")})})}},{id:"resources",header:s("accountsTable.sharedResources"),size:150,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=n.original.shared_resource_mode||"shared",i=n.original.shared_resource_inferred;return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:o==="shared"?"outline":"secondary",className:$e("font-mono text-[10px] uppercase px-1.5 py-0",o==="shared"?"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20":"text-muted-foreground bg-muted/60 border-transparent shadow-none"),children:s(o==="shared"?"accountsTable.resourcesShared":"accountsTable.resourcesProfileLocal")}),i&&e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]})}},{id:"actions",header:s("accountsTable.actions"),size:220,cell:({row:n})=>{const o=n.original.name===x,i=u.isPending||r.isPending||g.isPending,w=n.original.type==="cliproxy",D=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>d(n.original),title:s("accountsTable.syncTitle"),children:[e.jsx(ns,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sync")]}),!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>N(n.original),title:s("accountsTable.resourcesTitle"),children:[e.jsx(Ne,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sharedResources")]}),!w&&D&&e.jsxs(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:i,onClick:()=>g.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:s("accountsTable.confirmLegacyTitle"),children:[e.jsx(rs,{className:"w-3 h-3 mr-1"}),s("accountsTable.confirm")]}),e.jsxs(p,{variant:o?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:o||i,onClick:()=>u.mutate(n.original.name),children:[e.jsx(V,{className:`w-3 h-3 mr-1 ${o?"opacity-50":""}`}),s(o?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:o||i,onClick:()=>h(n.original.name),title:s(o?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(cs,{className:"w-4 h-4"})})]})}}],y=Pe({data:a,columns:j,getCoreRowModel:De()});return a.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Te,{children:[e.jsx(Se,{children:y.getHeaderGroups().map(n=>e.jsx(te,{children:n.headers.map(o=>{const i={name:"w-[180px]",type:"w-[80px]",created:"w-[120px]",last_used:"w-[120px]",context:"w-[150px]",resources:"w-[120px]",actions:"w-[320px]"}[o.id]||"w-auto";return e.jsx(Re,{className:i,children:o.isPlaceholder?null:se(o.column.columnDef.header,o.getContext())},o.id)})},n.id))}),e.jsx(_e,{children:y.getRowModel().rows.map(n=>e.jsx(te,{children:n.getVisibleCells().map(o=>e.jsx(Oe,{children:se(o.column.columnDef.cell,o.getContext())},o.id))},n.id))})]})}),x&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.isPending,children:[e.jsx(os,{className:"w-4 h-4 mr-2"}),s("accountsTable.resetToDefault")]})})]}),v&&e.jsx(ms,{account:v,groupSummaries:t,plainCcsLane:m,onClose:()=>d(null)}),c&&e.jsx(hs,{account:c,onClose:()=>N(null)}),e.jsx(Ue,{open:!!b,onOpenChange:n=>!n&&h(null),children:e.jsxs(Ke,{children:[e.jsxs(Ee,{children:[e.jsx(Ze,{children:s("accountsTable.deleteDialogTitle")}),e.jsx(Ve,{children:s("accountsTable.deleteDialogDesc",{name:b??""})})]}),e.jsxs(Xe,{children:[e.jsx(qe,{children:s("accountsTable.cancel")}),e.jsx(We,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{b&&(r.mutate(b),h(null))},children:s("accountsTable.delete")})]})]})})]})}function me({totalAccounts:a,isolatedCount:x,sharedPeerGroups:t,deeperReadyGroups:m}){const{t:s}=R(),u=m[0]||t[0]||"daily",r=a<2?"empty":m.length>0?"deeper":t.length>0?"shared":a>=2&&x===a?"isolated":a===0?"empty":"mixed",l=`ccs auth create work2 --share-context --context-group ${u} --deeper-continuity`;return e.jsxs(O,{className:"overflow-hidden",children:[e.jsx(M,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(z,{className:"text-lg",children:s("accountRouteGuide.title")}),e.jsx(F,{children:s("accountRouteGuide.description")})]}),e.jsx(C,{variant:r==="deeper"?"default":"secondary",children:s(`accountRouteGuide.status.${r}`)})]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("section",{className:"rounded-md border bg-blue-50/50 p-3 text-sm dark:bg-blue-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ye,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),s("accountRouteGuide.cards.isolated.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.isolated.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-emerald-50/50 p-3 text-sm dark:bg-emerald-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ds,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),s("accountRouteGuide.cards.select.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.select.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-sky-50/50 p-3 text-sm dark:bg-sky-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ls,{className:"h-4 w-4 text-sky-600 dark:text-sky-400"}),s("accountRouteGuide.cards.settings.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.settings.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-indigo-50/50 p-3 text-sm dark:bg-indigo-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(L,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400"}),s("accountRouteGuide.cards.sync.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.sync.desc")})]})]}),e.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.isolated")]}),["ccs auth create work","ccs auth create personal","ccs work","ccs personal"].map(g=>e.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:g}),e.jsx(P,{value:g,size:"icon"})]},g))]}),e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.sync")]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:l}),e.jsx(P,{value:l,size:"icon"})]}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.commands.syncDesc",{group:u})})]})]})]})]})}const K=({titleKey:a,descKey:x})=>{const{t}=R();return e.jsxs(Ie,{children:[e.jsx(He,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon","aria-label":t(a),className:"h-5 w-5 rounded-full hover:bg-muted text-muted-foreground/70 transition-colors",children:e.jsx(je,{className:"h-3 w-3"})})}),e.jsxs(Fe,{className:"w-72 p-4 rounded-xl shadow-lg border-border/50 text-sm",side:"top",align:"center",children:[e.jsx("p",{className:"font-semibold tracking-tight",children:t(a)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(x)})]})]})};function he({totalAccounts:a,primaryAccountName:x,isolatedCount:t,sharedStandardCount:m,deeperSharedCount:s,sharedAloneCount:u,sharedPeerAccountCount:r,deeperReadyAccountCount:l,sharedPeerGroups:g,deeperReadyGroups:b,legacyTargetCount:h,cliproxyCount:v,plainCcsLane:d}){const{t:c}=R(),N=d?d.kind==="native"?c("continuityOverview.lane.native"):d.kind==="account-default"?c("continuityOverview.lane.accountDefault",{name:d.account_name||""}):d.kind==="account-inherited"?c("continuityOverview.lane.accountInherited",{name:d.account_name||""}):d.kind==="profile-default"?c("continuityOverview.lane.profileDefault",{name:d.profile_name||"default"}):d.label:"",j=a<2?"single":g.length===0?t===a?"isolated":"shared-alone":b.length===0?"shared-standard":t>0||u>0||l<r||b.length<g.length?"partial":"ready",y=b[0]||g[0]||"default",n=b.length>0&&(t>0||m>0||g.length>b.length),i={ready:e.jsx(is,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(L,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"}),single:e.jsx(be,{className:"h-6 w-6 text-stone-400"}),isolated:e.jsx(Z,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),"shared-alone":e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),partial:e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}[j],w=!!x&&d?.account_name===x,D=a>0&&!!d&&(!x||!w),A=a>1&&j!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{className:"flex flex-col justify-between overflow-hidden relative group p-0 border-border bg-card shadow-sm hover:shadow-md transition-shadow duration-300",children:e.jsxs(G,{className:"p-6 flex flex-col h-full bg-gradient-to-br from-card to-muted/20 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsx("div",{className:"rounded-2xl bg-background p-3 shadow-sm ring-1 ring-border/50 self-start shrink-0",children:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:c(`continuityReadiness.messages.${j}.title`,{group:y})}),e.jsx(C,{variant:j==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:c(`continuityReadiness.state.${j}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:c(`continuityReadiness.messages.${j}.description`,{group:y,count:u})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[v>0&&e.jsx(C,{variant:"outline",className:"text-blue-700 bg-blue-50/50 border-blue-200/60 dark:border-blue-900/40 dark:bg-blue-900/20 dark:text-blue-300",children:c("historySyncLearningMap.cliproxyManaged",{count:v})}),h>0&&e.jsx(C,{variant:"outline",className:"text-amber-700 bg-amber-50/50 border-amber-200/60 dark:border-amber-900/40 dark:bg-amber-900/20 dark:text-amber-300",children:c("historySyncLearningMap.legacyConfirmation",{count:h})}),g.length>0&&b.length===0&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.recommendBadge",{group:y})}),n&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.partialBadge",{group:y})})]})]})}),(D||A)&&e.jsx(O,{className:"border-dashed",children:e.jsxs(G,{className:"p-5 space-y-4",children:[D&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c("continuityOverview.plainLaneDescription",{lane:N||"plain ccs"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),x?e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:`ccs auth default ${x}`}),e.jsx(P,{value:`ccs auth default ${x}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:c("continuityOverview.setDefaultHint")})]})]}),A&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:c("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:c("continuityReadiness.steps.sameGroup",{group:y})}),e.jsx("li",{children:c("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:c("continuityReadiness.steps.resumeOriginal")})]})]})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-3",children:[e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-blue-300/40 bg-blue-50/50 dark:border-blue-900/30 dark:bg-blue-900/10 shadow-sm transition-colors hover:bg-blue-100/40 dark:hover:bg-blue-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4 text-blue-700/80 dark:text-blue-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-900 dark:text-blue-200",children:c("historySyncLearningMap.isolated")}),e.jsx(K,{titleKey:"accountsPage.isolated",descKey:"accountsPage.isolatedDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-blue-900 dark:text-blue-200",children:t})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-emerald-300/40 bg-emerald-50/50 dark:border-emerald-900/30 dark:bg-emerald-900/10 shadow-sm transition-colors hover:bg-emerald-100/40 dark:hover:bg-emerald-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-emerald-700/80 dark:text-emerald-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-900 dark:text-emerald-200",children:c("historySyncLearningMap.shared")}),e.jsx(K,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:m})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-indigo-300/40 bg-indigo-50/50 dark:border-indigo-900/30 dark:bg-indigo-900/10 shadow-sm transition-colors hover:bg-indigo-100/40 dark:hover:bg-indigo-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-4 w-4 text-indigo-700/80 dark:text-indigo-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-indigo-900 dark:text-indigo-200",children:c("historySyncLearningMap.deeper")}),e.jsx(K,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:s})]})]})]})}const ge=64;function gs({open:a,onClose:x}){const{t}=R(),[m,s]=k.useState(""),[u,r]=k.useState(!1),[l,g]=k.useState(""),[b,h]=k.useState(!1),[v,d]=k.useState(!1),c=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(m),N=l.trim().toLowerCase().replace(/\s+/g,"-"),j=N.length===0||N.length<=ge&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),y=m&&c?[`ccs auth create ${m}`,u?N.length>0?`--context-group ${N}`:"--share-context":"",u&&b?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),n=async()=>{!c||u&&!j||(await navigator.clipboard.writeText(y),d(!0),setTimeout(()=>d(!1),2e3))},o=()=>{s(""),r(!1),g(""),h(!1),d(!1),x()};return e.jsx(q,{open:a,onOpenChange:i=>!i&&o(),children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(Q,{children:[e.jsx(J,{children:t("createAuthProfileDialog.title")}),e.jsx(Y,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(E,{id:"profile-name",value:m,onChange:i=>s(i.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),m&&!c&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{id:"share-context",checked:u,onCheckedChange:i=>r(i===!0)}),e.jsx(S,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),u&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(S,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(E,{id:"context-group",value:l,onChange:i=>g(i.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ie,{id:"deeper-continuity",checked:b,onCheckedChange:i=>h(i===!0)}),e.jsx(S,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),l.trim().length>0&&!j&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ge})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(ve,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:y}),e.jsx(p,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:n,disabled:!c||u&&!j,children:v?e.jsx(V,{className:"w-4 h-4 text-green-500"}):e.jsx(oe,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p,{variant:"ghost",onClick:o,children:t("createAuthProfileDialog.close")}),e.jsx(p,{onClick:n,disabled:!c||u&&!j,children:v?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function Ts(){const{t:a}=R(),x=Ae(),{data:t,isLoading:m}=ss(),s=ts(),[u,r]=k.useState(!1),l=t?.accounts||[],g=t?.cliproxyCount||0,b=t?.legacyContextCount||0,h=t?.legacyContinuityCount||0,v=t?.sharedCount||0,d=t?.sharedStandardCount||0,c=t?.deeperSharedCount||0,N=t?.isolatedCount||0,j=t?.sharedAloneCount||0,y=t?.sharedPeerAccountCount||0,n=t?.deeperReadyAccountCount||0,o=t?.sharedPeerGroups||[],i=t?.deeperReadyGroups||[],w=t?.sharedGroups||[],D=t?.groupSummaries||[],A=t?.plainCcsLane||null,$=l.filter(H=>H.context_inferred||H.continuity_inferred),T=$.length,U=T>0,f=()=>x("/cliproxy?provider=claude"),I=()=>x("/cliproxy?provider=claude&action=auth"),_=()=>s.mutate($);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:a("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.manageSuffix")]})]}),e.jsx(Be,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.primaryActions")}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:I,children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),a("accountsPage.authClaudeInPool")]}),e.jsxs(p,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:f,children:[a("accountsPage.openClaudePoolSettings"),e.jsx(B,{className:"w-4 h-4 ml-auto"})]})]}),U?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(X,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContextPending",{count:b})}),h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContinuityPending",{count:h})})]})]}),e.jsx(p,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:a("accountsPage.noLegacyFollowup")}),e.jsxs(O,{children:[e.jsxs(M,{className:"pb-2",children:[e.jsx(z,{className:"text-sm",children:a("accountsPage.quickCommands")}),e.jsx(F,{children:a("accountsPage.quickCommandsDesc")})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity"}),e.jsx(P,{value:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(P,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",children:a("accountsPage.workspaceBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.historySyncBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.resourcesBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:a("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[a("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:a("accountsTable.sync")}),a("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{className:"flex flex-col",children:[e.jsxs(M,{className:"pb-3",children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.accountMatrix")}),e.jsx(F,{children:a("accountsPage.sharedTotalDesc",{count:v})})]}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(O,{children:[e.jsxs(M,{children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.title")}),e.jsxs(F,{children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.mobileManageSuffix")]})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs(p,{className:"w-full",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:f,children:[a("accountsPage.openCliProxyClaudePool"),e.jsx(B,{className:"w-4 h-4 ml-2"})]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:I,children:[a("accountsPage.authClaudeInPool"),e.jsx(le,{className:"w-4 h-4 ml-2"})]}),e.jsx(p,{variant:"outline",className:"w-full",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}),e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{children:[e.jsx(M,{className:"pb-3",children:e.jsx(z,{className:"text-base",children:a("accountsPage.accountMatrix")})}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]}),e.jsx(gs,{open:u,onClose:()=>r(!1)})]})}export{Ts as AccountsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as o,bY as l}from"./index-
|
|
1
|
+
import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as o,bY as l}from"./index-BB0thfeB.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function z({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,z as f,y as g};
|