deepseek-harness-wallet 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +4 -3
- package/index.js +43 -13
- package/lib/client.js +690 -142
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -10,11 +10,20 @@ window.__ModuleLoader__.load({
|
|
|
10
10
|
var exports = module.exports
|
|
11
11
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
|
|
12
12
|
var React = require('react')
|
|
13
|
+
var ReactDOM = (function () {
|
|
14
|
+
try {
|
|
15
|
+
if (typeof require === 'function') {
|
|
16
|
+
try { return require('react-dom') } catch (e) { /* ignore */ }
|
|
17
|
+
}
|
|
18
|
+
if (typeof window !== 'undefined' && window.ReactDOM) return window.ReactDOM
|
|
19
|
+
} catch (e) { /* ignore */ }
|
|
20
|
+
return null
|
|
21
|
+
})()
|
|
13
22
|
var useLayoutEffect = React.useLayoutEffect || React.useEffect
|
|
14
23
|
|
|
15
24
|
var POLL_MS = 15000
|
|
16
25
|
// Keep in lockstep with package.json; a test enforces the sync.
|
|
17
|
-
var WALLET_VERSION = '0.2.
|
|
26
|
+
var WALLET_VERSION = '0.2.4'
|
|
18
27
|
var CONFIRM_KEY = 'dsh-wallet-recharge-confirmed'
|
|
19
28
|
var CHIP_LAYOUT_KEY = 'dshw-chip-layout-v4'
|
|
20
29
|
var PANEL_POS_KEY = 'dshw-panel-pos-v1'
|
|
@@ -25,6 +34,11 @@ window.__ModuleLoader__.load({
|
|
|
25
34
|
var SETTINGS_EVENT = 'dshw-settings-change'
|
|
26
35
|
var LOW_BLINK_KEY = 'dshw-low-blink-v1'
|
|
27
36
|
var PEAK_RING_KEY = 'dshw-peakring-v1'
|
|
37
|
+
var PEAK_ORIENT_KEY = 'dshw-peak-orient-v1'
|
|
38
|
+
var PEAK_RECHARGE_KEY = 'dshw-peak-recharge-v1'
|
|
39
|
+
var PEAK_SCALE_KEY = 'dshw-peak-scale-v1'
|
|
40
|
+
var PEAK_DOCK_KEY = 'dshw-peak-dock-v1'
|
|
41
|
+
var PEAK_POS_KEY = 'dshw-peak-pos-v1'
|
|
28
42
|
var CLASSIC_CARD_KEY = 'dshw-classic-card-v1'
|
|
29
43
|
var PEAK_NOTIFY_KEY = 'dshw-peaknotify-v1'
|
|
30
44
|
var PEAK_NOTIFY_LAST_KEY = 'dshw-peaknotify-last-v1'
|
|
@@ -263,12 +277,12 @@ window.__ModuleLoader__.load({
|
|
|
263
277
|
'.dshw_anchorHome{overflow:hidden;min-width:44px}',
|
|
264
278
|
'.dshw_chipLift{z-index:80!important}',
|
|
265
279
|
'.dshw_anchorHome>.dshw_chip{box-sizing:border-box;max-width:100%;min-width:0;overflow:hidden}',
|
|
266
|
-
'.dshw_chip{border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
280
|
+
'.dshw_chip{border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:transparent;height:22px;color:var(--dsw-alias-label-primary,#1f2328);white-space:nowrap;border-radius:999px;align-items:stretch;font-size:12px;line-height:1;display:inline-flex;position:relative;touch-action:none;user-select:none;cursor:grab}',
|
|
267
281
|
'.dshw_chip:hover,.dshw_chip:focus-within{border-color:var(--dsw-alias-brand-primary,#4aa3ff)}',
|
|
268
282
|
'.dshw_chipLow{border-color:var(--dsw-alias-state-error-primary,#e5534b);color:var(--dsw-alias-state-error-primary,#e5534b);animation:dshwChipPulseIn 1.8s ease-in-out infinite}',
|
|
269
283
|
'.dshw_chipLow:hover,.dshw_chipLow:focus-within{border-color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
270
|
-
'.dshw_chipDocked{position:fixed;z-index:79;background:var(--dsw-alias-bg-
|
|
271
|
-
'.dshw_chipDragging{cursor:grabbing;box-shadow:0 6px 18px rgba(0,0,0,.
|
|
284
|
+
'.dshw_chipDocked{position:fixed;z-index:79;background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,#1e1e20));box-shadow:0 2px 10px rgba(0,0,0,.25)}',
|
|
285
|
+
'.dshw_chipDragging{cursor:grabbing;box-shadow:0 6px 18px rgba(0,0,0,.3)}',
|
|
272
286
|
'.dshw_snapPreview{position:fixed;z-index:78;pointer-events:none;box-sizing:border-box;border:2px dashed var(--dsw-alias-brand-primary,#4aa3ff);background:rgba(74,163,255,.10);box-shadow:0 0 0 3px rgba(74,163,255,.10);border-radius:999px;transition:left .06s ease,top .06s ease,width .06s ease,height .06s ease}',
|
|
273
287
|
'.dshw_snapPreviewVertical{border-radius:7px}',
|
|
274
288
|
'.dshw_chipVertical{height:auto;width:40px;min-width:40px;max-width:40px;box-sizing:border-box;overflow:hidden;flex-direction:column;border-radius:7px;align-items:stretch;white-space:normal;font-size:10px;line-height:1.1}',
|
|
@@ -277,7 +291,7 @@ window.__ModuleLoader__.load({
|
|
|
277
291
|
'.dshw_chipVertical .dshw_metricLabel{opacity:.72}',
|
|
278
292
|
'.dshw_chipVertical .dshw_metricValue{font-variant-numeric:tabular-nums}',
|
|
279
293
|
'.dshw_chipVertical .dshw_sep{display:none}',
|
|
280
|
-
'.dshw_chipVertical .dshw_recharge{width:100%;box-sizing:border-box;border-left:0;border-top:1px solid var(--dsw-alias-border-l2,rgba(
|
|
294
|
+
'.dshw_chipVertical .dshw_recharge{width:100%;box-sizing:border-box;border-left:0;border-top:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));padding:3px 1px;justify-content:center;border-radius:0 0 7px 7px}',
|
|
281
295
|
'.dshw_bottomDockHost{box-sizing:border-box!important;padding-bottom:30px!important}',
|
|
282
296
|
'@keyframes dshwChipPulseIn{0%,100%{box-shadow:inset 0 0 0 0 rgba(229,83,75,0)}50%{box-shadow:inset 0 0 0 3px rgba(229,83,75,.32)}}',
|
|
283
297
|
'@keyframes dshwPulse{0%,100%{box-shadow:0 0 0 0 rgba(229,83,75,.45)}50%{box-shadow:0 0 0 5px rgba(229,83,75,0)}}',
|
|
@@ -286,28 +300,28 @@ window.__ModuleLoader__.load({
|
|
|
286
300
|
'.dshw_chipMain{padding:0 7px;border-radius:999px 0 0 999px}',
|
|
287
301
|
'.dshw_chipNoRecharge .dshw_chipMain{border-radius:999px}',
|
|
288
302
|
'.dshw_chipVertical.dshw_chipNoRecharge .dshw_chipMain{border-radius:7px}',
|
|
289
|
-
'.dshw_recharge{color:var(--dsw-alias-brand-primary,#4aa3ff);border-left:1px solid var(--dsw-alias-border-l2,rgba(
|
|
303
|
+
'.dshw_recharge{color:var(--dsw-alias-brand-primary,#4aa3ff);border-left:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));padding:0 7px 0 6px;border-radius:0 999px 999px 0}',
|
|
290
304
|
'.dshw_chipMain:focus-visible,.dshw_recharge:focus-visible,.dshw_btn:focus-visible,.dshw_floatBtn:focus-visible,.dshw_dot:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4aa3ff);outline-offset:2px}',
|
|
291
|
-
'.dshw_panel{z-index:40;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
305
|
+
'.dshw_panel{z-index:40;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));box-sizing:border-box;width:min(276px,calc(100vw - 12px));max-height:calc(100vh - 16px);overflow:auto;color:var(--dsw-alias-label-primary,#1f2328);border-radius:8px;flex-direction:column;gap:4px;padding:8px 9px;font-size:12px;display:flex;position:fixed;box-shadow:0 4px 16px rgba(0,0,0,.35)}',
|
|
292
306
|
'.dshw_panelHeader{min-height:24px;cursor:move;touch-action:none;user-select:none}',
|
|
293
307
|
'.dshw_panelHeader .dshw_btn{cursor:pointer}',
|
|
294
308
|
'.dshw_row{justify-content:space-between;align-items:center;gap:6px;display:flex}',
|
|
295
309
|
'.dshw_row>span:last-child{text-align:right;overflow-wrap:anywhere}',
|
|
296
310
|
'.dshw_title{font-weight:600;opacity:.9}',
|
|
297
|
-
'.dshw_muted{color:var(--dsw-alias-label-tertiary,#
|
|
298
|
-
'.dshw_divider{border-top:1px solid var(--dsw-alias-border-l2,rgba(
|
|
299
|
-
'.dshw_input{background:var(--dsw-alias-bg-layer-1
|
|
311
|
+
'.dshw_muted{color:var(--dsw-alias-label-tertiary,#8b949e)}',
|
|
312
|
+
'.dshw_divider{border-top:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));margin-top:1px;padding-top:4px}',
|
|
313
|
+
'.dshw_input{background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.08)));border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));color:var(--dsw-alias-label-primary,inherit);border-radius:5px;padding:3px 6px;width:56px;font-size:12px}',
|
|
300
314
|
'.dshw_scaleControl{display:flex;align-items:center;gap:7px;min-width:126px;justify-content:flex-end}',
|
|
301
315
|
'.dshw_scaleInput{width:78px;accent-color:var(--dsw-alias-brand-primary,#4aa3ff);cursor:pointer}',
|
|
302
316
|
'.dshw_scaleValue{width:34px;text-align:right;font-variant-numeric:tabular-nums}',
|
|
303
317
|
'.dshw_visibilityControl{display:flex;align-items:center;gap:7px}',
|
|
304
318
|
'.dshw_check{display:inline-flex;align-items:center;gap:4px;cursor:pointer;white-space:nowrap}',
|
|
305
319
|
'.dshw_check input{margin:0;accent-color:var(--dsw-alias-brand-primary,#4aa3ff)}',
|
|
306
|
-
'.dshw_select{background:var(--dsw-alias-bg-layer-1
|
|
307
|
-
'.dshw_btn{border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
320
|
+
'.dshw_select{background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.08)));border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));color:var(--dsw-alias-label-primary,inherit);border-radius:5px;padding:2px 4px;font-size:12px}',
|
|
321
|
+
'.dshw_btn{border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:var(--dsw-alias-bg-layer-1,transparent);color:var(--dsw-alias-label-primary,inherit);border-radius:5px;padding:2px 6px;font-size:12px;cursor:pointer}',
|
|
308
322
|
'.dshw_btnPrimary{background:var(--dsw-alias-brand-primary,#4aa3ff);border-color:transparent;color:var(--dsw-alias-label-primary-foreground,#ffffff)}',
|
|
309
323
|
// ---- v0.2 panel restyle: balance card, settings card, account scroll ----
|
|
310
|
-
'.dshw_balanceCard{margin:2px 0 2px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
324
|
+
'.dshw_balanceCard{margin:2px 0 2px;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));border-radius:8px;background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.06)))}',
|
|
311
325
|
'.dshw_balLine{display:flex;align-items:center;gap:7px;white-space:nowrap}',
|
|
312
326
|
'.dshw_balNum{font-size:18px;font-weight:650;line-height:1.1;letter-spacing:-.01em;font-variant-numeric:tabular-nums}',
|
|
313
327
|
'.dshw_balWarn{display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:999px;background:var(--dsw-alias-state-error-soft,rgba(229,83,75,.12));color:var(--dsw-alias-state-error-primary,#e5534b);font-size:10px;font-weight:500;line-height:16px;white-space:nowrap}',
|
|
@@ -316,109 +330,124 @@ window.__ModuleLoader__.load({
|
|
|
316
330
|
'.dshw_balSession{text-align:right;white-space:nowrap}',
|
|
317
331
|
'.dshw_balSession .dshw_muted{margin-right:5px}',
|
|
318
332
|
'.dshw_balSessionNum{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}',
|
|
319
|
-
'.dshw_balSub{margin-top:4px;font-size:11px;color:var(--dsw-alias-label-secondary,rgba(
|
|
320
|
-
'.dshw_balSub .dshw_balDot{color:var(--dsw-alias-label-
|
|
321
|
-
'.dshw_setCard{border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
322
|
-
'.dshw_setCell{display:flex;align-items:center;gap:8px;padding:6px 9px;min-height:34px}',
|
|
323
|
-
'.dshw_setCell+.dshw_setCell{border-top:1px solid var(--dsw-alias-border-l1,rgba(
|
|
324
|
-
'.dshw_setCell:hover{background:var(--dsw-alias-bg-
|
|
333
|
+
'.dshw_balSub{margin-top:4px;font-size:11px;color:var(--dsw-alias-label-secondary,rgba(127,127,127,.85));display:flex;align-items:center;gap:7px;white-space:nowrap}',
|
|
334
|
+
'.dshw_balSub .dshw_balDot{color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))}',
|
|
335
|
+
'.dshw_setCard{border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));border-radius:8px;background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,transparent));overflow:hidden;margin:2px 0}',
|
|
336
|
+
'.dshw_setCell{display:flex;align-items:center;gap:8px;padding:6px 9px;min-height:34px;color:var(--dsw-alias-label-primary,inherit)}',
|
|
337
|
+
'.dshw_setCell+.dshw_setCell{border-top:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.12))}',
|
|
338
|
+
'.dshw_setCell:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.08))}',
|
|
325
339
|
'.dshw_setCell .dshw_scaleControl{min-width:0;flex:1;justify-content:flex-end}',
|
|
326
|
-
'.dshw_chipToggle{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 9px;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
327
|
-
'.dshw_chipToggle:hover{border-color:var(--dsw-alias-brand-primary,#4aa3ff)}',
|
|
340
|
+
'.dshw_chipToggle{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 9px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));border-radius:999px;background:transparent;font-size:11.5px;color:var(--dsw-alias-label-secondary,inherit);cursor:pointer;white-space:nowrap;transition:color .12s,border-color .12s,background-color .12s}',
|
|
341
|
+
'.dshw_chipToggle:hover{border-color:var(--dsw-alias-brand-primary,#4aa3ff);background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.08))}',
|
|
328
342
|
'.dshw_chipToggle input{margin:0;accent-color:var(--dsw-alias-brand-primary,#4aa3ff)}',
|
|
329
|
-
'.dshw_acctScroll{border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
343
|
+
'.dshw_acctScroll{border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));border-radius:8px;overflow-y:auto;max-height:58px;scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l3,rgba(127,127,127,.35)) transparent;margin:2px 0}',
|
|
330
344
|
'.dshw_acctScroll::-webkit-scrollbar{width:6px}',
|
|
331
|
-
'.dshw_acctScroll::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l3,rgba(
|
|
345
|
+
'.dshw_acctScroll::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l3,rgba(127,127,127,.35));border-radius:3px}',
|
|
332
346
|
'.dshw_acctScroll .dshw_row{padding:2px 6px}',
|
|
333
347
|
'.dshw_balanceCard.dshw_low{border-color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
334
348
|
'.dshw_balanceCard.dshw_low .dshw_balNum{color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
335
|
-
'.dshw_chipLow .dshw_chipMain>span:not(.dshw_homePrimary):not(.dshw_sep){color:var(--dsw-alias-label-primary
|
|
349
|
+
'.dshw_chipLow .dshw_chipMain>span:not(.dshw_homePrimary):not(.dshw_sep){color:var(--dsw-alias-label-primary,inherit)}',
|
|
336
350
|
'.dshw_chipLow .dshw_thirdText .dshw_homePrimaryValue{color:inherit}',
|
|
337
|
-
'.dshw_chipLow .dshw_balanceText .dshw_homePrimaryLabel{color:var(--dsw-alias-label-primary
|
|
351
|
+
'.dshw_chipLow .dshw_balanceText .dshw_homePrimaryLabel{color:var(--dsw-alias-label-primary,inherit)!important}',
|
|
338
352
|
'.dshw_chipLow .dshw_balanceText .dshw_homePrimaryValue{color:var(--dsw-alias-state-error-primary,#e5534b)!important}',
|
|
339
|
-
'.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:not(:first-child) .dshw_metricLabel,.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:not(:first-child) .dshw_metricValue{color:var(--dsw-alias-label-primary
|
|
353
|
+
'.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:not(:first-child) .dshw_metricLabel,.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:not(:first-child) .dshw_metricValue{color:var(--dsw-alias-label-primary,inherit)}',
|
|
340
354
|
'.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:first-child .dshw_metricValue{color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
341
|
-
'.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:first-child .dshw_metricLabel{color:var(--dsw-alias-label-primary
|
|
355
|
+
'.dshw_chipLow.dshw_chipVertical .dshw_chipMain>.dshw_metric:first-child .dshw_metricLabel{color:var(--dsw-alias-label-primary,inherit)}',
|
|
342
356
|
'.dshw_chipLow.dshw_noBlink{animation:none}',
|
|
343
|
-
'.dshw_acctMore{display:flex;justify-content:flex-end;font-size:10.5px;color:var(--dsw-alias-label-
|
|
357
|
+
'.dshw_acctMore{display:flex;justify-content:flex-end;font-size:10.5px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e));margin-top:3px}',
|
|
344
358
|
''.trim() || '.dshw_acctRow{display:flex;align-items:center;gap:5px;padding:2px 6px;min-height:26px}',
|
|
345
|
-
'.dshw_acctRow+.dshw_acctRow{border-top:1px solid var(--dsw-alias-border-l1,rgba(
|
|
359
|
+
'.dshw_acctRow+.dshw_acctRow{border-top:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.12))}',
|
|
346
360
|
'.dshw_acctRow.current{background:var(--dsw-alias-brand-soft,rgba(74,163,255,.10))}',
|
|
347
361
|
'.dshw_acctAvatar{flex:none;width:18px;height:18px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:650;user-select:none}',
|
|
348
362
|
'.dshw_acctInfo{flex:1;min-width:0;display:flex;align-items:center;gap:6px}',
|
|
349
363
|
'.dshw_acctName{font-size:11.5px;font-weight:550;color:var(--dsw-alias-label-primary,inherit);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:0 1 auto}',
|
|
350
364
|
'.dshw_acctBadge{flex:none;font-size:9.5px;color:var(--dsw-alias-brand-primary,#4aa3ff);border:1px solid var(--dsw-alias-brand-primary,#4aa3ff);border-radius:4px;padding:0 4px;line-height:14px;opacity:.85}',
|
|
351
|
-
'.dshw_acctKey{font-family:ui-monospace,Consolas,monospace;font-size:10px;color:var(--dsw-alias-label-
|
|
365
|
+
'.dshw_acctKey{font-family:ui-monospace,Consolas,monospace;font-size:10px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto}',
|
|
352
366
|
'.dshw_acctNow{flex:none;padding:1px 7px;border-radius:999px;background:var(--dsw-alias-brand-soft,rgba(74,163,255,.14));color:var(--dsw-alias-brand-primary,#4aa3ff);font-size:10.5px;font-weight:550;line-height:16px}',
|
|
353
|
-
'.dshw_settingsSection .dshw_setCard{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--dsw-alias-border-l1,rgba(
|
|
354
|
-
'.dshw_settingsSection .dshw_setCell{background:var(--dsw-alias-bg-
|
|
355
|
-
'.dshw_settingsSection .dshw_setCell:hover{background:var(--dsw-alias-bg-
|
|
367
|
+
'.dshw_settingsSection .dshw_setCard{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--dsw-alias-border-l1,rgba(127,127,127,.12))}',
|
|
368
|
+
'.dshw_settingsSection .dshw_setCell{background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,transparent));border-top:none!important;padding:8px 10px}',
|
|
369
|
+
'.dshw_settingsSection .dshw_setCell:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.08))}',
|
|
356
370
|
'.dshw_settingsSection .dshw_setCell.wide{grid-column:1/-1}',
|
|
357
371
|
'.dshw_settingsSection{--dshw-card-radius:11px;max-width:900px;gap:12px!important}',
|
|
358
372
|
'.dshw_settingsHeader{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}',
|
|
359
|
-
'.dshw_settingsHeading{font-size:16px;font-weight:650;letter-spacing:-.01em}',
|
|
360
|
-
'.dshw_settingsLead{margin-top:2px;font-size:11.5px;color:var(--dsw-alias-label-tertiary,#
|
|
361
|
-
'.dshw_versionBadge{flex:none;padding:2px 7px;border-radius:999px;background:var(--dsw-alias-bg-
|
|
362
|
-
'.dshw_settingsHero{border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
373
|
+
'.dshw_settingsHeading{font-size:16px;font-weight:650;letter-spacing:-.01em;color:var(--dsw-alias-label-primary,inherit)}',
|
|
374
|
+
'.dshw_settingsLead{margin-top:2px;font-size:11.5px;color:var(--dsw-alias-label-tertiary,#8b949e)}',
|
|
375
|
+
'.dshw_versionBadge{flex:none;padding:2px 7px;border-radius:999px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,rgba(127,127,127,.1)));color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e));font-size:10px}',
|
|
376
|
+
'.dshw_settingsHero{border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));border-radius:var(--dshw-card-radius);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.05)));color:var(--dsw-alias-label-primary,inherit);padding:13px 15px}',
|
|
363
377
|
'.dshw_settingsHero.dshw_low{border-color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
364
378
|
'.dshw_settingsHeroTop{display:flex;align-items:center;gap:8px}',
|
|
365
|
-
'.dshw_settingsHeroLabel{font-size:11.5px;color:var(--dsw-alias-label-tertiary,#
|
|
366
|
-
'.dshw_accountPill{display:inline-flex;align-items:center;max-width:180px;padding:2px 7px;border-radius:999px;background:var(--dsw-alias-brand-soft,rgba(74,163,255,.10));color:var(--dsw-alias-label-secondary,
|
|
379
|
+
'.dshw_settingsHeroLabel{font-size:11.5px;color:var(--dsw-alias-label-tertiary,#8b949e)}',
|
|
380
|
+
'.dshw_accountPill{display:inline-flex;align-items:center;max-width:180px;padding:2px 7px;border-radius:999px;background:var(--dsw-alias-brand-soft,rgba(74,163,255,.10));color:var(--dsw-alias-label-secondary,inherit);font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
367
381
|
'.dshw_settingsHeroMain{display:flex;align-items:flex-end;gap:18px;margin-top:7px}',
|
|
368
382
|
'.dshw_settingsBalance{font-size:28px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.025em}',
|
|
369
383
|
'.dshw_settingsHero.dshw_low .dshw_settingsBalance{color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
370
384
|
'.dshw_settingsSpend{display:flex;flex-direction:column;gap:2px;padding-bottom:1px}',
|
|
371
385
|
'.dshw_settingsSpend strong{font-size:14px;font-variant-numeric:tabular-nums}',
|
|
372
|
-
'.dshw_settingsHeroMeta{display:flex;align-items:center;gap:7px;margin-top:9px;color:var(--dsw-alias-label-tertiary,#
|
|
386
|
+
'.dshw_settingsHeroMeta{display:flex;align-items:center;gap:7px;margin-top:9px;color:var(--dsw-alias-label-tertiary,#8b949e);font-size:11px;white-space:nowrap}',
|
|
373
387
|
'.dshw_settingsGrid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}',
|
|
374
388
|
'.dshw_settingsSection .dshw_setCard{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;border:0;background:transparent;overflow:visible}',
|
|
375
|
-
'.dshw_settingsSection .dshw_setCard>.dshw_setCell{min-width:0;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
376
|
-
'.dshw_settingsSection .dshw_setCard>.dshw_setCell:hover{background:var(--dsw-alias-bg-
|
|
389
|
+
'.dshw_settingsSection .dshw_setCard>.dshw_setCell{min-width:0;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2))!important;border-radius:var(--dshw-card-radius);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.05)));padding:11px 12px;color:var(--dsw-alias-label-primary,inherit)}',
|
|
390
|
+
'.dshw_settingsSection .dshw_setCard>.dshw_setCell:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-1,rgba(127,127,127,.09)))}',
|
|
377
391
|
'.dshw_settingsSection .dshw_setCard>.dshw_setCell.wide{grid-column:1/-1}',
|
|
378
392
|
'.dshw_reminderCard{display:block!important;padding:0!important;overflow:hidden}',
|
|
379
|
-
'.dshw_settingsGroup{min-width:0;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
380
|
-
'.dshw_settingsGroupHeader{padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l1,rgba(
|
|
381
|
-
'.dshw_settingsGroupTitle{font-size:12px;font-weight:650}',
|
|
382
|
-
'.dshw_settingsGroupHint{margin-top:2px;color:var(--dsw-alias-label-
|
|
393
|
+
'.dshw_settingsGroup{min-width:0;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));border-radius:var(--dshw-card-radius);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.05)));overflow:hidden;color:var(--dsw-alias-label-primary,inherit)}',
|
|
394
|
+
'.dshw_settingsGroupHeader{padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.12))}',
|
|
395
|
+
'.dshw_settingsGroupTitle{font-size:12px;font-weight:650;color:var(--dsw-alias-label-primary,inherit)}',
|
|
396
|
+
'.dshw_settingsGroupHint{margin-top:2px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e));font-size:10.5px}',
|
|
383
397
|
'.dshw_settingsField{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;padding:8px 12px}',
|
|
384
|
-
'.dshw_settingsField+.dshw_settingsField{border-top:1px solid var(--dsw-alias-border-l1,rgba(
|
|
398
|
+
'.dshw_settingsField+.dshw_settingsField{border-top:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.1))}',
|
|
385
399
|
'.dshw_settingsFieldLabel{display:flex;min-width:0;flex-direction:column;gap:2px}',
|
|
386
|
-
'.dshw_settingsFieldLabel>strong{font-size:11.5px;font-weight:550}',
|
|
387
|
-
'.dshw_settingsFieldLabel>span{font-size:10px;color:var(--dsw-alias-label-
|
|
400
|
+
'.dshw_settingsFieldLabel>strong{font-size:11.5px;font-weight:550;color:var(--dsw-alias-label-primary,inherit)}',
|
|
401
|
+
'.dshw_settingsFieldLabel>span{font-size:10px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))}',
|
|
388
402
|
'.dshw_settingsInline{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0}',
|
|
389
403
|
'.dshw_settingsInline .dshw_input{height:26px;box-sizing:border-box}',
|
|
390
404
|
'.dshw_settingsInline .dshw_select{height:26px}',
|
|
391
405
|
'.dshw_settingChoices{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:9px 12px}',
|
|
392
|
-
'.dshw_settingChoice{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:7px 9px;border:1px solid var(--dsw-alias-border-l1,rgba(
|
|
406
|
+
'.dshw_settingChoice{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:7px 9px;border:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.15));border-radius:8px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,rgba(127,127,127,.04)));color:var(--dsw-alias-label-primary,inherit)}',
|
|
407
|
+
'.dshw_settingChoice:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.08))}',
|
|
393
408
|
'.dshw_settingChoiceCopy{min-width:0;display:flex;flex-direction:column;gap:1px}',
|
|
394
|
-
'.dshw_settingChoiceCopy strong{font-size:11px;font-weight:550;white-space:nowrap}',
|
|
395
|
-
'.dshw_settingChoiceCopy span{font-size:9.5px;color:var(--dsw-alias-label-
|
|
409
|
+
'.dshw_settingChoiceCopy strong{font-size:11px;font-weight:550;white-space:nowrap;color:var(--dsw-alias-label-primary,inherit)}',
|
|
410
|
+
'.dshw_settingChoiceCopy span{font-size:9.5px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
396
411
|
'.dshw_switch{position:relative;flex:none;width:34px;height:20px;display:inline-flex;cursor:pointer}',
|
|
397
412
|
'.dshw_switch>input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}',
|
|
398
|
-
'.dshw_track{position:absolute;inset:0;border-radius:999px;background:var(--dsw-alias-border-l3,rgba(
|
|
399
|
-
'.dshw_knob{position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:var(--dsw-alias-bg-
|
|
413
|
+
'.dshw_track{position:absolute;inset:0;border-radius:999px;background:var(--dsw-alias-border-l3,rgba(127,127,127,.3));transition:background-color .15s}',
|
|
414
|
+
'.dshw_knob{position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:var(--dsw-alias-bg-layer-1,#fff);box-shadow:0 1px 3px rgba(0,0,0,.24);transition:transform .15s}',
|
|
400
415
|
'.dshw_switch>input:checked+.dshw_track{background:var(--dsw-alias-brand-primary,#4aa3ff)}',
|
|
401
416
|
'.dshw_switch>input:checked~.dshw_knob{transform:translateX(14px)}',
|
|
402
417
|
'.dshw_switch>input:focus-visible+.dshw_track{outline:2px solid var(--dsw-alias-brand-primary,#4aa3ff);outline-offset:2px}',
|
|
403
418
|
'.dshw_switch>input:disabled+.dshw_track{opacity:.38}.dshw_switch>input:disabled~.dshw_knob{opacity:.7}',
|
|
404
419
|
'.dshw_accountHeader{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:2px}',
|
|
405
|
-
'.dshw_accountCount{font-size:10.5px;color:var(--dsw-alias-label-
|
|
420
|
+
'.dshw_accountCount{font-size:10.5px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))}',
|
|
406
421
|
'.dshw_settingsSection .dshw_acctScroll{max-height:150px;margin:0;border-radius:var(--dshw-card-radius)}',
|
|
407
422
|
'.dshw_settingsSection .dshw_acctRow{min-height:38px;padding:6px 9px;gap:8px}',
|
|
408
423
|
'.dshw_settingsSection .dshw_acctAvatar{width:24px;height:24px;font-size:11px}',
|
|
409
424
|
'.dshw_settingsSection .dshw_acctInfo{align-items:flex-start;flex-direction:column;gap:1px}',
|
|
410
425
|
'.dshw_settingsSection .dshw_acctName{font-size:11.5px}',
|
|
411
426
|
'.dshw_settingsSection .dshw_acctKey{font-size:9.5px}',
|
|
412
|
-
'.dshw_accountAdd{display:grid;grid-template-columns:120px minmax(150px,1fr) auto;gap:6px;padding:9px;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
427
|
+
'.dshw_accountAdd{display:grid;grid-template-columns:120px minmax(150px,1fr) auto;gap:6px;padding:9px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.2));border-radius:var(--dshw-card-radius);background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,rgba(127,127,127,.04)))}',
|
|
413
428
|
'.dshw_accountAdd .dshw_input{box-sizing:border-box;width:100%;height:28px}',
|
|
414
429
|
'.dshw_settingsFooter{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:2px}',
|
|
415
430
|
'.dshw_settingsFooterActions{display:flex;align-items:center;gap:7px}',
|
|
416
431
|
'.dshw_settingsFooter .dshw_btn{height:30px;padding:0 14px}',
|
|
417
|
-
'.dshw_footRing{width:100%;box-sizing:border-box;display:flex;align-items:center;gap:
|
|
418
|
-
'.dshw_footRing:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(
|
|
432
|
+
'.dshw_footRing{width:100%;box-sizing:border-box;display:flex;align-items:center;gap:8px;margin:2px 0 8px;padding:7px 9px;border:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.18));border-radius:11px;background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.04)));color:var(--dsw-alias-label-primary,inherit);font-size:12.5px;cursor:grab;user-select:none;touch-action:none;transition:border-color .15s ease,background-color .15s ease}',
|
|
433
|
+
'.dshw_footRing:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.1));border-color:var(--dsw-alias-border-l2,rgba(127,127,127,.28))}',
|
|
419
434
|
'.dshw_footRing.dshw_low{border-color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
420
435
|
'.dshw_footRingRail{width:42px;height:42px;min-height:42px;margin:3px 0 6px;padding:0;justify-content:center;border-radius:50%;background:transparent;border:none;cursor:pointer}',
|
|
421
|
-
'.dshw_footRingRail:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(
|
|
436
|
+
'.dshw_footRingRail:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.1))}',
|
|
437
|
+
'.dshw_footRingVertical{flex-direction:column;align-items:center;text-align:center;width:fit-content;min-width:132px;max-width:152px;margin:2px auto 8px;padding:8px 8px;gap:4px;overflow:visible}',
|
|
438
|
+
'.dshw_footRingVertical .dshw_footRingLabel{align-items:center;text-align:center;width:100%;gap:3px;overflow:visible}',
|
|
439
|
+
'.dshw_footRingVertical .dshw_footRingHeader{justify-content:center}',
|
|
440
|
+
'.dshw_footRingVertical .dshw_footRingTitle{font-size:13px}',
|
|
441
|
+
'.dshw_footRingVertical .dshw_footRingMoney{justify-content:center;font-size:11px;overflow:visible;white-space:nowrap;width:100%}',
|
|
442
|
+
'.dshw_footRingVertical .dshw_footRingCountdown{font-size:10.5px;overflow:visible;white-space:nowrap}',
|
|
443
|
+
'.dshw_footRingVertical .dshw_footRingBottom{justify-content:center}',
|
|
444
|
+
'.dshw_footRingNoRecharge{padding-right:10px}',
|
|
445
|
+
'.dshw_footRingFloating{position:fixed;z-index:90;width:auto;min-width:180px;max-width:260px;margin:0!important;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));box-shadow:0 8px 24px rgba(0,0,0,.35);cursor:grab;touch-action:none}',
|
|
446
|
+
'.dshw_footRingFloating.dshw_footRingVertical{min-width:132px;max-width:152px;width:140px;padding:9px 8px;gap:4px}',
|
|
447
|
+
'.dshw_footRingFloating.dshw_footRingVertical .dshw_footRingResetBtn{position:absolute;top:4px;right:4px;font-size:9.5px;padding:1px 5px;line-height:13px}',
|
|
448
|
+
'.dshw_footRingFloating.dshw_footRingDragging{cursor:grabbing;box-shadow:0 10px 30px rgba(0,0,0,.45)}',
|
|
449
|
+
'.dshw_footRingResetBtn{position:absolute;top:4px;right:6px;font-size:10px;padding:1px 6px;border-radius:4px;border:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.2));background:var(--dsw-alias-bg-layer-2,transparent);color:var(--dsw-alias-label-tertiary,#8b949e);cursor:pointer;line-height:14px}',
|
|
450
|
+
'.dshw_footRingResetBtn:hover{color:var(--dsw-alias-label-primary,inherit);border-color:var(--dsw-alias-brand-primary,#4aa3ff)}',
|
|
422
451
|
'.dshw_footRingLabel{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:3px;overflow:hidden}',
|
|
423
452
|
'.dshw_footRingHeader{display:flex;align-items:center;gap:6px;white-space:nowrap}',
|
|
424
453
|
'.dshw_footRingTitle{font-size:13.5px;font-weight:700;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
@@ -427,35 +456,40 @@ window.__ModuleLoader__.load({
|
|
|
427
456
|
'.dshw_footRingBadgeOff{background:var(--dsw-alias-state-success-soft,rgba(26,127,55,.12));color:var(--dsw-alias-state-success-primary,#1a7f37)}',
|
|
428
457
|
'.dshw_footRingMoney{font-size:12.5px;font-variant-numeric:tabular-nums;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}',
|
|
429
458
|
'.dshw_footRingMoney.dshw_low .dshw_footBalNum{color:var(--dsw-alias-state-error-primary,#e5534b);font-weight:700}',
|
|
430
|
-
'.
|
|
431
|
-
'.
|
|
432
|
-
'.
|
|
433
|
-
'.
|
|
459
|
+
'.dshw_footRingBottom{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;min-height:18px}',
|
|
460
|
+
'.dshw_footRingCountdown{font-size:11px;color:var(--dsw-alias-label-secondary,rgba(127,127,127,.85));line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}',
|
|
461
|
+
'.dshw_footRingBtnRechargeInline{border:1px solid var(--dsw-alias-brand-primary,#4aa3ff);background:var(--dsw-alias-brand-soft,rgba(74,163,255,.10));color:var(--dsw-alias-brand-primary,#4aa3ff);border-radius:4px;height:18px;padding:0 6px;font-size:10.5px;font-weight:600;line-height:16px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .15s ease;user-select:none;flex:none}',
|
|
462
|
+
'.dshw_footRingBtnRechargeInline:hover{background:var(--dsw-alias-brand-primary,#4aa3ff);color:#fff}',
|
|
463
|
+
'.dshw_peakPanel{position:fixed;z-index:95;width:290px;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));color:var(--dsw-alias-label-primary,inherit);border-radius:12px;box-shadow:0 10px 32px rgba(0,0,0,.38);display:flex;flex-direction:column;gap:8px;padding:12px 14px;font-size:12px;user-select:none;touch-action:none}',
|
|
464
|
+
'.dshw_peakPanelHeader{display:flex;align-items:center;justify-content:space-between;font-weight:650;font-size:12.5px;color:var(--dsw-alias-label-primary,inherit)}',
|
|
465
|
+
'.dshw_peakPanelClose{border:none;background:transparent;color:inherit;font-size:16px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:4px}',
|
|
466
|
+
'.dshw_peakPanelClose:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.12))}',
|
|
467
|
+
'.dshw_peakStatusCard{padding:8px 10px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.15));background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base,rgba(127,127,127,.05)));display:flex;flex-direction:column;gap:3px}',
|
|
468
|
+
'.dshw_peakRow{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:26px}',
|
|
434
469
|
'.dshw_ringPeak{stroke:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
435
470
|
'.dshw_ringOff{stroke:var(--dsw-alias-state-success-primary,#1a7f37)}',
|
|
436
|
-
'.dshw_ringNeutral{stroke:var(--dsw-alias-border-l3,rgba(
|
|
471
|
+
'.dshw_ringNeutral{stroke:var(--dsw-alias-border-l3,rgba(127,127,127,.3))}',
|
|
437
472
|
'.dshw_peakRing circle{transition:stroke-width .3s ease}',
|
|
438
473
|
'.dshw_ringNow{stroke-width:6;filter:brightness(1.15)}',
|
|
439
474
|
'.dshw_ringPointer{fill:var(--dsw-alias-label-primary,#1f2328)}',
|
|
440
|
-
'.dshw_ringTick{fill:var(--dsw-alias-label-
|
|
475
|
+
'.dshw_ringTick{fill:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))}',
|
|
441
476
|
'@media (max-width:760px){.dshw_settingsGrid,.dshw_settingsSection .dshw_setCard{grid-template-columns:1fr}.dshw_settingsSection .dshw_setCard>.dshw_setCell.wide{grid-column:1}.dshw_accountAdd{grid-template-columns:1fr}.dshw_settingsFooter{align-items:flex-start;flex-direction:column-reverse}.dshw_settingsFooterActions{width:100%}.dshw_settingsFooterActions .dshw_btn{flex:1}.dshw_settingsHeroMeta{white-space:normal;flex-wrap:wrap}}',
|
|
442
477
|
'.dshw_actionRow{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:2px 0}',
|
|
443
|
-
'.dshw_textDanger{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 4px;border:none;background:transparent;font:inherit;font-size:11px;color:var(--dsw-alias-label-
|
|
478
|
+
'.dshw_textDanger{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 4px;border:none;background:transparent;font:inherit;font-size:11px;color:var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e));cursor:pointer;border-radius:4px;transition:color .12s,background-color .12s}',
|
|
444
479
|
'.dshw_textDanger:hover{color:var(--dsw-alias-state-error-primary,#e5534b);background:var(--dsw-alias-state-error-soft,rgba(229,83,75,.12))}',
|
|
445
480
|
'.dshw_overlay{position:fixed;inset:0;background:var(--dsw-alias-bg-mask-drop,rgba(0,0,0,.55));display:flex;align-items:center;justify-content:center;z-index:100}',
|
|
446
|
-
'.dshw_overlayBox{background:var(--dsw-alias-bg-
|
|
481
|
+
'.dshw_overlayBox{background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));color:var(--dsw-alias-label-primary,#1f2328);border-radius:8px;padding:14px 18px;width:min(320px,calc(100vw - 32px));box-sizing:border-box;font-size:13px;line-height:1.7}',
|
|
447
482
|
'.dshw_overlayRow{margin-top:10px;display:flex;gap:8px;justify-content:flex-end}',
|
|
448
|
-
|
|
449
|
-
'.dshw_float{position:fixed;z-index:80;min-width:230px;max-width:280px;border:1px solid var(--dsw-alias-border-l2,rgba(0,0,0,.15));background:var(--dsw-alias-bg-overlay,#fff);color:var(--dsw-alias-label-primary,#1f2328);border-radius:12px;box-shadow:0 6px 20px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:6px;padding:10px 12px;font-size:12px;user-select:none}',
|
|
483
|
+
'.dshw_float{position:fixed;z-index:80;min-width:230px;max-width:280px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));color:var(--dsw-alias-label-primary,#1f2328);border-radius:12px;box-shadow:0 6px 20px rgba(0,0,0,.25);display:flex;flex-direction:column;gap:6px;padding:10px 12px;font-size:12px;user-select:none}',
|
|
450
484
|
'.dshw_floatHeader{display:flex;align-items:center;justify-content:space-between;cursor:move;font-weight:600;opacity:.9;touch-action:none}',
|
|
451
|
-
'.dshw_floatBtn{border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
452
|
-
'.dshw_floatBtn:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(
|
|
453
|
-
'.dshw_dot{position:fixed;z-index:80;width:36px;height:36px;border-radius:50%;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
485
|
+
'.dshw_floatBtn{border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:transparent;color:inherit;border-radius:5px;width:22px;height:20px;font-size:12px;line-height:1;cursor:pointer;padding:0}',
|
|
486
|
+
'.dshw_floatBtn:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.1))}',
|
|
487
|
+
'.dshw_dot{position:fixed;z-index:80;width:36px;height:36px;border-radius:50%;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));color:var(--dsw-alias-label-primary,#1f2328);font-size:11px;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.25);user-select:none;touch-action:none}',
|
|
454
488
|
'.dshw_dotLow{border-color:var(--dsw-alias-state-error-primary,#e5534b);color:var(--dsw-alias-state-error-primary,#e5534b)}',
|
|
455
489
|
'.dshw_noticeStack{position:fixed;z-index:120;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:min(340px,calc(100vw - 24px));display:flex;flex-direction:column;gap:8px;pointer-events:none}',
|
|
456
|
-
'.dshw_notice{box-sizing:border-box;width:100%;display:flex;align-items:flex-start;gap:8px;padding:10px 10px 10px 12px;border:1px solid var(--dsw-alias-border-l2,rgba(
|
|
490
|
+
'.dshw_notice{box-sizing:border-box;width:100%;display:flex;align-items:flex-start;gap:8px;padding:10px 10px 10px 12px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.25));border-radius:9px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1,#21262d));color:var(--dsw-alias-label-primary,#1f2328);box-shadow:0 6px 20px rgba(0,0,0,.25);font-size:12px;line-height:1.45;pointer-events:auto;cursor:pointer}',
|
|
457
491
|
'.dshw_noticeCopy{min-width:0;display:flex;flex:1;flex-direction:column;gap:2px}.dshw_noticeCopy span{white-space:pre-line;overflow-wrap:anywhere}',
|
|
458
|
-
'.dshw_noticeClose{flex:none;width:24px;height:24px;border:0;border-radius:5px;background:transparent;color:inherit;font-size:18px;line-height:1;cursor:pointer}.dshw_noticeClose:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(
|
|
492
|
+
'.dshw_noticeClose{flex:none;width:24px;height:24px;border:0;border-radius:5px;background:transparent;color:inherit;font-size:18px;line-height:1;cursor:pointer}.dshw_noticeClose:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.1))}',
|
|
459
493
|
// Home-fit and compact modes are toggled by measured space (see the
|
|
460
494
|
// home-space effect in WalletChip), not by container queries:
|
|
461
495
|
// container-type:inline-size on a content-sized flex item detaches its
|
|
@@ -599,6 +633,32 @@ window.__ModuleLoader__.load({
|
|
|
599
633
|
}
|
|
600
634
|
}
|
|
601
635
|
|
|
636
|
+
function selectBalanceInfo(balance) {
|
|
637
|
+
if (!balance || !Array.isArray(balance.balances) || balance.balances.length === 0) return null
|
|
638
|
+
var currency = typeof balance.currency === 'string' ? balance.currency.toUpperCase() : null
|
|
639
|
+
if (currency) {
|
|
640
|
+
var matching = balance.balances.find(function (info) {
|
|
641
|
+
return info && typeof info.currency === 'string' && info.currency.toUpperCase() === currency
|
|
642
|
+
})
|
|
643
|
+
if (matching) return matching
|
|
644
|
+
}
|
|
645
|
+
return balance.balances[0]
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
function balanceErrorText(error) {
|
|
649
|
+
switch (error) {
|
|
650
|
+
case 'no-credentials': return '宿主凭证服务不可用'
|
|
651
|
+
case 'no-api-key': return '未配置 DeepSeek API Key'
|
|
652
|
+
case 'unauthorized': return 'API Key 无效或已过期'
|
|
653
|
+
case 'rate-limited': return '余额接口请求过于频繁'
|
|
654
|
+
case 'timeout': return '余额接口请求超时'
|
|
655
|
+
case 'invalid-response': return '余额接口返回无效数据'
|
|
656
|
+
case 'balance-unavailable': return '余额暂不可用'
|
|
657
|
+
case 'upstream-unavailable': return '余额接口暂时不可用'
|
|
658
|
+
default: return '余额暂不可用'
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
602
662
|
function computePanelPosition(chipRect, panelRect, viewportWidth, viewportHeight) {
|
|
603
663
|
var margin = 8
|
|
604
664
|
var gap = 6
|
|
@@ -664,6 +724,11 @@ window.__ModuleLoader__.load({
|
|
|
664
724
|
function normalizeNotifyConfig(value) {
|
|
665
725
|
var enabled = !value || value.enabled !== false
|
|
666
726
|
var timeout = value && Number.parseInt(value.timeout, 10)
|
|
727
|
+
// Migrate the brief settings-page schema that stored milliseconds under
|
|
728
|
+
// autoCloseMs. The canonical shared shape is { enabled, timeout }.
|
|
729
|
+
if ([0, 5, 10, 30, 60].indexOf(timeout) === -1 && value && Object.hasOwn(value, 'autoCloseMs')) {
|
|
730
|
+
timeout = value.autoCloseMs === null ? 0 : Math.round(Number(value.autoCloseMs) / 1000)
|
|
731
|
+
}
|
|
667
732
|
if ([0, 5, 10, 30, 60].indexOf(timeout) === -1) timeout = 10
|
|
668
733
|
return { enabled: enabled, timeout: timeout }
|
|
669
734
|
}
|
|
@@ -722,7 +787,7 @@ window.__ModuleLoader__.load({
|
|
|
722
787
|
}
|
|
723
788
|
var item = active.item
|
|
724
789
|
var remaining = queue.length
|
|
725
|
-
var body = item.title + (remaining > 0 ? '\n另有 ' + remaining + ' 个对话等待提醒' : '\n点击打开该对话')
|
|
790
|
+
var body = item.title + (remaining > 0 ? '\r\n另有 ' + remaining + ' 个对话等待提醒' : '\r\n点击打开该对话')
|
|
726
791
|
if (active.timer !== null) clearTimeout(active.timer)
|
|
727
792
|
if (active.notification) {
|
|
728
793
|
active.notification.onclose = null
|
|
@@ -1051,7 +1116,7 @@ window.__ModuleLoader__.load({
|
|
|
1051
1116
|
var [notifyEnabled, setNotifyEnabled] = React.useState(function () { return readNotifyConfig().enabled })
|
|
1052
1117
|
var [notifyTimeout, setNotifyTimeout] = React.useState(function () {
|
|
1053
1118
|
var cfg = readNotifyConfig()
|
|
1054
|
-
return cfg.
|
|
1119
|
+
return cfg.timeout === 0 ? 'keep' : String(cfg.timeout)
|
|
1055
1120
|
})
|
|
1056
1121
|
var [lowBlinkEnabled, setLowBlinkEnabled] = React.useState(function () {
|
|
1057
1122
|
try { return compatibility.storage.getItem(LOW_BLINK_KEY) !== 'false' } catch (e) { return true }
|
|
@@ -1068,6 +1133,21 @@ window.__ModuleLoader__.load({
|
|
|
1068
1133
|
var [peakNotifyEnabled, setPeakNotifyEnabled] = React.useState(function () {
|
|
1069
1134
|
try { return compatibility.storage.getItem(PEAK_NOTIFY_KEY) === 'true' } catch (e) { return false }
|
|
1070
1135
|
})
|
|
1136
|
+
var [peakOrient, setPeakOrient] = React.useState(function () {
|
|
1137
|
+
try { return compatibility.storage.getItem(PEAK_ORIENT_KEY) || 'horizontal' } catch (e) { return 'horizontal' }
|
|
1138
|
+
})
|
|
1139
|
+
var [peakRecharge, setPeakRecharge] = React.useState(function () {
|
|
1140
|
+
try { return compatibility.storage.getItem(PEAK_RECHARGE_KEY) !== 'false' } catch (e) { return true }
|
|
1141
|
+
})
|
|
1142
|
+
var [peakScale, setPeakScale] = React.useState(function () {
|
|
1143
|
+
try {
|
|
1144
|
+
var val = Number.parseFloat(compatibility.storage.getItem(PEAK_SCALE_KEY))
|
|
1145
|
+
return Number.isFinite(val) ? Math.min(1.2, Math.max(1.0, val)) : 1.0
|
|
1146
|
+
} catch (e) { return 1.0 }
|
|
1147
|
+
})
|
|
1148
|
+
var [peakDock, setPeakDock] = React.useState(function () {
|
|
1149
|
+
try { return compatibility.storage.getItem(PEAK_DOCK_KEY) || 'sidebar' } catch (e) { return 'sidebar' }
|
|
1150
|
+
})
|
|
1071
1151
|
React.useEffect(function () {
|
|
1072
1152
|
if (typeof window.addEventListener !== 'function') return
|
|
1073
1153
|
function refreshCap() { setPdSupported(compatibility.hasCapability('permanentDelete')) }
|
|
@@ -1120,13 +1200,13 @@ window.__ModuleLoader__.load({
|
|
|
1120
1200
|
}
|
|
1121
1201
|
|
|
1122
1202
|
function persistNotify(enabled, timeout) {
|
|
1123
|
-
var
|
|
1124
|
-
if (
|
|
1203
|
+
var timeoutSeconds = timeout === 'keep' ? 0 : Number.parseInt(timeout, 10)
|
|
1204
|
+
if ([0, 5, 10, 30, 60].indexOf(timeoutSeconds) === -1) timeoutSeconds = 10
|
|
1125
1205
|
try {
|
|
1126
|
-
compatibility.storage.setItem(NOTIFY_CONFIG_KEY, JSON.stringify({ enabled: enabled,
|
|
1206
|
+
compatibility.storage.setItem(NOTIFY_CONFIG_KEY, JSON.stringify({ enabled: enabled, timeout: timeoutSeconds }))
|
|
1127
1207
|
} catch (e) { /* ignore */ }
|
|
1128
1208
|
setNotifyEnabled(enabled)
|
|
1129
|
-
setNotifyTimeout(
|
|
1209
|
+
setNotifyTimeout(timeoutSeconds === 0 ? 'keep' : String(timeoutSeconds))
|
|
1130
1210
|
compatibility.dispatch(NOTIFY_CONFIG_EVENT)
|
|
1131
1211
|
}
|
|
1132
1212
|
|
|
@@ -1137,6 +1217,38 @@ window.__ModuleLoader__.load({
|
|
|
1137
1217
|
compatibility.dispatch(SETTINGS_EVENT)
|
|
1138
1218
|
}
|
|
1139
1219
|
|
|
1220
|
+
function persistPeakOrient(next) {
|
|
1221
|
+
setPeakOrient(next)
|
|
1222
|
+
try { compatibility.storage.setItem(PEAK_ORIENT_KEY, next) } catch (e) { /* ignore */ }
|
|
1223
|
+
compatibility.dispatch(SETTINGS_EVENT)
|
|
1224
|
+
compatibility.dispatch(PEAK_RING_EVENT)
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
function persistPeakRecharge(next) {
|
|
1228
|
+
setPeakRecharge(next)
|
|
1229
|
+
try { compatibility.storage.setItem(PEAK_RECHARGE_KEY, String(next)) } catch (e) { /* ignore */ }
|
|
1230
|
+
compatibility.dispatch(SETTINGS_EVENT)
|
|
1231
|
+
compatibility.dispatch(PEAK_RING_EVENT)
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
function persistPeakScale(next) {
|
|
1235
|
+
var num = Math.min(1.2, Math.max(1.0, next))
|
|
1236
|
+
setPeakScale(num)
|
|
1237
|
+
try { compatibility.storage.setItem(PEAK_SCALE_KEY, String(num)) } catch (e) { /* ignore */ }
|
|
1238
|
+
compatibility.dispatch(SETTINGS_EVENT)
|
|
1239
|
+
compatibility.dispatch(PEAK_RING_EVENT)
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
function resetPeakDock() {
|
|
1243
|
+
setPeakDock('sidebar')
|
|
1244
|
+
try {
|
|
1245
|
+
compatibility.storage.setItem(PEAK_DOCK_KEY, 'sidebar')
|
|
1246
|
+
compatibility.storage.removeItem(PEAK_POS_KEY)
|
|
1247
|
+
} catch (e) { /* ignore */ }
|
|
1248
|
+
compatibility.dispatch(SETTINGS_EVENT)
|
|
1249
|
+
compatibility.dispatch(PEAK_RING_EVENT)
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1140
1252
|
function saveThreshold(valueArg) {
|
|
1141
1253
|
var value = Number.parseFloat(valueArg !== undefined ? valueArg : thresholdDraft)
|
|
1142
1254
|
if (!Number.isFinite(value)) return
|
|
@@ -1224,7 +1336,7 @@ window.__ModuleLoader__.load({
|
|
|
1224
1336
|
var lowBalance = snapshot && snapshot.lowBalance === true
|
|
1225
1337
|
var sessionCost = snapshot && snapshot.session && snapshot.session.official && snapshot.session.official.cost !== null && snapshot.session.official.cost !== undefined ? sessionCostText(snapshot.session.official.cost, snapshot && snapshot.balance ? snapshot.balance.currency : null) : '--'
|
|
1226
1338
|
var currencyCode = bal && typeof bal.currency === 'string' ? bal.currency : 'CNY'
|
|
1227
|
-
var primaryBalance =
|
|
1339
|
+
var primaryBalance = selectBalanceInfo(bal)
|
|
1228
1340
|
var toppedText = primaryBalance ? fmtCurrency(primaryBalance.topped_up_balance, primaryBalance.currency) : '--'
|
|
1229
1341
|
var grantedText = primaryBalance ? fmtCurrency(primaryBalance.granted_balance, primaryBalance.currency) : '--'
|
|
1230
1342
|
rows.push(React.createElement('div', { key: 'head', className: 'dshw_settingsHeader' },
|
|
@@ -1356,7 +1468,7 @@ window.__ModuleLoader__.load({
|
|
|
1356
1468
|
React.createElement('div', { className: 'dshw_settingChoice' },
|
|
1357
1469
|
React.createElement('span', { className: 'dshw_settingChoiceCopy' },
|
|
1358
1470
|
React.createElement('strong', null, '峰谷时钟'),
|
|
1359
|
-
React.createElement('span', null, '
|
|
1471
|
+
React.createElement('span', null, '侧边栏底部 24h 峰谷时钟')),
|
|
1360
1472
|
React.createElement('label', { className: 'dshw_switch', title: '在侧边栏设置按钮上方显示峰谷环形钟' },
|
|
1361
1473
|
React.createElement('input', {
|
|
1362
1474
|
type: 'checkbox', checked: ringEnabled,
|
|
@@ -1387,7 +1499,53 @@ window.__ModuleLoader__.load({
|
|
|
1387
1499
|
}
|
|
1388
1500
|
}),
|
|
1389
1501
|
React.createElement('span', { className: 'dshw_track', 'aria-hidden': 'true' }),
|
|
1390
|
-
React.createElement('span', { className: 'dshw_knob', 'aria-hidden': 'true' })))
|
|
1502
|
+
React.createElement('span', { className: 'dshw_knob', 'aria-hidden': 'true' }))),
|
|
1503
|
+
React.createElement('div', { className: 'dshw_settingChoice' },
|
|
1504
|
+
React.createElement('span', { className: 'dshw_settingChoiceCopy' },
|
|
1505
|
+
React.createElement('strong', null, '时钟布局'),
|
|
1506
|
+
React.createElement('span', null, '横向或纵向排布')),
|
|
1507
|
+
React.createElement('select', {
|
|
1508
|
+
className: 'dshw_select',
|
|
1509
|
+
'aria-label': '峰谷时钟布局',
|
|
1510
|
+
value: peakOrient,
|
|
1511
|
+
onChange: function (event) { persistPeakOrient(event.target.value) }
|
|
1512
|
+
},
|
|
1513
|
+
React.createElement('option', { value: 'horizontal' }, '横向排列'),
|
|
1514
|
+
React.createElement('option', { value: 'vertical' }, '纵向排列'))),
|
|
1515
|
+
React.createElement('div', { className: 'dshw_settingChoice' },
|
|
1516
|
+
React.createElement('span', { className: 'dshw_settingChoiceCopy' },
|
|
1517
|
+
React.createElement('strong', null, '时钟大小'),
|
|
1518
|
+
React.createElement('span', null, '100% ~ 120% 缩放')),
|
|
1519
|
+
React.createElement('span', { className: 'dshw_scaleControl' },
|
|
1520
|
+
React.createElement('input', {
|
|
1521
|
+
className: 'dshw_scaleInput', type: 'range', min: '100', max: '120', step: '5',
|
|
1522
|
+
value: String(Math.round(peakScale * 100)),
|
|
1523
|
+
'aria-label': '峰谷时钟卡片比例',
|
|
1524
|
+
onInput: function (event) { persistPeakScale(Number.parseFloat(event.target.value) / 100) },
|
|
1525
|
+
onChange: function (event) { persistPeakScale(Number.parseFloat(event.target.value) / 100) }
|
|
1526
|
+
}),
|
|
1527
|
+
React.createElement('span', { className: 'dshw_scaleValue' }, Math.round(peakScale * 100) + '%'))),
|
|
1528
|
+
React.createElement('div', { className: 'dshw_settingChoice' },
|
|
1529
|
+
React.createElement('span', { className: 'dshw_settingChoiceCopy' },
|
|
1530
|
+
React.createElement('strong', null, '时钟充值按钮'),
|
|
1531
|
+
React.createElement('span', null, '关闭可缩小卡片')),
|
|
1532
|
+
React.createElement('label', { className: 'dshw_switch', title: '关闭充值按钮可进一步收缩时钟卡片' },
|
|
1533
|
+
React.createElement('input', {
|
|
1534
|
+
type: 'checkbox', checked: peakRecharge,
|
|
1535
|
+
'aria-label': '显示时钟充值按钮',
|
|
1536
|
+
onChange: function (event) { persistPeakRecharge(event.target.checked) }
|
|
1537
|
+
}),
|
|
1538
|
+
React.createElement('span', { className: 'dshw_track', 'aria-hidden': 'true' }),
|
|
1539
|
+
React.createElement('span', { className: 'dshw_knob', 'aria-hidden': 'true' }))),
|
|
1540
|
+
React.createElement('div', { className: 'dshw_settingChoice' },
|
|
1541
|
+
React.createElement('span', { className: 'dshw_settingChoiceCopy' },
|
|
1542
|
+
React.createElement('strong', null, '时钟位置'),
|
|
1543
|
+
React.createElement('span', null, peakDock === 'free' ? '自由浮动中' : '侧边栏底部(可拖动)')),
|
|
1544
|
+
peakDock === 'free' ? React.createElement('button', {
|
|
1545
|
+
type: 'button', className: 'dshw_btn',
|
|
1546
|
+
title: '点击归位至侧边栏底部',
|
|
1547
|
+
onClick: function () { resetPeakDock() }
|
|
1548
|
+
}, '↩ 归位') : React.createElement('span', { className: 'dshw_muted', style: { fontSize: '11px' } }, '固定'))))
|
|
1391
1549
|
)
|
|
1392
1550
|
rows.push(React.createElement('div', { key: 'setcard', className: 'dshw_setCard' }, cells))
|
|
1393
1551
|
|
|
@@ -1477,7 +1635,7 @@ window.__ModuleLoader__.load({
|
|
|
1477
1635
|
onChange: function (event) { setNameDraft(event.target.value) }
|
|
1478
1636
|
}),
|
|
1479
1637
|
React.createElement('input', {
|
|
1480
|
-
className: 'dshw_input',
|
|
1638
|
+
className: 'dshw_input', type: 'password',
|
|
1481
1639
|
placeholder: 'sk-...', 'aria-label': 'API Key',
|
|
1482
1640
|
value: keyDraft,
|
|
1483
1641
|
onInput: function (event) { setKeyDraft(event.target.value) },
|
|
@@ -1619,8 +1777,46 @@ window.__ModuleLoader__.load({
|
|
|
1619
1777
|
var [shown, setShown] = React.useState(function () {
|
|
1620
1778
|
try { return compatibility.storage.getItem(PEAK_RING_KEY) !== 'false' } catch (e) { return true }
|
|
1621
1779
|
})
|
|
1780
|
+
var [orient, setOrient] = React.useState(function () {
|
|
1781
|
+
try { return compatibility.storage.getItem(PEAK_ORIENT_KEY) || 'horizontal' } catch (e) { return 'horizontal' }
|
|
1782
|
+
})
|
|
1783
|
+
var [showRecharge, setShowRecharge] = React.useState(function () {
|
|
1784
|
+
try { return compatibility.storage.getItem(PEAK_RECHARGE_KEY) !== 'false' } catch (e) { return true }
|
|
1785
|
+
})
|
|
1786
|
+
var [peakScale, setPeakScale] = React.useState(function () {
|
|
1787
|
+
try {
|
|
1788
|
+
var val = Number.parseFloat(compatibility.storage.getItem(PEAK_SCALE_KEY))
|
|
1789
|
+
return Number.isFinite(val) ? Math.min(1.2, Math.max(1.0, val)) : 1.0
|
|
1790
|
+
} catch (e) { return 1.0 }
|
|
1791
|
+
})
|
|
1792
|
+
var [dock, setDock] = React.useState(function () {
|
|
1793
|
+
try { return compatibility.storage.getItem(PEAK_DOCK_KEY) || 'sidebar' } catch (e) { return 'sidebar' }
|
|
1794
|
+
})
|
|
1795
|
+
var [pos, setPos] = React.useState(function () {
|
|
1796
|
+
try {
|
|
1797
|
+
var raw = compatibility.storage.getItem(PEAK_POS_KEY)
|
|
1798
|
+
if (raw) {
|
|
1799
|
+
var parsed = JSON.parse(raw)
|
|
1800
|
+
if (parsed && typeof parsed.x === 'number' && typeof parsed.y === 'number') return parsed
|
|
1801
|
+
}
|
|
1802
|
+
return null
|
|
1803
|
+
} catch (e) { return null }
|
|
1804
|
+
})
|
|
1805
|
+
var latestPosRef = React.useRef(pos)
|
|
1806
|
+
latestPosRef.current = pos
|
|
1807
|
+
var [dragging, setDragging] = React.useState(false)
|
|
1622
1808
|
var [snapshot, setSnapshot] = React.useState(undefined) // undefined = loading
|
|
1623
1809
|
var [nowMs, setNowMs] = React.useState(function () { return Date.now() })
|
|
1810
|
+
var dragRef = React.useRef(null)
|
|
1811
|
+
var didDragRef = React.useRef(false)
|
|
1812
|
+
var [panelOpen, setPanelOpen] = React.useState(false)
|
|
1813
|
+
var [panelPos, setPanelPos] = React.useState({ left: 16, top: 16 })
|
|
1814
|
+
var cardNodeRef = React.useRef(null)
|
|
1815
|
+
var panelNodeRef = React.useRef(null)
|
|
1816
|
+
|
|
1817
|
+
var [peakNotify, setPeakNotify] = React.useState(function () {
|
|
1818
|
+
try { return compatibility.storage.getItem(PEAK_NOTIFY_KEY) === 'true' } catch (e) { return false }
|
|
1819
|
+
})
|
|
1624
1820
|
|
|
1625
1821
|
React.useEffect(function () {
|
|
1626
1822
|
var stopped = false
|
|
@@ -1632,7 +1828,29 @@ window.__ModuleLoader__.load({
|
|
|
1632
1828
|
loadSnap()
|
|
1633
1829
|
var listensEvents = typeof window.addEventListener === 'function'
|
|
1634
1830
|
function onRingChange() {
|
|
1635
|
-
try {
|
|
1831
|
+
try {
|
|
1832
|
+
setShown(compatibility.storage.getItem(PEAK_RING_KEY) !== 'false')
|
|
1833
|
+
setOrient(compatibility.storage.getItem(PEAK_ORIENT_KEY) || 'horizontal')
|
|
1834
|
+
setShowRecharge(compatibility.storage.getItem(PEAK_RECHARGE_KEY) !== 'false')
|
|
1835
|
+
var val = Number.parseFloat(compatibility.storage.getItem(PEAK_SCALE_KEY))
|
|
1836
|
+
setPeakScale(Number.isFinite(val) ? Math.min(1.2, Math.max(1.0, val)) : 1.0)
|
|
1837
|
+
var currentDock = compatibility.storage.getItem(PEAK_DOCK_KEY) || 'sidebar'
|
|
1838
|
+
setDock(currentDock)
|
|
1839
|
+
setPeakNotify(compatibility.storage.getItem(PEAK_NOTIFY_KEY) === 'true')
|
|
1840
|
+
var raw = compatibility.storage.getItem(PEAK_POS_KEY)
|
|
1841
|
+
if (raw) {
|
|
1842
|
+
try {
|
|
1843
|
+
var parsed = JSON.parse(raw)
|
|
1844
|
+
if (parsed && typeof parsed.x === 'number' && typeof parsed.y === 'number') {
|
|
1845
|
+
setPos(parsed)
|
|
1846
|
+
latestPosRef.current = parsed
|
|
1847
|
+
}
|
|
1848
|
+
} catch (e) { /* ignore */ }
|
|
1849
|
+
} else if (currentDock === 'sidebar') {
|
|
1850
|
+
setPos(null)
|
|
1851
|
+
latestPosRef.current = null
|
|
1852
|
+
}
|
|
1853
|
+
} catch (e) { /* ignore */ }
|
|
1636
1854
|
loadSnap()
|
|
1637
1855
|
}
|
|
1638
1856
|
function onSnapUpdate(event) {
|
|
@@ -1662,6 +1880,60 @@ window.__ModuleLoader__.load({
|
|
|
1662
1880
|
}
|
|
1663
1881
|
}, [])
|
|
1664
1882
|
|
|
1883
|
+
React.useEffect(function () {
|
|
1884
|
+
if (!panelOpen) return
|
|
1885
|
+
function updatePosition() {
|
|
1886
|
+
var cardEl = cardNodeRef.current
|
|
1887
|
+
var panelEl = panelNodeRef.current
|
|
1888
|
+
if (!cardEl || !panelEl) return
|
|
1889
|
+
var cRect = cardEl.getBoundingClientRect()
|
|
1890
|
+
var pRect = panelEl.getBoundingClientRect()
|
|
1891
|
+
var winW = window.innerWidth || 1024
|
|
1892
|
+
var winH = window.innerHeight || 768
|
|
1893
|
+
var targetLeft = 16
|
|
1894
|
+
var targetTop = 16
|
|
1895
|
+
|
|
1896
|
+
if (dock === 'sidebar') {
|
|
1897
|
+
targetLeft = Math.min(winW - pRect.width - 12, cRect.right + 12)
|
|
1898
|
+
targetTop = Math.max(12, Math.min(winH - pRect.height - 12, cRect.bottom - pRect.height))
|
|
1899
|
+
} else {
|
|
1900
|
+
targetLeft = Math.max(12, Math.min(winW - pRect.width - 12, cRect.left))
|
|
1901
|
+
if (cRect.bottom + pRect.height + 12 <= winH) {
|
|
1902
|
+
targetTop = cRect.bottom + 8
|
|
1903
|
+
} else {
|
|
1904
|
+
targetTop = Math.max(12, cRect.top - pRect.height - 8)
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
setPanelPos({ left: Math.round(targetLeft), top: Math.round(targetTop) })
|
|
1908
|
+
}
|
|
1909
|
+
updatePosition()
|
|
1910
|
+
if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {
|
|
1911
|
+
window.addEventListener('resize', updatePosition)
|
|
1912
|
+
return function () {
|
|
1913
|
+
window.removeEventListener('resize', updatePosition)
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}, [panelOpen, dock, pos, peakScale, orient])
|
|
1917
|
+
|
|
1918
|
+
React.useEffect(function () {
|
|
1919
|
+
if (!panelOpen) return
|
|
1920
|
+
function onDocDown(event) {
|
|
1921
|
+
var target = event.target
|
|
1922
|
+
if (panelNodeRef.current && panelNodeRef.current.contains(target)) return
|
|
1923
|
+
if (cardNodeRef.current && cardNodeRef.current.contains(target)) return
|
|
1924
|
+
setPanelOpen(false)
|
|
1925
|
+
}
|
|
1926
|
+
function onKeyDown(event) {
|
|
1927
|
+
if (event.key === 'Escape') setPanelOpen(false)
|
|
1928
|
+
}
|
|
1929
|
+
document.addEventListener('pointerdown', onDocDown)
|
|
1930
|
+
document.addEventListener('keydown', onKeyDown)
|
|
1931
|
+
return function () {
|
|
1932
|
+
document.removeEventListener('pointerdown', onDocDown)
|
|
1933
|
+
document.removeEventListener('keydown', onKeyDown)
|
|
1934
|
+
}
|
|
1935
|
+
}, [panelOpen])
|
|
1936
|
+
|
|
1665
1937
|
var policy = snapshot && snapshot.pricingWindows ? snapshot.pricingWindows : null
|
|
1666
1938
|
|
|
1667
1939
|
React.useEffect(function () {
|
|
@@ -1699,52 +1971,334 @@ window.__ModuleLoader__.load({
|
|
|
1699
1971
|
var costLabel = sessionCostLabel(balCurrency)
|
|
1700
1972
|
var low = snapshot && snapshot.lowBalance === true
|
|
1701
1973
|
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1974
|
+
var isFreeFloating = dock === 'free'
|
|
1975
|
+
var isVertical = orient === 'vertical' && (wide || isFreeFloating)
|
|
1976
|
+
var isRail = !wide && !isFreeFloating
|
|
1977
|
+
|
|
1978
|
+
function updateOrient(val) {
|
|
1979
|
+
setOrient(val)
|
|
1980
|
+
try { compatibility.storage.setItem(PEAK_ORIENT_KEY, val) } catch (e) { /* ignore */ }
|
|
1981
|
+
try { compatibility.dispatch(SETTINGS_EVENT) } catch (e) { /* ignore */ }
|
|
1982
|
+
try { compatibility.dispatch(PEAK_RING_EVENT) } catch (e) { /* ignore */ }
|
|
1983
|
+
}
|
|
1984
|
+
function updateScale(val) {
|
|
1985
|
+
val = Math.min(1.2, Math.max(1.0, Math.round(val * 20) / 20))
|
|
1986
|
+
setPeakScale(val)
|
|
1987
|
+
try { compatibility.storage.setItem(PEAK_SCALE_KEY, String(val)) } catch (e) { /* ignore */ }
|
|
1988
|
+
try { compatibility.dispatch(SETTINGS_EVENT) } catch (e) { /* ignore */ }
|
|
1989
|
+
try { compatibility.dispatch(PEAK_RING_EVENT) } catch (e) { /* ignore */ }
|
|
1990
|
+
}
|
|
1991
|
+
function updateRecharge(val) {
|
|
1992
|
+
setShowRecharge(val)
|
|
1993
|
+
try { compatibility.storage.setItem(PEAK_RECHARGE_KEY, String(val)) } catch (e) { /* ignore */ }
|
|
1994
|
+
try { compatibility.dispatch(SETTINGS_EVENT) } catch (e) { /* ignore */ }
|
|
1995
|
+
try { compatibility.dispatch(PEAK_RING_EVENT) } catch (e) { /* ignore */ }
|
|
1996
|
+
}
|
|
1997
|
+
function updateNotify(val) {
|
|
1998
|
+
setPeakNotify(val)
|
|
1999
|
+
try { compatibility.storage.setItem(PEAK_NOTIFY_KEY, String(val)) } catch (e) { /* ignore */ }
|
|
2000
|
+
try { compatibility.dispatch(SETTINGS_EVENT) } catch (e) { /* ignore */ }
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
function handlePointerDown(e) {
|
|
2004
|
+
if (isRail) return
|
|
2005
|
+
var targetEl = e.target && e.target.nodeType === 3 ? e.target.parentElement : e.target
|
|
2006
|
+
if (targetEl && typeof targetEl.closest === 'function' && (targetEl.closest('button') || targetEl.closest('a') || targetEl.closest('input') || targetEl.closest('select'))) return
|
|
2007
|
+
if (e.button !== undefined && e.button !== 0) return
|
|
2008
|
+
var targetNode = e.currentTarget
|
|
2009
|
+
var rect = targetNode.getBoundingClientRect()
|
|
2010
|
+
var curX = (isFreeFloating && pos && typeof pos.x === 'number') ? pos.x : rect.left
|
|
2011
|
+
var curY = (isFreeFloating && pos && typeof pos.y === 'number') ? pos.y : rect.top
|
|
2012
|
+
var grabOffsetX = e.clientX - curX
|
|
2013
|
+
var grabOffsetY = e.clientY - curY
|
|
2014
|
+
dragRef.current = {
|
|
2015
|
+
startX: e.clientX,
|
|
2016
|
+
startY: e.clientY,
|
|
2017
|
+
grabOffsetX: grabOffsetX,
|
|
2018
|
+
grabOffsetY: grabOffsetY,
|
|
2019
|
+
rectWidth: rect.width,
|
|
2020
|
+
rectHeight: rect.height,
|
|
2021
|
+
dragged: false,
|
|
2022
|
+
pointerId: e.pointerId
|
|
2023
|
+
}
|
|
2024
|
+
didDragRef.current = false
|
|
2025
|
+
latestPosRef.current = { x: curX, y: curY }
|
|
2026
|
+
|
|
2027
|
+
function onMove(moveEvent) {
|
|
2028
|
+
if (!dragRef.current) return
|
|
2029
|
+
var dx = moveEvent.clientX - dragRef.current.startX
|
|
2030
|
+
var dy = moveEvent.clientY - dragRef.current.startY
|
|
2031
|
+
if (!dragRef.current.dragged && Math.hypot(dx, dy) > 3) {
|
|
2032
|
+
dragRef.current.dragged = true
|
|
2033
|
+
didDragRef.current = true
|
|
2034
|
+
setDragging(true)
|
|
2035
|
+
setDock('free')
|
|
2036
|
+
}
|
|
2037
|
+
if (dragRef.current.dragged) {
|
|
2038
|
+
var w = dragRef.current.rectWidth || (isVertical ? 140 : 180)
|
|
2039
|
+
var h = dragRef.current.rectHeight || (isVertical ? 120 : 60)
|
|
2040
|
+
var maxX = (window.innerWidth || 1024) - w - 8
|
|
2041
|
+
var maxY = (window.innerHeight || 768) - h - 8
|
|
2042
|
+
var nextX = Math.max(8, Math.min(maxX, moveEvent.clientX - dragRef.current.grabOffsetX))
|
|
2043
|
+
var nextY = Math.max(8, Math.min(maxY, moveEvent.clientY - dragRef.current.grabOffsetY))
|
|
2044
|
+
var nextPos = { x: Math.round(nextX), y: Math.round(nextY) }
|
|
2045
|
+
latestPosRef.current = nextPos
|
|
2046
|
+
setPos(nextPos)
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
function onUp() {
|
|
2050
|
+
if (dragRef.current && dragRef.current.dragged) {
|
|
2051
|
+
var finalPos = latestPosRef.current || { x: curX, y: curY }
|
|
2052
|
+
try {
|
|
2053
|
+
compatibility.storage.setItem(PEAK_DOCK_KEY, 'free')
|
|
2054
|
+
if (finalPos) compatibility.storage.setItem(PEAK_POS_KEY, JSON.stringify(finalPos))
|
|
2055
|
+
} catch (err) { /* ignore */ }
|
|
2056
|
+
setDragging(false)
|
|
2057
|
+
setDock('free')
|
|
2058
|
+
setPos(finalPos)
|
|
2059
|
+
try { compatibility.dispatch(SETTINGS_EVENT) } catch (err) { /* ignore */ }
|
|
2060
|
+
}
|
|
2061
|
+
dragRef.current = null
|
|
2062
|
+
window.removeEventListener('pointermove', onMove)
|
|
2063
|
+
window.removeEventListener('pointerup', onUp)
|
|
2064
|
+
window.removeEventListener('pointercancel', onUp)
|
|
2065
|
+
}
|
|
2066
|
+
window.addEventListener('pointermove', onMove)
|
|
2067
|
+
window.addEventListener('pointerup', onUp)
|
|
2068
|
+
window.addEventListener('pointercancel', onUp)
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
function handleResetDock(e) {
|
|
2072
|
+
if (e && typeof e.stopPropagation === 'function') e.stopPropagation()
|
|
2073
|
+
setDock('sidebar')
|
|
2074
|
+
setPos(null)
|
|
2075
|
+
latestPosRef.current = null
|
|
2076
|
+
try {
|
|
2077
|
+
compatibility.storage.setItem(PEAK_DOCK_KEY, 'sidebar')
|
|
2078
|
+
compatibility.storage.removeItem(PEAK_POS_KEY)
|
|
2079
|
+
compatibility.dispatch(SETTINGS_EVENT)
|
|
2080
|
+
compatibility.dispatch(PEAK_RING_EVENT)
|
|
2081
|
+
} catch (err) { /* ignore */ }
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
var cardStyle = {}
|
|
2085
|
+
if (isFreeFloating) {
|
|
2086
|
+
cardStyle.position = 'fixed'
|
|
2087
|
+
if (pos && typeof pos.x === 'number' && typeof pos.y === 'number') {
|
|
2088
|
+
cardStyle.left = pos.x + 'px'
|
|
2089
|
+
cardStyle.top = pos.y + 'px'
|
|
2090
|
+
} else {
|
|
2091
|
+
cardStyle.left = '20px'
|
|
2092
|
+
cardStyle.top = '100px'
|
|
2093
|
+
}
|
|
2094
|
+
cardStyle.zIndex = 90
|
|
2095
|
+
if (peakScale && peakScale !== 1) {
|
|
2096
|
+
cardStyle.transform = 'scale(' + peakScale + ')'
|
|
2097
|
+
cardStyle.transformOrigin = 'top left'
|
|
2098
|
+
}
|
|
2099
|
+
} else {
|
|
2100
|
+
if (!isVertical) {
|
|
2101
|
+
cardStyle.width = '100%'
|
|
2102
|
+
} else {
|
|
2103
|
+
cardStyle.width = 'fit-content'
|
|
2104
|
+
cardStyle.maxWidth = Math.round(148 * peakScale) + 'px'
|
|
2105
|
+
cardStyle.marginLeft = 'auto'
|
|
2106
|
+
cardStyle.marginRight = 'auto'
|
|
2107
|
+
}
|
|
2108
|
+
cardStyle.boxSizing = 'border-box'
|
|
2109
|
+
cardStyle.marginBottom = Math.round(8 * peakScale) + 'px'
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
var containerClasses = ['dshw_footRing']
|
|
2113
|
+
if (isRail) containerClasses.push('dshw_footRingRail')
|
|
2114
|
+
if (isVertical) containerClasses.push('dshw_footRingVertical')
|
|
2115
|
+
if (!isVertical && !showRecharge) containerClasses.push('dshw_footRingNoRecharge')
|
|
2116
|
+
if (isFreeFloating) containerClasses.push('dshw_footRingFloating')
|
|
2117
|
+
if (dragging) containerClasses.push('dshw_footRingDragging')
|
|
2118
|
+
if (low) containerClasses.push('dshw_low')
|
|
2119
|
+
|
|
2120
|
+
var clockSize = isRail
|
|
2121
|
+
? 36
|
|
2122
|
+
: (isFreeFloating ? (isVertical ? 42 : 50) : Math.round((isVertical ? 42 : 50) * peakScale))
|
|
2123
|
+
|
|
2124
|
+
var cardElement = React.createElement('div', {
|
|
2125
|
+
ref: cardNodeRef,
|
|
2126
|
+
className: containerClasses.join(' '),
|
|
2127
|
+
style: Object.keys(cardStyle).length > 0 ? cardStyle : undefined,
|
|
2128
|
+
title: state.tip + ' · 余额 ' + balText + ' · ' + costLabel + ' ' + costText + (isRail ? ' · 点击前往官方充值' : ' · 点击展开专属控制面板 / 按住拖拽'),
|
|
1705
2129
|
'aria-label': state.ariaText + ',余额 ' + balText + ',' + costLabel + ' ' + costText,
|
|
1706
|
-
role: '
|
|
1707
|
-
|
|
2130
|
+
role: 'button',
|
|
2131
|
+
tabIndex: 0,
|
|
2132
|
+
onPointerDown: isRail ? undefined : handlePointerDown,
|
|
2133
|
+
onClick: function (e) {
|
|
2134
|
+
if (isRail) {
|
|
2135
|
+
window.open('https://platform.deepseek.com/top_up', '_blank', 'noopener')
|
|
2136
|
+
return
|
|
2137
|
+
}
|
|
2138
|
+
if (didDragRef.current !== true) {
|
|
2139
|
+
setPanelOpen(function (prev) { return !prev })
|
|
2140
|
+
}
|
|
2141
|
+
},
|
|
2142
|
+
onKeyDown: function (e) {
|
|
2143
|
+
if (e.target === e.currentTarget && (e.key === 'Enter' || e.key === ' ')) {
|
|
2144
|
+
e.preventDefault()
|
|
2145
|
+
setPanelOpen(function (prev) { return !prev })
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
1708
2148
|
},
|
|
2149
|
+
isFreeFloating ? React.createElement('button', {
|
|
2150
|
+
type: 'button',
|
|
2151
|
+
className: 'dshw_footRingResetBtn',
|
|
2152
|
+
title: '归位至侧边栏底部',
|
|
2153
|
+
'aria-label': '归位至侧边栏底部',
|
|
2154
|
+
onClick: handleResetDock
|
|
2155
|
+
}, '↩ 归位') : null,
|
|
1709
2156
|
React.createElement('div', { style: { flex: 'none', display: 'flex', alignItems: 'center', justifyContent: 'center' } },
|
|
1710
|
-
peakRingSVG(state.configured ? state.windows : null, wallHourIn(tzName, offsetMinutes, new Date(nowMs)),
|
|
2157
|
+
peakRingSVG(state.configured ? state.windows : null, wallHourIn(tzName, offsetMinutes, new Date(nowMs)), clockSize, state.ariaText)
|
|
1711
2158
|
),
|
|
1712
|
-
|
|
2159
|
+
!isRail ? React.createElement('div', { className: 'dshw_footRingLabel' },
|
|
1713
2160
|
React.createElement('div', { className: 'dshw_footRingHeader' },
|
|
1714
2161
|
React.createElement('span', {
|
|
1715
2162
|
className: 'dshw_footRingTitle',
|
|
1716
|
-
style: {
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}, state.
|
|
2163
|
+
style: {
|
|
2164
|
+
color: state.configured ? (state.inPeak ? 'var(--dsw-alias-state-error-primary,#e5534b)' : 'var(--dsw-alias-state-success-primary,#1a7f37)') : 'inherit',
|
|
2165
|
+
fontSize: isFreeFloating ? undefined : (Math.round((isVertical ? 12 : 13.5) * peakScale) + 'px')
|
|
2166
|
+
}
|
|
2167
|
+
}, state.configured ? state.periodName : '峰谷时钟')
|
|
1721
2168
|
),
|
|
1722
|
-
React.createElement('div', {
|
|
2169
|
+
React.createElement('div', {
|
|
2170
|
+
className: 'dshw_footRingMoney' + (low ? ' dshw_low' : ''),
|
|
2171
|
+
style: isFreeFloating ? undefined : { fontSize: (Math.round((isVertical ? 11 : 12.5) * peakScale) + 'px') }
|
|
2172
|
+
},
|
|
1723
2173
|
React.createElement('span', { className: 'dshw_muted' }, '余额 '),
|
|
1724
2174
|
React.createElement('span', { className: 'dshw_footBalNum', style: { fontWeight: '600' } }, balText),
|
|
1725
2175
|
React.createElement('span', { className: 'dshw_balDot', style: { margin: '0 3px' } }, '·'),
|
|
1726
2176
|
React.createElement('span', { className: 'dshw_muted' }, costLabel + ' '),
|
|
1727
2177
|
React.createElement('span', { style: { fontWeight: '600' } }, costText)
|
|
1728
2178
|
),
|
|
1729
|
-
React.createElement('
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
React.createElement('span', { style: { lineHeight: 1 } }, '值')
|
|
2179
|
+
React.createElement('div', { className: 'dshw_footRingBottom' },
|
|
2180
|
+
React.createElement('span', {
|
|
2181
|
+
className: 'dshw_footRingCountdown',
|
|
2182
|
+
style: isFreeFloating ? undefined : { fontSize: (Math.round((isVertical ? 10 : 11) * peakScale) + 'px') }
|
|
2183
|
+
}, state.configured ? state.countdownSummary : '计费时段未配置'),
|
|
2184
|
+
showRecharge ? React.createElement('button', {
|
|
2185
|
+
type: 'button',
|
|
2186
|
+
className: 'dshw_footRingBtnRechargeInline',
|
|
2187
|
+
title: 'DeepSeek 开放平台 · 前往官方充值',
|
|
2188
|
+
'aria-label': '前往官方充值',
|
|
2189
|
+
onClick: function (e) {
|
|
2190
|
+
if (e && typeof e.stopPropagation === 'function') e.stopPropagation()
|
|
2191
|
+
window.open('https://platform.deepseek.com/top_up', '_blank', 'noopener')
|
|
2192
|
+
}
|
|
2193
|
+
}, '充值') : null
|
|
1745
2194
|
)
|
|
1746
2195
|
) : null
|
|
1747
2196
|
)
|
|
2197
|
+
|
|
2198
|
+
var panelElement = panelOpen ? React.createElement('div', {
|
|
2199
|
+
ref: panelNodeRef,
|
|
2200
|
+
className: 'dshw_peakPanel',
|
|
2201
|
+
style: { left: panelPos.left + 'px', top: panelPos.top + 'px' },
|
|
2202
|
+
role: 'dialog',
|
|
2203
|
+
'aria-label': '峰谷时钟专属控制面板'
|
|
2204
|
+
},
|
|
2205
|
+
React.createElement('div', { className: 'dshw_peakPanelHeader' },
|
|
2206
|
+
React.createElement('span', { style: { display: 'flex', alignItems: 'center', gap: '6px' } },
|
|
2207
|
+
React.createElement('span', { style: { color: 'var(--dsw-alias-brand-primary,#4aa3ff)' } }, '⚡'),
|
|
2208
|
+
React.createElement('strong', null, '峰谷时钟控制面板')),
|
|
2209
|
+
React.createElement('button', {
|
|
2210
|
+
type: 'button',
|
|
2211
|
+
className: 'dshw_peakPanelClose',
|
|
2212
|
+
title: '关闭面板 (Esc)',
|
|
2213
|
+
'aria-label': '关闭面板',
|
|
2214
|
+
onClick: function (e) { e.stopPropagation(); setPanelOpen(false) }
|
|
2215
|
+
}, '×')),
|
|
2216
|
+
React.createElement('div', { className: 'dshw_peakStatusCard' },
|
|
2217
|
+
React.createElement('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' } },
|
|
2218
|
+
React.createElement('span', {
|
|
2219
|
+
style: {
|
|
2220
|
+
fontWeight: '700',
|
|
2221
|
+
fontSize: '13px',
|
|
2222
|
+
color: state.configured ? (state.inPeak ? 'var(--dsw-alias-state-error-primary,#e5534b)' : 'var(--dsw-alias-state-success-primary,#1a7f37)') : 'inherit'
|
|
2223
|
+
}
|
|
2224
|
+
}, state.configured ? (state.periodName + (state.inPeak ? '(标准价)' : '(半价优惠)')) : '计费时段未配置'),
|
|
2225
|
+
React.createElement('span', { className: 'dshw_muted', style: { fontSize: '11px' } }, state.countdownSummary)),
|
|
2226
|
+
React.createElement('div', { className: 'dshw_muted', style: { fontSize: '11px', marginTop: '2px' } }, state.windowSummary),
|
|
2227
|
+
React.createElement('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginTop: '5px', paddingTop: '5px', borderTop: '1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.12))' } },
|
|
2228
|
+
React.createElement('span', { style: { fontSize: '11.5px' } }, '余额 ' + balText + ' · ' + costLabel + ' ' + costText),
|
|
2229
|
+
React.createElement('button', {
|
|
2230
|
+
type: 'button',
|
|
2231
|
+
className: 'dshw_btn dshw_btnPrimary',
|
|
2232
|
+
style: { height: '22px', fontSize: '11px', padding: '0 8px' },
|
|
2233
|
+
onClick: function () { window.open('https://platform.deepseek.com/top_up', '_blank', 'noopener') }
|
|
2234
|
+
}, '↗ 充值'))),
|
|
2235
|
+
React.createElement('div', { className: 'dshw_divider' }),
|
|
2236
|
+
React.createElement('div', { className: 'dshw_peakRow' },
|
|
2237
|
+
React.createElement('span', { className: 'dshw_muted' }, '时钟排版'),
|
|
2238
|
+
React.createElement('select', {
|
|
2239
|
+
className: 'dshw_select',
|
|
2240
|
+
style: { height: '24px', fontSize: '11px' },
|
|
2241
|
+
'aria-label': '控制面板时钟排版',
|
|
2242
|
+
value: orient,
|
|
2243
|
+
onChange: function (e) { updateOrient(e.target.value) }
|
|
2244
|
+
},
|
|
2245
|
+
React.createElement('option', { value: 'horizontal' }, '横向排列'),
|
|
2246
|
+
React.createElement('option', { value: 'vertical' }, '纵向排列'))),
|
|
2247
|
+
React.createElement('div', { className: 'dshw_peakRow' },
|
|
2248
|
+
React.createElement('span', { className: 'dshw_muted' }, '时钟大小 (' + Math.round(peakScale * 100) + '%)'),
|
|
2249
|
+
React.createElement('span', { className: 'dshw_scaleControl' },
|
|
2250
|
+
React.createElement('input', {
|
|
2251
|
+
className: 'dshw_scaleInput', type: 'range', min: '100', max: '120', step: '5',
|
|
2252
|
+
value: String(Math.round(peakScale * 100)),
|
|
2253
|
+
'aria-label': '控制面板时钟卡片比例',
|
|
2254
|
+
onInput: function (e) { updateScale(Number.parseFloat(e.target.value) / 100) },
|
|
2255
|
+
onChange: function (e) { updateScale(Number.parseFloat(e.target.value) / 100) }
|
|
2256
|
+
}))),
|
|
2257
|
+
React.createElement('div', { className: 'dshw_peakRow' },
|
|
2258
|
+
React.createElement('span', { className: 'dshw_muted' }, '时钟充值按钮'),
|
|
2259
|
+
React.createElement('label', { className: 'dshw_switch' },
|
|
2260
|
+
React.createElement('input', {
|
|
2261
|
+
type: 'checkbox', checked: showRecharge,
|
|
2262
|
+
'aria-label': '控制面板时钟充值按钮',
|
|
2263
|
+
onChange: function (e) { updateRecharge(e.target.checked) }
|
|
2264
|
+
}),
|
|
2265
|
+
React.createElement('span', { className: 'dshw_track', 'aria-hidden': 'true' }),
|
|
2266
|
+
React.createElement('span', { className: 'dshw_knob', 'aria-hidden': 'true' }))),
|
|
2267
|
+
React.createElement('div', { className: 'dshw_peakRow' },
|
|
2268
|
+
React.createElement('span', { className: 'dshw_muted' }, '峰谷切换提醒'),
|
|
2269
|
+
React.createElement('label', { className: 'dshw_switch' },
|
|
2270
|
+
React.createElement('input', {
|
|
2271
|
+
type: 'checkbox', checked: peakNotify,
|
|
2272
|
+
'aria-label': '控制面板开启峰谷切换提醒',
|
|
2273
|
+
onChange: function (e) { updateNotify(e.target.checked) }
|
|
2274
|
+
}),
|
|
2275
|
+
React.createElement('span', { className: 'dshw_track', 'aria-hidden': 'true' }),
|
|
2276
|
+
React.createElement('span', { className: 'dshw_knob', 'aria-hidden': 'true' }))),
|
|
2277
|
+
React.createElement('div', { className: 'dshw_peakRow' },
|
|
2278
|
+
React.createElement('span', { className: 'dshw_muted' }, '时钟位置'),
|
|
2279
|
+
isFreeFloating ? React.createElement('button', {
|
|
2280
|
+
type: 'button',
|
|
2281
|
+
className: 'dshw_btn',
|
|
2282
|
+
style: { height: '24px', fontSize: '11px' },
|
|
2283
|
+
onClick: handleResetDock
|
|
2284
|
+
}, '↩ 归位至侧边栏') : React.createElement('span', { className: 'dshw_muted', style: { fontSize: '11px' } }, '侧边栏底部(可拖拽)')),
|
|
2285
|
+
React.createElement('div', { style: { marginTop: '4px', textAlign: 'right', fontSize: '10px', color: 'var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))' } },
|
|
2286
|
+
'DeepSeek Harness Control Center v' + WALLET_VERSION)
|
|
2287
|
+
) : null
|
|
2288
|
+
|
|
2289
|
+
function renderWithPortal(elem) {
|
|
2290
|
+
if (ReactDOM && typeof ReactDOM.createPortal === 'function' && typeof document !== 'undefined' && document.body) {
|
|
2291
|
+
return ReactDOM.createPortal(elem, document.body)
|
|
2292
|
+
}
|
|
2293
|
+
return elem
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
if (panelOpen) {
|
|
2297
|
+
var renderedCard = isFreeFloating ? renderWithPortal(cardElement) : cardElement
|
|
2298
|
+
var renderedPanel = renderWithPortal(panelElement)
|
|
2299
|
+
return React.createElement(React.Fragment, null, renderedCard, renderedPanel)
|
|
2300
|
+
}
|
|
2301
|
+
return isFreeFloating ? renderWithPortal(cardElement) : cardElement
|
|
1748
2302
|
}
|
|
1749
2303
|
|
|
1750
2304
|
function WalletChip(props) {
|
|
@@ -1952,7 +2506,8 @@ window.__ModuleLoader__.load({
|
|
|
1952
2506
|
if (showOfficial && json.lowBalance) {
|
|
1953
2507
|
if (!notifiedRef.current) {
|
|
1954
2508
|
try {
|
|
1955
|
-
var
|
|
2509
|
+
var lowCurrency = json.balance && json.balance.currency ? json.balance.currency : 'CNY'
|
|
2510
|
+
var lowNotice = compatibility.notify('DeepSeek 余额不足', { body: '余额已低于提醒线 ' + fmtCurrency(json.threshold, lowCurrency), tag: 'dsh-wallet-low' })
|
|
1956
2511
|
if (lowNotice) notifiedRef.current = true
|
|
1957
2512
|
} catch (e) { /* ignore */ }
|
|
1958
2513
|
}
|
|
@@ -2554,7 +3109,7 @@ window.__ModuleLoader__.load({
|
|
|
2554
3109
|
|
|
2555
3110
|
function activateAccount(id, name) {
|
|
2556
3111
|
if (switchingId !== null) return
|
|
2557
|
-
if (!window.confirm('\u5207\u6362\u5230\u8d26\u6237\u300c' + name + '\u300d\uff1f\n\u5207\u6362\u540e\uff0c\u540e\u7eed LLM \u8bf7\u6c42\u5c06\u4f7f\u7528\u8be5\u8d26\u6237\u7684 Key \u8ba1\u8d39\u3002')) return
|
|
3112
|
+
if (!window.confirm('\u5207\u6362\u5230\u8d26\u6237\u300c' + name + '\u300d\uff1f\r\n\u5207\u6362\u540e\uff0c\u540e\u7eed LLM \u8bf7\u6c42\u5c06\u4f7f\u7528\u8be5\u8d26\u6237\u7684 Key \u8ba1\u8d39\u3002')) return
|
|
2558
3113
|
setSwitchingId(id)
|
|
2559
3114
|
setAccountNotice(null)
|
|
2560
3115
|
fetch('/api/wallet/accounts/activate', {
|
|
@@ -2585,7 +3140,7 @@ window.__ModuleLoader__.load({
|
|
|
2585
3140
|
}
|
|
2586
3141
|
|
|
2587
3142
|
function removeAccount(id, name) {
|
|
2588
|
-
if (!window.confirm('\u5220\u9664\u8d26\u6237\u300c' + name + '\u300d\uff1f\n\u4ec5\u5220\u9664\u672c\u63d2\u4ef6\u7684\u8d26\u6237\u8bb0\u5f55\uff0c\u4e0d\u5f71\u54cd .credentials.yaml \u4e2d\u5df2\u6709\u7684 Key\u3002')) return
|
|
3143
|
+
if (!window.confirm('\u5220\u9664\u8d26\u6237\u300c' + name + '\u300d\uff1f\r\n\u4ec5\u5220\u9664\u672c\u63d2\u4ef6\u7684\u8d26\u6237\u8bb0\u5f55\uff0c\u4e0d\u5f71\u54cd .credentials.yaml \u4e2d\u5df2\u6709\u7684 Key\u3002')) return
|
|
2589
3144
|
fetch('/api/wallet/accounts/remove', {
|
|
2590
3145
|
method: 'POST',
|
|
2591
3146
|
headers: { 'content-type': 'application/json' },
|
|
@@ -2868,7 +3423,7 @@ window.__ModuleLoader__.load({
|
|
|
2868
3423
|
type: 'number',
|
|
2869
3424
|
min: '0',
|
|
2870
3425
|
step: 'any',
|
|
2871
|
-
'aria-label': '
|
|
3426
|
+
'aria-label': '余额提醒阈值(' + (bal.currency || 'CNY') + ')',
|
|
2872
3427
|
value: thresholdDraft === null ? '' : thresholdDraft,
|
|
2873
3428
|
onChange: function (event) {
|
|
2874
3429
|
thresholdInitializedRef.current = 'editing'
|
|
@@ -3003,10 +3558,10 @@ window.__ModuleLoader__.load({
|
|
|
3003
3558
|
function balanceCard() {
|
|
3004
3559
|
if (!bal.available || !bal.balances || bal.balances.length === 0) {
|
|
3005
3560
|
return React.createElement('div', { className: 'dshw_balanceCard' },
|
|
3006
|
-
React.createElement('div', { className: 'dshw_muted' }, bal.error ? (
|
|
3561
|
+
React.createElement('div', { className: 'dshw_muted' }, bal.error ? balanceErrorText(bal.error) : '余额查询中…'))
|
|
3007
3562
|
}
|
|
3008
|
-
var first = bal
|
|
3009
|
-
var others = bal.balances.
|
|
3563
|
+
var first = selectBalanceInfo(bal)
|
|
3564
|
+
var others = bal.balances.filter(function (info) { return info !== first })
|
|
3010
3565
|
var subParts = [
|
|
3011
3566
|
React.createElement('span', { key: 'top' }, '\u5145\u503c ' + fmtCurrency(first.topped_up_balance, first.currency)),
|
|
3012
3567
|
React.createElement('span', { key: 'd1', className: 'dshw_balDot' }, '\u00b7'),
|
|
@@ -3017,25 +3572,16 @@ window.__ModuleLoader__.load({
|
|
|
3017
3572
|
subParts.push(React.createElement('span', { key: 'x' + i }, info.currency + ' ' + fmtCurrency(info.total_balance, info.currency)))
|
|
3018
3573
|
})
|
|
3019
3574
|
return React.createElement('div', {
|
|
3020
|
-
className: low ? 'dshw_balanceCard dshw_low' : 'dshw_balanceCard'
|
|
3021
|
-
style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '8px' }
|
|
3575
|
+
className: low ? 'dshw_balanceCard dshw_low' : 'dshw_balanceCard'
|
|
3022
3576
|
},
|
|
3023
|
-
React.createElement('div', {
|
|
3024
|
-
React.createElement('
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
subParts)),
|
|
3032
|
-
React.createElement('button', {
|
|
3033
|
-
type: 'button',
|
|
3034
|
-
className: 'dshw_btn dshw_btnPrimary',
|
|
3035
|
-
style: { height: '28px', padding: '0 10px', fontSize: '11px', flex: 'none', whiteSpace: 'nowrap' },
|
|
3036
|
-
onClick: onRechargeClick,
|
|
3037
|
-
'aria-label': '前往官方充值'
|
|
3038
|
-
}, '↗ 充值'))
|
|
3577
|
+
React.createElement('div', { className: 'dshw_balLine' },
|
|
3578
|
+
React.createElement('span', { className: 'dshw_muted' }, '\u4f59\u989d'),
|
|
3579
|
+
React.createElement('span', { className: 'dshw_balNum' }, fmtCurrency(first.total_balance, first.currency)),
|
|
3580
|
+
low ? React.createElement('span', { className: 'dshw_balWarn', title: '低于提醒阈值 ' + fmtCurrency(snapshot.threshold !== undefined ? snapshot.threshold : 0, bal.currency || 'CNY') }, '余额偏低') : null),
|
|
3581
|
+
React.createElement('div', { className: 'dshw_balSub' },
|
|
3582
|
+
sessionCostLabel(bal.currency) + ' ' + (official.cost === null ? '--' : sessionCostText(official.cost, bal.currency)),
|
|
3583
|
+
React.createElement('span', { className: 'dshw_balDot' }, '\u00b7'),
|
|
3584
|
+
subParts))
|
|
3039
3585
|
}
|
|
3040
3586
|
|
|
3041
3587
|
// All controls in one bordered card with compact rows; the threshold
|
|
@@ -3173,7 +3719,7 @@ window.__ModuleLoader__.load({
|
|
|
3173
3719
|
}, '清除')),
|
|
3174
3720
|
React.createElement('div', { className: 'dshw_divider' })) : null,
|
|
3175
3721
|
accountsSection(),
|
|
3176
|
-
React.createElement('div', { style: { marginTop: '8px', textAlign: 'right', fontSize: '10px', color: 'var(--dsw-alias-label-
|
|
3722
|
+
React.createElement('div', { style: { marginTop: '8px', textAlign: 'right', fontSize: '10px', color: 'var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))', userSelect: 'none' } }, 'DeepSeek Harness Control Center v' + WALLET_VERSION)
|
|
3177
3723
|
)
|
|
3178
3724
|
|
|
3179
3725
|
if (floated) {
|
|
@@ -3228,7 +3774,7 @@ window.__ModuleLoader__.load({
|
|
|
3228
3774
|
permanentDeleteControl,
|
|
3229
3775
|
showOfficial ? React.createElement(React.Fragment, null,
|
|
3230
3776
|
React.createElement('div', { className: 'dshw_row' },
|
|
3231
|
-
React.createElement('span', { className: 'dshw_muted' }, '阈值(
|
|
3777
|
+
React.createElement('span', { className: 'dshw_muted' }, '阈值(' + (bal.currency || 'CNY') + ',0=关)'),
|
|
3232
3778
|
thresholdInput),
|
|
3233
3779
|
React.createElement('div', { className: 'dshw_row' },
|
|
3234
3780
|
React.createElement('button', { type: 'button', className: 'dshw_btn', onClick: refreshBalance }, '刷新'),
|
|
@@ -3248,7 +3794,7 @@ window.__ModuleLoader__.load({
|
|
|
3248
3794
|
}, '清除余额与 token'),
|
|
3249
3795
|
React.createElement('div', { className: 'dshw_divider' }),
|
|
3250
3796
|
accountsSection(),
|
|
3251
|
-
React.createElement('div', { style: { marginTop: '8px', textAlign: 'right', fontSize: '10px', color: 'var(--dsw-alias-label-
|
|
3797
|
+
React.createElement('div', { style: { marginTop: '8px', textAlign: 'right', fontSize: '10px', color: 'var(--dsw-alias-label-dimmed,var(--dsw-alias-label-tertiary,#8b949e))', userSelect: 'none' } }, 'DeepSeek Harness Control Center v' + WALLET_VERSION)
|
|
3252
3798
|
)
|
|
3253
3799
|
return React.createElement(React.Fragment, null, floatPanel, confirmOverlay)
|
|
3254
3800
|
}
|
|
@@ -3309,6 +3855,8 @@ window.__ModuleLoader__.load({
|
|
|
3309
3855
|
computePanelPosition: computePanelPosition,
|
|
3310
3856
|
createCompatibilityAdapter: createCompatibilityAdapter,
|
|
3311
3857
|
fmtCurrency: fmtCurrency,
|
|
3858
|
+
selectBalanceInfo: selectBalanceInfo,
|
|
3859
|
+
balanceErrorText: balanceErrorText,
|
|
3312
3860
|
installCompletionNotifier: installCompletionNotifier,
|
|
3313
3861
|
normalizeDataVisibility: normalizeDataVisibility,
|
|
3314
3862
|
normalizeNotifyConfig: normalizeNotifyConfig,
|