@mars-sea/dsh-commandcode-provider 0.13.0 → 0.13.2
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/CHANGELOG.md +27 -0
- package/README.md +13 -7
- package/README.zh-CN.md +11 -5
- package/lib/client.js +377 -186
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +24 -1
- package/lib/index.js +175 -48
- package/lib/index.js.map +1 -1
- package/package.json +39 -38
package/lib/client.js
CHANGED
|
@@ -1538,6 +1538,14 @@ window.__ModuleLoader__.load({
|
|
|
1538
1538
|
function formatResetAt(ms) {
|
|
1539
1539
|
return ms <= 0 ? "" : new Date(ms).toLocaleString();
|
|
1540
1540
|
}
|
|
1541
|
+
/** 只有官方汇总与订阅共同确认同一起点,才展示完整账期;旧宿主和部分响应保持未知。 */
|
|
1542
|
+
function formatUsageBillingPeriod(usageStart, planStart, planEnd) {
|
|
1543
|
+
if (usageStart === void 0 || planStart !== usageStart || planEnd === void 0 || usageStart <= 0 || planEnd <= usageStart) return "";
|
|
1544
|
+
const start = new Date(usageStart);
|
|
1545
|
+
const end = new Date(planEnd);
|
|
1546
|
+
if (!Number.isFinite(start.getTime()) || !Number.isFinite(end.getTime())) return "";
|
|
1547
|
+
return `${start.toLocaleDateString()} – ${end.toLocaleDateString()}`;
|
|
1548
|
+
}
|
|
1541
1549
|
//#endregion
|
|
1542
1550
|
//#region src/client/usage.ts
|
|
1543
1551
|
const IDLE$1 = {
|
|
@@ -2203,6 +2211,7 @@ window.__ModuleLoader__.load({
|
|
|
2203
2211
|
totalCredits: numberField(usage, "totalCredits", "usage.totalCredits"),
|
|
2204
2212
|
periodBasis: stringField$1(usage, "periodBasis", "usage.periodBasis")
|
|
2205
2213
|
};
|
|
2214
|
+
if (usage.periodStart !== void 0) report.usage.periodStart = numberField(usage, "periodStart", "usage.periodStart");
|
|
2206
2215
|
}
|
|
2207
2216
|
if (source.credits !== void 0) {
|
|
2208
2217
|
const credits = record$1(source.credits, "credits");
|
|
@@ -2230,6 +2239,7 @@ window.__ModuleLoader__.load({
|
|
|
2230
2239
|
monthlyCredits: monthly,
|
|
2231
2240
|
currentPeriodEnd: numberField(plan, "currentPeriodEnd", "plan.currentPeriodEnd")
|
|
2232
2241
|
};
|
|
2242
|
+
if (plan.currentPeriodStart !== void 0) report.plan.currentPeriodStart = numberField(plan, "currentPeriodStart", "plan.currentPeriodStart");
|
|
2233
2243
|
}
|
|
2234
2244
|
return report;
|
|
2235
2245
|
}
|
|
@@ -2854,6 +2864,9 @@ window.__ModuleLoader__.load({
|
|
|
2854
2864
|
usageFailed: "失败",
|
|
2855
2865
|
usageSuccessRate: "成功率",
|
|
2856
2866
|
usageCost: "花费",
|
|
2867
|
+
usageCompleted: "成功",
|
|
2868
|
+
usageBillingPeriod: "官方账期用量",
|
|
2869
|
+
usagePeriodUnknown: "官方用量汇总,统计周期未确认",
|
|
2857
2870
|
usageTokens: "Token",
|
|
2858
2871
|
usageTokensIn: "入",
|
|
2859
2872
|
usageTokensOut: "出",
|
|
@@ -3029,6 +3042,9 @@ window.__ModuleLoader__.load({
|
|
|
3029
3042
|
usageFailed: "failed",
|
|
3030
3043
|
usageSuccessRate: "Success rate",
|
|
3031
3044
|
usageCost: "Spend",
|
|
3045
|
+
usageCompleted: "Completed",
|
|
3046
|
+
usageBillingPeriod: "Official billing-period usage",
|
|
3047
|
+
usagePeriodUnknown: "官方用量汇总,统计周期未确认",
|
|
3032
3048
|
usageTokens: "Tokens",
|
|
3033
3049
|
usageTokensIn: "in",
|
|
3034
3050
|
usageTokensOut: "out",
|
|
@@ -3275,7 +3291,7 @@ window.__ModuleLoader__.load({
|
|
|
3275
3291
|
}
|
|
3276
3292
|
//#endregion
|
|
3277
3293
|
//#region package.json
|
|
3278
|
-
var version = "0.13.
|
|
3294
|
+
var version = "0.13.2";
|
|
3279
3295
|
var repository = {
|
|
3280
3296
|
"type": "git",
|
|
3281
3297
|
"url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
|
|
@@ -3684,6 +3700,7 @@ window.__ModuleLoader__.load({
|
|
|
3684
3700
|
const planStatus = plan !== void 0 && plan.status !== "" && plan.status !== "active" ? plan.status : "";
|
|
3685
3701
|
const showPeriod = plan !== void 0 && plan.currentPeriodEnd > 0;
|
|
3686
3702
|
const showPartial = report.failures.length > 0 && report.blocked === void 0;
|
|
3703
|
+
const usagePeriod = formatUsageBillingPeriod(report.usage?.periodStart, plan?.currentPeriodStart, plan?.currentPeriodEnd);
|
|
3687
3704
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3688
3705
|
className: "cc-accountReport",
|
|
3689
3706
|
children: [
|
|
@@ -3731,13 +3748,17 @@ window.__ModuleLoader__.load({
|
|
|
3731
3748
|
}) : null
|
|
3732
3749
|
]
|
|
3733
3750
|
}) : null,
|
|
3751
|
+
report.usage !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3752
|
+
className: "cc-usageUpdated",
|
|
3753
|
+
children: usagePeriod ? `${t("usageBillingPeriod")} ${usagePeriod}` : t("usagePeriodUnknown")
|
|
3754
|
+
}) : null,
|
|
3734
3755
|
report.usage !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3735
3756
|
className: "cc-usageStats cc-usageStatsActivity",
|
|
3736
3757
|
children: [
|
|
3737
3758
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageStat, {
|
|
3738
3759
|
label: t("usageRequests"),
|
|
3739
|
-
value: String(report.usage.
|
|
3740
|
-
sub: `${t("usageFailed")} ${report.usage.failedCount}`
|
|
3760
|
+
value: String(report.usage.totalCount),
|
|
3761
|
+
sub: `${t("usageCompleted")} ${report.usage.completedCount} / ${t("usageFailed")} ${report.usage.failedCount}`
|
|
3741
3762
|
}),
|
|
3742
3763
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageStat, {
|
|
3743
3764
|
label: t("usageSuccessRate"),
|
|
@@ -5579,8 +5600,19 @@ window.__ModuleLoader__.load({
|
|
|
5579
5600
|
analysisSections: "分析内容",
|
|
5580
5601
|
analysisHistory: "历史用量",
|
|
5581
5602
|
analysisSimulation: "价格试算",
|
|
5582
|
-
analysisByModel: "
|
|
5583
|
-
analysisModelHint: "
|
|
5603
|
+
analysisByModel: "模型用量比较",
|
|
5604
|
+
analysisModelHint: "比例条表示占已知成本小计的份额;展开查看明细。",
|
|
5605
|
+
analysisIntro: "查看历史用量,比较模型成本与响应表现。",
|
|
5606
|
+
analysisModel: "模型",
|
|
5607
|
+
analysisCostShare: "已知成本 / 占比",
|
|
5608
|
+
analysisNoShare: "无占比",
|
|
5609
|
+
analysisShareHint: "占全部已知成本小计",
|
|
5610
|
+
analysisSimulationHeading: "相同工作量价格试算",
|
|
5611
|
+
analysisSimulationHint: "计价覆盖不同的金额不能直接比较。",
|
|
5612
|
+
analysisSimulationCost: "试算成本",
|
|
5613
|
+
analysisCoverage: "计价覆盖",
|
|
5614
|
+
analysisUsd: "美元",
|
|
5615
|
+
analysisTokenUnit: "词元",
|
|
5584
5616
|
analysisCost: "已知成本 · 美元",
|
|
5585
5617
|
analysisRequests: "模型请求",
|
|
5586
5618
|
analysisSessionCount: "会话数",
|
|
@@ -5661,8 +5693,19 @@ window.__ModuleLoader__.load({
|
|
|
5661
5693
|
analysisSections: "Analysis sections",
|
|
5662
5694
|
analysisHistory: "Recorded usage",
|
|
5663
5695
|
analysisSimulation: "Price simulation",
|
|
5664
|
-
analysisByModel: "
|
|
5665
|
-
analysisModelHint: "
|
|
5696
|
+
analysisByModel: "Model usage comparison",
|
|
5697
|
+
analysisModelHint: "Bars show each share of the known cost subtotal; expand for details.",
|
|
5698
|
+
analysisIntro: "Review recorded usage and compare model cost and response times.",
|
|
5699
|
+
analysisModel: "Model",
|
|
5700
|
+
analysisCostShare: "Known cost / share",
|
|
5701
|
+
analysisNoShare: ANALYTICS_COPY_ZH.analysisNoShare,
|
|
5702
|
+
analysisShareHint: "Share of the known cost subtotal",
|
|
5703
|
+
analysisSimulationHeading: "Price simulation for the same workload",
|
|
5704
|
+
analysisSimulationHint: "Amounts with different priced coverage are not directly comparable.",
|
|
5705
|
+
analysisSimulationCost: "Simulated cost",
|
|
5706
|
+
analysisCoverage: "Priced coverage",
|
|
5707
|
+
analysisUsd: "USD",
|
|
5708
|
+
analysisTokenUnit: "tokens",
|
|
5666
5709
|
analysisCost: "Known cost · USD",
|
|
5667
5710
|
analysisRequests: "Model requests",
|
|
5668
5711
|
analysisSessionCount: "Sessions",
|
|
@@ -5752,6 +5795,9 @@ window.__ModuleLoader__.load({
|
|
|
5752
5795
|
credits: "额度",
|
|
5753
5796
|
limits: "配额窗口",
|
|
5754
5797
|
usage: "用量",
|
|
5798
|
+
completed: "成功",
|
|
5799
|
+
usageBillingPeriod: "官方账期用量",
|
|
5800
|
+
usagePeriodUnknown: "官方用量汇总,统计周期未确认",
|
|
5755
5801
|
monthly: "月额度",
|
|
5756
5802
|
monthlyLimit: "月额度上限",
|
|
5757
5803
|
monthlyUsed: "本月已用",
|
|
@@ -5807,6 +5853,9 @@ window.__ModuleLoader__.load({
|
|
|
5807
5853
|
credits: "Credits",
|
|
5808
5854
|
limits: "Quota windows",
|
|
5809
5855
|
usage: "Usage",
|
|
5856
|
+
completed: "completed",
|
|
5857
|
+
usageBillingPeriod: "Official billing-period usage",
|
|
5858
|
+
usagePeriodUnknown: "官方用量汇总,统计周期未确认",
|
|
5810
5859
|
monthly: "Monthly",
|
|
5811
5860
|
monthlyLimit: "Monthly limit",
|
|
5812
5861
|
monthlyUsed: "Monthly used",
|
|
@@ -5956,12 +6005,13 @@ window.__ModuleLoader__.load({
|
|
|
5956
6005
|
const plan = report.plan;
|
|
5957
6006
|
const credits = report.credits;
|
|
5958
6007
|
const usage = report.usage;
|
|
6008
|
+
const usageRange = formatUsageBillingPeriod(usage?.periodStart, plan?.currentPeriodStart, plan?.currentPeriodEnd);
|
|
5959
6009
|
const stats = [];
|
|
5960
6010
|
if (usage !== void 0) {
|
|
5961
6011
|
stats.push({
|
|
5962
6012
|
label: "requests",
|
|
5963
|
-
value: String(usage.
|
|
5964
|
-
sub: `${usage.failedCount} ${t("failed")}`
|
|
6013
|
+
value: String(usage.totalCount),
|
|
6014
|
+
sub: `${usage.completedCount} ${t("completed")} / ${usage.failedCount} ${t("failed")}`
|
|
5965
6015
|
});
|
|
5966
6016
|
stats.push({
|
|
5967
6017
|
label: "successRate",
|
|
@@ -5999,7 +6049,8 @@ window.__ModuleLoader__.load({
|
|
|
5999
6049
|
active: entry.active,
|
|
6000
6050
|
monthly: monthlyView(report),
|
|
6001
6051
|
windows,
|
|
6002
|
-
stats
|
|
6052
|
+
stats,
|
|
6053
|
+
usagePeriod: usage === void 0 ? "" : usageRange ? `${t("usageBillingPeriod")} ${usageRange}` : t("usagePeriodUnknown")
|
|
6003
6054
|
};
|
|
6004
6055
|
}
|
|
6005
6056
|
/** The report-level failure box, or undefined when the report is usable. */
|
|
@@ -6333,12 +6384,35 @@ window.__ModuleLoader__.load({
|
|
|
6333
6384
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m9 5 7 7-7 7" })
|
|
6334
6385
|
});
|
|
6335
6386
|
}
|
|
6336
|
-
function
|
|
6387
|
+
function AnalysisIcon({ kind }) {
|
|
6388
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
6389
|
+
className: "ccp-analysisIcon",
|
|
6390
|
+
width: "16",
|
|
6391
|
+
height: "16",
|
|
6392
|
+
viewBox: "0 0 24 24",
|
|
6393
|
+
fill: "none",
|
|
6394
|
+
stroke: "currentColor",
|
|
6395
|
+
strokeWidth: "1.6",
|
|
6396
|
+
strokeLinecap: "round",
|
|
6397
|
+
strokeLinejoin: "round",
|
|
6398
|
+
"aria-hidden": "true",
|
|
6399
|
+
children: kind === "info" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
6400
|
+
cx: "12",
|
|
6401
|
+
cy: "12",
|
|
6402
|
+
r: "9"
|
|
6403
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 11v6M12 7h.01" })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
6404
|
+
cx: "10.5",
|
|
6405
|
+
cy: "10.5",
|
|
6406
|
+
r: "6.5"
|
|
6407
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m16 16 4.5 4.5" })] })
|
|
6408
|
+
});
|
|
6409
|
+
}
|
|
6410
|
+
function Metric({ label, value, sub, children }) {
|
|
6337
6411
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6338
6412
|
className: "ccp-analysisMetric",
|
|
6339
6413
|
children: [
|
|
6340
6414
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6341
|
-
className: "ccp-analysisLabel",
|
|
6415
|
+
className: "ccp-analysisLabel ccp-analysisMetricLabel",
|
|
6342
6416
|
children: label
|
|
6343
6417
|
}),
|
|
6344
6418
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -6348,10 +6422,38 @@ window.__ModuleLoader__.load({
|
|
|
6348
6422
|
sub ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6349
6423
|
className: "ccp-analysisSub",
|
|
6350
6424
|
children: sub
|
|
6351
|
-
}) : null
|
|
6425
|
+
}) : null,
|
|
6426
|
+
children
|
|
6352
6427
|
]
|
|
6353
6428
|
});
|
|
6354
6429
|
}
|
|
6430
|
+
/** 只比较已知成本;没有计价样本或已知小计为零时,不制造百分比。 */
|
|
6431
|
+
function knownCostShare(m, totalCost) {
|
|
6432
|
+
return m.pricedRequests > 0 && totalCost > 0 ? m.cost / totalCost * 100 : null;
|
|
6433
|
+
}
|
|
6434
|
+
function CostShare({ m, totalCost, text }) {
|
|
6435
|
+
const share = knownCostShare(m, totalCost);
|
|
6436
|
+
if (share === null) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6437
|
+
className: "ccp-analysisSub",
|
|
6438
|
+
children: text("analysisNoShare")
|
|
6439
|
+
});
|
|
6440
|
+
const percentage = `${share.toFixed(1)}%`;
|
|
6441
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6442
|
+
className: "ccp-analysisShare",
|
|
6443
|
+
title: `${text("analysisShareHint")} ${percentage}`,
|
|
6444
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6445
|
+
className: "ccp-analysisShareTrack",
|
|
6446
|
+
"aria-hidden": "true",
|
|
6447
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6448
|
+
className: "ccp-analysisShareFill",
|
|
6449
|
+
style: { width: `${Math.min(100, Math.max(0, share))}%` }
|
|
6450
|
+
})
|
|
6451
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6452
|
+
className: "ccp-analysisShareValue",
|
|
6453
|
+
children: percentage
|
|
6454
|
+
})]
|
|
6455
|
+
});
|
|
6456
|
+
}
|
|
6355
6457
|
function DetailGroup({ title, values, text }) {
|
|
6356
6458
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6357
6459
|
className: "ccp-analysisDetailGroup",
|
|
@@ -6424,7 +6526,7 @@ window.__ModuleLoader__.load({
|
|
|
6424
6526
|
]
|
|
6425
6527
|
});
|
|
6426
6528
|
}
|
|
6427
|
-
function ModelRow({ m, text }) {
|
|
6529
|
+
function ModelRow({ m, name, totalCost, text }) {
|
|
6428
6530
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
6429
6531
|
className: "ccp-analysisModelRow",
|
|
6430
6532
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", {
|
|
@@ -6432,26 +6534,38 @@ window.__ModuleLoader__.load({
|
|
|
6432
6534
|
children: [
|
|
6433
6535
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6434
6536
|
className: "ccp-analysisIdentity",
|
|
6435
|
-
children: [
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6537
|
+
children: [
|
|
6538
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6539
|
+
className: "ccp-analysisModelName",
|
|
6540
|
+
children: name || m.id
|
|
6541
|
+
}),
|
|
6542
|
+
name && name !== m.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6543
|
+
className: "ccp-analysisSub",
|
|
6544
|
+
children: m.id
|
|
6545
|
+
}) : null,
|
|
6546
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6547
|
+
className: "ccp-analysisSub ccp-analysisModelCount",
|
|
6548
|
+
children: [
|
|
6549
|
+
text("analysisRequests"),
|
|
6550
|
+
" ",
|
|
6551
|
+
digits(m.requests),
|
|
6552
|
+
" · ",
|
|
6553
|
+
text("analysisSessionCount"),
|
|
6554
|
+
" ",
|
|
6555
|
+
digits(m.sessions)
|
|
6556
|
+
]
|
|
6557
|
+
})
|
|
6558
|
+
]
|
|
6450
6559
|
}),
|
|
6451
6560
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Metric, {
|
|
6452
|
-
label: text("
|
|
6561
|
+
label: text("analysisCostShare"),
|
|
6453
6562
|
value: m.pricedRequests ? money(m.cost) : text("analysisMissing"),
|
|
6454
|
-
sub: `${text("analysisPriced")} ${m.pricedRequests}/${m.requests}
|
|
6563
|
+
sub: `${text("analysisPriced")} ${m.pricedRequests}/${m.requests}`,
|
|
6564
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostShare, {
|
|
6565
|
+
m,
|
|
6566
|
+
totalCost,
|
|
6567
|
+
text
|
|
6568
|
+
})
|
|
6455
6569
|
}),
|
|
6456
6570
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Metric, {
|
|
6457
6571
|
label: text("analysisResponse"),
|
|
@@ -6490,17 +6604,19 @@ window.__ModuleLoader__.load({
|
|
|
6490
6604
|
})]
|
|
6491
6605
|
}),
|
|
6492
6606
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Metric, {
|
|
6493
|
-
label: text("
|
|
6607
|
+
label: text("analysisSimulationCost"),
|
|
6494
6608
|
value: m.pricedRequests ? money(m.cost) : text("analysisMissing"),
|
|
6495
|
-
sub:
|
|
6609
|
+
sub: text("analysisUsd")
|
|
6496
6610
|
}),
|
|
6497
6611
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Metric, {
|
|
6498
|
-
label: text("
|
|
6499
|
-
value: m.
|
|
6612
|
+
label: text("analysisCoverage"),
|
|
6613
|
+
value: `${m.pricedRequests}/${m.pricedRequests + m.excludedRequests + m.unknownRequests}`,
|
|
6614
|
+
sub: `${text("analysisExcluded")} ${digits(m.excludedRequests)} · ${text("analysisUnknownPrice")} ${digits(m.unknownRequests)}`
|
|
6500
6615
|
}),
|
|
6501
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6502
|
-
|
|
6503
|
-
|
|
6616
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Metric, {
|
|
6617
|
+
label: text("analysisCapabilities"),
|
|
6618
|
+
value: m.contextWindow === null ? text("analysisMissing") : `${digits(m.contextWindow)} ${text("analysisTokenUnit")}`,
|
|
6619
|
+
sub: text(m.images ? "analysisImages" : "analysisTextOnly")
|
|
6504
6620
|
}),
|
|
6505
6621
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, {})
|
|
6506
6622
|
]
|
|
@@ -6560,6 +6676,7 @@ window.__ModuleLoader__.load({
|
|
|
6560
6676
|
event.currentTarget.querySelector(`[data-page="${next}"]`)?.focus();
|
|
6561
6677
|
};
|
|
6562
6678
|
const scenarios = report?.scenarios.filter((m) => `${m.id} ${m.name}`.toLowerCase().includes(filter.trim().toLowerCase())) ?? [];
|
|
6679
|
+
const names = new Map(report?.scenarios.map((m) => [m.id, m.name]));
|
|
6563
6680
|
const m = report?.totals;
|
|
6564
6681
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
6565
6682
|
className: "ccp-analysis",
|
|
@@ -6568,6 +6685,7 @@ window.__ModuleLoader__.load({
|
|
|
6568
6685
|
children: [
|
|
6569
6686
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
6570
6687
|
className: "ccp-analysisFilters",
|
|
6688
|
+
"data-mode": mode,
|
|
6571
6689
|
noValidate: true,
|
|
6572
6690
|
onSubmit: (e) => {
|
|
6573
6691
|
e.preventDefault();
|
|
@@ -6606,7 +6724,7 @@ window.__ModuleLoader__.load({
|
|
|
6606
6724
|
onChange: (e) => setLimit(e.target.value)
|
|
6607
6725
|
})]
|
|
6608
6726
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6609
|
-
className: "ccp-analysisField",
|
|
6727
|
+
className: "ccp-analysisField ccp-analysisDateField",
|
|
6610
6728
|
children: [text("analysisFrom"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6611
6729
|
className: "ccp-analysisInput",
|
|
6612
6730
|
type: "date",
|
|
@@ -6616,7 +6734,7 @@ window.__ModuleLoader__.load({
|
|
|
6616
6734
|
onChange: (e) => setFrom(e.target.value)
|
|
6617
6735
|
})]
|
|
6618
6736
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6619
|
-
className: "ccp-analysisField",
|
|
6737
|
+
className: "ccp-analysisField ccp-analysisDateField",
|
|
6620
6738
|
children: [text("analysisTo"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6621
6739
|
className: "ccp-analysisInput",
|
|
6622
6740
|
type: "date",
|
|
@@ -6710,22 +6828,17 @@ window.__ModuleLoader__.load({
|
|
|
6710
6828
|
className: "ccp-analysisNote",
|
|
6711
6829
|
children: text("analysisShortBasis")
|
|
6712
6830
|
}),
|
|
6713
|
-
report.truncated || report.unreadableSessions > 0 || report.skippedSessions > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6714
|
-
className: "ccp-analysisMessage ccp-analysisWarning",
|
|
6715
|
-
role: "status",
|
|
6716
|
-
children: text("analysisPartial")
|
|
6717
|
-
}) : null,
|
|
6718
|
-
m.pricedRequests < m.requests ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6831
|
+
report.truncated || report.unreadableSessions > 0 || report.skippedSessions > 0 || m.pricedRequests < m.requests ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6719
6832
|
className: "ccp-analysisMessage ccp-analysisWarning",
|
|
6720
6833
|
role: "status",
|
|
6721
|
-
children: text("analysisUnpriced")
|
|
6834
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnalysisIcon, { kind: "info" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [report.truncated || report.unreadableSessions > 0 || report.skippedSessions > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: text("analysisPartial") }) : null, m.pricedRequests < m.requests ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: text("analysisUnpriced") }) : null] })]
|
|
6722
6835
|
}) : null,
|
|
6723
6836
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6724
6837
|
className: "ccp-analysisTabs",
|
|
6725
6838
|
role: "tablist",
|
|
6726
6839
|
"aria-label": text("analysisSections"),
|
|
6727
6840
|
onKeyDown: navigateTab,
|
|
6728
|
-
children: ["history", "simulation"].map((tab) => /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6841
|
+
children: ["history", "simulation"].map((tab) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
6729
6842
|
className: "ccp-analysisTab",
|
|
6730
6843
|
id: `${id}-${tab}-tab`,
|
|
6731
6844
|
"data-page": tab,
|
|
@@ -6735,7 +6848,10 @@ window.__ModuleLoader__.load({
|
|
|
6735
6848
|
"aria-controls": `${id}-${tab}`,
|
|
6736
6849
|
tabIndex: page === tab ? 0 : -1,
|
|
6737
6850
|
onClick: () => setPage(tab),
|
|
6738
|
-
children: text(tab === "history" ? "analysisHistory" : "analysisSimulation")
|
|
6851
|
+
children: [text(tab === "history" ? "analysisHistory" : "analysisSimulation"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6852
|
+
className: "ccp-analysisTabCount",
|
|
6853
|
+
children: digits(tab === "history" ? report.models.length : report.scenarios.length)
|
|
6854
|
+
})]
|
|
6739
6855
|
}, tab))
|
|
6740
6856
|
}),
|
|
6741
6857
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
@@ -6759,36 +6875,51 @@ window.__ModuleLoader__.load({
|
|
|
6759
6875
|
m.requests === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6760
6876
|
className: "ccp-analysisEmpty",
|
|
6761
6877
|
children: text("analysisEmpty")
|
|
6762
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6878
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6763
6879
|
className: "ccp-analysisModels",
|
|
6764
|
-
children:
|
|
6880
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6881
|
+
className: "ccp-analysisTableHead",
|
|
6882
|
+
"aria-hidden": "true",
|
|
6883
|
+
children: [
|
|
6884
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisModel") }),
|
|
6885
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisCostShare") }),
|
|
6886
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisResponse") }),
|
|
6887
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisFirstToken") }),
|
|
6888
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisSpeed") }),
|
|
6889
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {})
|
|
6890
|
+
]
|
|
6891
|
+
}), report.models.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelRow, {
|
|
6765
6892
|
m: model,
|
|
6893
|
+
name: names.get(model.id),
|
|
6894
|
+
totalCost: m.cost,
|
|
6766
6895
|
text
|
|
6767
|
-
}, model.id))
|
|
6768
|
-
}),
|
|
6769
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
6770
|
-
className: "ccp-analysisAggregate",
|
|
6771
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", {
|
|
6772
|
-
className: "ccp-analysisDisclosure",
|
|
6773
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, {}), text("analysisDetails")]
|
|
6774
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MetricsDetails, {
|
|
6775
|
-
m,
|
|
6776
|
-
text
|
|
6777
|
-
})]
|
|
6896
|
+
}, model.id))]
|
|
6778
6897
|
}),
|
|
6779
6898
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6780
|
-
className: "ccp-
|
|
6781
|
-
children: [
|
|
6782
|
-
|
|
6783
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
6784
|
-
className: "ccp-
|
|
6785
|
-
children:
|
|
6786
|
-
}),
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6899
|
+
className: "ccp-analysisFooter",
|
|
6900
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
6901
|
+
className: "ccp-analysisAggregate",
|
|
6902
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", {
|
|
6903
|
+
className: "ccp-analysisDisclosure",
|
|
6904
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Chevron, {}), text("analysisDetails")]
|
|
6905
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MetricsDetails, {
|
|
6906
|
+
m,
|
|
6907
|
+
text
|
|
6908
|
+
})]
|
|
6909
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6910
|
+
className: "ccp-analysisMonthly",
|
|
6911
|
+
children: [
|
|
6912
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisMonthly") }),
|
|
6913
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
6914
|
+
className: "ccp-analysisMonthlyValue",
|
|
6915
|
+
children: report.monthlyEstimate === null || report.truncated || report.unreadableSessions || report.skippedSessions ? text("analysisMissing") : money(report.monthlyEstimate)
|
|
6916
|
+
}),
|
|
6917
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6918
|
+
className: "ccp-analysisNote",
|
|
6919
|
+
children: text("analysisMonthlyHint")
|
|
6920
|
+
})
|
|
6921
|
+
]
|
|
6922
|
+
})]
|
|
6792
6923
|
})
|
|
6793
6924
|
]
|
|
6794
6925
|
}),
|
|
@@ -6809,25 +6940,50 @@ window.__ModuleLoader__.load({
|
|
|
6809
6940
|
role: "status",
|
|
6810
6941
|
children: text("analysisCatalog")
|
|
6811
6942
|
}) : null,
|
|
6812
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
6813
|
-
className: "ccp-
|
|
6814
|
-
children: [
|
|
6815
|
-
className: "ccp-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6943
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6944
|
+
className: "ccp-analysisSectionHead",
|
|
6945
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
6946
|
+
className: "ccp-analysisHeading",
|
|
6947
|
+
children: text("analysisSimulationHeading")
|
|
6948
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6949
|
+
className: "ccp-analysisNote",
|
|
6950
|
+
children: text("analysisSimulationHint")
|
|
6951
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6952
|
+
className: "ccp-analysisField ccp-analysisSearch",
|
|
6953
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6954
|
+
className: "ccp-analysisSearchLabel",
|
|
6955
|
+
children: text("analysisSearch")
|
|
6956
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6957
|
+
className: "ccp-analysisSearchShell",
|
|
6958
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnalysisIcon, { kind: "search" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6959
|
+
className: "ccp-analysisInput",
|
|
6960
|
+
type: "search",
|
|
6961
|
+
placeholder: text("analysisSearchPlaceholder"),
|
|
6962
|
+
value: filter,
|
|
6963
|
+
onChange: (e) => setFilter(e.target.value)
|
|
6964
|
+
})]
|
|
6965
|
+
})]
|
|
6820
6966
|
})]
|
|
6821
6967
|
}),
|
|
6822
6968
|
m.requests === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6823
6969
|
className: "ccp-analysisEmpty",
|
|
6824
6970
|
children: text("analysisEmpty")
|
|
6825
|
-
}) : scenarios.length ? /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6971
|
+
}) : scenarios.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6826
6972
|
className: "ccp-analysisModels",
|
|
6827
|
-
children:
|
|
6973
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6974
|
+
className: "ccp-analysisTableHead ccp-analysisScenarioHead",
|
|
6975
|
+
"aria-hidden": "true",
|
|
6976
|
+
children: [
|
|
6977
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisModel") }),
|
|
6978
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisSimulationCost") }),
|
|
6979
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisCoverage") }),
|
|
6980
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text("analysisCapabilities") }),
|
|
6981
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {})
|
|
6982
|
+
]
|
|
6983
|
+
}), scenarios.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScenarioRow, {
|
|
6828
6984
|
m: model,
|
|
6829
6985
|
text
|
|
6830
|
-
}, model.id))
|
|
6986
|
+
}, model.id))]
|
|
6831
6987
|
}) : !report.catalogUnavailable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6832
6988
|
className: "ccp-analysisEmpty",
|
|
6833
6989
|
role: "status",
|
|
@@ -7129,17 +7285,24 @@ window.__ModuleLoader__.load({
|
|
|
7129
7285
|
}) : null,
|
|
7130
7286
|
account.stats.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7131
7287
|
className: "ccp-block",
|
|
7132
|
-
children: [
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7288
|
+
children: [
|
|
7289
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
7290
|
+
className: "ccp-blockTitle",
|
|
7291
|
+
children: text("usage")
|
|
7292
|
+
}),
|
|
7293
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
7294
|
+
className: "ccp-windowReset",
|
|
7295
|
+
children: account.usagePeriod
|
|
7296
|
+
}),
|
|
7297
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7298
|
+
className: "ccp-tiles",
|
|
7299
|
+
children: account.stats.map((stat) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tile, {
|
|
7300
|
+
label: text(stat.label),
|
|
7301
|
+
value: stat.value,
|
|
7302
|
+
sub: stat.sub
|
|
7303
|
+
}, stat.label))
|
|
7304
|
+
})
|
|
7305
|
+
]
|
|
7143
7306
|
}) : null
|
|
7144
7307
|
]
|
|
7145
7308
|
});
|
|
@@ -7180,10 +7343,10 @@ window.__ModuleLoader__.load({
|
|
|
7180
7343
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
7181
7344
|
className: "ccp-title",
|
|
7182
7345
|
children: mode === "analysis" ? `Command Code · ${text("analyticsNav")}` : text("nav")
|
|
7183
|
-
}),
|
|
7346
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
7184
7347
|
className: "ccp-subtitle",
|
|
7185
|
-
children: text("subtitle")
|
|
7186
|
-
})
|
|
7348
|
+
children: text(mode === "quota" ? "subtitle" : "analysisIntro")
|
|
7349
|
+
})]
|
|
7187
7350
|
}),
|
|
7188
7351
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "ccp-spacer" }),
|
|
7189
7352
|
mode === "quota" && view.updatedAt !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -7658,7 +7821,8 @@ window.__ModuleLoader__.load({
|
|
|
7658
7821
|
notes.push(isPeak ? SESSION_COST_COPY.peakRates : SESSION_COST_COPY.offPeakRates);
|
|
7659
7822
|
}
|
|
7660
7823
|
}
|
|
7661
|
-
|
|
7824
|
+
const summary = facts.summaryTokens ?? zeroCostTokens();
|
|
7825
|
+
if (COST_TOKEN_KEYS.some((key) => totals[key] - summary[key] !== count(usage[key])) || !priced) return void 0;
|
|
7662
7826
|
const { total, unpricedCacheWriteTokens } = breakdown;
|
|
7663
7827
|
partial ||= unpricedCacheWriteTokens > 0;
|
|
7664
7828
|
free &&= !partial;
|
|
@@ -8627,108 +8791,135 @@ window.__ModuleLoader__.load({
|
|
|
8627
8791
|
.ccp-tabActive{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-brand-primary)}
|
|
8628
8792
|
|
|
8629
8793
|
@media (prefers-reduced-motion:reduce){.ccp-footFill,.ccp-barFill{transition:none}}
|
|
8630
|
-
/*
|
|
8631
|
-
.ccp-mainInnerAnalysis{max-width:1040px}
|
|
8632
|
-
|
|
8633
|
-
.ccp-
|
|
8634
|
-
.ccp-
|
|
8635
|
-
.ccp-
|
|
8636
|
-
.ccp-analysisFilters .ccp-
|
|
8637
|
-
|
|
8638
|
-
.ccp-
|
|
8639
|
-
/*
|
|
8794
|
+
/* 分析页继承设置页和宿主控件的语义变量;独立选择器不影响账号额度页面。 */
|
|
8795
|
+
.ccp-mainInnerAnalysis{max-width:1040px;box-sizing:border-box}
|
|
8796
|
+
/* 宿主侧栏会缩窄中心面板,按实际可用宽度切换列数,而不是仅看浏览器宽度。 */
|
|
8797
|
+
.ccp-analysis{font-size:14px;line-height:22px;min-width:0;color:var(--dsw-alias-label-primary);container-type:inline-size;container-name:ccp-analysis}
|
|
8798
|
+
.ccp-analysisFilters{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin:8px 0 20px}
|
|
8799
|
+
.ccp-analysisField{display:flex;flex-direction:column;gap:6px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);min-width:0}
|
|
8800
|
+
.ccp-analysisFilters .ccp-analysisField{flex:0 1 158px}
|
|
8801
|
+
.ccp-analysisFilters .ccp-analysisScopeField{flex-basis:184px}
|
|
8802
|
+
.ccp-analysisFilters .ccp-analysisDateField{flex-basis:166px}
|
|
8803
|
+
/* 对齐原生选择器、日期输入与按钮的边框盒;保留独立箭头留白和点击区域。 */
|
|
8804
|
+
.ccp-analysisInput{box-sizing:border-box;width:100%;min-width:0;height:36px;padding:0 11px;font:inherit;font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:.5px solid var(--dsw-alias-border-l4);border-radius:8px}
|
|
8640
8805
|
.ccp-analysisSelectShell{position:relative;display:block;width:100%;min-width:0}
|
|
8641
|
-
.ccp-analysisSelect{appearance:none;-webkit-appearance:none;padding-inline-end:40px;text-overflow:ellipsis;cursor:pointer}
|
|
8806
|
+
.ccp-analysisSelect{appearance:none;-webkit-appearance:none;padding-inline-end:40px;text-overflow:ellipsis;cursor:pointer;border:0;border-radius:18px;background:var(--dsw-alias-bg-module-platform)}
|
|
8642
8807
|
.ccp-analysisSelectShell > .ccp-analysisChevron{position:absolute;inset-inline-end:12px;top:50%;transform:translateY(-50%) rotate(90deg);pointer-events:none}
|
|
8643
|
-
.ccp-analysisSelect:disabled + .ccp-analysisChevron{opacity:.
|
|
8644
|
-
.ccp-analysisInput::placeholder{color:var(--dsw-alias-label-tertiary
|
|
8645
|
-
.ccp-analysisApply{box-sizing:border-box;height:
|
|
8646
|
-
.ccp-analysisApply:disabled{
|
|
8647
|
-
.ccp-
|
|
8808
|
+
.ccp-analysisSelect:disabled + .ccp-analysisChevron{opacity:.6}
|
|
8809
|
+
.ccp-analysisInput::placeholder{color:var(--dsw-alias-label-tertiary)}
|
|
8810
|
+
.ccp-analysisApply{box-sizing:border-box;flex:none;height:36px;font:inherit;font-size:14px;line-height:22px;white-space:nowrap;padding:0 20px;border:0;border-radius:var(--dsw-radius-md,18px);background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);cursor:pointer;margin-left:2px}
|
|
8811
|
+
.ccp-analysisApply:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}
|
|
8812
|
+
.ccp-analysisApply:disabled{opacity:.4;cursor:wait}
|
|
8813
|
+
.ccp-analysisInput:disabled{opacity:.6}
|
|
8648
8814
|
.ccp-analysisInput:focus-visible,.ccp-analysisApply:focus-visible,.ccp-analysisTab:focus-visible,.ccp-analysisPanel:focus-visible,.ccp-analysisModelSummary:focus-visible,.ccp-analysisScenarioSummary:focus-visible,.ccp-analysisDisclosure:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px}
|
|
8649
8815
|
/* 模型列表会裁切圆角,内收焦点框以保持第一行和最后一行也清晰可见。 */
|
|
8650
|
-
.ccp-analysisModelSummary:focus-visible,.ccp-analysisScenarioSummary:focus-visible
|
|
8651
|
-
.ccp-analysisScope{display:flex;justify-content:space-between;gap:
|
|
8652
|
-
.ccp-
|
|
8653
|
-
.ccp-
|
|
8654
|
-
.ccp-
|
|
8655
|
-
.ccp-
|
|
8656
|
-
.ccp-
|
|
8657
|
-
.ccp-
|
|
8658
|
-
.ccp-analysisOverview .ccp-analysisMetric
|
|
8659
|
-
.ccp-analysisOverview .ccp-
|
|
8660
|
-
.ccp-
|
|
8661
|
-
.ccp-
|
|
8662
|
-
.ccp-
|
|
8663
|
-
.ccp-
|
|
8664
|
-
.ccp-
|
|
8665
|
-
.ccp-
|
|
8666
|
-
.ccp-
|
|
8667
|
-
.ccp-
|
|
8668
|
-
|
|
8669
|
-
.ccp-
|
|
8816
|
+
.ccp-analysisModelSummary:focus-visible,.ccp-analysisScenarioSummary:focus-visible{outline-offset:-3px;border-radius:6px}
|
|
8817
|
+
.ccp-analysisScope{display:flex;justify-content:space-between;gap:8px 18px;flex-wrap:wrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px;margin-bottom:12px}
|
|
8818
|
+
.ccp-analysisScope > span:first-child{color:var(--dsw-alias-label-primary);font-weight:500}
|
|
8819
|
+
.ccp-analysisOverview{display:grid;grid-template-columns:1.45fr repeat(3,1fr);gap:20px;padding:16px 18px;background:var(--dsw-alias-bg-layer-3);border:.5px solid var(--dsw-alias-border-l4);border-radius:16px;font-variant-numeric:tabular-nums}
|
|
8820
|
+
.ccp-analysisMetric{display:flex;flex-direction:column;gap:3px;min-width:0}
|
|
8821
|
+
.ccp-analysisLabel{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);font-weight:400}
|
|
8822
|
+
.ccp-analysisValue{font-size:14px;line-height:22px;font-weight:500;overflow-wrap:anywhere}
|
|
8823
|
+
.ccp-analysisSub{display:block;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px;font-weight:400;overflow-wrap:anywhere}
|
|
8824
|
+
.ccp-analysisOverview .ccp-analysisMetric{gap:5px}
|
|
8825
|
+
.ccp-analysisOverview .ccp-analysisValue{font-size:20px;line-height:28px;font-weight:500}
|
|
8826
|
+
.ccp-analysisNote{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);margin:9px 0 0}
|
|
8827
|
+
.ccp-analysisMessage{margin:12px 0 0;padding:12px 14px;border:.5px solid var(--dsw-alias-border-l4);border-radius:12px;background:var(--dsw-alias-bg-layer-3);font-size:14px;line-height:22px}
|
|
8828
|
+
.ccp-analysisWarning{display:flex;align-items:flex-start;gap:8px}
|
|
8829
|
+
.ccp-analysisIcon{flex:none}
|
|
8830
|
+
.ccp-analysisWarning > .ccp-analysisIcon{color:var(--dsw-alias-state-warn-label,var(--dsw-alias-label-secondary));margin-top:3px}
|
|
8831
|
+
.ccp-analysisWarning p{margin:0}
|
|
8832
|
+
.ccp-analysisWarning p + p{margin-top:5px}
|
|
8833
|
+
.ccp-analysisError{color:var(--dsw-alias-state-error-primary)}
|
|
8834
|
+
/* 沿用宿主分段控件的轨道、浮层与胶囊尺寸,保留原有页签键盘语义。 */
|
|
8835
|
+
.ccp-analysisTabs{box-sizing:border-box;display:inline-grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:2px;padding:4px;border:0;border-radius:var(--dsw-radius-md,18px);background:var(--dsw-alias-interactive-bg-hover);margin:22px 0 0;max-width:100%}
|
|
8836
|
+
.ccp-analysisTab{height:28px;padding:0 16px;border:0;border-radius:var(--dsw-radius-sm,14px);background:transparent;font:inherit;font-size:13px;line-height:20px;font-weight:500;color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer}
|
|
8837
|
+
.ccp-analysisTab:hover,.ccp-analysisTab[aria-selected="true"]{color:var(--dsw-alias-label-primary)}
|
|
8838
|
+
.ccp-analysisTab[aria-selected="true"]{background:var(--dsw-alias-bg-layer-1);box-shadow:var(--dsw-elevation-soft)}
|
|
8839
|
+
.ccp-analysisTabCount{display:inline-flex;justify-content:center;min-width:16px;padding:0 4px;margin-left:6px;border-radius:999px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}
|
|
8840
|
+
.ccp-analysisPanel{padding-top:20px;min-width:0}
|
|
8670
8841
|
.ccp-analysisPanel[hidden]{display:none}
|
|
8671
|
-
.ccp-analysisSectionHead{display:flex;align-items:
|
|
8672
|
-
.ccp-analysisHeading{font-size:14px;font-weight:
|
|
8673
|
-
.ccp-analysisSectionHead .ccp-analysisNote{margin:0}
|
|
8674
|
-
.ccp-analysisModels{border
|
|
8675
|
-
.ccp-analysisModelRow{border-top
|
|
8676
|
-
.ccp-
|
|
8677
|
-
.ccp-
|
|
8678
|
-
.ccp-
|
|
8842
|
+
.ccp-analysisSectionHead{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
|
|
8843
|
+
.ccp-analysisHeading{font-size:14px;line-height:22px;font-weight:500;margin:0}
|
|
8844
|
+
.ccp-analysisSectionHead .ccp-analysisNote{margin:0;max-width:56ch}
|
|
8845
|
+
.ccp-analysisModels{border:.5px solid var(--dsw-alias-border-l4);border-radius:16px;overflow:hidden}
|
|
8846
|
+
.ccp-analysisModelRow + .ccp-analysisModelRow{border-top:.5px solid var(--dsw-alias-border-l2)}
|
|
8847
|
+
.ccp-analysisTableHead,.ccp-analysisModelSummary,.ccp-analysisScenarioSummary{position:relative;display:grid;grid-template-columns:minmax(190px,2.1fr) minmax(150px,1.45fr) minmax(90px,.9fr) minmax(90px,.9fr) minmax(100px,1fr) 16px;gap:18px;align-items:center;padding:16px 18px;font-variant-numeric:tabular-nums}
|
|
8848
|
+
.ccp-analysisTableHead{padding-top:11px;padding-bottom:11px;background:var(--dsw-alias-interactive-bg-hover);border-bottom:.5px solid var(--dsw-alias-border-l2);font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
|
|
8849
|
+
.ccp-analysisTableHead > span:not(:first-child){text-align:right}
|
|
8850
|
+
.ccp-analysisScenarioHead,.ccp-analysisScenarioSummary{grid-template-columns:minmax(190px,2fr) minmax(118px,1.1fr) minmax(155px,1.35fr) minmax(142px,1.15fr) 16px}
|
|
8851
|
+
.ccp-analysisScenarioHead > span:nth-child(3),.ccp-analysisScenarioHead > span:nth-child(4){text-align:left}
|
|
8852
|
+
.ccp-analysisModelSummary,.ccp-analysisScenarioSummary{cursor:pointer;list-style:none;min-height:60px}
|
|
8679
8853
|
.ccp-analysisModelSummary::-webkit-details-marker,.ccp-analysisScenarioSummary::-webkit-details-marker,.ccp-analysisDisclosure::-webkit-details-marker{display:none}
|
|
8680
|
-
.ccp-analysisModelSummary:hover,.ccp-analysisScenarioSummary:hover{background:var(--dsw-alias-interactive-bg-hover
|
|
8681
|
-
.ccp-analysisIdentity{display:flex;flex-direction:column;gap:
|
|
8682
|
-
.ccp-analysisModelName{font-size:14px;font-weight:
|
|
8683
|
-
.ccp-
|
|
8854
|
+
.ccp-analysisModelSummary:hover,.ccp-analysisScenarioSummary:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
8855
|
+
.ccp-analysisIdentity{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
8856
|
+
.ccp-analysisModelName{font-size:14px;line-height:22px;font-weight:500;overflow-wrap:anywhere}
|
|
8857
|
+
.ccp-analysisModelCount{margin-top:3px}
|
|
8858
|
+
.ccp-analysisModelSummary > .ccp-analysisMetric,.ccp-analysisScenarioSummary > .ccp-analysisMetric{align-items:flex-end}
|
|
8859
|
+
.ccp-analysisScenarioSummary > .ccp-analysisMetric:nth-child(3),.ccp-analysisScenarioSummary > .ccp-analysisMetric:nth-child(4){align-items:flex-start}
|
|
8860
|
+
/* 宽表使用集中表头,但保留每个指标的无障碍标签;窄面板恢复可见标签。 */
|
|
8861
|
+
.ccp-analysisModelSummary .ccp-analysisMetricLabel,.ccp-analysisScenarioSummary .ccp-analysisMetricLabel,.ccp-analysisSearchLabel{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
8862
|
+
.ccp-analysisShare{display:flex;align-items:center;gap:8px;width:100%;max-width:148px;margin-top:3px}
|
|
8863
|
+
.ccp-analysisShareTrack{display:block;flex:1;height:4px;overflow:hidden;background:var(--dsw-alias-bg-module-platform);border-radius:999px}
|
|
8864
|
+
.ccp-analysisShareFill{display:block;height:100%;background:var(--dsw-alias-label-secondary);border-radius:999px}
|
|
8865
|
+
.ccp-analysisShareValue{font-size:12px;line-height:18px;min-width:40px;text-align:right;color:var(--dsw-alias-label-tertiary)}
|
|
8866
|
+
.ccp-analysisChevron{flex:none;color:var(--dsw-alias-label-tertiary)}
|
|
8684
8867
|
.ccp-analysisModelRow[open] > .ccp-analysisModelSummary > .ccp-analysisChevron,.ccp-analysisModelRow[open] > .ccp-analysisScenarioSummary > .ccp-analysisChevron,.ccp-analysisAggregate[open] > .ccp-analysisDisclosure > .ccp-analysisChevron,.ccp-analysisRules[open] > .ccp-analysisDisclosure > .ccp-analysisChevron{transform:rotate(90deg)}
|
|
8685
|
-
.ccp-analysisDetails{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:
|
|
8686
|
-
.ccp-analysisDetailTitle{font-size:12px;font-weight:600;margin:0 0
|
|
8868
|
+
.ccp-analysisDetails{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px;padding:16px 18px;background:var(--dsw-alias-bg-module-platform);border-top:.5px solid var(--dsw-alias-border-l2)}
|
|
8869
|
+
.ccp-analysisDetailTitle{font-size:12px;line-height:18px;font-weight:600;margin:0 0 11px}
|
|
8687
8870
|
.ccp-analysisFacts{margin:0;display:flex;flex-direction:column;gap:8px}
|
|
8688
|
-
.ccp-analysisFact{display:flex;align-items:baseline;justify-content:space-between;gap:
|
|
8689
|
-
.ccp-analysisFactValue{font-size:14px;margin:0;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0}
|
|
8871
|
+
.ccp-analysisFact{display:flex;align-items:baseline;justify-content:space-between;gap:10px;min-width:0}
|
|
8872
|
+
.ccp-analysisFactValue{font-size:14px;line-height:22px;margin:0;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0}
|
|
8690
8873
|
.ccp-analysisFact .ccp-analysisLabel{flex-shrink:0}
|
|
8691
|
-
.ccp-
|
|
8692
|
-
.ccp-
|
|
8693
|
-
.ccp-
|
|
8694
|
-
.ccp-
|
|
8874
|
+
.ccp-analysisFooter{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap;margin-top:14px}
|
|
8875
|
+
.ccp-analysisAggregate{flex:1;min-width:210px}
|
|
8876
|
+
.ccp-analysisAggregate > .ccp-analysisDetails{border:.5px solid var(--dsw-alias-border-l4);border-radius:8px;margin-top:6px}
|
|
8877
|
+
.ccp-analysisDisclosure{display:flex;gap:7px;align-items:center;cursor:pointer;list-style:none;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);padding:7px 0}
|
|
8878
|
+
.ccp-analysisDisclosure > .ccp-analysisChevron{width:14px;height:14px}
|
|
8879
|
+
.ccp-analysisMonthly{flex:none;max-width:340px;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:2px 8px;align-items:baseline;text-align:right;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);padding-top:5px}
|
|
8880
|
+
.ccp-analysisMonthlyValue{font-size:14px;line-height:22px;font-weight:500;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums}
|
|
8695
8881
|
.ccp-analysisMonthly .ccp-analysisNote{width:100%;margin:0}
|
|
8696
|
-
.ccp-analysisAssumption{font-size:14px;line-height:
|
|
8697
|
-
.ccp-analysisSearch{
|
|
8698
|
-
.ccp-
|
|
8882
|
+
.ccp-analysisAssumption{font-size:14px;line-height:22px;color:var(--dsw-alias-label-tertiary);margin:0 0 18px;max-width:76ch}
|
|
8883
|
+
.ccp-analysisSearch{flex:0 1 270px}
|
|
8884
|
+
.ccp-analysisSearchShell{position:relative;display:block}
|
|
8885
|
+
.ccp-analysisSearchShell > .ccp-analysisIcon{position:absolute;top:10px;left:11px;color:var(--dsw-alias-label-tertiary);pointer-events:none}
|
|
8886
|
+
.ccp-analysisSearch .ccp-analysisInput{padding-left:35px}
|
|
8699
8887
|
.ccp-analysisScenarioDetails{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
|
|
8700
|
-
.ccp-analysisScenarioDetails .ccp-analysisFactValue{max-width:
|
|
8701
|
-
.ccp-analysisEmpty{font-size:14px;color:var(--dsw-alias-label-
|
|
8702
|
-
.ccp-analysisRules{margin-top:22px;border-top
|
|
8703
|
-
.ccp-
|
|
8704
|
-
.ccp-analysisRulesBody{
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
.ccp-
|
|
8708
|
-
.ccp-
|
|
8709
|
-
.ccp-analysisModelSummary{grid-template-columns:repeat(4,minmax(0,1fr)) 16px;gap:12px 16px}
|
|
8710
|
-
.ccp-analysisScenarioSummary{grid-template-columns:repeat(3,minmax(0,1fr)) 16px;gap:12px 16px}
|
|
8888
|
+
.ccp-analysisScenarioDetails .ccp-analysisFactValue{max-width:70%}
|
|
8889
|
+
.ccp-analysisEmpty{font-size:14px;line-height:22px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:34px 18px;margin:0;border:1px dashed var(--dsw-alias-border-l4);border-radius:8px}
|
|
8890
|
+
.ccp-analysisRules{margin-top:22px;border-top:.5px solid var(--dsw-alias-border-l2);padding-top:8px}
|
|
8891
|
+
.ccp-analysisRulesBody{display:grid;grid-template-columns:1fr 1fr;gap:24px;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px;margin-top:9px}
|
|
8892
|
+
.ccp-analysisRulesBody p{margin:0 0 10px}
|
|
8893
|
+
@container ccp-analysis (max-width:920px){
|
|
8894
|
+
.ccp-analysisTableHead{display:none}
|
|
8895
|
+
.ccp-analysisModelSummary{grid-template-columns:repeat(4,minmax(0,1fr)) 16px;gap:12px 18px}
|
|
8896
|
+
.ccp-analysisScenarioSummary{grid-template-columns:repeat(3,minmax(0,1fr)) 16px;gap:12px 18px}
|
|
8711
8897
|
.ccp-analysisModelSummary > .ccp-analysisIdentity,.ccp-analysisScenarioSummary > .ccp-analysisIdentity{grid-column:1/-2}
|
|
8712
|
-
.ccp-analysisModelSummary > .ccp-analysisChevron{grid-column:5;grid-row:1}
|
|
8713
|
-
.ccp-analysisScenarioSummary > .ccp-analysisChevron{grid-column:4;grid-row:1}
|
|
8898
|
+
.ccp-analysisModelSummary > .ccp-analysisChevron{grid-column:5;grid-row:1;justify-self:end}
|
|
8899
|
+
.ccp-analysisScenarioSummary > .ccp-analysisChevron{grid-column:4;grid-row:1;justify-self:end}
|
|
8900
|
+
.ccp-analysisModelSummary > .ccp-analysisMetric,.ccp-analysisScenarioSummary > .ccp-analysisMetric{align-items:flex-start}
|
|
8901
|
+
.ccp-analysisModelSummary .ccp-analysisMetricLabel,.ccp-analysisScenarioSummary .ccp-analysisMetricLabel{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}
|
|
8714
8902
|
.ccp-analysisDetails{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
8715
8903
|
}
|
|
8716
|
-
@
|
|
8717
|
-
.ccp-
|
|
8718
|
-
.ccp-analysisFilters{
|
|
8719
|
-
.ccp-
|
|
8720
|
-
.ccp-
|
|
8721
|
-
.ccp-
|
|
8722
|
-
.ccp-analysisOverview .ccp-analysisMetric{padding:0 12px}
|
|
8723
|
-
.ccp-analysisOverview .ccp-analysisMetric:nth-child(odd){border-left:0;padding-left:0}
|
|
8724
|
-
.ccp-analysisOverview .ccp-analysisValue{font-size:22px}
|
|
8725
|
-
.ccp-analysisModelSummary,.ccp-analysisScenarioSummary{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:16px}
|
|
8904
|
+
@container ccp-analysis (max-width:588px){
|
|
8905
|
+
.ccp-analysisFilters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
|
|
8906
|
+
.ccp-analysisFilters[data-mode="range"] .ccp-analysisScopeField{grid-column:1/-1}
|
|
8907
|
+
.ccp-analysisApply{grid-column:1/-1;margin:0;width:100%}
|
|
8908
|
+
.ccp-analysisOverview{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 18px;padding:16px}
|
|
8909
|
+
.ccp-analysisModelSummary,.ccp-analysisScenarioSummary{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 18px;padding:16px}
|
|
8726
8910
|
.ccp-analysisModelSummary > .ccp-analysisIdentity,.ccp-analysisScenarioSummary > .ccp-analysisIdentity{grid-column:1/-1;padding-right:24px}
|
|
8727
|
-
.ccp-analysisModelSummary > .ccp-analysisChevron,.ccp-analysisScenarioSummary > .ccp-analysisChevron{position:absolute;top:
|
|
8728
|
-
.ccp-analysisDetails{gap:20px;grid-template-columns:1fr}
|
|
8729
|
-
.ccp-
|
|
8730
|
-
.ccp-
|
|
8911
|
+
.ccp-analysisModelSummary > .ccp-analysisChevron,.ccp-analysisScenarioSummary > .ccp-analysisChevron{position:absolute;top:18px;right:16px;grid-column:auto;grid-row:auto}
|
|
8912
|
+
.ccp-analysisDetails,.ccp-analysisScenarioDetails{gap:20px;grid-template-columns:1fr;padding:16px}
|
|
8913
|
+
.ccp-analysisAggregate{width:100%;min-width:0}
|
|
8914
|
+
.ccp-analysisMonthly{width:100%;max-width:none;justify-content:flex-start;text-align:left;padding-top:0}
|
|
8915
|
+
.ccp-analysisSectionHead{align-items:flex-start}
|
|
8916
|
+
.ccp-analysisSectionHead .ccp-analysisSearch{flex-basis:100%;width:100%;order:2}
|
|
8917
|
+
.ccp-analysisRulesBody{grid-template-columns:1fr;gap:12px}
|
|
8918
|
+
/* 英文页签带数量时允许换行,避免轨道或文字撑出宿主的窄面板。 */
|
|
8919
|
+
.ccp-analysisTabs{margin-top:18px;grid-auto-columns:minmax(0,1fr)}
|
|
8920
|
+
.ccp-analysisTab{height:auto;min-height:28px;padding:4px 8px;white-space:normal}
|
|
8731
8921
|
}
|
|
8922
|
+
@media (max-width:640px){.ccp-mainInnerAnalysis{padding:20px 16px 32px}}
|
|
8732
8923
|
`;
|
|
8733
8924
|
//#endregion
|
|
8734
8925
|
//#region src/client/analytics.ts
|