@v587d/capital-generation 2.27.1 → 2.28.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/CHANGELOG.md +45 -0
- package/README.md +4 -4
- package/automation/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +7 -7
- package/preset/capital-generation/README.md +1 -1
- package/watchlist/client.js +17 -11
- package/watchlist/client.src.cjs +53 -41
- package/watchlist/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,51 @@
|
|
|
7
7
|
- **第三位(patch)**:不破坏既有工具 / 配置 / 会话的新增与修复(如 2.1.1、2.1.2)。
|
|
8
8
|
- **第二位(minor)**:有需要用户知晓的行为变更,且段内附迁移说明(如 2.1.0 的图表呈现通道重做、2.2.0 的数据源与检索来源扩容、2.4.0 的**必须换宿主版本**、2.9.0 的选择器收敛与质检前置——本插件自己的工具与数据契约没变,所以只抬第二位)。
|
|
9
9
|
|
|
10
|
+
## [2.28.0] - 2026-11-20
|
|
11
|
+
|
|
12
|
+
适配 DSH `0.2.2-rc.5`:宿主换了网页搜索的默认提供方、新增一个拒答错误码,本插件的工具、数据契约与会话行为都不变。
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **基线抬到 `0.2.2-rc.5`**:两个 dsh peer 精确 pin 到 rc.5,三颗开发依赖与 lockfile 里的 16 颗 `@deepseek-ai/dsh*` 同步;兼容预检对 rc.5 判定无问题。
|
|
17
|
+
- **依赖面逐包核对**:rc.5 的 325 颗上游包全部抬版本,其中只有 28 颗有 manifest 之外的变化——两条官方升级指南(rc.3 的拒答错误码、rc.4 的搜索默认提供方)都不消费;其余是新增 `deepseek-chat-import` 官方 bundle、新的 `sidebar.session.action` 座位、工作区选择器重构与构建戳。本仓消费的 host 包除版本号外零 diff,`check:dsh` 39 条对 rc.5 全绿(29 条实测 + 10 条按设计 n/a)。
|
|
18
|
+
- **宿主默认搜索变了,Capital 会话不受影响**:rc.4 起 DeepSeek 模型会话的宿主 `web_search` 改走旧版 Messages 搜索(按 token 计费)。本插件自带检索面(AnySearch / Wind / 具名来源 / 本机直连),宿主搜索工具不在 Capital 的 preset 行组合里(`web_fetch` 另在根侧按名 deny,`web_search` 由人设禁用),因此不需要配置 `searchProvider`。
|
|
19
|
+
- **拒答错误码更名为 `CONTENT_REFUSED`**:自动化运行记录里的 `turn/end` 错误码跟着上游变,展示层照旧原样透传(不在码上分支),无需迁移。
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **`npm test` 在 DSH 会话里跑会误红 6 条**:`PythonRuntimeManager` 让 `$DSH_HOME` 优先于夹具传的 `dshHome`,而在 DSH 会话里该变量指向真实 `~/.dsh`——六条夹具把 Python 运行时缓存建到了用户目录,然后找不到自己造的文件。测试文件顶部改为清掉继承来的 `DSH_HOME`,夹具回到临时 home;断言一条未动,CI 行为不变。
|
|
24
|
+
|
|
25
|
+
### Migration
|
|
26
|
+
|
|
27
|
+
- **先升宿主再更新插件**:`0.2.2-rc.5` 是必需版本(peer 精确 pin),rc.2 上启动会被预检 `disabled`,界面上三个模式一起消失。更新后**重启宿主**——运行中的进程仍是旧版内存镜像。
|
|
28
|
+
- 配置、自选股、数据集、图表与历史会话都不迁移;`CONTENT_REFUSED` 只影响新产生的失败记录。
|
|
29
|
+
|
|
30
|
+
### Notes
|
|
31
|
+
|
|
32
|
+
- 五个包版本抬到 `2.28.0`;`LOCAL_FETCH_CLIENT_VERSION` 与 `WIND_CLIENT_VERSION` 同步。
|
|
33
|
+
- 回归:`check:dsh` 39 条全绿(对 rc.5:29 条实测 + 10 条按设计 n/a)、`npm test` 1598/1598、`smoke:boot` 真启动(预设 `broken=null`、13 行 bundle 组件、20/20 族行、4 颗身份闸门、三条自注册路由的 401/200 围栏、settings 条目、反向对照)。判据见 `docs/reference/host-upgrade-analysis-0.2.2-rc.2-to-rc.5.md`。
|
|
34
|
+
- 顺带把 2.22.0 漏入库的 `docs/reference/host-upgrade-analysis-0.2.2-rc.1-to-rc.2.md` 补进 `.gitignore` 白名单(其余升级分析都在库里)。
|
|
35
|
+
- 浏览器侧手工点选(配置卡片、自选股面板、图表卡片)留待重启 rc.5 宿主后按 README 清单过一遍,DOM 与槽位契约已由上述自动化覆盖。
|
|
36
|
+
|
|
37
|
+
## [2.27.2] - 2026-11-19
|
|
38
|
+
|
|
39
|
+
「自选股」行情工作台的详情头瘦身:标题行只留标题与一个信息键,重复的事实删掉、参考读数收起来。
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **六个会话读数收进「分时」旁的 ⓘ**:今开 / 最高 / 最低 / 均价 / 成交量 / 成交额原来铺在分时标题行上,现在收在一张悬停卡片里(鼠标移上去或键盘聚焦展开,点一下钉住,触摸端也能开;Esc 与指针移出收起)。卡片是 2×3 的读数格,标签在上、数值在下,等宽数字;同样的六项也写在按钮的 `aria-label` 上,读屏不丢。
|
|
44
|
+
- **分时标题行只剩「分时 ⓘ」**:右侧的「2026-11-19 收盘」与「收起」都去掉。会话状态没有丢——它跟着六项读数进了信息卡的第一行;折叠功能整条下线(随之删掉 `trendFolded` 状态、`.cwd-folded` / `.cwd-blockfold` 样式与「收起 / 展开」两套文案),两块图仍按 `flex: 1 1 0` 平分详情列高度。
|
|
45
|
+
|
|
46
|
+
### Removed
|
|
47
|
+
|
|
48
|
+
- **详情头里的「标的类型」一格**:行上的类型标签(`A股` / `美股`)已经说了这件事,详情头再写一遍只是重复;meta 区只剩「行情时间」一格,它本来就说明"上面的价格是什么时候印出来的"。
|
|
49
|
+
|
|
50
|
+
### Notes
|
|
51
|
+
|
|
52
|
+
- 五个包版本同步抬到 `2.27.2`;`LOCAL_FETCH_CLIENT_VERSION` 与 `WIND_CLIENT_VERSION` 随版本号更新。用户侧无需迁移,纯前端改动(刷新页面即生效)。
|
|
53
|
+
- 回归:`⛔ 分时标题行只留标题与信息键`(标题行不许再有会话状态与收起键、状态进卡片首行、六项读数齐、折叠态不再存在)、`⛔ 统计收进信息键`(悬停 / 聚焦 / 钉住三条 CSS 揭示规则 + `aria-label` 六字段 + 点击后 `aria-expanded`),以及 meta 只剩「行情时间」的断言。详见 `docs/design/watchlist-intraday-v0.1.md` §11.8。
|
|
54
|
+
|
|
10
55
|
## [2.27.1] - 2026-11-18
|
|
11
56
|
|
|
12
57
|
修掉「分时」块在收盘后必现的加载失败,以及失败态里那个看不出是按钮的「重试」。
|
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<p align="left">
|
|
3
3
|
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
|
|
4
4
|
<a href="https://github.com/v587d/capital-generation"><img src="https://img.shields.io/badge/Financial%20Market-CN%20%7C%20HK%20%7C%20US-orange" alt="Market·CN+HK+US"></a>
|
|
5
|
-
<a href="https://github.com/deepseek-ai"><img src="https://img.shields.io/badge/DSH%20Baseline-0.2.2--rc.
|
|
6
|
-
<a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.
|
|
5
|
+
<a href="https://github.com/deepseek-ai"><img src="https://img.shields.io/badge/DSH%20Baseline-0.2.2--rc.5-blue" alt="DSH@0.2.2-rc.5"></a>
|
|
6
|
+
<a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.28.0-9cf" alt="Version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/@v587d/capital-generation"><img src="https://img.shields.io/npm/v/%40v587d%2Fcapital-generation" alt="npm version"></a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
|
|
|
21
21
|
## 快速上手
|
|
22
22
|
|
|
23
23
|
> [!NOTE]
|
|
24
|
-
> 最新版本已适配 DSH`@0.2.2-rc.
|
|
24
|
+
> 最新版本已适配 DSH`@0.2.2-rc.5`(宿主换了网页搜索的默认提供方,本插件自带检索、工具与数据契约不变)。
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
0. **前置**
|
|
@@ -191,7 +191,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
|
|
|
191
191
|
- **安装后找不到模式?** 确认插件出现在「插件」→ 已安装列表;Web / CLI profile 安装后要重启该 profile,并在新会话选择模式。选择器里应看到自动模式、行情专家、资讯专员;分析师和绘图专员是自动模式的内部角色,不会出现在这里。
|
|
192
192
|
- **配置在哪?** 打开「插件」→ 已安装的 **Capital Generation**,插件介绍下方就是「数据源 / 投研自动化 / 精选 Skills / 包含的组件 / 分析环境」五格,五把密钥都在第一格;第二格可指定任务统一使用的默认工作区,也能改自动检查间隔与最长运行时间等上限;第五格准备 Python 分析环境;不在 DSH 的普通「设置」页面,也不用点进任何一行组件。保存密钥后新建会话再试。
|
|
193
193
|
- **升级到 2.9.0 后,分析师和绘图专员去哪了?** 这一版把它们收进自动模式内部,不再出现在选择器与预设管理里,避免误开一个没有取数入口的空会话。旧会话仍能按原身份恢复;新任务直接用自动模式提出即可。
|
|
194
|
-
- **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.
|
|
194
|
+
- **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.28.0` 或 `@2.28.0`。
|
|
195
195
|
- **刚发布的新版本装不到?** 桌面端取包时会跳过**刚发布不久**的版本(宿主侧包管理器的发布冷却策略,实测会静默装成上一个版本),国内镜像的同步也可能滞后一段时间。急着用最新代码,改用仓库地址安装最直接;但仓库地址安装的是 git 依赖,插件页不显示「版本」检查。
|
|
196
196
|
- **插件页的「版本」段怎么用?** 只有用包名从 npm 安装的版本才有;它只列比当前新的版本。回旧版要先卸载,再安装 `@v587d/capital-generation@版本号`(桌面端地址末尾加 `#v版本号`);旧版必须匹配当前 DSH 基线,对应关系见 [CHANGELOG 的 Migration](CHANGELOG.md)。
|
|
197
197
|
- **网页抓取失败?** 配置卡片中的「允许启动本地提取网页内容」默认开启:AnySearch 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
|
package/automation/package.json
CHANGED
package/chart-ui/package.json
CHANGED
package/config/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Known limit: DNS resolves per request but the IP is not pinned to the connection,
|
|
4
4
|
* so a rebinding window remains (same trade-off as dsh-search-first).
|
|
5
5
|
*/
|
|
6
|
-
export declare const LOCAL_FETCH_CLIENT_VERSION = "2.
|
|
6
|
+
export declare const LOCAL_FETCH_CLIENT_VERSION = "2.28.0";
|
|
7
7
|
export declare const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
|
|
8
8
|
export type LocalFetchErrorCode = 'ABORTED' | 'TIMEOUT' | 'INVALID_URL' | 'BLOCKED_URL' | 'DNS' | 'REDIRECT' | 'HTTP' | 'TOO_LARGE' | 'UNSUPPORTED_CONTENT_TYPE';
|
|
9
9
|
export declare class LocalFetchError extends Error {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* so a rebinding window remains (same trade-off as dsh-search-first).
|
|
5
5
|
*/
|
|
6
6
|
import { htmlToMarkdown, stripInvisibleText } from './html-markdown.js';
|
|
7
|
-
export const LOCAL_FETCH_CLIENT_VERSION = '2.
|
|
7
|
+
export const LOCAL_FETCH_CLIENT_VERSION = '2.28.0';
|
|
8
8
|
export const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
|
|
9
9
|
export class LocalFetchError extends Error {
|
|
10
10
|
code;
|
|
@@ -35,7 +35,7 @@ export interface WindCallResult {
|
|
|
35
35
|
code?: WindErrorCode;
|
|
36
36
|
}
|
|
37
37
|
/** Must match `package.json` version; a test pins the two together. */
|
|
38
|
-
export declare const WIND_CLIENT_VERSION = "2.
|
|
38
|
+
export declare const WIND_CLIENT_VERSION = "2.28.0";
|
|
39
39
|
export interface WindClient {
|
|
40
40
|
callTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<WindCallResult>;
|
|
41
41
|
}
|
|
@@ -19,7 +19,7 @@ export const WIND_SERVER_ENDPOINTS = {
|
|
|
19
19
|
analytics_data: 'https://mcp.wind.com.cn/vserver_analytics_data/mcp/',
|
|
20
20
|
};
|
|
21
21
|
/** Must match `package.json` version; a test pins the two together. */
|
|
22
|
-
export const WIND_CLIENT_VERSION = '2.
|
|
22
|
+
export const WIND_CLIENT_VERSION = '2.28.0';
|
|
23
23
|
function errorText(error) {
|
|
24
24
|
return error instanceof Error ? error.message : String(error);
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v587d/capital-generation",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Capital Generation:面向中国散户的 AI
|
|
3
|
+
"version": "2.28.0",
|
|
4
|
+
"description": "Capital Generation:面向中国散户的 AI 投资助手插件",
|
|
5
5
|
"icon": "assets/cg-icon.png",
|
|
6
6
|
"author": "v587d",
|
|
7
7
|
"license": "MIT",
|
|
@@ -175,14 +175,14 @@
|
|
|
175
175
|
},
|
|
176
176
|
"peerDependencies": {
|
|
177
177
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
178
|
-
"@deepseek-ai/dsh-skill": "0.2.2-rc.
|
|
179
|
-
"@deepseek-ai/dsh-skill-filesystem": "0.2.2-rc.
|
|
178
|
+
"@deepseek-ai/dsh-skill": "0.2.2-rc.5",
|
|
179
|
+
"@deepseek-ai/dsh-skill-filesystem": "0.2.2-rc.5"
|
|
180
180
|
},
|
|
181
181
|
"devDependencies": {
|
|
182
182
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
183
|
-
"@deepseek-ai/dsh-skill": "^0.2.2-rc.
|
|
184
|
-
"@deepseek-ai/dsh-skill-filesystem": "^0.2.2-rc.
|
|
185
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.
|
|
183
|
+
"@deepseek-ai/dsh-skill": "^0.2.2-rc.5",
|
|
184
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.2.2-rc.5",
|
|
185
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.5",
|
|
186
186
|
"@deepseek-ai/schemastery": "^3.19.0",
|
|
187
187
|
"@types/node": "^24.19.2",
|
|
188
188
|
"esbuild": "^0.28.2",
|
package/watchlist/client.js
CHANGED
|
@@ -5,7 +5,7 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
var module = { exports: {} }
|
|
6
6
|
var exports = module.exports
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
|
|
8
|
-
"use strict";var ze=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var Tt=(t,a,i)=>()=>{if(i)throw i[0];try{return t&&(a=t(t=0)),a}catch(r){throw i=[r],r}};var Ht=(t,a)=>{for(var i in a)ze(t,i,{get:a[i],enumerable:!0})},Pt=(t,a,i,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of At(a))!zt.call(t,s)&&s!==i&&ze(t,s,{get:()=>a[s],enumerable:!(r=Mt(a,s))||r.enumerable});return t};var Et=t=>Pt(ze({},"__esModule",{value:!0}),t);var Ye={};Ht(Ye,{ASSET_TYPES:()=>Rt,HOLDABLE_ASSET_TYPES:()=>We,MAX_ROW_WEIGHT_PCT:()=>Ot,MAX_TOTAL_WEIGHT_PCT:()=>It,holdingWeight:()=>Ke,isHoldable:()=>Ft,otherHeldWeightPct:()=>Qe,weightCeiling:()=>Lt});var Rt,We,Ft,Ot,It,Ke,Qe,Lt,Ve=Tt(()=>{"use strict";Rt=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],We=["a-share","fund-etf","hk-stock","us-stock"],Ft=t=>We.includes(t?.asset_type),Ot=100,It=120,Ke=t=>t?.holding===null||t?.holding===void 0?0:t?.holding?.weight_pct??0,Qe=(t,a)=>t.reduce((i,r)=>r?.thscode===a?i:i+Ke(r),0),Lt=(t,a)=>Math.max(0,Math.min(100,120-Qe(t,a)))});var{createElement:e,useEffect:ge,useRef:Ue,useState:A}=require("react"),{createSnapshotStore:Ut}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:ke,IconCloseOutlineRegular:Xe,IconDatabaseOutlineRegular:jt,IconEllipsisOutlineRegular:ot,IconGoalOutlineRegular:ct,IconListPenOutlineRegular:Dt,IconPinOutlineRegular:dt,IconRefreshOutlineRegular:Re,IconSearchOutlineRegular:pt,IconTrashOutlineRegular:Fe,Menu:Oe,MenuItemButton:Ne,Modal:Gt,Switch:qt}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:Ze,weightCeiling:ht}=(Ve(),Et(Ye)),he="capital-watchlist",fe="capital.watchlist",Je="conversation.input.overlay",et="/capital-watchlist",Bt="capital-generation",Wt=300,Te=10,tt="capital-watchlist-css",Kt={"command.label":"\u81EA\u9009\u80A1","command.description":"\u6DFB\u52A0 / \u67E5\u770B / \u5220\u9664\u81EA\u9009\u80A1",title:"\u81EA\u9009\u80A1",close:"\u5173\u95ED",searchPlaceholder:"\u8F93\u5165\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u652F\u6301A\u80A1/\u6E2F\u80A1/\u7F8E\u80A1",add:"\u6DFB\u52A0",added:"\u5DF2\u6DFB\u52A0",refreshing:"\u5237\u65B0\u4E2D\u2026",refresh:"\u5237\u65B0\u62A5\u4EF7",loading:"\u6B63\u5728\u8BFB\u53D6\u6E05\u5355\u2026",empty:"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1\uFF0C\u7528\u4E0A\u9762\u7684\u8F93\u5165\u6846\u6DFB\u52A0\u3002",colName:"\u540D\u79F0",colQuote:"\u6700\u65B0\u4EF7 / \u6DA8\u8DCC\u5E45",colAction:"\u64CD\u4F5C",updated:"\u66F4\u65B0\u65F6\u95F4",notRefreshed:"\u672A\u5237\u65B0",stale:"\u4E0A\u4E00\u6B21\u5FEB\u7167",exchangeTime:"\u4EA4\u6613\u6240\u65F6\u95F4",noChangePct:"\u6682\u65E0\u6DA8\u8DCC\u6570\u636E",typeAShare:"A\u80A1",typeHkStock:"\u6E2F\u80A1",typeUsStock:"\u7F8E\u80A1",typeAIndex:"A\u6307",typeHkIndex:"\u6E2F\u6307",typeUsIndex:"\u7F8E\u6307",kindStock:"\u80A1\u7968",kindIndex:"\u6307\u6570",kindEtf:"ETF",remove:"\u79FB\u9664",more:"\u66F4\u591A",pin:"\u7F6E\u9876",holdingWeightLabel:"\u6301\u4ED3\u6BD4\u4F8B",holdingStepper:"\u6301\u4ED3\u6BD4\u4F8B\uFF08\u6BCF\u6863 10 \u4E2A\u767E\u5206\u70B9\uFF09",holdingStepUp:"\u589E\u52A0\u6301\u4ED3\u6BD4\u4F8B",holdingStepDown:"\u51CF\u5C11\u6301\u4ED3\u6BD4\u4F8B",holdingName:"\u6301\u4ED3",predict:"\u9884\u6D4B",predictTip:"AI\u9884\u6D4B",review:"\u590D\u76D8",reviewTip:"AI\u590D\u76D8",predictPromptPrefix:"\u8BF7\u9884\u6D4B ",predictPromptSuffix:"\uFF1A\u672A\u6765 5 \u4E2A\u4EA4\u6613\u65E5\u7684\u8D70\u52BF\u4E0E\u5173\u952E\u70B9\u4F4D\uFF0C\u8BF4\u660E\u4F9D\u636E\uFF0C\u5E76\u7ED9\u51FA\u5224\u65AD\u7684\u4E0D\u786E\u5B9A\u6027\u3002",reviewPromptPrefix:"\u8BF7\u590D\u76D8 ",reviewPromptSuffix:"\uFF1A\u4ECA\u65E5\u8D70\u52BF\u4E0E\u91CF\u4EF7\u3001\u8FD1 20 \u65E5\u8D8B\u52BF\u3001\u57FA\u7840\u9762\u3001\u6D88\u606F\u9762\uFF0C\u7ED9\u51FA\u7ED3\u8BBA\u548C\u5FC5\u8981\u98CE\u9669\u8BC4\u4F30\u3002",searching:"\u641C\u7D22\u4E2D\u2026",composingHint:"\u8F93\u5165\u5B8C\u6210\u540E\u81EA\u52A8\u641C\u7D22",clearInput:"\u6E05\u7A7A\u8F93\u5165",confirmTitle:"\u786E\u8BA4\u79FB\u9664\uFF1F",confirmDescPrefix:"\u786E\u5B9A\u5C06 ",confirmDescSuffix:" \u4ECE\u81EA\u9009\u4E2D\u79FB\u9664\u5417\uFF1F",confirmCancel:"\u53D6\u6D88",confirmOk:"\u786E\u8BA4\u79FB\u9664",truncated:"\u6CA1\u6709\u66F4\u591A\uFF0C\u8BF7\u8F93\u5165\u51C6\u786E\u7684\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\u3002",filterAll:"\u5168\u90E8",filterLabel:"\u6309\u5E02\u573A\u7B5B\u9009\u5019\u9009",filterNoHit:"\u8FD9\u4E2A\u5E02\u573A\u4E0B\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\u3002",noHit:"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\uFF08A\u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF0C\u542B\u6307\u6570\u4E0E\u573A\u5185\u57FA\u91D1\uFF09\u3002","error.invalid_query":"\u8F93\u5165\u4E0D\u88AB\u63A5\u53D7","error.not_found":"\u6CA1\u6709\u627E\u5230\u8BE5\u6807\u7684","error.ambiguous":"\u547D\u4E2D\u591A\u6761\uFF0C\u8BF7\u4ECE\u5019\u9009\u91CC\u9009\u4E00\u6761","error.list_full":"\u81EA\u9009\u80A1\u6700\u591A {max} \u6761\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.list_full_noMax":"\u81EA\u9009\u80A1\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.credential_missing":"\u672A\u914D\u7F6E Fuyao \u5BC6\u94A5\uFF1A\u5728\u300C\u63D2\u4EF6\u300D\u9875\u7684 \u81EA\u52A8\u6A21\u5F0F\u5361\u7247\u91CC\u586B API Key\uFF08\u53EA\u5F71\u54CD A \u80A1\u90A3\u4E00\u8DEF\uFF0C\u6E2F\u7F8E\u80A1\u7167\u5E38\u7528\uFF09","error.rate_limited":"\u884C\u60C5\u670D\u52A1\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.fuyao_unavailable":"A \u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.tencent_unavailable":"\u6E2F\u7F8E\u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.quote_unavailable":"\u8BE5\u6807\u7684\u6CA1\u6709\u53EF\u7528\u62A5\u4EF7","error.refresh_timeout":"\u5237\u65B0\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.store_unavailable":"\u81EA\u9009\u80A1\u5B58\u50A8\u4E0D\u53EF\u7528","error.unauthorized":"\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548\uFF1A\u8BF7\u5148\u56DE\u5230\u5BBF\u4E3B\u7A97\u53E3\u91CD\u65B0\u767B\u5F55",errorSuffix:"\uFF08\u5176\u4ED6\u6807\u7684\u4ECD\u662F\u4E0A\u4E00\u6B21\u6210\u529F\u5FEB\u7167\uFF09","partial.a-share":"A \u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.hk":"\u6E2F\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.us":"\u7F8E\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","desk.panel":"\u81EA\u9009\u80A1","desk.title":"\u81EA\u9009\u80A1\u884C\u60C5\u5DE5\u4F5C\u53F0","desk.refresh":"\u5237\u65B0\u884C\u60C5","desk.refreshing":"\u5237\u65B0\u4E2D\u2026","desk.loading":"\u6B63\u5728\u8BFB\u53D6\u81EA\u9009\u80A1\u2026","desk.lastUpdate":"\u6700\u8FD1\u66F4\u65B0","desk.notRefreshed":"\u672A\u5237\u65B0","desk.filter":"\u7B5B\u9009\u6807\u7684","desk.filterPlaceholder":"\u540D\u79F0\u6216\u4EE3\u7801","desk.group":"\u5206\u7EC4","desk.allGroups":"\u5168\u90E8","desk.newGroup":"\u5206\u7EC4\u540D\u79F0","desk.createGroup":"\u65B0\u5EFA","desk.deleteGroup":"\u5220\u9664\u5206\u7EC4","desk.noGroup":"\u672A\u5206\u7EC4","desk.more":"\u66F4\u591A\u64CD\u4F5C","desk.noGroupYet":"\u8FD8\u6CA1\u6709\u5206\u7EC4","desk.pin":"\u7F6E\u9876","desk.remove":"\u79FB\u9664","desk.removeHint":"\u518D\u70B9\u4E00\u6B21\u5220\u9664\u6309\u94AE\u786E\u8BA4\u79FB\u9664","desk.cancel":"\u53D6\u6D88","desk.empty":"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1","desk.emptyHint":"\u7528\u8F93\u5165\u6846\u7684\u300C\u81EA\u9009\u80A1\u300D\u9762\u677F\u6DFB\u52A0\u6807\u7684\uFF0C\u8FD9\u91CC\u4F1A\u540C\u6B65\u663E\u793A\u3002","desk.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684","desk.noMatchHint":"\u6362\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u56DE\u300C\u5168\u90E8\u300D\u5206\u7EC4\u3002","desk.selectHint":"\u9009\u62E9\u4E00\u53EA\u6807\u7684\u67E5\u770B\u8BE6\u60C5","desk.selectHintBody":"\u5DE6\u4FA7\u5217\u8868\u6309\u5206\u7EC4\u7B5B\u9009\uFF1B\u9009\u4E2D\u540E\u8FD9\u91CC\u663E\u793A\u62A5\u4EF7\u3001\u5206\u65F6\u4E0E\u6210\u4EA4\u91CF\u3002","desk.intraday":"\u5206\u65F6","desk.trendLoading":"\u6B63\u5728\u8BFB\u53D6\u5206\u65F6\u2026","desk.trendUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u5206\u65F6\u6570\u636E","desk.trendUnavailableHint":"\u573A\u5916\u7F8E\u80A1\u4E0E\u90E8\u5206\u6D77\u5916\u6307\u6570\u6CA1\u6709\u5206\u65F6\u6E90\uFF0C\u8FD9\u91CC\u4E0D\u753B\u5047\u8D70\u52BF\u3002","desk.trendError":"\u5206\u65F6\u52A0\u8F7D\u5931\u8D25","desk.retry":"\u91CD\u8BD5","desk.daily":"\u65E5K","desk.fold":"\u6536\u8D77","desk.unfold":"\u5C55\u5F00","desk.adjustQfq":"\u524D\u590D\u6743","desk.klineLoading":"\u6B63\u5728\u8BFB\u53D6\u65E5K\u2026","desk.klineError":"\u65E5K\u52A0\u8F7D\u5931\u8D25","desk.klineUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u65E5K\u6570\u636E","desk.klineUnavailableHint":"\u6E2F\u7F8E\u80A1\u6307\u6570\u53EA\u6709\u5206\u65F6\uFF0C\u6CA1\u6709\u53EF\u7528\u7684\u65E5\u7EBF\u5E8F\u5217","desk.kOpen":"\u5F00","desk.kHigh":"\u9AD8","desk.kLow":"\u4F4E","desk.kClose":"\u6536","desk.trendLive":"\u76D8\u4E2D","desk.trendClosed":"\u6536\u76D8","desk.trendPrevious":"\u4E0A\u4E00\u4EA4\u6613\u65E5","desk.trendStale":"\u6570\u636E\u6EDE\u540E","desk.trendOpen":"\u4ECA\u5F00","desk.trendHigh":"\u6700\u9AD8","desk.trendLow":"\u6700\u4F4E","desk.trendAvg":"\u5747\u4EF7","desk.trendVolume":"\u6210\u4EA4\u91CF","desk.trendAmount":"\u6210\u4EA4\u989D","desk.lot":"\u624B","desk.share":"\u80A1","desk.trendZoneUs":"\u7F8E\u4E1C","desk.trendZoneHk":"\u9999\u6E2F","desk.capturedAt":"\u884C\u60C5\u65F6\u95F4","desk.groupsOf":"\u6240\u5C5E\u5206\u7EC4","desk.kind":"\u6807\u7684\u7C7B\u578B","desk.colName":"\u540D\u79F0","desk.colPrice":"\u6700\u65B0","desk.colChange":"\u6DA8\u8DCC","desk.colAction":"\u64CD\u4F5C","desk.loadFailed":"\u81EA\u9009\u80A1\u670D\u52A1\u6682\u4E0D\u53EF\u7528"},Qt={"command.label":"Watchlist","command.description":"Add / view / remove watched symbols",title:"Watchlist",close:"Close",searchPlaceholder:"Symbol code or name \u2014 A-share / HK / US",add:"Add",added:"Added",refreshing:"Refreshing\u2026",refresh:"Refresh quotes",loading:"Loading list\u2026",empty:"No symbols yet \u2014 use the input above to add one.",colName:"Symbol",colQuote:"Last / change",colAction:"Actions",updated:"Updated",notRefreshed:"Not refreshed",stale:"last snapshot",exchangeTime:"exchange time",noChangePct:"No change data yet",typeAShare:"A-Share",typeHkStock:"HK",typeUsStock:"US",typeAIndex:"A-Index",typeHkIndex:"HK-Index",typeUsIndex:"US-Index",kindStock:"stock",kindIndex:"index",kindEtf:"ETF",remove:"Remove",more:"More",pin:"Pin to top",holdingWeightLabel:"Holding weight",holdingStepper:"Holding weight, in steps of 10 percentage points",holdingStepUp:"Increase holding weight",holdingStepDown:"Decrease holding weight",holdingName:"Holding",predict:"Predict",predictTip:"AI prediction",review:"Review",reviewTip:"AI review",predictPromptPrefix:"Predict ",predictPromptSuffix:" over the next 5 sessions: the likely path and key levels, the evidence behind the call, and how uncertain it is.",reviewPromptPrefix:"Review ",reviewPromptSuffix:" with today's trend and volume, the last 20 sessions, fundamental, news, then a conclusion and the necessary risks analysis.",searching:"Searching\u2026",composingHint:"Search runs when you finish typing",clearInput:"Clear input",confirmTitle:"Remove this symbol?",confirmDescPrefix:"Remove ",confirmDescSuffix:" from your watchlist?",confirmCancel:"Cancel",confirmOk:"Remove",truncated:"No more candidates \u2014 enter an accurate code or name.",filterAll:"All",filterLabel:"Filter candidates by market",filterNoHit:"No matching symbol in this market.",noHit:"No matching symbol (A-share / HK / US, including indices and listed funds).","error.invalid_query":"Input not accepted","error.not_found":"Symbol not found","error.ambiguous":"Multiple hits \u2014 pick one candidate","error.list_full":"Watchlist holds at most {max} symbols \u2014 remove one first","error.list_full_noMax":"Watchlist is full \u2014 remove one first","error.credential_missing":"No Fuyao API key: set it on the Capital card in the Plugins page (A-share quotes only \u2014 HK and US keep working)","error.rate_limited":"Quote service is rate limited \u2014 try again later","error.fuyao_unavailable":"A-share quotes unavailable \u2014 try again later","error.tencent_unavailable":"HK / US quotes unavailable \u2014 try again later","error.quote_unavailable":"No quote for this symbol","error.refresh_timeout":"Refresh timed out \u2014 try again later","error.store_unavailable":"Watchlist storage unavailable","error.unauthorized":"Session expired \u2014 sign back in to the host first",errorSuffix:" (other symbols still show their last good snapshot)","partial.a-share":"A-share search unavailable: ","partial.hk":"HK search unavailable: ","partial.us":"US search unavailable: ","desk.panel":"Watchlist","desk.title":"Watchlist market desk","desk.refresh":"Refresh quotes","desk.refreshing":"Refreshing\u2026","desk.loading":"Loading watchlist\u2026","desk.lastUpdate":"Last update","desk.notRefreshed":"Not refreshed","desk.filter":"Filter symbols","desk.filterPlaceholder":"Name or code","desk.group":"Group","desk.allGroups":"All","desk.newGroup":"Group name","desk.createGroup":"Create","desk.deleteGroup":"Delete group","desk.noGroup":"Ungrouped","desk.more":"More actions","desk.noGroupYet":"No groups yet","desk.pin":"Pin","desk.remove":"Remove","desk.removeHint":"Press remove again to confirm","desk.cancel":"Cancel","desk.empty":"No symbols yet","desk.emptyHint":"Add symbols from the watchlist panel in the composer; they appear here.","desk.noMatch":"No symbols match","desk.noMatchHint":"Try another term, or switch back to All.","desk.selectHint":"Select a symbol","desk.selectHintBody":"The left list filters by group; the quote, intraday and volume panels follow the selection.","desk.intraday":"Intraday","desk.trendLoading":"Loading intraday\u2026","desk.trendUnavailable":"No intraday series for this market","desk.trendUnavailableHint":"OTC US lines and some overseas indices have no intraday source; nothing is drawn to fill the gap.","desk.trendError":"Intraday failed to load","desk.retry":"Retry","desk.daily":"Daily","desk.fold":"Collapse","desk.unfold":"Expand","desk.adjustQfq":"Forward-adjusted","desk.klineLoading":"Loading daily bars\u2026","desk.klineError":"Daily bars failed to load","desk.klineUnavailable":"No daily bars for this market","desk.klineUnavailableHint":"HK/US indices carry an intraday series only","desk.kOpen":"Open","desk.kHigh":"High","desk.kLow":"Low","desk.kClose":"Close","desk.trendLive":"Live","desk.trendClosed":"Closed","desk.trendPrevious":"Previous session","desk.trendStale":"Stale","desk.trendOpen":"Open","desk.trendHigh":"High","desk.trendLow":"Low","desk.trendAvg":"VWAP","desk.trendVolume":"Volume","desk.trendAmount":"Turnover","desk.lot":"lots","desk.share":"shares","desk.trendZoneUs":"ET","desk.trendZoneHk":"HK","desk.capturedAt":"As of","desk.groupsOf":"Groups","desk.kind":"Instrument","desk.colName":"Symbol","desk.colPrice":"Last","desk.colChange":"Change","desk.colAction":"Actions","desk.loadFailed":"Watchlist service unavailable"},Yt={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},Vt={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function ut(t,a){let i=Yt[t];return i===void 0?String(t??""):a(i)}function Xt(t,a){let i=Vt[t];return i===void 0?String(t??""):a(i)}var Zt=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function xe(t){return String(t??"").replace(Zt,"")}function ce(t){return Array.isArray(t)?t.map(a=>a===null||typeof a!="object"?a:{...a,name:xe(a.name)}):t}var Jt={"a-share":"capital-watchlist-tag-cn","a-share-index":"capital-watchlist-tag-cn","fund-etf":"capital-watchlist-tag-cn","hk-stock":"capital-watchlist-tag-hk","hk-index":"capital-watchlist-tag-hk","us-stock":"capital-watchlist-tag-us","us-index":"capital-watchlist-tag-us"},wt=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],at=t=>t.exchange==="HK"?"hk":t.exchange==="US"?"us":"cn",ea=`
|
|
8
|
+
"use strict";var ze=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var Pt=(t,a,i)=>()=>{if(i)throw i[0];try{return t&&(a=t(t=0)),a}catch(r){throw i=[r],r}};var Tt=(t,a)=>{for(var i in a)ze(t,i,{get:a[i],enumerable:!0})},Ht=(t,a,i,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of At(a))!zt.call(t,s)&&s!==i&&ze(t,s,{get:()=>a[s],enumerable:!(r=Mt(a,s))||r.enumerable});return t};var Et=t=>Ht(ze({},"__esModule",{value:!0}),t);var Xe={};Tt(Xe,{ASSET_TYPES:()=>Rt,HOLDABLE_ASSET_TYPES:()=>Qe,MAX_ROW_WEIGHT_PCT:()=>Ft,MAX_TOTAL_WEIGHT_PCT:()=>It,holdingWeight:()=>Ye,isHoldable:()=>Ot,otherHeldWeightPct:()=>Ve,weightCeiling:()=>Lt});var Rt,Qe,Ot,Ft,It,Ye,Ve,Lt,Ze=Pt(()=>{"use strict";Rt=["a-share","a-share-index","fund-etf","hk-stock","hk-index","us-stock","us-index"],Qe=["a-share","fund-etf","hk-stock","us-stock"],Ot=t=>Qe.includes(t?.asset_type),Ft=100,It=120,Ye=t=>t?.holding===null||t?.holding===void 0?0:t?.holding?.weight_pct??0,Ve=(t,a)=>t.reduce((i,r)=>r?.thscode===a?i:i+Ye(r),0),Lt=(t,a)=>Math.max(0,Math.min(100,120-Ve(t,a)))});var{createElement:e,useEffect:ge,useRef:Ue,useState:M}=require("react"),{createSnapshotStore:Ut}=require("@deepseek-ai/dsh-client-store"),{IconChecklistOutlineRegular:ke,IconCloseOutlineRegular:Je,IconDatabaseOutlineRegular:jt,IconEllipsisOutlineRegular:dt,IconInfoOutlineRegular:Dt,IconGoalOutlineRegular:pt,IconListPenOutlineRegular:Gt,IconPinOutlineRegular:ht,IconRefreshOutlineRegular:Re,IconSearchOutlineRegular:ut,IconTrashOutlineRegular:Oe,Menu:Fe,MenuItemButton:Ne,Modal:qt,Switch:Bt}=require("@deepseek-ai/dsh-client-ui-primitives"),{isHoldable:et,weightCeiling:wt}=(Ze(),Et(Xe)),ue="capital-watchlist",fe="capital.watchlist",tt="conversation.input.overlay",at="/capital-watchlist",Wt="capital-generation",Kt=300,Pe=10,it="capital-watchlist-css",Qt={"command.label":"\u81EA\u9009\u80A1","command.description":"\u6DFB\u52A0 / \u67E5\u770B / \u5220\u9664\u81EA\u9009\u80A1",title:"\u81EA\u9009\u80A1",close:"\u5173\u95ED",searchPlaceholder:"\u8F93\u5165\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u652F\u6301A\u80A1/\u6E2F\u80A1/\u7F8E\u80A1",add:"\u6DFB\u52A0",added:"\u5DF2\u6DFB\u52A0",refreshing:"\u5237\u65B0\u4E2D\u2026",refresh:"\u5237\u65B0\u62A5\u4EF7",loading:"\u6B63\u5728\u8BFB\u53D6\u6E05\u5355\u2026",empty:"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1\uFF0C\u7528\u4E0A\u9762\u7684\u8F93\u5165\u6846\u6DFB\u52A0\u3002",colName:"\u540D\u79F0",colQuote:"\u6700\u65B0\u4EF7 / \u6DA8\u8DCC\u5E45",colAction:"\u64CD\u4F5C",updated:"\u66F4\u65B0\u65F6\u95F4",notRefreshed:"\u672A\u5237\u65B0",stale:"\u4E0A\u4E00\u6B21\u5FEB\u7167",exchangeTime:"\u4EA4\u6613\u6240\u65F6\u95F4",noChangePct:"\u6682\u65E0\u6DA8\u8DCC\u6570\u636E",typeAShare:"A\u80A1",typeHkStock:"\u6E2F\u80A1",typeUsStock:"\u7F8E\u80A1",typeAIndex:"A\u6307",typeHkIndex:"\u6E2F\u6307",typeUsIndex:"\u7F8E\u6307",kindStock:"\u80A1\u7968",kindIndex:"\u6307\u6570",kindEtf:"ETF",remove:"\u79FB\u9664",more:"\u66F4\u591A",pin:"\u7F6E\u9876",holdingWeightLabel:"\u6301\u4ED3\u6BD4\u4F8B",holdingStepper:"\u6301\u4ED3\u6BD4\u4F8B\uFF08\u6BCF\u6863 10 \u4E2A\u767E\u5206\u70B9\uFF09",holdingStepUp:"\u589E\u52A0\u6301\u4ED3\u6BD4\u4F8B",holdingStepDown:"\u51CF\u5C11\u6301\u4ED3\u6BD4\u4F8B",holdingName:"\u6301\u4ED3",predict:"\u9884\u6D4B",predictTip:"AI\u9884\u6D4B",review:"\u590D\u76D8",reviewTip:"AI\u590D\u76D8",predictPromptPrefix:"\u8BF7\u9884\u6D4B ",predictPromptSuffix:"\uFF1A\u672A\u6765 5 \u4E2A\u4EA4\u6613\u65E5\u7684\u8D70\u52BF\u4E0E\u5173\u952E\u70B9\u4F4D\uFF0C\u8BF4\u660E\u4F9D\u636E\uFF0C\u5E76\u7ED9\u51FA\u5224\u65AD\u7684\u4E0D\u786E\u5B9A\u6027\u3002",reviewPromptPrefix:"\u8BF7\u590D\u76D8 ",reviewPromptSuffix:"\uFF1A\u4ECA\u65E5\u8D70\u52BF\u4E0E\u91CF\u4EF7\u3001\u8FD1 20 \u65E5\u8D8B\u52BF\u3001\u57FA\u7840\u9762\u3001\u6D88\u606F\u9762\uFF0C\u7ED9\u51FA\u7ED3\u8BBA\u548C\u5FC5\u8981\u98CE\u9669\u8BC4\u4F30\u3002",searching:"\u641C\u7D22\u4E2D\u2026",composingHint:"\u8F93\u5165\u5B8C\u6210\u540E\u81EA\u52A8\u641C\u7D22",clearInput:"\u6E05\u7A7A\u8F93\u5165",confirmTitle:"\u786E\u8BA4\u79FB\u9664\uFF1F",confirmDescPrefix:"\u786E\u5B9A\u5C06 ",confirmDescSuffix:" \u4ECE\u81EA\u9009\u4E2D\u79FB\u9664\u5417\uFF1F",confirmCancel:"\u53D6\u6D88",confirmOk:"\u786E\u8BA4\u79FB\u9664",truncated:"\u6CA1\u6709\u66F4\u591A\uFF0C\u8BF7\u8F93\u5165\u51C6\u786E\u7684\u8BC1\u5238\u4EE3\u7801\u6216\u540D\u79F0\u3002",filterAll:"\u5168\u90E8",filterLabel:"\u6309\u5E02\u573A\u7B5B\u9009\u5019\u9009",filterNoHit:"\u8FD9\u4E2A\u5E02\u573A\u4E0B\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\u3002",noHit:"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684\uFF08A\u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF0C\u542B\u6307\u6570\u4E0E\u573A\u5185\u57FA\u91D1\uFF09\u3002","error.invalid_query":"\u8F93\u5165\u4E0D\u88AB\u63A5\u53D7","error.not_found":"\u6CA1\u6709\u627E\u5230\u8BE5\u6807\u7684","error.ambiguous":"\u547D\u4E2D\u591A\u6761\uFF0C\u8BF7\u4ECE\u5019\u9009\u91CC\u9009\u4E00\u6761","error.list_full":"\u81EA\u9009\u80A1\u6700\u591A {max} \u6761\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.list_full_noMax":"\u81EA\u9009\u80A1\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u5148\u5220\u4E00\u6761\u518D\u52A0","error.credential_missing":"\u672A\u914D\u7F6E Fuyao \u5BC6\u94A5\uFF1A\u5728\u300C\u63D2\u4EF6\u300D\u9875\u7684 \u81EA\u52A8\u6A21\u5F0F\u5361\u7247\u91CC\u586B API Key\uFF08\u53EA\u5F71\u54CD A \u80A1\u90A3\u4E00\u8DEF\uFF0C\u6E2F\u7F8E\u80A1\u7167\u5E38\u7528\uFF09","error.rate_limited":"\u884C\u60C5\u670D\u52A1\u9650\u6D41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.fuyao_unavailable":"A \u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.tencent_unavailable":"\u6E2F\u7F8E\u80A1\u884C\u60C5\u6682\u65F6\u53D6\u4E0D\u5230\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.quote_unavailable":"\u8BE5\u6807\u7684\u6CA1\u6709\u53EF\u7528\u62A5\u4EF7","error.refresh_timeout":"\u5237\u65B0\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5","error.store_unavailable":"\u81EA\u9009\u80A1\u5B58\u50A8\u4E0D\u53EF\u7528","error.unauthorized":"\u767B\u5F55\u72B6\u6001\u5DF2\u5931\u6548\uFF1A\u8BF7\u5148\u56DE\u5230\u5BBF\u4E3B\u7A97\u53E3\u91CD\u65B0\u767B\u5F55",errorSuffix:"\uFF08\u5176\u4ED6\u6807\u7684\u4ECD\u662F\u4E0A\u4E00\u6B21\u6210\u529F\u5FEB\u7167\uFF09","partial.a-share":"A \u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.hk":"\u6E2F\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","partial.us":"\u7F8E\u80A1\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A","desk.panel":"\u81EA\u9009\u80A1","desk.title":"\u81EA\u9009\u80A1\u884C\u60C5\u5DE5\u4F5C\u53F0","desk.refresh":"\u5237\u65B0\u884C\u60C5","desk.refreshing":"\u5237\u65B0\u4E2D\u2026","desk.loading":"\u6B63\u5728\u8BFB\u53D6\u81EA\u9009\u80A1\u2026","desk.lastUpdate":"\u6700\u8FD1\u66F4\u65B0","desk.notRefreshed":"\u672A\u5237\u65B0","desk.filter":"\u7B5B\u9009\u6807\u7684","desk.filterPlaceholder":"\u540D\u79F0\u6216\u4EE3\u7801","desk.group":"\u5206\u7EC4","desk.allGroups":"\u5168\u90E8","desk.newGroup":"\u5206\u7EC4\u540D\u79F0","desk.createGroup":"\u65B0\u5EFA","desk.deleteGroup":"\u5220\u9664\u5206\u7EC4","desk.noGroup":"\u672A\u5206\u7EC4","desk.more":"\u66F4\u591A\u64CD\u4F5C","desk.noGroupYet":"\u8FD8\u6CA1\u6709\u5206\u7EC4","desk.pin":"\u7F6E\u9876","desk.remove":"\u79FB\u9664","desk.removeHint":"\u518D\u70B9\u4E00\u6B21\u5220\u9664\u6309\u94AE\u786E\u8BA4\u79FB\u9664","desk.cancel":"\u53D6\u6D88","desk.empty":"\u8FD8\u6CA1\u6709\u81EA\u9009\u80A1","desk.emptyHint":"\u7528\u8F93\u5165\u6846\u7684\u300C\u81EA\u9009\u80A1\u300D\u9762\u677F\u6DFB\u52A0\u6807\u7684\uFF0C\u8FD9\u91CC\u4F1A\u540C\u6B65\u663E\u793A\u3002","desk.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u6807\u7684","desk.noMatchHint":"\u6362\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u56DE\u300C\u5168\u90E8\u300D\u5206\u7EC4\u3002","desk.selectHint":"\u9009\u62E9\u4E00\u53EA\u6807\u7684\u67E5\u770B\u8BE6\u60C5","desk.selectHintBody":"\u5DE6\u4FA7\u5217\u8868\u6309\u5206\u7EC4\u7B5B\u9009\uFF1B\u9009\u4E2D\u540E\u8FD9\u91CC\u663E\u793A\u62A5\u4EF7\u3001\u5206\u65F6\u4E0E\u6210\u4EA4\u91CF\u3002","desk.intraday":"\u5206\u65F6","desk.trendLoading":"\u6B63\u5728\u8BFB\u53D6\u5206\u65F6\u2026","desk.trendUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u5206\u65F6\u6570\u636E","desk.trendUnavailableHint":"\u573A\u5916\u7F8E\u80A1\u4E0E\u90E8\u5206\u6D77\u5916\u6307\u6570\u6CA1\u6709\u5206\u65F6\u6E90\uFF0C\u8FD9\u91CC\u4E0D\u753B\u5047\u8D70\u52BF\u3002","desk.trendError":"\u5206\u65F6\u52A0\u8F7D\u5931\u8D25","desk.retry":"\u91CD\u8BD5","desk.daily":"\u65E5K","desk.adjustQfq":"\u524D\u590D\u6743","desk.klineLoading":"\u6B63\u5728\u8BFB\u53D6\u65E5K\u2026","desk.klineError":"\u65E5K\u52A0\u8F7D\u5931\u8D25","desk.klineUnavailable":"\u8BE5\u5E02\u573A\u6682\u65F6\u6CA1\u6709\u65E5K\u6570\u636E","desk.klineUnavailableHint":"\u6E2F\u7F8E\u80A1\u6307\u6570\u53EA\u6709\u5206\u65F6\uFF0C\u6CA1\u6709\u53EF\u7528\u7684\u65E5\u7EBF\u5E8F\u5217","desk.kOpen":"\u5F00","desk.kHigh":"\u9AD8","desk.kLow":"\u4F4E","desk.kClose":"\u6536","desk.trendLive":"\u76D8\u4E2D","desk.trendClosed":"\u6536\u76D8","desk.trendPrevious":"\u4E0A\u4E00\u4EA4\u6613\u65E5","desk.trendStale":"\u6570\u636E\u6EDE\u540E","desk.trendOpen":"\u4ECA\u5F00","desk.trendHigh":"\u6700\u9AD8","desk.trendLow":"\u6700\u4F4E","desk.trendAvg":"\u5747\u4EF7","desk.trendVolume":"\u6210\u4EA4\u91CF","desk.trendAmount":"\u6210\u4EA4\u989D","desk.stats":"\u884C\u60C5\u7EDF\u8BA1","desk.lot":"\u624B","desk.share":"\u80A1","desk.trendZoneUs":"\u7F8E\u4E1C","desk.trendZoneHk":"\u9999\u6E2F","desk.capturedAt":"\u884C\u60C5\u65F6\u95F4","desk.groupsOf":"\u6240\u5C5E\u5206\u7EC4","desk.colName":"\u540D\u79F0","desk.colPrice":"\u6700\u65B0","desk.colChange":"\u6DA8\u8DCC","desk.colAction":"\u64CD\u4F5C","desk.loadFailed":"\u81EA\u9009\u80A1\u670D\u52A1\u6682\u4E0D\u53EF\u7528"},Yt={"command.label":"Watchlist","command.description":"Add / view / remove watched symbols",title:"Watchlist",close:"Close",searchPlaceholder:"Symbol code or name \u2014 A-share / HK / US",add:"Add",added:"Added",refreshing:"Refreshing\u2026",refresh:"Refresh quotes",loading:"Loading list\u2026",empty:"No symbols yet \u2014 use the input above to add one.",colName:"Symbol",colQuote:"Last / change",colAction:"Actions",updated:"Updated",notRefreshed:"Not refreshed",stale:"last snapshot",exchangeTime:"exchange time",noChangePct:"No change data yet",typeAShare:"A-Share",typeHkStock:"HK",typeUsStock:"US",typeAIndex:"A-Index",typeHkIndex:"HK-Index",typeUsIndex:"US-Index",kindStock:"stock",kindIndex:"index",kindEtf:"ETF",remove:"Remove",more:"More",pin:"Pin to top",holdingWeightLabel:"Holding weight",holdingStepper:"Holding weight, in steps of 10 percentage points",holdingStepUp:"Increase holding weight",holdingStepDown:"Decrease holding weight",holdingName:"Holding",predict:"Predict",predictTip:"AI prediction",review:"Review",reviewTip:"AI review",predictPromptPrefix:"Predict ",predictPromptSuffix:" over the next 5 sessions: the likely path and key levels, the evidence behind the call, and how uncertain it is.",reviewPromptPrefix:"Review ",reviewPromptSuffix:" with today's trend and volume, the last 20 sessions, fundamental, news, then a conclusion and the necessary risks analysis.",searching:"Searching\u2026",composingHint:"Search runs when you finish typing",clearInput:"Clear input",confirmTitle:"Remove this symbol?",confirmDescPrefix:"Remove ",confirmDescSuffix:" from your watchlist?",confirmCancel:"Cancel",confirmOk:"Remove",truncated:"No more candidates \u2014 enter an accurate code or name.",filterAll:"All",filterLabel:"Filter candidates by market",filterNoHit:"No matching symbol in this market.",noHit:"No matching symbol (A-share / HK / US, including indices and listed funds).","error.invalid_query":"Input not accepted","error.not_found":"Symbol not found","error.ambiguous":"Multiple hits \u2014 pick one candidate","error.list_full":"Watchlist holds at most {max} symbols \u2014 remove one first","error.list_full_noMax":"Watchlist is full \u2014 remove one first","error.credential_missing":"No Fuyao API key: set it on the Capital card in the Plugins page (A-share quotes only \u2014 HK and US keep working)","error.rate_limited":"Quote service is rate limited \u2014 try again later","error.fuyao_unavailable":"A-share quotes unavailable \u2014 try again later","error.tencent_unavailable":"HK / US quotes unavailable \u2014 try again later","error.quote_unavailable":"No quote for this symbol","error.refresh_timeout":"Refresh timed out \u2014 try again later","error.store_unavailable":"Watchlist storage unavailable","error.unauthorized":"Session expired \u2014 sign back in to the host first",errorSuffix:" (other symbols still show their last good snapshot)","partial.a-share":"A-share search unavailable: ","partial.hk":"HK search unavailable: ","partial.us":"US search unavailable: ","desk.panel":"Watchlist","desk.title":"Watchlist market desk","desk.refresh":"Refresh quotes","desk.refreshing":"Refreshing\u2026","desk.loading":"Loading watchlist\u2026","desk.lastUpdate":"Last update","desk.notRefreshed":"Not refreshed","desk.filter":"Filter symbols","desk.filterPlaceholder":"Name or code","desk.group":"Group","desk.allGroups":"All","desk.newGroup":"Group name","desk.createGroup":"Create","desk.deleteGroup":"Delete group","desk.noGroup":"Ungrouped","desk.more":"More actions","desk.noGroupYet":"No groups yet","desk.pin":"Pin","desk.remove":"Remove","desk.removeHint":"Press remove again to confirm","desk.cancel":"Cancel","desk.empty":"No symbols yet","desk.emptyHint":"Add symbols from the watchlist panel in the composer; they appear here.","desk.noMatch":"No symbols match","desk.noMatchHint":"Try another term, or switch back to All.","desk.selectHint":"Select a symbol","desk.selectHintBody":"The left list filters by group; the quote, intraday and volume panels follow the selection.","desk.intraday":"Intraday","desk.trendLoading":"Loading intraday\u2026","desk.trendUnavailable":"No intraday series for this market","desk.trendUnavailableHint":"OTC US lines and some overseas indices have no intraday source; nothing is drawn to fill the gap.","desk.trendError":"Intraday failed to load","desk.retry":"Retry","desk.daily":"Daily","desk.adjustQfq":"Forward-adjusted","desk.klineLoading":"Loading daily bars\u2026","desk.klineError":"Daily bars failed to load","desk.klineUnavailable":"No daily bars for this market","desk.klineUnavailableHint":"HK/US indices carry an intraday series only","desk.kOpen":"Open","desk.kHigh":"High","desk.kLow":"Low","desk.kClose":"Close","desk.trendLive":"Live","desk.trendClosed":"Closed","desk.trendPrevious":"Previous session","desk.trendStale":"Stale","desk.trendOpen":"Open","desk.trendHigh":"High","desk.trendLow":"Low","desk.trendAvg":"VWAP","desk.trendVolume":"Volume","desk.trendAmount":"Turnover","desk.stats":"Session stats","desk.lot":"lots","desk.share":"shares","desk.trendZoneUs":"ET","desk.trendZoneHk":"HK","desk.capturedAt":"As of","desk.groupsOf":"Groups","desk.colName":"Symbol","desk.colPrice":"Last","desk.colChange":"Change","desk.colAction":"Actions","desk.loadFailed":"Watchlist service unavailable"},Vt={"a-share":"typeAShare","hk-stock":"typeHkStock","us-stock":"typeUsStock","a-share-index":"typeAIndex","hk-index":"typeHkIndex","us-index":"typeUsIndex","fund-etf":"typeAShare"},Xt={"a-share":"kindStock","hk-stock":"kindStock","us-stock":"kindStock","a-share-index":"kindIndex","hk-index":"kindIndex","us-index":"kindIndex","fund-etf":"kindEtf"};function Zt(t,a){let i=Vt[t];return i===void 0?String(t??""):a(i)}function Jt(t,a){let i=Xt[t];return i===void 0?String(t??""):a(i)}var ea=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u200B-\u200F\u2028\u2029\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/gu;function xe(t){return String(t??"").replace(ea,"")}function de(t){return Array.isArray(t)?t.map(a=>a===null||typeof a!="object"?a:{...a,name:xe(a.name)}):t}var ta={"a-share":"capital-watchlist-tag-cn","a-share-index":"capital-watchlist-tag-cn","fund-etf":"capital-watchlist-tag-cn","hk-stock":"capital-watchlist-tag-hk","hk-index":"capital-watchlist-tag-hk","us-stock":"capital-watchlist-tag-us","us-index":"capital-watchlist-tag-us"},mt=[{id:"all"},{id:"cn",label:"CN"},{id:"hk",label:"HK"},{id:"us",label:"US"}],st=t=>t.exchange==="HK"?"hk":t.exchange==="US"?"us":"cn",aa=`
|
|
9
9
|
.capital-watchlist-dialog.capital-watchlist-dialog { width: min(420px, 92vw); max-height: 100%; padding: 0; gap: 0; border-radius: 18px; }
|
|
10
10
|
.capital-watchlist-card { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: 18px; --capital-watchlist-up: #d1493f; --capital-watchlist-down: #17a063; --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }
|
|
11
11
|
.capital-watchlist-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 20px 14px; }
|
|
@@ -187,13 +187,9 @@ window.__ModuleLoader__.load({
|
|
|
187
187
|
.cwd-metavalue { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
188
188
|
.cwd-block { flex: none; padding-top: 12px; border-top: .5px solid var(--dsw-alias-border-l2); }
|
|
189
189
|
.cwd-block-chart { flex: 1 1 0; display: flex; flex-direction: column; min-height: 200px; }
|
|
190
|
-
/* Folded block keeps only its title row, so it stops competing for height. */
|
|
191
|
-
.cwd-block-chart.cwd-folded { flex: none; min-height: 0; }
|
|
192
190
|
.cwd-blockhead { display: flex; flex: none; align-items: baseline; gap: 12px; margin-bottom: 8px; }
|
|
193
191
|
.cwd-blocktitle { flex: none; font-size: 12.5px; line-height: 18px; font-weight: 600; }
|
|
194
192
|
.cwd-blocknote { margin-left: auto; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
|
|
195
|
-
.cwd-blockfold { flex: none; padding: 0 2px; border: 0; background: none; font-family: inherit; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); cursor: pointer; }
|
|
196
|
-
.cwd-blockfold:hover { color: var(--dsw-alias-label-primary); }
|
|
197
193
|
.cwd-chart { flex: 1; min-height: 150px; display: grid; place-items: center; padding: 12px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 10px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent) 0 1px, transparent 1px 36px), var(--dsw-alias-bg-module-platform); text-align: center; }
|
|
198
194
|
.cwd-charttext { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
|
|
199
195
|
.cwd-charthint { margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
|
|
@@ -204,11 +200,21 @@ window.__ModuleLoader__.load({
|
|
|
204
200
|
.cwd-retry:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 22%, transparent); }
|
|
205
201
|
.cwd-retry:active { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 30%, transparent); }
|
|
206
202
|
.cwd-retry:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 60%, transparent); outline-offset: 2px; }
|
|
207
|
-
.cwd-
|
|
208
|
-
.cwd-
|
|
203
|
+
.cwd-statsbox { position: relative; display: inline-flex; align-items: center; flex: none; align-self: center; }
|
|
204
|
+
.cwd-statsinfo { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dsw-alias-label-tertiary); cursor: help; }
|
|
205
|
+
.cwd-statsinfo:hover, .cwd-statsinfo:focus-visible, .cwd-statsbox-pinned .cwd-statsinfo { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover-accent); }
|
|
206
|
+
.cwd-statsinfo:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 55%, transparent); outline-offset: 1px; }
|
|
207
|
+
/* The padding on the panel is the hover bridge: the card starts 8px below the icon without a dead
|
|
208
|
+
strip where the pointer would drop the hover. */
|
|
209
|
+
.cwd-statspanel { position: absolute; top: 100%; left: -10px; z-index: 8; padding-top: 8px; opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility .12s ease; }
|
|
210
|
+
.cwd-statsbox:hover .cwd-statspanel, .cwd-statsbox:focus-within .cwd-statspanel, .cwd-statsbox-pinned .cwd-statspanel { opacity: 1; visibility: visible; }
|
|
211
|
+
.cwd-statscard { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px; border: .5px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); box-shadow: var(--dsw-elevation-prominent); }
|
|
212
|
+
.cwd-statscap { font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
|
|
213
|
+
.cwd-statsgrid { display: grid; grid-template-columns: repeat(3, minmax(66px, auto)); gap: 7px 20px; }
|
|
214
|
+
.cwd-trendstat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
209
215
|
.cwd-trendstat span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
210
|
-
.cwd-trendstat span:first-child { flex: none; color: var(--dsw-alias-label-tertiary); }
|
|
211
|
-
.cwd-trendstat span:last-child { font-variant-numeric: tabular-nums; }
|
|
216
|
+
.cwd-trendstat span:first-child { flex: none; font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); }
|
|
217
|
+
.cwd-trendstat span:last-child { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }
|
|
212
218
|
.cwd-chartbox { position: relative; flex: 1; min-height: 120px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
|
|
213
219
|
/* The daily pane shares the SVG contract above (absolute child, determinate height): a flexed chart
|
|
214
220
|
next to a scrolled column is exactly how the container used to grow. */
|
|
@@ -254,8 +260,8 @@ window.__ModuleLoader__.load({
|
|
|
254
260
|
.cwd-skeleton { display: block; height: 12px; border-radius: 6px; background: var(--dsw-alias-bg-skeleton); }
|
|
255
261
|
@media (max-width: 1040px) { .cwd-body { flex: none; grid-template-columns: minmax(0, 1fr); gap: 16px; height: auto; max-height: none; } .cwd-card { height: auto; } .cwd-tablebody { flex: none; max-height: 60vh; } .cwd-chart { flex: none; height: 200px; } .cwd-chartbox { flex: none; height: 260px; } .cwd-klinebox { flex: none; height: 260px; } .cwd-block-chart, .cwd-block-kline { flex: none; } }
|
|
256
262
|
@media (max-width: 720px) { .cwd-inner { padding: 20px 16px 32px; } .cwd-thead, .cwd-row { grid-template-columns: minmax(0, 1.5fr) 78px 72px 36px; gap: 8px; } .cwd-thead { padding: 8px 10px; } .cwd-row { padding: 9px 10px; } }
|
|
257
|
-
`;function
|
|
258
|
-
`);return await navigator.clipboard.writeText(a),a}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function $e(t){if(typeof t!="number"||!Number.isFinite(t))return"";let a=new Date(t),i=r=>String(r).padStart(2,"0");return`${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}`}function Se({assetType:t,t:a}){return e("span",{className:`capital-watchlist-tag ${Jt[t]??"capital-watchlist-tag-cn"}`},ut(t,a))}function aa(t,a,i){let r=xe(t.name);return`${a(`${i}PromptPrefix`)}${r} (${t.thscode} \xB7 ${Xt(t.asset_type,a)})${a(`${i}PromptSuffix`)}`}function ia({quote:t,failureCode:a,refreshing:i,t:r}){let s=a!==void 0;if(t==null)return i===!0?e("div",{className:"capital-watchlist-quote"},e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):s?e("div",{className:"capital-watchlist-quote",title:r(`error.${a}`)},e("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):e("div",{className:"capital-watchlist-quote"},e("div",{className:"capital-watchlist-price"},r("notRefreshed")));let w=typeof t.change_pct=="number"&&Number.isFinite(t.change_pct),g=w?`${t.change_pct>0?"+":""}${t.change_pct.toFixed(2)}%`:"\u2014",c=s?"capital-watchlist-stale":w?t.change_pct>0?"capital-watchlist-up":t.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",d=typeof t.source_time=="string"&&t.source_time.length>0?`${r("exchangeTime")} ${t.source_time}`:"",x=[];return s?x.push(`${r(`error.${a}`)} \xB7 ${r("stale")} ${$e(t.captured_at)}`):w||x.push(r("noChangePct")),d.length>0&&x.push(d),e("div",{className:"capital-watchlist-quote",title:x.length===0?void 0:x.join(" \xB7 ")},e("div",{className:s?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},t.price.toFixed(2)),e("div",{className:`capital-watchlist-change ${c}`},g))}function sa(t,a){if(a.code!=="list_full")return t(`error.${a.code}`);let i=a.limit;return typeof i!="number"||!Number.isFinite(i)?t("error.list_full_noMax"):t("error.list_full").replace("{max}",String(i))}function la(t,a){let i=t?.weight_pct;return i==null?a("holdingName"):`${a("holdingName")} ${i}%`}function na(t,a){let i=`${t.name} ${t.ticker}`;return t.holding===null||t.holding===void 0?i:`${i} \xB7 ${la(t.holding,a)}`}function ra({useDialog:t,surface:a,t:i,inputActions:r}){let s=t(n=>n),[w,g]=A(!1),[c,d]=A(null),x=s.pendingRemove??null;if(ge(()=>()=>a.dispose(),[a]),!s.open)return null;let k=s.dropdownOpen===!0,S=x!==null,G=n=>{if(n.key==="Escape"){if(S){n.stopPropagation(),a.setPendingRemove(null);return}k&&(n.stopPropagation(),a.hideDropdown())}},N=n=>{if(!k)return;let C=n.relatedTarget;C!=null&&n.currentTarget?.contains?.(C)===!0||a.hideDropdown()},I=s.error,T=I==null?null:e("p",{className:"capital-watchlist-notice",role:"alert","data-code":I.code},`${i(`error.${I.code}`)}${I.partial===!0?i("errorSuffix"):""}`),q=(n,C)=>{r.insertText(aa(n,i,C),r.captureInsertion())===!0&&a.close()},H=s.marketFilter==="all"?s.candidates:s.candidates.filter(n=>at(n)===s.marketFilter),z={all:s.candidates.length,cn:0,hk:0,us:0};for(let n of s.candidates)z[at(n)]+=1;let V=s.candidates.length===0?null:e("div",{className:"capital-watchlist-filter",role:"group","aria-label":i("filterLabel")},wt.map(n=>e("button",{key:n.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":s.marketFilter===n.id,onClick:()=>a.setMarketFilter(n.id)},e("span",{className:"capital-watchlist-filterlabel"},n.id==="all"?i("filterAll"):n.label),e("span",{className:"capital-watchlist-filtercount"},String(z[n.id]))))),ae=k?e("div",{className:"capital-watchlist-dropdown","aria-label":i("title"),"data-menu-material":"translucent"},V,e("div",{className:"capital-watchlist-options",role:"listbox","aria-label":i("title")},H.map(n=>e("button",{key:n.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:n.name,"aria-disabled":n.in_list===!0||c===n.thscode,onClick:()=>{n.in_list===!0||c===n.thscode||(g(!0),d(n.thscode),a.add(n).finally(()=>{g(!1),d(null)}))}},e("span",{className:"capital-watchlist-optionmain"},e("span",{className:"capital-watchlist-optionname"},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-optioncode"},n.thscode),e(Se,{assetType:n.asset_type,t:i}))),e("span",{className:"capital-watchlist-addbtn","data-state":n.in_list===!0?"added":"idle"},n.in_list===!0?i("added"):i("add")))),s.truncated===!0&&H.length>0?e("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},i("truncated")):null),s.composing===!0?e("div",{className:"capital-watchlist-hint"},i("composingHint")):s.searching===!0||s.pendingSearch===!0?e("div",{className:"capital-watchlist-hint"},i("searching")):s.searchError!==null&&s.searchError!==void 0?e("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":s.searchError.code},i(`error.${s.searchError.code}`)):s.candidates.length===0?e("div",{className:"capital-watchlist-hint"},i("noHit")):H.length===0?e("div",{className:"capital-watchlist-hint","data-filter":s.marketFilter},i("filterNoHit")):null,...(s.searchPartial??[]).map(n=>e("div",{key:`partial-${n.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":n.market,"data-code":n.code},`${i(`partial.${n.market}`)}${i(`error.${n.code}`)}`))):null,ie=s.items.length===0?null:e("div",{className:"capital-watchlist-grid capital-watchlist-head"},e("span",null,i("colName")),e("span",{className:"capital-watchlist-quote"},i("colQuote")),e("span",{className:"capital-watchlist-headaction"},i("colAction"))),X=s.loadError!==null&&s.loadError!==void 0?e("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":s.loadError.code},i(`error.${s.loadError.code}`)):e("p",{className:"capital-watchlist-empty"},i("empty")),L=s.loading?e("p",{className:"capital-watchlist-empty"},i("loading")):s.items.length===0?X:e("div",{className:k?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},s.items.map((n,C)=>{let P=n.holding!==null&&n.holding!==void 0,$=n.holding?.weight_pct,F=Ze(n)||P,K=ht(s.items,n.thscode),R=!P||$===null||$===void 0||$<=0,Q=(typeof $=="number"?$:0)+Te>K;return e("div",{key:n.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":n.thscode},e("span",{className:"capital-watchlist-namewrap"},e("span",{className:P?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:na(n,i)},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-code"},n.ticker),e(Se,{assetType:n.asset_type,t:i}))),e(ia,{quote:n.quote,failureCode:s.failures[n.thscode],refreshing:s.refreshing,t:i}),e("span",{className:"capital-watchlist-rowactions"},e("button",{type:"button",className:"capital-watchlist-predict",disabled:w,title:i("predictTip"),"aria-label":`${i("predict")} ${n.name}`,onClick:()=>q(n,"predict")},e(ct,{size:14})),e("button",{type:"button",className:"capital-watchlist-review",disabled:w,title:i("reviewTip"),"aria-label":`${i("review")} ${n.name}`,onClick:()=>q(n,"review")},e(Dt,{size:14})),e(Oe,{open:s.rowMenu===n.thscode,anchor:e("button",{type:"button",className:"capital-watchlist-more",disabled:w,title:i("more"),"aria-label":`${i("more")} ${n.name}`,"aria-haspopup":"menu","aria-expanded":s.rowMenu===n.thscode,onClick:()=>a.toggleRowMenu(n.thscode)},e(ot,{size:14})),items:[{id:"pin",label:i("pin"),icon:e(dt,{size:14}),disabled:C===0}],children:[...F?[e("div",{key:"holding-check",role:"group","aria-label":i("holdingName"),className:"capital-watchlist-checkrow"},e("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},e(jt,{size:14})),e("span",{className:"capital-watchlist-checklabel"},i("holdingName")),e(qt,{checked:P,disabled:w,label:i("holdingName"),onChange:j=>j?a.markHolding(n.thscode,null):a.clearHolding(n.thscode)}))]:[],...P&&Ze(n)?[e("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":i("holdingStepper")},e("span",{className:"capital-watchlist-stepperlabel"},i("holdingWeightLabel")),e("span",{className:"capital-watchlist-stepperline"},e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepDown"),disabled:R,onClick:()=>a.stepHolding(n.thscode,-Te)},"\u2212"),e("span",{className:typeof $=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof $=="number"?`${$}%`:`0~${K}`),e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepUp"),title:`0~${K}`,disabled:Q,onClick:()=>a.stepHolding(n.thscode,Te)},"+")))]:[],e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Fe,{size:14}),onSelect:()=>{a.closeRowMenu(),a.setPendingRemove(n)}},i("remove"))],onSelect:j=>{j==="pin"&&(a.closeRowMenu(),a.pin(n.thscode))},onClose:()=>a.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),U=e("div",{className:S?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":S?void 0:"true"},e("div",{className:"capital-watchlist-confirmbox",role:S?"alertdialog":void 0,"aria-label":i("confirmTitle")},e("div",{className:"capital-watchlist-confirmtitle"},i("confirmTitle")),S?e("p",{className:"capital-watchlist-confirmdesc"},i("confirmDescPrefix"),e("strong",null,`${x.name} \xB7 ${x.ticker}`),i("confirmDescSuffix")):null,e("div",{className:"capital-watchlist-confirmactions"},e("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>a.setPendingRemove(null)},i("confirmCancel")),e("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let n=x;a.setPendingRemove(null),n!==null&&a.remove(n.thscode)}},i("confirmOk")))));return e(Gt,{open:!0,onClose:()=>a.close(),title:i("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},e("div",{className:"capital-watchlist-card",onKeyDown:G},e("div",{className:"capital-watchlist-header"},e("h2",{className:"capital-watchlist-title"},i("title")),e("button",{type:"button",className:"capital-watchlist-close","aria-label":i("close"),onClick:()=>a.close()},e(Xe,{size:14}))),e("div",{className:"capital-watchlist-search",onBlur:N},e("div",{className:"capital-watchlist-field"},e("span",{className:"capital-watchlist-searchicon"},e(pt,{size:16})),e("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:s.query,placeholder:i("searchPlaceholder"),onChange:n=>a.onQueryChange(n.target.value,n.isComposing),onCompositionStart:()=>a.beginComposition(),onCompositionEnd:n=>a.endComposition(n.target.value)}),s.query.length>0?e("button",{type:"button",className:"capital-watchlist-clear",title:i("clearInput"),"aria-label":i("clearInput"),onMouseDown:n=>n.preventDefault(),onClick:()=>a.onQueryChange("",!1)},e(Xe,{size:12})):null),ae),s.addError!==null&&s.addError!==void 0?e("p",{className:"capital-watchlist-adderror",role:"status","data-code":s.addError.code},sa(i,s.addError)):null,ie,L,e("div",{className:"capital-watchlist-footer"},e("div",{className:"capital-watchlist-footcol"},e("button",{type:"button",className:"capital-watchlist-refresh",disabled:s.refreshing||w,onClick:()=>{a.refresh()}},e(Re,{size:14}),s.refreshing?i("refreshing"):i("refresh")),T),e("span",{className:"capital-watchlist-updated"},`${i("updated")} ${s.refreshed_at===null||s.refreshed_at===void 0?i("notRefreshed"):$e(s.refreshed_at)}`)),U))}var st=`${he}:desk`,mt="capital.watchlist.desk.groups.v1",ne="__all__",He=0,Pe=0;function oa(){let t={names:[],assignments:{}};try{let a=JSON.parse(localStorage.getItem(mt)??"{}");return a===null||typeof a!="object"||!Array.isArray(a.names)||a.assignments===null||typeof a.assignments!="object"?t:{names:a.names.filter(i=>typeof i=="string"&&i.length>0).slice(0,20),assignments:a.assignments}}catch{return t}}function ca(t){try{localStorage.setItem(mt,JSON.stringify(t))}catch{}}var Ee=(t,a)=>{let i=t.assignments[a];return Array.isArray(i)?i:[]},lt=t=>t!=null&&typeof t.change_pct=="number"&&Number.isFinite(t.change_pct)?t.change_pct:null,Le=t=>t===null?"cwd-flat":t>0?"cwd-up":t<0?"cwd-down":"cwd-flat",_e=t=>t===null?"\u2014":`${t>0?"+":""}${t.toFixed(2)}%`,ft=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),nt=t=>t!=null&&typeof t.price=="number"&&Number.isFinite(t.price)?ft.format(t.price):"\u2014",E=t=>typeof t=="number"&&Number.isFinite(t)?ft.format(t):"\u2014";function je(t,a=2){if(typeof t!="number"||!Number.isFinite(t))return"\u2014";let i=Math.abs(t);return i>=1e8?`${(t/1e8).toFixed(a)}\u4EBF`:i>=1e4?`${(t/1e4).toFixed(a)}\u4E07`:new Intl.NumberFormat("en-US",{maximumFractionDigits:a}).format(t)}var da=t=>typeof t=="string"&&t.length>=5?Number(t.slice(0,2))*60+Number(t.slice(3,5)):0;function De(t,a,i){let r=je(t);return r==="\u2014"?r:a==="lot"?`${r}${i("desk.lot")}`:a==="share"?`${r}${i("desk.share")}`:r}function pa(t,a){let i=je(t);return i==="\u2014"||a==null||a==="CNY"?i:`${i} ${a}`}var rt={"a-share":[[570,690],[780,900]],hk:[[570,720],[780,960]],us:[[570,960]]},ha=t=>`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`;function ua(t){let a=[],i=0;for(let[r,s]of rt[t]??rt.us)a.push([r,s,i]),i+=s-r;return{spans:a,total:i}}function wa(t,a){for(let[i,r,s]of t.spans){if(a<=i)return s;if(a<r)return s+a-i}return t.total}function ma(t){let a=[];for(let[i,r,s]of t.spans)for(let w=i;w<=r;w+=30){let g=s+w-i;(a.length===0||a[a.length-1].slot!==g)&&a.push({time:ha(w),slot:g})}return a}function fa({data:t,t:a}){let[i,r]=A({width:720,height:300}),[s,w]=A(null),g=Ue(null);ge(()=>{let h=g.current;if(h==null)return;let p=()=>{let B=h.getBoundingClientRect();if(!(B.width>0)||!(B.height>0))return;let ee=Math.max(280,Math.round(B.width)),we=Math.max(180,Math.round(B.height));r(be=>Math.abs(be.width-ee)<2&&Math.abs(be.height-we)<2?be:{width:ee,height:we})};if(p(),typeof ResizeObserver>"u")return;let Y=new ResizeObserver(p);return Y.observe(h),()=>Y.disconnect()},[]);let c=t.points,d=t.prev_close,x=i.width,k=i.height,S=66,G=54,N=12,I=18,T=Math.round(Math.min(70,Math.max(30,k*.22))),q=Math.max(60,k-N-I-T-10),H=Math.max(60,x-S-G),z=ua(t.market),V=H/z.total,ae=c.map(h=>h[1]),ie=Math.min(d,...ae),X=Math.max(d,...ae),L=(X-ie)*.06||Math.max(X*.002,.01),U=ie-L,n=X+L,C=h=>N+(n-h)/(n-U)*q,P=c.map(h=>wa(z,da(h[0]))),$=h=>S+h*V,F=$(P[0]).toFixed(1),K=$(P[c.length-1]).toFixed(1),R=t.last===null||t.last>=d?"up":"down",Q=R==="up"?"var(--capital-watchlist-up)":"var(--capital-watchlist-down)",j=c.map((h,p)=>`${p===0?"M":"L"}${$(P[p]).toFixed(1)} ${C(h[1]).toFixed(1)}`).join(""),ue=(N+q).toFixed(1),b=`${j}L${K} ${ue}L${F} ${ue}Z`,se=c.reduce((h,p,Y)=>p[2]===null?h:`${h}${h===""?"M":"L"}${$(P[Y]).toFixed(1)} ${C(p[2]).toFixed(1)}`,""),Z=N+q+10,te=Math.max(1,...c.map(h=>h[3]??0)),le=Math.max(1,Math.min(10,V*.72)),re=C(d),ye=[0,1,2,3,4].map(h=>{let p=U+(n-U)*h/4;return{value:p,y:C(p),pct:(p-d)/d*100}}).filter(h=>Math.abs(h.y-re)>9),de=z.spans.length>1?z.spans[1][2]:null,o=ma(z),y=x>=620?1:2,O=o.filter((h,p)=>p%y===0||p===o.length-1),_=s===null||s<0||s>=c.length?null:c[s],J=_===null?0:$(P[s]),M=_===null?0:C(_[1]),pe=Math.min(x-172,Math.max(8,J+12)),ve=`${t.thscode} ${t.session_date??""} ${a("desk.intraday")} \xB7 ${a("desk.trendOpen")} ${E(t.open)} \xB7 ${a("desk.trendHigh")} ${E(t.high)} \xB7 ${a("desk.trendLow")} ${E(t.low)} \xB7 ${a("desk.trendAvg")} ${E(t.avg)}`,Ce=h=>{let p=h.currentTarget.getBoundingClientRect();if(!(p.width>0))return;let Y=Math.max(0,Math.min(z.total,(h.clientX-p.left-S)/H*z.total)),B=0;for(let ee=1;ee<P.length;ee+=1)Math.abs(P[ee]-Y)<Math.abs(P[B]-Y)&&(B=ee);w(B)};return e("div",{className:"cwd-chartbox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${x} ${k}`,role:"img","aria-label":ve,onPointerMove:Ce,onPointerLeave:()=>w(null)},e("defs",null,e("linearGradient",{id:"cwd-trend-fill",x1:"0",y1:"0",x2:"0",y2:"1"},e("stop",{offset:"0%",style:{stopColor:Q,stopOpacity:.2}}),e("stop",{offset:"100%",style:{stopColor:Q,stopOpacity:0}}))),ye.map(h=>e("g",{key:`grid-${h.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:S,x2:S+H,y1:h.y,y2:h.y}),e("text",{className:"cwd-chartaxis",x:S-8,y:h.y+3.5,textAnchor:"end"},E(h.value)),e("text",{className:"cwd-chartaxis",x:S+H+8,y:h.y+3.5},`${h.pct>0?"+":""}${h.pct.toFixed(2)}%`))),O.map(h=>e("line",{key:`grid-${h.time}`,className:"cwd-chartgrid",x1:$(h.slot),x2:$(h.slot),y1:N,y2:Z+T})),de===null?null:e("line",{className:"cwd-chartsep",x1:$(de),x2:$(de),y1:N,y2:Z+T}),e("path",{className:"cwd-chartarea",d:b,fill:"url(#cwd-trend-fill)"}),c.map((h,p)=>{let Y=h[3]??0,B=Math.max(0,Y/te*T),ee=p===0?d:c[p-1][1],we=$(P[p]+.5);return e("rect",{key:`vol-${p}`,className:h[1]>=ee?"cwd-vol-up":"cwd-vol-down",x:Math.min(S+H-le,Math.max(S,we-le/2)).toFixed(1),y:(Z+T-B).toFixed(1),width:le.toFixed(1),height:Math.max(.5,B).toFixed(1)})}),e("path",{className:"cwd-chartline",d:j,style:{stroke:Q}}),se===""?null:e("path",{className:"cwd-chartavg",d:se}),e("line",{className:"cwd-chartbase",x1:S,x2:S+H,y1:re,y2:re,strokeDasharray:"4 3"}),e("text",{className:"cwd-chartaxis cwd-chartbaselabel",x:S-8,y:re+3.5,textAnchor:"end"},E(d)),O.map(h=>e("text",{key:`tick-${h.time}`,className:"cwd-chartaxis",x:$(h.slot),y:k-5,textAnchor:h.slot===0?"start":h.slot>=z.total?"end":"middle"},h.time)),_===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:J,x2:J,y1:N,y2:Z+T}),e("line",{className:"cwd-chartcross",x1:S,x2:S+H,y1:M,y2:M}),e("circle",{className:`cwd-chartdot ${R==="up"?"cwd-up":"cwd-down"}`,cx:J,cy:M,r:3}))),_===null?null:e("div",{className:"cwd-charttip",style:{left:`${pe}px`}},e("div",{className:"cwd-charttiptime"},_[0]),e("div",{className:`cwd-charttipprice ${R==="up"?"cwd-up":"cwd-down"}`},`${E(_[1])} ${_e((_[1]-d)/d*100)}`),_[2]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendAvg")),e("span",null,E(_[2]))),_[3]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(_[3],t.volume_unit,a)))))}function gt(t,a){let i=new Array(t.length).fill(null),r=0;for(let s=0;s<t.length;s+=1)r+=t[s].close,s>=a&&(r-=t[s-a].close),s>=a-1&&(i[s]=r/a);return i}var xt=[5,10,20,60];function ga({data:t,t:a}){let[i,r]=A({width:720,height:300}),[s,w]=A(null),g=Ue(null);ge(()=>{let o=g.current;if(o==null)return;let y=()=>{let _=o.getBoundingClientRect();if(!(_.width>0)||!(_.height>0))return;let J=Math.max(280,Math.round(_.width)),M=Math.max(180,Math.round(_.height));r(pe=>Math.abs(pe.width-J)<2&&Math.abs(pe.height-M)<2?pe:{width:J,height:M})};if(y(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(y);return O.observe(o),()=>O.disconnect()},[]);let c=t.bars,d=i.width,x=i.height,k=66,S=54,G=10,N=18,I=Math.round(Math.min(64,Math.max(28,x*.2))),T=Math.max(60,x-G-N-I-12),q=Math.max(60,d-k-S),H=q/Math.max(1,c.length),z=Math.max(1,Math.min(14,H*.62)),V=Math.max(...c.map(o=>o.high)),ae=Math.min(...c.map(o=>o.low)),ie=(V-ae)*.06||Math.max(V*.01,.01),X=V+ie,L=ae-ie,U=o=>G+(X-o)/(X-L)*T,n=o=>k+(o+.5)*H,C=G+T+12,P=Math.max(1,...c.map(o=>o.volume)),$=o=>o/P*I,F=xt.map(o=>({window:o,values:gt(c,o)})),K=o=>o.reduce((y,O,_)=>O===null?y:`${y}${y===""?"M":"L"}${n(_).toFixed(1)} ${U(O).toFixed(1)}`,""),R=[];for(let o=0;o<c.length;o+=1){let y=c[o].date.slice(5,7);(o===0||y!==c[o-1].date.slice(5,7))&&R.push({index:o,month:y})}let Q=R.length>1?(R[1].index-R[0].index)*H:Number.POSITIVE_INFINITY,j=R.map((o,y)=>({index:o.index,label:y===0&&Q>=56?`${c[o.index].date.slice(0,4)}/${o.month}`:o.month})),ue=[0,1,2,3,4].map(o=>{let y=X-(X-L)*o/4;return{value:y,y:U(y)}}),b=s===null||s<0||s>=c.length?null:c[s],se=b===null?0:n(s),Z=b===null?0:U(b.close),te=s===null||s<=0?null:c[s-1].close,le=b===null||te===null||te<=0?null:(b.close-te)/te*100,re=Math.min(d-186,Math.max(8,se+12)),ye=`${t.thscode} ${a("desk.daily")} \xB7 ${c.length} \xB7 ${E(c[c.length-1].close)}`,de=o=>{let y=o.currentTarget.getBoundingClientRect();if(!(y.width>0))return;let O=Math.round((o.clientX-y.left-k)/H-.5);w(Math.max(0,Math.min(c.length-1,O)))};return e("div",{className:"cwd-klinebox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${d} ${x}`,role:"img","aria-label":ye,onPointerMove:de,onPointerLeave:()=>w(null)},ue.map(o=>e("g",{key:`grid-${o.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:k,x2:k+q,y1:o.y,y2:o.y}),e("text",{className:"cwd-chartaxis",x:k-8,y:o.y+3.5,textAnchor:"end"},E(o.value)))),j.map(o=>e("g",{key:`tick-${o.index}`},e("line",{className:"cwd-chartgrid",x1:n(o.index),x2:n(o.index),y1:G,y2:C+I}),e("text",{className:"cwd-chartaxis",x:n(o.index),y:x-5,textAnchor:o.index===0?"start":"middle"},o.label))),c.map((o,y)=>{let O=Math.max(.5,$(o.volume));return e("rect",{key:`vol-${o.date}`,className:o.close>=o.open?"cwd-vol-up":"cwd-vol-down",x:(n(y)-z/2).toFixed(1),y:(C+I-O).toFixed(1),width:z.toFixed(1),height:O.toFixed(1)})}),e("text",{className:"cwd-chartaxis",x:k-8,y:C+8,textAnchor:"end"},je(P)),c.map((o,y)=>{let O=U(o.open),_=U(o.close),J=Math.min(O,_),M=Math.max(.8,Math.abs(_-O));return e("g",{key:`bar-${o.date}`,className:o.close>=o.open?"cwd-candle-up":"cwd-candle-down"},e("line",{x1:n(y).toFixed(1),x2:n(y).toFixed(1),y1:U(o.high).toFixed(1),y2:U(o.low).toFixed(1)}),e("rect",{x:(n(y)-z/2).toFixed(1),y:J.toFixed(1),width:z.toFixed(1),height:M.toFixed(1)}))}),F.map(o=>{let y=K(o.values);return y===""?null:e("path",{key:`ma-${o.window}`,className:`cwd-maline cwd-ma${o.window}`,d:y})}),b===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:se,x2:se,y1:G,y2:C+I}),e("line",{className:"cwd-chartcross",x1:k,x2:k+q,y1:Z,y2:Z}))),b===null?null:e("div",{className:"cwd-charttip",style:{left:`${re}px`}},e("div",{className:"cwd-charttiptime"},b.date),e("div",{className:`cwd-charttipprice ${Le(le)}`},`${E(b.close)} ${_e(le)}`),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kOpen")),e("span",null,E(b.open)),e("span",null,a("desk.kHigh")),e("span",null,E(b.high))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kLow")),e("span",null,E(b.low)),e("span",null,a("desk.kClose")),e("span",null,E(b.close))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(b.volume,t.volume_unit,a)))))}function xa({size:t=18}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e("path",{d:"M4 19V5"}),e("path",{d:"M4 19h16"}),e("path",{d:"m7 15 3-4 3 2 5-7"}),e("circle",{cx:18,cy:6,r:1.4,fill:"currentColor",stroke:"none"}))}function ba({t}){let[a,i]=A([]),[r,s]=A(!0),[w,g]=A(!1),[c,d]=A(null),[x,k]=A({}),[S,G]=A(null),[N,I]=A(oa),[T,q]=A(ne),[H,z]=A(!1),[V,ae]=A(""),[ie,X]=A(""),[L,U]=A(null),[n,C]=A(null),[P,$]=A(null),[F,K]=A({status:"idle",data:null,code:null,detail:null}),[R,Q]=A({status:"idle",data:null,code:null,detail:null}),[j,ue]=A(!1),b=Ue(!0);ge(()=>(b.current=!0,()=>{b.current=!1}),[]),ge(()=>{ca(N)},[N]);let se=l=>{let m=ce(l.items);Array.isArray(m)&&i(m);let f={};for(let u of l.failures??[])u!==null&&typeof u=="object"&&typeof u.thscode=="string"&&(f[u.thscode]=u.code);k(f),typeof l.refreshed_at=="number"&&d(l.refreshed_at),G(l.error!==void 0&&l.error!==null&&typeof l.error.code=="string"?l.error.code:null)},Z=async(l,m={})=>{if(typeof l!="string"||l.length===0){K({status:"idle",data:null,code:null,detail:null}),Q({status:"idle",data:null,code:null,detail:null});return}let f=He+=1;K(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await W("/trend",{query:u});if(!b.current||f!==He)return;K({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==He)return;let v=typeof u?.code=="string"?u.code:"trend_unavailable",D=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;K({status:v==="trend_unavailable"?"unavailable":"error",data:null,code:v,detail:D})}},te=async(l,m={})=>{if(typeof l!="string"||l.length===0){Q({status:"idle",data:null,code:null,detail:null});return}let f=Pe+=1;Q(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await W("/kline",{query:u});if(!b.current||f!==Pe)return;Q({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==Pe)return;let v=typeof u?.code=="string"?u.code:"kline_unavailable",D=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;Q({status:v==="kline_unavailable"?"unavailable":"error",data:null,code:v,detail:D})}},le=l=>{U(l),Z(l),te(l)};ge(()=>{let l=!1;return(async()=>{try{let f=await W("/list");if(l)return;let u=ce(f.items)??[];i(u);let v=typeof u[0]?.thscode=="string"?u[0].thscode:null;U(D=>D!==null?D:v),v!==null&&(Z(v),te(v))}catch(f){l||G(f.code??"load_failed");return}finally{l||s(!1)}try{let f=await W("/refresh",{body:{}});l||se(f)}catch(f){l||G(f.code??"fuyao_unavailable")}})(),()=>{l=!0}},[]);let re=async()=>{if(!w){g(!0);try{let l=await W("/refresh",{body:{}});b.current&&se(l),b.current&&L!==null&&(Z(L,{bust:!0}),te(L,{bust:!0}))}catch(l){b.current&&G(l.code??"fuyao_unavailable")}finally{b.current&&g(!1)}}},ye=async l=>{let m=a;C(null),i(m.filter(f=>f.thscode!==l)),L===l&&(U(null),K({status:"idle",data:null,code:null,detail:null}));try{await W("/remove",{body:{thscode:l}})}catch{b.current&&i(m)}},de=async l=>{let m=a,f=m.find(u=>u.thscode===l);if(f!==void 0){i([f,...m.filter(u=>u.thscode!==l)]);try{let u=await W("/pin",{body:{thscode:l}});Array.isArray(u.items)&&b.current&&i(ce(u.items))}catch{b.current&&i(m)}}},o=()=>{let l=V.trim();l.length===0||l===ne||N.names.includes(l)||(I({names:[...N.names,l],assignments:N.assignments}),ae(""),q(l))},y=l=>{if(l===ne)return;let m={};for(let[f,u]of Object.entries(N.assignments)){let v=(Array.isArray(u)?u:[]).filter(D=>D!==l);v.length>0&&(m[f]=v)}I({names:N.names.filter(f=>f!==l),assignments:m}),q(ne),z(!1)},O=(l,m)=>{let f=Ee(N,l),u=f.includes(m)?f.filter(D=>D!==m):[...f,m],v={...N.assignments};u.length===0?delete v[l]:v[l]=u,I({names:N.names,assignments:v})},_=ie.trim().toLowerCase(),J=a.filter(l=>T!==ne&&!Ee(N,l.thscode).includes(T)?!1:_.length===0?!0:[l.name,l.thscode,l.ticker].some(m=>typeof m=="string"&&m.toLowerCase().includes(_))),M=L===null?null:a.find(l=>l.thscode===L)??null,pe=[{id:ne,label:t("desk.allGroups"),icon:T===ne?e(ke,{size:14}):void 0}].concat(N.names.map(l=>({id:l,label:l,icon:T===l?e(ke,{size:14}):void 0}))),ve=l=>{if(F.status!=="ready"||F.data===null||F.data.thscode!==l.thscode||typeof F.data.last!="number")return l.quote;let m=F.data.prev_close;return{price:F.data.last,change_pct:m>0?(F.data.last-m)/m*100:null}},Ce=J.map((l,m)=>{let f=ve(l),u=lt(f),v=x[l.thscode],D=Ee(N,l.thscode),qe=L===l.thscode,Be=v===void 0?void 0:t(`error.${v}`),Ae=P===l.thscode;return e("div",{key:l.thscode,className:"cwd-row",role:"listitem","aria-current":qe?"true":void 0,onClick:oe=>{oe.target.closest(".cwd-rowactions")===null&&le(l.thscode)}},e("button",{type:"button",className:"cwd-cellname","aria-pressed":qe,onClick:()=>le(l.thscode)},e("span",{className:"cwd-nameline"},e("span",{className:"cwd-nametext",title:l.name},xe(l.name)),e(Se,{assetType:l.asset_type,t})),e("span",{className:"cwd-codeline"},e("span",{className:"cwd-code"},l.thscode))),e("div",{className:v===void 0?"cwd-price":"cwd-price cwd-stale",title:Be},nt(f)),e("div",{className:`cwd-pct ${Le(u)}`,title:Be},_e(u)),e("div",{className:"cwd-rowactions"},e(Oe,{open:Ae,anchor:e("button",{type:"button",className:"cwd-iconbtn",title:t("desk.more"),"aria-label":`${t("desk.more")} ${l.name}`,"aria-haspopup":"menu","aria-expanded":Ae,onClick:()=>{C(null),$(Ae?null:l.thscode)}},e(ot,{size:16})),items:[{id:"pin",label:t("desk.pin"),icon:e(dt,{size:14}),disabled:m===0}],children:[...N.names.length===0?[e("div",{key:"no-group",className:"cwd-menuhint"},t("desk.noGroupYet"))]:N.names.map(oe=>e(Ne,{key:`group:${oe}`,icon:D.includes(oe)?e(ke,{size:14}):void 0,onSelect:()=>O(l.thscode,oe)},oe)),e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Fe,{size:14}),onSelect:()=>{$(null),C(l)}},t("desk.remove"))],onSelect:oe=>{oe==="pin"&&($(null),de(l.thscode))},onClose:()=>$(null),align:"end",portal:!0,listClassName:"cwd-menulist"})))}),h=r?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.loading"))):a.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.empty")),e("p",{className:"cwd-emptyhint"},t("desk.emptyHint"))):J.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.noMatch")),e("p",{className:"cwd-emptyhint"},t("desk.noMatchHint"))):e("div",{className:"cwd-tablebody",role:"list","aria-label":t("desk.title")},Ce),p=F.status==="ready"?F.data:null,Y=p!==null&&M!==null&&p.thscode===M.thscode&&typeof p.last=="number",B=M===null?null:ve(M),ee=lt(B),we=Y?p.points[p.points.length-1][0]:null,be=Y&&p.market==="us"?` ${t("desk.trendZoneUs")}`:"",bt=Y?`${String(p.session_date??"").slice(5)} ${we}${be}`.trim():M===null||M.quote===null||M.quote===void 0?t("desk.notRefreshed"):$e(M.quote.captured_at)||t("desk.notRefreshed"),Me=p===null||p.market==="a-share"?"":` ${t(p.market==="us"?"desk.trendZoneUs":"desk.trendZoneHk")}`,yt=p===null?F.status==="loading"?t("desk.trendLoading"):F.status==="error"?t("desk.trendError"):"":p.session_status==="live"?`${p.stale?t("desk.trendStale"):t("desk.trendLive")}${Me} \xB7 ${p.points[p.points.length-1][0]}`:p.session_status==="closed"?`${p.session_date??""} ${t("desk.trendClosed")}${Me}`:`${t("desk.trendPrevious")} ${p.session_date??""}${Me}`,vt=p===null?null:e("div",{className:"cwd-trendstats"},...[[t("desk.trendOpen"),E(p.open)],[t("desk.trendHigh"),E(p.high)],[t("desk.trendLow"),E(p.low)],[t("desk.trendAvg"),E(p.avg)],[t("desk.trendVolume"),De(p.volume,p.volume_unit,t)],[t("desk.trendAmount"),pa(p.amount,p.currency)]].map(([l,m])=>e("div",{key:l,className:"cwd-trendstat"},e("span",null,l),e("span",{title:m},m)))),Ge=(l,m,f=null)=>{let u=l.status==="error"?m.error:l.status==="loading"?m.loading:m.unavailable,v=l.status==="error"?l.detail:l.status==="unavailable"?m.hint:null,D=l.status==="error"&&f!==null;return e("div",{className:D?"cwd-chart cwd-chartfail":"cwd-chart"},e("div",{className:"cwd-fallback"},e("div",{className:"cwd-charttext"},u),v==null||v.length===0?null:e("div",{className:"cwd-charthint"},v),D?e("button",{type:"button",className:"cwd-retry",onClick:f.onClick},e(Re,{size:14}),e("span",null,t("desk.retry"))):null))},kt=p!==null?e(fa,{key:p.thscode,data:p,t}):Ge(F,{error:t("desk.trendError"),loading:t("desk.trendLoading"),unavailable:t("desk.trendUnavailable"),hint:t("desk.trendUnavailableHint")},{onClick:()=>{Z(L,{bust:!0})}}),me=R.status==="ready"&&Array.isArray(R.data?.bars)&&R.data.bars.length>0?R.data:null,Nt=me===null?R.status==="loading"?t("desk.klineLoading"):R.status==="error"?t("desk.klineError"):"":t("desk.adjustQfq"),$t=me===null?null:e("div",{className:"cwd-malegend"},...xt.map(l=>{let m=gt(me.bars,l),f=m[m.length-1];return e("span",{key:l,className:`cwd-malegenditem cwd-ma${l}`},`MA${l} ${f==null?"\u2014":E(f)}`)})),St=me!==null?e(ga,{key:me.thscode,data:me,t}):Ge(R,{error:t("desk.klineError"),loading:t("desk.klineLoading"),unavailable:t("desk.klineUnavailable"),hint:t("desk.klineUnavailableHint")},{onClick:()=>{te(L,{bust:!0})}}),_t=e("div",{className:"cwd-block cwd-block-kline"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.daily")),$t,e("span",{className:"cwd-blocknote"},Nt)),St),Ct=M===null?e("div",{className:"cwd-card"},e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.selectHint")),e("p",{className:"cwd-emptyhint"},t("desk.selectHintBody")))):e("div",{className:"cwd-card"},e("div",{className:"cwd-detail"},e("div",{className:"cwd-detailhead"},e("div",{style:{minWidth:0}},e("div",{className:"cwd-detailname"},e("span",{className:"cwd-detailtext",title:M.name},xe(M.name)),e(Se,{assetType:M.asset_type,t})),e("div",{className:"cwd-detailcode"},M.thscode))),e("div",{className:"cwd-quoterow"},e("div",{className:"cwd-bigquote"},e("span",{className:"cwd-bigprice"},nt(B)),e("span",{className:`cwd-bigpct ${Le(ee)}`},_e(ee))),e("div",{className:"cwd-meta"},e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.capturedAt")),e("div",{className:"cwd-metavalue"},bt)),e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.kind")),e("div",{className:"cwd-metavalue"},ut(M.asset_type,t))))),e("div",{className:j?"cwd-block cwd-block-chart cwd-folded":"cwd-block cwd-block-chart"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.intraday")),j?null:vt,e("span",{className:"cwd-blocknote"},yt),e("button",{type:"button",className:"cwd-blockfold","aria-expanded":j?"false":"true",onClick:()=>ue(!j)},t(j?"desk.unfold":"desk.fold"))),j?null:kt),_t));return e("div",{className:"cwd-page"},e("div",{className:"cwd-inner"},e("header",{className:"cwd-head"},e("h1",{className:"cwd-title"},t("desk.title")),e("div",{className:"cwd-headactions"},e("span",{className:"cwd-updated"},`${t("desk.lastUpdate")} ${c===null?t("desk.notRefreshed"):$e(c)}`),e("button",{type:"button",className:"cwd-refresh",disabled:w,onClick:()=>{re()}},e(Re,{size:14}),t(w?"desk.refreshing":"desk.refresh")))),e("div",{className:"cwd-body"},e("section",{className:"cwd-card"},e("div",{className:"cwd-toolbar"},e("label",{className:"cwd-field"},e(pt,{size:14}),e("input",{type:"text",value:ie,placeholder:t("desk.filterPlaceholder"),"aria-label":t("desk.filter"),onChange:l=>X(l.target.value)})),e(Oe,{open:H,anchor:e("button",{type:"button",className:"cwd-pill","aria-haspopup":"menu","aria-expanded":H,"aria-label":t("desk.group"),onClick:()=>z(!H)},e(ct,{size:14}),e("span",null,T===ne?t("desk.allGroups"):T)),items:pe,children:T===ne?[]:[e(Ne,{key:"delete-group",danger:!0,separatorBefore:!0,icon:e(Fe,{size:14}),onSelect:()=>y(T)},t("desk.deleteGroup"))],onSelect:l=>{z(!1),q(l)},onClose:()=>z(!1),align:"start",portal:!0,listClassName:"cwd-menulist"}),e("div",{className:"cwd-groupcreate"},e("input",{type:"text",value:V,maxLength:20,placeholder:t("desk.newGroup"),"aria-label":t("desk.newGroup"),onChange:l=>ae(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o()}}),e("button",{type:"button",className:"cwd-pill",disabled:V.trim().length===0,onClick:o},t("desk.createGroup")))),S===null?null:e("div",{className:"cwd-error",role:"alert"},t(S==="load_failed"?"desk.loadFailed":`error.${S}`)),n===null?null:e("div",{className:"cwd-notice cwd-notice-danger"},e("span",null,`${t("desk.removeHint")} \xB7 ${xe(n.name)}`),e("button",{type:"button",className:"cwd-pill",onClick:()=>C(null)},t("desk.cancel"))),e("div",{className:"cwd-thead",role:"row"},e("span",null,t("desk.colName")),e("span",{className:"cwd-right"},t("desk.colPrice")),e("span",{className:"cwd-right"},t("desk.colChange")),e("span",{className:"cwd-right"},t("desk.colAction"))),h),e("aside",null,Ct))))}function ya(t){t.effect(ta,`${he}: styles`),t.effect(()=>t.locale.register(fe,{zh:Kt,en:Qt}),`${he}: dictionaries`);let a=new Map,i=c=>{let d=a.get(c);return d===void 0&&(d=new Ie,a.set(c,d)),d};t.effect(()=>()=>{for(let c of a.values())c.dispose();a.clear()},`${he}: per-session surfaces`);let r=c=>{let x=t.sessions?.list?.getSnapshot?.().byId?.[c]?.projectionValues?.agentPreset;return typeof x=="string"?x:void 0},s=new Set,w=c=>{let d=r(c);return d!==void 0?d===Bt:(s.has(c)||(s.add(c),Promise.resolve(t.sessions?.refreshProjections?.(c)).catch(()=>{})),!1)};t.slots.inject(Je,()=>t.slots.register({name:Je,id:"capital-watchlist-dialog",order:3,locale:fe,inject:c=>{let d=i(c);return{hooks:{dialog:d.state},surface:d}}},ra));let g=t.locale.bind(fe);t.slots.inject("main",()=>t.slots.register({name:"main",key:st,locale:fe},ba)),t.slots.inject("sidebar.panellist",()=>t.slots.register({name:"sidebar.panellist",id:st,order:12,locale:fe,label:()=>g("desk.panel")},xa)),t.inject(["commandUi"],c=>{let d=t.locale.bind(fe);c.effect(()=>c.commandUi.register({name:"watchlist",label:()=>d("command.label"),description:()=>d("command.description"),icon:ke,available:x=>w(x.sessionId),ui:{kind:"action",run:x=>{i(x.sessionId).open()}}}),`${he}: /watchlist contribution`)}),t.logger?.info?.(`${he}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=he;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=ya;
|
|
263
|
+
`;function ia(){let t=globalThis.document;if(!t||typeof t.createElement!="function"||t.querySelector(`style[data-${it}]`))return;let a=t.createElement("style");a.setAttribute(`data-${it}`,""),a.textContent=aa;let i=t.head??t.body;if(!(i===void 0||typeof i.appendChild!="function"))return i.appendChild(a),()=>a.remove()}async function B(t,{query:a,body:i,signal:r}={}){let s=a!==void 0?`${at}${t}?${a}`:`${at}${t}`,w=i===void 0?{method:"GET",cache:"no-store",credentials:"same-origin",signal:r}:{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),credentials:"same-origin",signal:r},g=await fetch(s,w),c=await g.text(),d={};try{d=c.length>0?JSON.parse(c):{}}catch{d={}}if(g.ok===!0&&d.ok===!0)return d;let x=typeof d.code=="string"&&d.code.length>0?d.code:g.status===401||g.status===403?"unauthorized":"fuyao_unavailable",k=new Error(x);throw k.code=x,k.detail=typeof d.message=="string"&&d.message.length>0?d.message:null,k.candidates=d.candidates,k.limit=d.limit,k}var lt=()=>({open:!1,loading:!1,refreshing:!1,searching:!1,items:[],candidates:[],truncated:!1,marketFilter:"all",query:"",dropdownOpen:!1,rowMenu:null,pendingRemove:null,refreshed_at:null,error:null,searchError:null,searchPartial:null,addError:null,loadError:null,failures:{},composing:!1,pendingSearch:!1}),Ie=class{constructor(){this.store=Ut(lt()),this.searchController=null,this.timer=null,this.pending=null,this.lastQuery=null,this.holdingOps=new Map}get state(){return this.store}get snapshot(){return this.store.getSnapshot()}patch(a){this.store.update(i=>Object.assign(i,a))}open(){this.patch({...lt(),open:!0,loading:!0}),this.load().then(()=>this.refresh(),()=>this.patch({loading:!1}))}close(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({open:!1,rowMenu:null,composing:!1,pendingSearch:!1}),this.holdingOps.clear()}async load(){try{let a=await B("/list");this.holdingOps.clear(),this.patch({items:de(a.items)??[],seeded_at:a.seeded_at,loading:!1,loadError:null})}catch(a){throw this.patch({loading:!1,loadError:{code:a.code??"fuyao_unavailable"}}),a}}refresh(){if(this.pending!==null)return this.pending;this.patch({refreshing:!0});let a=B("/refresh",{body:{}}).then(i=>{let r={};for(let g of i.failures??[])r[g.thscode]=g.code;let s=de(i.items),w=s??this.snapshot.items;s!==null&&this.holdingOps.clear(),this.patch({items:w,refreshed_at:i.refreshed_at??this.snapshot.refreshed_at,failures:r,error:i.error?{code:i.error.code,partial:w.length>0&&w.some(g=>r[g.thscode]===void 0)}:null})}).catch(i=>{this.patch({error:{code:i.code??"fuyao_unavailable",partial:this.snapshot.items.some(r=>r.quote!==null)}})}).finally(()=>{this.patch({refreshing:!1}),this.pending=null});return this.pending=a,a}onQueryChange(a,i){let r=a.trim(),s=i===void 0?this.snapshot.composing===!0:i===!0;if(this.patch({query:a,searchError:null,composing:s,dropdownOpen:r.length>0}),this.timer!==null&&clearTimeout(this.timer),r.length===0){this.searchController!==null&&this.searchController.abort(),this.lastQuery=null,this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1});return}r===this.lastQuery&&this.snapshot.pendingSearch===!1||(this.patch({candidates:[],truncated:!1,pendingSearch:!s}),s!==!0&&(this.timer=setTimeout(()=>this.search(r),Kt)))}beginComposition(){this.timer!==null&&clearTimeout(this.timer),this.patch({composing:!0})}endComposition(a){this.onQueryChange(a,!1)}hideDropdown(){this.patch({dropdownOpen:!1})}setMarketFilter(a){mt.some(i=>i.id===a)&&this.patch({marketFilter:a})}toggleRowMenu(a){this.patch({rowMenu:this.snapshot.rowMenu===a?null:a})}closeRowMenu(){this.snapshot.rowMenu!==null&&this.patch({rowMenu:null})}setPendingRemove(a){this.patch({pendingRemove:a??null})}replaceRow(a){let[i]=de([a]);i===void 0||typeof i?.thscode!="string"||this.patch({items:this.snapshot.items.map(r=>r.thscode===i.thscode?i:r)})}async search(a){this.lastQuery=a,this.searchController!==null&&this.searchController.abort();let i=new AbortController;this.searchController=i,this.patch({searching:!0,searchError:null,searchPartial:null});let r=()=>this.snapshot.query.trim()===a;try{let s=await B("/search",{query:`q=${encodeURIComponent(a)}`,signal:i.signal});if(!r()){this.patch({searching:!1});return}this.patch({candidates:de(s.items)??[],truncated:s.truncated===!0,searching:!1,pendingSearch:!1,searchPartial:Array.isArray(s.partial)&&s.partial.length>0?s.partial:null})}catch(s){if(s.name==="AbortError"||(this.lastQuery===a&&(this.lastQuery=null),!r()))return;this.patch({candidates:[],truncated:!1,searching:!1,pendingSearch:!1,searchError:{code:s.code??"fuyao_unavailable"},searchPartial:null})}}async add(a){try{await B("/add",{body:{thscode:a.thscode}})}catch(r){this.patch({addError:{code:r.code??"fuyao_unavailable",candidates:r.candidates,limit:r.limit}}),r.candidates!==void 0&&this.patch({candidates:r.candidates,truncated:!1});return}this.patch({addError:null,candidates:this.snapshot.candidates.map(r=>r.thscode===a.thscode?{...r,in_list:!0}:r)}),await this.load().catch(()=>{}),await this.refresh();let i=this.snapshot.items.find(r=>r.thscode===a.thscode);i!==void 0&&i.quote===null&&this.snapshot.failures[a.thscode]===void 0&&await this.refresh()}async remove(a){let i=this.snapshot.items;this.patch({items:i.filter(r=>r.thscode!==a),rowMenu:null});try{await B("/remove",{body:{thscode:a}}),this.snapshot.addError?.code==="list_full"&&this.patch({addError:null})}catch{this.patch({items:i})}}async pin(a){let i=this.snapshot.items,r=i.find(s=>s.thscode===a);if(r!==void 0){this.patch({items:[r,...i.filter(s=>s.thscode!==a)],rowMenu:null});try{let s=await B("/pin",{body:{thscode:a}});Array.isArray(s.items)&&this.patch({items:de(s.items)})}catch{let s=this.snapshot.items,w=i.map(c=>s.find(d=>d.thscode===c.thscode)).filter(Boolean),g=new Set(w.map(c=>c.thscode));this.patch({items:[...w,...s.filter(c=>!g.has(c.thscode))]})}}}async writeHolding(a,i,r){let s=this.snapshot.items.find(d=>d.thscode===a);if(s===void 0)return;let w=this.holdingOps.get(a)??{seq:0,baseline:s};this.holdingOps.set(a,w);let g=++w.seq;this.patch({items:this.snapshot.items.map(d=>d.thscode===a?r(d):d)});let c=()=>this.holdingOps.get(a)!==w||w.seq!==g;try{let d=await B("/holding",{body:i});if(c())return;this.replaceRow(d.item),w.baseline=d.item??r(s),this.holdingOps.delete(a)}catch{if(c())return;this.replaceRow(w.baseline),this.holdingOps.delete(a)}}markHolding(a,i){return this.writeHolding(a,{thscode:a,weight_pct:i},r=>({...r,holding:{weight_pct:i,marked_at:Date.now()}}))}clearHolding(a){return this.writeHolding(a,{thscode:a,clear:!0},i=>{let r={...i};return delete r.holding,r})}stepHolding(a,i){let r=this.snapshot.items,s=r.find(g=>g.thscode===a)?.holding?.weight_pct;if(typeof s!="number"&&i<0)return;let w=Math.min(wt(r,a),Math.max(0,(typeof s=="number"?s:0)+i));if(w!==s)return this.markHolding(a,w)}async copyToClipboard(){let a=this.snapshot.items.map(i=>[i.thscode,xe(i.name),i.asset_type,i.quote?.price??"",i.quote?.change_pct??"",i.quote?.captured_at??""].join(" ")).join(`
|
|
264
|
+
`);return await navigator.clipboard.writeText(a),a}dispose(){this.timer!==null&&clearTimeout(this.timer),this.searchController!==null&&this.searchController.abort()}};function $e(t){if(typeof t!="number"||!Number.isFinite(t))return"";let a=new Date(t),i=r=>String(r).padStart(2,"0");return`${i(a.getMonth()+1)}-${i(a.getDate())} ${i(a.getHours())}:${i(a.getMinutes())}`}function Se({assetType:t,t:a}){return e("span",{className:`capital-watchlist-tag ${ta[t]??"capital-watchlist-tag-cn"}`},Zt(t,a))}function sa(t,a,i){let r=xe(t.name);return`${a(`${i}PromptPrefix`)}${r} (${t.thscode} \xB7 ${Jt(t.asset_type,a)})${a(`${i}PromptSuffix`)}`}function la({quote:t,failureCode:a,refreshing:i,t:r}){let s=a!==void 0;if(t==null)return i===!0?e("div",{className:"capital-watchlist-quote"},e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-price"}),e("span",{className:"capital-watchlist-skeleton capital-watchlist-skeleton-change"})):s?e("div",{className:"capital-watchlist-quote",title:r(`error.${a}`)},e("div",{className:"capital-watchlist-price capital-watchlist-quotefailed"},"\u2014")):e("div",{className:"capital-watchlist-quote"},e("div",{className:"capital-watchlist-price"},r("notRefreshed")));let w=typeof t.change_pct=="number"&&Number.isFinite(t.change_pct),g=w?`${t.change_pct>0?"+":""}${t.change_pct.toFixed(2)}%`:"\u2014",c=s?"capital-watchlist-stale":w?t.change_pct>0?"capital-watchlist-up":t.change_pct<0?"capital-watchlist-down":"capital-watchlist-flat":"capital-watchlist-nodata",d=typeof t.source_time=="string"&&t.source_time.length>0?`${r("exchangeTime")} ${t.source_time}`:"",x=[];return s?x.push(`${r(`error.${a}`)} \xB7 ${r("stale")} ${$e(t.captured_at)}`):w||x.push(r("noChangePct")),d.length>0&&x.push(d),e("div",{className:"capital-watchlist-quote",title:x.length===0?void 0:x.join(" \xB7 ")},e("div",{className:s?"capital-watchlist-price capital-watchlist-stale":"capital-watchlist-price"},t.price.toFixed(2)),e("div",{className:`capital-watchlist-change ${c}`},g))}function na(t,a){if(a.code!=="list_full")return t(`error.${a.code}`);let i=a.limit;return typeof i!="number"||!Number.isFinite(i)?t("error.list_full_noMax"):t("error.list_full").replace("{max}",String(i))}function ra(t,a){let i=t?.weight_pct;return i==null?a("holdingName"):`${a("holdingName")} ${i}%`}function oa(t,a){let i=`${t.name} ${t.ticker}`;return t.holding===null||t.holding===void 0?i:`${i} \xB7 ${ra(t.holding,a)}`}function ca({useDialog:t,surface:a,t:i,inputActions:r}){let s=t(n=>n),[w,g]=M(!1),[c,d]=M(null),x=s.pendingRemove??null;if(ge(()=>()=>a.dispose(),[a]),!s.open)return null;let k=s.dropdownOpen===!0,S=x!==null,D=n=>{if(n.key==="Escape"){if(S){n.stopPropagation(),a.setPendingRemove(null);return}k&&(n.stopPropagation(),a.hideDropdown())}},N=n=>{if(!k)return;let C=n.relatedTarget;C!=null&&n.currentTarget?.contains?.(C)===!0||a.hideDropdown()},I=s.error,P=I==null?null:e("p",{className:"capital-watchlist-notice",role:"alert","data-code":I.code},`${i(`error.${I.code}`)}${I.partial===!0?i("errorSuffix"):""}`),G=(n,C)=>{r.insertText(sa(n,i,C),r.captureInsertion())===!0&&a.close()},T=s.marketFilter==="all"?s.candidates:s.candidates.filter(n=>st(n)===s.marketFilter),z={all:s.candidates.length,cn:0,hk:0,us:0};for(let n of s.candidates)z[st(n)]+=1;let V=s.candidates.length===0?null:e("div",{className:"capital-watchlist-filter",role:"group","aria-label":i("filterLabel")},mt.map(n=>e("button",{key:n.id,type:"button",className:"capital-watchlist-filterbtn","aria-pressed":s.marketFilter===n.id,onClick:()=>a.setMarketFilter(n.id)},e("span",{className:"capital-watchlist-filterlabel"},n.id==="all"?i("filterAll"):n.label),e("span",{className:"capital-watchlist-filtercount"},String(z[n.id]))))),ae=k?e("div",{className:"capital-watchlist-dropdown","aria-label":i("title"),"data-menu-material":"translucent"},V,e("div",{className:"capital-watchlist-options",role:"listbox","aria-label":i("title")},T.map(n=>e("button",{key:n.thscode,type:"button",role:"option",className:"capital-watchlist-option",title:n.name,"aria-disabled":n.in_list===!0||c===n.thscode,onClick:()=>{n.in_list===!0||c===n.thscode||(g(!0),d(n.thscode),a.add(n).finally(()=>{g(!1),d(null)}))}},e("span",{className:"capital-watchlist-optionmain"},e("span",{className:"capital-watchlist-optionname"},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-optioncode"},n.thscode),e(Se,{assetType:n.asset_type,t:i}))),e("span",{className:"capital-watchlist-addbtn","data-state":n.in_list===!0?"added":"idle"},n.in_list===!0?i("added"):i("add")))),s.truncated===!0&&T.length>0?e("div",{className:"capital-watchlist-hint capital-watchlist-endhint"},i("truncated")):null),s.composing===!0?e("div",{className:"capital-watchlist-hint"},i("composingHint")):s.searching===!0||s.pendingSearch===!0?e("div",{className:"capital-watchlist-hint"},i("searching")):s.searchError!==null&&s.searchError!==void 0?e("div",{className:"capital-watchlist-hint capital-watchlist-searcherror",role:"alert","data-code":s.searchError.code},i(`error.${s.searchError.code}`)):s.candidates.length===0?e("div",{className:"capital-watchlist-hint"},i("noHit")):T.length===0?e("div",{className:"capital-watchlist-hint","data-filter":s.marketFilter},i("filterNoHit")):null,...(s.searchPartial??[]).map(n=>e("div",{key:`partial-${n.market}`,className:"capital-watchlist-hint capital-watchlist-searcherror",role:"status","data-market":n.market,"data-code":n.code},`${i(`partial.${n.market}`)}${i(`error.${n.code}`)}`))):null,ie=s.items.length===0?null:e("div",{className:"capital-watchlist-grid capital-watchlist-head"},e("span",null,i("colName")),e("span",{className:"capital-watchlist-quote"},i("colQuote")),e("span",{className:"capital-watchlist-headaction"},i("colAction"))),X=s.loadError!==null&&s.loadError!==void 0?e("p",{className:"capital-watchlist-empty capital-watchlist-loaderror",role:"alert","data-code":s.loadError.code},i(`error.${s.loadError.code}`)):e("p",{className:"capital-watchlist-empty"},i("empty")),L=s.loading?e("p",{className:"capital-watchlist-empty"},i("loading")):s.items.length===0?X:e("div",{className:k?"capital-watchlist-list capital-watchlist-list-open":"capital-watchlist-list"},s.items.map((n,C)=>{let H=n.holding!==null&&n.holding!==void 0,$=n.holding?.weight_pct,O=et(n)||H,W=wt(s.items,n.thscode),R=!H||$===null||$===void 0||$<=0,K=(typeof $=="number"?$:0)+Pe>W;return e("div",{key:n.thscode,className:"capital-watchlist-grid capital-watchlist-row","data-thscode":n.thscode},e("span",{className:"capital-watchlist-namewrap"},e("span",{className:H?"capital-watchlist-name capital-watchlist-name-held":"capital-watchlist-name",title:oa(n,i)},n.name),e("span",{className:"capital-watchlist-codeline"},e("span",{className:"capital-watchlist-code"},n.ticker),e(Se,{assetType:n.asset_type,t:i}))),e(la,{quote:n.quote,failureCode:s.failures[n.thscode],refreshing:s.refreshing,t:i}),e("span",{className:"capital-watchlist-rowactions"},e("button",{type:"button",className:"capital-watchlist-predict",disabled:w,title:i("predictTip"),"aria-label":`${i("predict")} ${n.name}`,onClick:()=>G(n,"predict")},e(pt,{size:14})),e("button",{type:"button",className:"capital-watchlist-review",disabled:w,title:i("reviewTip"),"aria-label":`${i("review")} ${n.name}`,onClick:()=>G(n,"review")},e(Gt,{size:14})),e(Fe,{open:s.rowMenu===n.thscode,anchor:e("button",{type:"button",className:"capital-watchlist-more",disabled:w,title:i("more"),"aria-label":`${i("more")} ${n.name}`,"aria-haspopup":"menu","aria-expanded":s.rowMenu===n.thscode,onClick:()=>a.toggleRowMenu(n.thscode)},e(dt,{size:14})),items:[{id:"pin",label:i("pin"),icon:e(ht,{size:14}),disabled:C===0}],children:[...O?[e("div",{key:"holding-check",role:"group","aria-label":i("holdingName"),className:"capital-watchlist-checkrow"},e("span",{className:"capital-watchlist-checkicon","aria-hidden":"true"},e(jt,{size:14})),e("span",{className:"capital-watchlist-checklabel"},i("holdingName")),e(Bt,{checked:H,disabled:w,label:i("holdingName"),onChange:Q=>Q?a.markHolding(n.thscode,null):a.clearHolding(n.thscode)}))]:[],...H&&et(n)?[e("div",{key:"holding-step",className:"capital-watchlist-stepper",role:"group","aria-label":i("holdingStepper")},e("span",{className:"capital-watchlist-stepperlabel"},i("holdingWeightLabel")),e("span",{className:"capital-watchlist-stepperline"},e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepDown"),disabled:R,onClick:()=>a.stepHolding(n.thscode,-Pe)},"\u2212"),e("span",{className:typeof $=="number"?"capital-watchlist-stepperreadout":"capital-watchlist-stepperreadout capital-watchlist-stepperplaceholder",role:"status"},typeof $=="number"?`${$}%`:`0~${W}`),e("button",{type:"button",className:"capital-watchlist-stepperbtn","aria-label":i("holdingStepUp"),title:`0~${W}`,disabled:K,onClick:()=>a.stepHolding(n.thscode,Pe)},"+")))]:[],e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Oe,{size:14}),onSelect:()=>{a.closeRowMenu(),a.setPendingRemove(n)}},i("remove"))],onSelect:Q=>{Q==="pin"&&(a.closeRowMenu(),a.pin(n.thscode))},onClose:()=>a.closeRowMenu(),align:"end",portal:!0,listClassName:"capital-watchlist-rows",className:"capital-watchlist-actions"})))})),U=e("div",{className:S?"capital-watchlist-confirm capital-watchlist-confirm-open":"capital-watchlist-confirm","aria-hidden":S?void 0:"true"},e("div",{className:"capital-watchlist-confirmbox",role:S?"alertdialog":void 0,"aria-label":i("confirmTitle")},e("div",{className:"capital-watchlist-confirmtitle"},i("confirmTitle")),S?e("p",{className:"capital-watchlist-confirmdesc"},i("confirmDescPrefix"),e("strong",null,`${x.name} \xB7 ${x.ticker}`),i("confirmDescSuffix")):null,e("div",{className:"capital-watchlist-confirmactions"},e("button",{type:"button",className:"capital-watchlist-confirmbtn",onClick:()=>a.setPendingRemove(null)},i("confirmCancel")),e("button",{type:"button",className:"capital-watchlist-confirmbtn capital-watchlist-confirmdanger",onClick:()=>{let n=x;a.setPendingRemove(null),n!==null&&a.remove(n.thscode)}},i("confirmOk")))));return e(qt,{open:!0,onClose:()=>a.close(),title:i("title"),headless:!0,shortcutModal:"watchlist",className:"capital-watchlist-dialog"},e("div",{className:"capital-watchlist-card",onKeyDown:D},e("div",{className:"capital-watchlist-header"},e("h2",{className:"capital-watchlist-title"},i("title")),e("button",{type:"button",className:"capital-watchlist-close","aria-label":i("close"),onClick:()=>a.close()},e(Je,{size:14}))),e("div",{className:"capital-watchlist-search",onBlur:N},e("div",{className:"capital-watchlist-field"},e("span",{className:"capital-watchlist-searchicon"},e(ut,{size:16})),e("input",{className:"capital-watchlist-input","data-modal-autofocus":!0,value:s.query,placeholder:i("searchPlaceholder"),onChange:n=>a.onQueryChange(n.target.value,n.isComposing),onCompositionStart:()=>a.beginComposition(),onCompositionEnd:n=>a.endComposition(n.target.value)}),s.query.length>0?e("button",{type:"button",className:"capital-watchlist-clear",title:i("clearInput"),"aria-label":i("clearInput"),onMouseDown:n=>n.preventDefault(),onClick:()=>a.onQueryChange("",!1)},e(Je,{size:12})):null),ae),s.addError!==null&&s.addError!==void 0?e("p",{className:"capital-watchlist-adderror",role:"status","data-code":s.addError.code},na(i,s.addError)):null,ie,L,e("div",{className:"capital-watchlist-footer"},e("div",{className:"capital-watchlist-footcol"},e("button",{type:"button",className:"capital-watchlist-refresh",disabled:s.refreshing||w,onClick:()=>{a.refresh()}},e(Re,{size:14}),s.refreshing?i("refreshing"):i("refresh")),P),e("span",{className:"capital-watchlist-updated"},`${i("updated")} ${s.refreshed_at===null||s.refreshed_at===void 0?i("notRefreshed"):$e(s.refreshed_at)}`)),U))}var nt=`${ue}:desk`,ft="capital.watchlist.desk.groups.v1",ne="__all__",Te=0,He=0;function da(){let t={names:[],assignments:{}};try{let a=JSON.parse(localStorage.getItem(ft)??"{}");return a===null||typeof a!="object"||!Array.isArray(a.names)||a.assignments===null||typeof a.assignments!="object"?t:{names:a.names.filter(i=>typeof i=="string"&&i.length>0).slice(0,20),assignments:a.assignments}}catch{return t}}function pa(t){try{localStorage.setItem(ft,JSON.stringify(t))}catch{}}var Ee=(t,a)=>{let i=t.assignments[a];return Array.isArray(i)?i:[]},rt=t=>t!=null&&typeof t.change_pct=="number"&&Number.isFinite(t.change_pct)?t.change_pct:null,Le=t=>t===null?"cwd-flat":t>0?"cwd-up":t<0?"cwd-down":"cwd-flat",_e=t=>t===null?"\u2014":`${t>0?"+":""}${t.toFixed(2)}%`,gt=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),ot=t=>t!=null&&typeof t.price=="number"&&Number.isFinite(t.price)?gt.format(t.price):"\u2014",E=t=>typeof t=="number"&&Number.isFinite(t)?gt.format(t):"\u2014";function je(t,a=2){if(typeof t!="number"||!Number.isFinite(t))return"\u2014";let i=Math.abs(t);return i>=1e8?`${(t/1e8).toFixed(a)}\u4EBF`:i>=1e4?`${(t/1e4).toFixed(a)}\u4E07`:new Intl.NumberFormat("en-US",{maximumFractionDigits:a}).format(t)}var ha=t=>typeof t=="string"&&t.length>=5?Number(t.slice(0,2))*60+Number(t.slice(3,5)):0;function De(t,a,i){let r=je(t);return r==="\u2014"?r:a==="lot"?`${r}${i("desk.lot")}`:a==="share"?`${r}${i("desk.share")}`:r}function ua(t,a){let i=je(t);return i==="\u2014"||a==null||a==="CNY"?i:`${i} ${a}`}var ct={"a-share":[[570,690],[780,900]],hk:[[570,720],[780,960]],us:[[570,960]]},wa=t=>`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`;function ma(t){let a=[],i=0;for(let[r,s]of ct[t]??ct.us)a.push([r,s,i]),i+=s-r;return{spans:a,total:i}}function fa(t,a){for(let[i,r,s]of t.spans){if(a<=i)return s;if(a<r)return s+a-i}return t.total}function ga(t){let a=[];for(let[i,r,s]of t.spans)for(let w=i;w<=r;w+=30){let g=s+w-i;(a.length===0||a[a.length-1].slot!==g)&&a.push({time:wa(w),slot:g})}return a}function xa({data:t,t:a}){let[i,r]=M({width:720,height:300}),[s,w]=M(null),g=Ue(null);ge(()=>{let h=g.current;if(h==null)return;let p=()=>{let q=h.getBoundingClientRect();if(!(q.width>0)||!(q.height>0))return;let ee=Math.max(280,Math.round(q.width)),we=Math.max(180,Math.round(q.height));r(be=>Math.abs(be.width-ee)<2&&Math.abs(be.height-we)<2?be:{width:ee,height:we})};if(p(),typeof ResizeObserver>"u")return;let Y=new ResizeObserver(p);return Y.observe(h),()=>Y.disconnect()},[]);let c=t.points,d=t.prev_close,x=i.width,k=i.height,S=66,D=54,N=12,I=18,P=Math.round(Math.min(70,Math.max(30,k*.22))),G=Math.max(60,k-N-I-P-10),T=Math.max(60,x-S-D),z=ma(t.market),V=T/z.total,ae=c.map(h=>h[1]),ie=Math.min(d,...ae),X=Math.max(d,...ae),L=(X-ie)*.06||Math.max(X*.002,.01),U=ie-L,n=X+L,C=h=>N+(n-h)/(n-U)*G,H=c.map(h=>fa(z,ha(h[0]))),$=h=>S+h*V,O=$(H[0]).toFixed(1),W=$(H[c.length-1]).toFixed(1),R=t.last===null||t.last>=d?"up":"down",K=R==="up"?"var(--capital-watchlist-up)":"var(--capital-watchlist-down)",Q=c.map((h,p)=>`${p===0?"M":"L"}${$(H[p]).toFixed(1)} ${C(h[1]).toFixed(1)}`).join(""),re=(N+G).toFixed(1),b=`${Q}L${W} ${re}L${O} ${re}Z`,se=c.reduce((h,p,Y)=>p[2]===null?h:`${h}${h===""?"M":"L"}${$(H[Y]).toFixed(1)} ${C(p[2]).toFixed(1)}`,""),Z=N+G+10,te=Math.max(1,...c.map(h=>h[3]??0)),le=Math.max(1,Math.min(10,V*.72)),oe=C(d),ye=[0,1,2,3,4].map(h=>{let p=U+(n-U)*h/4;return{value:p,y:C(p),pct:(p-d)/d*100}}).filter(h=>Math.abs(h.y-oe)>9),pe=z.spans.length>1?z.spans[1][2]:null,o=ga(z),y=x>=620?1:2,F=o.filter((h,p)=>p%y===0||p===o.length-1),_=s===null||s<0||s>=c.length?null:c[s],J=_===null?0:$(H[s]),A=_===null?0:C(_[1]),he=Math.min(x-172,Math.max(8,J+12)),ve=`${t.thscode} ${t.session_date??""} ${a("desk.intraday")} \xB7 ${a("desk.trendOpen")} ${E(t.open)} \xB7 ${a("desk.trendHigh")} ${E(t.high)} \xB7 ${a("desk.trendLow")} ${E(t.low)} \xB7 ${a("desk.trendAvg")} ${E(t.avg)}`,Ce=h=>{let p=h.currentTarget.getBoundingClientRect();if(!(p.width>0))return;let Y=Math.max(0,Math.min(z.total,(h.clientX-p.left-S)/T*z.total)),q=0;for(let ee=1;ee<H.length;ee+=1)Math.abs(H[ee]-Y)<Math.abs(H[q]-Y)&&(q=ee);w(q)};return e("div",{className:"cwd-chartbox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${x} ${k}`,role:"img","aria-label":ve,onPointerMove:Ce,onPointerLeave:()=>w(null)},e("defs",null,e("linearGradient",{id:"cwd-trend-fill",x1:"0",y1:"0",x2:"0",y2:"1"},e("stop",{offset:"0%",style:{stopColor:K,stopOpacity:.2}}),e("stop",{offset:"100%",style:{stopColor:K,stopOpacity:0}}))),ye.map(h=>e("g",{key:`grid-${h.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:S,x2:S+T,y1:h.y,y2:h.y}),e("text",{className:"cwd-chartaxis",x:S-8,y:h.y+3.5,textAnchor:"end"},E(h.value)),e("text",{className:"cwd-chartaxis",x:S+T+8,y:h.y+3.5},`${h.pct>0?"+":""}${h.pct.toFixed(2)}%`))),F.map(h=>e("line",{key:`grid-${h.time}`,className:"cwd-chartgrid",x1:$(h.slot),x2:$(h.slot),y1:N,y2:Z+P})),pe===null?null:e("line",{className:"cwd-chartsep",x1:$(pe),x2:$(pe),y1:N,y2:Z+P}),e("path",{className:"cwd-chartarea",d:b,fill:"url(#cwd-trend-fill)"}),c.map((h,p)=>{let Y=h[3]??0,q=Math.max(0,Y/te*P),ee=p===0?d:c[p-1][1],we=$(H[p]+.5);return e("rect",{key:`vol-${p}`,className:h[1]>=ee?"cwd-vol-up":"cwd-vol-down",x:Math.min(S+T-le,Math.max(S,we-le/2)).toFixed(1),y:(Z+P-q).toFixed(1),width:le.toFixed(1),height:Math.max(.5,q).toFixed(1)})}),e("path",{className:"cwd-chartline",d:Q,style:{stroke:K}}),se===""?null:e("path",{className:"cwd-chartavg",d:se}),e("line",{className:"cwd-chartbase",x1:S,x2:S+T,y1:oe,y2:oe,strokeDasharray:"4 3"}),e("text",{className:"cwd-chartaxis cwd-chartbaselabel",x:S-8,y:oe+3.5,textAnchor:"end"},E(d)),F.map(h=>e("text",{key:`tick-${h.time}`,className:"cwd-chartaxis",x:$(h.slot),y:k-5,textAnchor:h.slot===0?"start":h.slot>=z.total?"end":"middle"},h.time)),_===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:J,x2:J,y1:N,y2:Z+P}),e("line",{className:"cwd-chartcross",x1:S,x2:S+T,y1:A,y2:A}),e("circle",{className:`cwd-chartdot ${R==="up"?"cwd-up":"cwd-down"}`,cx:J,cy:A,r:3}))),_===null?null:e("div",{className:"cwd-charttip",style:{left:`${he}px`}},e("div",{className:"cwd-charttiptime"},_[0]),e("div",{className:`cwd-charttipprice ${R==="up"?"cwd-up":"cwd-down"}`},`${E(_[1])} ${_e((_[1]-d)/d*100)}`),_[2]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendAvg")),e("span",null,E(_[2]))),_[3]===null?null:e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(_[3],t.volume_unit,a)))))}function xt(t,a){let i=new Array(t.length).fill(null),r=0;for(let s=0;s<t.length;s+=1)r+=t[s].close,s>=a&&(r-=t[s-a].close),s>=a-1&&(i[s]=r/a);return i}var bt=[5,10,20,60];function ba({data:t,t:a}){let[i,r]=M({width:720,height:300}),[s,w]=M(null),g=Ue(null);ge(()=>{let o=g.current;if(o==null)return;let y=()=>{let _=o.getBoundingClientRect();if(!(_.width>0)||!(_.height>0))return;let J=Math.max(280,Math.round(_.width)),A=Math.max(180,Math.round(_.height));r(he=>Math.abs(he.width-J)<2&&Math.abs(he.height-A)<2?he:{width:J,height:A})};if(y(),typeof ResizeObserver>"u")return;let F=new ResizeObserver(y);return F.observe(o),()=>F.disconnect()},[]);let c=t.bars,d=i.width,x=i.height,k=66,S=54,D=10,N=18,I=Math.round(Math.min(64,Math.max(28,x*.2))),P=Math.max(60,x-D-N-I-12),G=Math.max(60,d-k-S),T=G/Math.max(1,c.length),z=Math.max(1,Math.min(14,T*.62)),V=Math.max(...c.map(o=>o.high)),ae=Math.min(...c.map(o=>o.low)),ie=(V-ae)*.06||Math.max(V*.01,.01),X=V+ie,L=ae-ie,U=o=>D+(X-o)/(X-L)*P,n=o=>k+(o+.5)*T,C=D+P+12,H=Math.max(1,...c.map(o=>o.volume)),$=o=>o/H*I,O=bt.map(o=>({window:o,values:xt(c,o)})),W=o=>o.reduce((y,F,_)=>F===null?y:`${y}${y===""?"M":"L"}${n(_).toFixed(1)} ${U(F).toFixed(1)}`,""),R=[];for(let o=0;o<c.length;o+=1){let y=c[o].date.slice(5,7);(o===0||y!==c[o-1].date.slice(5,7))&&R.push({index:o,month:y})}let K=R.length>1?(R[1].index-R[0].index)*T:Number.POSITIVE_INFINITY,Q=R.map((o,y)=>({index:o.index,label:y===0&&K>=56?`${c[o.index].date.slice(0,4)}/${o.month}`:o.month})),re=[0,1,2,3,4].map(o=>{let y=X-(X-L)*o/4;return{value:y,y:U(y)}}),b=s===null||s<0||s>=c.length?null:c[s],se=b===null?0:n(s),Z=b===null?0:U(b.close),te=s===null||s<=0?null:c[s-1].close,le=b===null||te===null||te<=0?null:(b.close-te)/te*100,oe=Math.min(d-186,Math.max(8,se+12)),ye=`${t.thscode} ${a("desk.daily")} \xB7 ${c.length} \xB7 ${E(c[c.length-1].close)}`,pe=o=>{let y=o.currentTarget.getBoundingClientRect();if(!(y.width>0))return;let F=Math.round((o.clientX-y.left-k)/T-.5);w(Math.max(0,Math.min(c.length-1,F)))};return e("div",{className:"cwd-klinebox",ref:g},e("svg",{className:"cwd-chartsvg",viewBox:`0 0 ${d} ${x}`,role:"img","aria-label":ye,onPointerMove:pe,onPointerLeave:()=>w(null)},re.map(o=>e("g",{key:`grid-${o.value.toFixed(4)}`},e("line",{className:"cwd-chartgrid",x1:k,x2:k+G,y1:o.y,y2:o.y}),e("text",{className:"cwd-chartaxis",x:k-8,y:o.y+3.5,textAnchor:"end"},E(o.value)))),Q.map(o=>e("g",{key:`tick-${o.index}`},e("line",{className:"cwd-chartgrid",x1:n(o.index),x2:n(o.index),y1:D,y2:C+I}),e("text",{className:"cwd-chartaxis",x:n(o.index),y:x-5,textAnchor:o.index===0?"start":"middle"},o.label))),c.map((o,y)=>{let F=Math.max(.5,$(o.volume));return e("rect",{key:`vol-${o.date}`,className:o.close>=o.open?"cwd-vol-up":"cwd-vol-down",x:(n(y)-z/2).toFixed(1),y:(C+I-F).toFixed(1),width:z.toFixed(1),height:F.toFixed(1)})}),e("text",{className:"cwd-chartaxis",x:k-8,y:C+8,textAnchor:"end"},je(H)),c.map((o,y)=>{let F=U(o.open),_=U(o.close),J=Math.min(F,_),A=Math.max(.8,Math.abs(_-F));return e("g",{key:`bar-${o.date}`,className:o.close>=o.open?"cwd-candle-up":"cwd-candle-down"},e("line",{x1:n(y).toFixed(1),x2:n(y).toFixed(1),y1:U(o.high).toFixed(1),y2:U(o.low).toFixed(1)}),e("rect",{x:(n(y)-z/2).toFixed(1),y:J.toFixed(1),width:z.toFixed(1),height:A.toFixed(1)}))}),O.map(o=>{let y=W(o.values);return y===""?null:e("path",{key:`ma-${o.window}`,className:`cwd-maline cwd-ma${o.window}`,d:y})}),b===null?null:e("g",null,e("line",{className:"cwd-chartcross",x1:se,x2:se,y1:D,y2:C+I}),e("line",{className:"cwd-chartcross",x1:k,x2:k+G,y1:Z,y2:Z}))),b===null?null:e("div",{className:"cwd-charttip",style:{left:`${oe}px`}},e("div",{className:"cwd-charttiptime"},b.date),e("div",{className:`cwd-charttipprice ${Le(le)}`},`${E(b.close)} ${_e(le)}`),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kOpen")),e("span",null,E(b.open)),e("span",null,a("desk.kHigh")),e("span",null,E(b.high))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.kLow")),e("span",null,E(b.low)),e("span",null,a("desk.kClose")),e("span",null,E(b.close))),e("div",{className:"cwd-charttiprow"},e("span",null,a("desk.trendVolume")),e("span",null,De(b.volume,t.volume_unit,a)))))}function ya({size:t=18}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},e("path",{d:"M4 19V5"}),e("path",{d:"M4 19h16"}),e("path",{d:"m7 15 3-4 3 2 5-7"}),e("circle",{cx:18,cy:6,r:1.4,fill:"currentColor",stroke:"none"}))}function va({t}){let[a,i]=M([]),[r,s]=M(!0),[w,g]=M(!1),[c,d]=M(null),[x,k]=M({}),[S,D]=M(null),[N,I]=M(da),[P,G]=M(ne),[T,z]=M(!1),[V,ae]=M(""),[ie,X]=M(""),[L,U]=M(null),[n,C]=M(null),[H,$]=M(null),[O,W]=M({status:"idle",data:null,code:null,detail:null}),[R,K]=M({status:"idle",data:null,code:null,detail:null}),[Q,re]=M(!1),b=Ue(!0);ge(()=>(b.current=!0,()=>{b.current=!1}),[]),ge(()=>{pa(N)},[N]);let se=l=>{let m=de(l.items);Array.isArray(m)&&i(m);let f={};for(let u of l.failures??[])u!==null&&typeof u=="object"&&typeof u.thscode=="string"&&(f[u.thscode]=u.code);k(f),typeof l.refreshed_at=="number"&&d(l.refreshed_at),D(l.error!==void 0&&l.error!==null&&typeof l.error.code=="string"?l.error.code:null)},Z=async(l,m={})=>{if(typeof l!="string"||l.length===0){W({status:"idle",data:null,code:null,detail:null}),K({status:"idle",data:null,code:null,detail:null});return}let f=Te+=1;W(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await B("/trend",{query:u});if(!b.current||f!==Te)return;W({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==Te)return;let v=typeof u?.code=="string"?u.code:"trend_unavailable",j=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;W({status:v==="trend_unavailable"?"unavailable":"error",data:null,code:v,detail:j})}},te=async(l,m={})=>{if(typeof l!="string"||l.length===0){K({status:"idle",data:null,code:null,detail:null});return}let f=He+=1;K(u=>({status:"loading",data:u.data!==null&&u.data.thscode===l?u.data:null,code:null,detail:null}));try{let u=`thscode=${encodeURIComponent(l)}${m.bust===!0?"&refresh=1":""}`,v=await B("/kline",{query:u});if(!b.current||f!==He)return;K({status:"ready",data:v,code:null,detail:null})}catch(u){if(!b.current||f!==He)return;let v=typeof u?.code=="string"?u.code:"kline_unavailable",j=typeof u?.detail=="string"&&u.detail.length>0?u.detail:null;K({status:v==="kline_unavailable"?"unavailable":"error",data:null,code:v,detail:j})}},le=l=>{U(l),Z(l),te(l)};ge(()=>{let l=!1;return(async()=>{try{let f=await B("/list");if(l)return;let u=de(f.items)??[];i(u);let v=typeof u[0]?.thscode=="string"?u[0].thscode:null;U(j=>j!==null?j:v),v!==null&&(Z(v),te(v))}catch(f){l||D(f.code??"load_failed");return}finally{l||s(!1)}try{let f=await B("/refresh",{body:{}});l||se(f)}catch(f){l||D(f.code??"fuyao_unavailable")}})(),()=>{l=!0}},[]);let oe=async()=>{if(!w){g(!0);try{let l=await B("/refresh",{body:{}});b.current&&se(l),b.current&&L!==null&&(Z(L,{bust:!0}),te(L,{bust:!0}))}catch(l){b.current&&D(l.code??"fuyao_unavailable")}finally{b.current&&g(!1)}}},ye=async l=>{let m=a;C(null),i(m.filter(f=>f.thscode!==l)),L===l&&(U(null),W({status:"idle",data:null,code:null,detail:null}));try{await B("/remove",{body:{thscode:l}})}catch{b.current&&i(m)}},pe=async l=>{let m=a,f=m.find(u=>u.thscode===l);if(f!==void 0){i([f,...m.filter(u=>u.thscode!==l)]);try{let u=await B("/pin",{body:{thscode:l}});Array.isArray(u.items)&&b.current&&i(de(u.items))}catch{b.current&&i(m)}}},o=()=>{let l=V.trim();l.length===0||l===ne||N.names.includes(l)||(I({names:[...N.names,l],assignments:N.assignments}),ae(""),G(l))},y=l=>{if(l===ne)return;let m={};for(let[f,u]of Object.entries(N.assignments)){let v=(Array.isArray(u)?u:[]).filter(j=>j!==l);v.length>0&&(m[f]=v)}I({names:N.names.filter(f=>f!==l),assignments:m}),G(ne),z(!1)},F=(l,m)=>{let f=Ee(N,l),u=f.includes(m)?f.filter(j=>j!==m):[...f,m],v={...N.assignments};u.length===0?delete v[l]:v[l]=u,I({names:N.names,assignments:v})},_=ie.trim().toLowerCase(),J=a.filter(l=>P!==ne&&!Ee(N,l.thscode).includes(P)?!1:_.length===0?!0:[l.name,l.thscode,l.ticker].some(m=>typeof m=="string"&&m.toLowerCase().includes(_))),A=L===null?null:a.find(l=>l.thscode===L)??null,he=[{id:ne,label:t("desk.allGroups"),icon:P===ne?e(ke,{size:14}):void 0}].concat(N.names.map(l=>({id:l,label:l,icon:P===l?e(ke,{size:14}):void 0}))),ve=l=>{if(O.status!=="ready"||O.data===null||O.data.thscode!==l.thscode||typeof O.data.last!="number")return l.quote;let m=O.data.prev_close;return{price:O.data.last,change_pct:m>0?(O.data.last-m)/m*100:null}},Ce=J.map((l,m)=>{let f=ve(l),u=rt(f),v=x[l.thscode],j=Ee(N,l.thscode),We=L===l.thscode,Ke=v===void 0?void 0:t(`error.${v}`),Ae=H===l.thscode;return e("div",{key:l.thscode,className:"cwd-row",role:"listitem","aria-current":We?"true":void 0,onClick:ce=>{ce.target.closest(".cwd-rowactions")===null&&le(l.thscode)}},e("button",{type:"button",className:"cwd-cellname","aria-pressed":We,onClick:()=>le(l.thscode)},e("span",{className:"cwd-nameline"},e("span",{className:"cwd-nametext",title:l.name},xe(l.name)),e(Se,{assetType:l.asset_type,t})),e("span",{className:"cwd-codeline"},e("span",{className:"cwd-code"},l.thscode))),e("div",{className:v===void 0?"cwd-price":"cwd-price cwd-stale",title:Ke},ot(f)),e("div",{className:`cwd-pct ${Le(u)}`,title:Ke},_e(u)),e("div",{className:"cwd-rowactions"},e(Fe,{open:Ae,anchor:e("button",{type:"button",className:"cwd-iconbtn",title:t("desk.more"),"aria-label":`${t("desk.more")} ${l.name}`,"aria-haspopup":"menu","aria-expanded":Ae,onClick:()=>{C(null),$(Ae?null:l.thscode)}},e(dt,{size:16})),items:[{id:"pin",label:t("desk.pin"),icon:e(ht,{size:14}),disabled:m===0}],children:[...N.names.length===0?[e("div",{key:"no-group",className:"cwd-menuhint"},t("desk.noGroupYet"))]:N.names.map(ce=>e(Ne,{key:`group:${ce}`,icon:j.includes(ce)?e(ke,{size:14}):void 0,onSelect:()=>F(l.thscode,ce)},ce)),e(Ne,{key:"remove",danger:!0,separatorBefore:!0,icon:e(Oe,{size:14}),onSelect:()=>{$(null),C(l)}},t("desk.remove"))],onSelect:ce=>{ce==="pin"&&($(null),pe(l.thscode))},onClose:()=>$(null),align:"end",portal:!0,listClassName:"cwd-menulist"})))}),h=r?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.loading"))):a.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.empty")),e("p",{className:"cwd-emptyhint"},t("desk.emptyHint"))):J.length===0?e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.noMatch")),e("p",{className:"cwd-emptyhint"},t("desk.noMatchHint"))):e("div",{className:"cwd-tablebody",role:"list","aria-label":t("desk.title")},Ce),p=O.status==="ready"?O.data:null,Y=p!==null&&A!==null&&p.thscode===A.thscode&&typeof p.last=="number",q=A===null?null:ve(A),ee=rt(q),we=Y?p.points[p.points.length-1][0]:null,be=Y&&p.market==="us"?` ${t("desk.trendZoneUs")}`:"",yt=Y?`${String(p.session_date??"").slice(5)} ${we}${be}`.trim():A===null||A.quote===null||A.quote===void 0?t("desk.notRefreshed"):$e(A.quote.captured_at)||t("desk.notRefreshed"),Me=p===null||p.market==="a-share"?"":` ${t(p.market==="us"?"desk.trendZoneUs":"desk.trendZoneHk")}`,Ge=p===null?O.status==="loading"?t("desk.trendLoading"):O.status==="error"?t("desk.trendError"):"":p.session_status==="live"?`${p.stale?t("desk.trendStale"):t("desk.trendLive")}${Me} \xB7 ${p.points[p.points.length-1][0]}`:p.session_status==="closed"?`${p.session_date??""} ${t("desk.trendClosed")}${Me}`:`${t("desk.trendPrevious")} ${p.session_date??""}${Me}`,qe=p===null?[]:[[t("desk.trendOpen"),E(p.open)],[t("desk.trendHigh"),E(p.high)],[t("desk.trendLow"),E(p.low)],[t("desk.trendAvg"),E(p.avg)],[t("desk.trendVolume"),De(p.volume,p.volume_unit,t)],[t("desk.trendAmount"),ua(p.amount,p.currency)]],vt=p===null?null:e("div",{className:Q?"cwd-statsbox cwd-statsbox-pinned":"cwd-statsbox",onMouseLeave:()=>{Q&&re(!1)}},e("button",{type:"button",className:"cwd-statsinfo","aria-label":`${t("desk.stats")}\uFF1A${qe.map(([l,m])=>`${l} ${m}`).join("\uFF0C")}`,"aria-expanded":Q?"true":"false",onClick:()=>re(!Q),onKeyDown:l=>{l.key==="Escape"&&re(!1)}},e(Dt,{size:13})),e("div",{className:"cwd-statspanel","aria-hidden":"true"},e("div",{className:"cwd-statscard"},Ge===""?null:e("div",{className:"cwd-statscap"},Ge),e("div",{className:"cwd-statsgrid"},...qe.map(([l,m])=>e("div",{key:l,className:"cwd-trendstat"},e("span",null,l),e("span",{title:m},m))))))),Be=(l,m,f=null)=>{let u=l.status==="error"?m.error:l.status==="loading"?m.loading:m.unavailable,v=l.status==="error"?l.detail:l.status==="unavailable"?m.hint:null,j=l.status==="error"&&f!==null;return e("div",{className:j?"cwd-chart cwd-chartfail":"cwd-chart"},e("div",{className:"cwd-fallback"},e("div",{className:"cwd-charttext"},u),v==null||v.length===0?null:e("div",{className:"cwd-charthint"},v),j?e("button",{type:"button",className:"cwd-retry",onClick:f.onClick},e(Re,{size:14}),e("span",null,t("desk.retry"))):null))},kt=p!==null?e(xa,{key:p.thscode,data:p,t}):Be(O,{error:t("desk.trendError"),loading:t("desk.trendLoading"),unavailable:t("desk.trendUnavailable"),hint:t("desk.trendUnavailableHint")},{onClick:()=>{Z(L,{bust:!0})}}),me=R.status==="ready"&&Array.isArray(R.data?.bars)&&R.data.bars.length>0?R.data:null,Nt=me===null?R.status==="loading"?t("desk.klineLoading"):R.status==="error"?t("desk.klineError"):"":t("desk.adjustQfq"),$t=me===null?null:e("div",{className:"cwd-malegend"},...bt.map(l=>{let m=xt(me.bars,l),f=m[m.length-1];return e("span",{key:l,className:`cwd-malegenditem cwd-ma${l}`},`MA${l} ${f==null?"\u2014":E(f)}`)})),St=me!==null?e(ba,{key:me.thscode,data:me,t}):Be(R,{error:t("desk.klineError"),loading:t("desk.klineLoading"),unavailable:t("desk.klineUnavailable"),hint:t("desk.klineUnavailableHint")},{onClick:()=>{te(L,{bust:!0})}}),_t=e("div",{className:"cwd-block cwd-block-kline"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.daily")),$t,e("span",{className:"cwd-blocknote"},Nt)),St),Ct=A===null?e("div",{className:"cwd-card"},e("div",{className:"cwd-empty"},e("div",{className:"cwd-emptytitle"},t("desk.selectHint")),e("p",{className:"cwd-emptyhint"},t("desk.selectHintBody")))):e("div",{className:"cwd-card"},e("div",{className:"cwd-detail"},e("div",{className:"cwd-detailhead"},e("div",{style:{minWidth:0}},e("div",{className:"cwd-detailname"},e("span",{className:"cwd-detailtext",title:A.name},xe(A.name)),e(Se,{assetType:A.asset_type,t})),e("div",{className:"cwd-detailcode"},A.thscode))),e("div",{className:"cwd-quoterow"},e("div",{className:"cwd-bigquote"},e("span",{className:"cwd-bigprice"},ot(q)),e("span",{className:`cwd-bigpct ${Le(ee)}`},_e(ee))),e("div",{className:"cwd-meta"},e("div",{className:"cwd-metaitem"},e("div",{className:"cwd-metalabel"},t("desk.capturedAt")),e("div",{className:"cwd-metavalue"},yt)))),e("div",{className:"cwd-block cwd-block-chart"},e("div",{className:"cwd-blockhead"},e("span",{className:"cwd-blocktitle"},t("desk.intraday")),vt),kt),_t));return e("div",{className:"cwd-page"},e("div",{className:"cwd-inner"},e("header",{className:"cwd-head"},e("h1",{className:"cwd-title"},t("desk.title")),e("div",{className:"cwd-headactions"},e("span",{className:"cwd-updated"},`${t("desk.lastUpdate")} ${c===null?t("desk.notRefreshed"):$e(c)}`),e("button",{type:"button",className:"cwd-refresh",disabled:w,onClick:()=>{oe()}},e(Re,{size:14}),t(w?"desk.refreshing":"desk.refresh")))),e("div",{className:"cwd-body"},e("section",{className:"cwd-card"},e("div",{className:"cwd-toolbar"},e("label",{className:"cwd-field"},e(ut,{size:14}),e("input",{type:"text",value:ie,placeholder:t("desk.filterPlaceholder"),"aria-label":t("desk.filter"),onChange:l=>X(l.target.value)})),e(Fe,{open:T,anchor:e("button",{type:"button",className:"cwd-pill","aria-haspopup":"menu","aria-expanded":T,"aria-label":t("desk.group"),onClick:()=>z(!T)},e(pt,{size:14}),e("span",null,P===ne?t("desk.allGroups"):P)),items:he,children:P===ne?[]:[e(Ne,{key:"delete-group",danger:!0,separatorBefore:!0,icon:e(Oe,{size:14}),onSelect:()=>y(P)},t("desk.deleteGroup"))],onSelect:l=>{z(!1),G(l)},onClose:()=>z(!1),align:"start",portal:!0,listClassName:"cwd-menulist"}),e("div",{className:"cwd-groupcreate"},e("input",{type:"text",value:V,maxLength:20,placeholder:t("desk.newGroup"),"aria-label":t("desk.newGroup"),onChange:l=>ae(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o()}}),e("button",{type:"button",className:"cwd-pill",disabled:V.trim().length===0,onClick:o},t("desk.createGroup")))),S===null?null:e("div",{className:"cwd-error",role:"alert"},t(S==="load_failed"?"desk.loadFailed":`error.${S}`)),n===null?null:e("div",{className:"cwd-notice cwd-notice-danger"},e("span",null,`${t("desk.removeHint")} \xB7 ${xe(n.name)}`),e("button",{type:"button",className:"cwd-pill",onClick:()=>C(null)},t("desk.cancel"))),e("div",{className:"cwd-thead",role:"row"},e("span",null,t("desk.colName")),e("span",{className:"cwd-right"},t("desk.colPrice")),e("span",{className:"cwd-right"},t("desk.colChange")),e("span",{className:"cwd-right"},t("desk.colAction"))),h),e("aside",null,Ct))))}function ka(t){t.effect(ia,`${ue}: styles`),t.effect(()=>t.locale.register(fe,{zh:Qt,en:Yt}),`${ue}: dictionaries`);let a=new Map,i=c=>{let d=a.get(c);return d===void 0&&(d=new Ie,a.set(c,d)),d};t.effect(()=>()=>{for(let c of a.values())c.dispose();a.clear()},`${ue}: per-session surfaces`);let r=c=>{let x=t.sessions?.list?.getSnapshot?.().byId?.[c]?.projectionValues?.agentPreset;return typeof x=="string"?x:void 0},s=new Set,w=c=>{let d=r(c);return d!==void 0?d===Wt:(s.has(c)||(s.add(c),Promise.resolve(t.sessions?.refreshProjections?.(c)).catch(()=>{})),!1)};t.slots.inject(tt,()=>t.slots.register({name:tt,id:"capital-watchlist-dialog",order:3,locale:fe,inject:c=>{let d=i(c);return{hooks:{dialog:d.state},surface:d}}},ca));let g=t.locale.bind(fe);t.slots.inject("main",()=>t.slots.register({name:"main",key:nt,locale:fe},va)),t.slots.inject("sidebar.panellist",()=>t.slots.register({name:"sidebar.panellist",id:nt,order:12,locale:fe,label:()=>g("desk.panel")},ya)),t.inject(["commandUi"],c=>{let d=t.locale.bind(fe);c.effect(()=>c.commandUi.register({name:"watchlist",label:()=>d("command.label"),description:()=>d("command.description"),icon:ke,available:x=>w(x.sessionId),ui:{kind:"action",run:x=>{i(x.sessionId).open()}}}),`${ue}: /watchlist contribution`)}),t.logger?.info?.(`${ue}: \u5BA2\u6237\u7AEF\u534A\u8FB9\u5DF2\u6302\u8F7D\uFF08/watchlist \u83DC\u5355\u884C + \u81EA\u9009\u80A1\u5F39\u7A97\uFF09`)}exports.name=ue;exports.inject=["slots","locale","commandUi","sessions"];exports.apply=ka;
|
|
259
265
|
return module.exports
|
|
260
266
|
},
|
|
261
267
|
})
|
package/watchlist/client.src.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const { createElement: h, useEffect, useRef, useState } = require('react')
|
|
|
9
9
|
const { createSnapshotStore } = require('@deepseek-ai/dsh-client-store')
|
|
10
10
|
// Official icons only; the set has no wallet/pie/coin glyph, so stepper keys use text −/+.
|
|
11
11
|
// `MenuItemButton` gives the remove row official geometry and its separator line.
|
|
12
|
-
const { IconChecklistOutlineRegular, IconCloseOutlineRegular, IconDatabaseOutlineRegular, IconEllipsisOutlineRegular, IconGoalOutlineRegular, IconListPenOutlineRegular, IconPinOutlineRegular, IconRefreshOutlineRegular, IconSearchOutlineRegular, IconTrashOutlineRegular, Menu, MenuItemButton, Modal, Switch } = require('@deepseek-ai/dsh-client-ui-primitives')
|
|
12
|
+
const { IconChecklistOutlineRegular, IconCloseOutlineRegular, IconDatabaseOutlineRegular, IconEllipsisOutlineRegular, IconInfoOutlineRegular, IconGoalOutlineRegular, IconListPenOutlineRegular, IconPinOutlineRegular, IconRefreshOutlineRegular, IconSearchOutlineRegular, IconTrashOutlineRegular, Menu, MenuItemButton, Modal, Switch } = require('@deepseek-ai/dsh-client-ui-primitives')
|
|
13
13
|
// Holdability and ceiling come from the same module the host gate uses.
|
|
14
14
|
const { isHoldable, weightCeiling } = require('./holding-rules.js')
|
|
15
15
|
|
|
@@ -146,8 +146,6 @@ const zh = {
|
|
|
146
146
|
'desk.trendError': '分时加载失败',
|
|
147
147
|
'desk.retry': '重试',
|
|
148
148
|
'desk.daily': '日K',
|
|
149
|
-
'desk.fold': '收起',
|
|
150
|
-
'desk.unfold': '展开',
|
|
151
149
|
'desk.adjustQfq': '前复权',
|
|
152
150
|
'desk.klineLoading': '正在读取日K…',
|
|
153
151
|
'desk.klineError': '日K加载失败',
|
|
@@ -167,13 +165,13 @@ const zh = {
|
|
|
167
165
|
'desk.trendAvg': '均价',
|
|
168
166
|
'desk.trendVolume': '成交量',
|
|
169
167
|
'desk.trendAmount': '成交额',
|
|
168
|
+
'desk.stats': '行情统计',
|
|
170
169
|
'desk.lot': '手',
|
|
171
170
|
'desk.share': '股',
|
|
172
171
|
'desk.trendZoneUs': '美东',
|
|
173
172
|
'desk.trendZoneHk': '香港',
|
|
174
173
|
'desk.capturedAt': '行情时间',
|
|
175
174
|
'desk.groupsOf': '所属分组',
|
|
176
|
-
'desk.kind': '标的类型',
|
|
177
175
|
'desk.colName': '名称',
|
|
178
176
|
'desk.colPrice': '最新',
|
|
179
177
|
'desk.colChange': '涨跌',
|
|
@@ -293,8 +291,6 @@ const en = {
|
|
|
293
291
|
'desk.trendError': 'Intraday failed to load',
|
|
294
292
|
'desk.retry': 'Retry',
|
|
295
293
|
'desk.daily': 'Daily',
|
|
296
|
-
'desk.fold': 'Collapse',
|
|
297
|
-
'desk.unfold': 'Expand',
|
|
298
294
|
'desk.adjustQfq': 'Forward-adjusted',
|
|
299
295
|
'desk.klineLoading': 'Loading daily bars…',
|
|
300
296
|
'desk.klineError': 'Daily bars failed to load',
|
|
@@ -314,13 +310,13 @@ const en = {
|
|
|
314
310
|
'desk.trendAvg': 'VWAP',
|
|
315
311
|
'desk.trendVolume': 'Volume',
|
|
316
312
|
'desk.trendAmount': 'Turnover',
|
|
313
|
+
'desk.stats': 'Session stats',
|
|
317
314
|
'desk.lot': 'lots',
|
|
318
315
|
'desk.share': 'shares',
|
|
319
316
|
'desk.trendZoneUs': 'ET',
|
|
320
317
|
'desk.trendZoneHk': 'HK',
|
|
321
318
|
'desk.capturedAt': 'As of',
|
|
322
319
|
'desk.groupsOf': 'Groups',
|
|
323
|
-
'desk.kind': 'Instrument',
|
|
324
320
|
'desk.colName': 'Symbol',
|
|
325
321
|
'desk.colPrice': 'Last',
|
|
326
322
|
'desk.colChange': 'Change',
|
|
@@ -583,13 +579,9 @@ const CSS = `
|
|
|
583
579
|
.cwd-metavalue { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
584
580
|
.cwd-block { flex: none; padding-top: 12px; border-top: .5px solid var(--dsw-alias-border-l2); }
|
|
585
581
|
.cwd-block-chart { flex: 1 1 0; display: flex; flex-direction: column; min-height: 200px; }
|
|
586
|
-
/* Folded block keeps only its title row, so it stops competing for height. */
|
|
587
|
-
.cwd-block-chart.cwd-folded { flex: none; min-height: 0; }
|
|
588
582
|
.cwd-blockhead { display: flex; flex: none; align-items: baseline; gap: 12px; margin-bottom: 8px; }
|
|
589
583
|
.cwd-blocktitle { flex: none; font-size: 12.5px; line-height: 18px; font-weight: 600; }
|
|
590
584
|
.cwd-blocknote { margin-left: auto; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
|
|
591
|
-
.cwd-blockfold { flex: none; padding: 0 2px; border: 0; background: none; font-family: inherit; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); cursor: pointer; }
|
|
592
|
-
.cwd-blockfold:hover { color: var(--dsw-alias-label-primary); }
|
|
593
585
|
.cwd-chart { flex: 1; min-height: 150px; display: grid; place-items: center; padding: 12px; border: 1px dashed var(--dsw-alias-border-l2); border-radius: 10px; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--dsw-alias-border-l2) 60%, transparent) 0 1px, transparent 1px 36px), var(--dsw-alias-bg-module-platform); text-align: center; }
|
|
594
586
|
.cwd-charttext { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
|
|
595
587
|
.cwd-charthint { margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-tertiary); }
|
|
@@ -600,11 +592,21 @@ const CSS = `
|
|
|
600
592
|
.cwd-retry:hover { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 22%, transparent); }
|
|
601
593
|
.cwd-retry:active { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 30%, transparent); }
|
|
602
594
|
.cwd-retry:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 60%, transparent); outline-offset: 2px; }
|
|
603
|
-
.cwd-
|
|
604
|
-
.cwd-
|
|
595
|
+
.cwd-statsbox { position: relative; display: inline-flex; align-items: center; flex: none; align-self: center; }
|
|
596
|
+
.cwd-statsinfo { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--dsw-alias-label-tertiary); cursor: help; }
|
|
597
|
+
.cwd-statsinfo:hover, .cwd-statsinfo:focus-visible, .cwd-statsbox-pinned .cwd-statsinfo { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover-accent); }
|
|
598
|
+
.cwd-statsinfo:focus-visible { outline: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 55%, transparent); outline-offset: 1px; }
|
|
599
|
+
/* The padding on the panel is the hover bridge: the card starts 8px below the icon without a dead
|
|
600
|
+
strip where the pointer would drop the hover. */
|
|
601
|
+
.cwd-statspanel { position: absolute; top: 100%; left: -10px; z-index: 8; padding-top: 8px; opacity: 0; visibility: hidden; transition: opacity .12s ease, visibility .12s ease; }
|
|
602
|
+
.cwd-statsbox:hover .cwd-statspanel, .cwd-statsbox:focus-within .cwd-statspanel, .cwd-statsbox-pinned .cwd-statspanel { opacity: 1; visibility: visible; }
|
|
603
|
+
.cwd-statscard { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px; border: .5px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1)); box-shadow: var(--dsw-elevation-prominent); }
|
|
604
|
+
.cwd-statscap { font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); white-space: nowrap; }
|
|
605
|
+
.cwd-statsgrid { display: grid; grid-template-columns: repeat(3, minmax(66px, auto)); gap: 7px 20px; }
|
|
606
|
+
.cwd-trendstat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
605
607
|
.cwd-trendstat span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
606
|
-
.cwd-trendstat span:first-child { flex: none; color: var(--dsw-alias-label-tertiary); }
|
|
607
|
-
.cwd-trendstat span:last-child { font-variant-numeric: tabular-nums; }
|
|
608
|
+
.cwd-trendstat span:first-child { flex: none; font-size: 10.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); }
|
|
609
|
+
.cwd-trendstat span:last-child { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--dsw-alias-label-primary); font-variant-numeric: tabular-nums; }
|
|
608
610
|
.cwd-chartbox { position: relative; flex: 1; min-height: 120px; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--dsw-alias-bg-module-platform); }
|
|
609
611
|
/* The daily pane shares the SVG contract above (absolute child, determinate height): a flexed chart
|
|
610
612
|
next to a scrolled column is exactly how the container used to grow. */
|
|
@@ -2001,8 +2003,8 @@ function WatchlistDeskPage({ t }) {
|
|
|
2001
2003
|
const [rowMenu, setRowMenu] = useState(null)
|
|
2002
2004
|
const [trend, setTrend] = useState({ status: 'idle', data: null, code: null, detail: null })
|
|
2003
2005
|
const [kline, setKline] = useState({ status: 'idle', data: null, code: null, detail: null })
|
|
2004
|
-
//
|
|
2005
|
-
const [
|
|
2006
|
+
// Touch has no hover: a tap pins the stats card open until the pointer leaves the box.
|
|
2007
|
+
const [statsPinned, setStatsPinned] = useState(false)
|
|
2006
2008
|
const alive = useRef(true)
|
|
2007
2009
|
|
|
2008
2010
|
useEffect(() => {
|
|
@@ -2306,16 +2308,36 @@ function WatchlistDeskPage({ t }) {
|
|
|
2306
2308
|
? `${trendData.session_date ?? ''} ${t('desk.trendClosed')}${trendZone}`
|
|
2307
2309
|
: `${t('desk.trendPrevious')} ${trendData.session_date ?? ''}${trendZone}`
|
|
2308
2310
|
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2311
|
+
// The six session facts are reference material, not the headline: they live behind one info
|
|
2312
|
+
// button on the title row (hover / focus / tap) instead of eating the width the title and the
|
|
2313
|
+
// session state need. The button carries them as its accessible name, so nothing is lost.
|
|
2314
|
+
const trendFacts = trendData === null ? [] : [
|
|
2315
|
+
[t('desk.trendOpen'), deskNumberText(trendData.open)],
|
|
2316
|
+
[t('desk.trendHigh'), deskNumberText(trendData.high)],
|
|
2317
|
+
[t('desk.trendLow'), deskNumberText(trendData.low)],
|
|
2318
|
+
[t('desk.trendAvg'), deskNumberText(trendData.avg)],
|
|
2319
|
+
[t('desk.trendVolume'), deskVolumeText(trendData.volume, trendData.volume_unit, t)],
|
|
2320
|
+
[t('desk.trendAmount'), deskAmountText(trendData.amount, trendData.currency)],
|
|
2321
|
+
]
|
|
2322
|
+
const trendStats = trendData === null ? null : h('div', {
|
|
2323
|
+
className: statsPinned ? 'cwd-statsbox cwd-statsbox-pinned' : 'cwd-statsbox',
|
|
2324
|
+
onMouseLeave: () => { if (statsPinned) setStatsPinned(false) },
|
|
2325
|
+
},
|
|
2326
|
+
h('button', {
|
|
2327
|
+
type: 'button',
|
|
2328
|
+
className: 'cwd-statsinfo',
|
|
2329
|
+
'aria-label': `${t('desk.stats')}:${trendFacts.map(([label, value]) => `${label} ${value}`).join(',')}`,
|
|
2330
|
+
'aria-expanded': statsPinned ? 'true' : 'false',
|
|
2331
|
+
onClick: () => setStatsPinned(!statsPinned),
|
|
2332
|
+
onKeyDown: (event) => { if (event.key === 'Escape') setStatsPinned(false) },
|
|
2333
|
+
}, h(IconInfoOutlineRegular, { size: 13 })),
|
|
2334
|
+
h('div', { className: 'cwd-statspanel', 'aria-hidden': 'true' },
|
|
2335
|
+
h('div', { className: 'cwd-statscard' },
|
|
2336
|
+
// The session state moved in here with the facts: the title row is the title's.
|
|
2337
|
+
trendNote === '' ? null : h('div', { className: 'cwd-statscap' }, trendNote),
|
|
2338
|
+
h('div', { className: 'cwd-statsgrid' },
|
|
2339
|
+
...trendFacts.map(([label, value]) => h('div', { key: label, className: 'cwd-trendstat' },
|
|
2340
|
+
h('span', null, label), h('span', { title: value }, value)))))))
|
|
2319
2341
|
|
|
2320
2342
|
/**
|
|
2321
2343
|
* One look for both panes when there is nothing to draw: the host's own sentence says what went
|
|
@@ -2389,22 +2411,12 @@ function WatchlistDeskPage({ t }) {
|
|
|
2389
2411
|
h('span', { className: 'cwd-bigprice' }, deskPriceText(detailQuote)),
|
|
2390
2412
|
h('span', { className: `cwd-bigpct ${deskToneOf(detailPct)}` }, deskPctText(detailPct))),
|
|
2391
2413
|
h('div', { className: 'cwd-meta' },
|
|
2392
|
-
h('div', { className: 'cwd-metaitem' }, h('div', { className: 'cwd-metalabel' }, t('desk.capturedAt')), h('div', { className: 'cwd-metavalue' }, detailAt)),
|
|
2393
|
-
|
|
2394
|
-
h('div', { className: trendFolded ? 'cwd-block cwd-block-chart cwd-folded' : 'cwd-block cwd-block-chart' },
|
|
2414
|
+
h('div', { className: 'cwd-metaitem' }, h('div', { className: 'cwd-metalabel' }, t('desk.capturedAt')), h('div', { className: 'cwd-metavalue' }, detailAt)))),
|
|
2415
|
+
h('div', { className: 'cwd-block cwd-block-chart' },
|
|
2395
2416
|
h('div', { className: 'cwd-blockhead' },
|
|
2396
2417
|
h('span', { className: 'cwd-blocktitle' }, t('desk.intraday')),
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
// Two panes in one column: folding the upper one hands the height to the daily pane instead
|
|
2400
|
-
// of pushing the card into a scrollbar.
|
|
2401
|
-
h('button', {
|
|
2402
|
-
type: 'button',
|
|
2403
|
-
className: 'cwd-blockfold',
|
|
2404
|
-
'aria-expanded': trendFolded ? 'false' : 'true',
|
|
2405
|
-
onClick: () => setTrendFolded(!trendFolded),
|
|
2406
|
-
}, trendFolded ? t('desk.unfold') : t('desk.fold'))),
|
|
2407
|
-
trendFolded ? null : trendBody),
|
|
2418
|
+
trendStats),
|
|
2419
|
+
trendBody),
|
|
2408
2420
|
klineBlock))
|
|
2409
2421
|
|
|
2410
2422
|
return h('div', { className: 'cwd-page' },
|
package/watchlist/package.json
CHANGED