@kenz1117/dsh-ui-usage-billing 0.8.1 → 0.8.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.
Files changed (2) hide show
  1. package/lib/client.js +458 -426
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -34,208 +34,208 @@ window.__ModuleLoader__.load({
34
34
  document.head.appendChild(tag);
35
35
  }
36
36
  var UsageBilling_module_css_default = {
37
- "providerGroup": "VWh0dG_providerGroup",
38
- "pricingToggle": "VWh0dG_pricingToggle",
39
- "heatmapCellEmpty": "VWh0dG_heatmapCellEmpty",
40
- "heroGaugeSvg": "VWh0dG_heroGaugeSvg",
41
- "deltaDown": "VWh0dG_deltaDown",
42
- "kpiDetail": "VWh0dG_kpiDetail",
37
+ "modelDot": "VWh0dG_modelDot",
43
38
  "bandPrice": "VWh0dG_bandPrice",
44
- "heatmap": "VWh0dG_heatmap",
45
- "heroGaugePctOver": "VWh0dG_heroGaugePctOver",
46
- "trigger": "VWh0dG_trigger",
47
- "healthBad": "VWh0dG_healthBad",
48
- "kpiGrid": "VWh0dG_kpiGrid",
49
- "roundsBarLabel": "VWh0dG_roundsBarLabel",
39
+ "kpiTile": "VWh0dG_kpiTile",
40
+ "shareTrack": "VWh0dG_shareTrack",
41
+ "bandTag": "VWh0dG_bandTag",
42
+ "healthBadge": "VWh0dG_healthBadge",
43
+ "healthBadgeBad": "VWh0dG_healthBadgeBad",
50
44
  "planTag": "VWh0dG_planTag",
51
- "rangeButtonActive": "VWh0dG_rangeButtonActive",
52
- "chartLegend": "VWh0dG_chartLegend",
53
- "kpiValue": "VWh0dG_kpiValue",
54
- "heroGaugeArcOver": "VWh0dG_heroGaugeArcOver",
55
- "currencyButtonActive": "VWh0dG_currencyButtonActive",
56
- "headTitleRow": "VWh0dG_headTitleRow",
57
- "budgetFill": "VWh0dG_budgetFill",
58
- "rangeButton": "VWh0dG_rangeButton",
59
- "heroGaugePct": "VWh0dG_heroGaugePct",
60
- "heroSide": "VWh0dG_heroSide",
61
- "shareSegUser": "VWh0dG_shareSegUser",
62
- "chartBar": "VWh0dG_chartBar",
63
- "chartLegendBar": "VWh0dG_chartLegendBar",
64
- "modelName": "VWh0dG_modelName",
65
- "bandPriceOff": "VWh0dG_bandPriceOff",
66
- "closeButton": "VWh0dG_closeButton",
67
- "healthIdle": "VWh0dG_healthIdle",
68
- "liveCostSep": "VWh0dG_liveCostSep",
69
- "subscriptionExhausted": "VWh0dG_subscriptionExhausted",
70
- "roundsBars": "VWh0dG_roundsBars",
71
- "panelTitle": "VWh0dG_panelTitle",
72
- "tableScroll": "VWh0dG_tableScroll",
73
- "providerGroupName": "VWh0dG_providerGroupName",
74
- "triggerPop": "VWh0dG_triggerPop",
75
- "chartSvg": "VWh0dG_chartSvg",
76
- "subscriptionCard": "VWh0dG_subscriptionCard",
77
- "heatmapFooter": "VWh0dG_heatmapFooter",
78
- "tabPanel": "VWh0dG_tabPanel",
79
- "subscriptionFillOver": "VWh0dG_subscriptionFillOver",
80
- "triggerAmountSub": "VWh0dG_triggerAmountSub",
81
- "triggerWrap": "VWh0dG_triggerWrap",
45
+ "pricingChevronOpen": "VWh0dG_pricingChevronOpen",
82
46
  "liveTierOff": "VWh0dG_liveTierOff",
83
- "modelTableScroll": "VWh0dG_modelTableScroll",
84
- "tabButton": "VWh0dG_tabButton",
85
- "currencyToggle": "VWh0dG_currencyToggle",
86
- "pricingTable": "VWh0dG_pricingTable",
87
- "dashboardModal": "VWh0dG_dashboardModal",
88
- "heroLabel": "VWh0dG_heroLabel",
89
- "panel": "VWh0dG_panel",
90
- "panelHint": "VWh0dG_panelHint",
91
- "delta": "VWh0dG_delta",
92
- "shareDot": "VWh0dG_shareDot",
93
- "flatTag": "VWh0dG_flatTag",
47
+ "budgetTrack": "VWh0dG_budgetTrack",
48
+ "liveQuotaCrit": "VWh0dG_liveQuotaCrit",
49
+ "providerGroupList": "VWh0dG_providerGroupList",
50
+ "providerGroupName": "VWh0dG_providerGroupName",
94
51
  "subscriptionStatus": "VWh0dG_subscriptionStatus",
95
- "budgetValue": "VWh0dG_budgetValue",
96
- "tabNav": "VWh0dG_tabNav",
97
- "providerGroupMeta": "VWh0dG_providerGroupMeta",
98
- "kpiTile": "VWh0dG_kpiTile",
99
- "shareSeg": "VWh0dG_shareSeg",
100
- "healthBadgeOk": "VWh0dG_healthBadgeOk",
101
- "exportLabel": "VWh0dG_exportLabel",
102
- "liveCostItem": "VWh0dG_liveCostItem",
103
- "heroValue": "VWh0dG_heroValue",
104
- "chartTooltip": "VWh0dG_chartTooltip",
105
- "shareTrack": "VWh0dG_shareTrack",
52
+ "subscriptionWindow": "VWh0dG_subscriptionWindow",
53
+ "switchKnob": "VWh0dG_switchKnob",
54
+ "modelName": "VWh0dG_modelName",
55
+ "providerGroupBadge": "VWh0dG_providerGroupBadge",
56
+ "heroGaugeArc": "VWh0dG_heroGaugeArc",
57
+ "chartAxisLabel": "VWh0dG_chartAxisLabel",
58
+ "chartLegendBar": "VWh0dG_chartLegendBar",
59
+ "numCol": "VWh0dG_numCol",
106
60
  "providerGroupTitle": "VWh0dG_providerGroupTitle",
107
- "subscriptionName": "VWh0dG_subscriptionName",
61
+ "triggerToday": "VWh0dG_triggerToday",
62
+ "providerGroupBalanceLabel": "VWh0dG_providerGroupBalanceLabel",
63
+ "heatmapLegend": "VWh0dG_heatmapLegend",
64
+ "triggerPop": "VWh0dG_triggerPop",
65
+ "rangeButtonActive": "VWh0dG_rangeButtonActive",
66
+ "heroGaugePct": "VWh0dG_heroGaugePct",
67
+ "railButton": "VWh0dG_railButton",
68
+ "kpiGreen": "VWh0dG_kpiGreen",
69
+ "tabPanelIn": "VWh0dG_tabPanelIn",
108
70
  "pricingToggleText": "VWh0dG_pricingToggleText",
71
+ "heroSide": "VWh0dG_heroSide",
72
+ "shareLegend": "VWh0dG_shareLegend",
73
+ "flatTag": "VWh0dG_flatTag",
74
+ "dashboardRight": "VWh0dG_dashboardRight",
109
75
  "roundsBar": "VWh0dG_roundsBar",
110
- "modelProvider": "VWh0dG_modelProvider",
111
- "triggerPopRow": "VWh0dG_triggerPopRow",
112
- "tabPanelIn": "VWh0dG_tabPanelIn",
113
- "budgetInputWrap": "VWh0dG_budgetInputWrap",
114
- "currencyButton": "VWh0dG_currencyButton",
76
+ "estimatedTag": "VWh0dG_estimatedTag",
77
+ "tabButton": "VWh0dG_tabButton",
78
+ "heroGaugeTrack": "VWh0dG_heroGaugeTrack",
79
+ "chartTooltipSwatch": "VWh0dG_chartTooltipSwatch",
115
80
  "subscriptionFillWarn": "VWh0dG_subscriptionFillWarn",
116
- "providerGroupBadge": "VWh0dG_providerGroupBadge",
117
- "emptyRow": "VWh0dG_emptyRow",
81
+ "subscriptionFillOver": "VWh0dG_subscriptionFillOver",
82
+ "subscriptionPct": "VWh0dG_subscriptionPct",
83
+ "heroGaugePctOver": "VWh0dG_heroGaugePctOver",
84
+ "chartStack": "VWh0dG_chartStack",
85
+ "budgetInputWrap": "VWh0dG_budgetInputWrap",
86
+ "roundsBars": "VWh0dG_roundsBars",
87
+ "roundsAxis": "VWh0dG_roundsAxis",
88
+ "triggerDivider": "VWh0dG_triggerDivider",
89
+ "kpiGrid": "VWh0dG_kpiGrid",
90
+ "triggerPopRow": "VWh0dG_triggerPopRow",
91
+ "heroGaugeCenter": "VWh0dG_heroGaugeCenter",
118
92
  "budgetFillOver": "VWh0dG_budgetFillOver",
119
- "triggerPopValue": "VWh0dG_triggerPopValue",
93
+ "chartTooltip": "VWh0dG_chartTooltip",
94
+ "exportBar": "VWh0dG_exportBar",
95
+ "triggerAmount": "VWh0dG_triggerAmount",
96
+ "tabNav": "VWh0dG_tabNav",
97
+ "shareItem": "VWh0dG_shareItem",
98
+ "shareValue": "VWh0dG_shareValue",
99
+ "healthBadgeOk": "VWh0dG_healthBadgeOk",
100
+ "liveCostSep": "VWh0dG_liveCostSep",
101
+ "liveQuotaWarn": "VWh0dG_liveQuotaWarn",
102
+ "balanceCell": "VWh0dG_balanceCell",
103
+ "currencyToggle": "VWh0dG_currencyToggle",
104
+ "subscriptionGrid": "VWh0dG_subscriptionGrid",
105
+ "roundsBarLabel": "VWh0dG_roundsBarLabel",
106
+ "heatmapCell": "VWh0dG_heatmapCell",
107
+ "delta": "VWh0dG_delta",
108
+ "pricingTable": "VWh0dG_pricingTable",
109
+ "balanceDaysLow": "VWh0dG_balanceDaysLow",
110
+ "roundsBarWrap": "VWh0dG_roundsBarWrap",
120
111
  "rangeToggle": "VWh0dG_rangeToggle",
121
- "chartStack": "VWh0dG_chartStack",
122
- "heroGaugeLabel": "VWh0dG_heroGaugeLabel",
123
- "shareLegend": "VWh0dG_shareLegend",
124
- "switchKnob": "VWh0dG_switchKnob",
125
- "triggerToday": "VWh0dG_triggerToday",
126
- "bandTag": "VWh0dG_bandTag",
127
- "liveCostBar": "VWh0dG_liveCostBar",
128
- "chartLine": "VWh0dG_chartLine",
129
- "chartEmpty": "VWh0dG_chartEmpty",
130
- "budgetLabel": "VWh0dG_budgetLabel",
131
- "dashboardSubtitle": "VWh0dG_dashboardSubtitle",
132
- "budgetOverPulse": "VWh0dG_budgetOverPulse",
133
- "budgetTrack": "VWh0dG_budgetTrack",
134
- "chartTooltipDate": "VWh0dG_chartTooltipDate",
135
- "modelDot": "VWh0dG_modelDot",
136
- "healthDot": "VWh0dG_healthDot",
112
+ "closeButton": "VWh0dG_closeButton",
137
113
  "heroSideLabel": "VWh0dG_heroSideLabel",
114
+ "dashboardHead": "VWh0dG_dashboardHead",
115
+ "providerGroupMeta": "VWh0dG_providerGroupMeta",
116
+ "budgetUnit": "VWh0dG_budgetUnit",
117
+ "uncataloguedTag": "VWh0dG_uncataloguedTag",
118
+ "chartGrid": "VWh0dG_chartGrid",
119
+ "heroValue": "VWh0dG_heroValue",
120
+ "healthIdle": "VWh0dG_healthIdle",
138
121
  "trendPanel": "VWh0dG_trendPanel",
139
- "roundsBarWrap": "VWh0dG_roundsBarWrap",
140
- "dashboardTitle": "VWh0dG_dashboardTitle",
141
- "triggerAmount": "VWh0dG_triggerAmount",
142
- "dashboardBody": "VWh0dG_dashboardBody",
143
- "heroMeta": "VWh0dG_heroMeta",
144
- "heroGaugeArc": "VWh0dG_heroGaugeArc",
145
- "shareSegOff": "VWh0dG_shareSegOff",
146
- "balanceCell": "VWh0dG_balanceCell",
122
+ "shareSeg": "VWh0dG_shareSeg",
123
+ "budgetInput": "VWh0dG_budgetInput",
124
+ "rounds": "VWh0dG_rounds",
125
+ "roundsEmpty": "VWh0dG_roundsEmpty",
126
+ "heatmap": "VWh0dG_heatmap",
127
+ "rateBadgeBuiltin": "VWh0dG_rateBadgeBuiltin",
128
+ "heatmapFooter": "VWh0dG_heatmapFooter",
129
+ "na": "VWh0dG_na",
130
+ "subscriptionWindowLabel": "VWh0dG_subscriptionWindowLabel",
131
+ "emptyRow": "VWh0dG_emptyRow",
132
+ "kpiValue": "VWh0dG_kpiValue",
133
+ "pricingToggle": "VWh0dG_pricingToggle",
134
+ "triggerMeta": "VWh0dG_triggerMeta",
135
+ "heroGauge": "VWh0dG_heroGauge",
136
+ "triggerIcon": "VWh0dG_triggerIcon",
137
+ "chartEmpty": "VWh0dG_chartEmpty",
138
+ "budgetControls": "VWh0dG_budgetControls",
139
+ "roundsFlagMark": "VWh0dG_roundsFlagMark",
140
+ "heroSideValue": "VWh0dG_heroSideValue",
141
+ "modelProvider": "VWh0dG_modelProvider",
147
142
  "roundsBarCol": "VWh0dG_roundsBarCol",
148
- "subscriptionTrack": "VWh0dG_subscriptionTrack",
143
+ "exportButton": "VWh0dG_exportButton",
144
+ "subscriptionPlan": "VWh0dG_subscriptionPlan",
145
+ "healthDot": "VWh0dG_healthDot",
146
+ "chartLegend": "VWh0dG_chartLegend",
147
+ "kpiDetail": "VWh0dG_kpiDetail",
148
+ "heroGaugeLabel": "VWh0dG_heroGaugeLabel",
149
+ "chartLegendLine": "VWh0dG_chartLegendLine",
150
+ "subscriptionFill": "VWh0dG_subscriptionFill",
151
+ "subscriptionReset": "VWh0dG_subscriptionReset",
152
+ "chartWrap": "VWh0dG_chartWrap",
153
+ "exportLabel": "VWh0dG_exportLabel",
149
154
  "kpiLabel": "VWh0dG_kpiLabel",
150
155
  "providerGroupHead": "VWh0dG_providerGroupHead",
151
- "heatmapLegend": "VWh0dG_heatmapLegend",
152
- "subscriptionFill": "VWh0dG_subscriptionFill",
153
- "hero": "VWh0dG_hero",
154
- "heroMain": "VWh0dG_heroMain",
155
- "shareSegAssistant": "VWh0dG_shareSegAssistant",
156
- "chartLegendLine": "VWh0dG_chartLegendLine",
157
- "dashboardIn": "VWh0dG_dashboardIn",
158
- "providerGroupBalanceLabel": "VWh0dG_providerGroupBalanceLabel",
156
+ "heatmapGrid": "VWh0dG_heatmapGrid",
159
157
  "heroSideItem": "VWh0dG_heroSideItem",
160
- "numCol": "VWh0dG_numCol",
161
- "triggerIcon": "VWh0dG_triggerIcon",
162
- "estimatedTag": "VWh0dG_estimatedTag",
163
- "roundsBarFlagged": "VWh0dG_roundsBarFlagged",
164
- "providerGroupBalance": "VWh0dG_providerGroupBalance",
158
+ "rateBadgeLive": "VWh0dG_rateBadgeLive",
159
+ "bandPriceOff": "VWh0dG_bandPriceOff",
160
+ "liveCostBar": "VWh0dG_liveCostBar",
161
+ "dashboardIn": "VWh0dG_dashboardIn",
162
+ "currencyButtonActive": "VWh0dG_currencyButtonActive",
163
+ "triggerAmountSub": "VWh0dG_triggerAmountSub",
164
+ "shareSegUser": "VWh0dG_shareSegUser",
165
+ "heroMain": "VWh0dG_heroMain",
166
+ "switchOn": "VWh0dG_switchOn",
167
+ "liveTierPeak": "VWh0dG_liveTierPeak",
168
+ "heatmapHover": "VWh0dG_heatmapHover",
165
169
  "triggerPopLabel": "VWh0dG_triggerPopLabel",
166
- "heroGauge": "VWh0dG_heroGauge",
167
- "triggerMonth": "VWh0dG_triggerMonth",
168
- "shareSegPeak": "VWh0dG_shareSegPeak",
169
- "subscriptionPct": "VWh0dG_subscriptionPct",
170
- "exportButton": "VWh0dG_exportButton",
171
- "chartCrosshair": "VWh0dG_chartCrosshair",
170
+ "tabPanel": "VWh0dG_tabPanel",
171
+ "roundsBarFlagged": "VWh0dG_roundsBarFlagged",
172
+ "dashboardBody": "VWh0dG_dashboardBody",
173
+ "panel": "VWh0dG_panel",
174
+ "triggerPopBars": "VWh0dG_triggerPopBars",
175
+ "budgetFill": "VWh0dG_budgetFill",
176
+ "rangeButton": "VWh0dG_rangeButton",
177
+ "dashboardSubtitle": "VWh0dG_dashboardSubtitle",
178
+ "dashboard": "VWh0dG_dashboard",
179
+ "heroGaugeSvg": "VWh0dG_heroGaugeSvg",
180
+ "pricingChevron": "VWh0dG_pricingChevron",
172
181
  "bandTagOff": "VWh0dG_bandTagOff",
173
- "shareValue": "VWh0dG_shareValue",
174
- "kpiGreen": "VWh0dG_kpiGreen",
175
- "liveQuotaCrit": "VWh0dG_liveQuotaCrit",
176
- "subscriptionGrid": "VWh0dG_subscriptionGrid",
177
- "subscriptionWindowLabel": "VWh0dG_subscriptionWindowLabel",
178
- "pricingChevronOpen": "VWh0dG_pricingChevronOpen",
179
- "railButton": "VWh0dG_railButton",
180
- "rounds": "VWh0dG_rounds",
181
- "roundsFlagMark": "VWh0dG_roundsFlagMark",
182
- "roundsAxis": "VWh0dG_roundsAxis",
183
- "heatmapCell": "VWh0dG_heatmapCell",
184
- "budgetHead": "VWh0dG_budgetHead",
185
- "heroSideValue": "VWh0dG_heroSideValue",
186
- "budget": "VWh0dG_budget",
187
- "providerGroupList": "VWh0dG_providerGroupList",
188
- "modelTable": "VWh0dG_modelTable",
189
- "roundsEmpty": "VWh0dG_roundsEmpty",
190
- "heatmapGrid": "VWh0dG_heatmapGrid",
191
- "budgetControls": "VWh0dG_budgetControls",
192
- "na": "VWh0dG_na",
193
- "triggerDivider": "VWh0dG_triggerDivider",
194
- "heroGaugeCenter": "VWh0dG_heroGaugeCenter",
195
- "modelCell": "VWh0dG_modelCell",
196
- "dashboardRight": "VWh0dG_dashboardRight",
197
- "panelHead": "VWh0dG_panelHead",
198
- "switchOn": "VWh0dG_switchOn",
199
- "balanceDaysLow": "VWh0dG_balanceDaysLow",
200
- "heroGaugeTrack": "VWh0dG_heroGaugeTrack",
201
- "dashboardHead": "VWh0dG_dashboardHead",
202
- "liveQuotaWarn": "VWh0dG_liveQuotaWarn",
182
+ "headTitleRow": "VWh0dG_headTitleRow",
183
+ "providerGroup": "VWh0dG_providerGroup",
184
+ "dashboardTitle": "VWh0dG_dashboardTitle",
185
+ "liveCostItem": "VWh0dG_liveCostItem",
203
186
  "triggerPopBar": "VWh0dG_triggerPopBar",
204
- "deltaUp": "VWh0dG_deltaUp",
205
- "subscriptionHead": "VWh0dG_subscriptionHead",
206
- "costCol": "VWh0dG_costCol",
207
- "chartTooltipSwatch": "VWh0dG_chartTooltipSwatch",
208
- "liveTierPeak": "VWh0dG_liveTierPeak",
209
- "roundsFlagBadge": "VWh0dG_roundsFlagBadge",
210
- "rateBadge": "VWh0dG_rateBadge",
211
- "exportBar": "VWh0dG_exportBar",
212
- "chartAxisLabel": "VWh0dG_chartAxisLabel",
213
- "chartWrap": "VWh0dG_chartWrap",
214
- "rateBadgeBuiltin": "VWh0dG_rateBadgeBuiltin",
215
- "uncataloguedTag": "VWh0dG_uncataloguedTag",
216
- "shareItem": "VWh0dG_shareItem",
217
- "healthBadgeBad": "VWh0dG_healthBadgeBad",
187
+ "modelTableScroll": "VWh0dG_modelTableScroll",
188
+ "chartBar": "VWh0dG_chartBar",
189
+ "heroLabel": "VWh0dG_heroLabel",
190
+ "subscriptionExhausted": "VWh0dG_subscriptionExhausted",
191
+ "heatmapCellEmpty": "VWh0dG_heatmapCellEmpty",
218
192
  "balanceDays": "VWh0dG_balanceDays",
219
- "switch": "VWh0dG_switch",
220
- "subscriptionReset": "VWh0dG_subscriptionReset",
221
- "pricingChevron": "VWh0dG_pricingChevron",
222
- "heatmapHover": "VWh0dG_heatmapHover",
223
- "triggerMeta": "VWh0dG_triggerMeta",
224
- "chartDot": "VWh0dG_chartDot",
193
+ "subscriptionCard": "VWh0dG_subscriptionCard",
194
+ "budgetValue": "VWh0dG_budgetValue",
195
+ "panelTitle": "VWh0dG_panelTitle",
196
+ "budgetFillWarn": "VWh0dG_budgetFillWarn",
197
+ "panelHint": "VWh0dG_panelHint",
198
+ "shareSegPeak": "VWh0dG_shareSegPeak",
225
199
  "chartTooltipRow": "VWh0dG_chartTooltipRow",
226
- "chartGrid": "VWh0dG_chartGrid",
200
+ "deltaUp": "VWh0dG_deltaUp",
201
+ "chartTooltipDate": "VWh0dG_chartTooltipDate",
202
+ "costCol": "VWh0dG_costCol",
203
+ "healthBad": "VWh0dG_healthBad",
204
+ "shareSegOff": "VWh0dG_shareSegOff",
205
+ "subscriptionName": "VWh0dG_subscriptionName",
206
+ "chartCrosshair": "VWh0dG_chartCrosshair",
207
+ "providerGroupBalance": "VWh0dG_providerGroupBalance",
208
+ "modelCell": "VWh0dG_modelCell",
209
+ "chartDot": "VWh0dG_chartDot",
210
+ "tableScroll": "VWh0dG_tableScroll",
211
+ "shareSegAssistant": "VWh0dG_shareSegAssistant",
212
+ "dashboardModal": "VWh0dG_dashboardModal",
213
+ "currencyButton": "VWh0dG_currencyButton",
214
+ "heroMeta": "VWh0dG_heroMeta",
227
215
  "tabButtonActive": "VWh0dG_tabButtonActive",
228
- "budgetInput": "VWh0dG_budgetInput",
229
- "shareSegTool": "VWh0dG_shareSegTool",
230
- "budgetFillWarn": "VWh0dG_budgetFillWarn",
231
- "triggerPopBars": "VWh0dG_triggerPopBars",
232
- "dashboard": "VWh0dG_dashboard",
216
+ "panelHead": "VWh0dG_panelHead",
217
+ "rateBadge": "VWh0dG_rateBadge",
218
+ "trigger": "VWh0dG_trigger",
219
+ "switch": "VWh0dG_switch",
220
+ "hero": "VWh0dG_hero",
221
+ "budgetLabel": "VWh0dG_budgetLabel",
222
+ "subscriptionHead": "VWh0dG_subscriptionHead",
223
+ "roundsFlagBadge": "VWh0dG_roundsFlagBadge",
224
+ "budget": "VWh0dG_budget",
225
+ "triggerWrap": "VWh0dG_triggerWrap",
226
+ "heroGaugeArcOver": "VWh0dG_heroGaugeArcOver",
227
+ "budgetOverPulse": "VWh0dG_budgetOverPulse",
228
+ "chartSvg": "VWh0dG_chartSvg",
229
+ "subscriptionTrack": "VWh0dG_subscriptionTrack",
230
+ "chartLine": "VWh0dG_chartLine",
231
+ "triggerMonth": "VWh0dG_triggerMonth",
232
+ "modelTable": "VWh0dG_modelTable",
233
233
  "healthOk": "VWh0dG_healthOk",
234
- "healthBadge": "VWh0dG_healthBadge",
235
- "subscriptionPlan": "VWh0dG_subscriptionPlan",
236
- "rateBadgeLive": "VWh0dG_rateBadgeLive",
237
- "subscriptionWindow": "VWh0dG_subscriptionWindow",
238
- "budgetUnit": "VWh0dG_budgetUnit"
234
+ "deltaDown": "VWh0dG_deltaDown",
235
+ "shareSegTool": "VWh0dG_shareSegTool",
236
+ "budgetHead": "VWh0dG_budgetHead",
237
+ "shareDot": "VWh0dG_shareDot",
238
+ "triggerPopValue": "VWh0dG_triggerPopValue"
239
239
  };
240
240
  //#endregion
241
241
  //#region src/client/plan-knowledge.ts
@@ -1118,6 +1118,20 @@ window.__ModuleLoader__.load({
1118
1118
  if (price >= 10) return `¥${price.toFixed(1)}`;
1119
1119
  return `¥${price.toFixed(2)}`;
1120
1120
  }
1121
+ /**
1122
+ * 把一条「每百万 token」单价从原生币种换算到目标展示币种(按 USD→CNY 汇率)。
1123
+ * 汇率缺失/非法时回退原值,避免 0 汇率把价格算没。
1124
+ * @param price - 原生币种单价。
1125
+ * @param native - 模型原生币种。
1126
+ * @param target - 用户当前展示币种。
1127
+ * @param rate - USD→CNY 汇率(1 USD = rate CNY)。
1128
+ * @returns 换算到目标币种的单价;同币种或汇率不可用时原值。
1129
+ */
1130
+ function convertUnitPrice(price, native, target, rate) {
1131
+ if (rate <= 0 || !Number.isFinite(rate)) return price;
1132
+ if (native === (target === "usd" ? "USD" : "CNY")) return price;
1133
+ return target === "usd" ? price / rate : price * rate;
1134
+ }
1121
1135
  /** Format a large token count with B/M/K suffix. */
1122
1136
  function formatTokens(value) {
1123
1137
  if (value >= 1e9) return `${(value / 1e9).toFixed(2)}B`;
@@ -1762,6 +1776,245 @@ window.__ModuleLoader__.load({
1762
1776
  URL.revokeObjectURL(url);
1763
1777
  }
1764
1778
  //#endregion
1779
+ //#region src/client/locales.ts
1780
+ const NS = "usageBilling";
1781
+ const zh = {
1782
+ "billing.title": "使用统计",
1783
+ "billing.subtitle": "计费仪表盘",
1784
+ "billing.cost": "费用",
1785
+ "billing.todayCost": "今日费用",
1786
+ "billing.monthCost": "本月费用",
1787
+ "billing.yearCost": "本年费用",
1788
+ "billing.monthProjected": "本月预计",
1789
+ "billing.liveTurn": "本轮",
1790
+ "billing.liveSession": "会话",
1791
+ "billing.totalCost": "总费用",
1792
+ "billing.calls": "调用",
1793
+ "billing.cacheHitRate": "缓存命中率",
1794
+ "billing.tokens": "Token",
1795
+ "billing.inputTokens": "输入",
1796
+ "billing.outputTokens": "输出",
1797
+ "billing.avgCost": "平均成本",
1798
+ "billing.trend": "每日费用与调用趋势",
1799
+ "billing.trend7d": "7 天",
1800
+ "billing.trend30d": "30 天",
1801
+ "billing.trendEmpty": "暂无趋势数据",
1802
+ "billing.budget": "本月预算",
1803
+ "billing.sessions": "会话明细",
1804
+ "billing.project": "项目",
1805
+ "billing.lastActive": "最后活跃",
1806
+ "billing.sessionOverflow": "仅显示花费前 {limit} 个,共 {total} 个会话",
1807
+ "billing.budgetTierBody": "本月花费 {cost} 已达预算 {budget} 的 {pct}%",
1808
+ "billing.models": "模型计费明细",
1809
+ "billing.providerBilling": "厂商计费与订阅",
1810
+ "billing.estimated": "估算",
1811
+ "billing.actual": "实际",
1812
+ "billing.pricing": "模型单价表",
1813
+ "billing.showPricing": "查看模型单价",
1814
+ "billing.hidePricing": "收起单价表",
1815
+ "billing.pricePerM": "¥ / 1M tokens",
1816
+ "billing.input": "输入",
1817
+ "billing.output": "输出",
1818
+ "billing.cacheHit": "缓存命中",
1819
+ "billing.peak": "高峰",
1820
+ "billing.offPeak": "低谷",
1821
+ "billing.flat": "全天统一",
1822
+ "billing.peakHours": "高峰时段",
1823
+ "billing.band": "时段",
1824
+ "billing.openDashboard": "打开计费仪表盘",
1825
+ "billing.close": "关闭",
1826
+ "billing.lastUpdated": "数据更新于",
1827
+ "billing.noData": "暂无计费数据",
1828
+ "billing.todayRate": "今日汇率",
1829
+ "billing.rateLive": "实时",
1830
+ "billing.rateBuiltin": "内置",
1831
+ "billing.balance": "余额",
1832
+ "billing.balanceUnconfigured": "未配置",
1833
+ "billing.balanceUnauthorized": "密钥无效",
1834
+ "billing.balanceUnreachable": "查询失败",
1835
+ "billing.uncatalogued": "未收录",
1836
+ "billing.estimatedPricing": "估算价",
1837
+ "billing.balanceDays": "约可撑 {days} 天",
1838
+ "billing.balanceLowBody": "{name} 余额 {balance},约可撑 {days} 天,请及时充值",
1839
+ "billing.subscriptions": "订阅套餐",
1840
+ "billing.subscriptionNotConfigured": "未配置密钥",
1841
+ "billing.subscriptionUnauthorized": "密钥无效",
1842
+ "billing.subscriptionUnavailable": "查询失败",
1843
+ "billing.subscriptionInvalid": "响应异常",
1844
+ "billing.subscriptionRateLimited": "触发限流",
1845
+ "billing.subscriptionSession": "本次",
1846
+ "billing.subscriptionWeekly": "本周",
1847
+ "billing.subscriptionMonthly": "本月",
1848
+ "billing.subscriptionBilling": "计费周期",
1849
+ "billing.subscriptionRemaining": "剩余 {pct}%",
1850
+ "billing.subscriptionExhausted": "已用尽",
1851
+ "billing.subscriptionReset": "{date} 重置",
1852
+ "billing.subscriptionNoApi": "该厂商暂未提供用量查询接口",
1853
+ "billing.heatmapLess": "少",
1854
+ "billing.heatmapMore": "多",
1855
+ "billing.currency": "币种",
1856
+ "billing.currencyCny": "人民币",
1857
+ "billing.currencyUsd": "美元",
1858
+ "billing.heatmap": "用量热力图",
1859
+ "billing.rounds": "每轮费用",
1860
+ "billing.anomaly": "成本突增",
1861
+ "billing.workspaces": "工作区统计",
1862
+ "billing.plan": "套餐",
1863
+ "billing.remaining": "剩余",
1864
+ "billing.unknownModel": "未定价",
1865
+ "billing.model": "模型",
1866
+ "billing.currentRound": "当前",
1867
+ "billing.costAbbr": "费用",
1868
+ "billing.tabOverview": "概览",
1869
+ "billing.tabTrends": "趋势",
1870
+ "billing.tabProviders": "明细",
1871
+ "billing.tabDetails": "统计",
1872
+ "billing.tabPricing": "费率",
1873
+ "billing.export": "导出",
1874
+ "billing.exportCsvDay": "按日 CSV",
1875
+ "billing.exportCsvSession": "按会话 CSV",
1876
+ "billing.exportJson": "全量 JSON",
1877
+ "billing.peakShare": "峰谷时段占比",
1878
+ "billing.peakShareHint": "近 {count} 轮",
1879
+ "billing.weekCost": "本周",
1880
+ "billing.roleCost": "费用构成",
1881
+ "billing.roleUser": "用户输入",
1882
+ "billing.roleAssistant": "助手输出",
1883
+ "billing.roleTool": "工具结果",
1884
+ "billing.roleHint": "估算:输出按实测计价,输入按消息长度摊分",
1885
+ "billing.tierPeak": "峰时",
1886
+ "billing.tierOff": "平价",
1887
+ "billing.tierToPeak": "后转峰时",
1888
+ "billing.tierToOff": "后转平价",
1889
+ "billing.tierAlertEnterPeak": "{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等",
1890
+ "billing.tierAlertEnterOff": "{minutes} 分钟后进入平价(价格减半)",
1891
+ "billing.planTypeCode": "订阅制",
1892
+ "billing.planTypeToken": "按量",
1893
+ "billing.subscriptionFeePerMonth": "{amount}/月",
1894
+ "billing.triggerToday": "今日",
1895
+ "billing.triggerMonth": "当月",
1896
+ "billing.subscriptionIncluded": "订阅包含",
1897
+ "billing.free": "免费"
1898
+ };
1899
+ const en = {
1900
+ "billing.title": "Usage",
1901
+ "billing.subtitle": "Billing dashboard",
1902
+ "billing.cost": "Cost",
1903
+ "billing.todayCost": "Today",
1904
+ "billing.monthCost": "This month",
1905
+ "billing.yearCost": "This year",
1906
+ "billing.monthProjected": "Projected",
1907
+ "billing.liveTurn": "Turn",
1908
+ "billing.liveSession": "Session",
1909
+ "billing.totalCost": "Total",
1910
+ "billing.calls": "Calls",
1911
+ "billing.cacheHitRate": "Cache Hit",
1912
+ "billing.tokens": "Tokens",
1913
+ "billing.inputTokens": "Input",
1914
+ "billing.outputTokens": "Output",
1915
+ "billing.avgCost": "Avg cost",
1916
+ "billing.trend": "Daily cost & calls",
1917
+ "billing.trend7d": "7D",
1918
+ "billing.trend30d": "30D",
1919
+ "billing.trendEmpty": "No trend data yet",
1920
+ "billing.budget": "Monthly budget",
1921
+ "billing.sessions": "Sessions",
1922
+ "billing.project": "Project",
1923
+ "billing.lastActive": "Last active",
1924
+ "billing.sessionOverflow": "Top {limit} of {total} sessions by cost",
1925
+ "billing.budgetTierBody": "This month {cost} reached {pct}% of the budget {budget}",
1926
+ "billing.models": "Model billing",
1927
+ "billing.providerBilling": "Provider billing & subscriptions",
1928
+ "billing.estimated": "Est.",
1929
+ "billing.actual": "Actual",
1930
+ "billing.pricing": "Model pricing",
1931
+ "billing.showPricing": "View pricing",
1932
+ "billing.hidePricing": "Hide pricing",
1933
+ "billing.pricePerM": "¥ / 1M tokens",
1934
+ "billing.input": "Input",
1935
+ "billing.output": "Output",
1936
+ "billing.cacheHit": "Cache hit",
1937
+ "billing.peak": "Peak",
1938
+ "billing.offPeak": "Off-peak",
1939
+ "billing.flat": "Flat",
1940
+ "billing.peakHours": "Peak hours",
1941
+ "billing.band": "Band",
1942
+ "billing.openDashboard": "Open billing dashboard",
1943
+ "billing.close": "Close",
1944
+ "billing.lastUpdated": "Updated",
1945
+ "billing.noData": "No billing data yet",
1946
+ "billing.todayRate": "Today rate",
1947
+ "billing.rateLive": "Live",
1948
+ "billing.rateBuiltin": "Built-in",
1949
+ "billing.balance": "Balance",
1950
+ "billing.balanceUnconfigured": "Not set",
1951
+ "billing.balanceUnauthorized": "Bad key",
1952
+ "billing.balanceUnreachable": "Unavailable",
1953
+ "billing.uncatalogued": "Not catalogued",
1954
+ "billing.estimatedPricing": "Estimated",
1955
+ "billing.balanceDays": "~{days} days left",
1956
+ "billing.balanceLowBody": "{name} balance {balance}, ~{days} days left, please top up",
1957
+ "billing.subscriptions": "Subscriptions",
1958
+ "billing.subscriptionNotConfigured": "Key not set",
1959
+ "billing.subscriptionUnauthorized": "Bad key",
1960
+ "billing.subscriptionUnavailable": "Unavailable",
1961
+ "billing.subscriptionInvalid": "Bad response",
1962
+ "billing.subscriptionRateLimited": "Rate limited",
1963
+ "billing.subscriptionSession": "Current",
1964
+ "billing.subscriptionWeekly": "Weekly",
1965
+ "billing.subscriptionMonthly": "Monthly",
1966
+ "billing.subscriptionBilling": "Billing",
1967
+ "billing.subscriptionRemaining": "{pct}% left",
1968
+ "billing.subscriptionExhausted": "Exhausted",
1969
+ "billing.subscriptionReset": "Resets {date}",
1970
+ "billing.subscriptionNoApi": "Provider does not offer a usage API",
1971
+ "billing.heatmapLess": "Less",
1972
+ "billing.heatmapMore": "More",
1973
+ "billing.currency": "Currency",
1974
+ "billing.currencyCny": "CNY",
1975
+ "billing.currencyUsd": "USD",
1976
+ "billing.heatmap": "Usage heatmap",
1977
+ "billing.rounds": "Cost per turn",
1978
+ "billing.anomaly": "Cost spike",
1979
+ "billing.workspaces": "Workspaces",
1980
+ "billing.plan": "Plan",
1981
+ "billing.remaining": "Left",
1982
+ "billing.unknownModel": "Unpriced",
1983
+ "billing.model": "Model",
1984
+ "billing.currentRound": "current",
1985
+ "billing.costAbbr": "cost",
1986
+ "billing.tabOverview": "Overview",
1987
+ "billing.tabTrends": "Trends",
1988
+ "billing.tabProviders": "Details",
1989
+ "billing.tabDetails": "Stats",
1990
+ "billing.tabPricing": "Rates",
1991
+ "billing.export": "Export",
1992
+ "billing.exportCsvDay": "Daily CSV",
1993
+ "billing.exportCsvSession": "Sessions CSV",
1994
+ "billing.exportJson": "Full JSON",
1995
+ "billing.peakShare": "Peak vs off-peak",
1996
+ "billing.peakShareHint": "last {count} turns",
1997
+ "billing.weekCost": "This week",
1998
+ "billing.roleCost": "Cost breakdown",
1999
+ "billing.roleUser": "User input",
2000
+ "billing.roleAssistant": "Assistant output",
2001
+ "billing.roleTool": "Tool results",
2002
+ "billing.roleHint": "Estimated: output priced exactly, input split by message size",
2003
+ "billing.tierPeak": "Peak",
2004
+ "billing.tierOff": "Off-peak",
2005
+ "billing.tierToPeak": "until peak",
2006
+ "billing.tierToOff": "until off-peak",
2007
+ "billing.tierAlertEnterPeak": "Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait",
2008
+ "billing.tierAlertEnterOff": "Off-peak pricing (50% off) starts in {minutes} min",
2009
+ "billing.planTypeCode": "Subscription",
2010
+ "billing.planTypeToken": "Usage",
2011
+ "billing.subscriptionFeePerMonth": "{amount}/mo",
2012
+ "billing.triggerToday": "Today",
2013
+ "billing.triggerMonth": "This month",
2014
+ "billing.subscriptionIncluded": "Included",
2015
+ "billing.free": "Free"
2016
+ };
2017
+ //#endregion
1765
2018
  //#region src/client/UsageBilling.tsx
1766
2019
  /**
1767
2020
  * UsageBilling: sidebar footer trigger + full billing dashboard modal.
@@ -2231,7 +2484,7 @@ window.__ModuleLoader__.load({
2231
2484
  className: UsageBilling_module_css_default.trigger,
2232
2485
  "data-testid": "billing-trigger",
2233
2486
  onClick: onOpen,
2234
- title: `${t("billing.title")} · 本月 ${formatMoney(monthCost)}`,
2487
+ title: `${t("billing.title")} · ${t("billing.triggerMonth")} ${formatMoney(monthCost)}`,
2235
2488
  children: [
2236
2489
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2237
2490
  className: UsageBilling_module_css_default.triggerIcon,
@@ -2243,7 +2496,7 @@ window.__ModuleLoader__.load({
2243
2496
  "data-testid": "billing-trigger-today",
2244
2497
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2245
2498
  className: UsageBilling_module_css_default.triggerMeta,
2246
- children: "今日"
2499
+ children: t("billing.triggerToday")
2247
2500
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2248
2501
  className: UsageBilling_module_css_default.triggerAmount,
2249
2502
  children: formatMoney(todayCost)
@@ -2255,7 +2508,7 @@ window.__ModuleLoader__.load({
2255
2508
  "data-testid": "billing-trigger-month",
2256
2509
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2257
2510
  className: UsageBilling_module_css_default.triggerMeta,
2258
- children: "当月"
2511
+ children: t("billing.triggerMonth")
2259
2512
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2260
2513
  className: UsageBilling_module_css_default.triggerAmountSub,
2261
2514
  children: formatMoney(monthCost)
@@ -2321,6 +2574,7 @@ window.__ModuleLoader__.load({
2321
2574
  const [trendDays, setTrendDays] = (0, react.useState)(7);
2322
2575
  const rateInfo = getRateInfo();
2323
2576
  const money = (cny) => formatMoney(currency === "usd" ? cnyToUsd(cny) : cny, currency);
2577
+ const unitMoney = (price, native) => price === 0 ? t("billing.free") : formatUnitPrice(convertUnitPrice(price, native, currency, rateInfo.rate), currency === "usd" ? "USD" : "CNY");
2324
2578
  const roundFlags = (0, react.useMemo)(() => flagAnomalies([...turns].reverse()), [turns]);
2325
2579
  const peakShare = (0, react.useMemo)(() => peakOffpeakCost(turns), [turns]);
2326
2580
  const roleRows = (0, react.useMemo)(() => {
@@ -2766,8 +3020,8 @@ window.__ModuleLoader__.load({
2766
3020
  step: 1,
2767
3021
  value: budgetAmount === 0 ? "" : budgetAmount,
2768
3022
  placeholder: stats.budget !== void 0 ? String(stats.budget) : "0",
2769
- "aria-label": `${t("billing.budget")}(元)`,
2770
- title: `${t("billing.budget")}(元)`,
3023
+ "aria-label": `${t("billing.budget")}(${currency === "usd" ? "USD" : "CNY"})`,
3024
+ title: `${t("billing.budget")}(${currency === "usd" ? "USD" : "CNY"})`,
2771
3025
  onChange: (e) => {
2772
3026
  onBudgetAmount(e.target.valueAsNumber);
2773
3027
  }
@@ -3192,7 +3446,7 @@ window.__ModuleLoader__.load({
3192
3446
  className: UsageBilling_module_css_default.numCol,
3193
3447
  children: row.plan ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3194
3448
  className: UsageBilling_module_css_default.planTag,
3195
- children: "订阅包含"
3449
+ children: t("billing.subscriptionIncluded")
3196
3450
  }) : row.actual !== void 0 ? money(row.actual) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3197
3451
  className: UsageBilling_module_css_default.na,
3198
3452
  children: "—"
@@ -3558,11 +3812,11 @@ window.__ModuleLoader__.load({
3558
3812
  className: UsageBilling_module_css_default.numCol,
3559
3813
  children: hasPrice ? entry.price.offPeak !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3560
3814
  className: UsageBilling_module_css_default.bandPrice,
3561
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: formatUnitPrice(entry.price.input, entry.price.currency) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3815
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: unitMoney(entry.price.input, entry.price.currency) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3562
3816
  className: UsageBilling_module_css_default.bandPriceOff,
3563
- children: formatUnitPrice(entry.price.offPeak.input, entry.price.currency)
3817
+ children: unitMoney(entry.price.offPeak.input, entry.price.currency)
3564
3818
  })]
3565
- }) : formatUnitPrice(entry.price.input, entry.price.currency) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3819
+ }) : unitMoney(entry.price.input, entry.price.currency) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3566
3820
  className: UsageBilling_module_css_default.na,
3567
3821
  children: "—"
3568
3822
  })
@@ -3571,11 +3825,11 @@ window.__ModuleLoader__.load({
3571
3825
  className: UsageBilling_module_css_default.numCol,
3572
3826
  children: hasPrice ? entry.price.offPeak !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3573
3827
  className: UsageBilling_module_css_default.bandPrice,
3574
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: formatUnitPrice(entry.price.cacheHit, entry.price.currency) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3828
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: unitMoney(entry.price.cacheHit, entry.price.currency) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3575
3829
  className: UsageBilling_module_css_default.bandPriceOff,
3576
- children: formatUnitPrice(entry.price.offPeak.cacheHit, entry.price.currency)
3830
+ children: unitMoney(entry.price.offPeak.cacheHit, entry.price.currency)
3577
3831
  })]
3578
- }) : formatUnitPrice(entry.price.cacheHit, entry.price.currency) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3832
+ }) : unitMoney(entry.price.cacheHit, entry.price.currency) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3579
3833
  className: UsageBilling_module_css_default.na,
3580
3834
  children: "—"
3581
3835
  })
@@ -3584,11 +3838,11 @@ window.__ModuleLoader__.load({
3584
3838
  className: UsageBilling_module_css_default.numCol,
3585
3839
  children: hasPrice ? entry.price.offPeak !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3586
3840
  className: UsageBilling_module_css_default.bandPrice,
3587
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: formatUnitPrice(entry.price.output, entry.price.currency) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3841
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: unitMoney(entry.price.output, entry.price.currency) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3588
3842
  className: UsageBilling_module_css_default.bandPriceOff,
3589
- children: formatUnitPrice(entry.price.offPeak.output, entry.price.currency)
3843
+ children: unitMoney(entry.price.offPeak.output, entry.price.currency)
3590
3844
  })]
3591
- }) : formatUnitPrice(entry.price.output, entry.price.currency) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3845
+ }) : unitMoney(entry.price.output, entry.price.currency) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3592
3846
  className: UsageBilling_module_css_default.na,
3593
3847
  children: "—"
3594
3848
  })
@@ -3625,12 +3879,20 @@ window.__ModuleLoader__.load({
3625
3879
  * @param props - framework-provided sidebar and locale props.
3626
3880
  */
3627
3881
  function UsageBilling(props) {
3628
- const { t, checkModels, publishCosts, registerOpen, renderSlot, useStore, actions } = props;
3882
+ const { t: hostT, checkModels, publishCosts, registerOpen, renderSlot, useStore, actions } = props;
3629
3883
  const [stats, setStats] = (0, react.useState)(EMPTY_STATS);
3630
3884
  const [health, setHealth] = (0, react.useState)(IDLE_HEALTH);
3631
3885
  const [balances, setBalances] = (0, react.useState)([]);
3632
3886
  const [quotas, setQuotas] = (0, react.useState)([]);
3633
3887
  const [currency, setCurrency] = (0, react.useState)("cny");
3888
+ const lang = currency === "usd" ? "en" : "zh";
3889
+ const t = (0, react.useCallback)((key, params) => {
3890
+ const text = (lang === "en" ? en : zh)[key] ?? hostT(key);
3891
+ if (params === void 0) return text;
3892
+ let out = text;
3893
+ for (const [k, v] of Object.entries(params)) out = out.replaceAll(`{${k}}`, String(v));
3894
+ return out;
3895
+ }, [lang, hostT]);
3634
3896
  const [open, setOpen] = (0, react.useState)(false);
3635
3897
  const close = (0, react.useCallback)(() => {
3636
3898
  setOpen(false);
@@ -3782,6 +4044,7 @@ window.__ModuleLoader__.load({
3782
4044
  const turns = (0, react.useMemo)(() => stats.byTurn ?? [], [stats.byTurn]);
3783
4045
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageBillingTrigger, {
3784
4046
  ...props,
4047
+ t,
3785
4048
  onOpen: openDashboard,
3786
4049
  monthCost,
3787
4050
  todayCost,
@@ -4020,237 +4283,6 @@ window.__ModuleLoader__.load({
4020
4283
  });
4021
4284
  }
4022
4285
  //#endregion
4023
- //#region src/client/locales.ts
4024
- const NS = "usageBilling";
4025
- const zh = {
4026
- "billing.title": "使用统计",
4027
- "billing.subtitle": "计费仪表盘",
4028
- "billing.cost": "费用",
4029
- "billing.todayCost": "今日费用",
4030
- "billing.monthCost": "本月费用",
4031
- "billing.yearCost": "本年费用",
4032
- "billing.monthProjected": "本月预计",
4033
- "billing.liveTurn": "本轮",
4034
- "billing.liveSession": "会话",
4035
- "billing.totalCost": "总费用",
4036
- "billing.calls": "调用",
4037
- "billing.cacheHitRate": "缓存命中率",
4038
- "billing.tokens": "Token",
4039
- "billing.inputTokens": "输入",
4040
- "billing.outputTokens": "输出",
4041
- "billing.avgCost": "平均成本",
4042
- "billing.trend": "每日费用与调用趋势",
4043
- "billing.trend7d": "7 天",
4044
- "billing.trend30d": "30 天",
4045
- "billing.trendEmpty": "暂无趋势数据",
4046
- "billing.budget": "本月预算",
4047
- "billing.sessions": "会话明细",
4048
- "billing.project": "项目",
4049
- "billing.lastActive": "最后活跃",
4050
- "billing.sessionOverflow": "仅显示花费前 {limit} 个,共 {total} 个会话",
4051
- "billing.budgetTierBody": "本月花费 {cost} 已达预算 {budget} 的 {pct}%",
4052
- "billing.models": "模型计费明细",
4053
- "billing.providerBilling": "厂商计费与订阅",
4054
- "billing.estimated": "估算",
4055
- "billing.actual": "实际",
4056
- "billing.pricing": "模型单价表",
4057
- "billing.showPricing": "查看模型单价",
4058
- "billing.hidePricing": "收起单价表",
4059
- "billing.pricePerM": "¥ / 1M tokens",
4060
- "billing.input": "输入",
4061
- "billing.output": "输出",
4062
- "billing.cacheHit": "缓存命中",
4063
- "billing.peak": "高峰",
4064
- "billing.offPeak": "低谷",
4065
- "billing.flat": "全天统一",
4066
- "billing.peakHours": "高峰时段",
4067
- "billing.band": "时段",
4068
- "billing.openDashboard": "打开计费仪表盘",
4069
- "billing.close": "关闭",
4070
- "billing.lastUpdated": "数据更新于",
4071
- "billing.noData": "暂无计费数据",
4072
- "billing.todayRate": "今日汇率",
4073
- "billing.rateLive": "实时",
4074
- "billing.rateBuiltin": "内置",
4075
- "billing.balance": "余额",
4076
- "billing.balanceUnconfigured": "未配置",
4077
- "billing.balanceUnauthorized": "密钥无效",
4078
- "billing.balanceUnreachable": "查询失败",
4079
- "billing.uncatalogued": "未收录",
4080
- "billing.estimatedPricing": "估算价",
4081
- "billing.balanceDays": "约可撑 {days} 天",
4082
- "billing.balanceLowBody": "{name} 余额 {balance},约可撑 {days} 天,请及时充值",
4083
- "billing.subscriptions": "订阅套餐",
4084
- "billing.subscriptionNotConfigured": "未配置密钥",
4085
- "billing.subscriptionUnauthorized": "密钥无效",
4086
- "billing.subscriptionUnavailable": "查询失败",
4087
- "billing.subscriptionInvalid": "响应异常",
4088
- "billing.subscriptionRateLimited": "触发限流",
4089
- "billing.subscriptionSession": "本次",
4090
- "billing.subscriptionWeekly": "本周",
4091
- "billing.subscriptionMonthly": "本月",
4092
- "billing.subscriptionBilling": "计费周期",
4093
- "billing.subscriptionRemaining": "剩余 {pct}%",
4094
- "billing.subscriptionExhausted": "已用尽",
4095
- "billing.subscriptionReset": "{date} 重置",
4096
- "billing.subscriptionNoApi": "该厂商暂未提供用量查询接口",
4097
- "billing.heatmapLess": "少",
4098
- "billing.heatmapMore": "多",
4099
- "billing.currency": "币种",
4100
- "billing.currencyCny": "人民币",
4101
- "billing.currencyUsd": "美元",
4102
- "billing.heatmap": "用量热力图",
4103
- "billing.rounds": "每轮费用",
4104
- "billing.anomaly": "成本突增",
4105
- "billing.workspaces": "工作区统计",
4106
- "billing.plan": "套餐",
4107
- "billing.remaining": "剩余",
4108
- "billing.unknownModel": "未定价",
4109
- "billing.model": "模型",
4110
- "billing.currentRound": "当前",
4111
- "billing.costAbbr": "费用",
4112
- "billing.tabOverview": "概览",
4113
- "billing.tabTrends": "趋势",
4114
- "billing.tabProviders": "明细",
4115
- "billing.tabDetails": "统计",
4116
- "billing.tabPricing": "费率",
4117
- "billing.export": "导出",
4118
- "billing.exportCsvDay": "按日 CSV",
4119
- "billing.exportCsvSession": "按会话 CSV",
4120
- "billing.exportJson": "全量 JSON",
4121
- "billing.peakShare": "峰谷时段占比",
4122
- "billing.peakShareHint": "近 {count} 轮",
4123
- "billing.weekCost": "本周",
4124
- "billing.roleCost": "费用构成",
4125
- "billing.roleUser": "用户输入",
4126
- "billing.roleAssistant": "助手输出",
4127
- "billing.roleTool": "工具结果",
4128
- "billing.roleHint": "估算:输出按实测计价,输入按消息长度摊分",
4129
- "billing.tierPeak": "峰时",
4130
- "billing.tierOff": "平价",
4131
- "billing.tierToPeak": "后转峰时",
4132
- "billing.tierToOff": "后转平价",
4133
- "billing.tierAlertEnterPeak": "{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等",
4134
- "billing.tierAlertEnterOff": "{minutes} 分钟后进入平价(价格减半)",
4135
- "billing.planTypeCode": "订阅制",
4136
- "billing.planTypeToken": "按量",
4137
- "billing.subscriptionFeePerMonth": "{amount}/月"
4138
- };
4139
- const en = {
4140
- "billing.title": "Usage",
4141
- "billing.subtitle": "Billing dashboard",
4142
- "billing.cost": "Cost",
4143
- "billing.todayCost": "Today",
4144
- "billing.monthCost": "This month",
4145
- "billing.yearCost": "This year",
4146
- "billing.monthProjected": "Projected",
4147
- "billing.liveTurn": "Turn",
4148
- "billing.liveSession": "Session",
4149
- "billing.totalCost": "Total",
4150
- "billing.calls": "Calls",
4151
- "billing.cacheHitRate": "Cache Hit",
4152
- "billing.tokens": "Tokens",
4153
- "billing.inputTokens": "Input",
4154
- "billing.outputTokens": "Output",
4155
- "billing.avgCost": "Avg cost",
4156
- "billing.trend": "Daily cost & calls",
4157
- "billing.trend7d": "7D",
4158
- "billing.trend30d": "30D",
4159
- "billing.trendEmpty": "No trend data yet",
4160
- "billing.budget": "Monthly budget",
4161
- "billing.sessions": "Sessions",
4162
- "billing.project": "Project",
4163
- "billing.lastActive": "Last active",
4164
- "billing.sessionOverflow": "Top {limit} of {total} sessions by cost",
4165
- "billing.budgetTierBody": "This month {cost} reached {pct}% of the budget {budget}",
4166
- "billing.models": "Model billing",
4167
- "billing.providerBilling": "Provider billing & subscriptions",
4168
- "billing.estimated": "Est.",
4169
- "billing.actual": "Actual",
4170
- "billing.pricing": "Model pricing",
4171
- "billing.showPricing": "View pricing",
4172
- "billing.hidePricing": "Hide pricing",
4173
- "billing.pricePerM": "¥ / 1M tokens",
4174
- "billing.input": "Input",
4175
- "billing.output": "Output",
4176
- "billing.cacheHit": "Cache hit",
4177
- "billing.peak": "Peak",
4178
- "billing.offPeak": "Off-peak",
4179
- "billing.flat": "Flat",
4180
- "billing.peakHours": "Peak hours",
4181
- "billing.band": "Band",
4182
- "billing.openDashboard": "Open billing dashboard",
4183
- "billing.close": "Close",
4184
- "billing.lastUpdated": "Updated",
4185
- "billing.noData": "No billing data yet",
4186
- "billing.todayRate": "Today rate",
4187
- "billing.rateLive": "Live",
4188
- "billing.rateBuiltin": "Built-in",
4189
- "billing.balance": "Balance",
4190
- "billing.balanceUnconfigured": "Not set",
4191
- "billing.balanceUnauthorized": "Bad key",
4192
- "billing.balanceUnreachable": "Unavailable",
4193
- "billing.uncatalogued": "Not catalogued",
4194
- "billing.estimatedPricing": "Estimated",
4195
- "billing.balanceDays": "~{days} days left",
4196
- "billing.balanceLowBody": "{name} balance {balance}, ~{days} days left, please top up",
4197
- "billing.subscriptions": "Subscriptions",
4198
- "billing.subscriptionNotConfigured": "Key not set",
4199
- "billing.subscriptionUnauthorized": "Bad key",
4200
- "billing.subscriptionUnavailable": "Unavailable",
4201
- "billing.subscriptionInvalid": "Bad response",
4202
- "billing.subscriptionRateLimited": "Rate limited",
4203
- "billing.subscriptionSession": "Current",
4204
- "billing.subscriptionWeekly": "Weekly",
4205
- "billing.subscriptionMonthly": "Monthly",
4206
- "billing.subscriptionBilling": "Billing",
4207
- "billing.subscriptionRemaining": "{pct}% left",
4208
- "billing.subscriptionExhausted": "Exhausted",
4209
- "billing.subscriptionReset": "Resets {date}",
4210
- "billing.subscriptionNoApi": "Provider does not offer a usage API",
4211
- "billing.heatmapLess": "Less",
4212
- "billing.heatmapMore": "More",
4213
- "billing.currency": "Currency",
4214
- "billing.currencyCny": "CNY",
4215
- "billing.currencyUsd": "USD",
4216
- "billing.heatmap": "Usage heatmap",
4217
- "billing.rounds": "Cost per turn",
4218
- "billing.anomaly": "Cost spike",
4219
- "billing.workspaces": "Workspaces",
4220
- "billing.plan": "Plan",
4221
- "billing.remaining": "Left",
4222
- "billing.unknownModel": "Unpriced",
4223
- "billing.model": "Model",
4224
- "billing.currentRound": "current",
4225
- "billing.costAbbr": "cost",
4226
- "billing.tabOverview": "Overview",
4227
- "billing.tabTrends": "Trends",
4228
- "billing.tabProviders": "Details",
4229
- "billing.tabDetails": "Stats",
4230
- "billing.tabPricing": "Rates",
4231
- "billing.export": "Export",
4232
- "billing.exportCsvDay": "Daily CSV",
4233
- "billing.exportCsvSession": "Sessions CSV",
4234
- "billing.exportJson": "Full JSON",
4235
- "billing.peakShare": "Peak vs off-peak",
4236
- "billing.peakShareHint": "last {count} turns",
4237
- "billing.weekCost": "This week",
4238
- "billing.roleCost": "Cost breakdown",
4239
- "billing.roleUser": "User input",
4240
- "billing.roleAssistant": "Assistant output",
4241
- "billing.roleTool": "Tool results",
4242
- "billing.roleHint": "Estimated: output priced exactly, input split by message size",
4243
- "billing.tierPeak": "Peak",
4244
- "billing.tierOff": "Off-peak",
4245
- "billing.tierToPeak": "until peak",
4246
- "billing.tierToOff": "until off-peak",
4247
- "billing.tierAlertEnterPeak": "Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait",
4248
- "billing.tierAlertEnterOff": "Off-peak pricing (50% off) starts in {minutes} min",
4249
- "billing.planTypeCode": "Subscription",
4250
- "billing.planTypeToken": "Usage",
4251
- "billing.subscriptionFeePerMonth": "{amount}/mo"
4252
- };
4253
- //#endregion
4254
4286
  //#region src/client/billing-service.ts
4255
4287
  /** 创建计费指标运行时(apply 内调用,随插件纤维存活)。 */
4256
4288
  function createBillingMetrics() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kenz1117/dsh-ui-usage-billing",
3
3
  "description": "Usage billing dashboard for DeepSeek Harness: sidebar cost metrics plus a full dashboard modal, priced from a current multi-provider catalog with real usage aggregated from session logs.",
4
- "version": "0.8.1",
4
+ "version": "0.8.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },