@vibedev-si/dsh-vibedev 0.3.10 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -7
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/client/client.account-center.js +13151 -0
- package/client/client.js +3417 -878
- package/cordis.patch.yml +5 -0
- package/lib/account/center-business-contract.d.ts +22 -0
- package/lib/account/center-business.d.ts +6 -0
- package/lib/account/center-contract.d.ts +12 -0
- package/lib/account/center-monitor-contract.d.ts +10 -0
- package/lib/account/center-price-contract.d.ts +5 -0
- package/lib/account/center.d.ts +7 -0
- package/lib/account/index.d.ts +14 -0
- package/lib/{anthropic-messages-BgIfgjNt.js → anthropic-messages-QcnVMGaA.js} +11 -11
- package/lib/contract-v1.types.d.ts +134 -0
- package/lib/contracts.d.ts +34 -0
- package/lib/gateway/errors.d.ts +29 -1
- package/lib/gateway/http.d.ts +6 -0
- package/lib/host-locales.d.ts +4 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +4619 -1976
- package/lib/{node-D58f7Ea6.js → node-CcLPV4RA.js} +4 -4
- package/lib/{node-Br-0fshF.js → node-vkDR3GtK.js} +2 -2
- package/lib/pricing.d.ts +21 -1
- package/lib/service.d.ts +51 -9
- package/lib/tasks/progress.d.ts +96 -0
- package/lib/tasks/remote.d.ts +15 -8
- package/lib/tasks/store.d.ts +59 -9
- package/lib/tasks/tracker.d.ts +51 -45
- package/lib/tools/image.d.ts +1 -0
- package/lib/tools/video.d.ts +3 -0
- package/lib/util/files.d.ts +2 -0
- package/locale/en.json +13 -0
- package/locale/zh.json +13 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/LICENSE +22 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/README.md +154 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/catalog/catalog.json +167 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/catalog-updates.js +326 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/catalog-validator.js +263 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/client.js +2816 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/cordis.patch.yml +5 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/icon.svg +5 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/index.js +169 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/locale/en.json +6 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/locale/zh.json +6 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/package.json +75 -0
- package/node_modules/@vibedev-si/dsh-ecosystem/remote-catalog.js +212 -0
- package/package.json +12 -1
package/client/client.js
CHANGED
|
@@ -5,736 +5,1820 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
//#region src/client/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"security-privacy-permission",
|
|
26
|
-
"other"
|
|
27
|
-
];
|
|
28
|
-
const FEEDBACK_ROUTE = "/api/dsh-vibedev/feedback";
|
|
29
|
-
const FEEDBACK_ATTACHMENT_ROUTE = "/api/dsh-vibedev/feedback/attachment";
|
|
30
|
-
/** The gateway's limit on the text, in code points. */
|
|
31
|
-
const FEEDBACK_MAX_TEXT = 4e3;
|
|
32
|
-
const INITIAL = {
|
|
33
|
-
open: false,
|
|
34
|
-
category: void 0,
|
|
35
|
-
text: "",
|
|
36
|
-
attach: false,
|
|
37
|
-
preview: { status: "idle" },
|
|
38
|
-
phase: { kind: "editing" }
|
|
8
|
+
//#region src/client/AccountCenter/subscription-ui-locales.ts
|
|
9
|
+
const subscriptionUiZh = {
|
|
10
|
+
centerSubPlan: "订阅计划",
|
|
11
|
+
centerSubStatusUnknown: "状态未知",
|
|
12
|
+
centerSubExpiryUnknown: "到期时间未知",
|
|
13
|
+
centerSubValidity: "有效期",
|
|
14
|
+
centerSubExpiresSoon: "将在 7 天内到期",
|
|
15
|
+
centerSubAvailabilityUnknown: "网关尚未提供当前可用性。",
|
|
16
|
+
centerSubWindows: "额度窗口",
|
|
17
|
+
centerSubRemainingUnknown: "剩余额度未知",
|
|
18
|
+
centerSubWindowUnknown: "窗口状态未知",
|
|
19
|
+
centerSubLowRemaining: "剩余额度较低",
|
|
20
|
+
centerSubRecovery: "恢复时间",
|
|
21
|
+
centerSubRecoveryUnknown: "恢复时间未知",
|
|
22
|
+
centerSubRestrictions: "当前限制",
|
|
23
|
+
centerSubMoreModels: "展开其余 {n} 个模型",
|
|
24
|
+
centerSubPeakClock: "峰时按网关时钟执行;网关未提供其时区。"
|
|
39
25
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* Whether the dialog can send: a category or some text, and, with the box ticked, the attachment already shown.
|
|
57
|
-
* @param state - the dialog state.
|
|
58
|
-
* @returns true when something would be sent.
|
|
59
|
-
*/
|
|
60
|
-
function canSend(state) {
|
|
61
|
-
return state.phase.kind === "editing" && (state.category !== void 0 || state.text.trim() !== "") && !(state.attach && state.preview.status === "loading");
|
|
62
|
-
}
|
|
63
|
-
/** The feedback dialog's store. */
|
|
64
|
-
var FeedbackStore = class {
|
|
65
|
-
options;
|
|
66
|
-
state = INITIAL;
|
|
67
|
-
listeners = /* @__PURE__ */ new Set();
|
|
68
|
-
/** Bumped by every opening and closing, so an answer for an earlier opening is ignored. */
|
|
69
|
-
generation = 0;
|
|
70
|
-
/**
|
|
71
|
-
* @param options - fetch (a test seam).
|
|
72
|
-
*/
|
|
73
|
-
constructor(options = {}) {
|
|
74
|
-
this.options = options;
|
|
75
|
-
}
|
|
76
|
-
subscribe = (listener) => {
|
|
77
|
-
this.listeners.add(listener);
|
|
78
|
-
return () => {
|
|
79
|
-
this.listeners.delete(listener);
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
getSnapshot = () => this.state;
|
|
83
|
-
set(change) {
|
|
84
|
-
this.state = {
|
|
85
|
-
...this.state,
|
|
86
|
-
...change
|
|
87
|
-
};
|
|
88
|
-
for (const listener of this.listeners) listener();
|
|
89
|
-
}
|
|
90
|
-
fetch(path, init) {
|
|
91
|
-
return (this.options.fetch ?? globalThis.fetch)(path, init);
|
|
92
|
-
}
|
|
93
|
-
/** Open the dialog with an empty form. */
|
|
94
|
-
open() {
|
|
95
|
-
this.generation++;
|
|
96
|
-
this.state = {
|
|
97
|
-
...INITIAL,
|
|
98
|
-
open: true
|
|
99
|
-
};
|
|
100
|
-
for (const listener of this.listeners) listener();
|
|
101
|
-
}
|
|
102
|
-
/** Close it; whatever was sent or queued carries on without the dialog. */
|
|
103
|
-
close() {
|
|
104
|
-
this.generation++;
|
|
105
|
-
this.state = INITIAL;
|
|
106
|
-
for (const listener of this.listeners) listener();
|
|
107
|
-
}
|
|
108
|
-
/** Choose a category, or none. */
|
|
109
|
-
setCategory(category) {
|
|
110
|
-
if (this.state.phase.kind !== "editing") return;
|
|
111
|
-
this.set({
|
|
112
|
-
category,
|
|
113
|
-
phase: { kind: "editing" }
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/** Change the text (cut to 4,000 code points). */
|
|
117
|
-
setText(text) {
|
|
118
|
-
if (this.state.phase.kind !== "editing") return;
|
|
119
|
-
this.set({
|
|
120
|
-
text: limitText(text),
|
|
121
|
-
phase: { kind: "editing" }
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Tick or untick "attach recent errors". Ticking reads the text that would be sent, every time, so what the dialog
|
|
126
|
-
* shows is what goes.
|
|
127
|
-
* @param attach - the box's new state.
|
|
128
|
-
* @returns once the preview (if any) is read.
|
|
129
|
-
*/
|
|
130
|
-
async setAttach(attach) {
|
|
131
|
-
if (this.state.phase.kind !== "editing") return;
|
|
132
|
-
if (!attach) {
|
|
133
|
-
this.set({ attach: false });
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const generation = ++this.generation;
|
|
137
|
-
this.set({
|
|
138
|
-
attach: true,
|
|
139
|
-
preview: { status: "loading" }
|
|
140
|
-
});
|
|
141
|
-
let preview;
|
|
142
|
-
try {
|
|
143
|
-
const response = await this.fetch(FEEDBACK_ATTACHMENT_ROUTE);
|
|
144
|
-
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
145
|
-
const body = await response.json();
|
|
146
|
-
if (typeof body.content !== "string" || typeof body.entries !== "number" || typeof body.bytes !== "number") throw new Error("not a preview");
|
|
147
|
-
preview = {
|
|
148
|
-
status: "ready",
|
|
149
|
-
preview: {
|
|
150
|
-
content: body.content,
|
|
151
|
-
entries: body.entries,
|
|
152
|
-
bytes: body.bytes
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
} catch {
|
|
156
|
-
preview = { status: "failed" };
|
|
157
|
-
}
|
|
158
|
-
if (generation === this.generation) this.set({ preview });
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Send the feedback: the category and text, and the shown attachment only when its box is ticked.
|
|
162
|
-
* @param locale - the language the dialog is in.
|
|
163
|
-
* @returns once the Host answered.
|
|
164
|
-
*/
|
|
165
|
-
async submit(locale) {
|
|
166
|
-
const state = this.state;
|
|
167
|
-
if (!canSend(state)) return;
|
|
168
|
-
const generation = ++this.generation;
|
|
169
|
-
const shown = state.attach && state.preview.status === "ready" && state.preview.preview.content !== "" ? state.preview.preview.content : void 0;
|
|
170
|
-
this.set({ phase: { kind: "sending" } });
|
|
171
|
-
let phase;
|
|
172
|
-
try {
|
|
173
|
-
const response = await this.fetch(FEEDBACK_ROUTE, {
|
|
174
|
-
method: "POST",
|
|
175
|
-
headers: { "content-type": "application/json" },
|
|
176
|
-
body: JSON.stringify({
|
|
177
|
-
...state.category === void 0 ? {} : { category: state.category },
|
|
178
|
-
...state.text.trim() === "" ? {} : { text: state.text },
|
|
179
|
-
...shown === void 0 ? {} : { attachment: { content: shown } },
|
|
180
|
-
...locale === void 0 ? {} : { locale }
|
|
181
|
-
})
|
|
182
|
-
});
|
|
183
|
-
const body = await response.json().catch(() => void 0);
|
|
184
|
-
if (response.status === 409 && body?.error?.code === "SIGNED_OUT") phase = { kind: "signed-out" };
|
|
185
|
-
else if (response.status === 400) phase = {
|
|
186
|
-
kind: "editing",
|
|
187
|
-
error: "invalid"
|
|
188
|
-
};
|
|
189
|
-
else if (!response.ok) phase = {
|
|
190
|
-
kind: "editing",
|
|
191
|
-
error: "failed"
|
|
192
|
-
};
|
|
193
|
-
else if (body?.status === "sent") phase = { kind: "sent" };
|
|
194
|
-
else if (body?.status === "queued") phase = {
|
|
195
|
-
kind: "queued",
|
|
196
|
-
reason: body.reason === "offline" || body.reason === "signed-out" ? body.reason : "later"
|
|
197
|
-
};
|
|
198
|
-
else phase = {
|
|
199
|
-
kind: "editing",
|
|
200
|
-
error: "rejected",
|
|
201
|
-
...typeof body?.code === "string" ? { code: body.code } : {}
|
|
202
|
-
};
|
|
203
|
-
} catch {
|
|
204
|
-
phase = {
|
|
205
|
-
kind: "editing",
|
|
206
|
-
error: "failed"
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
if (generation === this.generation) this.set({ phase });
|
|
210
|
-
}
|
|
26
|
+
const subscriptionUiEn = {
|
|
27
|
+
centerSubPlan: "Subscription plan",
|
|
28
|
+
centerSubStatusUnknown: "Status unavailable",
|
|
29
|
+
centerSubExpiryUnknown: "Expiration unavailable",
|
|
30
|
+
centerSubValidity: "Validity",
|
|
31
|
+
centerSubExpiresSoon: "Expires within 7 days",
|
|
32
|
+
centerSubAvailabilityUnknown: "The gateway has not provided current availability.",
|
|
33
|
+
centerSubWindows: "Quota windows",
|
|
34
|
+
centerSubRemainingUnknown: "Remaining unavailable",
|
|
35
|
+
centerSubWindowUnknown: "Window status unavailable",
|
|
36
|
+
centerSubLowRemaining: "Low remaining",
|
|
37
|
+
centerSubRecovery: "Recovery",
|
|
38
|
+
centerSubRecoveryUnknown: "Recovery time unavailable",
|
|
39
|
+
centerSubRestrictions: "Current restrictions",
|
|
40
|
+
centerSubMoreModels: "{n} more models",
|
|
41
|
+
centerSubPeakClock: "Peak hours follow the gateway clock; its timezone was not provided."
|
|
211
42
|
};
|
|
212
43
|
//#endregion
|
|
213
|
-
//#region src/client/
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
44
|
+
//#region src/client/AccountCenter/dashboard-locales.ts
|
|
45
|
+
const dashboardZh = {
|
|
46
|
+
centerDashTodayRequests: "今日请求",
|
|
47
|
+
centerDashTodaySpend: "今日实际扣款",
|
|
48
|
+
centerDashLifetimeRequests: "累计请求",
|
|
49
|
+
centerDashLifetimeCost: "累计实际扣款",
|
|
50
|
+
centerDashLifetimeStandard: "累计标准计费",
|
|
51
|
+
centerDashGlobalScope: "今日与累计 · 不随下方日期范围变化",
|
|
52
|
+
centerDashRangeScope: "以下趋势、模型及最近记录使用所选日期与时区。",
|
|
53
|
+
centerDashRecentScope: "所选日期内最近 5 条记录",
|
|
54
|
+
centerDashTokenBreakdown: "Token 与缓存明细",
|
|
55
|
+
centerDashLast5Minutes: "近 5 分钟",
|
|
56
|
+
centerDashQuickHint: "查看账户用量与管理服务。",
|
|
57
|
+
centerDashViewUsage: "查看全部记录",
|
|
58
|
+
centerChartExactData: "精确数据",
|
|
59
|
+
centerChartSelectPoint: "选择数据点",
|
|
60
|
+
centerChartSelectedPoint: "所选数据点",
|
|
61
|
+
centerChartTokenUnit: "Token",
|
|
62
|
+
centerChartRequestUnit: "请求数",
|
|
63
|
+
centerChartCurrencyUnit: "金额",
|
|
64
|
+
centerChartPercentUnit: "百分比 (%)",
|
|
65
|
+
centerChartRelativeScale: "刻度:最大数值",
|
|
66
|
+
centerChartShowingTop: "展示前 {n} 项 · 精确数据包含全部项目"
|
|
67
|
+
};
|
|
68
|
+
const dashboardEn = {
|
|
69
|
+
centerDashTodayRequests: "Requests today",
|
|
70
|
+
centerDashTodaySpend: "Actual charge today",
|
|
71
|
+
centerDashLifetimeRequests: "Lifetime requests",
|
|
72
|
+
centerDashLifetimeCost: "Lifetime actual charge",
|
|
73
|
+
centerDashLifetimeStandard: "Lifetime standard cost",
|
|
74
|
+
centerDashGlobalScope: "Today and lifetime · independent of the date range below",
|
|
75
|
+
centerDashRangeScope: "Trends, models and recent records use the selected dates and time zone.",
|
|
76
|
+
centerDashRecentScope: "Latest 5 records in the selected dates",
|
|
77
|
+
centerDashTokenBreakdown: "Token and cache details",
|
|
78
|
+
centerDashLast5Minutes: "Last 5 minutes",
|
|
79
|
+
centerDashQuickHint: "Review usage and manage your account services.",
|
|
80
|
+
centerDashViewUsage: "View all records",
|
|
81
|
+
centerChartExactData: "Exact data",
|
|
82
|
+
centerChartSelectPoint: "Select a data point",
|
|
83
|
+
centerChartSelectedPoint: "Selected data point",
|
|
84
|
+
centerChartTokenUnit: "Tokens",
|
|
85
|
+
centerChartRequestUnit: "Requests",
|
|
86
|
+
centerChartCurrencyUnit: "Amount",
|
|
87
|
+
centerChartPercentUnit: "Percent (%)",
|
|
88
|
+
centerChartRelativeScale: "Scale: largest value",
|
|
89
|
+
centerChartShowingTop: "Showing {n} items · exact data includes all items"
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/client/AccountCenter/usage-ui-locales.ts
|
|
93
|
+
const usageUiZh = {
|
|
94
|
+
centerUsageAnalytics: "用量分析",
|
|
95
|
+
centerUsageAnalyticsHint: "展开查看所选日期的成功用量趋势与分布",
|
|
96
|
+
centerUsageSummaryScope: "所选日期与已应用筛选 · 成功用量",
|
|
97
|
+
centerUsageMoreFilters: "更多筛选",
|
|
98
|
+
centerUsageApplied: "已应用筛选",
|
|
99
|
+
centerUsageNoFilters: "未应用额外筛选",
|
|
100
|
+
centerUsageDraft: "筛选已修改,应用后更新记录",
|
|
101
|
+
centerUsageRestoreColumns: "恢复推荐列",
|
|
102
|
+
centerUsageExportPage: "导出当前页 CSV",
|
|
103
|
+
centerUsagePageRange: "第 {from}–{to} 条,共 {total} 条 · 第 {page}/{pages} 页",
|
|
104
|
+
centerUsageUnknownRange: "第 {page} 页 · 总数未知",
|
|
105
|
+
centerUsageErrorTotal: "匹配的错误请求",
|
|
106
|
+
centerUsageErrorScope: "所选日期与已应用的模型、分类、状态筛选;此接口不提供错误费用或 Token 统计。",
|
|
107
|
+
centerUsageCache: "缓存",
|
|
108
|
+
centerUsageRead: "读取",
|
|
109
|
+
centerUsageWrite: "创建",
|
|
110
|
+
centerUsageCacheSplit: "创建总量拆分,不重复相加",
|
|
111
|
+
centerUsageExact: "精确值",
|
|
112
|
+
centerUsageSync: "同步",
|
|
113
|
+
centerUsageStream: "流式",
|
|
114
|
+
centerUsageWs: "WebSocket v2",
|
|
115
|
+
centerUsageLive: "实时",
|
|
116
|
+
centerUsageCyber: "Cyber 任务",
|
|
117
|
+
centerUsageUnknown: "未知",
|
|
118
|
+
centerUsageTokenMode: "Token 计费",
|
|
119
|
+
centerUsageRequestMode: "按请求",
|
|
120
|
+
centerUsageImageMode: "图片",
|
|
121
|
+
centerUsageVideoMode: "视频",
|
|
122
|
+
centerUsageVideoTokenMode: "视频 Token",
|
|
123
|
+
centerUsageStale: "旧数据",
|
|
124
|
+
centerDetailOverview: "概览",
|
|
125
|
+
centerDetailTokens: "Token 与缓存",
|
|
126
|
+
centerDetailTechnical: "技术信息",
|
|
127
|
+
centerDetailMedia: "图片规格",
|
|
128
|
+
centerDetailCopyId: "复制请求 ID",
|
|
129
|
+
centerDetailCopied: "请求 ID 已复制",
|
|
130
|
+
centerDetailCopyFailed: "复制失败,请选择请求 ID 后复制",
|
|
131
|
+
centerDetailCopyUnavailable: "此请求 ID 无法复制"
|
|
132
|
+
};
|
|
133
|
+
const usageUiEn = {
|
|
134
|
+
centerUsageAnalytics: "Usage analytics",
|
|
135
|
+
centerUsageAnalyticsHint: "Expand successful usage trends and distributions for the selected dates",
|
|
136
|
+
centerUsageSummaryScope: "Selected dates and applied filters · Successful usage",
|
|
137
|
+
centerUsageMoreFilters: "More filters",
|
|
138
|
+
centerUsageApplied: "Applied filters",
|
|
139
|
+
centerUsageNoFilters: "No additional filters applied",
|
|
140
|
+
centerUsageDraft: "Filters changed; apply to update records",
|
|
141
|
+
centerUsageRestoreColumns: "Restore recommended columns",
|
|
142
|
+
centerUsageExportPage: "Export current page CSV",
|
|
143
|
+
centerUsagePageRange: "{from}–{to} of {total} · Page {page}/{pages}",
|
|
144
|
+
centerUsageUnknownRange: "Page {page} · Total unknown",
|
|
145
|
+
centerUsageErrorTotal: "Matching error requests",
|
|
146
|
+
centerUsageErrorScope: "Selected dates and applied model, category and status filters; this endpoint does not provide error cost or token statistics.",
|
|
147
|
+
centerUsageCache: "Cache",
|
|
148
|
+
centerUsageRead: "Read",
|
|
149
|
+
centerUsageWrite: "Created",
|
|
150
|
+
centerUsageCacheSplit: "Creation total breakdown; do not add again",
|
|
151
|
+
centerUsageExact: "Exact value",
|
|
152
|
+
centerUsageSync: "Synchronous",
|
|
153
|
+
centerUsageStream: "Streaming",
|
|
154
|
+
centerUsageWs: "WebSocket v2",
|
|
155
|
+
centerUsageLive: "Live",
|
|
156
|
+
centerUsageCyber: "Cyber task",
|
|
157
|
+
centerUsageUnknown: "Unknown",
|
|
158
|
+
centerUsageTokenMode: "Tokens",
|
|
159
|
+
centerUsageRequestMode: "Per request",
|
|
160
|
+
centerUsageImageMode: "Image",
|
|
161
|
+
centerUsageVideoMode: "Video",
|
|
162
|
+
centerUsageVideoTokenMode: "Video tokens",
|
|
163
|
+
centerUsageStale: "Stale data",
|
|
164
|
+
centerDetailOverview: "Overview",
|
|
165
|
+
centerDetailTokens: "Tokens and cache",
|
|
166
|
+
centerDetailTechnical: "Technical information",
|
|
167
|
+
centerDetailMedia: "Image specification",
|
|
168
|
+
centerDetailCopyId: "Copy request ID",
|
|
169
|
+
centerDetailCopied: "Request ID copied",
|
|
170
|
+
centerDetailCopyFailed: "Copy failed; select and copy the request ID",
|
|
171
|
+
centerDetailCopyUnavailable: "This request ID cannot be copied"
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/client/AccountCenter/center-polish-locales.ts
|
|
175
|
+
const polishZh = {
|
|
176
|
+
centerNativePages: "账户页面",
|
|
177
|
+
centerWebsiteServices: "官网服务",
|
|
178
|
+
centerWebsiteHint: "在浏览器中打开",
|
|
179
|
+
centerDashboardIntro: "查看余额、消费与模型使用情况",
|
|
180
|
+
centerUsageIntro: "筛选请求,核对 Token、缓存与费用",
|
|
181
|
+
centerSubscriptionsIntro: "查看计划状态、剩余用量与恢复时间",
|
|
182
|
+
centerRefreshing: "刷新中…",
|
|
183
|
+
centerAccountWorkspace: "账户中心",
|
|
184
|
+
centerAccountRefresh: "刷新账户数据"
|
|
185
|
+
};
|
|
186
|
+
const polishEn = {
|
|
187
|
+
centerNativePages: "Account pages",
|
|
188
|
+
centerWebsiteServices: "Website services",
|
|
189
|
+
centerWebsiteHint: "Open in browser",
|
|
190
|
+
centerDashboardIntro: "Your balance, spending and model activity",
|
|
191
|
+
centerUsageIntro: "Find requests and review tokens, cache and charges",
|
|
192
|
+
centerSubscriptionsIntro: "Plan availability, remaining usage and recovery times",
|
|
193
|
+
centerRefreshing: "Refreshing…",
|
|
194
|
+
centerAccountWorkspace: "Account center",
|
|
195
|
+
centerAccountRefresh: "Refresh account data"
|
|
196
|
+
};
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/client/AccountCenter/model-price-locales.ts
|
|
199
|
+
const factText = {
|
|
200
|
+
input_modalities: ["输入模态", "Input modalities"],
|
|
201
|
+
output_modalities: ["输出模态", "Output modalities"],
|
|
202
|
+
context_window: ["上下文窗口 · Token", "Context window · tokens"],
|
|
203
|
+
max_input_tokens: ["输入上限 · Token", "Maximum input · tokens"],
|
|
204
|
+
max_output_tokens: ["输出上限 · Token", "Maximum output · tokens"],
|
|
205
|
+
reasoning_supported: ["推理", "Reasoning"],
|
|
206
|
+
reasoning_levels: ["推理力度", "Reasoning levels"],
|
|
207
|
+
default_reasoning: ["默认推理力度", "Default reasoning"],
|
|
208
|
+
tools: ["工具调用", "Tool calls"],
|
|
209
|
+
parallel_tools: ["并行工具", "Parallel tools"],
|
|
210
|
+
vision: ["视觉输入", "Vision input"],
|
|
211
|
+
structured_output: ["结构化输出", "Structured output"],
|
|
212
|
+
streaming: ["流式输出", "Streaming"],
|
|
213
|
+
fast: ["快速模式", "Fast mode"],
|
|
214
|
+
interleaved_thinking: ["交错思考", "Interleaved thinking"],
|
|
215
|
+
adaptive_thinking: ["自适应思考", "Adaptive thinking"],
|
|
216
|
+
image_sizes: ["图片分辨率", "Image resolutions"],
|
|
217
|
+
image_ratios: ["图片宽高比", "Image ratios"],
|
|
218
|
+
text_to_video: ["文生视频", "Text to video"],
|
|
219
|
+
image_to_video: ["图生视频", "Image to video"],
|
|
220
|
+
reference_image_input: ["参考图片输入", "Reference image input"],
|
|
221
|
+
max_reference_images: ["参考图片数量上限", "Maximum reference images"],
|
|
222
|
+
reference_video_input: ["参考视频输入", "Reference video input"],
|
|
223
|
+
max_reference_videos: ["参考视频数量上限", "Maximum reference videos"],
|
|
224
|
+
reference_audio_input: ["参考音频输入", "Reference audio input"],
|
|
225
|
+
max_reference_audios: ["参考音频数量上限", "Maximum reference audio clips"],
|
|
226
|
+
max_reference_video_duration_seconds: ["单段参考视频最长 · 秒", "Maximum reference video · seconds"],
|
|
227
|
+
min_reference_video_duration_seconds: ["单段参考视频最短 · 秒", "Minimum reference video · seconds"],
|
|
228
|
+
max_total_reference_video_duration_seconds: ["参考视频总时长上限 · 秒", "Total reference video limit · seconds"],
|
|
229
|
+
min_reference_audio_duration_seconds: ["单段参考音频最短 · 秒", "Minimum reference audio · seconds"],
|
|
230
|
+
max_reference_audio_duration_seconds: ["单段参考音频最长 · 秒", "Maximum reference audio · seconds"],
|
|
231
|
+
max_total_reference_audio_duration_seconds: ["参考音频总时长上限 · 秒", "Total reference audio limit · seconds"],
|
|
232
|
+
max_asset_bytes: ["单素材上限 · 字节", "Asset limit · bytes"],
|
|
233
|
+
max_request_bytes: ["请求上限 · 字节", "Request limit · bytes"],
|
|
234
|
+
max_reference_image_bytes: ["参考图片上限 · 字节", "Reference image limit · bytes"],
|
|
235
|
+
max_reference_video_bytes: ["参考视频上限 · 字节", "Reference video limit · bytes"],
|
|
236
|
+
max_reference_audio_bytes: ["参考音频上限 · 字节", "Reference audio limit · bytes"],
|
|
237
|
+
allowed_image_mimes: ["图片 MIME", "Image MIME types"],
|
|
238
|
+
allowed_video_mimes: ["视频 MIME", "Video MIME types"],
|
|
239
|
+
allowed_audio_mimes: ["音频 MIME", "Audio MIME types"],
|
|
240
|
+
allowed_extensions: ["素材扩展名", "Asset extensions"],
|
|
241
|
+
durations_seconds: ["生成时长 · 秒", "Durations · seconds"],
|
|
242
|
+
ratios: ["宽高比", "Aspect ratios"],
|
|
243
|
+
resolutions: ["分辨率", "Resolutions"],
|
|
244
|
+
native_audio_output: ["原生音频输出", "Native audio output"],
|
|
245
|
+
native_sequence: ["原生序列", "Native sequence"],
|
|
246
|
+
first_frame: ["首帧", "First frame"],
|
|
247
|
+
last_frame: ["尾帧", "Last frame"],
|
|
248
|
+
edit: ["视频编辑", "Video editing"],
|
|
249
|
+
extend: ["视频延长", "Video extension"],
|
|
250
|
+
async_create_poll_content: ["异步生成与读取", "Async generation and reading"],
|
|
251
|
+
gateway_relay_required: ["素材需经过网关", "Gateway media required"],
|
|
252
|
+
min_reference_image_width: ["参考图片最小宽度", "Minimum reference image width"],
|
|
253
|
+
max_reference_image_width: ["参考图片最大宽度", "Maximum reference image width"],
|
|
254
|
+
min_reference_image_height: ["参考图片最小高度", "Minimum reference image height"],
|
|
255
|
+
max_reference_image_height: ["参考图片最大高度", "Maximum reference image height"],
|
|
256
|
+
min_reference_image_aspect_ratio: ["参考图片最小宽高比", "Minimum reference image ratio"],
|
|
257
|
+
max_reference_image_aspect_ratio: ["参考图片最大宽高比", "Maximum reference image ratio"],
|
|
258
|
+
min_reference_image_pixels: ["参考图片最小像素数", "Minimum reference image pixels"],
|
|
259
|
+
max_reference_image_pixels: ["参考图片最大像素数", "Maximum reference image pixels"],
|
|
260
|
+
min_reference_video_width: ["参考视频最小宽度", "Minimum reference video width"],
|
|
261
|
+
max_reference_video_width: ["参考视频最大宽度", "Maximum reference video width"],
|
|
262
|
+
min_reference_video_height: ["参考视频最小高度", "Minimum reference video height"],
|
|
263
|
+
max_reference_video_height: ["参考视频最大高度", "Maximum reference video height"],
|
|
264
|
+
min_reference_video_aspect_ratio: ["参考视频最小宽高比", "Minimum reference video ratio"],
|
|
265
|
+
max_reference_video_aspect_ratio: ["参考视频最大宽高比", "Maximum reference video ratio"],
|
|
266
|
+
min_reference_video_pixels: ["参考视频最小像素数", "Minimum reference video pixels"],
|
|
267
|
+
max_reference_video_pixels: ["参考视频最大像素数", "Maximum reference video pixels"],
|
|
268
|
+
min_reference_video_fps: ["参考视频最低帧率", "Minimum reference video FPS"],
|
|
269
|
+
max_reference_video_fps: ["参考视频最高帧率", "Maximum reference video FPS"],
|
|
270
|
+
generation_kind: ["音频类型", "Audio kind"],
|
|
271
|
+
billing_unit: ["计费单位", "Billing unit"],
|
|
272
|
+
prompt_field: ["提示词字段", "Prompt field"],
|
|
273
|
+
max_prompt_characters: ["提示词字符上限", "Maximum prompt characters"],
|
|
274
|
+
request_fields: ["支持请求字段", "Request fields"],
|
|
275
|
+
reference_image_exclusive: ["图片与音频引用互斥", "Image and audio references exclusive"],
|
|
276
|
+
speaker_input: ["音色引用", "Voice reference"],
|
|
277
|
+
output_formats: ["输出格式", "Output formats"],
|
|
278
|
+
sample_rates: ["采样率", "Sample rates"],
|
|
279
|
+
default_format: ["默认格式", "Default format"],
|
|
280
|
+
subtitle: ["字幕", "Subtitles"],
|
|
281
|
+
watermark: ["水印", "Watermark"],
|
|
282
|
+
watermark_fields: ["水印字段", "Watermark fields"],
|
|
283
|
+
config_fields: ["配置字段", "Configuration fields"],
|
|
284
|
+
max_original_duration_seconds: ["原始音频时长上限 · 秒", "Original duration limit · seconds"],
|
|
285
|
+
label: ["规格", "Specification"],
|
|
286
|
+
min_tokens: ["下界 · Token", "Lower bound · tokens"],
|
|
287
|
+
max_tokens: ["上界 · Token", "Upper bound · tokens"],
|
|
288
|
+
period: ["时段", "Period"],
|
|
289
|
+
resolution: ["分辨率", "Resolution"],
|
|
290
|
+
ratio: ["宽高比", "Aspect ratio"],
|
|
291
|
+
pixel_size: ["精确像素", "Exact pixels"],
|
|
292
|
+
quality: ["质量", "Quality"],
|
|
293
|
+
reference_video: ["参考视频", "Reference video"],
|
|
294
|
+
reference_audio: ["参考音频", "Reference audio"],
|
|
295
|
+
reference_image: ["参考图片", "Reference image"],
|
|
296
|
+
generate_audio: ["生成音频", "Generate audio"],
|
|
297
|
+
input: ["输入", "Input"],
|
|
298
|
+
output: ["输出", "Output"],
|
|
299
|
+
read: ["缓存读取", "Cache read"],
|
|
300
|
+
write: ["缓存创建 · 5 分钟", "Cache write · 5 minutes"],
|
|
301
|
+
write1h: ["缓存创建 · 1 小时", "Cache write · 1 hour"],
|
|
302
|
+
output_tokens: ["官方输出 Token 示例", "Official output token example"],
|
|
303
|
+
image_output_per_million: ["图片输出 / 百万 Token", "Image output / million tokens"],
|
|
304
|
+
text_input: ["文字输入", "Text input"],
|
|
305
|
+
image_input: ["图片输入", "Image input"],
|
|
306
|
+
text_cached: ["文字缓存读取", "Cached text"],
|
|
307
|
+
image_cached: ["图片缓存读取", "Cached image"],
|
|
308
|
+
text_input_per_million: ["文字输入 / 百万 Token", "Text input / million tokens"],
|
|
309
|
+
image_input_per_million: ["图片输入 / 百万 Token", "Image input / million tokens"],
|
|
310
|
+
text_output_per_million: ["文字输出 / 百万 Token", "Text output / million tokens"],
|
|
311
|
+
input_video_per_second: ["输入视频 / 秒", "Input video / second"],
|
|
312
|
+
input_image_per_image: ["参考图片 / 张", "Reference image / image"],
|
|
313
|
+
free_images: ["免费参考图数", "Free reference images"],
|
|
314
|
+
units_per_second: ["每秒单位数", "Units / second"]
|
|
315
|
+
};
|
|
316
|
+
Object.keys(factText);
|
|
317
|
+
const facts = (index) => Object.fromEntries(Object.entries(factText).map(([key, values]) => [`priceFact_${key}`, values[index]]));
|
|
318
|
+
const priceZh = {
|
|
319
|
+
...facts(0),
|
|
320
|
+
priceTitle: "模型价格",
|
|
321
|
+
priceIntro: "当前已发布目录与分组售价。仅供阅读,不是报价单或账单;最终扣费以实际用量与计费结果为准。",
|
|
322
|
+
priceSearch: "搜索模型",
|
|
323
|
+
priceSearchPlaceholder: "名称、ID 或声明别名",
|
|
324
|
+
priceKind: "模型类型",
|
|
325
|
+
priceText: "文本",
|
|
326
|
+
priceImage: "图片",
|
|
327
|
+
priceVideo: "视频",
|
|
328
|
+
priceAudio: "音频",
|
|
329
|
+
priceGroup: "产品分组",
|
|
330
|
+
priceDefaultGroup: "默认授权分组",
|
|
331
|
+
pricePageSize: "每页数量",
|
|
332
|
+
priceQuotedAt: "价格读取时间",
|
|
333
|
+
priceCatalogVersion: "目录版本",
|
|
334
|
+
pricePersonalized: "已应用账户报价",
|
|
335
|
+
priceBase: "平台基础报价",
|
|
336
|
+
priceEmpty: "没有符合条件的模型",
|
|
337
|
+
pricePrevious: "上一页",
|
|
338
|
+
priceNext: "下一页",
|
|
339
|
+
pricePagination: "模型目录分页",
|
|
340
|
+
priceTotal: "可见模型",
|
|
341
|
+
pricePage: "页",
|
|
342
|
+
priceCurrent: "当前售价",
|
|
343
|
+
priceReference: "官方参考",
|
|
344
|
+
priceDetails: "价格、参考与能力详情",
|
|
345
|
+
priceCapabilities: "能力参数",
|
|
346
|
+
priceAliases: "声明别名",
|
|
347
|
+
priceCurrentNote: "基础档已包含适用倍率,无需再次相乘;时段、上下文、推理力度变化可能改变实际价格。",
|
|
348
|
+
priceUnknown: "未声明",
|
|
349
|
+
priceUnavailable: "价格暂不可用;没有明确报价不代表免费。",
|
|
350
|
+
priceSupported: "支持",
|
|
351
|
+
priceNotSupported: "不支持",
|
|
352
|
+
priceNone: "无",
|
|
353
|
+
priceNoLimit: "未声明上限",
|
|
354
|
+
priceInput: "输入",
|
|
355
|
+
priceOutput: "输出",
|
|
356
|
+
priceRead: "缓存读取",
|
|
357
|
+
priceWrite: "缓存创建 · 5 分钟",
|
|
358
|
+
priceWrite1h: "缓存创建 · 1 小时",
|
|
359
|
+
priceAmount: "生成价格",
|
|
360
|
+
priceImageInput: "图片输入",
|
|
361
|
+
priceImageOutput: "图片输出",
|
|
362
|
+
priceDefaultAmount: "未命中档位的默认单价",
|
|
363
|
+
priceUnitToken: "CNY / 百万 Token",
|
|
364
|
+
priceUnitVideoToken: "CNY / 百万视频 Token",
|
|
365
|
+
priceUnitImage: "CNY / 张",
|
|
366
|
+
priceUnitGeneration: "CNY / 次",
|
|
367
|
+
priceUnitSecond: "CNY / 秒",
|
|
368
|
+
priceUnitOriginalSecond: "CNY / 原始秒",
|
|
369
|
+
priceUnitMinute: "CNY / 分钟",
|
|
370
|
+
priceTiers: "上下文与媒体价格档位",
|
|
371
|
+
priceWholeRequest: "整单使用所在档位单价;区间为 (下界, 上界],第一档包括 0。",
|
|
372
|
+
priceMarginal: "仅超出阈值的部分使用对应档位单价。",
|
|
373
|
+
priceInterval: "输入上下文区间 · Token",
|
|
374
|
+
priceTime: "模型分时规则",
|
|
375
|
+
pricePeak: "产品分组高峰规则",
|
|
376
|
+
priceWeekdays: "仅周一至周五",
|
|
377
|
+
priceEveryDay: "每天",
|
|
378
|
+
priceExcluded: "排除日期使用基础 1 倍;仅适用于列出的日期",
|
|
379
|
+
priceEndExclusive: "结束时刻不包含",
|
|
380
|
+
priceReasoning: "推理力度倍率",
|
|
381
|
+
priceFast: "快速模式倍率",
|
|
382
|
+
priceFlex: "Flex 模式倍率",
|
|
383
|
+
priceFinalTokens: "最终按供应方返回的计费 Token 用量结算",
|
|
384
|
+
priceFinalRate: "最终视频 Token 单价",
|
|
385
|
+
priceEstimatedSecond: "预估 / 秒",
|
|
386
|
+
priceEstimateNote: "预估费用 = 预估秒价 ×(输出时长 + 所有参考视频总时长)。预估不保证最终金额;视频 Token 单价已包含适用倍率。",
|
|
387
|
+
priceReferenceVideoYes: "带参考视频",
|
|
388
|
+
priceReferenceVideoNo: "无参考视频",
|
|
389
|
+
priceReferenceImageYes: "带参考图片",
|
|
390
|
+
priceReferenceImageNo: "无参考图片",
|
|
391
|
+
priceReferenceAudioYes: "带参考音频",
|
|
392
|
+
priceReferenceAudioNo: "无参考音频",
|
|
393
|
+
pricePredicateAny: "未指定",
|
|
394
|
+
priceReferenceConditions: "参考条件",
|
|
395
|
+
priceScenario: "比价条件",
|
|
396
|
+
priceContextTokens: "输入上下文 · Token",
|
|
397
|
+
priceResolution: "分辨率",
|
|
398
|
+
priceRatio: "宽高比",
|
|
399
|
+
priceQuality: "精确质量",
|
|
400
|
+
pricePixelSize: "精确像素",
|
|
401
|
+
priceImageCount: "输出图片数",
|
|
402
|
+
priceGenerateAudio: "生成音频",
|
|
403
|
+
pricePeriod: "时段",
|
|
404
|
+
priceOffPeak: "标准/闲时",
|
|
405
|
+
pricePeakScenario: "峰时",
|
|
406
|
+
priceOfficialId: "官方型号",
|
|
407
|
+
priceRegion: "地域/服务档",
|
|
408
|
+
priceVerified: "核对日期/状态",
|
|
409
|
+
priceMapping: "映射状态",
|
|
410
|
+
priceOfficialUnit: "官方计费单位",
|
|
411
|
+
priceOfficialTiers: "官方各规格原币价格",
|
|
412
|
+
priceOfficialSource: "官方价格来源",
|
|
413
|
+
priceOfficialWebsite: "官方网站",
|
|
414
|
+
priceOfficialModelSource: "型号来源",
|
|
415
|
+
priceNoReference: "未绑定官方参考档案;当前售价仍按渠道定价执行。",
|
|
416
|
+
priceNoComparison: "暂无可比价",
|
|
417
|
+
priceSaving: "省",
|
|
418
|
+
priceHigher: "高",
|
|
419
|
+
priceEstimated: "约",
|
|
420
|
+
priceOfficialOriginal: "官方原币",
|
|
421
|
+
priceOfficialCny: "官方折算 CNY",
|
|
422
|
+
priceCompareNote: "逐项比价仅在型号、地域、服务档、单位、规格和缓存 TTL 均确认一致时成立。单价节省不代表整单折扣;参考信息不改变扣费。",
|
|
423
|
+
priceFx: "独立展示汇率",
|
|
424
|
+
priceFxNote: "仅用于参考展示,不影响充值和结算。",
|
|
425
|
+
priceCacheTtl: "缓存创建 TTL · 秒",
|
|
426
|
+
priceReferenceModes: "参考模式与组合限制",
|
|
427
|
+
priceRequiredInputs: "必要素材组合",
|
|
428
|
+
priceCombinations: "声明的生成组合",
|
|
429
|
+
priceModelDescription: "模型说明",
|
|
430
|
+
priceSearchTooLong: "搜索内容最多 256 UTF-8 字节。",
|
|
431
|
+
priceReasonUnbound: "未绑定官方参考档案",
|
|
432
|
+
priceReasonExpired: "官方资料已过期或日期未核实,等待核对",
|
|
433
|
+
priceReasonMapping: "映射或价格条件待核对",
|
|
434
|
+
priceReasonRegion: "渠道地域或服务档未确认或不一致",
|
|
435
|
+
priceReasonContext: "渠道上下文计价基准未确认或不一致",
|
|
436
|
+
priceReasonBasis: "上下文计费基准不一致",
|
|
437
|
+
priceReasonInput: "所选上下文超过该型号的输入上限;仅展示基础单价,不计算节省",
|
|
438
|
+
priceReasonResolution: "该型号不支持当前分辨率,请切换到已声明规格",
|
|
439
|
+
priceReasonRatio: "该型号不支持当前宽高比,请切换到已声明规格",
|
|
440
|
+
priceReasonReference: "该型号不支持所选的参考素材条件",
|
|
441
|
+
priceReasonSku: "型号映射或媒体规格尚未确认",
|
|
442
|
+
priceReasonRequired: "缺少已确认的精确像素、质量或输入用量条件,无法比较",
|
|
443
|
+
priceReasonTier: "当前上下文、分辨率或参考条件没有对应的官方规格",
|
|
444
|
+
priceReasonUnit: "售价与官方计费单位或质量规格未对齐",
|
|
445
|
+
priceReasonIncluded: "已计入输入价,不单独比较缓存创建",
|
|
446
|
+
priceReasonTtl: "缓存创建类型或 TTL 未确认或不一致",
|
|
447
|
+
priceReasonMissing: "官方未提供该项价格",
|
|
448
|
+
priceReasonFree: "官方价为零,不计算节省",
|
|
449
|
+
priceReasonFx: "未配置有效的独立展示汇率",
|
|
450
|
+
priceReasonSale: "当前条件下售价未配置",
|
|
451
|
+
priceNoteOutputOnly: "仅比较输出单价;官方参考图片、输入视频等可能另收费,不代表整单优惠。",
|
|
452
|
+
priceNoteImageEstimate: "约:按官方输出 Token 示例推导,仅含图片输出,不含提示词、参考图、文字/思考和工具费用。"
|
|
453
|
+
};
|
|
454
|
+
const priceEn = {
|
|
455
|
+
...facts(1),
|
|
456
|
+
priceTitle: "Model prices",
|
|
457
|
+
priceIntro: "Current published catalog and group retail prices. Not a quote or ledger; final charges follow actual usage and billing results.",
|
|
458
|
+
priceSearch: "Search models",
|
|
459
|
+
priceSearchPlaceholder: "Name, ID or declared alias",
|
|
460
|
+
priceKind: "Model kind",
|
|
461
|
+
priceText: "Text",
|
|
462
|
+
priceImage: "Image",
|
|
463
|
+
priceVideo: "Video",
|
|
464
|
+
priceAudio: "Audio",
|
|
465
|
+
priceGroup: "Product group",
|
|
466
|
+
priceDefaultGroup: "Default authorized group",
|
|
467
|
+
pricePageSize: "Per page",
|
|
468
|
+
priceQuotedAt: "Prices as of",
|
|
469
|
+
priceCatalogVersion: "Catalog version",
|
|
470
|
+
pricePersonalized: "Account pricing applied",
|
|
471
|
+
priceBase: "Platform base prices",
|
|
472
|
+
priceEmpty: "No matching models",
|
|
473
|
+
pricePrevious: "Previous",
|
|
474
|
+
priceNext: "Next",
|
|
475
|
+
pricePagination: "Model catalog pagination",
|
|
476
|
+
priceTotal: "visible models",
|
|
477
|
+
pricePage: "Page",
|
|
478
|
+
priceCurrent: "Current retail prices",
|
|
479
|
+
priceReference: "Official reference",
|
|
480
|
+
priceDetails: "Prices, reference and capability details",
|
|
481
|
+
priceCapabilities: "Capabilities",
|
|
482
|
+
priceAliases: "Declared aliases",
|
|
483
|
+
priceCurrentNote: "Base prices already include applicable multipliers. Do not apply them again; time, context and reasoning changes can affect the actual price.",
|
|
484
|
+
priceUnknown: "Not specified",
|
|
485
|
+
priceUnavailable: "Price unavailable. A missing price does not mean free.",
|
|
486
|
+
priceSupported: "Supported",
|
|
487
|
+
priceNotSupported: "Not supported",
|
|
488
|
+
priceNone: "None",
|
|
489
|
+
priceNoLimit: "No declared upper bound",
|
|
490
|
+
priceInput: "Input",
|
|
491
|
+
priceOutput: "Output",
|
|
492
|
+
priceRead: "Cache read",
|
|
493
|
+
priceWrite: "Cache write · 5 minutes",
|
|
494
|
+
priceWrite1h: "Cache write · 1 hour",
|
|
495
|
+
priceAmount: "Generation price",
|
|
496
|
+
priceImageInput: "Image input",
|
|
497
|
+
priceImageOutput: "Image output",
|
|
498
|
+
priceDefaultAmount: "Default price when no tier matches",
|
|
499
|
+
priceUnitToken: "CNY / million tokens",
|
|
500
|
+
priceUnitVideoToken: "CNY / million video tokens",
|
|
501
|
+
priceUnitImage: "CNY / image",
|
|
502
|
+
priceUnitGeneration: "CNY / generation",
|
|
503
|
+
priceUnitSecond: "CNY / second",
|
|
504
|
+
priceUnitOriginalSecond: "CNY / original second",
|
|
505
|
+
priceUnitMinute: "CNY / minute",
|
|
506
|
+
priceTiers: "Context and media price tiers",
|
|
507
|
+
priceWholeRequest: "The whole request uses its matching tier. Intervals are (lower, upper]; the first tier includes 0.",
|
|
508
|
+
priceMarginal: "Only usage above each threshold uses that tier price.",
|
|
509
|
+
priceInterval: "Input context interval · tokens",
|
|
510
|
+
priceTime: "Model time rules",
|
|
511
|
+
pricePeak: "Product group peak rules",
|
|
512
|
+
priceWeekdays: "Monday to Friday only",
|
|
513
|
+
priceEveryDay: "Every day",
|
|
514
|
+
priceExcluded: "Excluded dates use the base multiplier of 1; only the listed dates apply",
|
|
515
|
+
priceEndExclusive: "End time excluded",
|
|
516
|
+
priceReasoning: "Reasoning multipliers",
|
|
517
|
+
priceFast: "Fast mode multiplier",
|
|
518
|
+
priceFlex: "Flex mode multiplier",
|
|
519
|
+
priceFinalTokens: "Final charge uses provider billable tokens",
|
|
520
|
+
priceFinalRate: "Final video token rate",
|
|
521
|
+
priceEstimatedSecond: "Estimated / second",
|
|
522
|
+
priceEstimateNote: "Estimate = estimated second price × (output duration + total reference video duration). Estimates do not guarantee final charges. Video token prices already include applicable multipliers.",
|
|
523
|
+
priceReferenceVideoYes: "With reference video",
|
|
524
|
+
priceReferenceVideoNo: "Without reference video",
|
|
525
|
+
priceReferenceImageYes: "With reference image",
|
|
526
|
+
priceReferenceImageNo: "Without reference image",
|
|
527
|
+
priceReferenceAudioYes: "With reference audio",
|
|
528
|
+
priceReferenceAudioNo: "Without reference audio",
|
|
529
|
+
pricePredicateAny: "Not specified",
|
|
530
|
+
priceReferenceConditions: "Reference conditions",
|
|
531
|
+
priceScenario: "Comparison conditions",
|
|
532
|
+
priceContextTokens: "Input context · tokens",
|
|
533
|
+
priceResolution: "Resolution",
|
|
534
|
+
priceRatio: "Aspect ratio",
|
|
535
|
+
priceQuality: "Exact quality",
|
|
536
|
+
pricePixelSize: "Exact pixels",
|
|
537
|
+
priceImageCount: "Output image count",
|
|
538
|
+
priceGenerateAudio: "Generate audio",
|
|
539
|
+
pricePeriod: "Period",
|
|
540
|
+
priceOffPeak: "Standard / off peak",
|
|
541
|
+
pricePeakScenario: "Peak",
|
|
542
|
+
priceOfficialId: "Official model",
|
|
543
|
+
priceRegion: "Region / service tier",
|
|
544
|
+
priceVerified: "Verified date / status",
|
|
545
|
+
priceMapping: "Mapping status",
|
|
546
|
+
priceOfficialUnit: "Official billing unit",
|
|
547
|
+
priceOfficialTiers: "All official specifications in original currency",
|
|
548
|
+
priceOfficialSource: "Official price source",
|
|
549
|
+
priceOfficialWebsite: "Official website",
|
|
550
|
+
priceOfficialModelSource: "Model source",
|
|
551
|
+
priceNoReference: "No official reference profile is bound. Current retail prices still follow channel pricing.",
|
|
552
|
+
priceNoComparison: "No comparable price",
|
|
553
|
+
priceSaving: "Save",
|
|
554
|
+
priceHigher: "Higher",
|
|
555
|
+
priceEstimated: "Approx.",
|
|
556
|
+
priceOfficialOriginal: "Official original currency",
|
|
557
|
+
priceOfficialCny: "Official converted CNY",
|
|
558
|
+
priceCompareNote: "Component comparisons require confirmed model, region, service tier, unit, specification and cache TTL matches. Unit savings do not represent a whole order discount; references do not alter charges.",
|
|
559
|
+
priceFx: "Independent display exchange rate",
|
|
560
|
+
priceFxNote: "For reference display only; does not affect deposits or settlement.",
|
|
561
|
+
priceCacheTtl: "Cache write TTL · seconds",
|
|
562
|
+
priceReferenceModes: "Reference modes and combination limits",
|
|
563
|
+
priceRequiredInputs: "Required input combinations",
|
|
564
|
+
priceCombinations: "Declared generation combinations",
|
|
565
|
+
priceModelDescription: "Model description",
|
|
566
|
+
priceSearchTooLong: "Search is limited to 256 UTF-8 bytes.",
|
|
567
|
+
priceReasonUnbound: "No official reference profile is bound",
|
|
568
|
+
priceReasonExpired: "Official information is expired or its date is unverified",
|
|
569
|
+
priceReasonMapping: "Mapping or price conditions need verification",
|
|
570
|
+
priceReasonRegion: "Channel region or service tier is unconfirmed or does not match",
|
|
571
|
+
priceReasonContext: "Channel context pricing basis is unconfirmed or does not match",
|
|
572
|
+
priceReasonBasis: "Context billing bases do not match",
|
|
573
|
+
priceReasonInput: "Selected context exceeds the model input limit; only base rates are shown and savings are disabled",
|
|
574
|
+
priceReasonResolution: "The model does not support the selected resolution",
|
|
575
|
+
priceReasonRatio: "The model does not support the selected aspect ratio",
|
|
576
|
+
priceReasonReference: "The model does not support the selected reference inputs",
|
|
577
|
+
priceReasonSku: "Model mapping or media specification is unconfirmed",
|
|
578
|
+
priceReasonRequired: "Confirmed exact pixels, quality or input usage conditions are missing",
|
|
579
|
+
priceReasonTier: "No official specification matches the current context, resolution or references",
|
|
580
|
+
priceReasonUnit: "Retail and official billing units or quality specifications do not match",
|
|
581
|
+
priceReasonIncluded: "Included in the input price; cache writes are not compared separately",
|
|
582
|
+
priceReasonTtl: "Cache write type or TTL is unconfirmed or does not match",
|
|
583
|
+
priceReasonMissing: "The official source does not provide this component price",
|
|
584
|
+
priceReasonFree: "The official price is zero; savings are not calculated",
|
|
585
|
+
priceReasonFx: "No valid independent display exchange rate is configured",
|
|
586
|
+
priceReasonSale: "Retail pricing is not configured for the current conditions",
|
|
587
|
+
priceNoteOutputOnly: "Only output unit prices are compared. Official reference images or input video may cost extra; this is not a whole order discount.",
|
|
588
|
+
priceNoteImageEstimate: "Approximate image output only, derived from an official output token example. Excludes prompts, reference images, text, thinking and tools."
|
|
589
|
+
};
|
|
590
|
+
Object.fromEntries(Object.entries(priceZh).filter(([key]) => key.startsWith("priceReason") || key.startsWith("priceNote")).map(([key, value]) => [value, key]));
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region src/client/AccountCenter/channel-status-locales.ts
|
|
593
|
+
const statusZh = {
|
|
594
|
+
centerMonitorTitle: "渠道状态",
|
|
595
|
+
centerMonitorScope: "当前账号可访问分组中的历史观测。状态会随聚合更新,空白不表示正常。",
|
|
596
|
+
centerMonitorRange: "观测窗口",
|
|
597
|
+
centerMonitor90m: "90 分钟",
|
|
598
|
+
centerMonitor24h: "24 小时",
|
|
599
|
+
centerMonitor7d: "7 天",
|
|
600
|
+
centerMonitor30d: "30 天",
|
|
601
|
+
centerMonitorPlatform: "平台",
|
|
602
|
+
centerMonitorGroup: "分组",
|
|
603
|
+
centerMonitorModel: "模型",
|
|
604
|
+
centerMonitorAll: "全部",
|
|
605
|
+
centerMonitorClear: "清除筛选",
|
|
606
|
+
centerMonitorCards: "卡片",
|
|
607
|
+
centerMonitorList: "列表",
|
|
608
|
+
centerMonitorView: "显示方式",
|
|
609
|
+
centerMonitorRefresh: "刷新状态",
|
|
610
|
+
centerMonitorPulse: "可用性",
|
|
611
|
+
centerMonitorLine: "趋势",
|
|
612
|
+
centerMonitorMetric: "指标",
|
|
613
|
+
centerMonitorHealthy: "健康",
|
|
614
|
+
centerMonitorWarning: "需关注",
|
|
615
|
+
centerMonitorCritical: "异常",
|
|
616
|
+
centerMonitorUnknown: "未知",
|
|
617
|
+
centerMonitorOperational: "运行正常",
|
|
618
|
+
centerMonitorDegraded: "性能下降",
|
|
619
|
+
centerMonitorFailed: "不可用",
|
|
620
|
+
centerMonitorError: "检测异常",
|
|
621
|
+
centerMonitorSuccess: "成功率",
|
|
622
|
+
centerMonitorErrorRate: "错误率",
|
|
623
|
+
centerMonitorCache: "缓存命中率",
|
|
624
|
+
centerMonitorTTFT: "首 Token 延迟",
|
|
625
|
+
centerMonitorDuration: "请求耗时",
|
|
626
|
+
centerMonitorAverage: "平均",
|
|
627
|
+
centerMonitorScore: "健康分数",
|
|
628
|
+
centerMonitorNoObservations: "暂无观测数据",
|
|
629
|
+
centerMonitorNoCache: "暂无缓存观测",
|
|
630
|
+
centerMonitorPartial: "历史尚未完整",
|
|
631
|
+
centerMonitorComplete: "历史已覆盖",
|
|
632
|
+
centerMonitorCoverageUnknown: "历史覆盖范围未知",
|
|
633
|
+
centerMonitorBootstrap: "正在准备历史数据",
|
|
634
|
+
centerMonitorLag: "聚合延迟",
|
|
635
|
+
centerMonitorDataThrough: "数据更新至",
|
|
636
|
+
centerMonitorCoverageFrom: "历史起点",
|
|
637
|
+
centerMonitorComputed: "聚合时间",
|
|
638
|
+
centerMonitorRequested: "请求窗口",
|
|
639
|
+
centerMonitorAutoCatalogue: "自动模型目录",
|
|
640
|
+
centerMonitorManualCatalogue: "手动模型目录",
|
|
641
|
+
centerMonitorCatalogueUnknown: "模型目录来源未知",
|
|
642
|
+
centerMonitorCadence: "服务器更新间隔",
|
|
643
|
+
centerMonitorSeconds: "秒",
|
|
644
|
+
centerMonitorManualOnly: "按需读取;使用刷新按钮更新。",
|
|
645
|
+
centerMonitorModels: "模型表现",
|
|
646
|
+
centerMonitorNoModels: "此筛选下暂无模型观测。",
|
|
647
|
+
centerMonitorTrend: "状态趋势",
|
|
648
|
+
centerMonitorTimeline: "最近状态",
|
|
649
|
+
centerMonitorPoint: "选择观测点",
|
|
650
|
+
centerMonitorExact: "查看逐点数据",
|
|
651
|
+
centerMonitorTime: "时间",
|
|
652
|
+
centerMonitorNoTrend: "暂无趋势数据。",
|
|
653
|
+
centerMonitorMatrix: "维度状态",
|
|
654
|
+
centerMonitorGroupBy: "按维度汇总",
|
|
655
|
+
centerMonitorByPlatform: "平台",
|
|
656
|
+
centerMonitorByGroup: "平台 / 分组",
|
|
657
|
+
centerMonitorByModel: "平台 / 模型",
|
|
658
|
+
centerMonitorByAll: "平台 / 分组 / 模型",
|
|
659
|
+
centerMonitorDimension: "维度",
|
|
660
|
+
centerMonitorErrors: "错误分类",
|
|
661
|
+
centerMonitorNoErrors: "此窗口暂无错误分类。",
|
|
662
|
+
centerMonitorIgnored: "不计入健康评分",
|
|
663
|
+
centerMonitorErrorNote: "仅显示分类比例;不展示原始错误或请求内容。",
|
|
664
|
+
centerMonitorDetail: "查看详情",
|
|
665
|
+
centerMonitorClose: "收起详情",
|
|
666
|
+
centerMonitorThresholds: "健康判定阈值",
|
|
667
|
+
centerMonitorThresholdError: "错误率 · 警告 / 异常",
|
|
668
|
+
centerMonitorThresholdTTFT: "首 Token 延迟 · 目标 / 警告 / 异常",
|
|
669
|
+
centerMonitorThresholdCache: "缓存命中率 · 警告 / 异常",
|
|
670
|
+
centerMonitorLegacy: "兼容状态视图",
|
|
671
|
+
centerMonitorLegacyNote: "显示服务器已有检测记录;模型信息列在下方。",
|
|
672
|
+
centerMonitorNoLegacy: "暂无当前账号可见的状态记录,或监控尚未启用。",
|
|
673
|
+
centerMonitorAvailability: "可用率",
|
|
674
|
+
centerMonitor15d: "15 天",
|
|
675
|
+
centerMonitorPing: "连接延迟",
|
|
676
|
+
centerMonitorAverage7d: "7 天平均延迟",
|
|
677
|
+
centerMonitorLatency: "最近延迟",
|
|
678
|
+
centerMonitorCategoryContent: "内容策略",
|
|
679
|
+
centerMonitorCategoryAuth: "身份验证",
|
|
680
|
+
centerMonitorCategoryContext: "上下文长度",
|
|
681
|
+
centerMonitorCategoryRequest: "请求格式",
|
|
682
|
+
centerMonitorCategoryModel: "模型不支持",
|
|
683
|
+
centerMonitorCategoryGroup: "分组访问",
|
|
684
|
+
centerMonitorCategoryQuota: "额度或余额",
|
|
685
|
+
centerMonitorCategoryPool: "渠道资源暂不可用",
|
|
686
|
+
centerMonitorCategoryRate: "速率或容量",
|
|
687
|
+
centerMonitorCategoryTimeout: "请求超时",
|
|
688
|
+
centerMonitorCategoryTransport: "连接或流传输",
|
|
689
|
+
centerMonitorCategoryForbidden: "上游访问限制",
|
|
690
|
+
centerMonitorCategoryNotFound: "资源不存在",
|
|
691
|
+
centerMonitorCategoryCancelled: "客户端取消",
|
|
692
|
+
centerMonitorCategoryUpstream: "上游服务异常",
|
|
693
|
+
centerMonitorCategoryInternal: "内部错误",
|
|
694
|
+
centerMonitorCategoryOther: "其他"
|
|
695
|
+
};
|
|
696
|
+
const statusEn = {
|
|
697
|
+
centerMonitorTitle: "Channel status",
|
|
698
|
+
centerMonitorScope: "Historical observations for groups available to this account. Status follows aggregation; missing data does not indicate good health.",
|
|
699
|
+
centerMonitorRange: "Observation window",
|
|
700
|
+
centerMonitor90m: "90 minutes",
|
|
701
|
+
centerMonitor24h: "24 hours",
|
|
702
|
+
centerMonitor7d: "7 days",
|
|
703
|
+
centerMonitor30d: "30 days",
|
|
704
|
+
centerMonitorPlatform: "Platform",
|
|
705
|
+
centerMonitorGroup: "Group",
|
|
706
|
+
centerMonitorModel: "Model",
|
|
707
|
+
centerMonitorAll: "All",
|
|
708
|
+
centerMonitorClear: "Clear filters",
|
|
709
|
+
centerMonitorCards: "Cards",
|
|
710
|
+
centerMonitorList: "List",
|
|
711
|
+
centerMonitorView: "Display",
|
|
712
|
+
centerMonitorRefresh: "Refresh status",
|
|
713
|
+
centerMonitorPulse: "Availability",
|
|
714
|
+
centerMonitorLine: "Trend",
|
|
715
|
+
centerMonitorMetric: "Metric",
|
|
716
|
+
centerMonitorHealthy: "Healthy",
|
|
717
|
+
centerMonitorWarning: "Attention needed",
|
|
718
|
+
centerMonitorCritical: "Critical",
|
|
719
|
+
centerMonitorUnknown: "Unknown",
|
|
720
|
+
centerMonitorOperational: "Operational",
|
|
721
|
+
centerMonitorDegraded: "Degraded",
|
|
722
|
+
centerMonitorFailed: "Unavailable",
|
|
723
|
+
centerMonitorError: "Check error",
|
|
724
|
+
centerMonitorSuccess: "Success rate",
|
|
725
|
+
centerMonitorErrorRate: "Error rate",
|
|
726
|
+
centerMonitorCache: "Cache hit rate",
|
|
727
|
+
centerMonitorTTFT: "Time to first token",
|
|
728
|
+
centerMonitorDuration: "Request duration",
|
|
729
|
+
centerMonitorAverage: "Average",
|
|
730
|
+
centerMonitorScore: "Health score",
|
|
731
|
+
centerMonitorNoObservations: "No observations yet",
|
|
732
|
+
centerMonitorNoCache: "No cache observations",
|
|
733
|
+
centerMonitorPartial: "Partial history",
|
|
734
|
+
centerMonitorComplete: "History covered",
|
|
735
|
+
centerMonitorCoverageUnknown: "History coverage unknown",
|
|
736
|
+
centerMonitorBootstrap: "Preparing history",
|
|
737
|
+
centerMonitorLag: "Aggregation lag",
|
|
738
|
+
centerMonitorDataThrough: "Data through",
|
|
739
|
+
centerMonitorCoverageFrom: "History starts",
|
|
740
|
+
centerMonitorComputed: "Computed at",
|
|
741
|
+
centerMonitorRequested: "Requested window",
|
|
742
|
+
centerMonitorAutoCatalogue: "Auto catalogue",
|
|
743
|
+
centerMonitorManualCatalogue: "Manual catalogue",
|
|
744
|
+
centerMonitorCatalogueUnknown: "Catalogue source unknown",
|
|
745
|
+
centerMonitorCadence: "Server refresh interval",
|
|
746
|
+
centerMonitorSeconds: "seconds",
|
|
747
|
+
centerMonitorManualOnly: "Read on demand. Use refresh to update.",
|
|
748
|
+
centerMonitorModels: "Model performance",
|
|
749
|
+
centerMonitorNoModels: "No model observations match these filters.",
|
|
750
|
+
centerMonitorTrend: "Status trend",
|
|
751
|
+
centerMonitorTimeline: "Recent status",
|
|
752
|
+
centerMonitorPoint: "Select observation",
|
|
753
|
+
centerMonitorExact: "View observations",
|
|
754
|
+
centerMonitorTime: "Time",
|
|
755
|
+
centerMonitorNoTrend: "No trend observations yet.",
|
|
756
|
+
centerMonitorMatrix: "Dimension health",
|
|
757
|
+
centerMonitorGroupBy: "Group by",
|
|
758
|
+
centerMonitorByPlatform: "Platform",
|
|
759
|
+
centerMonitorByGroup: "Platform / group",
|
|
760
|
+
centerMonitorByModel: "Platform / model",
|
|
761
|
+
centerMonitorByAll: "Platform / group / model",
|
|
762
|
+
centerMonitorDimension: "Dimension",
|
|
763
|
+
centerMonitorErrors: "Error categories",
|
|
764
|
+
centerMonitorNoErrors: "No error categories in this window.",
|
|
765
|
+
centerMonitorIgnored: "Excluded from health scoring",
|
|
766
|
+
centerMonitorErrorNote: "Category proportions only. Raw errors and request contents are excluded.",
|
|
767
|
+
centerMonitorDetail: "View details",
|
|
768
|
+
centerMonitorClose: "Close details",
|
|
769
|
+
centerMonitorThresholds: "Health thresholds",
|
|
770
|
+
centerMonitorThresholdError: "Error rate · warning / critical",
|
|
771
|
+
centerMonitorThresholdTTFT: "First token · target / warning / critical",
|
|
772
|
+
centerMonitorThresholdCache: "Cache hit rate · warning / critical",
|
|
773
|
+
centerMonitorLegacy: "Compatible status view",
|
|
774
|
+
centerMonitorLegacyNote: "Existing server observations. Model information is listed below.",
|
|
775
|
+
centerMonitorNoLegacy: "No status records are available to this account, or monitoring is disabled.",
|
|
776
|
+
centerMonitorAvailability: "Availability",
|
|
777
|
+
centerMonitor15d: "15 days",
|
|
778
|
+
centerMonitorPing: "Connection latency",
|
|
779
|
+
centerMonitorAverage7d: "7-day average latency",
|
|
780
|
+
centerMonitorLatency: "Latest latency",
|
|
781
|
+
centerMonitorCategoryContent: "Content policy",
|
|
782
|
+
centerMonitorCategoryAuth: "Authentication",
|
|
783
|
+
centerMonitorCategoryContext: "Context limit",
|
|
784
|
+
centerMonitorCategoryRequest: "Invalid request",
|
|
785
|
+
centerMonitorCategoryModel: "Unsupported model",
|
|
786
|
+
centerMonitorCategoryGroup: "Group access",
|
|
787
|
+
centerMonitorCategoryQuota: "Quota or balance",
|
|
788
|
+
centerMonitorCategoryPool: "Channel resources unavailable",
|
|
789
|
+
centerMonitorCategoryRate: "Rate or capacity",
|
|
790
|
+
centerMonitorCategoryTimeout: "Timeout",
|
|
791
|
+
centerMonitorCategoryTransport: "Transport or stream",
|
|
792
|
+
centerMonitorCategoryForbidden: "Upstream access restriction",
|
|
793
|
+
centerMonitorCategoryNotFound: "Not found",
|
|
794
|
+
centerMonitorCategoryCancelled: "Client cancelled",
|
|
795
|
+
centerMonitorCategoryUpstream: "Upstream service error",
|
|
796
|
+
centerMonitorCategoryInternal: "Internal error",
|
|
797
|
+
centerMonitorCategoryOther: "Other"
|
|
798
|
+
};
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region src/client/AccountCenter/commerce-locales.ts
|
|
801
|
+
const commerceZh = {
|
|
802
|
+
ordersIntro: "查看付款、入账与退款进度。",
|
|
803
|
+
ordersBackToList: "返回订单列表",
|
|
804
|
+
ordersAdvancedFilters: "更多筛选",
|
|
805
|
+
ordersResetFilters: "重置筛选",
|
|
806
|
+
ordersMethodAlipay: "支付宝",
|
|
807
|
+
ordersMethodWechat: "微信支付",
|
|
808
|
+
ordersRefresh: "刷新订单",
|
|
809
|
+
ordersList: "订单列表",
|
|
810
|
+
ordersNoOrdersHint: "可调整筛选,或前往充值创建订单。",
|
|
811
|
+
ordersDismissAction: "暂不操作",
|
|
812
|
+
rechargeQuickAmounts: "快捷金额",
|
|
813
|
+
rechargeCustomAmount: "自定义金额",
|
|
814
|
+
rechargePickMethod: "选择支付方式",
|
|
815
|
+
rechargeChooseHint: "选择金额和支付方式,确认后创建订单。",
|
|
816
|
+
rechargeChooseAmount: "请选择充值金额",
|
|
817
|
+
rechargeConfirmTopUp: "确认充值",
|
|
818
|
+
rechargeConfirmSubscription: "确认购买订阅",
|
|
819
|
+
rechargeFeeIncluded: "已包含手续费",
|
|
820
|
+
rechargeNoFee: "无手续费",
|
|
821
|
+
rechargePaymentDetails: "费用明细",
|
|
822
|
+
rechargeLimitDetails: "支付限额",
|
|
823
|
+
rechargeSubmitHint: "确认后将创建订单;实际付款仍需扫码或前往官方收银台完成。",
|
|
824
|
+
rechargePaymentTitle: "完成付款",
|
|
825
|
+
rechargeWaitingPayment: "等待付款",
|
|
826
|
+
rechargeWaitingCredit: "已付款,正在入账",
|
|
827
|
+
rechargeWaitingCreditNote: "支付已确认,余额正在入账,请勿重复付款。",
|
|
828
|
+
rechargeCompleted: "已到账",
|
|
829
|
+
rechargeCompletedNote: "订单已完成,充值或订阅已生效。",
|
|
830
|
+
rechargePaymentUnknown: "暂无法确认支付状态",
|
|
831
|
+
rechargePaymentUnknownNote: "暂未获取到最新状态。请核对我的订单或官方支付记录,勿重复付款。",
|
|
832
|
+
rechargeRefreshingStatus: "正在更新状态…",
|
|
833
|
+
rechargeRefreshStatus: "刷新状态",
|
|
834
|
+
rechargeAutoCheck: "每 5 秒自动更新状态",
|
|
835
|
+
rechargeAutoCheckPaused: "自动更新已暂停,请手动刷新。",
|
|
836
|
+
rechargeBackToRecharge: "返回充值",
|
|
837
|
+
rechargeNewOrderWarning: "当前订单可能仍可付款或正在入账。请先核对订单状态;创建新订单不会关闭当前订单。",
|
|
838
|
+
rechargeNewOrderConfirm: "确认创建另一笔订单",
|
|
839
|
+
rechargeKeepOrder: "保留当前订单",
|
|
840
|
+
rechargeOrderDetails: "订单详情",
|
|
841
|
+
rechargeDiscountedPayment: "优惠后应付",
|
|
842
|
+
rechargeCredits: "到账额度",
|
|
843
|
+
rechargeSelected: "已选择",
|
|
844
|
+
rechargeAmountStep: "充值金额",
|
|
845
|
+
rechargeMethodStep: "支付方式",
|
|
846
|
+
rechargeSecurePaymentNote: "通过官方支付渠道完成付款。",
|
|
847
|
+
rechargeMethodUnavailableLabel: "暂不可用",
|
|
848
|
+
rechargeOrderClosed: "订单已结束",
|
|
849
|
+
rechargeOrderClosedNote: "订单已关闭,不要继续付款。",
|
|
850
|
+
rechargeCreatingOrder: "正在创建订单…",
|
|
851
|
+
rechargeCampaign: "充值活动",
|
|
852
|
+
rechargeExpiryElapsed: "付款时限已过,请刷新订单状态。",
|
|
853
|
+
commerceCurrencyUnknown: "币种未知",
|
|
854
|
+
commerceRecharge: "充值",
|
|
855
|
+
commerceOrders: "我的订单",
|
|
856
|
+
commerceBalance: "余额充值",
|
|
857
|
+
commerceSubscription: "购买订阅",
|
|
858
|
+
commerceAmount: "充值金额",
|
|
859
|
+
commerceMethod: "支付方式",
|
|
860
|
+
commerceMethodUnavailable: "此支付方式当前不可用。",
|
|
861
|
+
commerceNoMethods: "当前没有可用支付方式。",
|
|
862
|
+
commerceDisabled: "网关当前未开放支付。",
|
|
863
|
+
commerceBalanceDisabled: "余额充值已关闭,可查看订阅计划。",
|
|
864
|
+
commercePlans: "订阅计划",
|
|
865
|
+
commerceNoPlans: "当前没有在售订阅计划。",
|
|
866
|
+
commercePlan: "计划",
|
|
867
|
+
commerceChoosePlan: "选择计划",
|
|
868
|
+
commercePriceUnknown: "价格未知",
|
|
869
|
+
commerceUnknown: "未知",
|
|
870
|
+
commerceDays: "天",
|
|
871
|
+
commerceMonth: "月",
|
|
872
|
+
commerceYear: "年",
|
|
873
|
+
commerceValidity: "有效期",
|
|
874
|
+
commerceGroup: "分组",
|
|
875
|
+
commerceFeatures: "包含内容",
|
|
876
|
+
commerceDailyQuota: "每日额度",
|
|
877
|
+
commerceWeeklyQuota: "每周额度",
|
|
878
|
+
commerceMonthlyQuota: "每月额度",
|
|
879
|
+
commerceRate: "倍率",
|
|
880
|
+
commerceModels: "支持模型",
|
|
881
|
+
commerceInputAmount: "输入金额",
|
|
882
|
+
commerceEstimate: "预估金额",
|
|
883
|
+
commerceEstimateNote: "创建前为预估;实际应付与到账金额以网关创建的订单为准。",
|
|
884
|
+
commercePayBase: "支付基数",
|
|
885
|
+
commerceFee: "手续费",
|
|
886
|
+
commerceBonus: "赠送额度",
|
|
887
|
+
commerceDiscount: "优惠",
|
|
888
|
+
commerceCredited: "预计到账余额",
|
|
889
|
+
commerceTotal: "预计应付",
|
|
890
|
+
commerceRange: "单笔限额",
|
|
891
|
+
commerceDailyRemaining: "渠道今日剩余",
|
|
892
|
+
commerceUnlimited: "不限",
|
|
893
|
+
commerceReview: "核对订单",
|
|
894
|
+
commerceConfirm: "确认创建订单",
|
|
895
|
+
commerceConfirmNote: "确认将向网关创建此订单。付款需在下方官方支付页面或扫码完成。",
|
|
896
|
+
commerceBack: "返回修改",
|
|
897
|
+
commerceNewOrder: "创建另一笔订单",
|
|
898
|
+
commerceActual: "网关订单",
|
|
899
|
+
commerceActualPay: "实际应付",
|
|
900
|
+
commerceActualCredit: "订单金额",
|
|
901
|
+
commerceOrderCreatedNote: "订单已创建,当前不代表付款成功。请核对金额后付款,并在订单页查询结果。",
|
|
902
|
+
commercePayLink: "打开官方支付页面",
|
|
903
|
+
commerceOfficialFlow: "此支付方式需要在网站完成验证或官方收银台流程。请从网站继续,并在创建新订单前核对我的订单。",
|
|
904
|
+
commerceOpenWeb: "打开充值网站",
|
|
905
|
+
commerceQr: "使用支付应用扫码",
|
|
906
|
+
commerceQrLocal: "二维码由本机生成。",
|
|
907
|
+
commerceQrFailed: "二维码暂时无法生成,请使用官方支付页面。",
|
|
908
|
+
commerceExpires: "到期时间",
|
|
909
|
+
commerceOrderId: "订单号",
|
|
910
|
+
commerceTradeNo: "商户订单号",
|
|
911
|
+
commerceStatus: "状态",
|
|
912
|
+
commerceType: "订单类型",
|
|
913
|
+
commerceCreated: "创建时间",
|
|
914
|
+
commercePaid: "支付时间",
|
|
915
|
+
commerceCompleted: "完成时间",
|
|
916
|
+
commerceActions: "操作",
|
|
917
|
+
commerceDetail: "详情",
|
|
918
|
+
commerceClose: "关闭详情",
|
|
919
|
+
commerceNoOrders: "当前筛选条件下没有订单。",
|
|
920
|
+
commerceAll: "全部",
|
|
921
|
+
commercePage: "页",
|
|
922
|
+
commercePageSize: "每页条数",
|
|
923
|
+
commercePrevious: "上一页",
|
|
924
|
+
commerceNext: "下一页",
|
|
925
|
+
commerceCount: "总条数",
|
|
926
|
+
commerceCancel: "取消订单",
|
|
927
|
+
commerceCancelConfirm: "确认取消此待付款订单?",
|
|
928
|
+
commerceVerify: "查询支付结果",
|
|
929
|
+
commerceVerifyNote: "此操作会向支付渠道核对,并可能完成订单入账。",
|
|
930
|
+
commerceConfirmVerify: "确认查询",
|
|
931
|
+
commerceRefund: "申请退款",
|
|
932
|
+
commerceRefundReason: "退款原因",
|
|
933
|
+
commerceRefundNote: "申请将由网关审核,提交申请不代表退款成功。",
|
|
934
|
+
commerceConfirmRefund: "确认提交申请",
|
|
935
|
+
commerceRefundAmount: "已退款金额",
|
|
936
|
+
commerceRefundRequested: "退款申请时间",
|
|
937
|
+
commerceRefundEligibilityUnknown: "退款渠道资格暂不可用。",
|
|
938
|
+
commerceInvalidAmount: "请输入有效金额;余额充值金额必须大于零。",
|
|
939
|
+
commerceAmountPrecision: "金额的小数位数超过当前支付币种限制。",
|
|
940
|
+
commerceBelowLimit: "金额低于当前限额。",
|
|
941
|
+
commerceAboveLimit: "金额超过当前限额。",
|
|
942
|
+
commerceDailyLimit: "金额超过此渠道今日剩余额度。",
|
|
943
|
+
commerceInvalidPlan: "此计划暂无法在插件内购买,请使用网站。",
|
|
944
|
+
commerceReasonRequired: "请填写退款原因(最多 500 字)。",
|
|
945
|
+
commerceUnavailableDetail: "订单详情暂不可用。",
|
|
946
|
+
commercePending: "待付款",
|
|
947
|
+
commerceOrderPaid: "已付款",
|
|
948
|
+
commerceRecharging: "入账中",
|
|
949
|
+
commerceOrderCompleted: "已完成",
|
|
950
|
+
commerceExpired: "已过期",
|
|
951
|
+
commerceCancelled: "已取消",
|
|
952
|
+
commerceFailed: "失败",
|
|
953
|
+
commerceRefundRequestedStatus: "已申请退款",
|
|
954
|
+
commerceRefunding: "退款中",
|
|
955
|
+
commerceRefundPending: "等待退款",
|
|
956
|
+
commercePartiallyRefunded: "部分退款",
|
|
957
|
+
commerceRefunded: "已退款",
|
|
958
|
+
commerceRefundFailed: "退款失败",
|
|
959
|
+
commerceNoActionUntilRead: "请等待网关数据加载完成后再创建订单。"
|
|
960
|
+
};
|
|
961
|
+
const commerceEn = {
|
|
962
|
+
ordersIntro: "Track payments, crediting and refunds.",
|
|
963
|
+
ordersBackToList: "Back to orders",
|
|
964
|
+
ordersAdvancedFilters: "More filters",
|
|
965
|
+
ordersResetFilters: "Reset filters",
|
|
966
|
+
ordersMethodAlipay: "Alipay",
|
|
967
|
+
ordersMethodWechat: "WeChat Pay",
|
|
968
|
+
ordersRefresh: "Refresh orders",
|
|
969
|
+
ordersList: "Orders",
|
|
970
|
+
ordersNoOrdersHint: "Change the filters or go to Recharge to create an order.",
|
|
971
|
+
ordersDismissAction: "Not now",
|
|
972
|
+
rechargeQuickAmounts: "Quick amounts",
|
|
973
|
+
rechargeCustomAmount: "Custom amount",
|
|
974
|
+
rechargePickMethod: "Choose a payment method",
|
|
975
|
+
rechargeChooseHint: "Choose an amount and payment method, then confirm to create an order.",
|
|
976
|
+
rechargeChooseAmount: "Choose an amount",
|
|
977
|
+
rechargeConfirmTopUp: "Confirm top-up",
|
|
978
|
+
rechargeConfirmSubscription: "Confirm subscription",
|
|
979
|
+
rechargeFeeIncluded: "Surcharge included",
|
|
980
|
+
rechargeNoFee: "No surcharge",
|
|
981
|
+
rechargePaymentDetails: "Price breakdown",
|
|
982
|
+
rechargeLimitDetails: "Payment limits",
|
|
983
|
+
rechargeSubmitHint: "Confirmation creates an order. Complete payment separately using the QR code or official checkout.",
|
|
984
|
+
rechargePaymentTitle: "Complete payment",
|
|
985
|
+
rechargeWaitingPayment: "Waiting for payment",
|
|
986
|
+
rechargeWaitingCredit: "Payment received, credit pending",
|
|
987
|
+
rechargeWaitingCreditNote: "Payment confirmed. Your balance is being credited; do not pay again.",
|
|
988
|
+
rechargeCompleted: "Credited",
|
|
989
|
+
rechargeCompletedNote: "The order is complete. Your top-up or subscription is now active.",
|
|
990
|
+
rechargePaymentUnknown: "Payment status unavailable",
|
|
991
|
+
rechargePaymentUnknownNote: "The latest status is unavailable. Check My orders or the official payment record before paying again.",
|
|
992
|
+
rechargeRefreshingStatus: "Refreshing status…",
|
|
993
|
+
rechargeRefreshStatus: "Refresh status",
|
|
994
|
+
rechargeAutoCheck: "Status updates every 5 seconds",
|
|
995
|
+
rechargeAutoCheckPaused: "Auto-update paused. Refresh to check the latest status.",
|
|
996
|
+
rechargeBackToRecharge: "Back to recharge",
|
|
997
|
+
rechargeNewOrderWarning: "This order may still be payable or awaiting credit. Check its status first. Creating a new order does not close this one.",
|
|
998
|
+
rechargeNewOrderConfirm: "Confirm another order",
|
|
999
|
+
rechargeKeepOrder: "Keep current order",
|
|
1000
|
+
rechargeOrderDetails: "Order details",
|
|
1001
|
+
rechargeDiscountedPayment: "Discounted payment",
|
|
1002
|
+
rechargeCredits: "Credit amount",
|
|
1003
|
+
rechargeSelected: "Selected",
|
|
1004
|
+
rechargeAmountStep: "Amount",
|
|
1005
|
+
rechargeMethodStep: "Payment method",
|
|
1006
|
+
rechargeSecurePaymentNote: "Complete payment through the official provider.",
|
|
1007
|
+
rechargeMethodUnavailableLabel: "Unavailable",
|
|
1008
|
+
rechargeOrderClosed: "Order closed",
|
|
1009
|
+
rechargeOrderClosedNote: "This order is closed. Do not send another payment.",
|
|
1010
|
+
rechargeCreatingOrder: "Creating order…",
|
|
1011
|
+
rechargeCampaign: "Recharge offers",
|
|
1012
|
+
rechargeExpiryElapsed: "The payment deadline has passed. Refresh the order status.",
|
|
1013
|
+
commerceCurrencyUnknown: "Currency unavailable",
|
|
1014
|
+
commerceRecharge: "Recharge",
|
|
1015
|
+
commerceOrders: "My orders",
|
|
1016
|
+
commerceBalance: "Balance recharge",
|
|
1017
|
+
commerceSubscription: "Buy subscription",
|
|
1018
|
+
commerceAmount: "Recharge amount",
|
|
1019
|
+
commerceMethod: "Payment method",
|
|
1020
|
+
commerceMethodUnavailable: "This payment method is unavailable.",
|
|
1021
|
+
commerceNoMethods: "No payment methods are available.",
|
|
1022
|
+
commerceDisabled: "Payments are currently disabled by the gateway.",
|
|
1023
|
+
commerceBalanceDisabled: "Balance recharge is disabled. Subscription plans are listed below.",
|
|
1024
|
+
commercePlans: "Subscription plans",
|
|
1025
|
+
commerceNoPlans: "No subscription plans are on sale.",
|
|
1026
|
+
commercePlan: "Plan",
|
|
1027
|
+
commerceChoosePlan: "Choose plan",
|
|
1028
|
+
commercePriceUnknown: "Price unavailable",
|
|
1029
|
+
commerceUnknown: "Unknown",
|
|
1030
|
+
commerceDays: "days",
|
|
1031
|
+
commerceMonth: "months",
|
|
1032
|
+
commerceYear: "years",
|
|
1033
|
+
commerceValidity: "Validity",
|
|
1034
|
+
commerceGroup: "Group",
|
|
1035
|
+
commerceFeatures: "Included",
|
|
1036
|
+
commerceDailyQuota: "Daily quota",
|
|
1037
|
+
commerceWeeklyQuota: "Weekly quota",
|
|
1038
|
+
commerceMonthlyQuota: "Monthly quota",
|
|
1039
|
+
commerceRate: "Rate",
|
|
1040
|
+
commerceModels: "Supported models",
|
|
1041
|
+
commerceInputAmount: "Entered amount",
|
|
1042
|
+
commerceEstimate: "Estimated amounts",
|
|
1043
|
+
commerceEstimateNote: "Amounts are estimates until creation. The gateway order determines the actual charge and credited amount.",
|
|
1044
|
+
commercePayBase: "Payment base",
|
|
1045
|
+
commerceFee: "Surcharge",
|
|
1046
|
+
commerceBonus: "Bonus credit",
|
|
1047
|
+
commerceDiscount: "Discount",
|
|
1048
|
+
commerceCredited: "Estimated credited balance",
|
|
1049
|
+
commerceTotal: "Estimated payment",
|
|
1050
|
+
commerceRange: "Per-order limits",
|
|
1051
|
+
commerceDailyRemaining: "Channel remaining today",
|
|
1052
|
+
commerceUnlimited: "No limit",
|
|
1053
|
+
commerceReview: "Review order",
|
|
1054
|
+
commerceConfirm: "Confirm and create order",
|
|
1055
|
+
commerceConfirmNote: "Confirmation creates this order with the gateway. Complete payment using the official checkout or QR code below.",
|
|
1056
|
+
commerceBack: "Edit order",
|
|
1057
|
+
commerceNewOrder: "Create another order",
|
|
1058
|
+
commerceActual: "Gateway order",
|
|
1059
|
+
commerceActualPay: "Actual payment",
|
|
1060
|
+
commerceActualCredit: "Order amount",
|
|
1061
|
+
commerceOrderCreatedNote: "The order was created. Payment is not yet confirmed. Check the amounts before paying and query the result in My orders.",
|
|
1062
|
+
commercePayLink: "Open official payment page",
|
|
1063
|
+
commerceOfficialFlow: "This method needs website verification or its official checkout. Continue on the website and check My orders before creating another order.",
|
|
1064
|
+
commerceOpenWeb: "Open recharge website",
|
|
1065
|
+
commerceQr: "Scan with your payment app",
|
|
1066
|
+
commerceQrLocal: "QR code generated on this device.",
|
|
1067
|
+
commerceQrFailed: "The QR code could not be generated. Use the official payment page.",
|
|
1068
|
+
commerceExpires: "Expires",
|
|
1069
|
+
commerceOrderId: "Order ID",
|
|
1070
|
+
commerceTradeNo: "Merchant order number",
|
|
1071
|
+
commerceStatus: "Status",
|
|
1072
|
+
commerceType: "Order type",
|
|
1073
|
+
commerceCreated: "Created",
|
|
1074
|
+
commercePaid: "Paid",
|
|
1075
|
+
commerceCompleted: "Completed",
|
|
1076
|
+
commerceActions: "Actions",
|
|
1077
|
+
commerceDetail: "Details",
|
|
1078
|
+
commerceClose: "Close details",
|
|
1079
|
+
commerceNoOrders: "No orders match these filters.",
|
|
1080
|
+
commerceAll: "All",
|
|
1081
|
+
commercePage: "Page",
|
|
1082
|
+
commercePageSize: "Page size",
|
|
1083
|
+
commercePrevious: "Previous",
|
|
1084
|
+
commerceNext: "Next",
|
|
1085
|
+
commerceCount: "Total",
|
|
1086
|
+
commerceCancel: "Cancel order",
|
|
1087
|
+
commerceCancelConfirm: "Confirm cancellation of this unpaid order?",
|
|
1088
|
+
commerceVerify: "Query payment result",
|
|
1089
|
+
commerceVerifyNote: "This checks with the payment provider and may fulfill the order.",
|
|
1090
|
+
commerceConfirmVerify: "Confirm query",
|
|
1091
|
+
commerceRefund: "Request refund",
|
|
1092
|
+
commerceRefundReason: "Refund reason",
|
|
1093
|
+
commerceRefundNote: "The gateway reviews the request. Submission does not mean the refund has completed.",
|
|
1094
|
+
commerceConfirmRefund: "Confirm refund request",
|
|
1095
|
+
commerceRefundAmount: "Refunded amount",
|
|
1096
|
+
commerceRefundRequested: "Refund requested",
|
|
1097
|
+
commerceRefundEligibilityUnknown: "Refund provider eligibility is unavailable.",
|
|
1098
|
+
commerceInvalidAmount: "Enter a valid amount. Balance recharge must be greater than zero.",
|
|
1099
|
+
commerceAmountPrecision: "The amount has too many decimal places for this payment currency.",
|
|
1100
|
+
commerceBelowLimit: "The amount is below the current limit.",
|
|
1101
|
+
commerceAboveLimit: "The amount exceeds the current limit.",
|
|
1102
|
+
commerceDailyLimit: "The amount exceeds this channel’s remaining daily limit.",
|
|
1103
|
+
commerceInvalidPlan: "This plan cannot be purchased in the plugin. Use the website.",
|
|
1104
|
+
commerceReasonRequired: "Enter a refund reason (up to 500 characters).",
|
|
1105
|
+
commerceUnavailableDetail: "Order details are unavailable.",
|
|
1106
|
+
commercePending: "Pending payment",
|
|
1107
|
+
commerceOrderPaid: "Paid",
|
|
1108
|
+
commerceRecharging: "Fulfilling",
|
|
1109
|
+
commerceOrderCompleted: "Completed",
|
|
1110
|
+
commerceExpired: "Expired",
|
|
1111
|
+
commerceCancelled: "Cancelled",
|
|
1112
|
+
commerceFailed: "Failed",
|
|
1113
|
+
commerceRefundRequestedStatus: "Refund requested",
|
|
1114
|
+
commerceRefunding: "Refunding",
|
|
1115
|
+
commerceRefundPending: "Refund pending",
|
|
1116
|
+
commercePartiallyRefunded: "Partially refunded",
|
|
1117
|
+
commerceRefunded: "Refunded",
|
|
1118
|
+
commerceRefundFailed: "Refund failed",
|
|
1119
|
+
commerceNoActionUntilRead: "Wait for current gateway data before creating an order."
|
|
1120
|
+
};
|
|
1121
|
+
//#endregion
|
|
1122
|
+
//#region src/client/AccountCenter/member-locales.ts
|
|
1123
|
+
const memberZh = {
|
|
1124
|
+
memberCodePlaceholder: "请输入兑换码",
|
|
1125
|
+
memberShowCode: "显示兑换码",
|
|
1126
|
+
memberHideCode: "隐藏兑换码",
|
|
1127
|
+
memberBasics: "基本资料",
|
|
1128
|
+
memberNotification: "余额提醒",
|
|
1129
|
+
memberResetChanges: "撤销修改",
|
|
1130
|
+
memberProfileSaveHint: "只保存已修改的资料。",
|
|
1131
|
+
memberSecurityManaged: "在官网管理",
|
|
1132
|
+
memberAccountId: "账号 ID",
|
|
1133
|
+
memberProfileSaved: "资料已保存。",
|
|
1134
|
+
memberContinueEdit: "继续编辑",
|
|
1135
|
+
memberRedeemAnother: "兑换另一张",
|
|
1136
|
+
memberRedeemTitle: "兑换码",
|
|
1137
|
+
memberRedeemNote: "兑换余额或订阅;完成后刷新账号权益。",
|
|
1138
|
+
memberRefresh: "刷新",
|
|
1139
|
+
memberCode: "兑换码",
|
|
1140
|
+
memberApply: "立即兑换",
|
|
1141
|
+
memberRedeemPrivate: "兑换码仅用于本次提交,提交后清空;历史记录不显示原始兑换码。",
|
|
1142
|
+
memberInvalidCode: "请输入有效兑换码,最多 256 字节。",
|
|
1143
|
+
memberHistory: "兑换记录",
|
|
1144
|
+
memberNoHistory: "暂无兑换记录。",
|
|
1145
|
+
memberRecord: "记录",
|
|
1146
|
+
memberType: "类型",
|
|
1147
|
+
memberValue: "面值 / 权益",
|
|
1148
|
+
memberStatus: "状态",
|
|
1149
|
+
memberUsedAt: "使用时间",
|
|
1150
|
+
memberCreatedAt: "创建时间",
|
|
1151
|
+
memberBalanceCredit: "余额",
|
|
1152
|
+
memberSubscription: "订阅",
|
|
1153
|
+
memberConcurrency: "并发额度",
|
|
1154
|
+
memberOtherCredit: "其他权益",
|
|
1155
|
+
memberUsed: "已使用",
|
|
1156
|
+
memberUnused: "未使用",
|
|
1157
|
+
memberDisabled: "已停用",
|
|
1158
|
+
memberUnknown: "未知",
|
|
1159
|
+
memberDays: "天",
|
|
1160
|
+
memberGroup: "分组",
|
|
1161
|
+
memberPage: "页",
|
|
1162
|
+
memberPrevious: "上一页",
|
|
1163
|
+
memberNext: "下一页",
|
|
1164
|
+
memberRedeemReceipt: "兑换权益",
|
|
1165
|
+
memberReceiptRefresh: "已读取服务端回执;余额和订阅以刷新后的账号为准。",
|
|
1166
|
+
memberAffiliateTitle: "邀请返利",
|
|
1167
|
+
memberAffiliateNote: "邀请、返利与转入余额。返利更新需手动提交。",
|
|
1168
|
+
memberAvailable: "可转入返利",
|
|
1169
|
+
memberFrozen: "冻结返利",
|
|
1170
|
+
memberLifetime: "累计返利",
|
|
1171
|
+
memberRebateRate: "返利比例",
|
|
1172
|
+
memberInviteCount: "已邀请人数",
|
|
1173
|
+
memberInvitation: "邀请链接",
|
|
1174
|
+
memberGenerateRefresh: "生成邀请链接 / 刷新返利",
|
|
1175
|
+
memberRefreshRebates: "刷新返利",
|
|
1176
|
+
memberUninitialized: "尚未生成邀请链接;点击上方按钮生成。",
|
|
1177
|
+
memberInviteUnavailable: "邀请链接暂不可用,请检查网关账号后刷新。",
|
|
1178
|
+
memberCopy: "复制邀请链接",
|
|
1179
|
+
memberCopied: "邀请链接已复制。",
|
|
1180
|
+
memberCopyFailed: "复制失败,请选择链接并手动复制。",
|
|
1181
|
+
memberInvitees: "邀请用户",
|
|
1182
|
+
memberInviteesLimit: "最多显示 100 位已脱敏邀请用户;返利统计以服务端汇总为准。",
|
|
1183
|
+
memberNoInvitees: "暂无邀请用户。",
|
|
1184
|
+
memberEmail: "邮箱",
|
|
1185
|
+
memberUsername: "用户名",
|
|
1186
|
+
memberRebate: "累计返利",
|
|
1187
|
+
memberTransfer: "转入账号余额",
|
|
1188
|
+
memberTransferNote: "将所有当前可用返利转入账号余额;实际转入金额以服务端回执为准。",
|
|
1189
|
+
memberConfirmTransfer: "我确认将全部可用返利转入账号余额。",
|
|
1190
|
+
memberTransferEmpty: "暂无可转入返利。",
|
|
1191
|
+
memberTransferred: "已转入",
|
|
1192
|
+
memberTransferReceipt: "返利转入回执",
|
|
1193
|
+
memberProfileTitle: "个人资料",
|
|
1194
|
+
memberProfileNote: "查看账号资料并编辑基本设置。",
|
|
1195
|
+
memberAccount: "账号概况",
|
|
1196
|
+
memberBalance: "账号余额",
|
|
1197
|
+
memberActive: "正常",
|
|
1198
|
+
memberSuspended: "已暂停",
|
|
1199
|
+
memberEdit: "编辑资料",
|
|
1200
|
+
memberAvatar: "头像 URL",
|
|
1201
|
+
memberAvatarHint: "使用 HTTP 或 HTTPS 图片地址。",
|
|
1202
|
+
memberNotify: "余额不足时通知",
|
|
1203
|
+
memberThreshold: "通知阈值",
|
|
1204
|
+
memberThresholdHint: "0 恢复系统默认阈值。",
|
|
1205
|
+
memberSave: "保存资料",
|
|
1206
|
+
memberInvalidUsername: "用户名最多 256 字节,不能包含控制字符。",
|
|
1207
|
+
memberInvalidAvatar: "请输入有效的 HTTP 或 HTTPS 头像地址,不能包含用户名或密码。",
|
|
1208
|
+
memberInvalidThreshold: "通知阈值必须为有限的非负数字;输入 0 恢复默认。",
|
|
1209
|
+
memberNoChanges: "资料尚未修改。",
|
|
1210
|
+
memberSecurity: "账号安全",
|
|
1211
|
+
memberPasswordEmail: "密码与邮箱",
|
|
1212
|
+
memberTotpPasskeys: "TOTP 与通行密钥",
|
|
1213
|
+
memberSecurityNote: "通过官网已验证的流程管理密码、邮箱验证、TOTP 与通行密钥。",
|
|
1214
|
+
memberOpenSecurity: "打开官网安全设置",
|
|
1215
|
+
memberSecurityUnavailable: "当前无法打开官网安全设置。"
|
|
1216
|
+
};
|
|
1217
|
+
const memberEn = {
|
|
1218
|
+
memberCodePlaceholder: "Enter a redemption code",
|
|
1219
|
+
memberShowCode: "Show code",
|
|
1220
|
+
memberHideCode: "Hide code",
|
|
1221
|
+
memberBasics: "Basic information",
|
|
1222
|
+
memberNotification: "Balance notifications",
|
|
1223
|
+
memberResetChanges: "Reset changes",
|
|
1224
|
+
memberProfileSaveHint: "Only changed fields are saved.",
|
|
1225
|
+
memberSecurityManaged: "Manage on the website",
|
|
1226
|
+
memberAccountId: "Account ID",
|
|
1227
|
+
memberProfileSaved: "Profile saved.",
|
|
1228
|
+
memberContinueEdit: "Continue editing",
|
|
1229
|
+
memberRedeemAnother: "Redeem another code",
|
|
1230
|
+
memberRedeemTitle: "Redeem",
|
|
1231
|
+
memberRedeemNote: "Apply balance or subscription credits, then refresh account benefits.",
|
|
1232
|
+
memberRefresh: "Refresh",
|
|
1233
|
+
memberCode: "Redemption code",
|
|
1234
|
+
memberApply: "Redeem now",
|
|
1235
|
+
memberRedeemPrivate: "The code is used for this submission and cleared afterward. History excludes raw codes.",
|
|
1236
|
+
memberInvalidCode: "Enter a valid redemption code, up to 256 bytes.",
|
|
1237
|
+
memberHistory: "Redemption history",
|
|
1238
|
+
memberNoHistory: "No redemption records yet.",
|
|
1239
|
+
memberRecord: "Record",
|
|
1240
|
+
memberType: "Type",
|
|
1241
|
+
memberValue: "Value / benefit",
|
|
1242
|
+
memberStatus: "Status",
|
|
1243
|
+
memberUsedAt: "Used at",
|
|
1244
|
+
memberCreatedAt: "Created at",
|
|
1245
|
+
memberBalanceCredit: "Balance",
|
|
1246
|
+
memberSubscription: "Subscription",
|
|
1247
|
+
memberConcurrency: "Concurrency",
|
|
1248
|
+
memberOtherCredit: "Other credit",
|
|
1249
|
+
memberUsed: "Used",
|
|
1250
|
+
memberUnused: "Unused",
|
|
1251
|
+
memberDisabled: "Disabled",
|
|
1252
|
+
memberUnknown: "Unknown",
|
|
1253
|
+
memberDays: "days",
|
|
1254
|
+
memberGroup: "Group",
|
|
1255
|
+
memberPage: "Page",
|
|
1256
|
+
memberPrevious: "Previous",
|
|
1257
|
+
memberNext: "Next",
|
|
1258
|
+
memberRedeemReceipt: "Redeemed benefit",
|
|
1259
|
+
memberReceiptRefresh: "Server receipt received. The refreshed account determines balance and subscription benefits.",
|
|
1260
|
+
memberAffiliateTitle: "Affiliate",
|
|
1261
|
+
memberAffiliateNote: "Invitations, rebates and balance transfers. Submit rebate updates explicitly.",
|
|
1262
|
+
memberAvailable: "Available rebates",
|
|
1263
|
+
memberFrozen: "Frozen rebates",
|
|
1264
|
+
memberLifetime: "Lifetime rebates",
|
|
1265
|
+
memberRebateRate: "Rebate rate",
|
|
1266
|
+
memberInviteCount: "Invited users",
|
|
1267
|
+
memberInvitation: "Invitation link",
|
|
1268
|
+
memberGenerateRefresh: "Generate invitation link / refresh rebates",
|
|
1269
|
+
memberRefreshRebates: "Refresh rebates",
|
|
1270
|
+
memberUninitialized: "No invitation link yet. Generate it with the button above.",
|
|
1271
|
+
memberInviteUnavailable: "The invitation link is unavailable. Check the gateway account and refresh.",
|
|
1272
|
+
memberCopy: "Copy invitation link",
|
|
1273
|
+
memberCopied: "Invitation link copied.",
|
|
1274
|
+
memberCopyFailed: "Copy failed. Select the link and copy it manually.",
|
|
1275
|
+
memberInvitees: "Invited users",
|
|
1276
|
+
memberInviteesLimit: "Up to 100 masked invitees are shown. Rebate totals follow the server summary.",
|
|
1277
|
+
memberNoInvitees: "No invited users yet.",
|
|
1278
|
+
memberEmail: "Email",
|
|
1279
|
+
memberUsername: "Username",
|
|
1280
|
+
memberRebate: "Total rebate",
|
|
1281
|
+
memberTransfer: "Transfer to account balance",
|
|
1282
|
+
memberTransferNote: "Transfer all currently available rebates. The server receipt determines the actual amount.",
|
|
1283
|
+
memberConfirmTransfer: "I confirm transferring all available rebates to my account balance.",
|
|
1284
|
+
memberTransferEmpty: "No rebates are available to transfer.",
|
|
1285
|
+
memberTransferred: "Transferred",
|
|
1286
|
+
memberTransferReceipt: "Rebate transfer receipt",
|
|
1287
|
+
memberProfileTitle: "Profile",
|
|
1288
|
+
memberProfileNote: "View account information and edit basic settings.",
|
|
1289
|
+
memberAccount: "Account overview",
|
|
1290
|
+
memberBalance: "Account balance",
|
|
1291
|
+
memberActive: "Active",
|
|
1292
|
+
memberSuspended: "Suspended",
|
|
1293
|
+
memberEdit: "Edit profile",
|
|
1294
|
+
memberAvatar: "Avatar URL",
|
|
1295
|
+
memberAvatarHint: "Use an HTTP or HTTPS image address.",
|
|
1296
|
+
memberNotify: "Notify when balance is low",
|
|
1297
|
+
memberThreshold: "Notification threshold",
|
|
1298
|
+
memberThresholdHint: "0 restores the system default threshold.",
|
|
1299
|
+
memberSave: "Save profile",
|
|
1300
|
+
memberInvalidUsername: "The username must be at most 256 bytes and contain no control characters.",
|
|
1301
|
+
memberInvalidAvatar: "Enter a valid HTTP or HTTPS avatar address without a username or password.",
|
|
1302
|
+
memberInvalidThreshold: "The threshold must be a finite nonnegative number. Use 0 to restore the default.",
|
|
1303
|
+
memberNoChanges: "No profile changes yet.",
|
|
1304
|
+
memberSecurity: "Account security",
|
|
1305
|
+
memberPasswordEmail: "Password and email",
|
|
1306
|
+
memberTotpPasskeys: "TOTP and passkeys",
|
|
1307
|
+
memberSecurityNote: "Manage passwords, email verification, TOTP and passkeys through the official verified flow.",
|
|
1308
|
+
memberOpenSecurity: "Open official security settings",
|
|
1309
|
+
memberSecurityUnavailable: "Official security settings cannot be opened here."
|
|
1310
|
+
};
|
|
1311
|
+
//#endregion
|
|
1312
|
+
//#region src/client/AccountCenter/business-locales.ts
|
|
1313
|
+
const businessZh = {
|
|
1314
|
+
businessSending: "正在提交操作",
|
|
1315
|
+
businessSendingNote: "正在保存操作回执,请勿重复提交。",
|
|
1316
|
+
businessUnknown: "结果待确认",
|
|
1317
|
+
businessUnknownNote: "操作可能已经完成。请使用原操作编号继续核对,或先到官网查看订单与余额;不要直接重复提交。",
|
|
1318
|
+
businessDone: "操作已完成",
|
|
1319
|
+
businessRejected: "操作未完成",
|
|
1320
|
+
businessRejectedNote: "请根据提示检查信息后再操作。",
|
|
1321
|
+
businessReconcile: "继续核对",
|
|
1322
|
+
businessChecking: "正在核对…",
|
|
1323
|
+
businessReset: "继续其他操作",
|
|
1324
|
+
businessWebCheck: "前往官网核对",
|
|
1325
|
+
businessOperation: "操作编号",
|
|
1326
|
+
businessCopy: "复制编号",
|
|
1327
|
+
businessCopied: "已复制",
|
|
1328
|
+
businessCopyFailed: "复制失败,请手动复制编号。",
|
|
1329
|
+
businessAbandon: "清除本地记录",
|
|
1330
|
+
businessAbandonTitle: "确认清除待核对记录?",
|
|
1331
|
+
businessAbandonWarning: "原操作可能已经完成。请先核对订单或余额;清除后再次操作可能造成重复提交。此操作不会取消或撤销服务器上的结果。",
|
|
1332
|
+
businessConfirmAbandon: "已核对风险,清除记录",
|
|
1333
|
+
businessKeep: "保留记录",
|
|
1334
|
+
businessStorageUnavailable: "暂时无法保存操作恢复信息。为避免重复操作,本次没有提交。",
|
|
1335
|
+
businessRecoveryUnavailable: "无法读取操作恢复记录。请先核对官网记录,再决定是否清除本地记录。",
|
|
1336
|
+
businessAccountUnavailable: "暂时无法确认账号,请稍后重试。",
|
|
1337
|
+
businessInvalidInput: "填写的信息不符合要求,请检查后再提交。",
|
|
1338
|
+
businessUnsupported: "当前网关暂不支持此操作,请使用官网。"
|
|
1339
|
+
};
|
|
1340
|
+
const businessEn = {
|
|
1341
|
+
businessSending: "Submitting operation",
|
|
1342
|
+
businessSendingNote: "Saving the operation receipt. Please do not submit again.",
|
|
1343
|
+
businessUnknown: "Result pending confirmation",
|
|
1344
|
+
businessUnknownNote: "The operation may have completed. Reconcile the original operation, or check orders and balance on the website before submitting again.",
|
|
1345
|
+
businessDone: "Operation completed",
|
|
1346
|
+
businessRejected: "Operation not completed",
|
|
1347
|
+
businessRejectedNote: "Check the information and the reason before proceeding.",
|
|
1348
|
+
businessReconcile: "Reconcile",
|
|
1349
|
+
businessChecking: "Checking…",
|
|
1350
|
+
businessReset: "Continue with another operation",
|
|
1351
|
+
businessWebCheck: "Check on website",
|
|
1352
|
+
businessOperation: "Operation ID",
|
|
1353
|
+
businessCopy: "Copy ID",
|
|
1354
|
+
businessCopied: "Copied",
|
|
1355
|
+
businessCopyFailed: "Could not copy. Please copy the ID manually.",
|
|
1356
|
+
businessAbandon: "Clear local record",
|
|
1357
|
+
businessAbandonTitle: "Clear this unresolved record?",
|
|
1358
|
+
businessAbandonWarning: "The original operation may have completed. Check orders or balance first; proceeding may create a duplicate operation. Clearing this record does not cancel or reverse the server result.",
|
|
1359
|
+
businessConfirmAbandon: "I understand, clear record",
|
|
1360
|
+
businessKeep: "Keep record",
|
|
1361
|
+
businessStorageUnavailable: "Recovery metadata could not be saved. This operation was not submitted.",
|
|
1362
|
+
businessRecoveryUnavailable: "The recovery record could not be read. Check website records before clearing the local record.",
|
|
1363
|
+
businessAccountUnavailable: "The account cannot be confirmed right now. Try again later.",
|
|
1364
|
+
businessInvalidInput: "Check the entered information before submitting.",
|
|
1365
|
+
businessUnsupported: "This gateway does not support this operation yet. Use the website."
|
|
1366
|
+
};
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region src/client/AccountCenter/center-locales.ts
|
|
1369
|
+
const centerZh = {
|
|
1370
|
+
...commerceZh,
|
|
1371
|
+
...memberZh,
|
|
1372
|
+
...businessZh,
|
|
1373
|
+
centerRechargeIntro: "选择充值金额或订阅,确认费用后完成支付。",
|
|
1374
|
+
centerOrdersIntro: "查看自己的订单、支付进度和退款申请。",
|
|
1375
|
+
centerRedeemIntro: "兑换余额或订阅权益,查看兑换记录。",
|
|
1376
|
+
centerAffiliateIntro: "管理邀请链接,查看返利并转入账户余额。",
|
|
1377
|
+
centerProfileIntro: "查看账号资料,修改基础信息与余额提醒。",
|
|
1378
|
+
...statusZh,
|
|
1379
|
+
...priceZh,
|
|
1380
|
+
centerModelPrices: "模型价格",
|
|
1381
|
+
centerModelPricesIntro: "查看当前发布模型的能力、适用条件和售价,核对官方参考价格。",
|
|
1382
|
+
centerMonitorIntro: "查看你能访问的渠道运行情况、历史覆盖和模型状态。",
|
|
1383
|
+
...subscriptionUiZh,
|
|
1384
|
+
...dashboardZh,
|
|
1385
|
+
...usageUiZh,
|
|
1386
|
+
...polishZh,
|
|
1387
|
+
centerErrorCode: "错误码",
|
|
1388
|
+
centerErrorStage: "处理阶段",
|
|
1389
|
+
centerTaskId: "任务 ID",
|
|
1390
|
+
centerOperationId: "操作 ID",
|
|
1391
|
+
centerApply: "应用筛选",
|
|
1392
|
+
centerServiceTier: "服务层级",
|
|
1393
|
+
centerMedia: "媒体规格",
|
|
1394
|
+
centerImageInputSize: "图片输入尺寸",
|
|
1395
|
+
centerImageOutputSize: "图片输出尺寸",
|
|
1396
|
+
centerImageSource: "图片规格来源",
|
|
1397
|
+
centerImageBreakdown: "图片尺寸分布",
|
|
1398
|
+
centerUpstreamStatus: "上游状态码",
|
|
1399
|
+
centerFrozen: "冻结余额",
|
|
1400
|
+
centerActual: "实际扣款",
|
|
1401
|
+
centerStandard: "标准计费",
|
|
1402
|
+
centerTodayCost: "今日费用",
|
|
1403
|
+
centerTotalCost: "累计费用",
|
|
1404
|
+
centerTotalTokens: "累计 Token",
|
|
1405
|
+
centerTodayTokens: "今日 Token",
|
|
1406
|
+
centerInputTokens: "输入 Token",
|
|
1407
|
+
centerOutputTokens: "输出 Token",
|
|
1408
|
+
centerCacheRead: "缓存读取 Token",
|
|
1409
|
+
centerCacheWrite: "缓存创建 Token",
|
|
1410
|
+
centerCache5m: "5 分钟缓存创建 Token",
|
|
1411
|
+
centerCache1h: "1 小时缓存创建 Token",
|
|
1412
|
+
centerPerformance: "近 5 分钟速率",
|
|
1413
|
+
centerAverage: "平均响应",
|
|
1414
|
+
centerPlatforms: "平台用量",
|
|
1415
|
+
centerRecent: "最近记录",
|
|
1416
|
+
centerQuick: "快捷入口",
|
|
1417
|
+
centerRange: "日期范围",
|
|
1418
|
+
centerTodayRange: "今天",
|
|
1419
|
+
centerYesterday: "昨天",
|
|
1420
|
+
centerLast7: "近 7 天",
|
|
1421
|
+
centerLast30: "近 30 天",
|
|
1422
|
+
centerCustom: "自定义",
|
|
1423
|
+
centerGranularity: "粒度",
|
|
1424
|
+
centerDay: "天",
|
|
1425
|
+
centerHour: "小时",
|
|
1426
|
+
centerTimezone: "时区",
|
|
1427
|
+
centerMetric: "指标",
|
|
1428
|
+
centerRequestsMetric: "请求数",
|
|
1429
|
+
centerTokenMetric: "Token",
|
|
1430
|
+
centerCacheHit: "缓存命中率",
|
|
1431
|
+
centerGroup: "分组",
|
|
1432
|
+
centerAll: "全部",
|
|
1433
|
+
centerRequestType: "请求类型",
|
|
1434
|
+
centerBillingType: "计费来源",
|
|
1435
|
+
centerBillingMode: "计费模式",
|
|
1436
|
+
centerBalanceBilling: "余额",
|
|
1437
|
+
centerSubscriptionBilling: "订阅",
|
|
1438
|
+
centerCompaction: "原生压缩",
|
|
1439
|
+
centerCompactionOnly: "仅压缩请求",
|
|
1440
|
+
centerResetFilters: "重置筛选",
|
|
1441
|
+
centerRecords: "使用记录",
|
|
1442
|
+
centerErrors: "错误请求",
|
|
1443
|
+
centerCategory: "错误分类",
|
|
1444
|
+
centerStatus: "状态码",
|
|
1445
|
+
centerSort: "排序",
|
|
1446
|
+
centerAsc: "升序",
|
|
1447
|
+
centerDesc: "降序",
|
|
1448
|
+
centerPageSize: "每页条数",
|
|
1449
|
+
centerColumns: "显示列",
|
|
1450
|
+
centerExportPage: "导出当前页 CSV",
|
|
1451
|
+
centerExportHint: "仅导出当前日期和筛选条件下,当前页可见记录;不包含 API 密钥、供应商或原始请求。",
|
|
1452
|
+
centerExportEmpty: "当前页没有可导出的记录",
|
|
1453
|
+
centerExportFailed: "导出失败,请稍后重试",
|
|
1454
|
+
centerExportDone: "当前页已导出",
|
|
1455
|
+
centerDetails: "详情",
|
|
1456
|
+
centerLoadingDetails: "正在读取详情…",
|
|
1457
|
+
centerTokenPrices: "本条折算单价",
|
|
1458
|
+
centerUnitMillion: "每百万 Token",
|
|
1459
|
+
centerUnitCalculated: "由本条标准金额与对应 Token 折算,不代表历史定价;5m / 1h 缓存价格不推算。",
|
|
1460
|
+
centerEndpoint: "入站端点",
|
|
1461
|
+
centerUpstreamEndpoint: "上游协议端点",
|
|
1462
|
+
centerIp: "来源 IP",
|
|
1463
|
+
centerFirstToken: "首字延迟",
|
|
1464
|
+
centerDuration: "总耗时",
|
|
1465
|
+
centerTps: "输出 Token / 秒",
|
|
1466
|
+
centerRequestId: "请求 ID",
|
|
1467
|
+
centerCacheOverride: "缓存时长被覆盖",
|
|
1468
|
+
centerUserAgent: "客户端",
|
|
1469
|
+
centerReasoning: "推理强度",
|
|
1470
|
+
centerRate: "倍率",
|
|
1471
|
+
centerInputCost: "输入金额",
|
|
1472
|
+
centerOutputCost: "输出金额",
|
|
1473
|
+
centerCacheReadCost: "缓存读取金额",
|
|
1474
|
+
centerCacheWriteCost: "缓存创建金额",
|
|
1475
|
+
centerImageCount: "图片数量",
|
|
1476
|
+
centerImageSize: "图片尺寸",
|
|
1477
|
+
centerImageInput: "图片输入 Token",
|
|
1478
|
+
centerImageOutput: "图片输出 Token",
|
|
1479
|
+
centerImageInputCost: "图片输入金额",
|
|
1480
|
+
centerImageOutputCost: "图片输出金额",
|
|
1481
|
+
centerLongContext: "长上下文计费",
|
|
1482
|
+
centerStale: "刷新失败:显示此账号和筛选条件上次成功读取的旧数据。",
|
|
1483
|
+
centerUnsupportedSection: "此网关尚未提供这一部分数据。",
|
|
1484
|
+
centerSafeError: "仅展示安全分类摘要;不提供原始请求或上游响应。",
|
|
1485
|
+
centerErrorAuth: "身份验证失败",
|
|
1486
|
+
centerErrorRate: "请求速率受限",
|
|
1487
|
+
centerErrorQuota: "额度不足",
|
|
1488
|
+
centerErrorInvalid: "请求参数无效",
|
|
1489
|
+
centerErrorUnavailable: "服务暂不可用",
|
|
1490
|
+
centerErrorUpstream: "上游服务请求失败",
|
|
1491
|
+
centerErrorInternal: "服务处理失败",
|
|
1492
|
+
centerErrorCyber: "请求执行失败",
|
|
1493
|
+
centerPlatform: "平台",
|
|
1494
|
+
centerDescription: "说明",
|
|
1495
|
+
centerPeakRate: "峰时倍率",
|
|
1496
|
+
centerStarts: "开始时间",
|
|
1497
|
+
centerNoExpiry: "无到期时间",
|
|
1498
|
+
centerRenew: "续费",
|
|
1499
|
+
centerNoSnapshot: "当前网关尚未提供可用的订阅窗口快照。",
|
|
1500
|
+
centerUnknownModels: "模型覆盖尚未提供",
|
|
1501
|
+
centerSuspended: "已暂停",
|
|
1502
|
+
centerLegacyConstraints: "此订阅仍受原日 / 月限制,实际可用性以网关为准。",
|
|
1503
|
+
centerModelCoverage: "模型覆盖",
|
|
1504
|
+
centerRemaining: "剩余",
|
|
1505
|
+
centerNoData: "暂无数据",
|
|
1506
|
+
centerQuota: "平台额度",
|
|
1507
|
+
centerDaily: "日",
|
|
1508
|
+
centerWeekly: "周",
|
|
1509
|
+
centerMonthly: "月",
|
|
1510
|
+
centerQuotaDisabled: "已停用",
|
|
1511
|
+
centerBooleanYes: "是",
|
|
1512
|
+
centerBooleanNo: "否"
|
|
1513
|
+
};
|
|
1514
|
+
const centerEn = {
|
|
1515
|
+
...commerceEn,
|
|
1516
|
+
...memberEn,
|
|
1517
|
+
...businessEn,
|
|
1518
|
+
centerRechargeIntro: "Choose balance credit or a subscription, review the cost and complete payment.",
|
|
1519
|
+
centerOrdersIntro: "View your orders, payment progress and refund requests.",
|
|
1520
|
+
centerRedeemIntro: "Redeem balance or subscription benefits and view history.",
|
|
1521
|
+
centerAffiliateIntro: "Manage invitations, review rebates and transfer them to your balance.",
|
|
1522
|
+
centerProfileIntro: "View your account and edit basic settings and balance alerts.",
|
|
1523
|
+
...statusEn,
|
|
1524
|
+
...priceEn,
|
|
1525
|
+
centerModelPrices: "Model prices",
|
|
1526
|
+
centerModelPricesIntro: "Explore published capabilities, pricing conditions, retail prices and official references.",
|
|
1527
|
+
centerMonitorIntro: "View channel health, history coverage and model status within your access scope.",
|
|
1528
|
+
...subscriptionUiEn,
|
|
1529
|
+
...dashboardEn,
|
|
1530
|
+
...usageUiEn,
|
|
1531
|
+
...polishEn,
|
|
1532
|
+
centerErrorCode: "Error code",
|
|
1533
|
+
centerErrorStage: "Stage",
|
|
1534
|
+
centerTaskId: "Task ID",
|
|
1535
|
+
centerOperationId: "Operation ID",
|
|
1536
|
+
centerApply: "Apply filters",
|
|
1537
|
+
centerServiceTier: "Service tier",
|
|
1538
|
+
centerMedia: "Media",
|
|
1539
|
+
centerImageInputSize: "Image input size",
|
|
1540
|
+
centerImageOutputSize: "Image output size",
|
|
1541
|
+
centerImageSource: "Image size source",
|
|
1542
|
+
centerImageBreakdown: "Image size breakdown",
|
|
1543
|
+
centerUpstreamStatus: "Upstream status code",
|
|
1544
|
+
centerFrozen: "Frozen balance",
|
|
1545
|
+
centerActual: "Actual charge",
|
|
1546
|
+
centerStandard: "Standard cost",
|
|
1547
|
+
centerTodayCost: "Cost today",
|
|
1548
|
+
centerTotalCost: "Total cost",
|
|
1549
|
+
centerTotalTokens: "Total tokens",
|
|
1550
|
+
centerTodayTokens: "Tokens today",
|
|
1551
|
+
centerInputTokens: "Input tokens",
|
|
1552
|
+
centerOutputTokens: "Output tokens",
|
|
1553
|
+
centerCacheRead: "Cache read tokens",
|
|
1554
|
+
centerCacheWrite: "Cache creation tokens",
|
|
1555
|
+
centerCache5m: "Cache creation 5m tokens",
|
|
1556
|
+
centerCache1h: "Cache creation 1h tokens",
|
|
1557
|
+
centerPerformance: "Last 5-minute rate",
|
|
1558
|
+
centerAverage: "Average response",
|
|
1559
|
+
centerPlatforms: "Platform usage",
|
|
1560
|
+
centerRecent: "Recent usage",
|
|
1561
|
+
centerQuick: "Quick links",
|
|
1562
|
+
centerRange: "Date range",
|
|
1563
|
+
centerTodayRange: "Today",
|
|
1564
|
+
centerYesterday: "Yesterday",
|
|
1565
|
+
centerLast7: "Last 7 days",
|
|
1566
|
+
centerLast30: "Last 30 days",
|
|
1567
|
+
centerCustom: "Custom",
|
|
1568
|
+
centerGranularity: "Granularity",
|
|
1569
|
+
centerDay: "Day",
|
|
1570
|
+
centerHour: "Hour",
|
|
1571
|
+
centerTimezone: "Time zone",
|
|
1572
|
+
centerMetric: "Metric",
|
|
1573
|
+
centerRequestsMetric: "Requests",
|
|
1574
|
+
centerTokenMetric: "Tokens",
|
|
1575
|
+
centerCacheHit: "Cache hit rate",
|
|
1576
|
+
centerGroup: "Group",
|
|
1577
|
+
centerAll: "All",
|
|
1578
|
+
centerRequestType: "Request type",
|
|
1579
|
+
centerBillingType: "Billing source",
|
|
1580
|
+
centerBillingMode: "Billing mode",
|
|
1581
|
+
centerBalanceBilling: "Balance",
|
|
1582
|
+
centerSubscriptionBilling: "Subscription",
|
|
1583
|
+
centerCompaction: "Native compaction",
|
|
1584
|
+
centerCompactionOnly: "Compaction requests only",
|
|
1585
|
+
centerResetFilters: "Reset filters",
|
|
1586
|
+
centerRecords: "Usage records",
|
|
1587
|
+
centerErrors: "Error requests",
|
|
1588
|
+
centerCategory: "Error category",
|
|
1589
|
+
centerStatus: "Status code",
|
|
1590
|
+
centerSort: "Sort",
|
|
1591
|
+
centerAsc: "Ascending",
|
|
1592
|
+
centerDesc: "Descending",
|
|
1593
|
+
centerPageSize: "Rows per page",
|
|
1594
|
+
centerColumns: "Visible columns",
|
|
1595
|
+
centerExportPage: "Export current page CSV",
|
|
1596
|
+
centerExportHint: "Exports only this page for the current dates and filters. API keys, supplier data and raw requests are excluded.",
|
|
1597
|
+
centerExportEmpty: "No records on this page to export",
|
|
1598
|
+
centerExportFailed: "Export failed. Try again later.",
|
|
1599
|
+
centerExportDone: "Current page exported",
|
|
1600
|
+
centerDetails: "Details",
|
|
1601
|
+
centerLoadingDetails: "Loading details…",
|
|
1602
|
+
centerTokenPrices: "Observed unit prices",
|
|
1603
|
+
centerUnitMillion: "Per million tokens",
|
|
1604
|
+
centerUnitCalculated: "Calculated from this record’s standard amount and tokens, not a historical tariff. No inferred 5m / 1h cache prices.",
|
|
1605
|
+
centerEndpoint: "Inbound endpoint",
|
|
1606
|
+
centerUpstreamEndpoint: "Upstream protocol endpoint",
|
|
1607
|
+
centerIp: "Source IP",
|
|
1608
|
+
centerFirstToken: "First token",
|
|
1609
|
+
centerDuration: "Duration",
|
|
1610
|
+
centerTps: "Output tokens / second",
|
|
1611
|
+
centerRequestId: "Request ID",
|
|
1612
|
+
centerCacheOverride: "Cache TTL overridden",
|
|
1613
|
+
centerUserAgent: "User agent",
|
|
1614
|
+
centerReasoning: "Reasoning effort",
|
|
1615
|
+
centerRate: "Rate multiplier",
|
|
1616
|
+
centerInputCost: "Input amount",
|
|
1617
|
+
centerOutputCost: "Output amount",
|
|
1618
|
+
centerCacheReadCost: "Cache read amount",
|
|
1619
|
+
centerCacheWriteCost: "Cache creation amount",
|
|
1620
|
+
centerImageCount: "Images",
|
|
1621
|
+
centerImageSize: "Image size",
|
|
1622
|
+
centerImageInput: "Image input tokens",
|
|
1623
|
+
centerImageOutput: "Image output tokens",
|
|
1624
|
+
centerImageInputCost: "Image input amount",
|
|
1625
|
+
centerImageOutputCost: "Image output amount",
|
|
1626
|
+
centerLongContext: "Long-context billing",
|
|
1627
|
+
centerStale: "Refresh failed. Showing the last successful snapshot for this account and these filters.",
|
|
1628
|
+
centerUnsupportedSection: "This gateway does not provide this section yet.",
|
|
1629
|
+
centerSafeError: "Only a safe category summary is shown. Raw requests and upstream responses are excluded.",
|
|
1630
|
+
centerErrorAuth: "Authentication failed",
|
|
1631
|
+
centerErrorRate: "Request rate limited",
|
|
1632
|
+
centerErrorQuota: "Quota unavailable",
|
|
1633
|
+
centerErrorInvalid: "Invalid request",
|
|
1634
|
+
centerErrorUnavailable: "Service temporarily unavailable",
|
|
1635
|
+
centerErrorUpstream: "Upstream request failed",
|
|
1636
|
+
centerErrorInternal: "Request processing failed",
|
|
1637
|
+
centerErrorCyber: "Request execution failed",
|
|
1638
|
+
centerPlatform: "Platform",
|
|
1639
|
+
centerDescription: "Description",
|
|
1640
|
+
centerPeakRate: "Peak rate",
|
|
1641
|
+
centerStarts: "Starts",
|
|
1642
|
+
centerNoExpiry: "No expiration",
|
|
1643
|
+
centerRenew: "Renew",
|
|
1644
|
+
centerNoSnapshot: "This gateway has not provided an available subscription window snapshot.",
|
|
1645
|
+
centerUnknownModels: "Model coverage unavailable",
|
|
1646
|
+
centerSuspended: "Suspended",
|
|
1647
|
+
centerLegacyConstraints: "Legacy daily / monthly constraints still apply. The gateway determines availability.",
|
|
1648
|
+
centerModelCoverage: "Model coverage",
|
|
1649
|
+
centerRemaining: "Remaining",
|
|
1650
|
+
centerNoData: "No data",
|
|
1651
|
+
centerQuota: "Platform quota",
|
|
1652
|
+
centerDaily: "Daily",
|
|
1653
|
+
centerWeekly: "Weekly",
|
|
1654
|
+
centerMonthly: "Monthly",
|
|
1655
|
+
centerQuotaDisabled: "Disabled",
|
|
1656
|
+
centerBooleanYes: "Yes",
|
|
1657
|
+
centerBooleanNo: "No"
|
|
1658
|
+
};
|
|
1659
|
+
//#endregion
|
|
1660
|
+
//#region src/client/account-locales.ts
|
|
1661
|
+
const accountZh = {
|
|
1662
|
+
...centerZh,
|
|
1663
|
+
centerTitle: "账户中心",
|
|
1664
|
+
centerDashboard: "仪表盘",
|
|
1665
|
+
centerUsage: "使用记录",
|
|
1666
|
+
centerSubscriptions: "订阅",
|
|
1667
|
+
centerChannels: "可用渠道",
|
|
1668
|
+
centerMonitor: "渠道状态",
|
|
1669
|
+
centerRecharge: "充值",
|
|
1670
|
+
centerOrders: "我的订单",
|
|
1671
|
+
centerRedeem: "兑换",
|
|
1672
|
+
centerAffiliate: "邀请返利",
|
|
1673
|
+
centerProfile: "个人资料",
|
|
1674
|
+
centerUnavailable: "账户信息暂时无法获取,已保留上次成功读取的数据。请稍后刷新。",
|
|
1675
|
+
centerReading: "正在读取账户信息…",
|
|
1676
|
+
centerSignIn: "登录后查看账户、用量与订阅。",
|
|
1677
|
+
centerUnknown: "暂时无法获取",
|
|
1678
|
+
centerBalance: "可用余额",
|
|
1679
|
+
centerRequests: "累计请求",
|
|
1680
|
+
centerToday: "今日请求",
|
|
1681
|
+
centerTrend: "使用趋势",
|
|
1682
|
+
centerModels: "模型使用",
|
|
1683
|
+
centerNoModels: "暂无模型使用数据",
|
|
1684
|
+
centerRequestCount: "{n} 次请求",
|
|
1685
|
+
centerModel: "模型",
|
|
1686
|
+
centerStart: "开始",
|
|
1687
|
+
centerEnd: "结束",
|
|
1688
|
+
centerTime: "时间",
|
|
1689
|
+
centerTokens: "输入 / 输出",
|
|
1690
|
+
centerCost: "费用(CNY)",
|
|
1691
|
+
centerNoUsage: "暂无使用记录",
|
|
1692
|
+
centerPrevious: "上一页",
|
|
1693
|
+
centerNext: "下一页",
|
|
1694
|
+
centerPage: "第 {page} 页 · 共 {total} 条",
|
|
1695
|
+
centerRestricted: "当前账户无权访问此功能,或网关已关闭该功能。",
|
|
1696
|
+
centerWebHint: "此网关尚未开放该账户页面,请在网页版继续。",
|
|
1697
|
+
centerWeb: "打开网页版",
|
|
1698
|
+
centerEmptyTrend: "暂无趋势数据",
|
|
1699
|
+
centerTrendLabel: "请求量变化趋势",
|
|
1700
|
+
centerView: "查看账户",
|
|
1701
|
+
subTitle: "订阅",
|
|
1702
|
+
subDailyBlocked: "日额度已用完",
|
|
1703
|
+
subMonthlyBlocked: "月额度已用完",
|
|
1704
|
+
subFiveBlocked: "5 小时额度已用完",
|
|
1705
|
+
subSevenBlocked: "7 天额度已用完",
|
|
1706
|
+
subReasonUnknown: "此订阅受账户限制,暂时不可用",
|
|
1707
|
+
subRestricted: "暂时受限",
|
|
1708
|
+
subRestrictedNote: "此订阅暂时不可用,请查看账户中的限制。",
|
|
1709
|
+
subRestrictedWait: "此订阅暂时受限,{time}",
|
|
1710
|
+
subActive: "使用中",
|
|
1711
|
+
subExpired: "已过期",
|
|
1712
|
+
subRevoked: "已撤销",
|
|
1713
|
+
subPending: "待生效",
|
|
1714
|
+
subExhausted: "额度用完",
|
|
1715
|
+
subUsed: "已用完",
|
|
1716
|
+
subUnlimited: "不限额",
|
|
1717
|
+
subFirstUse: "首次使用后开始计时",
|
|
1718
|
+
subFive: "5 小时",
|
|
1719
|
+
subSeven: "7 天",
|
|
1720
|
+
subExpires: "到期:{time}",
|
|
1721
|
+
subFailed: "订阅信息暂时无法获取,额度以实际使用为准",
|
|
1722
|
+
subEmpty: "当前没有订阅",
|
|
1723
|
+
subMore: "还有 {n} 个订阅 · 查看全部",
|
|
1724
|
+
subReceipt: "实际计费来源和额度以网关回执为准。",
|
|
1725
|
+
subFallback: "优先使用订阅,额度用完自动使用余额",
|
|
1726
|
+
subZero: "订阅额度用完后,充值余额可继续使用",
|
|
1727
|
+
subBalance: "在恢复前使用余额付费",
|
|
1728
|
+
subWait: "额度已用完,{time}",
|
|
1729
|
+
subExpiredNote: "已过期,现在使用余额付费",
|
|
1730
|
+
subReset: "{time} 恢复",
|
|
1731
|
+
subTomorrow: "明天 {time}",
|
|
1732
|
+
subManage: "管理订阅",
|
|
1733
|
+
subModels: "包含模型:{models}"
|
|
1734
|
+
};
|
|
1735
|
+
const accountEn = {
|
|
1736
|
+
...centerEn,
|
|
1737
|
+
centerTitle: "Account center",
|
|
1738
|
+
centerDashboard: "Dashboard",
|
|
1739
|
+
centerUsage: "Usage",
|
|
1740
|
+
centerSubscriptions: "Subscriptions",
|
|
1741
|
+
centerChannels: "Available channels",
|
|
1742
|
+
centerMonitor: "Channel status",
|
|
1743
|
+
centerRecharge: "Top up",
|
|
1744
|
+
centerOrders: "My orders",
|
|
1745
|
+
centerRedeem: "Redeem",
|
|
1746
|
+
centerAffiliate: "Referrals",
|
|
1747
|
+
centerProfile: "Profile",
|
|
1748
|
+
centerUnavailable: "Account information is temporarily unavailable. The last successful snapshot is retained. Refresh later.",
|
|
1749
|
+
centerReading: "Reading account information…",
|
|
1750
|
+
centerSignIn: "Sign in to view your account, usage and subscriptions.",
|
|
1751
|
+
centerUnknown: "Unavailable",
|
|
1752
|
+
centerBalance: "Available balance",
|
|
1753
|
+
centerRequests: "Total requests",
|
|
1754
|
+
centerToday: "Requests today",
|
|
1755
|
+
centerTrend: "Usage trend",
|
|
1756
|
+
centerModels: "Model usage",
|
|
1757
|
+
centerNoModels: "No model usage yet",
|
|
1758
|
+
centerRequestCount: "{n} requests",
|
|
1759
|
+
centerModel: "Model",
|
|
1760
|
+
centerStart: "Start",
|
|
1761
|
+
centerEnd: "End",
|
|
1762
|
+
centerTime: "Time",
|
|
1763
|
+
centerTokens: "Input / output",
|
|
1764
|
+
centerCost: "Cost (CNY)",
|
|
1765
|
+
centerNoUsage: "No usage yet",
|
|
1766
|
+
centerPrevious: "Previous",
|
|
1767
|
+
centerNext: "Next",
|
|
1768
|
+
centerPage: "Page {page} · {total} records",
|
|
1769
|
+
centerRestricted: "This account cannot access this feature, or the gateway has disabled it.",
|
|
1770
|
+
centerWebHint: "This gateway has not enabled this account page. Continue on the website.",
|
|
1771
|
+
centerWeb: "Open website",
|
|
1772
|
+
centerEmptyTrend: "No trend data yet",
|
|
1773
|
+
centerTrendLabel: "Request volume trend",
|
|
1774
|
+
centerView: "View account",
|
|
1775
|
+
subTitle: "Subscriptions",
|
|
1776
|
+
subDailyBlocked: "Daily quota exhausted",
|
|
1777
|
+
subMonthlyBlocked: "Monthly quota exhausted",
|
|
1778
|
+
subFiveBlocked: "5-hour quota exhausted",
|
|
1779
|
+
subSevenBlocked: "7-day quota exhausted",
|
|
1780
|
+
subReasonUnknown: "This subscription is restricted by the account",
|
|
1781
|
+
subRestricted: "Restricted",
|
|
1782
|
+
subRestrictedNote: "This subscription is temporarily unavailable. Check the account restrictions.",
|
|
1783
|
+
subRestrictedWait: "This subscription is restricted, {time}",
|
|
1784
|
+
subActive: "Active",
|
|
1785
|
+
subExpired: "Expired",
|
|
1786
|
+
subRevoked: "Revoked",
|
|
1787
|
+
subPending: "Pending",
|
|
1788
|
+
subExhausted: "Quota exhausted",
|
|
1789
|
+
subUsed: "Exhausted",
|
|
1790
|
+
subUnlimited: "Unlimited",
|
|
1791
|
+
subFirstUse: "Starts on first use",
|
|
1792
|
+
subFive: "5 hours",
|
|
1793
|
+
subSeven: "7 days",
|
|
1794
|
+
subExpires: "Expires: {time}",
|
|
1795
|
+
subFailed: "Subscription information is temporarily unavailable; actual usage determines quota",
|
|
1796
|
+
subEmpty: "No current subscriptions",
|
|
1797
|
+
subMore: "{n} more subscriptions · View all",
|
|
1798
|
+
subReceipt: "The gateway receipt determines the billing source and quota.",
|
|
1799
|
+
subFallback: "Subscriptions are used first, then balance when quota is exhausted",
|
|
1800
|
+
subZero: "Top up to continue after subscription quota runs out",
|
|
1801
|
+
subBalance: "Balance pays until quota recovers",
|
|
1802
|
+
subWait: "Quota exhausted, {time}",
|
|
1803
|
+
subExpiredNote: "Expired; requests now use balance",
|
|
1804
|
+
subReset: "Resets {time}",
|
|
1805
|
+
subTomorrow: "Tomorrow {time}",
|
|
1806
|
+
subManage: "Manage subscriptions",
|
|
1807
|
+
subModels: "Included models: {models}"
|
|
1808
|
+
};
|
|
1809
|
+
//#endregion
|
|
1810
|
+
//#region src/client/locales.ts
|
|
732
1811
|
/**
|
|
733
1812
|
* Copy for the dsh-vibedev pages (the plugin's settings page, the VibeDev
|
|
734
1813
|
* account section in Settings and the sidebar status), in the two languages
|
|
735
1814
|
* the client ships. Keys are shared; `zh` is the reference dictionary.
|
|
736
1815
|
*/
|
|
737
1816
|
const zh = {
|
|
1817
|
+
...accountZh,
|
|
1818
|
+
unifiedTitle: "VibeDev",
|
|
1819
|
+
unifiedAccount: "账户",
|
|
1820
|
+
unifiedSections: "VibeDev 分区",
|
|
1821
|
+
unifiedUpdatesCount: "{count} 项更新",
|
|
738
1822
|
spending: "花费",
|
|
739
1823
|
confirmSpending: "每次付费生成前先询问",
|
|
740
1824
|
confirmSpendingHint: "开启后,生成图片、视频、音乐或播客之前会先请你确认,并显示模型和预估金额。默认关闭。",
|
|
@@ -879,159 +1963,1540 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
879
1963
|
feedbackErrorRejected: "VibeDev 没有接受这条反馈({code})。",
|
|
880
1964
|
feedbackSignedOut: "意见反馈会随你的 VibeDev 账号发送,不会匿名提交。请先登录 VibeDev。"
|
|
881
1965
|
};
|
|
882
|
-
const en = {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1966
|
+
const en = {
|
|
1967
|
+
...accountEn,
|
|
1968
|
+
unifiedTitle: "VibeDev",
|
|
1969
|
+
unifiedAccount: "Account",
|
|
1970
|
+
unifiedSections: "VibeDev sections",
|
|
1971
|
+
unifiedUpdatesCount: "{count} updates",
|
|
1972
|
+
spending: "Spending",
|
|
1973
|
+
confirmSpending: "Ask before each paid generation",
|
|
1974
|
+
confirmSpendingHint: "When on, you are asked to confirm before an image, video, song or podcast is generated, with the model and the estimated price. Off by default.",
|
|
1975
|
+
output: "Where results go",
|
|
1976
|
+
claudeCache: "Claude prompt caching",
|
|
1977
|
+
claudeCacheTtl: "Cache lifetime",
|
|
1978
|
+
claudeCacheDefault: "Default",
|
|
1979
|
+
claudeCache5m: "5 minutes",
|
|
1980
|
+
claudeCache1h: "1 hour",
|
|
1981
|
+
claudeCacheHint: "Default preserves existing requests; 5 minutes or 1 hour sets the lifetime on existing cache markers only. Applies to Claude over Messages in the VibeDev and Relay groups; model and gateway support are required. Saved changes apply to future requests. This does not guarantee a cache hit.",
|
|
1982
|
+
claudeCacheCostHint: "1-hour cache writes may cost more; actual charges come from the gateway. If the gateway rejects the lifetime, select Default or 5 minutes. The plugin never silently retries with a shorter lifetime.",
|
|
1983
|
+
outputDir: "Output folder",
|
|
1984
|
+
outputDirHint: "Relative to the workspace. Images, videos, audio and transcripts go into its images, videos, audio and transcripts folders. Clear it to go back to media.",
|
|
1985
|
+
models: "Default media models",
|
|
1986
|
+
modelsHint: "A model ID entered here is used first; leave it empty to let the agent choose from the VibeDev catalog. Ask the agent to list the media models to see what is available and what it costs.",
|
|
1987
|
+
imageModel: "Images",
|
|
1988
|
+
videoModel: "Video",
|
|
1989
|
+
musicModel: "Music",
|
|
1990
|
+
podcastModel: "Podcasts",
|
|
1991
|
+
speechModel: "Speech",
|
|
1992
|
+
transcriptionModel: "Speech to text",
|
|
1993
|
+
modelPlaceholder: "Empty: chosen automatically",
|
|
1994
|
+
account: "Account",
|
|
1995
|
+
accountHint: "Sign in to VibeDev in Settings → VibeDev account or at the bottom of the sidebar. In the VibeDev app, the account signed in to the app is used. Everything is paid from the VibeDev balance.",
|
|
1996
|
+
register: "Register or top up at VibeDev",
|
|
1997
|
+
loading: "Loading settings…",
|
|
1998
|
+
unavailable: "The plugin is not running, so its settings cannot be changed right now.",
|
|
1999
|
+
readOnly: "The configuration is read-only.",
|
|
2000
|
+
saveFailed: "The settings were not saved. Try again.",
|
|
2001
|
+
save: "Save",
|
|
2002
|
+
saving: "Saving…",
|
|
2003
|
+
overridden: "Changed",
|
|
2004
|
+
reset: "Reset",
|
|
2005
|
+
invalid: "Not a valid value",
|
|
2006
|
+
accountNav: "VibeDev account",
|
|
2007
|
+
mediaNav: "VibeDev media",
|
|
2008
|
+
accountTitle: "VibeDev account",
|
|
2009
|
+
accountIntro: "Once you sign in to VibeDev, the model picker gains a \"{name}\" group (Claude, GPT and more), and the agent can generate images, video and music. Everything is paid from your VibeDev balance, separately from the DeepSeek account.",
|
|
2010
|
+
signedOutStatus: "Not signed in",
|
|
2011
|
+
signIn: "Sign in to VibeDev",
|
|
2012
|
+
signingIn: "Signing in…",
|
|
2013
|
+
pendingStatus: "The VibeDev sign-in page is open in your browser; this updates once you finish there.",
|
|
2014
|
+
pendingLink: "Browser did not open? Open the sign-in page",
|
|
2015
|
+
cancelSignIn: "Cancel",
|
|
2016
|
+
registerHint: "No VibeDev account yet?",
|
|
2017
|
+
registerLink: "Register",
|
|
2018
|
+
signedInAs: "Signed in as {who}",
|
|
2019
|
+
signedInPlugin: "Signed in to VibeDev",
|
|
2020
|
+
hostStatus: "Signed in through the VibeDev app{who}",
|
|
2021
|
+
hostHint: "The VibeDev app manages this account; sign out from the account menu at the bottom of the app's sidebar.",
|
|
2022
|
+
keyStatus: "Using a development key from the environment",
|
|
2023
|
+
balance: "Balance: {amount}",
|
|
2024
|
+
balanceUnknown: "The balance could not be read right now",
|
|
2025
|
+
modelsListed: "\"{name}\" in the model picker: {count} models",
|
|
2026
|
+
modelsHost: "The VibeDev app already lists these models itself",
|
|
2027
|
+
topUp: "Top up",
|
|
2028
|
+
usage: "Usage",
|
|
2029
|
+
refresh: "Refresh",
|
|
2030
|
+
signOut: "Sign out",
|
|
2031
|
+
signOutFailed: "Signing out did not work. Try again.",
|
|
2032
|
+
signInFailed: "Could not start the sign-in: {message}",
|
|
2033
|
+
signInExchanging: "Exchanging sign-in credentials…",
|
|
2034
|
+
signInCommitting: "Saving sign-in credentials…",
|
|
2035
|
+
signInExpired: "Sign-in expired. Please sign in again.",
|
|
2036
|
+
signInNetwork: "Could not connect to the sign-in service. Check your network and try signing in again.",
|
|
2037
|
+
signInTimeout: "The sign-in service did not respond in time. Please sign in again.",
|
|
2038
|
+
signInRefused: "The sign-in service rejected this authorization. Please start a new sign-in.",
|
|
2039
|
+
signInUnavailable: "The sign-in service is temporarily unavailable. Please try again later.",
|
|
2040
|
+
signInProtocol: "The sign-in service returned an invalid response. Please share the diagnostic details with support.",
|
|
2041
|
+
signInStorage: "Could not save the sign-in locally. Check access to the app data folder.",
|
|
2042
|
+
signInCallback: "Could not start the local sign-in callback. Check local security software and try again.",
|
|
2043
|
+
signInUnknown: "Could not complete sign-in. Please sign in again.",
|
|
2044
|
+
signInDiagnostic: "Sign-in diagnostic details",
|
|
2045
|
+
loadFailed: "The VibeDev account could not be read. Try again later.",
|
|
2046
|
+
sidebarSignedIn: "VibeDev signed in",
|
|
2047
|
+
sidebarSignedOut: "Sign in to VibeDev",
|
|
2048
|
+
sidebarPending: "Signing in to VibeDev…",
|
|
2049
|
+
sidebarMenu: "VibeDev account",
|
|
2050
|
+
sidebarIntro: "Sign in to use the VibeDev models and media generation",
|
|
2051
|
+
settings: "Settings",
|
|
2052
|
+
accountMenu: "VibeDev account menu",
|
|
2053
|
+
numberStyle: "en",
|
|
2054
|
+
balanceFrozen: "On hold: {amount}, settled when the tasks end",
|
|
2055
|
+
cardTitle: "VibeDev balance",
|
|
2056
|
+
cardAvailable: "Available",
|
|
2057
|
+
cardFrozen: "On hold",
|
|
2058
|
+
cardFrozenNote: "Held when a video task starts, settled when it ends",
|
|
2059
|
+
cardTotal: "Total",
|
|
2060
|
+
cardUpdated: "Updated {ago}",
|
|
2061
|
+
cardReading: "Updating…",
|
|
2062
|
+
cardReadFailed: "Could not read it; this is the balance from {ago}",
|
|
2063
|
+
cardReadFailedNow: "Could not read it; this is the balance read moments ago",
|
|
2064
|
+
cardReadFailedNone: "The balance could not be read",
|
|
2065
|
+
agoNow: "just now",
|
|
2066
|
+
agoSeconds: "{n} s ago",
|
|
2067
|
+
agoMinutes: "{n} min ago",
|
|
2068
|
+
agoHours: "{n} h ago",
|
|
2069
|
+
cardLatency: "Latency",
|
|
2070
|
+
cardLatencyNote: "Round trip to the VibeDev gateway, not model speed",
|
|
2071
|
+
cardMeasuring: "measuring…",
|
|
2072
|
+
cardRemeasure: "Test again",
|
|
2073
|
+
cardMeasureFailed: "could not be measured",
|
|
2074
|
+
latencyFast: "Fast",
|
|
2075
|
+
latencyNormal: "Normal",
|
|
2076
|
+
latencySlow: "Slow",
|
|
2077
|
+
latencyVerySlow: "Very slow",
|
|
2078
|
+
latencyUnreachable: "Unreachable",
|
|
2079
|
+
latencyTimeout: "timed out",
|
|
2080
|
+
latencyNetwork: "network error",
|
|
2081
|
+
latencyHttp: "HTTP {status}",
|
|
2082
|
+
localeTag: "en",
|
|
2083
|
+
close: "Close",
|
|
2084
|
+
feedbackMenu: "Feedback",
|
|
2085
|
+
feedbackTitle: "Feedback",
|
|
2086
|
+
feedbackIntro: "Tell us what works and what needs improving. Feedback is sent to the VibeDev team with your VibeDev account.",
|
|
2087
|
+
feedbackCategories: "Category",
|
|
2088
|
+
categoryTaskResult: "Task result",
|
|
2089
|
+
categoryInstructionFollowing: "Instruction understanding and following",
|
|
2090
|
+
categoryProductInteraction: "Product features and interaction",
|
|
2091
|
+
categoryServiceStability: "Stability and speed",
|
|
2092
|
+
categoryResourceCost: "Resource usage and cost",
|
|
2093
|
+
categorySecurityPrivacyPermission: "Security, privacy, and permissions",
|
|
2094
|
+
categoryOther: "Other",
|
|
2095
|
+
feedbackDetail: "Feedback details",
|
|
2096
|
+
feedbackPlaceholder: "What went wrong, or what would you like to see?",
|
|
2097
|
+
feedbackCount: "{n} / {max}",
|
|
2098
|
+
feedbackAttach: "Attach recent error messages (may include file paths or code snippets)",
|
|
2099
|
+
feedbackAttachLoading: "Reading the error messages…",
|
|
2100
|
+
feedbackAttachPreview: "This will be attached ({entries} entries, {size}):",
|
|
2101
|
+
feedbackAttachEmpty: "No recent errors; nothing will be attached.",
|
|
2102
|
+
feedbackAttachFailed: "Could not read the error messages; nothing will be attached.",
|
|
2103
|
+
feedbackSend: "Send",
|
|
2104
|
+
feedbackSending: "Sending…",
|
|
2105
|
+
feedbackCancel: "Cancel",
|
|
2106
|
+
feedbackDone: "Done",
|
|
2107
|
+
feedbackSent: "Sent. Thank you!",
|
|
2108
|
+
feedbackQueuedOffline: "Saved; it will be sent automatically once you are online",
|
|
2109
|
+
feedbackQueuedLater: "Saved; it will be sent automatically later",
|
|
2110
|
+
feedbackQueuedSignedOut: "Saved; it will be sent once you sign in to VibeDev",
|
|
2111
|
+
feedbackErrorFailed: "Could not send it. Check your connection and try again.",
|
|
2112
|
+
feedbackErrorInvalid: "The feedback was not accepted as written. Edit it and try again.",
|
|
2113
|
+
feedbackErrorRejected: "VibeDev did not accept this feedback ({code}).",
|
|
2114
|
+
feedbackSignedOut: "Feedback is sent with your VibeDev account, never anonymously. Sign in to VibeDev first."
|
|
2115
|
+
};
|
|
2116
|
+
/**
|
|
2117
|
+
* Fill `{name}` placeholders.
|
|
2118
|
+
* @param template - the dictionary text.
|
|
2119
|
+
* @param values - placeholder values.
|
|
2120
|
+
* @returns the text.
|
|
2121
|
+
*/
|
|
2122
|
+
function fill(template, values) {
|
|
2123
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
|
|
2124
|
+
}
|
|
2125
|
+
//#endregion
|
|
2126
|
+
//#region src/client/UnifiedCenter.tsx
|
|
2127
|
+
/** Shared Client shell: account pages and lazily selected root-list plugin content. */
|
|
2128
|
+
const STYLES = `
|
|
2129
|
+
.vibedev-unified-center{height:100%;min-height:0;min-width:0;display:flex;flex-direction:column;container-type:inline-size;color:var(--dsw-alias-label-primary,#202124);background:var(--dsw-alias-bg-layer-1,#fff);font-size:13px;line-height:1.5;--unified-accent:var(--dsw-alias-state-business-primary,#416fe2)}
|
|
2130
|
+
.vibedev-unified-center *{box-sizing:border-box}.unified-center-header{flex:none;display:flex;align-items:center;flex-wrap:wrap;gap:16px;padding:16px 28px 12px;border-bottom:1px solid var(--dsw-alias-border-l2,#e4e7ec)}.unified-center-header h1{font-size:18px;font-weight:500;line-height:1.4;margin:0}.unified-center-sections{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.unified-center-sections>button{display:inline-flex;gap:6px;align-items:center;color:var(--dsw-alias-label-secondary,#667085);white-space:nowrap}.unified-center-sections>button[aria-current=page]{color:var(--unified-accent);background:color-mix(in srgb,var(--unified-accent) 10%,transparent)}.unified-center-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;font-size:11px;font-variant-numeric:tabular-nums;line-height:18px;color:var(--unified-accent);background:color-mix(in srgb,var(--unified-accent) 12%,transparent)}
|
|
2131
|
+
.unified-center-picker{display:none;min-width:0;max-width:100%;font:inherit;line-height:1.5;color:var(--dsw-alias-label-primary,#202124);background:var(--dsw-alias-bg-layer-2,#fff);border:1px solid var(--dsw-alias-border-l2,#e4e7ec);border-radius:6px;padding:7px 10px}.unified-center-content{flex:1;min-height:0;min-width:0;overflow:auto}.unified-center-content>.vibedev-center.center-ui-v2{min-height:0}.unified-center-content .center-account-embedded .center-page-heading h1{font-size:20px;font-weight:500}.unified-center-content .center-account-embedded .center-page-header{padding-top:12px}.unified-center-loading{height:100%;display:grid;place-items:center;color:var(--dsw-alias-label-secondary,#667085)}
|
|
2132
|
+
.vibedev-unified-center :focus-visible{outline:2px solid var(--unified-accent);outline-offset:3px}
|
|
2133
|
+
[data-platform='darwin'] .vibedev-unified-center .unified-center-header{padding-top:calc(16px + var(--dsh-frame-top-clearance,0px))}
|
|
2134
|
+
@container(max-width:560px){.unified-center-header{padding:12px 16px;gap:12px}.unified-center-picker{display:block;flex:1}.unified-center-sections{display:none}[data-platform='darwin'] .vibedev-unified-center .unified-center-header{padding-top:calc(12px + var(--dsh-frame-top-clearance,0px))}}
|
|
2135
|
+
`;
|
|
2136
|
+
/** A count used by both the section tab and the sidebar's update indicator. */
|
|
2137
|
+
function CenterUpdateCount({ count, t }) {
|
|
2138
|
+
return count > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2139
|
+
className: "unified-center-count",
|
|
2140
|
+
"aria-label": fill(t("unifiedUpdatesCount"), { count }),
|
|
2141
|
+
children: count > 99 ? "99+" : count
|
|
2142
|
+
}) : null;
|
|
2143
|
+
}
|
|
2144
|
+
/** Sidebar glyph and a compact indicator for updates supplied by registered sections. */
|
|
2145
|
+
function UnifiedCenterIcon({ navigation, size = 16, t }) {
|
|
2146
|
+
const { totalUpdates } = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
|
|
2147
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2148
|
+
style: {
|
|
2149
|
+
position: "relative",
|
|
2150
|
+
display: "inline-flex",
|
|
2151
|
+
width: size,
|
|
2152
|
+
height: size
|
|
2153
|
+
},
|
|
2154
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconUserOutlineMedium, { size }), totalUpdates > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2155
|
+
role: "img",
|
|
2156
|
+
"aria-label": fill(t("unifiedUpdatesCount"), { count: totalUpdates }),
|
|
2157
|
+
style: {
|
|
2158
|
+
position: "absolute",
|
|
2159
|
+
width: 6,
|
|
2160
|
+
height: 6,
|
|
2161
|
+
top: -2,
|
|
2162
|
+
right: -3,
|
|
2163
|
+
borderRadius: "50%",
|
|
2164
|
+
background: "var(--dsw-alias-state-error-primary, #e5484d)"
|
|
2165
|
+
}
|
|
2166
|
+
})]
|
|
2167
|
+
});
|
|
2168
|
+
}
|
|
2169
|
+
/** Only the selected section content mounts; section metadata never renders a slot at startup. */
|
|
2170
|
+
function UnifiedCenter({ navigation, t, renderSlot, renderAccount }) {
|
|
2171
|
+
const state = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
|
|
2172
|
+
const sections = [{
|
|
2173
|
+
id: "account",
|
|
2174
|
+
label: () => t("unifiedAccount"),
|
|
2175
|
+
updateCount: 0
|
|
2176
|
+
}, ...state.sections];
|
|
2177
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2178
|
+
className: "vibedev-unified-center",
|
|
2179
|
+
"data-dsh-vibedev-center": true,
|
|
2180
|
+
children: [
|
|
2181
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: STYLES }),
|
|
2182
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
2183
|
+
className: "unified-center-header",
|
|
2184
|
+
children: [
|
|
2185
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: t("unifiedTitle") }),
|
|
2186
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
|
|
2187
|
+
className: "unified-center-sections",
|
|
2188
|
+
"aria-label": t("unifiedSections"),
|
|
2189
|
+
children: sections.map((section) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
2190
|
+
variant: "ghost",
|
|
2191
|
+
size: "sm",
|
|
2192
|
+
"aria-current": state.selected.section === section.id ? "page" : void 0,
|
|
2193
|
+
onClick: () => navigation.open({ section: section.id }),
|
|
2194
|
+
children: [section.label(), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CenterUpdateCount, {
|
|
2195
|
+
count: section.updateCount,
|
|
2196
|
+
t
|
|
2197
|
+
})]
|
|
2198
|
+
}, section.id))
|
|
2199
|
+
}),
|
|
2200
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
2201
|
+
className: "unified-center-picker",
|
|
2202
|
+
"aria-label": t("unifiedSections"),
|
|
2203
|
+
value: state.selected.section,
|
|
2204
|
+
onChange: (event) => navigation.open({ section: event.target.value }),
|
|
2205
|
+
children: sections.map((section) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
2206
|
+
value: section.id,
|
|
2207
|
+
children: [section.label(), section.updateCount > 0 ? ` · ${section.updateCount}` : ""]
|
|
2208
|
+
}, section.id))
|
|
2209
|
+
})
|
|
2210
|
+
]
|
|
2211
|
+
}),
|
|
2212
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2213
|
+
className: "unified-center-content",
|
|
2214
|
+
"data-section": state.selected.section,
|
|
2215
|
+
children: state.selected.section === "account" ? renderAccount() : renderSlot("vibedev.center.section", {
|
|
2216
|
+
embedded: true,
|
|
2217
|
+
...state.selected.view === void 0 ? {} : { view: state.selected.view }
|
|
2218
|
+
}, { only: state.selected.section })
|
|
2219
|
+
}, state.selected.section === "account" ? "account" : `${state.selected.section}:${state.navigationRevision}`)
|
|
2220
|
+
]
|
|
2221
|
+
});
|
|
2222
|
+
}
|
|
2223
|
+
//#endregion
|
|
2224
|
+
//#region src/contracts.ts
|
|
2225
|
+
const ACCOUNT_PAGES = [
|
|
2226
|
+
"dashboard",
|
|
2227
|
+
"usage",
|
|
2228
|
+
"subscriptions",
|
|
2229
|
+
"available_channels",
|
|
2230
|
+
"channel_status",
|
|
2231
|
+
"model_prices",
|
|
2232
|
+
"recharge",
|
|
2233
|
+
"orders",
|
|
2234
|
+
"redeem",
|
|
2235
|
+
"affiliate",
|
|
2236
|
+
"profile"
|
|
2237
|
+
];
|
|
2238
|
+
const NATIVE_ACCOUNT_PAGES = /* @__PURE__ */ new Set([
|
|
2239
|
+
"dashboard",
|
|
2240
|
+
"usage",
|
|
2241
|
+
"subscriptions",
|
|
2242
|
+
"channel_status",
|
|
2243
|
+
"model_prices",
|
|
2244
|
+
"recharge",
|
|
2245
|
+
"orders",
|
|
2246
|
+
"redeem",
|
|
2247
|
+
"affiliate",
|
|
2248
|
+
"profile"
|
|
2249
|
+
]);
|
|
2250
|
+
function normalizeAccountPage(page) {
|
|
2251
|
+
return page === "available_channels" ? "model_prices" : page;
|
|
2252
|
+
}
|
|
2253
|
+
//#endregion
|
|
2254
|
+
//#region src/client/center-navigation.ts
|
|
2255
|
+
const SIGNED_IN = Object.freeze({ signedIn: true });
|
|
2256
|
+
const SIGNED_OUT = Object.freeze({ signedIn: false });
|
|
2257
|
+
const signedIn = (state) => state.view !== void 0 && state.view.source !== "none";
|
|
2258
|
+
/** Owns section subscriptions and exposes a credential-free service for one mounted main slot. */
|
|
2259
|
+
var CenterNavigation = class {
|
|
2260
|
+
store;
|
|
2261
|
+
selectPanel;
|
|
2262
|
+
listeners = /* @__PURE__ */ new Set();
|
|
2263
|
+
accountListeners = /* @__PURE__ */ new Set();
|
|
2264
|
+
sections = /* @__PURE__ */ new Map();
|
|
2265
|
+
unsubscribeAccount;
|
|
2266
|
+
accountSnapshot;
|
|
2267
|
+
snapshot = {
|
|
2268
|
+
selected: { section: "account" },
|
|
2269
|
+
navigationRevision: 0,
|
|
2270
|
+
sections: [],
|
|
2271
|
+
totalUpdates: 0
|
|
2272
|
+
};
|
|
2273
|
+
disposed = false;
|
|
2274
|
+
service;
|
|
2275
|
+
/** @param store - the existing shared browser account store. @param selectPanel - select this main panel. */
|
|
2276
|
+
constructor(store, selectPanel) {
|
|
2277
|
+
this.store = store;
|
|
2278
|
+
this.selectPanel = selectPanel;
|
|
2279
|
+
this.accountSnapshot = signedIn(store.getSnapshot()) ? SIGNED_IN : SIGNED_OUT;
|
|
2280
|
+
this.unsubscribeAccount = store.subscribe(() => {
|
|
2281
|
+
const next = signedIn(store.getSnapshot()) ? SIGNED_IN : SIGNED_OUT;
|
|
2282
|
+
if (next === this.accountSnapshot) return;
|
|
2283
|
+
this.accountSnapshot = next;
|
|
2284
|
+
for (const listener of this.accountListeners) listener();
|
|
2285
|
+
});
|
|
2286
|
+
this.service = {
|
|
2287
|
+
version: 1,
|
|
2288
|
+
account: {
|
|
2289
|
+
getSnapshot: () => this.accountSnapshot,
|
|
2290
|
+
subscribe: (listener) => {
|
|
2291
|
+
if (this.disposed) return () => {};
|
|
2292
|
+
this.accountListeners.add(listener);
|
|
2293
|
+
return () => {
|
|
2294
|
+
this.accountListeners.delete(listener);
|
|
2295
|
+
};
|
|
2296
|
+
}
|
|
2297
|
+
},
|
|
2298
|
+
signIn: async () => {
|
|
2299
|
+
if (this.disposed) return;
|
|
2300
|
+
this.open({ section: "account" });
|
|
2301
|
+
await this.store.signIn();
|
|
2302
|
+
},
|
|
2303
|
+
open: this.open,
|
|
2304
|
+
registerSection: (section) => this.registerSection(section)
|
|
2305
|
+
};
|
|
2306
|
+
}
|
|
2307
|
+
/** Current metadata and selection without mounting any registered section. */
|
|
2308
|
+
getSnapshot = () => this.snapshot;
|
|
2309
|
+
/** Subscribe to navigation, registrations and update counts. */
|
|
2310
|
+
subscribe = (listener) => {
|
|
2311
|
+
if (this.disposed) return () => {};
|
|
2312
|
+
this.listeners.add(listener);
|
|
2313
|
+
return () => {
|
|
2314
|
+
this.listeners.delete(listener);
|
|
2315
|
+
};
|
|
2316
|
+
};
|
|
2317
|
+
/** Open the account section or a registered plugin section. */
|
|
2318
|
+
open = (input) => {
|
|
2319
|
+
if (this.disposed) return;
|
|
2320
|
+
const section = input.section === "plugins" && !this.sections.has("plugins") ? "account" : input.section;
|
|
2321
|
+
const selected = {
|
|
2322
|
+
section,
|
|
2323
|
+
...input.view === void 0 ? {} : { view: input.view }
|
|
2324
|
+
};
|
|
2325
|
+
if (section === "account" && input.view !== void 0) this.store.selectAccountCenterPage(normalizeAccountPage(ACCOUNT_PAGES.find((page) => page === input.view) ?? "dashboard"));
|
|
2326
|
+
this.select(selected);
|
|
2327
|
+
this.selectPanel();
|
|
2328
|
+
};
|
|
2329
|
+
/** Preserve existing account page navigation and return from a plugin section. */
|
|
2330
|
+
openAccountPage(page) {
|
|
2331
|
+
if (this.disposed) return;
|
|
2332
|
+
this.store.selectAccountCenterPage(page);
|
|
2333
|
+
this.select({ section: "account" });
|
|
2334
|
+
this.selectPanel();
|
|
2335
|
+
}
|
|
2336
|
+
select(selected) {
|
|
2337
|
+
this.snapshot = {
|
|
2338
|
+
...this.snapshot,
|
|
2339
|
+
selected,
|
|
2340
|
+
navigationRevision: this.snapshot.navigationRevision + 1
|
|
2341
|
+
};
|
|
2342
|
+
this.publish();
|
|
2343
|
+
}
|
|
2344
|
+
registerSection(metadata) {
|
|
2345
|
+
if (this.disposed) return () => {};
|
|
2346
|
+
if (metadata.id === "account" || this.sections.has(metadata.id)) throw new Error(`VibeDev center section already registered: ${metadata.id}`);
|
|
2347
|
+
const entry = {
|
|
2348
|
+
metadata,
|
|
2349
|
+
off: () => {}
|
|
2350
|
+
};
|
|
2351
|
+
this.sections.set(metadata.id, entry);
|
|
2352
|
+
entry.off = metadata.updates?.subscribe(() => this.refreshSections()) ?? (() => {});
|
|
2353
|
+
this.refreshSections();
|
|
2354
|
+
return () => {
|
|
2355
|
+
if (this.sections.get(metadata.id) !== entry) return;
|
|
2356
|
+
this.sections.delete(metadata.id);
|
|
2357
|
+
entry.off();
|
|
2358
|
+
if (this.snapshot.selected.section === metadata.id) this.snapshot = {
|
|
2359
|
+
...this.snapshot,
|
|
2360
|
+
selected: { section: "account" }
|
|
2361
|
+
};
|
|
2362
|
+
this.refreshSections();
|
|
2363
|
+
};
|
|
2364
|
+
}
|
|
2365
|
+
refreshSections() {
|
|
2366
|
+
if (this.disposed) return;
|
|
2367
|
+
const sections = [...this.sections.values()].map(({ metadata }) => ({
|
|
2368
|
+
id: metadata.id,
|
|
2369
|
+
label: metadata.label,
|
|
2370
|
+
...metadata.order === void 0 ? {} : { order: metadata.order },
|
|
2371
|
+
updateCount: metadata.updates?.getSnapshot() ?? 0
|
|
2372
|
+
})).sort((a, b) => (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id));
|
|
2373
|
+
if (sections.length === this.snapshot.sections.length && sections.every((entry, index) => {
|
|
2374
|
+
const old = this.snapshot.sections[index];
|
|
2375
|
+
return entry.id === old.id && entry.label === old.label && entry.order === old.order && entry.updateCount === old.updateCount;
|
|
2376
|
+
})) return;
|
|
2377
|
+
this.snapshot = {
|
|
2378
|
+
...this.snapshot,
|
|
2379
|
+
sections,
|
|
2380
|
+
totalUpdates: sections.reduce((sum, section) => sum + section.updateCount, 0)
|
|
2381
|
+
};
|
|
2382
|
+
this.publish();
|
|
2383
|
+
}
|
|
2384
|
+
publish() {
|
|
2385
|
+
for (const listener of this.listeners) listener();
|
|
2386
|
+
}
|
|
2387
|
+
/** Release all metadata, update and account subscriptions when the main scope disappears. */
|
|
2388
|
+
dispose() {
|
|
2389
|
+
if (this.disposed) return;
|
|
2390
|
+
this.disposed = true;
|
|
2391
|
+
this.unsubscribeAccount();
|
|
2392
|
+
for (const section of this.sections.values()) section.off();
|
|
2393
|
+
this.sections.clear();
|
|
2394
|
+
this.listeners.clear();
|
|
2395
|
+
this.accountListeners.clear();
|
|
2396
|
+
}
|
|
2397
|
+
};
|
|
2398
|
+
//#endregion
|
|
2399
|
+
//#region src/client/feedback-store.ts
|
|
2400
|
+
/**
|
|
2401
|
+
* The feedback dialog's state and its two Host routes: the text of the
|
|
2402
|
+
* optional "recent errors" attachment (`GET /api/dsh-vibedev/feedback/attachment`)
|
|
2403
|
+
* and the submission (`POST /api/dsh-vibedev/feedback`).
|
|
2404
|
+
*
|
|
2405
|
+
* The attachment is sent only when its box is ticked, and then exactly the
|
|
2406
|
+
* text the dialog showed. Free of React and the DOM (fetch is injectable), so
|
|
2407
|
+
* the whole flow is tested in node.
|
|
2408
|
+
*/
|
|
2409
|
+
/** The categories DeepSeek Harness files feedback under, in its order. */
|
|
2410
|
+
const FEEDBACK_CATEGORIES = [
|
|
2411
|
+
"task-result",
|
|
2412
|
+
"instruction-following",
|
|
2413
|
+
"product-interaction",
|
|
2414
|
+
"service-stability",
|
|
2415
|
+
"resource-cost",
|
|
2416
|
+
"security-privacy-permission",
|
|
2417
|
+
"other"
|
|
2418
|
+
];
|
|
2419
|
+
const FEEDBACK_ROUTE = "/api/dsh-vibedev/feedback";
|
|
2420
|
+
const FEEDBACK_ATTACHMENT_ROUTE = "/api/dsh-vibedev/feedback/attachment";
|
|
2421
|
+
/** The gateway's limit on the text, in code points. */
|
|
2422
|
+
const FEEDBACK_MAX_TEXT = 4e3;
|
|
2423
|
+
const INITIAL = {
|
|
2424
|
+
open: false,
|
|
2425
|
+
category: void 0,
|
|
2426
|
+
text: "",
|
|
2427
|
+
attach: false,
|
|
2428
|
+
preview: { status: "idle" },
|
|
2429
|
+
phase: { kind: "editing" }
|
|
2430
|
+
};
|
|
2431
|
+
/**
|
|
2432
|
+
* Text cut to the gateway's limit, counted in code points as the gateway counts it.
|
|
2433
|
+
* @param text - the text.
|
|
2434
|
+
* @returns at most 4,000 code points.
|
|
2435
|
+
*/
|
|
2436
|
+
function limitText(text) {
|
|
2437
|
+
const characters = [...text];
|
|
2438
|
+
return characters.length <= 4e3 ? text : characters.slice(0, FEEDBACK_MAX_TEXT).join("");
|
|
2439
|
+
}
|
|
2440
|
+
/** The text's length in code points. */
|
|
2441
|
+
function textLength(text) {
|
|
2442
|
+
let count = 0;
|
|
2443
|
+
for (const _ of text) count++;
|
|
2444
|
+
return count;
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
* Whether the dialog can send: a category or some text, and, with the box ticked, the attachment already shown.
|
|
2448
|
+
* @param state - the dialog state.
|
|
2449
|
+
* @returns true when something would be sent.
|
|
2450
|
+
*/
|
|
2451
|
+
function canSend(state) {
|
|
2452
|
+
return state.phase.kind === "editing" && (state.category !== void 0 || state.text.trim() !== "") && !(state.attach && state.preview.status === "loading");
|
|
2453
|
+
}
|
|
2454
|
+
/** The feedback dialog's store. */
|
|
2455
|
+
var FeedbackStore = class {
|
|
2456
|
+
options;
|
|
2457
|
+
state = INITIAL;
|
|
2458
|
+
listeners = /* @__PURE__ */ new Set();
|
|
2459
|
+
/** Bumped by every opening and closing, so an answer for an earlier opening is ignored. */
|
|
2460
|
+
generation = 0;
|
|
2461
|
+
/**
|
|
2462
|
+
* @param options - fetch (a test seam).
|
|
2463
|
+
*/
|
|
2464
|
+
constructor(options = {}) {
|
|
2465
|
+
this.options = options;
|
|
2466
|
+
}
|
|
2467
|
+
subscribe = (listener) => {
|
|
2468
|
+
this.listeners.add(listener);
|
|
2469
|
+
return () => {
|
|
2470
|
+
this.listeners.delete(listener);
|
|
2471
|
+
};
|
|
2472
|
+
};
|
|
2473
|
+
getSnapshot = () => this.state;
|
|
2474
|
+
set(change) {
|
|
2475
|
+
this.state = {
|
|
2476
|
+
...this.state,
|
|
2477
|
+
...change
|
|
2478
|
+
};
|
|
2479
|
+
for (const listener of this.listeners) listener();
|
|
2480
|
+
}
|
|
2481
|
+
fetch(path, init) {
|
|
2482
|
+
return (this.options.fetch ?? globalThis.fetch)(path, init);
|
|
2483
|
+
}
|
|
2484
|
+
/** Open the dialog with an empty form. */
|
|
2485
|
+
open() {
|
|
2486
|
+
this.generation++;
|
|
2487
|
+
this.state = {
|
|
2488
|
+
...INITIAL,
|
|
2489
|
+
open: true
|
|
2490
|
+
};
|
|
2491
|
+
for (const listener of this.listeners) listener();
|
|
2492
|
+
}
|
|
2493
|
+
/** Close it; whatever was sent or queued carries on without the dialog. */
|
|
2494
|
+
close() {
|
|
2495
|
+
this.generation++;
|
|
2496
|
+
this.state = INITIAL;
|
|
2497
|
+
for (const listener of this.listeners) listener();
|
|
2498
|
+
}
|
|
2499
|
+
/** Choose a category, or none. */
|
|
2500
|
+
setCategory(category) {
|
|
2501
|
+
if (this.state.phase.kind !== "editing") return;
|
|
2502
|
+
this.set({
|
|
2503
|
+
category,
|
|
2504
|
+
phase: { kind: "editing" }
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
/** Change the text (cut to 4,000 code points). */
|
|
2508
|
+
setText(text) {
|
|
2509
|
+
if (this.state.phase.kind !== "editing") return;
|
|
2510
|
+
this.set({
|
|
2511
|
+
text: limitText(text),
|
|
2512
|
+
phase: { kind: "editing" }
|
|
2513
|
+
});
|
|
2514
|
+
}
|
|
2515
|
+
/**
|
|
2516
|
+
* Tick or untick "attach recent errors". Ticking reads the text that would be sent, every time, so what the dialog
|
|
2517
|
+
* shows is what goes.
|
|
2518
|
+
* @param attach - the box's new state.
|
|
2519
|
+
* @returns once the preview (if any) is read.
|
|
2520
|
+
*/
|
|
2521
|
+
async setAttach(attach) {
|
|
2522
|
+
if (this.state.phase.kind !== "editing") return;
|
|
2523
|
+
if (!attach) {
|
|
2524
|
+
this.set({ attach: false });
|
|
2525
|
+
return;
|
|
2526
|
+
}
|
|
2527
|
+
const generation = ++this.generation;
|
|
2528
|
+
this.set({
|
|
2529
|
+
attach: true,
|
|
2530
|
+
preview: { status: "loading" }
|
|
2531
|
+
});
|
|
2532
|
+
let preview;
|
|
2533
|
+
try {
|
|
2534
|
+
const response = await this.fetch(FEEDBACK_ATTACHMENT_ROUTE);
|
|
2535
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
2536
|
+
const body = await response.json();
|
|
2537
|
+
if (typeof body.content !== "string" || typeof body.entries !== "number" || typeof body.bytes !== "number") throw new Error("not a preview");
|
|
2538
|
+
preview = {
|
|
2539
|
+
status: "ready",
|
|
2540
|
+
preview: {
|
|
2541
|
+
content: body.content,
|
|
2542
|
+
entries: body.entries,
|
|
2543
|
+
bytes: body.bytes
|
|
2544
|
+
}
|
|
2545
|
+
};
|
|
2546
|
+
} catch {
|
|
2547
|
+
preview = { status: "failed" };
|
|
2548
|
+
}
|
|
2549
|
+
if (generation === this.generation) this.set({ preview });
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Send the feedback: the category and text, and the shown attachment only when its box is ticked.
|
|
2553
|
+
* @param locale - the language the dialog is in.
|
|
2554
|
+
* @returns once the Host answered.
|
|
2555
|
+
*/
|
|
2556
|
+
async submit(locale) {
|
|
2557
|
+
const state = this.state;
|
|
2558
|
+
if (!canSend(state)) return;
|
|
2559
|
+
const generation = ++this.generation;
|
|
2560
|
+
const shown = state.attach && state.preview.status === "ready" && state.preview.preview.content !== "" ? state.preview.preview.content : void 0;
|
|
2561
|
+
this.set({ phase: { kind: "sending" } });
|
|
2562
|
+
let phase;
|
|
2563
|
+
try {
|
|
2564
|
+
const response = await this.fetch(FEEDBACK_ROUTE, {
|
|
2565
|
+
method: "POST",
|
|
2566
|
+
headers: { "content-type": "application/json" },
|
|
2567
|
+
body: JSON.stringify({
|
|
2568
|
+
...state.category === void 0 ? {} : { category: state.category },
|
|
2569
|
+
...state.text.trim() === "" ? {} : { text: state.text },
|
|
2570
|
+
...shown === void 0 ? {} : { attachment: { content: shown } },
|
|
2571
|
+
...locale === void 0 ? {} : { locale }
|
|
2572
|
+
})
|
|
2573
|
+
});
|
|
2574
|
+
const body = await response.json().catch(() => void 0);
|
|
2575
|
+
if (response.status === 409 && body?.error?.code === "SIGNED_OUT") phase = { kind: "signed-out" };
|
|
2576
|
+
else if (response.status === 400) phase = {
|
|
2577
|
+
kind: "editing",
|
|
2578
|
+
error: "invalid"
|
|
2579
|
+
};
|
|
2580
|
+
else if (!response.ok) phase = {
|
|
2581
|
+
kind: "editing",
|
|
2582
|
+
error: "failed"
|
|
2583
|
+
};
|
|
2584
|
+
else if (body?.status === "sent") phase = { kind: "sent" };
|
|
2585
|
+
else if (body?.status === "queued") phase = {
|
|
2586
|
+
kind: "queued",
|
|
2587
|
+
reason: body.reason === "offline" || body.reason === "signed-out" ? body.reason : "later"
|
|
2588
|
+
};
|
|
2589
|
+
else phase = {
|
|
2590
|
+
kind: "editing",
|
|
2591
|
+
error: "rejected",
|
|
2592
|
+
...typeof body?.code === "string" ? { code: body.code } : {}
|
|
2593
|
+
};
|
|
2594
|
+
} catch {
|
|
2595
|
+
phase = {
|
|
2596
|
+
kind: "editing",
|
|
2597
|
+
error: "failed"
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
if (generation === this.generation) this.set({ phase });
|
|
2601
|
+
}
|
|
2602
|
+
};
|
|
2603
|
+
//#endregion
|
|
2604
|
+
//#region src/client/account-center-data.ts
|
|
2605
|
+
/** Portal routes shared by every account-center web fallback. */
|
|
2606
|
+
const ACCOUNT_CENTER_WEB_PATHS = {
|
|
2607
|
+
dashboard: "/dashboard",
|
|
2608
|
+
usage: "/usage",
|
|
2609
|
+
subscriptions: "/subscriptions",
|
|
2610
|
+
available_channels: "/available-channels",
|
|
2611
|
+
channel_status: "/monitor",
|
|
2612
|
+
model_prices: "/model-plaza",
|
|
2613
|
+
recharge: "/purchase",
|
|
2614
|
+
orders: "/orders",
|
|
2615
|
+
redeem: "/redeem",
|
|
2616
|
+
affiliate: "/affiliate",
|
|
2617
|
+
profile: "/profile"
|
|
2618
|
+
};
|
|
2619
|
+
function centerWebUrl(origin, page) {
|
|
2620
|
+
return `${new URL(origin).origin}${ACCOUNT_CENTER_WEB_PATHS[page]}`;
|
|
2621
|
+
}
|
|
2622
|
+
function centerObject(value) {
|
|
2623
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
2624
|
+
}
|
|
2625
|
+
/** Old handlers use both direct arrays and named arrays. Neither is an empty response. */
|
|
2626
|
+
function centerRows(value, field) {
|
|
2627
|
+
const items = Array.isArray(value) ? value : field === void 0 ? [] : centerObject(value)[field];
|
|
2628
|
+
return Array.isArray(items) ? items.map(centerObject) : [];
|
|
2629
|
+
}
|
|
2630
|
+
function centerIdentity(view) {
|
|
2631
|
+
let origin = "";
|
|
2632
|
+
try {
|
|
2633
|
+
origin = new URL(view?.links.register ?? "").origin;
|
|
2634
|
+
} catch {}
|
|
2635
|
+
return JSON.stringify([
|
|
2636
|
+
origin,
|
|
2637
|
+
view?.source ?? "none",
|
|
2638
|
+
view?.user?.id ?? null
|
|
2639
|
+
]);
|
|
2640
|
+
}
|
|
2641
|
+
//#endregion
|
|
2642
|
+
//#region src/client/account-store.ts
|
|
2643
|
+
/**
|
|
2644
|
+
* The VibeDev account as the browser half sees it: one store the Settings
|
|
2645
|
+
* section and the sidebar status share. It reads the Host route
|
|
2646
|
+
* (`GET /api/dsh-vibedev/account`) on start, every 2 s while a sign-in waits
|
|
2647
|
+
* for the browser, and whenever the window regains focus. Otherwise it keeps a
|
|
2648
|
+
* long poll open (`?since=<revision>`), which the Host answers as soon as the
|
|
2649
|
+
* balance or the person changes — a charge shows within seconds; a Host
|
|
2650
|
+
* without long polls is read every minute. The actions call the sign-in,
|
|
2651
|
+
* cancel and sign-out routes.
|
|
2652
|
+
*
|
|
2653
|
+
* The balance card (hovering the sidebar row) and the row's menu ask for a
|
|
2654
|
+
* fresh balance when the one shown was read more than 10 s ago, and the card
|
|
2655
|
+
* measures the network latency to the gateway (`POST /api/dsh-vibedev/latency`)
|
|
2656
|
+
* when it opens and the last measurement is more than a minute old, or when
|
|
2657
|
+
* asked to; never on a timer. Each of these runs at most once at a time.
|
|
2658
|
+
*
|
|
2659
|
+
* The account menus' 意见反馈 dialog has its own small store (`feedback`),
|
|
2660
|
+
* on the same Host connection.
|
|
2661
|
+
*
|
|
2662
|
+
* Kept free of React and of the DOM beyond `fetch` and timers (both
|
|
2663
|
+
* injectable) so it can be tested in node.
|
|
2664
|
+
*/
|
|
2665
|
+
const ACCOUNT_ROUTE = "/api/dsh-vibedev/account";
|
|
2666
|
+
const LATENCY_ROUTE = "/api/dsh-vibedev/latency";
|
|
2667
|
+
const PENDING_POLL_MS = 2e3;
|
|
2668
|
+
const IDLE_POLL_MS = 6e4;
|
|
2669
|
+
/** After a failed long poll, the next one waits this long (the Host may be restarting). */
|
|
2670
|
+
const WATCH_RETRY_MS = 5e3;
|
|
2671
|
+
/** Who to show: the nickname, else the email. */
|
|
2672
|
+
function displayName(view) {
|
|
2673
|
+
return view?.user?.nickname ?? view?.user?.email;
|
|
2674
|
+
}
|
|
2675
|
+
/** The account store. */
|
|
2676
|
+
var AccountStore = class {
|
|
2677
|
+
options;
|
|
2678
|
+
centerNavigation;
|
|
2679
|
+
consumingNavigation = /* @__PURE__ */ new Set();
|
|
2680
|
+
subscriptionRead;
|
|
2681
|
+
subscriptionReadFresh = false;
|
|
2682
|
+
queuedSubscriptionRead;
|
|
2683
|
+
subscriptionIdentity;
|
|
2684
|
+
subscriptionsAt = Number.NEGATIVE_INFINITY;
|
|
2685
|
+
refreshSubscriptions(fresh = false) {
|
|
2686
|
+
const identity = centerIdentity(this.state.view);
|
|
2687
|
+
if (this.subscriptionRead !== void 0 && this.subscriptionIdentity === identity) {
|
|
2688
|
+
if (!fresh || this.subscriptionReadFresh) return this.subscriptionRead;
|
|
2689
|
+
if (this.queuedSubscriptionRead?.identity === identity) return this.queuedSubscriptionRead.value;
|
|
2690
|
+
const value = this.subscriptionRead.then(() => {
|
|
2691
|
+
if (centerIdentity(this.state.view) === identity) return this.refreshSubscriptions(true);
|
|
2692
|
+
}).finally(() => {
|
|
2693
|
+
if (this.queuedSubscriptionRead?.value === value) this.queuedSubscriptionRead = void 0;
|
|
2694
|
+
});
|
|
2695
|
+
this.queuedSubscriptionRead = {
|
|
2696
|
+
identity,
|
|
2697
|
+
value
|
|
2698
|
+
};
|
|
2699
|
+
return value;
|
|
2700
|
+
}
|
|
2701
|
+
if (this.state.view === void 0 || this.state.view.source === "none") return Promise.resolve();
|
|
2702
|
+
if (!fresh && this.state.subscriptions?.identity === identity && this.now() - this.subscriptionsAt < 3e4) return Promise.resolve();
|
|
2703
|
+
this.subscriptionIdentity = identity;
|
|
2704
|
+
this.subscriptionReadFresh = fresh;
|
|
2705
|
+
const read = (async () => {
|
|
2706
|
+
let restricted = false;
|
|
2707
|
+
try {
|
|
2708
|
+
const response = await this.fetch(`/api/dsh-vibedev/account-center/entitlements${fresh ? "?fresh=1" : ""}`);
|
|
2709
|
+
restricted = response.status === 401 || response.status === 403;
|
|
2710
|
+
if (!response.ok && response.status !== 404 && response.status !== 405) throw new Error("unavailable");
|
|
2711
|
+
const body = centerObject(await response.json().catch(() => void 0));
|
|
2712
|
+
const entitlements = response.ok && body.unsupported !== true ? centerObject(body.data) : void 0;
|
|
2713
|
+
if (centerIdentity(this.state.view) === identity) this.set({ entitlements });
|
|
2714
|
+
let source = "entitlements";
|
|
2715
|
+
let items = centerRows(entitlements, "subscriptions");
|
|
2716
|
+
if (entitlements?.subscription_snapshot_available === true && !Array.isArray(entitlements.subscriptions)) throw new Error("invalid snapshot");
|
|
2717
|
+
if (entitlements?.subscription_snapshot_available !== true) {
|
|
2718
|
+
source = "summary";
|
|
2719
|
+
const summary = await this.fetch("/api/dsh-vibedev/account-center/subscriptions/summary");
|
|
2720
|
+
const legacy = centerObject(await summary.json().catch(() => void 0));
|
|
2721
|
+
if (!summary.ok || legacy.unsupported === true) throw new Error("unavailable");
|
|
2722
|
+
if (!Array.isArray(legacy.data) && !Array.isArray(centerObject(legacy.data).subscriptions)) throw new Error("invalid summary");
|
|
2723
|
+
items = centerRows(legacy.data, "subscriptions").map((item) => ({
|
|
2724
|
+
id: item.id,
|
|
2725
|
+
name: item.name ?? item.group_name,
|
|
2726
|
+
status: item.status,
|
|
2727
|
+
expires_at: item.expires_at,
|
|
2728
|
+
windows: { seven_day: centerObject(item.windows).seven_day }
|
|
2729
|
+
}));
|
|
2730
|
+
}
|
|
2731
|
+
if (centerIdentity(this.state.view) !== identity) return;
|
|
2732
|
+
this.subscriptionsAt = this.now();
|
|
2733
|
+
this.set({
|
|
2734
|
+
entitlements,
|
|
2735
|
+
subscriptions: {
|
|
2736
|
+
identity,
|
|
2737
|
+
status: "ready",
|
|
2738
|
+
source,
|
|
2739
|
+
items
|
|
2740
|
+
}
|
|
2741
|
+
});
|
|
2742
|
+
} catch {
|
|
2743
|
+
if (centerIdentity(this.state.view) !== identity) return;
|
|
2744
|
+
this.subscriptionsAt = this.now();
|
|
2745
|
+
this.set({ subscriptions: {
|
|
2746
|
+
...this.state.subscriptions,
|
|
2747
|
+
identity,
|
|
2748
|
+
status: "failed",
|
|
2749
|
+
restricted,
|
|
2750
|
+
items: this.state.subscriptions?.identity === identity ? this.state.subscriptions.items : []
|
|
2751
|
+
} });
|
|
2752
|
+
}
|
|
2753
|
+
})().finally(() => {
|
|
2754
|
+
if (this.subscriptionRead === read) {
|
|
2755
|
+
this.subscriptionRead = void 0;
|
|
2756
|
+
this.subscriptionReadFresh = false;
|
|
2757
|
+
}
|
|
2758
|
+
});
|
|
2759
|
+
this.subscriptionRead = read;
|
|
2760
|
+
return read;
|
|
2761
|
+
}
|
|
2762
|
+
setAccountCenterNavigation(open) {
|
|
2763
|
+
this.centerNavigation = open;
|
|
2764
|
+
return () => {
|
|
2765
|
+
if (this.centerNavigation === open) this.centerNavigation = void 0;
|
|
2766
|
+
};
|
|
2767
|
+
}
|
|
2768
|
+
openAccountCenter(page = "dashboard") {
|
|
2769
|
+
page = normalizeAccountPage(page);
|
|
2770
|
+
const view = this.state.view;
|
|
2771
|
+
if (!NATIVE_ACCOUNT_PAGES.has(page) && view !== void 0) {
|
|
2772
|
+
this.openLink(page === "recharge" ? view.links.topUp : centerWebUrl(view.links.register, page));
|
|
2773
|
+
return;
|
|
2774
|
+
}
|
|
2775
|
+
this.centerNavigation?.(page);
|
|
2776
|
+
}
|
|
2777
|
+
async consumeAccountCenterNavigation() {
|
|
2778
|
+
const navigation = this.state.view?.accountCenter;
|
|
2779
|
+
if (navigation === void 0 || navigation.expiresAt <= this.now() || this.consumingNavigation.has(navigation.id)) return;
|
|
2780
|
+
this.consumingNavigation.add(navigation.id);
|
|
2781
|
+
const response = await this.fetch(`${ACCOUNT_ROUTE}/navigation/consume`, {
|
|
2782
|
+
method: "POST",
|
|
2783
|
+
headers: { "content-type": "application/json" },
|
|
2784
|
+
body: JSON.stringify({ id: navigation.id })
|
|
2785
|
+
}).catch(() => void 0);
|
|
2786
|
+
if (response?.ok && (await response.json()).consumed === true) this.openAccountCenter(navigation.page);
|
|
2787
|
+
}
|
|
2788
|
+
selectAccountCenterPage(page) {
|
|
2789
|
+
this.set({ accountCenterPage: {
|
|
2790
|
+
page,
|
|
2791
|
+
revision: (this.state.accountCenterPage?.revision ?? 0) + 1
|
|
2792
|
+
} });
|
|
2793
|
+
}
|
|
2794
|
+
state = {
|
|
2795
|
+
view: void 0,
|
|
2796
|
+
loadFailed: false,
|
|
2797
|
+
busy: void 0,
|
|
2798
|
+
actionError: void 0,
|
|
2799
|
+
refreshing: false,
|
|
2800
|
+
latency: { measuring: false }
|
|
2801
|
+
};
|
|
2802
|
+
listeners = /* @__PURE__ */ new Set();
|
|
2803
|
+
timer;
|
|
2804
|
+
reading;
|
|
2805
|
+
/** The running read asks the Host to read the balance again. */
|
|
2806
|
+
readingFresh = false;
|
|
2807
|
+
/** A fresh read asked for while a plain one ran: it starts when that one ends. */
|
|
2808
|
+
queuedFresh;
|
|
2809
|
+
measuring;
|
|
2810
|
+
stopped = true;
|
|
2811
|
+
unsubscribeFocus;
|
|
2812
|
+
/** The open long poll, when one is. */
|
|
2813
|
+
watching;
|
|
2814
|
+
/** The feedback dialog the account menus open, on the same Host connection. */
|
|
2815
|
+
feedback;
|
|
2816
|
+
/**
|
|
2817
|
+
* @param options - fetch, timers, window opening, focus and the clock (test seams).
|
|
2818
|
+
*/
|
|
2819
|
+
constructor(options = {}) {
|
|
2820
|
+
this.options = options;
|
|
2821
|
+
this.feedback = new FeedbackStore(options.fetch === void 0 ? {} : { fetch: options.fetch });
|
|
2822
|
+
}
|
|
2823
|
+
/** The store's clock (epoch ms), which the card's "N 秒前" reads as well. */
|
|
2824
|
+
now = () => (this.options.now ?? Date.now)();
|
|
2825
|
+
/** Subscribe for useSyncExternalStore. */
|
|
2826
|
+
subscribe = (listener) => {
|
|
2827
|
+
this.listeners.add(listener);
|
|
2828
|
+
return () => {
|
|
2829
|
+
this.listeners.delete(listener);
|
|
2830
|
+
};
|
|
2831
|
+
};
|
|
2832
|
+
/** The current state, for useSyncExternalStore. */
|
|
2833
|
+
getSnapshot = () => this.state;
|
|
2834
|
+
set(next) {
|
|
2835
|
+
if (next.view !== void 0 && centerIdentity(next.view) !== centerIdentity(this.state.view)) {
|
|
2836
|
+
this.state = {
|
|
2837
|
+
...this.state,
|
|
2838
|
+
subscriptions: void 0,
|
|
2839
|
+
entitlements: void 0
|
|
2840
|
+
};
|
|
2841
|
+
this.subscriptionsAt = Number.NEGATIVE_INFINITY;
|
|
2842
|
+
}
|
|
2843
|
+
this.state = {
|
|
2844
|
+
...this.state,
|
|
2845
|
+
...next
|
|
2846
|
+
};
|
|
2847
|
+
for (const listener of this.listeners) try {
|
|
2848
|
+
listener();
|
|
2849
|
+
} catch {}
|
|
2850
|
+
}
|
|
2851
|
+
fetch(path, init) {
|
|
2852
|
+
return (this.options.fetch ?? globalThis.fetch)(path, init);
|
|
2853
|
+
}
|
|
2854
|
+
/** Start reading; returns stop. */
|
|
2855
|
+
start() {
|
|
2856
|
+
if (!this.stopped) return () => {
|
|
2857
|
+
this.stop();
|
|
2858
|
+
};
|
|
2859
|
+
this.stopped = false;
|
|
2860
|
+
this.unsubscribeFocus = this.options.onFocus?.(() => {
|
|
2861
|
+
this.refresh();
|
|
2862
|
+
});
|
|
2863
|
+
this.refresh();
|
|
2864
|
+
return () => {
|
|
2865
|
+
this.stop();
|
|
2866
|
+
};
|
|
2867
|
+
}
|
|
2868
|
+
stop() {
|
|
2869
|
+
this.stopped = true;
|
|
2870
|
+
this.unsubscribeFocus?.();
|
|
2871
|
+
this.unsubscribeFocus = void 0;
|
|
2872
|
+
if (this.timer !== void 0) (this.options.clearTimeout ?? ((handle) => {
|
|
2873
|
+
globalThis.clearTimeout(handle);
|
|
2874
|
+
}))(this.timer);
|
|
2875
|
+
this.timer = void 0;
|
|
2876
|
+
this.watching?.abort();
|
|
2877
|
+
this.watching = void 0;
|
|
2878
|
+
}
|
|
2879
|
+
later(callback, ms) {
|
|
2880
|
+
if (this.timer !== void 0) (this.options.clearTimeout ?? ((handle) => {
|
|
2881
|
+
globalThis.clearTimeout(handle);
|
|
2882
|
+
}))(this.timer);
|
|
2883
|
+
this.timer = (this.options.setTimeout ?? ((run, delay) => globalThis.setTimeout(run, delay)))(() => {
|
|
2884
|
+
this.timer = void 0;
|
|
2885
|
+
callback();
|
|
2886
|
+
}, ms);
|
|
2887
|
+
}
|
|
2888
|
+
schedule() {
|
|
2889
|
+
if (this.stopped) return;
|
|
2890
|
+
const view = this.state.view;
|
|
2891
|
+
if (view?.pending === void 0 && typeof view?.revision === "number") {
|
|
2892
|
+
if (this.timer !== void 0) (this.options.clearTimeout ?? ((handle) => {
|
|
2893
|
+
globalThis.clearTimeout(handle);
|
|
2894
|
+
}))(this.timer);
|
|
2895
|
+
this.timer = void 0;
|
|
2896
|
+
this.watch(view.revision);
|
|
2897
|
+
return;
|
|
2898
|
+
}
|
|
2899
|
+
this.watching?.abort();
|
|
2900
|
+
this.watching = void 0;
|
|
2901
|
+
this.later(() => {
|
|
2902
|
+
this.refresh();
|
|
2903
|
+
}, view?.pending !== void 0 ? PENDING_POLL_MS : IDLE_POLL_MS);
|
|
2904
|
+
}
|
|
2905
|
+
/** Keep one long poll open for changes past `revision`. */
|
|
2906
|
+
watch(revision) {
|
|
2907
|
+
if (this.watching !== void 0) return;
|
|
2908
|
+
const controller = new AbortController();
|
|
2909
|
+
this.watching = controller;
|
|
2910
|
+
(async () => {
|
|
2911
|
+
let failed = false;
|
|
2912
|
+
try {
|
|
2913
|
+
const response = await this.fetch(`${ACCOUNT_ROUTE}?since=${revision}`, { signal: controller.signal });
|
|
2914
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
2915
|
+
const view = await response.json();
|
|
2916
|
+
if (!controller.signal.aborted && (view.revision ?? 0) >= (this.state.view?.revision ?? 0)) this.set({
|
|
2917
|
+
view,
|
|
2918
|
+
loadFailed: false
|
|
2919
|
+
});
|
|
2920
|
+
} catch {
|
|
2921
|
+
failed = !controller.signal.aborted;
|
|
2922
|
+
} finally {
|
|
2923
|
+
if (this.watching === controller) this.watching = void 0;
|
|
2924
|
+
}
|
|
2925
|
+
if (this.stopped || controller.signal.aborted) return;
|
|
2926
|
+
if (failed) this.later(() => {
|
|
2927
|
+
this.refresh();
|
|
2928
|
+
}, WATCH_RETRY_MS);
|
|
2929
|
+
else this.schedule();
|
|
2930
|
+
})();
|
|
2931
|
+
}
|
|
2932
|
+
/**
|
|
2933
|
+
* Read the account now. One read runs at a time: a second call shares it, and a fresh read asked for while a
|
|
2934
|
+
* plain one runs starts as soon as that one ends (so the balance is still read again).
|
|
2935
|
+
* @param fresh - ask the Host to read the balance again.
|
|
2936
|
+
*/
|
|
2937
|
+
refresh(fresh = false) {
|
|
2938
|
+
const running = this.reading;
|
|
2939
|
+
if (running !== void 0) {
|
|
2940
|
+
if (!fresh || this.readingFresh) return running;
|
|
2941
|
+
if (!this.state.refreshing) this.set({ refreshing: true });
|
|
2942
|
+
this.queuedFresh ??= running.then(() => {
|
|
2943
|
+
this.queuedFresh = void 0;
|
|
2944
|
+
return this.refresh(true);
|
|
2945
|
+
});
|
|
2946
|
+
return this.queuedFresh;
|
|
2947
|
+
}
|
|
2948
|
+
this.readingFresh = fresh;
|
|
2949
|
+
if (fresh && !this.state.refreshing) this.set({ refreshing: true });
|
|
2950
|
+
const reading = this.read(fresh).finally(() => {
|
|
2951
|
+
this.reading = void 0;
|
|
2952
|
+
this.readingFresh = false;
|
|
2953
|
+
this.schedule();
|
|
2954
|
+
});
|
|
2955
|
+
this.reading = reading;
|
|
2956
|
+
return reading;
|
|
2957
|
+
}
|
|
2958
|
+
async read(fresh) {
|
|
2959
|
+
try {
|
|
2960
|
+
const response = await this.fetch(fresh ? `${ACCOUNT_ROUTE}?fresh=1` : ACCOUNT_ROUTE);
|
|
2961
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
2962
|
+
this.set({
|
|
2963
|
+
view: await response.json(),
|
|
2964
|
+
loadFailed: false,
|
|
2965
|
+
...fresh ? { refreshing: false } : {}
|
|
2966
|
+
});
|
|
2967
|
+
} catch {
|
|
2968
|
+
this.set({
|
|
2969
|
+
loadFailed: true,
|
|
2970
|
+
...fresh ? { refreshing: false } : {}
|
|
2971
|
+
});
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
/**
|
|
2975
|
+
* Read the balance again when the one shown was read more than {@link FRESH_READ_AFTER_MS} ago (or never), for
|
|
2976
|
+
* the balance card and the account menu; a recent one is kept, and nothing is read while nobody is signed in.
|
|
2977
|
+
* @returns once the read (if any) ended.
|
|
2978
|
+
*/
|
|
2979
|
+
refreshIfStale() {
|
|
2980
|
+
const view = this.state.view;
|
|
2981
|
+
if (view === void 0 || view.source === "none") return Promise.resolve();
|
|
2982
|
+
if (view.readAt !== void 0 && this.now() - view.readAt <= 1e4) return Promise.resolve();
|
|
2983
|
+
return this.refresh(true);
|
|
2984
|
+
}
|
|
2985
|
+
/**
|
|
2986
|
+
* Measure the network latency to the gateway (the Host times `GET /health`). One measurement runs at a time.
|
|
2987
|
+
* @param fresh - measure again even when the Host measured within the last minute (重新测速).
|
|
2988
|
+
* @returns once the measurement ended.
|
|
2989
|
+
*/
|
|
2990
|
+
measureLatency(fresh = false) {
|
|
2991
|
+
if (this.measuring !== void 0) return this.measuring;
|
|
2992
|
+
const measuring = this.measure(fresh).finally(() => {
|
|
2993
|
+
this.measuring = void 0;
|
|
2994
|
+
});
|
|
2995
|
+
this.measuring = measuring;
|
|
2996
|
+
return measuring;
|
|
2997
|
+
}
|
|
2998
|
+
async measure(fresh) {
|
|
2999
|
+
this.set({ latency: {
|
|
3000
|
+
...this.state.latency,
|
|
3001
|
+
measuring: true
|
|
3002
|
+
} });
|
|
3003
|
+
try {
|
|
3004
|
+
const response = await this.fetch(fresh ? `${LATENCY_ROUTE}?fresh=1` : LATENCY_ROUTE, { method: "POST" });
|
|
3005
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
3006
|
+
const result = await response.json();
|
|
3007
|
+
if (typeof result.measuredAt !== "number" || !Array.isArray(result.samplesMs)) throw new Error("not a latency result");
|
|
3008
|
+
this.set({ latency: {
|
|
3009
|
+
measuring: false,
|
|
3010
|
+
result
|
|
3011
|
+
} });
|
|
3012
|
+
} catch {
|
|
3013
|
+
this.set({ latency: {
|
|
3014
|
+
...this.state.latency,
|
|
3015
|
+
measuring: false,
|
|
3016
|
+
requestFailed: true
|
|
3017
|
+
} });
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
/**
|
|
3021
|
+
* The balance card opened: a fresh balance when the one shown is more than 10 s old, and a latency measurement
|
|
3022
|
+
* when the last one is more than a minute old (or there is none).
|
|
3023
|
+
*/
|
|
3024
|
+
openedCard() {
|
|
3025
|
+
this.refreshIfStale();
|
|
3026
|
+
const last = this.state.latency.result;
|
|
3027
|
+
if (this.measuring === void 0 && (last === void 0 || this.now() - last.measuredAt > 6e4)) this.measureLatency();
|
|
3028
|
+
}
|
|
3029
|
+
/** Start a sign-in: the Host opens the system browser; when it could not, the page opens the link. */
|
|
3030
|
+
async signIn() {
|
|
3031
|
+
this.set({
|
|
3032
|
+
busy: "sign-in",
|
|
3033
|
+
actionError: void 0
|
|
3034
|
+
});
|
|
3035
|
+
try {
|
|
3036
|
+
const response = await this.fetch(`${ACCOUNT_ROUTE}/sign-in`, {
|
|
3037
|
+
method: "POST",
|
|
3038
|
+
headers: { "content-type": "application/json" },
|
|
3039
|
+
body: JSON.stringify({ open: true })
|
|
3040
|
+
});
|
|
3041
|
+
const body = await response.json().catch(() => void 0);
|
|
3042
|
+
if (!response.ok || typeof body?.url !== "string") throw new Error(typeof body?.error?.message === "string" ? body.error.message : `HTTP ${response.status}`);
|
|
3043
|
+
if (body.opened !== true) this.options.openWindow?.(body.url);
|
|
3044
|
+
} catch {
|
|
3045
|
+
this.set({ actionError: {
|
|
3046
|
+
kind: "sign-in",
|
|
3047
|
+
message: "Sign-in request failed."
|
|
3048
|
+
} });
|
|
3049
|
+
} finally {
|
|
3050
|
+
this.set({ busy: void 0 });
|
|
3051
|
+
await this.refresh();
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
/** Open the waiting sign-in's link again (the browser did not show it). */
|
|
3055
|
+
openPending() {
|
|
3056
|
+
const url = this.state.view?.pending?.url;
|
|
3057
|
+
if (url !== void 0) this.options.openWindow?.(url);
|
|
3058
|
+
}
|
|
3059
|
+
/**
|
|
3060
|
+
* Open one of the gateway's pages (top-up, usage) the page's own way.
|
|
3061
|
+
* @param url - the page.
|
|
3062
|
+
*/
|
|
3063
|
+
openLink(url) {
|
|
3064
|
+
this.options.openWindow?.(url);
|
|
3065
|
+
}
|
|
3066
|
+
/** Stop a waiting sign-in. */
|
|
3067
|
+
async cancel() {
|
|
3068
|
+
await this.fetch(`${ACCOUNT_ROUTE}/cancel`, { method: "POST" }).catch(() => void 0);
|
|
3069
|
+
await this.refresh();
|
|
3070
|
+
}
|
|
3071
|
+
/** Sign out of the plugin's own sign-in. */
|
|
3072
|
+
async signOut() {
|
|
3073
|
+
this.set({
|
|
3074
|
+
busy: "sign-out",
|
|
3075
|
+
actionError: void 0
|
|
3076
|
+
});
|
|
3077
|
+
try {
|
|
3078
|
+
const response = await this.fetch(`${ACCOUNT_ROUTE}/sign-out`, { method: "POST" });
|
|
3079
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
3080
|
+
} catch (error) {
|
|
3081
|
+
this.set({ actionError: {
|
|
3082
|
+
kind: "sign-out",
|
|
3083
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3084
|
+
} });
|
|
3085
|
+
} finally {
|
|
3086
|
+
this.set({ busy: void 0 });
|
|
3087
|
+
await this.refresh();
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
1026
3090
|
};
|
|
3091
|
+
//#endregion
|
|
3092
|
+
//#region src/client/balance-format.ts
|
|
1027
3093
|
/**
|
|
1028
|
-
*
|
|
1029
|
-
* @param
|
|
1030
|
-
* @
|
|
1031
|
-
* @returns the text.
|
|
3094
|
+
* The unit words of the page's language, as its dictionary names them (`numberStyle`).
|
|
3095
|
+
* @param t - the plugin's dictionary.
|
|
3096
|
+
* @returns `en` for the English dictionary, else `zh`.
|
|
1032
3097
|
*/
|
|
1033
|
-
function
|
|
1034
|
-
return
|
|
3098
|
+
function numberStyleOf(t) {
|
|
3099
|
+
return t("numberStyle") === "en" ? "en" : "zh";
|
|
3100
|
+
}
|
|
3101
|
+
/**
|
|
3102
|
+
* The amount as the console writes it: `Number(value).toFixed(2)`, read back as exact cents.
|
|
3103
|
+
* @param value - decimal text or a number.
|
|
3104
|
+
* @returns the cents and the sign, or undefined for anything that is not a finite number.
|
|
3105
|
+
*/
|
|
3106
|
+
function centsOf(value) {
|
|
3107
|
+
const number = typeof value === "number" ? value : value.trim() === "" ? NaN : Number(value);
|
|
3108
|
+
if (!Number.isFinite(number)) return void 0;
|
|
3109
|
+
const fixed = Math.abs(number) < 1e21 ? number.toFixed(2) : `${BigInt(number)}.00`;
|
|
3110
|
+
const match = /^(-?)(\d+)\.(\d{2})$/.exec(fixed);
|
|
3111
|
+
if (match === null) return void 0;
|
|
3112
|
+
const cents = BigInt(`${match[2]}${match[3]}`);
|
|
3113
|
+
return {
|
|
3114
|
+
negative: match[1] === "-" && cents !== 0n,
|
|
3115
|
+
cents
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3118
|
+
const grouped = (digits) => digits.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
3119
|
+
/**
|
|
3120
|
+
* What goes before the digits.
|
|
3121
|
+
* @param currency - the currency code.
|
|
3122
|
+
* @returns `¥` for CNY, `$` for USD, else the code and a space.
|
|
3123
|
+
*/
|
|
3124
|
+
function currencyPrefix(currency) {
|
|
3125
|
+
return currency === "CNY" ? "¥" : currency === "USD" ? "$" : `${currency} `;
|
|
3126
|
+
}
|
|
3127
|
+
function full({ negative, cents }, currency) {
|
|
3128
|
+
const digits = cents.toString().padStart(3, "0");
|
|
3129
|
+
return `${negative ? "-" : ""}${currencyPrefix(currency)}${grouped(digits.slice(0, -2))}.${digits.slice(-2)}`;
|
|
3130
|
+
}
|
|
3131
|
+
/** From which amount (in yuan) each unit is used, and how many yuan it stands for, largest first. */
|
|
3132
|
+
const SCALES = {
|
|
3133
|
+
zh: [{
|
|
3134
|
+
from: 100000000n,
|
|
3135
|
+
unit: 100000000n,
|
|
3136
|
+
suffix: "亿"
|
|
3137
|
+
}, {
|
|
3138
|
+
from: 10000n,
|
|
3139
|
+
unit: 10000n,
|
|
3140
|
+
suffix: "万"
|
|
3141
|
+
}],
|
|
3142
|
+
en: [
|
|
3143
|
+
{
|
|
3144
|
+
from: 1000000000n,
|
|
3145
|
+
unit: 1000000000n,
|
|
3146
|
+
suffix: "B"
|
|
3147
|
+
},
|
|
3148
|
+
{
|
|
3149
|
+
from: 1000000n,
|
|
3150
|
+
unit: 1000000n,
|
|
3151
|
+
suffix: "M"
|
|
3152
|
+
},
|
|
3153
|
+
{
|
|
3154
|
+
from: 10000n,
|
|
3155
|
+
unit: 1000n,
|
|
3156
|
+
suffix: "K"
|
|
3157
|
+
}
|
|
3158
|
+
]
|
|
3159
|
+
};
|
|
3160
|
+
/**
|
|
3161
|
+
* The full form: two decimals as the console writes them, with thousands separators.
|
|
3162
|
+
* @param amount - decimal text or a number; undefined when unknown.
|
|
3163
|
+
* @param currency - the currency code.
|
|
3164
|
+
* @returns e.g. `¥99,976,091.91`, `-¥3.50`, `$12.00`; undefined when there is no finite amount.
|
|
3165
|
+
*/
|
|
3166
|
+
function formatMoney(amount, currency) {
|
|
3167
|
+
const value = amount === void 0 ? void 0 : centsOf(amount);
|
|
3168
|
+
return value === void 0 ? void 0 : full(value, currency);
|
|
3169
|
+
}
|
|
3170
|
+
/**
|
|
3171
|
+
* The compact form for the sidebar row.
|
|
3172
|
+
* @param amount - decimal text or a number; undefined when unknown.
|
|
3173
|
+
* @param currency - the currency code.
|
|
3174
|
+
* @param style - 万 / 亿 (zh) or K / M / B (en).
|
|
3175
|
+
* @returns e.g. `¥9,997.6万`, `¥99.97M`, `¥8,000.50`; undefined when there is no finite amount.
|
|
3176
|
+
*/
|
|
3177
|
+
function formatMoneyCompact(amount, currency, style) {
|
|
3178
|
+
const value = amount === void 0 ? void 0 : centsOf(amount);
|
|
3179
|
+
if (value === void 0) return void 0;
|
|
3180
|
+
const scale = SCALES[style].find((item) => value.cents >= item.from * 100n);
|
|
3181
|
+
if (scale === void 0) return full(value, currency);
|
|
3182
|
+
const hundredths = value.cents / scale.unit;
|
|
3183
|
+
const fraction = (hundredths % 100n).toString().padStart(2, "0").replace(/0+$/, "");
|
|
3184
|
+
return `${value.negative ? "-" : ""}${currencyPrefix(currency)}${grouped((hundredths / 100n).toString())}${fraction === "" ? "" : `.${fraction}`}${scale.suffix}`;
|
|
3185
|
+
}
|
|
3186
|
+
/**
|
|
3187
|
+
* Whether an amount reads as more than zero at two decimals (a hold of 0.001 is not worth a line).
|
|
3188
|
+
* @param amount - decimal text, or undefined.
|
|
3189
|
+
* @returns true for a positive amount.
|
|
3190
|
+
*/
|
|
3191
|
+
function isPositiveAmount(amount) {
|
|
3192
|
+
const value = amount === void 0 ? void 0 : centsOf(amount);
|
|
3193
|
+
return value !== void 0 && !value.negative && value.cents > 0n;
|
|
3194
|
+
}
|
|
3195
|
+
/**
|
|
3196
|
+
* The total of what can be spent and what is held, added the way the console adds them (as numbers).
|
|
3197
|
+
* @param amount - the available amount.
|
|
3198
|
+
* @param frozen - the held amount, when known.
|
|
3199
|
+
* @returns the sum, or undefined when the available amount is not a number.
|
|
3200
|
+
*/
|
|
3201
|
+
function totalAmount(amount, frozen) {
|
|
3202
|
+
const available = Number(amount);
|
|
3203
|
+
const held = frozen === void 0 ? 0 : Number(frozen);
|
|
3204
|
+
if (amount.trim() === "" || !Number.isFinite(available)) return void 0;
|
|
3205
|
+
return Number.isFinite(held) ? available + held : available;
|
|
3206
|
+
}
|
|
3207
|
+
/**
|
|
3208
|
+
* The balance in one of the two forms.
|
|
3209
|
+
* @param balance - the balance, when known.
|
|
3210
|
+
* @param form - `full` for details, `compact` for the sidebar row.
|
|
3211
|
+
* @param style - unit words for the compact form.
|
|
3212
|
+
* @returns the text, or undefined without a usable balance.
|
|
3213
|
+
*/
|
|
3214
|
+
function balanceText(balance, form = "full", style = "zh") {
|
|
3215
|
+
if (balance === void 0) return void 0;
|
|
3216
|
+
return form === "full" ? formatMoney(balance.amount, balance.currency) : formatMoneyCompact(balance.amount, balance.currency, style);
|
|
3217
|
+
}
|
|
3218
|
+
//#endregion
|
|
3219
|
+
//#region src/client/sign-in-presentation.ts
|
|
3220
|
+
/** @param attempt - latest safe Host snapshot. @returns a locale key for a terminal login failure. */
|
|
3221
|
+
function failureKey(attempt) {
|
|
3222
|
+
if (attempt?.phase === "expired") return "signInExpired";
|
|
3223
|
+
if (attempt?.phase !== "failed") return void 0;
|
|
3224
|
+
const keys = {
|
|
3225
|
+
network: "signInNetwork",
|
|
3226
|
+
timeout: "signInTimeout",
|
|
3227
|
+
"gateway-refused": "signInRefused",
|
|
3228
|
+
"gateway-unavailable": "signInUnavailable",
|
|
3229
|
+
protocol: "signInProtocol",
|
|
3230
|
+
storage: "signInStorage",
|
|
3231
|
+
callback: "signInCallback"
|
|
3232
|
+
};
|
|
3233
|
+
return attempt.errorCode !== void 0 && Object.hasOwn(keys, attempt.errorCode) ? keys[attempt.errorCode] : "signInUnknown";
|
|
3234
|
+
}
|
|
3235
|
+
/** @param attempt - latest snapshot. @returns support reference without query, body, credentials or raw error. */
|
|
3236
|
+
function safeSupportDetails(attempt) {
|
|
3237
|
+
if (attempt === void 0) return void 0;
|
|
3238
|
+
const id = /^[a-zA-Z0-9_-]{1,80}$/.test(attempt.id) ? attempt.id : void 0;
|
|
3239
|
+
let origin;
|
|
3240
|
+
try {
|
|
3241
|
+
const url = new URL(attempt.gatewayOrigin);
|
|
3242
|
+
if (["https:", "http:"].includes(url.protocol) && !url.username && !url.password) origin = url.origin;
|
|
3243
|
+
} catch {}
|
|
3244
|
+
const stage = [
|
|
3245
|
+
"listen",
|
|
3246
|
+
"device",
|
|
3247
|
+
"redeem",
|
|
3248
|
+
"persist"
|
|
3249
|
+
].includes(attempt.stage ?? "") ? attempt.stage : void 0;
|
|
3250
|
+
return [
|
|
3251
|
+
[
|
|
3252
|
+
"network",
|
|
3253
|
+
"timeout",
|
|
3254
|
+
"gateway-refused",
|
|
3255
|
+
"gateway-unavailable",
|
|
3256
|
+
"protocol",
|
|
3257
|
+
"storage",
|
|
3258
|
+
"callback"
|
|
3259
|
+
].includes(attempt.errorCode ?? "") ? attempt.errorCode : void 0,
|
|
3260
|
+
stage,
|
|
3261
|
+
Number.isInteger(attempt.httpStatus) && Number(attempt.httpStatus) >= 100 && Number(attempt.httpStatus) <= 599 ? `HTTP ${attempt.httpStatus}` : void 0,
|
|
3262
|
+
[
|
|
3263
|
+
"ECONNRESET",
|
|
3264
|
+
"ECONNREFUSED",
|
|
3265
|
+
"ETIMEDOUT",
|
|
3266
|
+
"ENOTFOUND",
|
|
3267
|
+
"EAI_AGAIN",
|
|
3268
|
+
"ENETUNREACH",
|
|
3269
|
+
"EHOSTUNREACH",
|
|
3270
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
3271
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
3272
|
+
"UND_ERR_BODY_TIMEOUT",
|
|
3273
|
+
"UND_ERR_SOCKET",
|
|
3274
|
+
"CERT_HAS_EXPIRED",
|
|
3275
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
3276
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
3277
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
3278
|
+
].includes(attempt.networkCode ?? "") ? attempt.networkCode : void 0,
|
|
3279
|
+
origin,
|
|
3280
|
+
id
|
|
3281
|
+
].filter((value) => value !== void 0).join(" · ");
|
|
3282
|
+
}
|
|
3283
|
+
//#endregion
|
|
3284
|
+
//#region src/client/Subscriptions.tsx
|
|
3285
|
+
const warn = "var(--dsw-alias-state-warn-primary, #d99a20)";
|
|
3286
|
+
const text = (value) => typeof value === "string" || typeof value === "number" ? String(value) : "—";
|
|
3287
|
+
const quotaPercent = (value) => typeof value !== "number" ? "—" : value > 0 && value < 1 ? "<1%" : `${Math.floor(Math.min(100, Math.max(0, value)))}%`;
|
|
3288
|
+
function recoveryTime(value, now, t) {
|
|
3289
|
+
if (typeof value !== "string" || !Number.isFinite(Date.parse(value))) return "—";
|
|
3290
|
+
const date = new Date(value), today = new Date(now), tomorrow = new Date(now);
|
|
3291
|
+
tomorrow.setDate(today.getDate() + 1);
|
|
3292
|
+
const locale = numberStyleOf(t) === "en" ? "en-US" : "zh-CN";
|
|
3293
|
+
const time = date.toLocaleTimeString(locale, {
|
|
3294
|
+
hour: "2-digit",
|
|
3295
|
+
minute: "2-digit",
|
|
3296
|
+
hour12: false
|
|
3297
|
+
});
|
|
3298
|
+
const same = (other) => date.toDateString() === other.toDateString();
|
|
3299
|
+
return fill(t("subReset"), { time: same(today) ? time : same(tomorrow) ? fill(t("subTomorrow"), { time }) : date.toLocaleDateString(locale, {
|
|
3300
|
+
month: "short",
|
|
3301
|
+
day: "numeric"
|
|
3302
|
+
}) });
|
|
3303
|
+
}
|
|
3304
|
+
function blockingReason(reason, t) {
|
|
3305
|
+
if (["DAILY_LIMIT_EXCEEDED", "DAILY_QUOTA_EXHAUSTED"].includes(text(reason.code))) return t("subDailyBlocked");
|
|
3306
|
+
if (["MONTHLY_LIMIT_EXCEEDED", "MONTHLY_QUOTA_EXHAUSTED"].includes(text(reason.code))) return t("subMonthlyBlocked");
|
|
3307
|
+
if (reason.code === "WEEKLY_LIMIT_EXCEEDED") return t("subSevenBlocked");
|
|
3308
|
+
if (reason.code !== "SUBSCRIPTION_QUOTA_EXHAUSTED") return t("subReasonUnknown");
|
|
3309
|
+
switch (reason.window) {
|
|
3310
|
+
case "daily":
|
|
3311
|
+
case "legacy_daily": return t("subDailyBlocked");
|
|
3312
|
+
case "monthly":
|
|
3313
|
+
case "legacy_monthly": return t("subMonthlyBlocked");
|
|
3314
|
+
case "five_hour": return t("subFiveBlocked");
|
|
3315
|
+
case "seven_day": return t("subSevenBlocked");
|
|
3316
|
+
default: return t("subExhausted");
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
/** Shared gateway facts; this component never admits or blocks a generation. */
|
|
3320
|
+
function Subscriptions({ t, store, compact = false, showTitle = true }) {
|
|
3321
|
+
const state = (0, react.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
3322
|
+
(0, react.useEffect)(() => {
|
|
3323
|
+
store.refreshSubscriptions();
|
|
3324
|
+
}, [
|
|
3325
|
+
store,
|
|
3326
|
+
state.view?.user?.id,
|
|
3327
|
+
state.view?.source
|
|
3328
|
+
]);
|
|
3329
|
+
const snapshot = state.subscriptions;
|
|
3330
|
+
const fired = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
3331
|
+
(0, react.useEffect)(() => {
|
|
3332
|
+
const next = (snapshot?.items ?? []).flatMap((item) => [...Object.values(centerObject(item.windows)).map((value) => Date.parse(text(centerObject(value).resets_at))), ...centerRows(item.blocking_reasons).map((reason) => Date.parse(text(reason.retry_at)))]).filter((at) => Number.isFinite(at) && at > store.now() && !fired.current.has(at)).sort((a, b) => a - b)[0];
|
|
3333
|
+
if (next === void 0) return;
|
|
3334
|
+
const timer = setTimeout(() => {
|
|
3335
|
+
fired.current.add(next);
|
|
3336
|
+
store.refreshSubscriptions(true);
|
|
3337
|
+
}, Math.min(2147483647, next - store.now() + 50));
|
|
3338
|
+
return () => clearTimeout(timer);
|
|
3339
|
+
}, [snapshot, store]);
|
|
3340
|
+
if (snapshot === void 0) return null;
|
|
3341
|
+
if (snapshot.status === "ready" && snapshot.items.length === 0) return compact ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("subEmpty") });
|
|
3342
|
+
const items = compact ? snapshot.items.slice(0, 2) : snapshot.items;
|
|
3343
|
+
const amount = state.view?.balance?.amount;
|
|
3344
|
+
const balanceKnown = amount !== void 0 && /^-?\d+(?:\.\d+)?$/.test(amount) && Number.isFinite(Number(amount));
|
|
3345
|
+
const hasBalance = balanceKnown && Number(amount) > 0;
|
|
3346
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3347
|
+
"data-vibedev-subscriptions": true,
|
|
3348
|
+
style: {
|
|
3349
|
+
fontSize: compact ? 12 : 13,
|
|
3350
|
+
lineHeight: 1.6,
|
|
3351
|
+
display: "grid",
|
|
3352
|
+
gap: 12
|
|
3353
|
+
},
|
|
3354
|
+
children: [
|
|
3355
|
+
showTitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("subTitle") }),
|
|
3356
|
+
snapshot.status === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3357
|
+
role: "status",
|
|
3358
|
+
style: {
|
|
3359
|
+
margin: 0,
|
|
3360
|
+
color: warn
|
|
3361
|
+
},
|
|
3362
|
+
children: t("subFailed")
|
|
3363
|
+
}),
|
|
3364
|
+
items.map((item, index) => {
|
|
3365
|
+
const windows = centerObject(item.windows);
|
|
3366
|
+
const blocked = Object.values(windows).map(centerObject).filter((window) => window.state === "exhausted");
|
|
3367
|
+
const reasons = centerRows(item.blocking_reasons);
|
|
3368
|
+
const restricted = item.usable === false || reasons.length > 0;
|
|
3369
|
+
const reset = [...blocked.map((window) => text(window.resets_at)), ...reasons.map((reason) => text(reason.retry_at))].filter((value) => Number.isFinite(Date.parse(value))).sort((a, b) => Date.parse(b) - Date.parse(a))[0];
|
|
3370
|
+
const expired = item.status === "expired" || item.status === "revoked";
|
|
3371
|
+
const status = expired ? item.status === "revoked" ? t("subRevoked") : t("subExpired") : restricted ? t("subRestricted") : blocked.length > 0 ? t("subExhausted") : item.status === "pending" ? t("subPending") : t("subActive");
|
|
3372
|
+
const fallback = item.allow_balance_fallback === true || state.entitlements?.allow_balance_fallback === true;
|
|
3373
|
+
const note = snapshot.source === "summary" ? void 0 : !balanceKnown && !restricted ? void 0 : expired ? t("subExpiredNote") : restricted ? reset === void 0 ? t("subRestrictedNote") : fill(t("subRestrictedWait"), { time: recoveryTime(reset, store.now(), t) }) : blocked.length > 0 ? hasBalance ? t("subBalance") : fill(t("subWait"), { time: recoveryTime(reset, store.now(), t) }) : !hasBalance ? t("subZero") : fallback ? t("subFallback") : void 0;
|
|
3374
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
3375
|
+
style: { opacity: expired ? .65 : 1 },
|
|
3376
|
+
children: [
|
|
3377
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3378
|
+
style: {
|
|
3379
|
+
display: "flex",
|
|
3380
|
+
flexWrap: "wrap",
|
|
3381
|
+
justifyContent: "space-between",
|
|
3382
|
+
gap: 6
|
|
3383
|
+
},
|
|
3384
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: text(item.name ?? item.group_name) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3385
|
+
style: { color: restricted || blocked.length > 0 ? warn : void 0 },
|
|
3386
|
+
children: status
|
|
3387
|
+
})]
|
|
3388
|
+
}),
|
|
3389
|
+
typeof item.expires_at === "string" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3390
|
+
style: { opacity: .75 },
|
|
3391
|
+
children: fill(t("subExpires"), { time: new Date(text(item.expires_at)).toLocaleDateString(numberStyleOf(t) === "en" ? "en-US" : "zh-CN") })
|
|
3392
|
+
}),
|
|
3393
|
+
!expired && ["five_hour", "seven_day"].map((key) => {
|
|
3394
|
+
const window = centerObject(windows[key]);
|
|
3395
|
+
if (window.state === void 0 || snapshot.source === "summary" && key === "five_hour") return null;
|
|
3396
|
+
const notStarted = window.state === "not_started", unlimited = window.state === "unlimited", exhausted = window.state === "exhausted";
|
|
3397
|
+
const percent = notStarted ? 100 : typeof window.remaining_percent === "number" ? window.remaining_percent : void 0;
|
|
3398
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3399
|
+
style: { marginTop: 8 },
|
|
3400
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3401
|
+
style: {
|
|
3402
|
+
display: "flex",
|
|
3403
|
+
flexWrap: "wrap",
|
|
3404
|
+
justifyContent: "space-between",
|
|
3405
|
+
gap: 4
|
|
3406
|
+
},
|
|
3407
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
3408
|
+
t(key === "five_hour" ? "subFive" : "subSeven"),
|
|
3409
|
+
" · ",
|
|
3410
|
+
unlimited ? t("subUnlimited") : exhausted ? t("subUsed") : quotaPercent(percent)
|
|
3411
|
+
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3412
|
+
title: text(window.resets_at),
|
|
3413
|
+
style: { opacity: .75 },
|
|
3414
|
+
children: notStarted ? t("subFirstUse") : window.resets_at ? recoveryTime(window.resets_at, store.now(), t) : ""
|
|
3415
|
+
})]
|
|
3416
|
+
}), !unlimited && percent !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("progress", {
|
|
3417
|
+
"aria-label": t(key === "five_hour" ? "subFive" : "subSeven"),
|
|
3418
|
+
value: percent,
|
|
3419
|
+
max: 100,
|
|
3420
|
+
style: {
|
|
3421
|
+
width: "100%",
|
|
3422
|
+
height: 5,
|
|
3423
|
+
accentColor: percent < 20 ? warn : "var(--dsw-alias-state-business-primary, #4e82ef)"
|
|
3424
|
+
}
|
|
3425
|
+
})]
|
|
3426
|
+
}, key);
|
|
3427
|
+
}),
|
|
3428
|
+
!expired && reasons.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
3429
|
+
style: {
|
|
3430
|
+
margin: "8px 0 0",
|
|
3431
|
+
paddingLeft: 18,
|
|
3432
|
+
color: warn
|
|
3433
|
+
},
|
|
3434
|
+
children: reasons.map((reason, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [blockingReason(reason, t), typeof reason.retry_at === "string" && Number.isFinite(Date.parse(reason.retry_at)) ? ` · ${recoveryTime(reason.retry_at, store.now(), t)}` : ""] }, index))
|
|
3435
|
+
}),
|
|
3436
|
+
!compact && Array.isArray(item.model_ids) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: fill(t("subModels"), { models: item.model_ids.map(text).join(", ") }) }),
|
|
3437
|
+
note && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3438
|
+
style: {
|
|
3439
|
+
marginTop: 8,
|
|
3440
|
+
color: blocked.length > 0 && !hasBalance ? warn : void 0
|
|
3441
|
+
},
|
|
3442
|
+
children: [note, balanceKnown && !hasBalance && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3443
|
+
onClick: () => store.openAccountCenter("recharge"),
|
|
3444
|
+
style: {
|
|
3445
|
+
color: "inherit",
|
|
3446
|
+
border: 0,
|
|
3447
|
+
background: "none",
|
|
3448
|
+
cursor: "pointer"
|
|
3449
|
+
},
|
|
3450
|
+
children: [" · ", t("topUp")]
|
|
3451
|
+
})]
|
|
3452
|
+
})
|
|
3453
|
+
]
|
|
3454
|
+
}, text(item.id) + index);
|
|
3455
|
+
}),
|
|
3456
|
+
compact && snapshot.items.length > 2 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3457
|
+
onClick: () => store.openAccountCenter("subscriptions"),
|
|
3458
|
+
style: {
|
|
3459
|
+
color: "inherit",
|
|
3460
|
+
border: 0,
|
|
3461
|
+
background: "none",
|
|
3462
|
+
padding: 0,
|
|
3463
|
+
textAlign: "left",
|
|
3464
|
+
cursor: "pointer"
|
|
3465
|
+
},
|
|
3466
|
+
children: fill(t("subMore"), { n: snapshot.items.length - 2 })
|
|
3467
|
+
}),
|
|
3468
|
+
!compact && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3469
|
+
style: {
|
|
3470
|
+
margin: 0,
|
|
3471
|
+
opacity: .75
|
|
3472
|
+
},
|
|
3473
|
+
children: t("subReceipt")
|
|
3474
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3475
|
+
style: {
|
|
3476
|
+
display: "flex",
|
|
3477
|
+
flexWrap: "wrap",
|
|
3478
|
+
gap: 12
|
|
3479
|
+
},
|
|
3480
|
+
children: [[
|
|
3481
|
+
["recharge", t("topUp")],
|
|
3482
|
+
["subscriptions", t("subManage")],
|
|
3483
|
+
["usage", t("usage")]
|
|
3484
|
+
].map(([page, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
3485
|
+
variant: "outline",
|
|
3486
|
+
size: "sm",
|
|
3487
|
+
onClick: () => page === "subscriptions" ? store.openLink(`${new URL(state.view.links.register).origin}/subscriptions`) : store.openAccountCenter(page),
|
|
3488
|
+
children: label
|
|
3489
|
+
}, page)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
3490
|
+
variant: "outline",
|
|
3491
|
+
size: "sm",
|
|
3492
|
+
onClick: () => {
|
|
3493
|
+
store.refreshSubscriptions(true);
|
|
3494
|
+
},
|
|
3495
|
+
children: t("refresh")
|
|
3496
|
+
})]
|
|
3497
|
+
})] })
|
|
3498
|
+
]
|
|
3499
|
+
});
|
|
1035
3500
|
}
|
|
1036
3501
|
//#endregion
|
|
1037
3502
|
//#region src/client/AccountSection.tsx
|
|
@@ -1067,7 +3532,7 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
1067
3532
|
padding: 16,
|
|
1068
3533
|
borderRadius: 12,
|
|
1069
3534
|
border: "0.5px solid var(--dsw-alias-border-l2)",
|
|
1070
|
-
background: "var(--dsw-alias-bg-
|
|
3535
|
+
background: "var(--dsw-alias-bg-layer-2, transparent)"
|
|
1071
3536
|
},
|
|
1072
3537
|
statusRow: {
|
|
1073
3538
|
display: "flex",
|
|
@@ -1218,7 +3683,7 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
1218
3683
|
variant: "primary",
|
|
1219
3684
|
size: "sm",
|
|
1220
3685
|
onClick: () => {
|
|
1221
|
-
store.
|
|
3686
|
+
store.openAccountCenter("recharge");
|
|
1222
3687
|
},
|
|
1223
3688
|
children: t("topUp")
|
|
1224
3689
|
}),
|
|
@@ -1226,7 +3691,7 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
1226
3691
|
variant: "outline",
|
|
1227
3692
|
size: "sm",
|
|
1228
3693
|
onClick: () => {
|
|
1229
|
-
store.
|
|
3694
|
+
store.openAccountCenter("usage");
|
|
1230
3695
|
},
|
|
1231
3696
|
children: t("usage")
|
|
1232
3697
|
}),
|
|
@@ -1295,6 +3760,13 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
1295
3760
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: t("signInDiagnostic") }), supportDetails]
|
|
1296
3761
|
})
|
|
1297
3762
|
]
|
|
3763
|
+
}),
|
|
3764
|
+
view !== void 0 && view.source !== "none" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3765
|
+
style: styles$2.card,
|
|
3766
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Subscriptions, {
|
|
3767
|
+
t,
|
|
3768
|
+
store
|
|
3769
|
+
})
|
|
1298
3770
|
})
|
|
1299
3771
|
]
|
|
1300
3772
|
});
|
|
@@ -1930,6 +4402,17 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
1930
4402
|
]
|
|
1931
4403
|
}),
|
|
1932
4404
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: styles.rule }),
|
|
4405
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Subscriptions, {
|
|
4406
|
+
t,
|
|
4407
|
+
store,
|
|
4408
|
+
compact: true
|
|
4409
|
+
}),
|
|
4410
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4411
|
+
type: "button",
|
|
4412
|
+
style: styles.action,
|
|
4413
|
+
onClick: () => store.openAccountCenter("dashboard"),
|
|
4414
|
+
children: t("centerView")
|
|
4415
|
+
}),
|
|
1933
4416
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1934
4417
|
style: styles.line,
|
|
1935
4418
|
role: "status",
|
|
@@ -2538,8 +5021,8 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
2538
5021
|
else if (id === "open-pending") store.openPending();
|
|
2539
5022
|
else if (id === "feedback") store.feedback.open();
|
|
2540
5023
|
else if (view === void 0) return;
|
|
2541
|
-
else if (id === "top-up") store.
|
|
2542
|
-
else if (id === "usage") store.
|
|
5024
|
+
else if (id === "top-up") store.openAccountCenter("recharge");
|
|
5025
|
+
else if (id === "usage") store.openAccountCenter("usage");
|
|
2543
5026
|
else if (id === "register") store.openLink(view.links.register);
|
|
2544
5027
|
}
|
|
2545
5028
|
});
|
|
@@ -2717,8 +5200,8 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
2717
5200
|
else if (id === "cancel") store.cancel();
|
|
2718
5201
|
else if (id === "open-pending") store.openPending();
|
|
2719
5202
|
else if (id === "feedback") store.feedback.open();
|
|
2720
|
-
else if (id === "top-up") store.
|
|
2721
|
-
else if (id === "usage") store.
|
|
5203
|
+
else if (id === "top-up") store.openAccountCenter("recharge");
|
|
5204
|
+
else if (id === "usage") store.openAccountCenter("usage");
|
|
2722
5205
|
else if (id === "register") store.openLink(view.links.register);
|
|
2723
5206
|
}
|
|
2724
5207
|
});
|
|
@@ -2756,6 +5239,8 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
2756
5239
|
* module table. The Host surfaces used here are typed structurally, so this
|
|
2757
5240
|
* external package depends on no monorepo-internal types.
|
|
2758
5241
|
*/
|
|
5242
|
+
const ACCOUNT_CENTER_PANEL = "vibedev-account-center";
|
|
5243
|
+
const AccountCenter = (0, react.lazy)(async () => ({ default: (await require.async("./client.account-center.js")).AccountCenter }));
|
|
2759
5244
|
/** The package name the Plugins page keys a bundle's configuration by. */
|
|
2760
5245
|
const PACKAGE_NAME = "@vibedev-si/dsh-vibedev";
|
|
2761
5246
|
/** The dictionary namespace this plugin owns. */
|
|
@@ -2800,6 +5285,60 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
2800
5285
|
const t = ctx.locale.bind(LOCALE_NAMESPACE);
|
|
2801
5286
|
const account = new AccountStore(windowOptions());
|
|
2802
5287
|
ctx.effect(() => account.start(), "dsh-vibedev: account reads");
|
|
5288
|
+
ctx.inject(["layout"], (scoped) => {
|
|
5289
|
+
scoped.effect(() => scoped.slots.inject("main", function* () {
|
|
5290
|
+
const center = new CenterNavigation(account, () => {
|
|
5291
|
+
scoped.layout?.selectPanel(ACCOUNT_CENTER_PANEL);
|
|
5292
|
+
});
|
|
5293
|
+
yield () => {
|
|
5294
|
+
center.dispose();
|
|
5295
|
+
};
|
|
5296
|
+
yield scoped.slots.register({
|
|
5297
|
+
name: "main",
|
|
5298
|
+
key: ACCOUNT_CENTER_PANEL,
|
|
5299
|
+
locale: LOCALE_NAMESPACE,
|
|
5300
|
+
children: { "vibedev.center.section": {
|
|
5301
|
+
kind: "list",
|
|
5302
|
+
scope: "root"
|
|
5303
|
+
} }
|
|
5304
|
+
}, (owner = {}) => (0, react.createElement)(UnifiedCenter, {
|
|
5305
|
+
navigation: center,
|
|
5306
|
+
t,
|
|
5307
|
+
renderSlot: owner.renderSlot,
|
|
5308
|
+
renderAccount: () => (0, react.createElement)(react.Suspense, { fallback: (0, react.createElement)("div", {
|
|
5309
|
+
className: "unified-center-loading",
|
|
5310
|
+
role: "status"
|
|
5311
|
+
}, t("centerReading")) }, (0, react.createElement)(AccountCenter, {
|
|
5312
|
+
store: account,
|
|
5313
|
+
t,
|
|
5314
|
+
embedded: true
|
|
5315
|
+
}))
|
|
5316
|
+
}));
|
|
5317
|
+
yield scoped.slots.inject("sidebar.panellist", () => scoped.slots.register({
|
|
5318
|
+
name: "sidebar.panellist",
|
|
5319
|
+
id: ACCOUNT_CENTER_PANEL,
|
|
5320
|
+
order: 5,
|
|
5321
|
+
label: () => t("unifiedTitle"),
|
|
5322
|
+
locale: LOCALE_NAMESPACE
|
|
5323
|
+
}, (owner = {}) => (0, react.createElement)(UnifiedCenterIcon, {
|
|
5324
|
+
navigation: center,
|
|
5325
|
+
t,
|
|
5326
|
+
size: typeof owner.size === "number" ? owner.size : 16
|
|
5327
|
+
})));
|
|
5328
|
+
yield account.setAccountCenterNavigation((page) => {
|
|
5329
|
+
center.openAccountPage(page);
|
|
5330
|
+
});
|
|
5331
|
+
const read = () => {
|
|
5332
|
+
account.consumeAccountCenterNavigation();
|
|
5333
|
+
};
|
|
5334
|
+
yield account.subscribe(read);
|
|
5335
|
+
read();
|
|
5336
|
+
const disposeService = scoped.reflect.provide("vibedevCenter", center.service);
|
|
5337
|
+
yield () => {
|
|
5338
|
+
disposeService();
|
|
5339
|
+
};
|
|
5340
|
+
}), "dsh-vibedev: unified center");
|
|
5341
|
+
});
|
|
2803
5342
|
const section = (order) => disposer(ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
2804
5343
|
name: "settings.section",
|
|
2805
5344
|
id: "vibedev-account",
|